/* DR.EPOXY · css/inner.css (owner: infra). The inner pages (src/inner.html + src/pages/*.html) in direction C: the legal
   pages, the guide and 404. Loaded after css/c.css (tokens, type, buttons, the header and the menu) on these pages only.
   A page body is plain semantic HTML:
     <header class="doc__head"> h1.doc__h1 (.doc__h1--win: a window into the film, the guide only; the poster: assets/film/), .lead, .updated
     <nav class="toc" aria-label="…"><ol>…</ol></nav>   (a11y.js adds the phone toggle and marks the current section)
     <article class="doc__body"> h2[id] h3 p ul ol .link .ph .table>table aside.cta-box .note
   Text sizes: C's tokens (css/c.css :root): reading --fs-body, the lead and h3 --fs-lead, labels --fs-s, fine print and
   the mono numerals --fs-xs (never under 13px). The measure follows the type (max-width in em).
   Phones: one column, the table of contents a folded box above the article. From 1024px: the article on the start side at a
   reading measure, the table of contents sticky on the end side. Nothing here moves with the scroll. */

/* ---------- the page ---------- */
.doc {
  display: grid; grid-template-columns: minmax(0, 1fr); align-items: start;
  padding: calc(var(--hdr) + env(safe-area-inset-top, 0px) + 8svh) var(--gut) 16svh;
}
.doc__head { display: grid; justify-items: start; padding-bottom: 30px; margin-bottom: 26px; border-bottom: 1px solid rgba(20, 18, 16, .18); }
.doc__h1 {
  margin: 0; max-width: 100%; color: var(--ink);
  font-family: var(--display); font-weight: 900; font-stretch: 62.5%; font-synthesis: none;
  font-size: clamp(54px, 15.5vw, 132px); line-height: .9; letter-spacing: 0; text-wrap: balance; overflow-wrap: break-word;
}
/* the guide's title (pass 7: plain ink display; the letters were a window into the film, the giant-letter language the owner
   retired) */
.doc__h1--win { font-size: clamp(50px, 13.6vw, 128px); line-height: .92; padding-bottom: .04em; color: var(--ink); }
.lead { margin: 28px 0 0; max-width: 34em; font: 300 var(--fs-lead)/1.55 var(--text); color: var(--ink); }
.lead b, .lead strong { font-weight: 500; }
.updated { margin: 22px 0 0; display: flex; align-items: center; gap: 10px; font: 400 var(--fs-s)/1.5 var(--text); color: var(--ink-2); }
.updated bdi { font-family: var(--mono); font-size: .92em; }
.updated::before { content: ""; flex: none; width: 22px; height: 1px; background: var(--copper); }

/* ---------- the table of contents ---------- */
.toc { margin: 0 0 7svh; border-bottom: 1px solid rgba(20, 18, 16, .18); }
.toc__toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 52px; padding: 0;
  border: 0; background: none; cursor: pointer; color: var(--ink); text-align: start;
  font: 500 var(--fs-s)/1.2 var(--text); letter-spacing: .04em;
}
.toc__toggle svg { width: 20px; height: 20px; flex: none; transition: transform .35s var(--ease); }
.toc__toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
@media (hover: hover) and (pointer: fine) { .toc__toggle:hover span { color: var(--copper-t, #8A5129); } }
.toc ol { margin: 0; padding: 2px 0 18px; list-style: none; counter-reset: toc; display: grid; }
.toc--js:not(.is-open) > ol { display: none; }
.toc li { counter-increment: toc; }
.toc a {
  display: grid; grid-template-columns: 2.6em minmax(0, 1fr); align-items: baseline; min-height: 40px; padding: 8px 0;
  font: 400 var(--fs-s)/1.4 var(--text); color: var(--ink-2); text-decoration: none;
}
.toc a::before { content: counter(toc, decimal-leading-zero); content: counter(toc, decimal-leading-zero) / ""; font: 400 var(--fs-xs)/1 var(--mono); letter-spacing: .04em; color: var(--copper-t, #8A5129); }
.doc .toc a.link, .toc a { text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .doc .toc a.link:hover, .toc a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--copper); text-underline-offset: 4px; } }
.toc a[aria-current] { color: var(--ink); font-weight: 500; }
.toc a[aria-current]::before { color: var(--ink); }

/* ---------- the article ---------- */
.doc__body { min-width: 0; max-width: 36em; font: 400 var(--fs-body)/1.75 var(--text); color: var(--ink); counter-reset: sec; }
.doc__body > * { margin: 0; }
.doc__body > * + * { margin-top: 1.05em; }
.doc__body h2 {
  margin-top: 2.4em; scroll-margin-top: calc(var(--hdr) + 28px); counter-increment: sec;
  font-family: var(--display); font-weight: 900; font-stretch: 62.5%; font-synthesis: none;
  font-size: clamp(36px, 8.6vw, 56px); line-height: .98; letter-spacing: 0; text-wrap: balance; color: var(--ink);
}
.doc__body > h2:first-child { margin-top: 0; }
.doc__body h2::before {
  content: counter(sec, decimal-leading-zero); content: counter(sec, decimal-leading-zero) / "";
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding-top: 20px; border-top: 1px solid rgba(20, 18, 16, .18);
  font: 400 var(--fs-xs)/1 var(--mono); letter-spacing: .08em; color: var(--copper-t, #8A5129);
}
.doc__body h2 + * { margin-top: .9em; }
.doc__body h3 { margin-top: 1.9em; font: 600 var(--fs-lead)/1.35 var(--text); color: var(--ink); scroll-margin-top: calc(var(--hdr) + 28px); }
.doc__body h3 + * { margin-top: .45em; }
.doc__body h4 { margin-top: 1.4em; font: 600 var(--fs-body)/1.4 var(--text); }
.doc__body b, .doc__body strong { font-weight: 600; }
.doc__body :is(ul, ol) { padding: 0; list-style: none; display: grid; gap: .55em; }
.doc__body ul > li { position: relative; padding-inline-start: 24px; }
.doc__body ul > li::before { content: ""; position: absolute; inset-inline-start: 0; top: .86em; width: 12px; height: 1px; background: var(--copper); }
.doc__body ol { counter-reset: li; }
.doc__body ol > li { position: relative; padding-inline-start: 2.2em; counter-increment: li; }
.doc__body ol > li::before {
  content: counter(li, decimal-leading-zero); content: counter(li, decimal-leading-zero) / "";
  position: absolute; inset-inline-start: 0; top: .45em; font: 400 var(--fs-xs)/1 var(--mono); letter-spacing: .04em; color: var(--copper-t, #8A5129);
}
.doc__body a, .doc a.link { color: var(--ink); text-decoration: underline; text-decoration-color: var(--copper); text-decoration-thickness: 1px; text-underline-offset: 4px; }
@media (hover: hover) and (pointer: fine) { .doc__body a:hover { color: var(--copper-t, #8A5129); text-decoration-thickness: 2px; } }
.doc__body .btn { text-decoration: none; }
.doc__body bdi[dir="ltr"] { unicode-bidi: isolate; }
.doc__body hr { border: 0; height: 1px; background: rgba(20, 18, 16, .18); margin: 2.4em 0; }
.doc__body blockquote { padding-inline-start: 18px; border-inline-start: 2px solid var(--copper); color: var(--ink-2); }
.doc__body figure img { display: block; width: 100%; height: auto; }
.doc__body figcaption { margin-top: 10px; font: 400 var(--fs-s)/1.5 var(--text); color: var(--ink-2); }

/* a table: hairlines, mono column labels; wider than the screen it scrolls inside its frame (a11y.js makes it reachable) */
.table { margin: 1.6em 0; overflow-x: auto; overscroll-behavior-x: contain; }
.table.is-scroll { box-shadow: inset 0 -1px 0 rgba(20, 18, 16, .18); }
.table:focus-visible { outline: 2px solid var(--copper); outline-offset: 4px; }
.table table { width: 100%; min-width: 30rem; border-collapse: collapse; font-size: var(--fs-s); line-height: 1.5; }
.table caption { caption-side: top; text-align: start; padding: 0 0 12px; font: 400 var(--fs-s)/1.5 var(--text); color: var(--ink-2); }
.table th, .table td { padding: 13px 0 13px 18px; text-align: start; vertical-align: top; border-bottom: 1px solid rgba(20, 18, 16, .16); }
.table thead th { padding-top: 0; font: 500 var(--fs-xs)/1.3 var(--text); letter-spacing: .04em; color: var(--ink-2); border-bottom-color: rgba(20, 18, 16, .45); }
.table tbody th { font-weight: 600; white-space: nowrap; }
.table td:last-child { white-space: nowrap; }

/* a call to action inside the article: a film-black moment */
.cta-box {
  margin: 2.6em 0 !important; padding: 26px 24px 24px; display: grid; gap: 18px; justify-items: start;
  background: var(--film); color: var(--pearl); border-radius: 2px;
}
.cta-box p { margin: 0; font: 400 var(--fs-body)/1.65 var(--text); color: rgba(244, 239, 231, .86); max-width: 34rem; }
.cta-box p b { display: block; margin-bottom: 10px; font-family: var(--display); font-weight: 900; font-stretch: 62.5%; font-size: 34px; line-height: 1; color: var(--pearl); }
.cta-box .btn--ink { background: var(--pearl); color: var(--ink); box-shadow: inset 0 0 0 1px var(--pearl); }
@media (hover: hover) and (pointer: fine) { .cta-box .btn--ink:hover { background: var(--copper-l); box-shadow: inset 0 0 0 1px var(--copper-l); } }
.cta-box .btn--ink::after { background: var(--copper); }
.cta-box .ph { color: var(--pearl); }
@media (min-width: 600px) { .cta-box { padding: 34px 36px 32px; } .cta-box p b { font-size: 40px; } }

.note { margin-top: 3em !important; padding-top: 16px; border-top: 1px solid rgba(20, 18, 16, .18); font-size: var(--fs-s); line-height: 1.65; color: var(--ink-2); }

/* ---------- from 1024px: the article on the start side, the table of contents sticky on the end side ---------- */
@media (min-width: 1024px) {
  .doc { grid-template-columns: minmax(0, 46rem) minmax(3rem, 1fr) minmax(14rem, 19rem); padding-top: calc(var(--hdr) + 12svh); }
  .doc__head { grid-column: 1 / -1; padding-bottom: 44px; margin-bottom: 56px; }
  .doc__head > :not(.doc__h1) { max-width: 46rem; }
  .doc__h1 { font-size: min(9.4vw, 148px); }
  .doc__h1--win { font-size: min(8.2vw, 136px); max-width: 15ch; }
  .doc__body { grid-column: 1; grid-row: 2; }
  .toc {
    grid-column: 3; grid-row: 2; position: sticky; top: calc(var(--hdr) + 28px); margin: 0; border: 0;
    max-height: calc(100vh - var(--hdr) - 56px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  }
  .toc__toggle { min-height: 40px; border-bottom: 1px solid rgba(20, 18, 16, .18); margin-bottom: 8px; }
  .toc a { min-height: 0; padding: 6px 0; }
}
@media (min-width: 1440px) { .doc { grid-template-columns: minmax(0, 52rem) minmax(4rem, 1fr) 21rem; } .doc__head > :not(.doc__h1) { max-width: 52rem; } }

/* ---------- 404 ---------- */
.page-404 .doc { min-height: 100vh; min-height: 100svh; align-content: center; padding-bottom: 10svh; }
.nf { display: grid; gap: 3svh; }
.nf__k {
  margin: 0; font-family: var(--display); font-weight: 900; font-stretch: 62.5%; font-synthesis: none;
  font-size: clamp(110px, 36vw, 280px); line-height: .8; letter-spacing: 0; color: var(--ink);   /* (pass 7: plain ink, ≤ ~55% of the width) */
}
.nf__copy { display: grid; gap: 18px; justify-items: start; max-width: 36rem; }
.nf__t { margin: 0; font-family: var(--display); font-weight: 900; font-stretch: 62.5%; font-size: clamp(42px, 10vw, 76px); line-height: .95; }
.nf__p { margin: 0; font: 400 var(--fs-lead)/1.55 var(--text); color: var(--ink-2); max-width: 34ch; }
.nf__ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 6px; }
.nf__nav { margin-top: 14px; padding-top: 16px; border-top: 1px solid rgba(20, 18, 16, .18); width: 100%; }
.nf__nav ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 0 20px; }
.nf__nav a { display: inline-flex; align-items: center; min-height: 44px; font: 400 var(--fs-body)/1.3 var(--text); color: var(--ink); text-decoration: underline; text-decoration-color: var(--copper); text-underline-offset: 4px; }
@media (hover: hover) and (pointer: fine) { .nf__nav a:hover { color: var(--copper-t, #8A5129); } }
@media (min-width: 900px) {
  .nf { grid-template-columns: auto minmax(0, 1fr); align-items: end; column-gap: 6vw; }
  .nf__k { font-size: min(34vw, 62svh); }
  .nf__copy { padding-bottom: 2svh; }
}

/* ---------- reduced motion, high contrast ---------- */
html.rm .toc__toggle svg { transition: none; }
html.a11y-contrast :is(.doc__h1--win, .nf__k) { background: none !important; -webkit-text-fill-color: #fff !important; }
html.a11y-contrast .cta-box { border: 2px solid #fff !important; }
