/* Hallmark · genre: atmospheric (terminal cluster) · macrostructure: Marquee Hero · theme: Terminal · tone: technical/terminal · anchor hue: 150 phosphor · enrichment: none (typography only) · nav: N8 terminal command · footer: Ft4 dense colophon
 * audience: senior engineers · use: pure impression · gate: user-answered
 * contrast: pass (40–41) · slop: pass (42–45) · honest: pass (46) · chrome: pass (47) · tokens: pass (48) · responsive: pass (49) · mobile: pass (34, 49, 50–57)
 * Hallmark · pre-emit critique: P5 H4 E4 S5 R5 V4
 */

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  src: url("fonts/JetBrainsMono-Regular.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  src: url("fonts/JetBrainsMono-Medium.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 800;
  src: url("fonts/JetBrainsMono-ExtraBold.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400 500;
  src: url("fonts/IBMPlexSans-var.woff2") format("woff2");
  font-display: swap;
}

html {
  overflow-x: clip;
  color-scheme: dark;
  background: var(--color-paper);
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--color-paper);
  color: var(--color-ink);
  font: 400 var(--text-base) / 1.6 var(--font-body);
  padding-inline: max(0px, env(safe-area-inset-left)) max(0px, env(safe-area-inset-right));
  padding-bottom: env(safe-area-inset-bottom);
}

::selection {
  background: var(--color-accent);
  color: var(--color-paper);
}

a {
  color: var(--color-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: var(--rule-hair);
  white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
  a:hover {
    color: var(--color-accent);
  }
}

a:active {
  color: var(--color-accent);
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

h1, h2 {
  font-family: var(--font-display);
  font-style: normal;
  margin: 0;
}

/* ── N8 · terminal command nav ─────────────────────────────── */

.nav-term {
  padding: var(--space-sm) var(--page-gutter);
  border-bottom: var(--rule-hair) solid var(--color-rule);
  overflow-x: auto;
}

.nav-term__line {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  line-height: 1.6;
  margin: 0;
}

/* brand mark. The logo's own baseline sits ~84% down the bitmap (the "p"
   descender fills the rest), so it hangs below the text baseline by that
   remainder to line up with the mono flags beside it. */
.wordmark {
  height: 1.55em;
  width: auto;
  vertical-align: -0.25em;
  margin-right: 0.5ch;
}

.nav-term__line a {
  color: var(--color-ink);
}

/* ── hero typing — the page's one orchestrated entrance ────── */

.type {
  display: block;
  clip-path: inset(-0.1em 100% -0.1em 0);
  animation: type forwards;
}

.type-1 { animation-duration: 360ms; animation-delay: 200ms;  animation-timing-function: steps(9, end); }
.type-2 { animation-duration: 720ms; animation-delay: 650ms;  animation-timing-function: steps(18, end); }
.type-3 { animation-duration: 720ms; animation-delay: 1450ms; animation-timing-function: steps(18, end); }

@keyframes type {
  to { clip-path: inset(-0.1em 0 -0.1em 0); }
}

.caret {
  display: inline-block;
  width: 1ch;
  height: 0.8em;
  background: var(--color-accent);
  opacity: 0;
  animation: blink var(--dur-caret) linear 2250ms infinite;
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.caret--nav {
  animation-delay: 0ms;
}

/* ── marquee hero — statement fills the fold, bottom-left ──── */

.marquee {
  min-height: 78dvh;
  display: grid;
  align-content: end;
  padding: var(--space-xl) var(--page-gutter) var(--space-2xl);
}

.display-xxl {
  font-size: var(--text-display);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
  min-width: 0;
  max-width: 20ch;
}

.rule-thick {
  border: none;
  height: var(--rule-thick);
  margin: 0;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  animation: rule-in 500ms var(--ease-out) 2300ms forwards;
}

@keyframes rule-in {
  to { transform: scaleX(1); }
}

/* ── intro — one paragraph, left-flush, wide right margin ──── */

.intro {
  padding: var(--space-2xl) var(--page-gutter) var(--space-xl);
}

.intro__lede {
  font-size: var(--text-md);
  line-height: 1.55;
  max-width: 55ch;
  margin: 0;
}

/* ── section heads — stacked, single column, lowercase mono ── */

section h2 {
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-lg);
  overflow-wrap: anywhere;
  min-width: 0;
}

/* ── F3 · tabular spec sheet ───────────────────────────────── */

.systems {
  padding: var(--space-3xl) var(--page-gutter) var(--space-xl);
}

.spec-sheet {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 62rem;
}

.spec-row {
  display: grid;
  grid-template-columns: minmax(8rem, 11rem) minmax(0, 1fr) auto;
  gap: var(--space-md) var(--space-lg);
  align-items: baseline;
  padding-block: var(--space-md);
  border-top: var(--rule-hair) solid var(--color-rule);
}

.spec-sheet .spec-row:last-child {
  border-bottom: var(--rule-hair) solid var(--color-rule);
}

.spec-row__name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-base);
}

.spec-row__caps {
  color: var(--color-muted);
  font-size: var(--text-base);
}

.spec-row__status {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  color: var(--color-muted);
  white-space: nowrap;
}

.spec-row__status::before {
  content: "● ";
  color: var(--color-accent);
}

@media (max-width: 40rem) {
  .spec-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-2xs) var(--space-md);
  }
  .spec-row__caps {
    grid-column: 1 / -1;
  }
}

/* ── systems map — content, not chrome ─────────────────────── */

.topology {
  margin: var(--space-2xl) 0 0;
  max-width: 62rem;
}

.topology__map {
  margin: 0;
  padding: var(--space-lg) var(--space-md);
  border-block: var(--rule-hair) solid var(--color-rule);
  font-family: var(--font-display);
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--color-muted);
  overflow-x: auto;
}

.topology figcaption {
  margin-top: var(--space-xs);
  font-size: var(--text-sm);
  color: var(--color-muted);
  max-width: 65ch;
}

/* ── agent-first ───────────────────────────────────────────── */

.agents {
  padding: var(--space-2xl) var(--page-gutter) var(--space-xl);
}

.agents p {
  max-width: 65ch;
  margin: 0 0 var(--space-md);
}

.agents p:last-child {
  margin-bottom: 0;
}

/* ── the work ahead ────────────────────────────────────────── */

.work {
  padding: var(--space-3xl) var(--page-gutter) var(--space-4xl);
}

.work p {
  max-width: 65ch;
  margin: 0 0 var(--space-md);
}

.work p:last-child {
  margin-bottom: 0;
  font-weight: 500;
}

/* ── Ft4 · dense colophon ──────────────────────────────────── */

.foot-dense {
  padding: var(--space-2xl) var(--page-gutter) var(--space-xl);
  border-top: var(--rule-hair) solid var(--color-rule);
}

.foot-dense p {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-sm);
  line-height: 1.8;
  color: var(--color-muted);
  max-width: 72ch;
}

.foot-dense a {
  color: var(--color-ink);
  white-space: nowrap;
}

/* ── reduced motion — everything renders settled ───────────── */

@media (prefers-reduced-motion: reduce) {
  .type {
    clip-path: none;
    animation: none;
  }
  .caret {
    animation: none;
    opacity: 1;
  }
  .rule-thick {
    animation: none;
    transform: none;
  }
}
