/* ==========================================================================
   CORE DAMAGE — landing page
   Design system: a 1970s control panel. Painted steel, phosphor, lamp amber.
   No external images anywhere; every mark on this page is SVG, canvas or CSS.
   ========================================================================== */

:root {
  /* --- surfaces: warm near-black, like unlit painted steel --- */
  --bg:         #0a0908;
  --bg-2:       #100e0c;
  --bg-3:       #17140f;
  --panel:      #14110d;
  --line:       #2a251d;
  --line-soft:  #1e1a15;

  /* --- ink --- */
  --ink:        #f2ece1;
  --ink-2:      #b3aa9b;
  --ink-3:      #7b7365;
  --ink-faint:  #4a443b;

  /* --- the one accent: annunciator lamp amber ---
     Chosen for contrast against the near-black surface, not for brand reasons.
     Everything else on the page is neutral so this is never ambiguous. */
  --amber:      #ff8f2e;
  --amber-dim:  #b3611c;
  --amber-glow: rgba(255, 143, 46, 0.22);

  /* --- status. Reserved: never reused as decoration. Always paired with a
         position or a label, never carrying meaning by hue alone. --- */
  --ok:         #4ea36a;
  --warn:       #d9a441;
  --crit:       #ff4d3d;

  /* --- phosphor green, used only for live readouts --- */
  --phos:       #6fe39f;

  --radius:     4px;
  --wrap:       1140px;

  --ease:       cubic-bezier(.22,.61,.36,1);
}

/* ========================================================================== */

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.mono { font-family: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace; }

.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;
}

.wrap { width: min(100% - 48px, var(--wrap)); margin-inline: auto; }
.dim  { color: var(--ink-3); }

/* ── decorative overlays ─────────────────────────────────────────────────── */

.grain, .scanlines, .vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 100;
}

/* film grain, generated — no image file */
.grain {
  opacity: .16; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

.scanlines {
  opacity: .5;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0px, rgba(0,0,0,0) 2px,
    rgba(0,0,0,.22) 3px, rgba(0,0,0,.22) 3px
  );
}

.vignette {
  background: radial-gradient(120% 90% at 50% 40%, transparent 45%, rgba(0,0,0,.72) 100%);
}

@media (prefers-reduced-motion: reduce) { .grain { display: none; } }

/* ── control strip ───────────────────────────────────────────────────────── */

.strip {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 20px;
  background: rgba(10,9,8,.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
  font-size: 11.5px; letter-spacing: .1em;
  color: var(--ink-3);
}

.strip__unit { display: flex; align-items: center; gap: 9px; color: var(--ink-2); }
.strip__mid  { color: var(--amber-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip__clock { color: var(--phos); font-variant-numeric: tabular-nums; }

@media (max-width: 720px) { .strip__mid { display: none; } }

.lamp {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--crit); box-shadow: 0 0 8px var(--crit);
  animation: blink 1.6s steps(1) infinite;
}
@keyframes blink { 0%,49% { opacity:1 } 50%,100% { opacity:.18 } }
@media (prefers-reduced-motion: reduce) { .lamp { animation: none; opacity: .9; } }

/* ── hero ────────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid; place-items: center;
  padding: 120px 24px 90px;
  overflow: hidden;
}

/* the chart-recorder trace, drawn continuously behind the title */
.hero__trace {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: .5;
}

.hero__inner {
  position: relative; z-index: 2;
  max-width: 820px; text-align: center;
}

.eyebrow {
  font-size: 11.5px; letter-spacing: .22em; color: var(--amber);
  margin: 0 0 26px;
}

.title {
  font-family: 'Anton', 'Barlow', sans-serif;
  font-weight: 400;
  font-size: clamp(58px, 13.5vw, 168px);
  line-height: .86;
  letter-spacing: -.012em;
  margin: 0 0 30px;
  color: var(--ink);
  text-shadow: 0 0 60px rgba(255,143,46,.16);
}
.title__break { display: inline; }
@media (max-width: 560px) { .title__break { display: block; height: 0; } }

.lede {
  font-size: clamp(19px, 2.4vw, 25px);
  line-height: 1.45; font-weight: 500;
  color: var(--ink); margin: 0 0 20px;
}

.sub {
  font-size: 16.5px; color: var(--ink-2);
  max-width: 620px; margin: 0 auto 40px;
}

.hero__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.hero__scroll {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  font-size: 10.5px; letter-spacing: .3em; color: var(--ink-faint);
  animation: drift 2.6s var(--ease) infinite;
}
@keyframes drift { 0%,100% { transform: translate(-50%,0); opacity:.5 } 50% { transform: translate(-50%,7px); opacity:1 } }
@media (prefers-reduced-motion: reduce) { .hero__scroll { animation: none; } }

/* ── buttons ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 24px;
  font-family: 'Barlow', sans-serif;
  font-size: 14.5px; font-weight: 600; letter-spacing: .04em;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer; text-decoration: none;
  transition: transform .16s var(--ease), background .16s var(--ease),
              border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

.btn--primary {
  background: var(--amber); color: #1a0d02;
  box-shadow: 0 0 0 0 var(--amber-glow);
}
.btn--primary:hover { background: #ffa254; box-shadow: 0 0 26px var(--amber-glow); }

.btn--ghost {
  background: transparent; color: var(--ink-2); border-color: var(--line);
}
.btn--ghost:hover { color: var(--ink); border-color: var(--ink-faint); background: var(--bg-2); }

.btn--lg   { padding: 16px 30px; font-size: 15.5px; }
.btn--full { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ── section furniture ───────────────────────────────────────────────────── */

section { position: relative; z-index: 2; }

.kicker {
  font-size: 11px; letter-spacing: .22em; color: var(--amber-dim);
  margin: 0 0 18px;
}

.h2 {
  font-family: 'Anton', sans-serif; font-weight: 400;
  font-size: clamp(28px, 4.4vw, 46px);
  line-height: 1.1; letter-spacing: -.005em;
  margin: 0 0 34px;
}

.premise { padding: 110px 0 90px; border-top: 1px solid var(--line-soft); background: var(--bg-2); }

.premise__grid {
  display: grid; gap: 26px;
  grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
  color: var(--ink-2); font-size: 16.5px;
}
.premise__grid p { margin: 0; }
.premise__grid strong { color: var(--amber); font-weight: 600; }

/* ── figure / chart ──────────────────────────────────────────────────────── */

.figure-section { padding: 100px 0; }

.figure {
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.figure__head { padding: 30px 32px 22px; border-bottom: 1px solid var(--line-soft); }

.figure__title {
  font-family: 'Anton', sans-serif; font-weight: 400;
  font-size: 27px; margin: 0 0 10px; letter-spacing: .002em;
}

.figure__sub { margin: 0; font-size: 15px; color: var(--ink-3); max-width: 66ch; }

.figure__plot { padding: 18px 12px 6px; }
.figure__plot svg { display: block; width: 100%; height: auto; overflow: visible; }

.figure__foot {
  padding: 14px 32px 18px;
  font-size: 10.5px; letter-spacing: .12em; color: var(--ink-faint);
  border-top: 1px solid var(--line-soft);
}

/* chart internals */
.ax-line   { stroke: var(--line); stroke-width: 1; }
.grid-line { stroke: var(--line-soft); stroke-width: 1; }
.ax-label  { fill: var(--ink-3); font-family: 'IBM Plex Mono', monospace; font-size: 11px; }
.ax-title  { fill: var(--ink-faint); font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; letter-spacing: .14em; }
.series    { fill: none; stroke: var(--amber); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.series-fill { fill: url(#decayFill); }
.pt        { fill: var(--amber); stroke: var(--panel); stroke-width: 2; }
.pt-label  { fill: var(--ink); font-family: 'IBM Plex Mono', monospace; font-size: 12px; font-weight: 500; }
.pt-sub    { fill: var(--ink-3); font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; }

/* table view — identity is never colour-alone */
.table-toggle { margin-top: 20px; }
.table-toggle summary {
  cursor: pointer; font-size: 11.5px; letter-spacing: .14em;
  color: var(--ink-3); padding: 8px 0;
}
.table-toggle summary:hover { color: var(--ink-2); }

.data-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14.5px; }
.data-table th, .data-table td {
  text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--line-soft);
}
.data-table th {
  font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; letter-spacing: .12em;
  color: var(--ink-faint); font-weight: 500;
}
.data-table td { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.data-table td:first-child { color: var(--ink); }

/* ── gauges ──────────────────────────────────────────────────────────────── */

.panel-section { padding: 100px 0; border-top: 1px solid var(--line-soft); background: var(--bg-2); }

.panel {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(214px, 1fr));
  padding: 26px;
  background:
    linear-gradient(180deg, var(--bg-3), var(--panel));
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

.gauge { text-align: center; }
.gauge svg { display: block; width: 100%; height: auto; }

.gauge__name {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px; letter-spacing: .16em; color: var(--ink-3);
  margin: 10px 0 3px;
}
.gauge__val {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 15px; font-weight: 500; color: var(--phos);
  font-variant-numeric: tabular-nums;
}
.gauge__val[data-state="warn"] { color: var(--warn); }
.gauge__val[data-state="crit"] { color: var(--crit); }

/* the state word is the secondary encoding — colour never carries it alone */
.gauge__state {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px; letter-spacing: .18em; margin-top: 3px; color: var(--ink-faint);
}

.panel__note {
  margin: 26px auto 0; max-width: 74ch;
  font-size: 15.5px; color: var(--ink-3);
}

/* ── pillars ─────────────────────────────────────────────────────────────── */

.pillars-section { padding: 100px 0; }

.pillars {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 1px;
  grid-template-columns: repeat(auto-fit, minmax(288px, 1fr));
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: 6px; overflow: hidden;
}

.pillar { background: var(--bg); padding: 34px 30px; }
.pillar__num {
  display: block; font-size: 11px; letter-spacing: .2em;
  color: var(--amber-dim); margin-bottom: 14px;
}
.pillar h3 {
  font-family: 'Anton', sans-serif; font-weight: 400;
  font-size: 21px; margin: 0 0 11px; letter-spacing: .004em;
}
.pillar p { margin: 0; font-size: 15.5px; color: var(--ink-3); }

/* ── cta ─────────────────────────────────────────────────────────────────── */

.cta-section {
  padding: 110px 0 120px;
  border-top: 1px solid var(--line-soft);
  background:
    radial-gradient(70% 120% at 50% 0%, rgba(255,143,46,.07), transparent 60%),
    var(--bg-2);
}
.cta { text-align: center; }
.cta__sub { max-width: 56ch; margin: 0 auto 32px; color: var(--ink-2); font-size: 16.5px; }

/* ── footer ──────────────────────────────────────────────────────────────── */

.foot { padding: 30px 0 46px; border-top: 1px solid var(--line-soft); }
.foot__inner {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 11px; letter-spacing: .1em; color: var(--ink-faint);
}

/* ── modal ───────────────────────────────────────────────────────────────── */

.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }

.modal__scrim {
  position: absolute; inset: 0;
  background: rgba(4,3,2,.82); backdrop-filter: blur(6px);
  animation: fade .2s var(--ease);
}
@keyframes fade { from { opacity: 0 } }

.modal__card {
  position: relative;
  width: min(100%, 520px);
  max-height: calc(100svh - 40px); overflow-y: auto;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 34px 34px 30px;
  box-shadow: 0 32px 80px rgba(0,0,0,.6);
  animation: rise .26s var(--ease);
}
@keyframes rise { from { opacity: 0; transform: translateY(14px) } }
@media (prefers-reduced-motion: reduce) {
  .modal__scrim, .modal__card { animation: none; }
}

.modal__x {
  position: absolute; top: 14px; right: 14px;
  width: 34px; height: 34px; display: grid; place-items: center;
  background: transparent; border: 1px solid var(--line-soft);
  border-radius: var(--radius); color: var(--ink-3); cursor: pointer;
  transition: color .15s, border-color .15s;
}
.modal__x:hover { color: var(--ink); border-color: var(--ink-faint); }
.modal__x:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.modal__title {
  font-family: 'Anton', sans-serif; font-weight: 400;
  font-size: 30px; margin: 0 0 10px;
}
.modal__desc { margin: 0 0 26px; font-size: 15.5px; color: var(--ink-3); }

/* ── form ────────────────────────────────────────────────────────────────── */

.field { margin-bottom: 18px; }
.field label {
  display: block; font-size: 10.5px; letter-spacing: .16em;
  color: var(--ink-3); margin-bottom: 7px;
}
.field .opt { color: var(--ink-faint); letter-spacing: .04em; }
.field .req { color: var(--amber-dim); letter-spacing: .04em; }

.field input, .field textarea {
  width: 100%; padding: 12px 14px;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius);
  font-family: 'Barlow', sans-serif; font-size: 15.5px;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 92px; }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-faint); }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(255,143,46,.13);
}
.field input[aria-invalid="true"] { border-color: var(--crit); }

.err { margin: 7px 0 0; font-size: 13px; color: var(--crit); }

/* honeypot — visually gone, still reachable by bots */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-status { margin: 14px 0 0; font-size: 14.5px; min-height: 1.2em; }
.form-status[data-state="ok"]   { color: var(--ok); }
.form-status[data-state="bad"]  { color: var(--crit); }
.form-status[data-state="busy"] { color: var(--ink-3); }

.privacy { margin: 18px 0 0; font-size: 10.5px; line-height: 1.6; color: var(--ink-faint); }

/* ── responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 700px) {
  body { font-size: 16px; }
  .wrap { width: calc(100% - 36px); }
  .figure__head, .figure__foot { padding-inline: 20px; }
  .premise, .figure-section, .panel-section, .pillars-section { padding: 72px 0; }
  .cta-section { padding: 80px 0 88px; }
  .modal__card { padding: 28px 22px 24px; }
  .panel { padding: 18px; }
}

/* ── print / forced colors ───────────────────────────────────────────────── */

@media (forced-colors: active) {
  .series { stroke: LinkText; }
  .btn--primary { border: 1px solid ButtonText; }
  .grain, .scanlines, .vignette { display: none; }
}
.hit { cursor: crosshair; }
