/* ==========================================================================
   Shared plumbing: used by every theme.
   Theme files in themes/ only style their own [data-look="…"] selector, so
   each theme starts from this small base rather than undoing the default.
   ========================================================================== */

/* Source Serif 4 (SIL OFL), self-hosted: upright with optical sizes, italic by weight only. */
@font-face {
  font-family: "Source Serif 4 Variable";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("../fonts/source-serif-4-latin-opsz-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4 Variable";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("../fonts/source-serif-4-latin-ext-opsz-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Serif 4 Variable";
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url("../fonts/source-serif-4-latin-wght-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4 Variable";
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url("../fonts/source-serif-4-latin-ext-wght-italic.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button {
  font: inherit;
  color: inherit;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.5rem 0.75rem;
  background: #000;
  color: #fff;
  transform: translateY(-300%);
}

.skip-link:focus {
  transform: none;
}

/* The theme picker only works with JavaScript. */
.themes {
  display: none;
}

.js .themes {
  display: flex;
}

/* site.js collapses long news lists; without JS everything is shown. */
.news[data-collapsed="true"] > li:nth-child(n + 7) {
  display: none;
}

.flags {
  white-space: nowrap;
}

/* Long venue names exist for themes that want them (serious academic). */
.venue-long {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* ==========================================================================
   Default look: quiet, typographic, light or dark.
   ========================================================================== */

[data-look="default"] {
  --serif: "Source Serif 4 Variable", "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;

  --bg: #fcfcfa;
  --ink: #1b1b1e;
  --ink-2: #4d4d53;
  --muted: #7b7a80;
  --rule: #e4e3de;
  --accent: #2341b0;
  --accent-line: rgba(35, 65, 176, 0.32);
  --highlight: #b3321c;
  --selection: rgba(35, 65, 176, 0.16);

  --meta: 8.5rem;
  --gutter: 2.25rem;
  --measure: 43rem;
  --prose: 37rem;
  --date: 5.75rem;

  color-scheme: light;
  background: var(--bg);
}

@media (prefers-color-scheme: dark) {
  [data-theme="default"] {
    --bg: #121314;
    --ink: #e9e7e2;
    --ink-2: #b9b7b1;
    --muted: #8b8a86;
    --rule: #2b2c2f;
    --accent: #a3b5ff;
    --accent-line: rgba(163, 181, 255, 0.38);
    --highlight: #ff9f87;
    --selection: rgba(163, 181, 255, 0.24);
    color-scheme: dark;
  }
}

[data-theme="defaultDark"] {
  --bg: #121314;
  --ink: #e9e7e2;
  --ink-2: #b9b7b1;
  --muted: #8b8a86;
  --rule: #2b2c2f;
  --accent: #a3b5ff;
  --accent-line: rgba(163, 181, 255, 0.38);
  --highlight: #ff9f87;
  --selection: rgba(163, 181, 255, 0.24);
  color-scheme: dark;
}

[data-look="default"] body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.6;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}

[data-theme="defaultDark"] body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (prefers-color-scheme: dark) {
  [data-theme="default"] body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

[data-look="default"] ::selection {
  background: var(--selection);
}

[data-look="default"] a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--accent-line);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 120ms ease, text-decoration-color 120ms ease;
}

[data-look="default"] a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

/* The email link only gets its href from site.js; without JS it is plain text. */
[data-look="default"] a:not([href]) {
  color: var(--muted);
  text-decoration: none;
}

[data-look="default"] :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

[data-look="default"] .page {
  max-width: calc(var(--meta) + var(--gutter) + var(--measure) + 6rem);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 3rem) 3rem;
}

/* Theme picker ----------------------------------------------------------- */

[data-look="default"] .themes {
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: baseline;
  gap: 0.25rem 0.85rem;
  padding: 1.25rem 0;
  color: var(--muted);
  font-size: 0.8rem;
}

[data-look="default"] .themes-label {
  font-style: italic;
}

[data-look="default"] .themes-modes,
[data-look="default"] .themes-looks {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.85rem;
}

[data-look="default"] .themes-modes {
  padding-right: 0.85rem;
  border-right: 1px solid var(--rule);
}

[data-look="default"] .themes button {
  padding: 0.1rem 0;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
}

[data-look="default"] .themes button:hover {
  color: var(--ink);
}

[data-look="default"] .themes button[aria-pressed="true"] {
  color: var(--ink);
  text-decoration-color: currentColor;
}

/* Masthead --------------------------------------------------------------- */

[data-look="default"] .masthead {
  display: grid;
  grid-template-columns: var(--meta) minmax(0, var(--measure));
  column-gap: var(--gutter);
  align-items: start;
  margin: 3.5rem 0 4.5rem;
}

[data-look="default"] .portrait {
  width: var(--meta);
  aspect-ratio: 1;
  border-radius: 2px;
  object-fit: cover;
  filter: saturate(0.9);
}

[data-look="default"] .name {
  margin: -0.35rem 0 0.5rem;
  font-size: clamp(2.3rem, 5vw, 3.15rem);
  font-weight: 560;
  line-height: 1.05;
  letter-spacing: -0.012em;
}

[data-look="default"] .role {
  margin: 0;
  color: var(--ink-2);
  font-size: 1rem;
}

[data-look="default"] .role a {
  color: inherit;
  text-decoration-color: var(--rule);
}

[data-look="default"] .role a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

[data-look="default"] .sep {
  padding: 0 0.3em;
  color: var(--muted);
}

[data-look="default"] .tagline {
  max-width: var(--prose);
  margin: 1.1rem 0 0;
  font-size: 1.3rem;
  line-height: 1.45;
  letter-spacing: -0.003em;
}

[data-look="default"] .flags {
  white-space: nowrap;
  font-size: 0.85em;
}

[data-look="default"] .contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.95rem;
}

[data-look="default"] .contact li + li::before {
  content: "·";
  padding: 0 0.55em;
  color: var(--muted);
}

/* Where the list can wrap, a separator could start a line: use spacing instead. */
@media (max-width: 60rem) {
  [data-look="default"] .contact {
    gap: 0.3rem 1.1rem;
  }

  [data-look="default"] .contact li + li::before {
    content: none;
  }
}

/* Sections --------------------------------------------------------------- */

[data-look="default"] .section {
  display: grid;
  grid-template-columns: var(--meta) minmax(0, var(--measure));
  column-gap: var(--gutter);
  margin-top: 3.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
}

[data-look="default"] .section > h2,
[data-look="default"] .section-head {
  grid-column: 1;
}

[data-look="default"] .section-body {
  grid-column: 2;
}

[data-look="default"] .section h2 {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.8rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

[data-look="default"] .section-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
}

[data-look="default"] .prose p {
  max-width: var(--prose);
  margin: 0 0 1em;
}

[data-look="default"] .prose p:last-child {
  margin-bottom: 0;
}

/* News ------------------------------------------------------------------- */

[data-look="default"] .news {
  display: grid;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

[data-look="default"] .news li {
  display: grid;
  grid-template-columns: var(--date) minmax(0, 1fr);
  column-gap: 1.25rem;
}

[data-look="default"] .news time,
[data-look="default"] .pub-year h3 {
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums lining-nums;
  line-height: 1.8rem;
  white-space: nowrap;
}

[data-look="default"] .news p {
  margin: 0;
}

[data-look="default"] .news-toggle {
  margin: 1rem 0 0 calc(var(--date) + 1.25rem);
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

[data-look="default"] .news-toggle:hover {
  text-decoration-color: currentColor;
}

/* Publications ----------------------------------------------------------- */

[data-look="default"] .pub-year {
  display: grid;
  grid-template-columns: var(--date) minmax(0, 1fr);
  column-gap: 1.25rem;
}

[data-look="default"] .pub-year + .pub-year {
  margin-top: 1.5rem;
}

[data-look="default"] .pub-year h3 {
  margin: 0;
  font-weight: 400;
}

[data-look="default"] .pubs {
  display: grid;
  gap: 1.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

[data-look="default"] .pub {
  display: flex;
  flex-direction: column;
}

[data-look="default"] .pub-title {
  color: var(--ink);
  font-weight: 580;
  line-height: 1.4;
  text-decoration-color: transparent;
}

[data-look="default"] .pub-title:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

[data-look="default"] .pub-authors {
  margin-top: 0.2rem;
  color: var(--ink-2);
  font-size: 0.95rem;
  line-height: 1.45;
}

[data-look="default"] .pub-authors strong {
  color: var(--ink);
  font-weight: 600;
}

[data-look="default"] .pub-venue {
  color: var(--muted);
  font-size: 0.95rem;
  font-style: italic;
  line-height: 1.45;
}

[data-look="default"] .pub-note {
  margin-left: 0.35em;
  color: var(--highlight);
  font-style: normal;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Colophon --------------------------------------------------------------- */

[data-look="default"] .colophon {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  margin-top: 4.5rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9rem;
}

[data-look="default"] .colophon p {
  margin: 0;
}

[data-look="default"] .colophon a {
  color: inherit;
  text-decoration-color: var(--rule);
}

[data-look="default"] .colophon a:hover {
  color: var(--ink);
  text-decoration-color: currentColor;
}

/* 404 -------------------------------------------------------------------- */

[data-look="default"] .not-found {
  max-width: var(--prose);
  margin: 22vh 0 0 calc(var(--meta) + var(--gutter));
}

[data-look="default"] .not-found-code {
  margin: 0 0 0.6rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.09em;
}

[data-look="default"] .not-found h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 5vw, 2.6rem);
  font-weight: 560;
  line-height: 1.1;
}

[data-look="default"] .not-found p {
  margin: 0;
}

[data-look="default"] .not-found-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

/* Small screens ---------------------------------------------------------- */

@media (max-width: 46rem) {
  [data-look="default"] body {
    font-size: 1.0625rem;
  }

  [data-look="default"] .themes {
    justify-content: flex-start;
  }

  [data-look="default"] .masthead,
  [data-look="default"] .section {
    grid-template-columns: minmax(0, 1fr);
  }

  [data-look="default"] .masthead {
    margin: 1.5rem 0 3rem;
  }

  [data-look="default"] .portrait {
    width: 5.5rem;
    margin-bottom: 1.25rem;
  }

  [data-look="default"] .section > h2,
  [data-look="default"] .section-head,
  [data-look="default"] .section-body {
    grid-column: 1;
  }

  [data-look="default"] .section-head,
  [data-look="default"] .section > h2 {
    margin-bottom: 0.75rem;
  }

  [data-look="default"] .section-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
  }

  [data-look="default"] .news li,
  [data-look="default"] .pub-year {
    grid-template-columns: minmax(0, 1fr);
  }

  [data-look="default"] .news time,
  [data-look="default"] .pub-year h3 {
    line-height: 1.5;
  }

  [data-look="default"] .pub-year h3 {
    margin-bottom: 0.4rem;
    color: var(--ink);
    font-weight: 600;
  }

  [data-look="default"] .news-toggle {
    margin-left: 0;
  }

  [data-look="default"] .not-found {
    margin: 14vh 0 0;
  }
}

/* Print ------------------------------------------------------------------ */

@media print {
  .themes,
  .skip-link,
  .news-toggle,
  [data-extra] {
    display: none !important;
  }

  .news[data-collapsed="true"] > li:nth-child(n + 7) {
    display: grid;
  }
}
