/* ============================================================
   Ferrite — Enspirit skin
   Brand tokens from enspirit-website/tailwind.config.mjs
   ============================================================ */
@font-face { font-family:'Reckless'; src:url('/fonts/RecklessGX.woff2'); font-weight:380 400; font-style:normal; font-display:swap; }
@font-face { font-family:'Reckless'; src:url('/fonts/RecklessItalicGX.woff2'); font-weight:380 400; font-style:italic; font-display:swap; }
@font-face { font-family:'DMSans'; src:url('/fonts/DMSans-VariableFont_opsz,wght.ttf'); font-weight:400 500; font-style:normal; font-display:swap; }
@font-face { font-family:'DMSans'; src:url('/fonts/DMSans-Italic-VariableFont_opsz,wght.ttf'); font-weight:400 500; font-style:italic; font-display:swap; }

:root {
  --ink:        #110e25;
  --paper:      #fff6e5;
  --yellow:     #ffee7f;
  --green:      #18bf97;
  --orange:     #f7a336;
  --blue:       #728dee;
  --lightBlue:  #b4c7fd;
  --melon:      #f5cab2;
  --red:        #eb3f5e;
  --hairline:   #110e2533;
  --ink-soft:   #110e25b3;
  --code-bg:    #110e250a;
  --serif: 'Reckless', Georgia, serif;
  --sans:  'DMSans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --mono:  ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-weight: 400; font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 78rem; margin: 0 auto; padding: 0 2rem; }
.narrow { max-width: 44rem; }
/* `.wrap.narrow` must stay the full container: it is the CHILDREN that are
   constrained, so every section aligns on the same left edge instead of the
   reading column being centred while full-width sections are not. */
.wrap.narrow { max-width: 78rem; }
.wrap.narrow > * { max-width: 44rem; }

a { color: var(--ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); text-decoration-color: var(--orange); }

/* ---------- display type ---------- */
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.005em; line-height: 1.12; }
h2 { font-size: clamp(1.75rem, 2.6vw, 2.4rem); margin: 0 0 1rem; max-width: 24ch; }
h3 { font-family: var(--sans); font-weight: 500; font-size: 1.05rem; line-height: 1.35; margin: 0 0 0.35rem; letter-spacing: 0; }
p { margin: 0 0 1.05rem; }

.eyebrow {
  font-family: var(--sans); font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink);
  margin: 0 0 1.1rem; display: flex; align-items: center; gap: 0.55rem;
}
.eyebrow::before {
  content: ''; width: 0; height: 0; flex: none;
  border-left: 7px solid var(--orange);
  border-top: 5px solid transparent; border-bottom: 5px solid transparent;
}
.lede { font-size: 1.15rem; line-height: 1.55; color: var(--ink); }

/* ---------- section rhythm ---------- */
section { padding: 3.2rem 0 3.6rem; }
section > .wrap > .eyebrow:first-child {
  padding-top: 2rem; border-top: 1px solid var(--ink); max-width: none;
}
.band-blue { background: var(--lightBlue); }
.band-dark, .closing { background: var(--ink); color: var(--paper); }
.band-dark .eyebrow, .band-dark h2, .band-dark a,
.closing .eyebrow, .closing h2, .closing a { color: var(--paper); }
.band-dark .lede, .closing .lede { color: #fff6e5cc; }

/* ---------- masthead ---------- */
header.masthead {
  padding: 1.5rem 0; display: flex; align-items: center;
  justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.brand { display: flex; align-items: baseline; gap: 0.7rem; }
.brand b { font-family: var(--serif); font-weight: 400; font-size: 1.5rem; }
.brand span { font-size: 0.78rem; color: var(--ink-soft); }
.mast-right { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.badge {
  font-size: 0.72rem; letter-spacing: 0.04em; border: 1px solid var(--ink);
  border-radius: 999px; padding: 0.4rem 0.9rem; background: transparent;
}
.badge b { font-weight: 500; }
.lang { font-size: 0.78rem; letter-spacing: 0.06em; }
.lang a { text-decoration: none; opacity: 0.55; }
.lang a[aria-current] { opacity: 1; font-weight: 500; }
.dot { color: var(--orange); }

/* ---------- Enspirit site header ---------- */
.site-header { background: var(--paper); }
.site-header > .wrap {
  position: relative;
  height: 4.5rem; display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
}
/* the rule is drawn inside the padding box so it lines up with every section
   separator; a border-bottom here would run 2rem wider on each side */
.site-header > .wrap::after {
  content: ''; position: absolute; left: 2rem; right: 2rem; bottom: 0;
  height: 2px; background: var(--ink);
}
.site-header .logo { display: block; line-height: 0; }
.site-header .logo img { height: 1.75rem; width: auto; max-width: 11rem; display: block; }
.site-header nav { display: flex; align-items: center; gap: 1.5rem; }
.hdr-pill {
  display: inline-flex; align-items: center; gap: 0.45rem;
  border: 1px solid var(--ink); border-radius: 999px; padding: 0.35rem 1rem;
  font-size: 0.88rem; font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: background .25s, color .25s;
}
.hdr-pill:hover { background: var(--ink); color: var(--paper); }
.hdr-pill svg { width: 1rem; height: 1rem; flex: none; }
@media (max-width: 40rem) {
  .site-header > .wrap { height: 4rem; }
  .site-header nav { gap: 1rem; }
  .hdr-pill { padding: 0.35rem 0.7rem; }
  .hdr-pill span { display: none; }
}

/* ---------- partners ---------- */
.partners {
  list-style: none; padding: 1.8rem 0 0; margin: 2rem 0 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 2.4rem 2rem;
  border-top: 1px solid var(--ink);
}
.partners li { display: flex; flex-direction: column; min-width: 0; }
/* the slot is sized for a stacked lockup; horizontal logos are capped lower so
   the four marks carry comparable visual weight rather than equal height */
.partners .mark { height: 4.4rem; display: flex; align-items: center; margin-bottom: 0.9rem; }
.partners .mark a {
  display: flex; align-items: center; height: 100%; max-width: 100%;
  text-decoration: none; transition: opacity .15s ease;
}
.partners .mark a:hover { opacity: 0.6; }
.partners .mark img { height: auto; max-height: 1.85rem; max-width: 100%; width: auto; display: block; }
.partners .mark.tall img { max-height: 4.4rem; }
.partners .mark .wordmark { font-family: var(--serif); font-size: 1.4rem; line-height: 1; }
.partners .role-tag {
  font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 0.45rem;
}
.partners p { font-size: 0.9rem; line-height: 1.55; color: var(--ink-soft); margin: 0; }
.partners p a { color: var(--ink); text-decoration-color: var(--orange); }
.partners p a:hover { color: var(--orange); }
.partners .todo { color: var(--red); }
@media (max-width: 64rem) { .partners { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 36rem) { .partners { grid-template-columns: 1fr; gap: 1.8rem; } }

/* the melon callout becomes a full-bleed band so its text aligns with every
   other section instead of being inset by the card padding */
.band-melon { background: var(--melon); }
.band-melon .opportunity { background: none; padding: 0; }

/* ---------- hero : text left, contents right ---------- */
.hero { padding: 2.6rem 2rem 4rem; }  /* keep .wrap's side padding: a 0 here widened
   the hero by 2rem on each side relative to every section */
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(16rem, 0.85fr); gap: 3.5rem; align-items: start; }
.hero h1 { font-size: clamp(2rem, 4vw, 3.1rem); margin: 0.6rem 0 1.4rem; max-width: 20ch; }
.hero .lede { max-width: 56ch; font-size: 1.2rem; }

.central {
  margin-top: 1.9rem; max-width: 54ch; padding: 1.3rem 1.5rem;
  background: var(--yellow); border-radius: 2px;
}
.central .label {
  display: block; font-size: 0.7rem; letter-spacing: 0.12em;
  text-transform: uppercase; margin-bottom: 0.5rem; font-weight: 500;
}
.central { font-family: var(--serif); font-size: 1.18rem; line-height: 1.4; }
.central .label { font-family: var(--sans); }

.frame { margin-top: 1.8rem; font-size: 0.95rem; color: var(--ink-soft); max-width: 56ch; }
.frame b { color: var(--ink); font-weight: 500; }

/* table of contents */
.toc { position: sticky; top: 1.5rem; }
.toc-title {
  font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
  font-weight: 500; padding-bottom: 0.8rem; border-bottom: 1px solid var(--ink); margin: 0;
}
.toc ol { list-style: none; counter-reset: toc; padding: 0; margin: 0; }
.toc li { counter-increment: toc; border-bottom: 1px solid var(--hairline); }
.toc a {
  display: grid; grid-template-columns: 2rem 1fr; gap: 0.5rem; align-items: baseline;
  padding: 0.7rem 0; text-decoration: none; font-size: 0.93rem; transition: color .12s;
}
.toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--mono); font-size: 0.7rem; color: var(--orange);
}
.toc a:hover { color: var(--ink); }
.toc a:hover span { text-decoration: underline; text-decoration-color: var(--orange); }
.toc .meta { display: block; font-size: 0.78rem; color: var(--ink-soft); margin-top: 0.1rem; }

@media (max-width: 62rem) {
  .hero-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .toc { position: static; }
}

/* ---------- buttons (Enspirit pill) ---------- */
.cta-row { display: flex; gap: 1.1rem; flex-wrap: wrap; margin-top: 2.2rem; }
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 0.55rem;
  border: 1px solid var(--ink); border-radius: 999px;
  padding: 0.6rem 1.25rem 0.6rem 2.3rem;
  background-color: transparent;
  /* the Enspirit cap, drawn as a background disc so it can never paint over
     the label the way a negative-z-index pseudo-element does */
  background-image: radial-gradient(circle at 1.15rem 50%, var(--ink) 0.72rem, transparent 0.73rem);
  background-repeat: no-repeat;
  color: var(--ink); text-decoration: none;
  font-size: 0.95rem; font-weight: 500;
  transition: background-color .2s ease, color .2s ease;
}
.btn::after { content: '→'; font-size: 0.95rem; }
.btn:hover { background-color: var(--ink); color: var(--paper); }
.band-dark .btn, .closing .btn {
  border-color: var(--paper); color: var(--paper);
  background-image: radial-gradient(circle at 1.15rem 50%, var(--paper) 0.72rem, transparent 0.73rem);
}
.band-dark .btn:hover, .closing .btn:hover { background-color: var(--paper); color: var(--ink); }

/* ---------- three strands ---------- */
.band { padding-bottom: 3rem; }
.strands {
  list-style: none; counter-reset: s; padding: 1.6rem 0 0; margin: 0;
  border-top: 1px solid var(--ink);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem;
}
.strands li { font-size: 0.95rem; color: var(--ink-soft); line-height: 1.55; }
.strands li::before {
  counter-increment: s; content: counter(s, decimal-leading-zero);
  display: block; font-family: var(--mono); font-size: 0.72rem; color: var(--orange); margin-bottom: 0.5rem;
}
.strands b { display: block; color: var(--ink); font-weight: 500; font-size: 1rem; margin-bottom: 0.3rem; }
@media (max-width: 48rem) { .strands { grid-template-columns: 1fr; gap: 1.4rem; } }

/* ---------- prose accents ---------- */
.pull {
  font-family: var(--serif); font-size: 1.45rem; line-height: 1.35;
  margin: 2.2rem 0; padding-left: 1.4rem; border-left: 3px solid var(--orange);
}
.shifts { margin: 2.2rem 0 0; }
.shift {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 1.2rem; align-items: center;
  padding: 1rem 0; border-top: 1px solid var(--hairline);
}
.shift:last-child { border-bottom: 1px solid var(--hairline); }
.shift .from { color: var(--ink-soft); }
.shift .to { font-weight: 500; }
.shift .arrow { color: var(--orange); }
@media (max-width: 42rem) {
  .shift { grid-template-columns: 1fr; gap: 0.2rem; }
  .shift .arrow { display: none; }
  .shift .to::before { content: '→ '; color: var(--orange); }
}

/* media is allowed a wider measure than the prose */
.wrap.narrow > figure,
.wrap.narrow > .stage,
.wrap.narrow > pre,
.wrap.narrow > .film { max-width: 68rem; }
figure > pre { width: 100%; }

/* ---------- code ---------- */
pre {
  background: var(--ink); color: #fff6e5; border-radius: 4px;
  padding: 1.4rem 1.5rem; overflow-x: auto; margin: 1.6rem 0;
  font-family: var(--mono); font-size: 0.8rem; line-height: 1.65;
}
code { font-family: var(--mono); font-size: 0.88em; }
p code, li code, td code, .qa code {
  background: var(--code-bg); border-radius: 3px; padding: 0.08em 0.35em; font-size: 0.85em;
}
.tok-str  { color: #f5cab2; }
.tok-kw   { color: var(--orange); }
.tok-type { color: var(--lightBlue); }
.tok-num  { color: var(--green); }
.tok-com  { color: #fff6e566; font-style: italic; }
figcaption { font-size: 0.88rem; color: var(--ink-soft); margin: -0.9rem 0 1.8rem; }
figure { margin: 0; }

/* ---------- derived-form list ---------- */
.derive { list-style: none; padding: 0; margin: 1.6rem 0; }
.derive li {
  display: grid; grid-template-columns: 8rem 1fr; gap: 0.5rem 1.2rem;
  padding: 0.7rem 0; border-top: 1px solid var(--hairline); align-items: baseline; font-size: 0.95rem;
}
.derive li:last-child { border-bottom: 1px solid var(--hairline); }
.derive code { background: none; padding: 0; color: var(--ink); font-weight: 500; }
@media (max-width: 36rem) { .derive li { grid-template-columns: 1fr; gap: 0.15rem; } }

/* ---------- numbered steps ---------- */
.step {
  display: grid; grid-template-columns: 2.4rem 1fr; gap: 0 1rem; align-items: baseline;
  margin: 2.8rem 0 1rem; padding-top: 1.5rem; border-top: 1px solid var(--hairline);
}
.step .num { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; color: var(--orange); }
.step h3 { font-family: var(--serif); font-weight: 400; font-size: 1.45rem; margin: 0; }
.step + p { margin-left: 3.4rem; }
.wrap.narrow > figure.stage--strip { max-width: 60rem; }
@media (max-width: 40rem) {
  .step { grid-template-columns: 1fr; gap: 0.2rem; }
  .step + p { margin-left: 0; }
}

/* ---------- exists / to build ---------- */
.ledger { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; margin: 2rem 0 2.6rem; }
/* the band behind this is light blue, where brand green and orange sit around
   1.3:1 against it; the two columns are told apart by fill, not by hue */
.ledger .col-title {
  display: inline-block; font-family: var(--mono); font-size: 0.66rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.32rem 0.8rem; border-radius: 999px;
  border: 1px solid var(--ink); margin: 0 0 0.9rem;
}
.ledger .done .col-title { background: var(--paper); color: var(--ink); }
.ledger .todo .col-title { background: var(--ink); color: var(--paper); }
.ledger ul { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--ink); }
.ledger li { padding: 0.85rem 0; border-bottom: 1px solid var(--hairline); font-size: 0.93rem; color: var(--ink-soft); line-height: 1.5; }
.ledger b { display: block; color: var(--ink); font-weight: 500; }
@media (max-width: 48rem) { .ledger { grid-template-columns: 1fr; gap: 1.6rem; } }

/* ---------- screenshots ---------- */
.stage { background: var(--ink); border-radius: 4px; padding: 0.5rem; margin: 1.8rem 0 0.8rem; }
.stage img { display: block; width: 100%; height: auto; border-radius: 2px; }
/* a portrait screenshot must not take the full media measure; the selector has to
   out-specify `.wrap.narrow > figure`, which sets 68rem further down */
.wrap.narrow > figure.stage--form { max-width: 34rem; }
.shot-note { font-size: 0.9rem; color: var(--ink-soft); margin: 0.8rem 0 2.4rem; }
.shot-note b { color: var(--ink); font-weight: 500; }
.band-blue .shot-note { color: #110e25cc; }
.film { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.8rem; margin: 1.8rem 0 0.8rem; }
.film img { display: block; width: 100%; height: auto; border-radius: 2px; }
.film figcaption {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-soft); margin: 0.5rem 0 0;
}
.film figure { margin: 0; }
@media (max-width: 44rem) { .film { grid-template-columns: repeat(2, 1fr); } }

/* ---------- opportunity (melon callout) ---------- */
.opportunity { background: var(--melon); border-radius: 4px; padding: 3rem 3.2rem; }
.opportunity h2 { margin-bottom: 1rem; }
.opportunity > p { max-width: 48rem; }
.examples {
  list-style: none; padding: 0; margin: 1.8rem 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 0 2.5rem;
}
.examples li { padding: 0.65rem 0; border-top: 1px solid #110e2526; font-size: 0.95rem; }
.examples b { display: block; font-weight: 500; }
.examples span { color: #110e25b3; }
@media (max-width: 44rem) { .opportunity { padding: 1.8rem 1.5rem; } }

/* ---------- research accordion ---------- */
.qlist { margin-top: 2.4rem; border-top: 1px solid var(--ink); max-width: 60rem; }
.q { border-bottom: 1px solid var(--hairline); }
.q > summary {
  list-style: none; cursor: pointer; display: grid;
  grid-template-columns: 3.4rem 1fr 2rem; align-items: center; gap: 0 1rem; padding: 1.2rem 0;
}
.q > summary::-webkit-details-marker { display: none; }
.q > summary::after {
  content: '+'; justify-self: end; width: 1.9rem; height: 1.9rem; border-radius: 999px;
  border: 1px solid var(--ink); display: grid; place-items: center;
  font-family: var(--sans); font-size: 1rem; line-height: 1; transition: background .15s, color .15s;
}
.q[open] > summary::after { content: '–'; background: var(--ink); color: var(--paper); }
.q > summary:hover::after { background: var(--ink); color: var(--paper); }
.q > summary:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.q .n { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; color: var(--orange); }
.q .qt { font-family: var(--serif); font-weight: 400; font-size: 1.28rem; line-height: 1.25; }
.qa { padding: 0 3rem 1.6rem 4.4rem; }
.qa p { margin: 0; color: var(--ink-soft); font-size: 0.97rem; }
.qa .field {
  display: block; margin-top: 1rem; padding-top: 0.7rem; border-top: 1px solid var(--hairline);
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-soft);
}
@media (max-width: 40rem) {
  .q > summary { grid-template-columns: 1fr 2rem; row-gap: 0.3rem; }
  .q .n { grid-row: 1; grid-column: 1; }
  .q .qt { grid-row: 2; grid-column: 1; font-size: 1.12rem; }
  .q > summary::after { grid-row: 1 / span 2; }
  .qa { padding: 0 0 1.4rem; }
}

/* ---------- setting list ---------- */
.setting { list-style: none; padding: 0; margin: 1.6rem 0 0; }
.setting li { padding: 0.9rem 0; border-top: 1px solid var(--hairline); font-size: 0.96rem; color: var(--ink-soft); }
.setting li:last-child { border-bottom: 1px solid var(--hairline); }
.setting b { color: var(--ink); font-weight: 500; }

/* ---------- partner roles ---------- */
.roles { display: grid; gap: 1rem; margin-top: 2.2rem; }
.role {
  display: grid; grid-template-columns: auto 1fr; gap: 1.4rem; align-items: start;
  border-top: 1px solid var(--hairline); padding: 1.4rem 0 0.4rem;
}
.role .slot {
  font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500;
  border: 1px solid var(--ink); border-radius: 999px; padding: 0.3rem 0.8rem;
  white-space: nowrap; margin-top: 0.15rem;
}
.role.need .slot { background: var(--yellow); }
.role h3 { font-family: var(--serif); font-weight: 400; font-size: 1.3rem; }
.role p { margin: 0.4rem 0 0; font-size: 0.95rem; color: var(--ink-soft); }
@media (max-width: 40rem) { .role { grid-template-columns: 1fr; gap: 0.6rem; } .role .slot { justify-self: start; } }

ul.plain { padding-left: 1.2rem; }
ul.plain li { margin-bottom: 0.6rem; }
.print-only { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- colophon ---------- */
.band-dark > .wrap > .eyebrow:first-child { border-top-color: #fff6e533; }
#colophon { padding-top: 0; }
#colophon p { color: #fff6e5cc; }
#colophon a { color: var(--paper); }

/* ---------- closing + footer ---------- */
.closing { background: var(--ink); color: var(--paper); padding: 5rem 0; }
.closing .lede { color: #fff6e5cc; }
.closing a { color: var(--paper); }
.disclaimer { font-size: 0.85rem; color: #fff6e599; border-left: 2px solid #fff6e533; padding-left: 1rem; margin-top: 2.5rem; max-width: 52rem; }
footer { background: var(--ink); color: #fff6e599; padding: 0 0 3rem; font-size: 0.88rem; }
footer a { color: #fff6e5cc; }

/* ---------- print ---------- */
@media print {
  /* Top and bottom margins hold the header and footer (scripts/export-papers-pdf.mjs);
     side space comes from the body padding, so that a designed cover can run full width. */
  @page { margin: 22mm 0; }
  body { background: #fff; font-size: 10pt; line-height: 1.5; margin: 0; padding: 0 22mm; }
  .wrap, .narrow { max-width: none; padding: 0; }
  section { padding: 1.1rem 0; }
  .band-blue, .band-dark, .closing, footer { background: #fff !important; color: #110e25 !important; }
  .closing a, footer a, .band-dark a, .band-dark h2, .band-dark .eyebrow { color: #110e25 !important; }
  .closing .lede, .disclaimer, footer { color: #444 !important; }
  .disclaimer { border-left-color: #ccc; }
  pre { background: #f4f1ea; color: #110e25; font-size: 7pt; }
  .tok-str { color: #8a3b1e; } .tok-kw { color: #a35a00; } .tok-type { color: #26407a; }
  .tok-num { color: #11614c; } .tok-com { color: #777; }
  h2 { font-size: 15pt; break-after: avoid; }
  h3 { break-after: avoid; }
  p, li { orphans: 3; widows: 3; }
  .hero { padding: 0.4rem 0 1.2rem; }
  .hero-grid { grid-template-columns: 1fr; gap: 1.2rem; }
  .hero h1 { font-size: 23pt; }
  .toc { break-inside: avoid; }
  .cta-row, .lang { display: none; }
  /* Site chrome and the on-screen contents sidebar stay out of the PDF. */
  header, footer, .paper-langs, .toc, .pdf-buttons { display: none !important; }
  /* On markdown papers the contents sidebar is printed as the contents page, see below. */
  .paper-grid .toc { display: block !important; }
  .print-only { display: block; }
  .qa { display: block !important; }
  .q > summary::after { display: none; }
  .q > summary { padding: 0.7rem 0 0.3rem; }
  .q, .role, .shift, .setting li, .derive li, .strands li, .film figure, .shot-note, pre, .toc li { break-inside: avoid; }
  .stage { background: #fff; border: 1px solid #c9c4bd; padding: 2px; }
  .opportunity { padding: 1.2rem 1.4rem; }
  a { color: #110e25; text-decoration: underline; }
}

/* ---------- long-form paper (white paper pages) ----------
   Markdown output inside <main class="paper">. Everything is scoped to .paper:
   the page also loads Tailwind's preflight, whose unscoped element resets
   (h2, p, ol, a, ...) would otherwise override the rules below. */
.paper h1, .paper h2, .paper h3, .paper h4 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.005em; line-height: 1.12; margin: 0; }
.paper h2 { font-size: clamp(1.75rem, 2.6vw, 2.4rem); }
.paper h3 { font-family: var(--sans); font-weight: 500; font-size: 1.05rem; line-height: 1.35; letter-spacing: 0; margin: 0 0 0.35rem; }
.paper h4 { font-family: var(--sans); font-weight: 500; font-size: 0.98rem; line-height: 1.35; letter-spacing: 0; margin: 1.8rem 0 0.4rem; }
.paper p { margin: 0 0 1.05rem; }
.paper a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.paper .toc a { text-decoration: none; }
.paper a:hover { color: var(--ink); text-decoration-color: var(--orange); }
.paper ul { list-style: disc; }
.paper ol { list-style: decimal; }

main.paper { padding-top: 2.6rem; padding-bottom: 4rem; }
.paper h1 { font-size: clamp(2rem, 4vw, 3.1rem); margin: 0.6rem 0 0.9rem; max-width: 22ch; }
.paper .subtitle { font-family: var(--serif); font-size: 1.5rem; line-height: 1.3; margin: 0 0 1.6rem; max-width: 34ch; }
.paper .byline { font-size: 0.85rem; color: var(--ink-soft); margin: 0 0 1.2rem; }

/* Download button for the paper's PDF, shown under the byline or the hero. */
.pdf-button, .paper a.pdf-button { display: inline-flex; align-items: center; gap: 0.6rem; margin: 0 0 2.4rem; padding: 0.7rem 1.25rem 0.7rem 1.1rem; background: var(--ink); color: var(--paper); border: 2px solid var(--ink); border-radius: 999px; font-family: var(--sans); font-size: 0.9rem; font-weight: 500; letter-spacing: 0.01em; text-decoration: none; transition: background-color 0.15s, color 0.15s; }
.pdf-button:hover, .pdf-button:focus-visible, .paper a.pdf-button:hover, .paper a.pdf-button:focus-visible { background: var(--yellow); color: var(--ink); }
.pdf-button svg { width: 1.1rem; height: 1.1rem; flex: none; }
.pdf-buttons { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0 0 2.4rem; }
.paper .pdf-buttons a.pdf-button { margin: 0; }
.hero .pdf-button { margin-top: 1.6rem; margin-bottom: 0; }
.paper h2 { margin-top: 3.2rem; margin-bottom: 1rem; border-top: 1px solid var(--ink); padding-top: 1.6rem; max-width: 30ch; }
.paper h3 { margin-top: 2.2rem; }
.paper h2 + h3, .paper h3 + h4 { margin-top: 0.4rem; }
.paper ul, .paper ol { margin: 0 0 1.2rem; padding-left: 1.4rem; }
.paper li { margin-bottom: 0.45rem; }
.paper li > ul, .paper li > ol { margin-top: 0.45rem; margin-bottom: 0; }
.paper blockquote { margin: 1.6rem 0; padding: 0.2rem 0 0.2rem 1.2rem; border-left: 3px solid var(--orange); color: var(--ink-soft); }
.paper blockquote p:last-child { margin-bottom: 0; }
.paper hr { border: 0; border-top: 1px solid var(--hairline); margin: 2.4rem 0; }
.paper code { font-family: var(--mono); font-size: 0.88em; background: var(--code-bg); border-radius: 3px; padding: 0.05em 0.3em; }
.paper pre { max-width: 100%; overflow-x: auto; margin: 0 0 1.4rem; }
.paper pre code { background: none; padding: 0; }
.paper pre { background: var(--code-bg); color: var(--ink); padding: 0.9rem 1.1rem; border-radius: 4px; font-family: var(--mono); font-size: 0.84rem; line-height: 1.55; }
.paper pre .k { font-weight: 600; }
.paper pre .c { color: var(--ink-soft); font-style: italic; }
.paper pre .t { color: #3348c0; }
.paper table { width: 100%; border-collapse: collapse; margin: 1.4rem 0 1.8rem; font-size: 0.85rem; line-height: 1.45; }
.paper th, .paper td { text-align: left; vertical-align: top; padding: 0.55rem 0.8rem 0.55rem 0; border-bottom: 1px solid var(--hairline); }
.paper th { font-weight: 500; border-bottom: 1px solid var(--ink); }
.paper td code { font-size: 0.85em; }

/* Wide tables scroll sideways inside their box on small screens. Cells keep a minimum
   width so that columns do not squeeze their text into single words. */
.paper .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media screen {
  .paper .table-scroll table { min-width: 36rem; }
  .paper th, .paper td { min-width: 9rem; }
}
/* figures are PNGs, each followed by its caption as an italic line */
.paper p:has(> img) { margin: 2.2rem 0 0.5rem; }
.paper img { display: block; max-width: 100%; height: auto; }
.paper p:has(> img) + p { font-size: 0.85rem; line-height: 1.45; color: var(--ink-soft); margin: 0 0 1.4rem; }
.paper .sources a { overflow-wrap: anywhere; }

/* two columns: the paper body, and a sticky contents list (as on ferrite) */
.paper-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, 17rem); gap: 3.5rem; align-items: start; }
.paper-body { min-width: 0; max-width: 44rem; }
.paper-grid .toc { top: 2rem; }
@media (max-width: 64rem) { .paper-grid { grid-template-columns: 1fr; } .paper-body { max-width: none; } .paper-grid .toc { position: static; } }
.paper .toc ol { list-style: none; padding-left: 0; }

/* contents: sections of the chapter being read open under it */
.paper .toc a[aria-current] .title { text-decoration: underline; text-decoration-color: var(--orange); }
.paper .toc li.chapter.is-active > a { color: var(--ink); font-weight: 500; }
.paper .toc .sections { display: none; list-style: none; padding: 0 0 0.7rem 2.5rem; margin: 0; }
.paper .toc li.is-active > .sections { display: block; }
.paper .toc .sections li { counter-increment: none; border-bottom: 0; margin: 0; }
.paper .toc .sections a { display: block; padding: 0.28rem 0; font-size: 0.85rem; color: var(--ink-soft); }
.paper .toc .sections a::before { content: none; }
.paper .toc .sections a[aria-current] { color: var(--ink); }
/* section headings (H3): larger, in the display face, to stand apart from body text */
.paper h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.25rem, 1.9vw, 1.5rem); line-height: 1.2; margin: 2.4rem 0 0.7rem; }
.paper h2 + h3, .paper h3 + h4 { margin-top: 0.6rem; }
/* keep headings clear of the top of the viewport when reached by a link or the contents */
.paper h2, .paper h3 { scroll-margin-top: 4.5rem; }
/* the chapter note only shows while its chapter is closed; the open chapter lists its sections instead */
.paper .toc li.chapter.is-active .meta { display: none; }


/* language switch for papers that exist in several languages */
.paper-langs { display: flex; gap: 0.9rem; justify-content: flex-end; max-width: 78rem; margin: 0 auto; padding: 0.9rem 2rem 0; font-size: 0.78rem; letter-spacing: 0.06em; }
.paper-langs a { color: var(--ink); text-decoration: none; opacity: 0.55; }
.paper-langs a[aria-current] { opacity: 1; font-weight: 500; }

/* ---------- white paper PDF: designed edition ----------
   For papers with `cover: true` in their frontmatter: a cover page, a contents page
   (the sidebar), then one page per chapter (H2). Only printed; the site ignores it. */
.paper-cover { display: none; }

@media print {
  html:has(.paper-cover), body:has(.paper-cover) { background: var(--paper); }

  /* Cover */
  .paper-cover { display: flex; flex-direction: column; height: 253mm; margin: 0 -4mm; /* cover rule runs wider than the text */ break-after: page; color: var(--ink); }
  .paper-cover-top { padding-bottom: 6mm; border-bottom: 1px solid var(--ink); }
  .paper-cover-logo { display: block; height: 8mm; width: auto; }
  .paper-cover-main { margin-top: 38mm; }
  .paper-cover-eyebrow { font: 500 7.5pt/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; margin: 0 0 6mm; }
  .paper-cover-title { font: 400 40pt/1.02 var(--serif); letter-spacing: -0.01em; margin: 0 0 6mm; max-width: 140mm; }
  .paper-cover-subtitle { font: 400 19pt/1.2 var(--serif); margin: 0 0 12mm; max-width: 120mm; }
  .paper-cover-summary { font: italic 400 11pt/1.45 var(--serif); margin: 0; max-width: 110mm; }
  .paper-cover-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; }
  .paper-cover-author { font: 400 8.5pt/1.5 var(--sans); margin: 0; }
  .paper-cover-mark { display: block; width: 120mm; height: auto; }

  /* Contents page: the sidebar, printed before the body */
  .paper-grid { display: flex; flex-direction: column; }
  .paper-grid .toc { order: -1; position: static; break-after: page; }
  .paper-grid .toc .meta { display: none; }
  .paper-grid .toc .chapter > a .title { font-family: var(--serif); font-size: 13pt; }
  .paper-grid .toc .chapter > a { padding: 3.2mm 0 2.4mm; }
  .paper-grid .toc .sections { display: block; padding: 0 0 3.2mm 11mm; }
  .paper-grid .toc .sections a { padding: 0.4mm 0; font-size: 9pt; color: var(--ink); }
  .paper-grid .toc { width: 100%; }
  .paper-grid .toc a .title, .paper-grid .toc a[aria-current] .title { text-decoration: none !important; }
  .paper .table-scroll { overflow: visible; }
  /* Long code lines wrap in print: an overflowing line makes Chrome shrink the whole page */
  .paper pre { white-space: pre-wrap; overflow-wrap: anywhere; overflow: visible; font-size: 7pt; }

  /* Body: front matter replaced by the cover, chapters start on new pages */
  body:has(.paper-cover) .paper-body { max-width: none; counter-reset: chapter; }
  body:has(.paper-cover) .paper-body > h1:first-of-type,
  body:has(.paper-cover) .paper-body > .subtitle,
  body:has(.paper-cover) .paper-body > .byline,
  body:has(.paper-cover) .paper-body > .pdf-buttons,
  body:has(.paper-cover) .paper-body > .central { display: none; }

  body:has(.paper-cover) .paper-body h2 {
    counter-increment: chapter; break-before: page; border-top: 0; padding-top: 0; max-width: none;
    font-size: 26pt; line-height: 1.1; margin: 0 0 9mm;
  }
  body:has(.paper-cover) .paper-body h2:first-of-type { break-before: auto; }
  body:has(.paper-cover) .paper-body h2::before {
    content: "Chapter " counter(chapter); display: block;
    font: 500 7.5pt/3.2mm var(--sans); letter-spacing: 0.16em; text-transform: uppercase;
    padding-left: 4.4mm; margin-bottom: 4mm;
    background: radial-gradient(circle at 0 50%, var(--orange) 1.6mm, transparent 1.7mm) no-repeat 0 0 / 3.2mm 3.2mm;
  }
  body:has(.paper-cover) .paper-body h2::after {
    content: ""; display: block; width: 30mm; border-top: 1px solid var(--ink); margin-top: 5mm;
  }
  body:has(.paper-cover) .paper-body h3 {
    font-size: 15pt; line-height: 1.2; margin: 8mm 0 3mm; max-width: none; border: 0; padding: 0;
  }
}
