/* Hallmark · macrostructure: Stat-Led · nav: N8 Terminal command · footer: Ft4 Dense colophon
 * genre: atmospheric · theme: Terminal (inherited from the live sibling panels — see design.md)
 * tone: technical · anchor hue: phosphor (chromatic-other) · enrichment: none (typography only)
 * pre-emit critique: P5 H5 E4 S5 R5 V4
 */

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

html, body {
  /* clip, never hidden — `hidden` on the root kills position:sticky in
   * several engines and is the classic cause of "the nav stopped sticking on
   * mobile only". */
  overflow-x: clip;
}

html {
  scrollbar-color: var(--color-dim-2) var(--color-paper);
  scrollbar-width: thin;
}

body {
  background: var(--color-paper);
  color: var(--color-ink-2);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* CRT scanline overlay — the one piece of atmosphere the family already has.
 * Static, not animated: it costs nothing and it is the reason these panels
 * read as instruments rather than as dashboards. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 2px,
    oklch(0% 0 0 / 0.06) 2px, oklch(0% 0 0 / 0.06) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

.wrap {
  width: 100%;
  max-width: 76rem;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.tnum { font-variant-numeric: tabular-nums; }

a { color: var(--color-ink); text-decoration-color: var(--color-rule); text-underline-offset: 3px; }
a:hover { color: var(--color-white); text-decoration-color: currentColor; }
a:focus-visible,
.chip:focus-visible,
.skip:focus-visible {
  /* Never animated: a focus ring that fades in is a focus ring that arrives
   * after the user has already moved. */
  outline: var(--rule-thick) solid var(--color-focus);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: var(--space-md);
  top: var(--space-md);
  z-index: 10000;
  background: var(--color-paper-2);
  border: var(--rule-hair) solid var(--color-ink);
  padding: var(--space-xs) var(--space-md);
}

/* ── N8 Terminal command nav ─────────────────────────────────────────── */

.prompt {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-paper);
  border-bottom: var(--rule-hair) solid var(--color-rule);
}

.prompt-in {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-sm);
  min-height: 3rem;
  font-size: var(--text-sm);
}

.prompt-sigil { color: var(--color-dim-2); }

.prompt-cmd {
  color: var(--color-ink);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
}

.prompt-flags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-md);
}

.prompt-flags a {
  color: var(--color-dim);
  text-decoration: none;
  /* 44px hit target on touch without inflating the bar on desktop. */
  padding-block: var(--space-xs);
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  /* A nav link that wraps to two lines is unclickable-looking on a phone. */
  white-space: nowrap;
}
.prompt-flags a:hover { color: var(--color-ink); }

.caret {
  width: 0.5em;
  height: 1em;
  background: var(--color-ink);
  animation: blink 1.1s steps(2, start) infinite;
  margin-inline-start: auto;
}
@keyframes blink { to { visibility: hidden; } }

/* ── Stat-Led hero ───────────────────────────────────────────────────── */

.hero {
  padding-block: clamp(var(--space-2xl), 9vw, var(--space-4xl)) var(--space-3xl);
  border-bottom: var(--rule-hair) solid var(--color-rule);
}

.hero-eyebrow {
  color: var(--color-dim-2);
  font-size: var(--text-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.figure {
  font-family: var(--font-display);
  font-size: var(--text-display);
  font-style: normal;
  font-weight: 700;
  line-height: 0.9;
  color: var(--color-ink);
  text-shadow: 0 0 24px oklch(87% 0.28 145 / 0.35);
  margin-block: var(--space-sm) var(--space-md);
  /* Long numbers must break rather than push the page sideways. */
  overflow-wrap: anywhere;
  min-width: 0;
}

.hero-head {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 700;
  font-size: clamp(var(--text-xl), 3.4vw, var(--text-3xl));
  line-height: 1.15;
  color: var(--color-white);
  text-wrap: balance;
  max-width: 26ch;
  overflow-wrap: anywhere;
  min-width: 0;
}

.hero-qual {
  margin-block-start: var(--space-md);
  max-width: 62ch;
  color: var(--color-dim);
}
.hero-qual strong { color: var(--color-ink); font-variant-numeric: tabular-nums; }
.hero-qual code {
  color: var(--color-white);
  background: var(--color-paper-3);
  padding: 0 0.3em;
}

.hero-note {
  margin-block-start: var(--space-md);
  color: var(--color-warn);
  font-size: var(--text-sm);
  border-inline-start: var(--rule-thick) solid var(--color-warn);
  padding-inline-start: var(--space-sm);
  max-width: 62ch;
}

/* ── Section heads ───────────────────────────────────────────────────── */

.sec-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-md);
  align-items: baseline;
  padding-block-end: var(--space-lg);
  border-bottom: var(--rule-hair) solid var(--color-rule);
  margin-block-end: var(--space-xl);
}
.sec-head h2 {
  font-family: var(--font-display);
  font-style: normal;
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-white);
  overflow-wrap: anywhere;
  min-width: 0;
}
.sec-head p { color: var(--color-dim-2); font-size: var(--text-sm); }

section.surfaces,
section.services,
section.mailblock { padding-block: var(--space-3xl); }

/* ── Surfaces — hairline-ruled stat blocks, the Stat-Led divider language ── */

.surface-list { list-style: none; }

.surface {
  display: grid;
  grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
  gap: var(--space-md) var(--space-xl);
  padding-block: var(--space-lg);
  border-bottom: var(--rule-hair) solid var(--color-rule);
}

.surface-id h3 {
  font-family: var(--font-display);
  font-style: normal;
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-white);
}
.surface-id a { font-size: var(--text-xs); color: var(--color-dim-2); }
.surface-id a:hover { color: var(--color-ink); }

.surface-nums {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: var(--space-md);
}
.surface-num .n {
  display: block;
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1.1;
  color: var(--color-ink);
  font-variant-numeric: tabular-nums;
}
.surface-num .l {
  display: block;
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-dim-2);
}
.surface-num.is-down .n { color: var(--color-warn); }

.surface-err {
  grid-column: 1 / -1;
  color: var(--color-warn);
  font-size: var(--text-sm);
}

/* ── Services ────────────────────────────────────────────────────────── */

.svc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: var(--space-xl);
}
.svc h3 {
  font-family: var(--font-display);
  font-style: normal;
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-ink);
  padding-block-end: var(--space-xs);
  border-bottom: var(--rule-hair) solid var(--color-rule);
  margin-block-end: var(--space-sm);
}
.svc p { color: var(--color-dim); font-size: var(--text-sm); }

.svc-cta {
  margin-block-start: var(--space-2xl);
  padding-block-start: var(--space-lg);
  border-top: var(--rule-hair) solid var(--color-rule);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md) var(--space-xl);
  align-items: center;
  justify-content: space-between;
}
.svc-cta p { color: var(--color-dim); max-width: 46ch; }

/* C1 outlined chip — the Stat-Led button voice. */
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: var(--space-xs) var(--space-lg);
  border: var(--rule-hair) solid var(--color-ink);
  color: var(--color-ink);
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.chip:hover { background: var(--color-ink); color: var(--color-paper); }
.chip:active { transform: translateY(1px); }

/* ── Mail strip ──────────────────────────────────────────────────────── */

.mail-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
  gap: var(--space-lg);
}
.mail-cell .n {
  display: block;
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1.1;
  color: var(--color-ink);
  font-variant-numeric: tabular-nums;
}
.mail-cell .l {
  display: block;
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-dim-2);
}
.mail-cell.is-alert .n { color: var(--color-alert); }
.mail-cell.is-warn  .n { color: var(--color-warn); }
.mail-strip .loading,
.mail-strip .strip-err { grid-column: 1 / -1; color: var(--color-dim-2); }
.mail-strip .strip-err { color: var(--color-warn); }

.nojs { color: var(--color-dim); }

/* ── Ft4 Dense colophon ──────────────────────────────────────────────── */

.colophon {
  border-top: var(--rule-hair) solid var(--color-rule);
  padding-block: var(--space-xl) var(--space-2xl);
  font-size: var(--text-xs);
  color: var(--color-dim-2);
}
.colo-line { color: var(--color-dim); max-width: 70ch; }
.colo-line strong { color: var(--color-ink); }
.colo-meta { margin-block-start: var(--space-sm); }
.colo-meta a { min-height: 2.75rem; display: inline-flex; align-items: center; }
.colo-sep { color: var(--color-rule); padding-inline: var(--space-xs); }

/* ── Mobile ──────────────────────────────────────────────────────────── */

@media (max-width: 60rem) {
  .surface { grid-template-columns: minmax(0, 1fr); }
  /* Section heads collapse to one column — a two-column head at 375px is the
   * single most common way a "responsive" page ships broken. */
  .sec-head { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 40rem) {
  .prompt-in { min-height: 2.75rem; }
  .caret { display: none; }
  .surface-num .n,
  .mail-cell .n { font-size: var(--text-xl); }
  .svc-cta { justify-content: flex-start; }
  .chip { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .caret { visibility: visible; }
}
