/* ==========================================================================
   NEXUS DESIGN SYSTEM — tokens, base, primitives, components
   --------------------------------------------------------------------------
   Layer 1 of 2. Owns everything reusable. Page/section composition lives in
   nexus-site.css. Nothing in this file should reference a specific page.

   Structure:
     01  Tokens
     02  Reset + base
     03  Layout primitives
     04  Typography
     05  Buttons
     06  Surfaces + cards
     07  Badges, chips, labels
     08  Instrument (data display) parts
     09  Tables
     10  Navigation
     11  Footer
     12  Motion primitives
   ========================================================================== */

/* ── 01 TOKENS ─────────────────────────────────────────────────────────── */

:root {
  /* Surface elevation ladder. Everything that needs to sit "above" something
     else moves up this scale — this is what gives the page hierarchy. */
  --surface-0:  #06070c;   /* page */
  --surface-1:  #090b13;   /* alternating section */
  --surface-2:  #0e1119;   /* resting card */
  --surface-3:  #141826;   /* raised panel */
  --surface-4:  #1b2032;   /* floating / featured */
  --surface-sunken: #04050a;

  --line-subtle: rgba(126,160,255,0.07);
  --line:        rgba(126,160,255,0.13);
  --line-strong: rgba(126,160,255,0.24);

  /* Brand */
  --brand:        #4f7cff;
  --brand-bright: #7ea0ff;
  --brand-deep:   #2b4fd0;
  --brand-wash:   rgba(79,124,255,0.10);
  --brand-edge:   rgba(79,124,255,0.32);
  --accent:       #8b5cf6;
  --accent-wash:  rgba(139,92,246,0.12);

  /* Semantic data colors — market direction is NOT the same as grade result.
     Keeping these separate is what lets a chart and a verdict coexist. */
  --data-up:    #16d876;
  --data-down:  #ff4d6a;
  --data-flat:  #7b88a8;

  --state-pass: #2ee6a8;
  --state-warn: #f5c84c;
  --state-fail: #ff4d6a;
  --state-live: #2ee6a8;

  --pass-wash: rgba(46,230,168,0.12);
  --warn-wash: rgba(245,200,76,0.12);
  --fail-wash: rgba(255,77,106,0.12);

  /* Text */
  --text:    #eaeefb;
  --text-2:  #9aa6c4;
  --text-3:  #5f6b8a;
  --text-on-brand: #060a16;

  /* Type */
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'Roboto Mono', ui-monospace, SFMono-Regular, monospace;

  --fs-display: clamp(42px, 5.6vw, 74px);
  --fs-h1:      clamp(34px, 4.2vw, 54px);
  --fs-h2:      clamp(27px, 3vw, 40px);
  --fs-h3:      clamp(19px, 1.5vw, 23px);
  --fs-h4:      17px;
  --fs-lead:    clamp(16px, 1.15vw, 18.5px);
  --fs-body:    15.5px;
  --fs-sm:      13.5px;
  --fs-xs:      12px;
  --fs-micro:   10.5px;

  --lh-tight: 1.06;
  --lh-snug:  1.25;
  --lh-body:  1.65;

  --tracking-label: 0.14em;
  --tracking-tight: -0.025em;

  /* Space — 4px base */
  --s1: 4px;   --s2: 8px;   --s3: 12px;  --s4: 16px;
  --s5: 20px;  --s6: 24px;  --s8: 32px;  --s10: 40px;
  --s12: 48px; --s16: 64px; --s20: 80px; --s24: 96px;
  --s32: 128px; --s40: 160px;

  /* Radius */
  --r-sm: 6px; --r: 10px; --r-md: 14px; --r-lg: 20px; --r-xl: 28px; --r-full: 999px;

  /* Elevation */
  --e1: 0 1px 2px rgba(0,0,0,0.35);
  --e2: 0 4px 14px rgba(0,0,0,0.40);
  --e3: 0 12px 34px rgba(0,0,0,0.48);
  --e4: 0 28px 70px rgba(0,0,0,0.58);
  --glow-brand: 0 0 0 1px var(--brand-edge), 0 12px 40px rgba(79,124,255,0.20);
  --glow-pass:  0 0 12px rgba(46,230,168,0.55);

  /* Motion */
  --dur-fast:  160ms;
  --dur:       280ms;
  --dur-slow:  520ms;
  --dur-cine:  1150ms;
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --container: 1180px;
  --container-wide: 1360px;
  --container-narrow: 760px;
  --gutter: clamp(18px, 4vw, 40px);
  --nav-h: 72px;
}

/* ── 02 RESET + BASE ───────────────────────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 20px);
  -webkit-text-size-adjust: 100%;
  /* Reveal transforms displace elements horizontally before they fire; clip
     so that never becomes a horizontal scrollbar. `clip` (unlike `hidden`)
     does not turn the root into a scroll container, so position:sticky in
     .sticky-col keeps working. */
  overflow-x: clip;
}
@supports not (overflow-x: clip) {
  html { overflow-x: hidden; }
}

body {
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text);
  background: var(--surface-0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg, canvas, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
table { border-collapse: collapse; width: 100%; }
::selection { background: var(--brand); color: #fff; }

:focus-visible {
  outline: 2px solid var(--brand-bright);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── 03 LAYOUT PRIMITIVES ──────────────────────────────────────────────── */

.container      { width: 100%; max-width: var(--container);        margin-inline: auto; padding-inline: var(--gutter); }
.container-wide { width: 100%; max-width: var(--container-wide);   margin-inline: auto; padding-inline: var(--gutter); }
.container-narrow { width: 100%; max-width: var(--container-narrow); margin-inline: auto; padding-inline: var(--gutter); }

.stack > * + * { margin-top: var(--stack-gap, var(--s4)); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--cluster-gap, var(--s3)); align-items: center; }

/* Autofit grid — the default for card groups. */
.grid { display: grid; gap: var(--grid-gap, var(--s5)); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(var(--grid-min, 260px), 1fr)); }

@media (max-width: 1000px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
}

/* Hairline rule that fades at both ends — used to separate movements. */
.rule {
  height: 1px; border: 0;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}

/* ── 04 TYPOGRAPHY ─────────────────────────────────────────────────────── */

.display {
  font-size: var(--fs-display);
  font-weight: 800;
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
}
h1, .h1 { font-size: var(--fs-h1); font-weight: 800; line-height: 1.1;  letter-spacing: var(--tracking-tight); }
h2, .h2 { font-size: var(--fs-h2); font-weight: 700; line-height: 1.14; letter-spacing: -0.02em; }
h3, .h3 { font-size: var(--fs-h3); font-weight: 650; line-height: 1.3;  letter-spacing: -0.01em; }
h4, .h4 { font-size: var(--fs-h4); font-weight: 650; line-height: 1.35; }

.lead     { font-size: var(--fs-lead); color: var(--text-2); line-height: 1.6; }
.muted    { color: var(--text-2); }
.dim      { color: var(--text-3); }
.fine     { font-size: var(--fs-xs); color: var(--text-3); line-height: 1.55; }
.mono     { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.numeric  { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* Text that carries a light gradient. Used sparingly — headline only. */
.text-gradient {
  background: linear-gradient(150deg, #ffffff 30%, #9db4ff 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* Section eyebrow — the bracketed mono label that marks every movement. */
.eyebrow {
  display: inline-flex; align-items: center; gap: var(--s2);
  font-family: var(--mono);
  font-size: var(--fs-micro);
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--brand-bright);
}
.eyebrow::before { content: '['; color: var(--brand); }
.eyebrow::after  { content: ']'; color: var(--brand); }
.eyebrow.plain::before, .eyebrow.plain::after { content: none; }

/* ── 05 BUTTONS ────────────────────────────────────────────────────────── */

.btn {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  --btn-line: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  padding: 13px 24px;
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--btn-fg);
  background: var(--btn-bg);
  border: 1px solid var(--btn-line);
  border-radius: var(--r);
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out);
}
.btn:hover  { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  --btn-fg: #fff;
  --btn-line: transparent;
  background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
  box-shadow: 0 6px 22px rgba(79,124,255,0.28);
}
.btn-primary:hover { box-shadow: 0 10px 32px rgba(79,124,255,0.42); }

.btn-secondary {
  --btn-bg: var(--surface-3);
  --btn-line: var(--line-strong);
}
.btn-secondary:hover { --btn-bg: var(--surface-4); --btn-line: var(--brand-edge); }

.btn-ghost { --btn-line: transparent; --btn-fg: var(--text-2); padding-inline: 14px; }
.btn-ghost:hover { --btn-fg: var(--text); --btn-line: var(--line); }

.btn-block { width: 100%; }
.btn-sm { padding: 9px 16px; font-size: var(--fs-xs); }

/* Arrow that slides on hover — cheap, and it makes links feel responsive. */
.btn .arrow { transition: transform var(--dur) var(--ease-out); }
.btn:hover .arrow { transform: translateX(3px); }

/* ── 06 SURFACES + CARDS ───────────────────────────────────────────────── */

.card {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s6);
  transition: transform var(--dur) var(--ease-out),
              border-color var(--dur) var(--ease-out),
              background-color var(--dur) var(--ease-out),
              box-shadow var(--dur) var(--ease-out);
}
.card-raised   { background: var(--surface-3); box-shadow: var(--e2); }
.card-floating { background: var(--surface-4); box-shadow: var(--e3); }

/* Only interactive cards lift. Static ones stay put — movement should mean
   something is clickable. */
.card-interactive:hover {
  transform: translateY(-3px);
  border-color: var(--brand-edge);
  background: var(--surface-3);
  box-shadow: var(--e3);
}

/* Featured card gets a real gradient edge rather than just a brighter border. */
.card-featured {
  background: var(--surface-3);
  border-color: transparent;
  box-shadow: var(--e3);
}
.card-featured::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(160deg, var(--brand) 0%, var(--accent) 45%, transparent 80%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

/* Panel = a framed instrument. Reads as hardware, not as a content card. */
.panel {
  position: relative;
  background: linear-gradient(180deg, var(--surface-2), var(--surface-sunken));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--e3);
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: var(--s2);
  padding: 11px var(--s5);
  background: var(--surface-3);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.05em;
  color: var(--text-2);
}
.panel-body { padding: var(--s5); }
.panel-foot {
  padding: 10px var(--s5);
  border-top: 1px solid var(--line-subtle);
  font-family: var(--mono);
  font-size: var(--fs-micro);
  color: var(--text-3);
}

/* Corner brackets — the terminal signature. Applied to instruments only. */
.bracketed::before, .bracketed::after,
.bracketed > .bracket-b::before, .bracketed > .bracket-b::after {
  content: ''; position: absolute; width: 13px; height: 13px;
  border-color: var(--brand); opacity: 0.55; pointer-events: none; z-index: 2;
}
.bracketed::before { top: -1px; left: -1px;  border-top: 2px solid; border-left: 2px solid;  border-top-left-radius: 3px; }
.bracketed::after  { top: -1px; right: -1px; border-top: 2px solid; border-right: 2px solid; border-top-right-radius: 3px; }
.bracketed > .bracket-b::before { bottom: -1px; left: -1px;  border-bottom: 2px solid; border-left: 2px solid;  border-bottom-left-radius: 3px; }
.bracketed > .bracket-b::after  { bottom: -1px; right: -1px; border-bottom: 2px solid; border-right: 2px solid; border-bottom-right-radius: 3px; }

/* ── 07 BADGES, CHIPS, LABELS ──────────────────────────────────────────── */

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px;
  font-family: var(--mono);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: var(--r-full);
  border: 1px solid var(--brand-edge);
  background: var(--brand-wash);
  color: var(--brand-bright);
}
.badge-pass { border-color: rgba(46,230,168,0.3); background: var(--pass-wash); color: var(--state-pass); }
.badge-warn { border-color: rgba(245,200,76,0.3); background: var(--warn-wash); color: var(--state-warn); }
.badge-fail { border-color: rgba(255,77,106,0.3); background: var(--fail-wash); color: var(--state-fail); }
.badge-solid {
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff;
}

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  transition: color var(--dur-fast), border-color var(--dur-fast), background-color var(--dur-fast);
}
a.chip:hover, button.chip:hover { color: var(--text); border-color: var(--brand-edge); background: var(--surface-3); }

/* Live dot — the one piece of ambient motion allowed everywhere. */
.live-dot {
  width: 7px; height: 7px; flex: 0 0 7px;
  border-radius: 50%;
  background: var(--state-live);
  box-shadow: var(--glow-pass);
  animation: nx-pulse 2.2s var(--ease-in-out) infinite;
}
.live-dot.brand { background: var(--brand); box-shadow: 0 0 10px var(--brand); }

@keyframes nx-pulse {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(0.82); }
}

/* Segmented control — asset / timeframe pickers. */
.segmented { display: flex; flex-wrap: wrap; gap: 5px; }
.segmented button {
  padding: 8px 13px;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  transition: all var(--dur-fast) var(--ease-out);
}
.segmented button:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface-3); }
.segmented button.active {
  color: var(--text);
  background: var(--brand-wash);
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand-wash), 0 0 14px rgba(79,124,255,0.18);
}

/* ── 08 INSTRUMENT PARTS ───────────────────────────────────────────────── */

/* A "stat" is one measured number with a label. The number is the hero, so
   it gets mono + tabular figures and a size well above the label. */
.stat { display: flex; flex-direction: column; gap: 3px; }
.stat-value {
  font-family: var(--mono);
  font-size: clamp(26px, 2.6vw, 38px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.stat-value.pass { color: var(--state-pass); }
.stat-label {
  font-family: var(--mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-3);
}
.stat-note { font-size: var(--fs-xs); color: var(--text-2); line-height: 1.5; }

.stat-sm .stat-value { font-size: 20px; }

/* Readout row — label left, value right, hairline between. */
.readout {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4);
  padding: 11px 0;
  border-bottom: 1px solid var(--line-subtle);
}
.readout:last-child { border-bottom: none; }
.readout > span {
  font-family: var(--mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}
.readout > strong {
  font-family: var(--mono);
  font-size: 19px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

/* Gauge bar — used for forecast band width. */
.gauge {
  height: 5px; border-radius: var(--r-full);
  background: linear-gradient(90deg, var(--state-pass), var(--brand), var(--state-fail));
  opacity: 0.8;
}

/* Directional value coloring. */
.up   { color: var(--data-up); }
.down { color: var(--data-down); }
.flat { color: var(--data-flat); }

/* ── 09 TABLES ─────────────────────────────────────────────────────────── */

.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  overflow: hidden;
}
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.data-table { min-width: 560px; }
.data-table th {
  padding: 12px var(--s5);
  text-align: left;
  font-family: var(--mono);
  font-size: var(--fs-micro);
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-3);
  background: var(--surface-3);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td {
  padding: 13px var(--s5);
  font-family: var(--mono);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
  border-bottom: 1px solid var(--line-subtle);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background-color var(--dur-fast); }
.data-table tbody tr:hover { background: rgba(126,160,255,0.035); }
.data-table td:first-child { color: var(--text); }
.data-table .num { text-align: right; }

/* ── 10 NAVIGATION ─────────────────────────────────────────────────────── */

.nav-surface {
  position: sticky; top: 0; z-index: 60;
  background: rgba(6,7,12,0.72);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid transparent;
  transition: background-color var(--dur) var(--ease-out),
              border-color var(--dur) var(--ease-out);
}
.nav-surface.scrolled {
  background: rgba(6,7,12,0.92);
  border-bottom-color: var(--line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s6);
  height: var(--nav-h);
  max-width: var(--container-wide);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 17px; font-weight: 700; letter-spacing: -0.02em;
  color: var(--text);
}
.logo-img { width: 30px; height: 30px; object-fit: contain; flex-shrink: 0; }

.nav-links { display: flex; align-items: center; gap: var(--s1); }
.nav-links a {
  position: relative;
  padding: 9px 14px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-2);
  border-radius: var(--r-sm);
  transition: color var(--dur-fast);
}
.nav-links a:hover { color: var(--text); }
.nav-links a[aria-current="page"] { color: var(--text); }
.nav-links a[aria-current="page"]::after {
  content: '';
  position: absolute; left: 14px; right: 14px; bottom: 2px;
  height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}
.nav-links .nav-cta {
  margin-left: var(--s3);
  padding: 9px 18px;
  color: var(--brand-bright);
  border: 1px solid var(--brand-edge);
  border-radius: var(--r);
  transition: all var(--dur-fast) var(--ease-out);
}
.nav-links .nav-cta:hover {
  color: #fff;
  background: var(--brand-wash);
  border-color: var(--brand);
  box-shadow: 0 0 20px rgba(79,124,255,0.25);
}
.nav-links .nav-cta::after { content: none; }

.nav-toggle {
  display: none;
  padding: 8px 14px;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    padding: var(--s4) var(--gutter) var(--s6);
    background: rgba(6,7,12,0.97);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
    transform: translateY(-8px);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity var(--dur) var(--ease-out),
                transform var(--dur) var(--ease-out),
                visibility var(--dur);
  }
  .nav-links.open { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); }
  .nav-links a { padding: 13px 10px; font-size: 15px; }
  .nav-links a[aria-current="page"]::after { left: 10px; right: auto; width: 18px; bottom: 6px; }
  .nav-links .nav-cta { margin: var(--s3) 0 0; text-align: center; }
}

/* ── 11 FOOTER ─────────────────────────────────────────────────────────── */

.site-footer {
  padding: var(--s16) 0 var(--s12);
  background: var(--surface-sunken);
  border-top: 1px solid var(--line);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--s10);
  align-items: start;
}
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links h4 {
  font-family: var(--mono);
  font-size: var(--fs-micro);
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 2px;
}
.footer-links a { font-size: var(--fs-sm); color: var(--text-2); transition: color var(--dur-fast); }
.footer-links a:hover { color: var(--brand-bright); }
.footer-legal {
  margin-top: var(--s12);
  padding-top: var(--s6);
  border-top: 1px solid var(--line-subtle);
  text-align: center;
}
@media (max-width: 800px) {
  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: var(--s8); }
}

/* ── 12 MOTION PRIMITIVES ──────────────────────────────────────────────── */

/* Scroll reveal. Elements start displaced and settle when observed.
   nexus-motion.js adds .in — without JS everything stays visible. */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
[data-reveal="left"]  { transform: translateX(-26px); }
[data-reveal="right"] { transform: translateX(26px); }
[data-reveal="scale"] { transform: scale(0.965); }
[data-reveal="fade"]  { transform: none; }

[data-reveal].in { opacity: 1; transform: none; }

/* Below the single-column breakpoint a sideways entrance reads as drift, not
   direction — and it is the only thing that can push the page sideways. */
@media (max-width: 900px) {
  [data-reveal="left"], [data-reveal="right"] { transform: translateY(18px); }
}

/* Staggered children — set once on the parent instead of per-item delays. */
[data-stagger] > * { --reveal-delay: calc(var(--i, 0) * 70ms); }

.no-js [data-reveal],
html:not(.js) [data-reveal] { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}
