/* ------------------------------------------------------------------
   Economics of Generative AI — NeurIPS 2026 Tutorial
   Palette: ledger-green paper, ballpoint-blue rule, single stamp red.
   Type:    Spectral (prose) + Archivo (programme, navigation, metadata)
   ------------------------------------------------------------------ */

/* Fonts served from this host. No external request, per the MPI web rules.
   Drop the seven .woff2 files into assets/fonts/ using exactly these names. */

@font-face { font-family: "Spectral"; font-style: normal; font-weight: 400;
  src: url("../fonts/spectral-400.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Spectral"; font-style: italic; font-weight: 400;
  src: url("../fonts/spectral-400-italic.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Spectral"; font-style: normal; font-weight: 500;
  src: url("../fonts/spectral-500.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Spectral"; font-style: normal; font-weight: 600;
  src: url("../fonts/spectral-600.woff2") format("woff2"); font-display: swap; }

@font-face { font-family: "Archivo"; font-style: normal; font-weight: 400;
  src: url("../fonts/archivo-400.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 500;
  src: url("../fonts/archivo-500.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 600;
  src: url("../fonts/archivo-600.woff2") format("woff2"); font-display: swap; }

:root {
  --ledger:    #e9eee4;
  --ledger-2:  #f2f6ee;
  --paper:     #fcfdfa;
  --ink:       #16221d;
  --ink-soft:  #4a5a52;
  --rule:      #c6d2c0;
  --rule-soft: #dae3d5;
  --blue:      #1b3b6f;
  --blue-soft: #365c93;
  --stamp:     #9e3b2e;

  --serif: "Spectral", Georgia, "Times New Roman", serif;
  --sans:  "Archivo", "Helvetica Neue", Arial, sans-serif;

  --measure: 34rem;      /* ~68 characters of Spectral */
  --page:    72rem;
  --gutter:  clamp(1.25rem, 4vw, 3.5rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ledger:    #131a17;
    --ledger-2:  #18211d;
    --paper:     #1b2521;
    --ink:       #e5ebe3;
    --ink-soft:  #9cafa4;
    --rule:      #2f3c36;
    --rule-soft: #26312c;
    --blue:      #93b8ea;
    --blue-soft: #b3cef3;
    --stamp:     #d98a78;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ledger);
  color: var(--ink);
  font: 400 1.0625rem/1.68 var(--serif);
  font-variant-numeric: oldstyle-nums proportional-nums;
  text-rendering: optimizeLegibility;
}

/* ---------- typographic scale ---------- */

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -0.012em;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: clamp(2.4rem, 6.4vw, 4rem); letter-spacing: -0.022em; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.1rem); }
h3 { font-size: 1.3125rem; line-height: 1.28; }
h4 { font-size: 1.0625rem; font-weight: 600; }

p { margin: 0 0 1.1em; max-width: var(--measure); }

a { color: var(--blue); text-underline-offset: 0.16em; text-decoration-thickness: from-font; }
a:hover { color: var(--stamp); }
a:focus-visible,
summary:focus-visible,
.skip:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: var(--blue); color: var(--ledger-2); }

.skip {
  position: absolute; left: -9999px;
  background: var(--paper); color: var(--ink);
  padding: 0.6rem 1rem; z-index: 99;
}
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- layout shell ---------- */

.wrap {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

section { padding-block: clamp(3rem, 7vw, 5.25rem); }
section + section { border-top: 1px solid var(--rule-soft); }

.section-head { margin-bottom: 2.25rem; }
.section-head p { color: var(--ink-soft); margin-bottom: 0; }
.section-head h2 { margin-bottom: 0.5rem; }

/* ---------- masthead ---------- */

.masthead {
  position: relative;
  background: var(--ledger-2);
  border-bottom: 1px solid var(--rule);
  padding-block: clamp(3rem, 8vw, 5.5rem) clamp(2rem, 5vw, 3rem);
  overflow: hidden;
}

.masthead .wrap { position: relative; }
.masthead h1 { max-width: 15ch; }

.masthead__sub {
  font-family: var(--sans);
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--blue);
  margin: 0.75rem 0 1.5rem;
  letter-spacing: 0.005em;
}

.standfirst {
  font-size: clamp(1.125rem, 2vw, 1.3125rem);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 38rem;
}

/* ---------- fact list ---------- */

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0;
  margin: 2.5rem 0 0;
  border-top: 1px solid var(--rule);
}
.facts > div {
  padding: 0.9rem 1.25rem 0.9rem 0;
  border-bottom: 1px solid var(--rule-soft);
}
.facts dt {
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 0.2rem;
}
.facts dd { margin: 0; font-size: 1rem; }

/* ---------- lifecycle figure ---------- */

.masthead__diagram {
  margin: clamp(2.5rem, 6vw, 4rem) 0 0;
  display: flex;
  align-items: flex-start;
  gap: clamp(1.5rem, 4vw, 3rem);
  flex-wrap: wrap;
}
.masthead__diagram .lifecycle { margin-top: 0; flex: 4 1 42rem; min-width: 0; }
.masthead__diagram .callout { flex: 1 1 12rem; margin-top: 0; }
.masthead__diagram .callout h4 { font-size: 0.9375rem; }
.masthead__diagram .callout p { font-size: 0.875rem; line-height: 1.55; }

.lifecycle { margin: clamp(2.5rem, 6vw, 4rem) 0 0; }
.lifecycle svg { display: block; width: 100%; height: auto; }
.lifecycle figcaption {
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--ink-soft);
  margin-top: 0.75rem;
  max-width: 40rem;
}

.lc-line   { stroke: var(--rule); stroke-width: 1.5; }
.lc-flow   { stroke: var(--blue); stroke-width: 1.5; fill: none; }
.lc-flow--faint { stroke: var(--blue-soft); stroke-dasharray: 5 4; }
.lc-node   { fill: var(--ledger-2); stroke: var(--blue); stroke-width: 2; }
.lc-glyph  { stroke: var(--ink); stroke-width: 1.6; fill: none; }
.lc-glyph--fill { fill: var(--ink); stroke: none; }
.lc-title  { font: 500 22px var(--sans); fill: var(--ink); }
.lc-meta   { font: 400 16px var(--sans); fill: var(--ink-soft); }
.lc-label  { font: 400 13px var(--sans); fill: var(--blue-soft); }
.lc-station { cursor: pointer; }
.lc-title { text-decoration: underline dotted; text-underline-offset: 5px; text-decoration-color: var(--rule); }
.lc-hit { fill: var(--blue); opacity: 0; transition: opacity 0.16s ease; }
.lc-station:hover .lc-hit { opacity: 0.055; }
.lc-station:hover .lc-title { fill: var(--blue); text-decoration-color: var(--blue); }
.lc-station:hover .lc-node  { fill: var(--blue); }
.lc-station:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
.lc-mover { fill: var(--blue); stroke: var(--ledger-2); stroke-width: 2; opacity: 0; }

/* one orchestrated page-load moment: the flows draw themselves */
@media (prefers-reduced-motion: no-preference) {
  .lc-flow { stroke-dasharray: 900; stroke-dashoffset: 900; animation: draw 1.5s 0.35s ease-out forwards; }
  .lc-flow--faint { animation-delay: 1.1s; }
  .lc-station { opacity: 0; animation: settle 0.5s ease-out forwards; }
  .lc-station:nth-of-type(1) { animation-delay: 0.05s; }
  .lc-station:nth-of-type(2) { animation-delay: 0.2s; }
  .lc-station:nth-of-type(3) { animation-delay: 0.35s; }
  .lc-mover { animation: reveal 0.7s 1.7s ease-out forwards; }
  @keyframes reveal { to { opacity: 1; } }
  @keyframes draw   { to { stroke-dashoffset: 0; } }
  @keyframes settle { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}

/* ---------- sticky navigation ---------- */

.subnav {
  position: sticky; top: 0; z-index: 20;
  background: var(--ledger);
  background: color-mix(in srgb, var(--ledger) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.subnav ul {
  display: flex; gap: clamp(1rem, 3vw, 2rem);
  justify-content: space-between;
  margin: 0; padding: 0; list-style: none;
  overflow-x: auto; scrollbar-width: none;
}
.subnav ul::-webkit-scrollbar { display: none; }
.subnav a {
  display: block;
  padding: 0.85rem 0;
  font-family: var(--sans);
  font-size: 0.9375rem;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.subnav a:hover { color: var(--ink); }
.subnav a[aria-current="true"] { color: var(--ink); border-bottom-color: var(--blue); }

/* ---------- programme ---------- */

.part {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 0 2.5rem;
  padding-block: 2.25rem;
  border-top: 1px solid var(--rule-soft);
}
.part:first-of-type { border-top: 1px solid var(--rule); }
@media (max-width: 704px) { .part { grid-template-columns: 1fr; gap: 0.75rem; } }

.part__slug { font-family: var(--sans); font-size: 0.9375rem; line-height: 1.5; }
.part__slug b {
  display: block;
  font-size: 1.0625rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.part__slug span { display: block; color: var(--ink-soft); }
.part__slug em { display: block; font-style: normal; color: var(--blue); }

.part h3 { margin-bottom: 0.75rem; }
.part-icon {
  display: inline-block;
  height: 0.75em;
  width: auto;
  margin-right: 0.55em;
  vertical-align: -0.05em;
  fill: var(--ink);
}
.part p:last-child { margin-bottom: 0; }

.threads { margin: 1.25rem 0 0; padding: 0; list-style: none; max-width: var(--measure); }
.threads li {
  padding: 0.45rem 0 0.45rem 1.25rem;
  border-top: 1px solid var(--rule-soft);
  font-size: 1rem;
  position: relative;
}
.threads li::before {
  content: "";
  position: absolute; left: 0; top: 1.1em;
  width: 0.5rem; height: 1px;
  background: var(--blue);
}

/* ---------- panel ---------- */

.people {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 2rem clamp(1.5rem, 4vw, 3rem);
  margin-top: 2rem;
}
.person__photo, .person__initials {
  width: 5.5rem; height: 5.5rem;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 0.9rem;
  background: var(--ledger-2);
  border: 1px solid var(--rule);
}
.person__initials {
  display: grid; place-content: center;
  font-family: var(--sans); font-size: 1.375rem; font-weight: 500;
  color: var(--blue);
}
.people--roster { gap: 1.75rem clamp(1.5rem, 4vw, 3rem); }
.people--roster .person { border-top: 1px solid var(--rule); padding-top: 1rem; }

.person h3 { margin-bottom: 0.2rem; }
.person__affil {
  font-family: var(--sans);
  font-size: 0.9375rem;
  color: var(--ink-soft);
  margin-bottom: 0.7rem;
}
.person p { font-size: 1rem; }
.person__links {
  font-family: var(--sans);
  font-size: 0.875rem;
  display: flex; flex-wrap: wrap; gap: 0.9rem;
  margin-top: 0.6rem;
}

/* ---------- materials ---------- */

.materials { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); max-width: 52rem; }
.materials li {
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: 0.5rem 1rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--rule-soft);
}
.materials li > span:first-child { flex: 1 1 18rem; }
.materials .dl { font-family: var(--sans); font-size: 0.9375rem; }
.pending {
  font-family: var(--sans); font-size: 0.8125rem;
  color: var(--ink-soft);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
}

.callout {
  border-left: 2px solid var(--blue);
  padding: 0.25rem 0 0.25rem 1.25rem;
  margin: 2.25rem 0 0;
  max-width: var(--measure);
}
.callout p:last-child { margin-bottom: 0; }

/* ---------- references ---------- */

.refgroup { border-top: 1px solid var(--rule-soft); }
.refgroup:first-of-type { border-top: 1px solid var(--rule); }
.refgroup > summary {
  display: flex; align-items: baseline; gap: 0.75rem;
  padding: 0.95rem 0;
  cursor: pointer;
  list-style: none;
  font-family: var(--sans);
  font-size: 1.0625rem;
  font-weight: 500;
}
.refgroup > summary::-webkit-details-marker { display: none; }
.refgroup > summary::before {
  content: "+";
  font-size: 1.125rem;
  color: var(--blue);
  width: 0.9rem;
  transition: transform 0.18s ease;
}
.refgroup[open] > summary::before { content: "\2212"; }
.refgroup > summary .count {
  margin-left: auto;
  font-size: 0.875rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}
.refgroup > summary:hover { color: var(--blue); }

.refgroup ol {
  margin: 0 0 1.5rem;
  padding: 0 0 0 1.75rem;
  max-width: 48rem;
  font-size: 0.9875rem;
  line-height: 1.6;
}
.refgroup li { margin-bottom: 0.55rem; }
.refgroup li cite { font-style: italic; color: var(--ink-soft); }
.refpart {
  font-family: var(--sans);
  font-size: 0.9375rem;
  color: var(--ink-soft);
  margin: 2.5rem 0 0.5rem;
  display: flex;
  align-items: center;
  cursor: pointer;
  list-style: none;
}
.refpart-group:first-of-type > .refpart { margin-top: 0; }
.refpart::-webkit-details-marker { display: none; }
.refpart::after {
  content: "+";
  margin-left: auto;
  padding-left: 1rem;
  font-size: 1.0625rem;
  color: var(--blue);
}
.refpart-group[open] > .refpart::after { content: "\2212"; }
.refpart:hover { color: var(--ink); }
.refpart-icon {
  display: inline-block;
  height: 0.8em;
  width: auto;
  margin-left: 0.55em;
  vertical-align: -0.05em;
  fill: var(--ink-soft);
}

/* ---------- external-link marker ---------- */
/* The arrow itself comes from the MPI CDN stylesheet, which sets it as a fixed
   background image. Two adjustments it does not make: sit it on the baseline,
   and keep it visible against the dark palette. */

a.mpi_external_links::after { vertical-align: -0.05em; }

@media (prefers-color-scheme: dark) {
  a.mpi_external_links::after { filter: invert(1); opacity: 0.7; }
}

/* ---------- footer ---------- */

.foot {
  border-top: 1px solid var(--rule);
  background: var(--ledger-2);
  padding-block: 2.5rem 3.5rem;
  font-family: var(--sans);
  font-size: 0.9375rem;
  color: var(--ink-soft);
}
.foot ul { display: flex; flex-wrap: wrap; gap: 1.5rem; list-style: none; margin: 0 0 1rem; padding: 0; }
.foot p { max-width: 42rem; margin: 0; }
