/* Hallmark · macrostructure: Index-First (home) · Map / Diagram (Perennos Tempo) · Marquee Hero (area pages) · nav: N6 masthead · footer: Ft5 statement · theme: studied-DNA (source: Perennos Tempo films v5) · genre: editorial */

@font-face {
  font-family: "Anybody";
  src: url("/fonts/anybody-latin-100-900.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 50% 150%;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "CourierPrime";
  src: url("/fonts/courier-prime-latin-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Base ---------- */

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

html {
  overflow-x: clip;
  color-scheme: light;
  background: var(--color-paper);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--space-6);
  --gutter: var(--space-5);
}

html[data-ground="night"] { color-scheme: dark; }

body {
  overflow-x: clip;
  margin: 0;
  min-width: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: var(--lh-body);
  font-synthesis: none;
}

em, i, cite, dfn, var, address { font-style: normal; }

h1, h2, h3, p, ul, ol, figure, dl, dd { margin: 0; }

ul, ol { padding: 0; list-style: none; }

img, svg, video { max-width: 100%; }

[id] { scroll-margin-top: var(--space-6); }

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: var(--rule-hair);
  text-underline-offset: 0.2em;
}

a:hover { text-decoration-thickness: var(--rule-heavy); }

a:focus-visible,
summary:focus-visible {
  outline: var(--focus-w) solid var(--color-ink);
  outline-offset: var(--space-1);
}

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

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.mono { font-family: var(--font-mono); font-weight: 700; }
.muted { color: var(--color-muted); }
.c-local { color: var(--color-local); }
.c-hosted { color: var(--color-hosted); }

.skip {
  position: absolute;
  left: var(--space-4);
  top: var(--space-2);
  z-index: 10;
  padding: var(--space-3) var(--space-4);
  background: var(--color-ink);
  color: var(--color-paper);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  text-decoration: none;
  transform: translateY(-300%);
}

.skip:focus-visible { transform: translateY(0); outline-offset: var(--space-1); }

/* ---------- Masthead (N6) ---------- */

.mast { padding-top: var(--space-6); text-align: center; }

.wordmark {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.wordmark:hover { text-decoration: underline; text-decoration-thickness: var(--rule-heavy); text-underline-offset: 0.18em; }

.mast-links {
  margin-top: var(--space-3);
  border-top: var(--rule-heavy) solid var(--color-ink);
}

.mast-links ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: var(--space-8);
}

.mast-links a {
  display: flex;
  align-items: center;
  min-height: var(--space-11);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  white-space: nowrap;
}

.mast-links a:hover,
.mast-links a[aria-current] {
  text-decoration: underline;
  text-decoration-thickness: var(--rule-heavy);
  text-underline-offset: 0.35em;
}

/* ---------- Footer (Ft5 statement) ---------- */

.foot { margin-top: var(--space-24); }

.foot-in {
  border-top: var(--rule-heavy) solid var(--color-ink);
  padding-block: var(--space-12) var(--space-16);
}

.foot-slogan {
  max-width: 18ch;
  min-width: 0;
  font-size: var(--text-4xl);
  font-weight: 650;
  line-height: var(--lh-tight);
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.foot-tab {
  display: block;
  width: var(--space-24);
  height: var(--space-3);
  margin-top: var(--space-5);
  background: var(--color-accent);
}

.foot-line {
  margin-top: var(--space-8);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
}

.foot-notes {
  margin-top: var(--space-3);
  max-width: var(--measure);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: 1.6;
  color: var(--color-muted);
}

.foot-notes li + li { margin-top: var(--space-1); }

/* ---------- Shared sections and rows ---------- */

.sec {
  margin-top: var(--space-16);
  border-top: var(--rule-heavy) solid var(--color-ink);
  padding-top: var(--space-6);
}

.sec-title {
  min-width: 0;
  max-width: 28ch;
  margin-bottom: var(--space-6);
  font-size: var(--text-2xl);
  font-weight: 650;
  line-height: var(--lh-snug);
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.sec-label {
  margin-bottom: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sec-sub {
  max-width: var(--measure);
  margin: calc(var(--space-3) * -1) 0 var(--space-6);
  font-size: var(--text-lg);
  color: var(--color-muted);
}

.tag {
  display: inline-block;
  margin: calc(var(--space-3) * -1) 0 var(--space-6);
  padding: var(--space-1) var(--space-2);
  border: var(--rule-hair) solid var(--color-rule);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-muted);
}

.rows { border-bottom: var(--rule-hair) solid var(--color-rule); }
.rows > li { border-top: var(--rule-hair) solid var(--color-rule); }

.row {
  display: grid;
  grid-template-columns: minmax(0, var(--label-w)) minmax(0, 1fr);
  column-gap: var(--space-6);
  row-gap: var(--space-1);
  align-items: baseline;
  padding-block: var(--space-4);
}

.row-label {
  min-width: 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-muted);
  overflow-wrap: anywhere;
}

.row-label.is-default {
  justify-self: start;
  padding: var(--space-1) var(--space-2);
  background: var(--color-ink);
  color: var(--color-paper);
}

.row-text {
  min-width: 0;
  max-width: var(--measure);
  font-size: var(--text-lg);
  line-height: var(--lh-snug);
  overflow-wrap: break-word;
}

/* Rows that are one link: hover and focus invert the whole row */
.lrows { border-bottom: var(--rule-hair) solid var(--color-rule); }
.lrows > li { border-top: var(--rule-hair) solid var(--color-rule); }

.lrow {
  display: grid;
  column-gap: var(--space-6);
  row-gap: var(--space-1);
  align-items: baseline;
  margin-inline: calc(var(--space-2) * -1);
  padding: var(--space-4) var(--space-2);
  color: inherit;
  text-decoration: none;
}

.lrow:hover,
.lrow:focus-visible {
  background: var(--color-ink);
  color: var(--color-paper);
}

.lrow:hover .muted,
.lrow:focus-visible .muted,
.lrow:hover .d-job,
.lrow:focus-visible .d-job { color: inherit; }

.lrow:focus-visible { outline: var(--focus-w) solid var(--color-ink); outline-offset: 2px; }

.lrow:active { transform: translateY(1px); }

.placeholder {
  max-width: var(--measure);
  padding: var(--space-6) var(--space-4);
  border: var(--rule-hair) dashed var(--color-rule);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  min-height: var(--space-11);
  padding: var(--space-2) var(--space-6);
  border: var(--rule-heavy) solid var(--color-ink);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover { background: var(--color-ink); color: var(--color-paper); }
.btn:focus-visible { outline: var(--focus-w) solid var(--color-ink); outline-offset: var(--space-1); }
.btn:active { transform: translateY(1px); }
.btn[aria-disabled="true"] { border-style: dashed; color: var(--color-muted); pointer-events: none; }

/* ---------- Film figure ---------- */

.film video,
.film-ph {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: var(--color-ink);
}

.film-ph {
  display: flex;
  align-items: flex-end;
  padding: var(--space-4);
  border: var(--rule-hair) dashed var(--color-rule);
  background: transparent;
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
}

.film figcaption {
  margin-top: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-muted);
}

.film-alt {
  margin-top: var(--space-4);
  font-size: var(--text-lg);
}

/* ---------- Home (Index-First) ---------- */

.home-intro {
  max-width: 48ch;
  padding-block: var(--space-16) var(--space-12);
  font-size: var(--text-xl);
  line-height: var(--lh-snug);
}

.ledger { margin-top: var(--space-8); }

.ledger + .ledger { margin-top: var(--space-16); }

.ledger-label {
  padding-top: var(--space-4);
  margin-bottom: var(--space-4);
  border-top: var(--rule-heavy) solid var(--color-ink);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
}

.irow { grid-template-columns: minmax(0, 14rem) minmax(0, 1fr) auto; }

.i-name { min-width: 0; font-size: var(--text-xl); font-weight: 650; line-height: var(--lh-snug); overflow-wrap: break-word; }
.i-open { min-width: 0; font-size: var(--text-lg); line-height: var(--lh-snug); overflow-wrap: break-word; }
.i-len { font-family: var(--font-mono); font-size: var(--text-sm); font-weight: 700; white-space: nowrap; }

/* ---------- Perennos Tempo (Map / Diagram) ---------- */

.tempo-head { padding-block: var(--space-12) var(--space-6); }

.tempo-h1 {
  min-width: 0;
  max-width: 24em;
  font-size: var(--text-3xl);
  font-weight: 650;
  line-height: var(--lh-tight);
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.dial-wrap { margin-top: var(--space-8); }

.dial {
  display: block;
  width: 100%;
  max-width: 64rem;
  height: auto;
  margin-inline: auto;
  overflow: visible;
}

.dial-ring { fill: none; stroke: var(--color-ink); stroke-width: 4; }
.dial-node-ring { fill: var(--color-paper); stroke: var(--color-ink); stroke-width: 3; }
.dial-node-dot { fill: var(--color-local); }
.dial-name { font-family: var(--font-display); font-size: 26px; font-weight: 650; fill: var(--color-ink); }
.dial-job { font-family: var(--font-mono); font-size: 16px; font-weight: 700; fill: var(--color-muted); }
.dial-core { font-family: var(--font-display); font-size: 44px; font-weight: 650; fill: var(--color-ink); }
.dial-core-sub { font-family: var(--font-mono); font-size: 16px; font-weight: 700; fill: var(--color-muted); }

.dial-node { cursor: pointer; text-decoration: none; }

.dial-node:hover .dial-node-ring,
.dial-node:focus-visible .dial-node-ring { stroke-width: 6; }

.dial-node:hover .dial-name,
.dial-node:focus-visible .dial-name {
  text-decoration: underline;
  text-decoration-color: var(--color-ink);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.dial-node:focus-visible { outline: var(--focus-w) solid var(--color-ink); outline-offset: 6px; }

.dial-legend {
  max-width: 46rem;
  margin: var(--space-6) auto 0;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  text-align: center;
  text-wrap: balance;
}

.dial-list { display: none; }

/* drawn glyphs (the site fonts have no arrows or bullet) */
.arw { display: inline-block; width: 0.95em; height: 0.6em; vertical-align: -0.06em; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: square; stroke-linejoin: miter; }
.dot-local { display: inline-block; width: 0.7em; height: 0.7em; border-radius: 50%; background: var(--color-local); vertical-align: -0.05em; margin-right: 0.35em; }

/* footer lockup: the films' end card, PERENNOS over Tem(P)o */
.foot-brand { margin-bottom: var(--space-6); }
.foot-plabel { display: block; font-family: var(--font-mono); font-size: var(--text-sm); font-weight: 700; letter-spacing: 0.08em; color: var(--color-muted); margin-bottom: var(--space-2); }
.foot-brand .lockup { font-family: var(--font-display); font-weight: 650; font-size: clamp(4rem, 11vw, 8.5rem); line-height: 1.04; letter-spacing: -0.045em; color: var(--color-ink); }
.foot-brand .lockup-p { margin-left: 0.064em; margin-right: -0.004em; }
html[data-ground="night"] .lockup-p { filter: invert(1) grayscale(1); }

.dial-list .lrow { grid-template-columns: var(--space-8) minmax(0, 1fr); }
.dial-list .d-num { grid-row: 1 / span 2; font-family: var(--font-mono); font-size: var(--text-sm); font-weight: 700; }
.dial-list .d-name { font-size: var(--text-xl); font-weight: 650; line-height: var(--lh-snug); }
.dial-list .d-job { font-family: var(--font-mono); font-size: var(--text-sm); font-weight: 700; color: var(--color-muted); }

.pilot-text { max-width: var(--measure); font-size: var(--text-xl); line-height: var(--lh-snug); margin-bottom: var(--space-6); }

/* ---------- Area page (Marquee Hero) ---------- */

.fold { padding-block: var(--space-8) var(--space-12); }

.crumbs ol { display: flex; flex-wrap: wrap; column-gap: var(--space-2); margin-bottom: var(--space-6); font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 700; }
.crumbs li { white-space: nowrap; }
.crumbs li + li::before { content: "/"; margin-right: var(--space-2); }

.marquee {
  min-width: 0;
  font-size: var(--text-display);
  font-weight: 650;
  line-height: var(--lh-tight);
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.film-sec { border-top: var(--rule-heavy) solid var(--color-ink); padding-top: var(--space-6); }

.pile-rows { border-bottom: var(--rule-hair) solid var(--color-rule); }
.pile-rows > li { padding-block: var(--space-3); border-top: var(--rule-hair) solid var(--color-rule); font-family: var(--font-mono); font-size: var(--text-base); font-weight: 700; overflow-wrap: anywhere; }

.pile-count { margin-top: var(--space-4); font-family: var(--font-mono); font-size: var(--text-lg); font-weight: 700; line-height: var(--lh-snug); }

.problem-block { margin-top: var(--space-12); }
.problem { min-width: 0; max-width: 28ch; font-size: var(--text-2xl); font-weight: 400; line-height: var(--lh-snug); overflow-wrap: anywhere; text-wrap: balance; }
.ban { margin-top: var(--space-3); max-width: var(--measure); font-family: var(--font-mono); font-size: var(--text-base); font-weight: 700; color: var(--color-muted); }

.never-block { margin-top: var(--space-12); padding-top: var(--space-6); border-top: var(--rule-hair) solid var(--color-rule); }
.never { max-width: var(--measure); font-family: var(--font-mono); font-size: var(--text-xl); font-weight: 700; line-height: var(--lh-snug); overflow-wrap: break-word; }

.stamp {
  display: inline-block;
  margin-top: var(--space-5);
  padding: var(--space-2) var(--space-4);
  border: 3px solid var(--color-local);
  color: var(--color-local);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.12em;
  transform-origin: left center;
}

.total { margin-top: var(--space-8); }

.total-label {
  margin-bottom: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
}

.total-figure {
  min-width: 0;
  padding-block: var(--space-4) var(--space-5);
  border-top: var(--rule-heavy) solid var(--color-ink);
  border-bottom: var(--rule-double) double var(--color-ink);
  font-size: var(--text-3xl);
  font-weight: 650;
  line-height: var(--lh-tight);
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.script { margin-top: var(--space-16); border-top: var(--rule-hair) solid var(--color-rule); border-bottom: var(--rule-hair) solid var(--color-rule); }

.script summary {
  display: flex;
  align-items: center;
  min-height: var(--space-12);
  padding-block: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
}

.script summary::after { content: "+"; margin-left: auto; font-size: var(--text-lg); }
.script[open] summary::after { content: "\2212"; }

.script summary:hover { text-decoration: underline; text-decoration-thickness: var(--rule-heavy); text-underline-offset: 0.3em; }

.scenes { max-width: var(--measure); padding-bottom: var(--space-6); }
.scenes > li { padding-block: var(--space-4); border-top: var(--rule-hair) solid var(--color-rule); font-size: var(--text-base); line-height: var(--lh-body); }
.scenes .sub { margin-top: var(--space-2); }
.scenes .sub li { padding-block: var(--space-1); }
.scenes .sub .lbl { display: inline-block; min-width: 9rem; margin-right: var(--space-3); font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.06em; color: var(--color-muted); }

.pilot-cta { margin-top: var(--space-16); border-top: var(--rule-heavy) solid var(--color-ink); padding-top: var(--space-6); }
.pilot-cta p { min-width: 0; max-width: 24ch; margin-bottom: var(--space-6); font-size: var(--text-2xl); font-weight: 650; line-height: var(--lh-snug); overflow-wrap: anywhere; text-wrap: balance; }

.pn { margin-top: var(--space-16); border-top: var(--rule-heavy) solid var(--color-ink); border-bottom: var(--rule-hair) solid var(--color-rule); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }

.pn a {
  display: flex;
  align-items: center;
  min-height: var(--space-16);
  padding: var(--space-4) var(--space-2);
  font-size: var(--text-lg);
  font-weight: 650;
  line-height: var(--lh-snug);
  text-decoration: none;
  white-space: nowrap;
}

.pn a:first-child { margin-left: calc(var(--space-2) * -1); }
.pn a:last-child { margin-right: calc(var(--space-2) * -1); justify-content: flex-end; text-align: right; }
.pn a:hover { background: var(--color-ink); color: var(--color-paper); }
.pn a:focus-visible { outline: var(--focus-w) solid var(--color-ink); outline-offset: -6px; }
.pn a:active { transform: translateY(1px); }

/* The P in the "Tem(P)o" lockup, sized from the films: 123.59 x 162.53 at a 208 px wordmark, 39.19 px below the baseline. Not placed in v1: the brief names no position for it. */
.lockup { display: inline-block; white-space: nowrap; }
.lockup-p { display: inline-block; width: 0.5942em; height: 0.7814em; object-fit: contain; vertical-align: -0.1884em; }

/* ---------- Narrow screens ---------- */

@media (max-width: 47.99rem) {
  .irow { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name len" "open open"; }
  .i-name { grid-area: name; }
  .i-open { grid-area: open; }
  .i-len { grid-area: len; }

  .dial, .dial-legend { display: none; }
  .dial-list { display: block; }
  .dial-wrap { margin-top: var(--space-4); }
}

@media (max-width: 40rem) {
  .row { grid-template-columns: minmax(0, 1fr); }
  .scenes .sub .lbl { display: block; margin-right: 0; }
  .pn { grid-template-columns: minmax(0, 1fr); }
  .pn a:first-child, .pn a:last-child { margin-inline: calc(var(--space-2) * -1); }
  .pn a:last-child { position: relative; justify-content: flex-start; text-align: left; }
  .pn a:last-child::before { content: ""; position: absolute; top: 0; left: var(--space-2); right: var(--space-2); border-top: var(--rule-hair) solid var(--color-rule); }
  .foot { margin-top: var(--space-16); }
}

@media (min-width: 48rem) {
  html { --gutter: var(--space-8); }
}

@media (min-width: 75rem) {
  html { --gutter: var(--space-12); }
}

/* ---------- Motion: transform and opacity only (dial ring draws with stroke-dashoffset, as the brief names) ---------- */

@media (prefers-reduced-motion: no-preference) {
  .js .dial-ring { stroke-dasharray: 1000; stroke-dashoffset: 1000; }
  .js .dial-node { opacity: 0; }

  .js .dial.is-in .dial-ring {
    stroke-dashoffset: 0;
    transition: stroke-dashoffset var(--dur-draw) var(--ease-out);
  }

  .js .dial.is-in .dial-node {
    opacity: 1;
    transition: opacity var(--dur-base) var(--ease-out) var(--d, 0ms);
  }

  .js .stamp { opacity: 0; transform: scale(1.06); }

  .js .stamp.is-in {
    opacity: 1;
    transform: scale(1);
    transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-base) var(--ease-out);
  }
}
