/* ═══════════════════════════════════════════════════════════════════════════
   NORTH POINT — FIELD TERMINAL CSS
   5 archaeology themes · terminal aesthetic · Jurassic Logs inspired
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── BASE VARIABLES (amber-terminal default) ─────────────────────────── */
:root {
  --bg:           #0a0800;
  --bg-elev:      #110e00;
  --card:         #140f00;
  --card-elev:    #1c1600;
  --ink:          #c9861a;
  --ink-dim:      #8a5c10;
  --ink-faint:    #4a3208;
  --accent:       #e8a820;
  --accent-dim:   #9e7010;
  --line:         #2a1f00;
  --line-bright:  #4a3800;
  --danger:       #c43020;
  --safe:         #4a9e30;
  --warn:         #c4a020;
  --info:         #2090c4;
  --purple:       #9060c4;
  --font-mono:    'Courier New', 'Lucida Console', monospace;
  --font-ui:      -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --maxw:         1140px;
  --radius:       2px;
  --scan-opacity: 0.04;

  /* diet colors */
  --carn: #c43020;
  --herb: #4a9e30;
  --omni: #c4a020;
  --pisc: #2090c4;
}

/* ── THEME: jungle-excavation ────────────────────────────────────────── */
[data-theme="jungle-excavation"] {
  --bg:          #040a03;
  --bg-elev:     #091408;
  --card:        #0b1709;
  --card-elev:   #121f10;
  --ink:         #b8cc8a;
  --ink-dim:     #7a9050;
  --ink-faint:   #3a5020;
  --accent:      #6abf40;
  --accent-dim:  #3a7020;
  --line:        #1a2c14;
  --line-bright: #2e4a1e;
  --scan-opacity: 0.03;
}

/* ── THEME: fossil-highland ──────────────────────────────────────────── */
[data-theme="fossil-highland"] {
  --bg:          #080a10;
  --bg-elev:     #0d1018;
  --card:        #101420;
  --card-elev:   #161c2a;
  --ink:         #b8b0a0;
  --ink-dim:     #7a7268;
  --ink-faint:   #3e3830;
  --accent:      #7aA0c4;
  --accent-dim:  #426880;
  --line:        #1c2030;
  --line-bright: #303848;
  --scan-opacity: 0.03;
}

/* ── THEME: coastal-deep ─────────────────────────────────────────────── */
[data-theme="coastal-deep"] {
  --bg:          #020810;
  --bg-elev:     #050e1c;
  --card:        #071224;
  --card-elev:   #0c1a30;
  --ink:         #90d4cc;
  --ink-dim:     #50948c;
  --ink-faint:   #204844;
  --accent:      #0cd8c8;
  --accent-dim:  #087870;
  --line:        #0c2030;
  --line-bright: #164050;
  --scan-opacity: 0.05;
}

/* ── THEME: volcanic-rift ────────────────────────────────────────────── */
[data-theme="volcanic-rift"] {
  --bg:          #0c0402;
  --bg-elev:     #160804;
  --card:        #1c0a06;
  --card-elev:   #260e08;
  --ink:         #d49070;
  --ink-dim:     #906040;
  --ink-faint:   #503020;
  --accent:      #e05020;
  --accent-dim:  #903010;
  --line:        #2a1008;
  --line-bright: #421a0e;
  --scan-opacity: 0.04;
}

/* ── THEME: lab (clinical white) ─────────────────────────────────────── */
[data-theme="lab"] {
  --bg:          #f4f6f3;
  --bg-elev:     #ffffff;
  --card:        #fafbf8;
  --card-elev:   #ffffff;
  --ink:         #1b2219;
  --ink-dim:     #4e5a4a;
  --ink-faint:   #8a9287;
  --accent:      #0f7a4e;
  --accent-dim:  #0c5a3a;
  --line:        #d6dcd4;
  --line-bright: #a8b4a4;
  --danger:      #b02420;
  --safe:        #0f7a4e;
  --warn:        #b07010;
  --info:        #1e6eb5;
  --purple:      #6a4aa2;
  --scan-opacity: 0.015;
}
[data-theme="lab"] body { color: var(--ink); }
[data-theme="lab"] body::before,
[data-theme="lab"] body::after { mix-blend-mode: multiply; }

/* ── THEME: dark-ops (black / red) ───────────────────────────────────── */
[data-theme="dark-ops"] {
  --bg:          #050505;
  --bg-elev:     #0a0a0a;
  --card:        #0f0f0f;
  --card-elev:   #141414;
  --ink:         #cf3030;
  --ink-dim:     #8a1a1a;
  --ink-faint:   #4a0a0a;
  --accent:      #ff3030;
  --accent-dim:  #9a1010;
  --line:        #200808;
  --line-bright: #3e1010;
  --danger:      #ff3030;
  --safe:        #60b060;
  --warn:        #d0a020;
  --info:        #4090d0;
  --purple:      #a060c4;
  --scan-opacity: 0.05;
}

/* ── THEME: field (khaki / olive) ────────────────────────────────────── */
[data-theme="field"] {
  --bg:          #1b1f14;
  --bg-elev:     #232818;
  --card:        #29301c;
  --card-elev:   #323a24;
  --ink:         #d4c89a;
  --ink-dim:     #9a9062;
  --ink-faint:   #52502e;
  --accent:      #c0a848;
  --accent-dim:  #8a7a30;
  --line:        #3a3e26;
  --line-bright: #545a3a;
  --danger:      #c24830;
  --safe:        #8aa848;
  --warn:        #d0a840;
  --info:        #6a9a8a;
  --purple:      #8a6ab0;
  --scan-opacity: 0.025;
}

/* ═══════════════════════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-dim) var(--bg-elev);
}
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-elev); }
::-webkit-scrollbar-thumb { background: var(--accent-dim); border-radius: 0; }

body {
  font-family: var(--font-mono);
  background-color: var(--bg);
  background-image: var(--tex-body, none);
  background-repeat: var(--tex-body-repeat, no-repeat);
  background-size: var(--tex-body-size, cover);
  background-position: center center;
  background-attachment: fixed;
  background-blend-mode: var(--tex-body-blend, normal);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* CRT scanlines */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,var(--scan-opacity)) 2px,
    rgba(0,0,0,var(--scan-opacity)) 4px
  );
  pointer-events: none;
  z-index: 9997;
}

/* vignette — darker to keep text readable over photo backgrounds */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.72) 100%),
    linear-gradient(180deg, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0.15) 40%, rgba(0,0,0,0.45) 100%);
  pointer-events: none;
  z-index: 9996;
}

/* ── PER-THEME ACCENT OVERLAY (third image layer) ─────────────────────
   A second, softer image pass on top of the body texture.  Lets warm
   themes ship a smoky gold glaze; jungle ships a canopy shadow; tundra
   ships a drifting fog; etc.  Opacity + blend-mode are per-theme via
   --tex-accent-opacity and --tex-accent-blend. */
.nx-accent-layer {
  position: fixed; inset: 0;
  background-image: var(--tex-accent, none);
  background-size: 110% auto;
  background-position: 50% 50%;
  background-repeat: no-repeat;
  background-attachment: fixed;
  mix-blend-mode: var(--tex-accent-blend, soft-light);
  opacity: var(--tex-accent-opacity, 0);
  pointer-events: none;
  z-index: 9994;
  animation: nx-accent-drift 60s ease-in-out infinite alternate;
  will-change: background-position;
}
[data-theme="amber-terminal"]     { --tex-accent-blend: screen; }
[data-theme="volcanic-rift"]      { --tex-accent-blend: screen; }
[data-theme="desert-badlands"]    { --tex-accent-blend: screen; }
[data-theme="dark-ops"]           { --tex-accent-blend: color-dodge; }
[data-theme="mist-tundra"]        { --tex-accent-blend: lighten; }
[data-theme="rainforest-canopy"]  { --tex-accent-blend: overlay; }
[data-theme="jungle-excavation"]  { --tex-accent-blend: overlay; }
[data-theme="coastal-deep"]       { --tex-accent-blend: screen; }
[data-theme="fossil-highland"]    { --tex-accent-blend: multiply; }
[data-theme="field"]              { --tex-accent-blend: overlay; }
[data-theme="lab"]                { --tex-accent-blend: multiply; }

@keyframes nx-accent-drift {
  0%   { background-position: 50% 50%; }
  100% { background-position: 46% 54%; }
}

/* Film-grain overlay — subtler, no per-frame translate (prevents jitter). */
.nx-grain-layer {
  position: fixed; inset: 0;
  background-image: var(--tex-grain, none);
  background-size: 420px 420px;
  background-repeat: repeat;
  mix-blend-mode: soft-light;
  opacity: var(--tex-grain-opacity, 0.08);
  pointer-events: none;
  z-index: 9995;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent-dim); }

code, pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--card-elev);
  padding: 1px 5px;
  border: 1px solid var(--line);
}

/* ═══════════════════════════════════════════════════════════════════════
   LOADING OVERLAY
   ═══════════════════════════════════════════════════════════════════════ */
#np-loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  gap: 8px;
  transition: opacity 0.4s ease;
}
#np-loader.hidden { opacity: 0; pointer-events: none; }
#np-loader .ld-line { color: var(--ink-dim); font-size: 0.88rem; letter-spacing: 0.05em; }
#np-loader .ld-title { color: var(--accent); font-size: 1.1rem; letter-spacing: 0.12em; }
#np-loader .ld-bar {
  color: var(--accent);
  font-size: 1rem;
  letter-spacing: 0.05em;
  min-height: 1.4em;
}

/* ═══════════════════════════════════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════════════════════════════════ */
header.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--line-bright);
  padding: 0 28px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  min-height: 48px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: bold;
  text-decoration: none;
  padding: 0 4px;
  border-right: 1px solid var(--line);
  padding-right: 20px;
  margin-right: 8px;
}
.brand:hover { color: var(--ink); text-decoration: none; }
.brand .mark { color: var(--accent); font-size: 1.2em; }
.brand small { color: var(--ink-dim); font-size: 0.7em; letter-spacing: 0.06em; margin-left: 6px; }

header.nav nav {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex: 1;
}
header.nav nav a {
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-dim);
  border-right: 1px solid var(--line);
  text-decoration: none;
  transition: background 100ms, color 100ms;
}
header.nav nav a:hover { background: var(--card); color: var(--accent); text-decoration: none; }
header.nav nav a.active { color: var(--accent); background: var(--card); }
header.nav nav a.cta {
  color: var(--bg);
  background: var(--accent);
  font-weight: bold;
  border-right: none;
  margin-left: 4px;
  padding: 0 18px;
}
header.nav nav a.cta:hover { background: var(--ink); }

/* live dot */
.live-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--danger);
  margin-right: 5px;
  animation: pulse-dot 1.4s ease-in-out infinite;
  vertical-align: middle;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

/* theme switcher */
.theme-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 10px;
  border-left: 1px solid var(--line);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.theme-btn {
  width: 36px; height: 36px;
  border-radius: 6px;
  border: 1.5px solid var(--line-bright);
  cursor: pointer;
  padding: 0;
  background-color: var(--card);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  transition: transform 120ms, border-color 120ms, box-shadow 120ms;
  overflow: hidden;
  position: relative;
}
.theme-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.10) 0%, rgba(0,0,0,0.20) 100%);
  pointer-events: none;
}
.theme-btn:hover { transform: scale(1.12); border-color: var(--accent); }
.theme-btn.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-dim), inset 0 0 0 1px var(--accent); }
.theme-btn[data-t="amber-terminal"] {
  background-image: url('/static/textures/themes/amber-terminal@2x.png');
  background-image: -webkit-image-set(
    url('/static/textures/themes/amber-terminal.png') 1x,
    url('/static/textures/themes/amber-terminal@2x.png') 2x);
  background-image: image-set(
    url('/static/textures/themes/amber-terminal.png') 1x,
    url('/static/textures/themes/amber-terminal@2x.png') 2x);
  background-color: #1a1400;
}
.theme-btn[data-t="jungle-excavation"] {
  background-image: url('/static/textures/themes/jungle-excavation@2x.png');
  background-image: -webkit-image-set(
    url('/static/textures/themes/jungle-excavation.png') 1x,
    url('/static/textures/themes/jungle-excavation@2x.png') 2x);
  background-image: image-set(
    url('/static/textures/themes/jungle-excavation.png') 1x,
    url('/static/textures/themes/jungle-excavation@2x.png') 2x);
  background-color: #1a2a18;
}
.theme-btn[data-t="fossil-highland"] {
  background-image: url('/static/textures/themes/fossil-highland@2x.png');
  background-image: -webkit-image-set(
    url('/static/textures/themes/fossil-highland.png') 1x,
    url('/static/textures/themes/fossil-highland@2x.png') 2x);
  background-image: image-set(
    url('/static/textures/themes/fossil-highland.png') 1x,
    url('/static/textures/themes/fossil-highland@2x.png') 2x);
  background-color: #526890;
}
.theme-btn[data-t="coastal-deep"] {
  background-image: url('/static/textures/themes/coastal-deep@2x.png');
  background-image: -webkit-image-set(
    url('/static/textures/themes/coastal-deep.png') 1x,
    url('/static/textures/themes/coastal-deep@2x.png') 2x);
  background-image: image-set(
    url('/static/textures/themes/coastal-deep.png') 1x,
    url('/static/textures/themes/coastal-deep@2x.png') 2x);
  background-color: #042028;
}
.theme-btn[data-t="volcanic-rift"] {
  background-image: url('/static/textures/themes/volcanic-rift@2x.png');
  background-image: -webkit-image-set(
    url('/static/textures/themes/volcanic-rift.png') 1x,
    url('/static/textures/themes/volcanic-rift@2x.png') 2x);
  background-image: image-set(
    url('/static/textures/themes/volcanic-rift.png') 1x,
    url('/static/textures/themes/volcanic-rift@2x.png') 2x);
  background-color: #501c10;
}

/* ═══════════════════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════════════════ */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 32px 28px 80px;
}

/* ═══════════════════════════════════════════════════════════════════════
   TERMINAL PANEL (the core Jurassic Logs panel style)
   ═══════════════════════════════════════════════════════════════════════ */
.t-panel {
  border: 1px solid var(--line-bright);
  background: var(--card);
  margin-bottom: 24px;
  position: relative;
  /* opaque scrim so body-texture doesn't bleed through the panel body */
  isolation: isolate;
  box-shadow:
    inset 0 0 0 9999px rgba(0,0,0,var(--panel-scrim, 0.55)),
    0 14px 28px -14px rgba(0, 0, 0, 0.55);
}
[data-theme="lab"] .t-panel { --panel-scrim: 0.25; }
[data-theme="fossil-highland"] .t-panel { --panel-scrim: 0.40; }
[data-theme="mist-tundra"] .t-panel { --panel-scrim: 0.35; }

.t-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line-bright);
  background: var(--card-elev);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.t-panel-head .corner { color: var(--line-bright); margin-right: 6px; }
.t-panel-head .badge {
  color: var(--ink-dim);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  border: 1px solid var(--line-bright);
  padding: 1px 8px;
}

.t-panel-body { padding: 0; }

/* terminal row — the numbered dotted-leader rows */
.t-row {
  display: flex;
  align-items: baseline;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 0.84rem;
  letter-spacing: 0.04em;
  transition: background 80ms;
  gap: 8px;
}
.t-row:last-child { border-bottom: none; }
.t-row:hover { background: var(--card-elev); }
.t-row a { color: inherit; width: 100%; display: flex; align-items: baseline; gap: 8px; }
.t-row a:hover { text-decoration: none; color: var(--accent); }

.t-num {
  color: var(--ink-faint);
  font-size: 0.72rem;
  min-width: 22px;
  flex-shrink: 0;
  letter-spacing: 0.04em;
}
.t-label {
  color: var(--ink);
  flex-shrink: 0;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.82rem;
}
.t-dots {
  flex: 1;
  overflow: hidden;
  color: var(--ink-faint);
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  white-space: nowrap;
  margin: 0 6px;
}
.t-dots::after { content: '·····················································································'; }
.t-badge {
  flex-shrink: 0;
  color: var(--ink-dim);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.t-badge.live { color: var(--danger); }
.t-badge.ok { color: var(--safe); }
.t-badge.warn { color: var(--warn); }

/* ═══════════════════════════════════════════════════════════════════════
   HERO / HEADER
   ═══════════════════════════════════════════════════════════════════════ */
.hero {
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--line-bright);
  margin-bottom: 32px;
}
.hero .t-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 12px;
}
.hero h1 {
  font-size: 2.4rem;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--accent);
  font-family: var(--font-mono);
  text-transform: uppercase;
  margin-bottom: 16px;
}
.hero h1 .cursor {
  display: inline-block;
  width: 3px;
  height: 1em;
  background: var(--accent);
  margin-left: 4px;
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

.hero .sub {
  color: var(--ink-dim);
  font-size: 0.88rem;
  max-width: 72ch;
  line-height: 1.7;
  margin-bottom: 24px;
}
.hero .ctas { display: flex; gap: 10px; flex-wrap: wrap; }

/* ═══════════════════════════════════════════════════════════════════════
   STATS BAR
   ═══════════════════════════════════════════════════════════════════════ */
.stats-bar {
  display: flex;
  gap: 0;
  border: 1px solid var(--line-bright);
  background: var(--card);
  margin-bottom: 28px;
  overflow-x: auto;
}
.stat-cell {
  flex: 1;
  min-width: 120px;
  padding: 14px 16px;
  border-right: 1px solid var(--line);
  text-align: center;
}
.stat-cell:last-child { border-right: none; }
.stat-cell .n {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--accent);
  letter-spacing: -0.01em;
  display: block;
  line-height: 1.2;
}
.stat-cell .lbl {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 2px;
  display: block;
}

/* ═══════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-block;
  padding: 8px 18px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--line-bright);
  color: var(--ink-dim);
  background: var(--card);
  cursor: pointer;
  text-decoration: none;
  transition: background 100ms, color 100ms, border-color 100ms;
}
.btn:hover { background: var(--card-elev); color: var(--accent); border-color: var(--accent-dim); text-decoration: none; }
.btn.primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  font-weight: bold;
}
.btn.primary:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* ═══════════════════════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════════════════════ */
.t-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  border: 1px solid var(--line-bright);
}
.t-table th, .t-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  vertical-align: top;
}
.t-table th {
  background: var(--card-elev);
  color: var(--accent);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: normal;
}
.t-table td { background: var(--card); color: var(--ink-dim); }
.t-table tr:hover td { background: var(--card-elev); }
.t-table tr:last-child td { border-bottom: none; }
.t-table td:last-child, .t-table th:last-child { border-right: none; }

/* ═══════════════════════════════════════════════════════════════════════
   SPECIES CARDS
   ═══════════════════════════════════════════════════════════════════════ */
.sp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line-bright);
  margin-bottom: 28px;
}
.sp-card {
  display: block;
  padding: 12px 14px;
  background: var(--card);
  color: var(--ink-dim);
  text-decoration: none;
  transition: background 80ms, color 80ms;
}
.sp-card:hover { background: var(--card-elev); color: var(--accent); text-decoration: none; }
.sp-card h3 {
  font-size: 0.84rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 4px;
}
.sp-card .meta { font-size: 0.72rem; color: var(--ink-faint); letter-spacing: 0.04em; }

/* ═══════════════════════════════════════════════════════════════════════
   DIET TAGS / PILLS
   ═══════════════════════════════════════════════════════════════════════ */
.tag {
  display: inline-block;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 8px;
  border: 1px solid;
  margin-right: 4px;
}
.tag.carnivore  { color: var(--carn); border-color: var(--carn); background: rgba(196,48,32,0.1); }
.tag.herbivore  { color: var(--herb); border-color: var(--herb); background: rgba(74,158,48,0.1); }
.tag.omnivore   { color: var(--omni); border-color: var(--omni); background: rgba(196,160,32,0.1); }
.tag.piscivore  { color: var(--pisc); border-color: var(--pisc); background: rgba(32,144,196,0.1); }

.pill {
  display: inline-block;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 1px 7px;
  border: 1px solid var(--line-bright);
  color: var(--ink-faint);
  margin-right: 3px;
}

/* ═══════════════════════════════════════════════════════════════════════
   SPECIES DETAIL
   ═══════════════════════════════════════════════════════════════════════ */
.detail-head { padding-bottom: 20px; border-bottom: 1px solid var(--line-bright); margin-bottom: 24px; }
.detail-head .back { font-size: 0.72rem; color: var(--ink-faint); letter-spacing: 0.06em; margin-bottom: 10px; display: block; }
.detail-head h1 { font-size: 1.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent); margin-bottom: 4px; }
.detail-head .sci { font-style: italic; color: var(--ink-dim); font-size: 0.86rem; margin-bottom: 12px; }

.statgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line-bright);
  margin-bottom: 24px;
}
.statbox {
  padding: 12px 14px;
  background: var(--card);
}
.statbox .label { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-faint); }
.statbox .val { font-size: 1.2rem; color: var(--accent); margin-top: 3px; }

/* ═══════════════════════════════════════════════════════════════════════
   KARMA / TIER ROWS
   ═══════════════════════════════════════════════════════════════════════ */
.tier-legend { display: flex; flex-direction: column; gap: 1px; background: var(--line); border: 1px solid var(--line-bright); }
.tier-row {
  display: grid;
  grid-template-columns: 140px 1fr 110px;
  gap: 12px;
  padding: 10px 14px;
  background: var(--card);
  font-size: 0.82rem;
  align-items: center;
}
.tier-row:hover { background: var(--card-elev); }
.tier-row .name { color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.78rem; }
.tier-row .desc { color: var(--ink-dim); }
.tier-row .range { text-align: right; color: var(--safe); font-size: 0.82rem; }
.tier-row.neg .range { color: var(--danger); }

/* ═══════════════════════════════════════════════════════════════════════
   LIVE FEED / EVENT STREAM
   ═══════════════════════════════════════════════════════════════════════ */
.event-log {
  background: var(--bg);
  border: 1px solid var(--line-bright);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  height: 420px;
  overflow-y: auto;
  padding: 10px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-dim) var(--bg-elev);
}
.event-row {
  display: flex;
  gap: 10px;
  padding: 4px 14px;
  border-bottom: 1px solid var(--line);
  animation: fadeIn 0.3s ease;
  line-height: 1.5;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.event-row:last-child { border-bottom: none; }
.event-ts { color: var(--ink-faint); white-space: nowrap; flex-shrink: 0; }
.event-type {
  min-width: 90px;
  flex-shrink: 0;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  align-self: center;
  padding: 1px 6px;
  border: 1px solid;
}
.event-type.kill     { color: var(--danger); border-color: var(--danger); background: rgba(196,48,32,0.1); }
.event-type.territory{ color: var(--warn);   border-color: var(--warn);   background: rgba(196,160,32,0.1); }
.event-type.karma    { color: var(--safe);   border-color: var(--safe);   background: rgba(74,158,48,0.1); }
.event-type.entry    { color: var(--info);   border-color: var(--info);   background: rgba(32,144,196,0.1); }
.event-type.warning  { color: var(--warn);   border-color: var(--warn);   background: rgba(196,160,32,0.15); }
.event-type.nest     { color: var(--purple); border-color: var(--purple); background: rgba(144,96,196,0.1); }
.event-msg { color: var(--ink-dim); flex: 1; }

/* ═══════════════════════════════════════════════════════════════════════
   FIELD CAM (canvas container)
   ═══════════════════════════════════════════════════════════════════════ */
.fieldcam-wrap {
  border: 1px solid var(--line-bright);
  background: var(--card);
  overflow: hidden;
}
.fieldcam-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-bottom: 1px solid var(--line-bright);
  background: var(--card-elev);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
/* Legacy canvas rule — new frame below replaces it. */
#fieldcam canvas { display: none; }

/* ── NEW FIELD-CAM STAGE (photo-realistic video frame) ────────────── */
.fc-stage {
  position: relative;
  aspect-ratio: 16 / 7;
  overflow: hidden;
  background: #000;
  cursor: crosshair;
  isolation: isolate;
}
.fc-frame { position: absolute; inset: 0; display: block; }
.fc-frame-img {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(1.05) contrast(1.05) brightness(0.92)
          hue-rotate(var(--fc-hue, 0deg));
  animation: fc-kenburns 26s ease-in-out infinite alternate;
}
[data-theme="amber-terminal"]    .fc-frame-img,
[data-theme="volcanic-rift"]     .fc-frame-img,
[data-theme="desert-badlands"]   .fc-frame-img { --fc-hue: 18deg;  filter: saturate(1.1) contrast(1.1) brightness(0.88) sepia(0.22) hue-rotate(var(--fc-hue)); }
[data-theme="jungle-excavation"] .fc-frame-img,
[data-theme="rainforest-canopy"] .fc-frame-img { --fc-hue: -8deg;  }
[data-theme="coastal-deep"]      .fc-frame-img,
[data-theme="mist-tundra"]       .fc-frame-img { --fc-hue: 190deg; filter: saturate(1.1) contrast(1.02) brightness(0.9) hue-rotate(var(--fc-hue)); }
[data-theme="dark-ops"]          .fc-frame-img { --fc-hue: 0deg;   filter: grayscale(0.8) contrast(1.25) brightness(0.65); }
[data-theme="lab"]               .fc-frame-img { --fc-hue: 0deg;   filter: contrast(0.95) brightness(1.05) saturate(0.85); }
[data-theme="fossil-highland"]   .fc-frame-img { --fc-hue: 20deg;  filter: sepia(0.35) contrast(1.05) brightness(0.95) hue-rotate(var(--fc-hue)); }
[data-theme="field"]             .fc-frame-img { --fc-hue: 0deg;   filter: grayscale(0.5) contrast(1.15) brightness(0.8); }

@keyframes fc-kenburns {
  0%   { transform: scale(1.00) translate3d(0, 0, 0); }
  50%  { transform: scale(1.06) translate3d(-1.5%, -1%, 0); }
  100% { transform: scale(1.04) translate3d(1.5%, 0.8%, 0); }
}

.fc-scan {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0) 0px,
    rgba(0,0,0,0) 2px,
    rgba(0,0,0,0.28) 3px,
    rgba(0,0,0,0) 4px
  );
  mix-blend-mode: multiply;
}
.fc-scan::after {
  content: ''; position: absolute; left: 0; right: 0; height: 14%;
  top: -20%;
  background: linear-gradient(180deg,
    transparent 0%,
    rgba(var(--accent-rgb, 255, 184, 60), 0.06) 40%,
    rgba(var(--accent-rgb, 255, 184, 60), 0.18) 50%,
    rgba(var(--accent-rgb, 255, 184, 60), 0.06) 60%,
    transparent 100%);
  animation: fc-scanline 4.2s linear infinite;
  filter: blur(2px);
}
@keyframes fc-scanline { 0% { top: -20%; } 100% { top: 120%; } }

.fc-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 54%, rgba(0,0,0,0.75) 100%);
}
.fc-hud {
  position: absolute; inset: 0; pointer-events: none;
  color: var(--accent);
  font-family: var(--font-mono, monospace);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 0 4px rgba(0,0,0,0.8), 0 0 1px rgba(0,0,0,0.9);
}
.fc-hud-tl, .fc-hud-tr, .fc-hud-bl, .fc-hud-br {
  position: absolute; padding: 8px 12px; display: flex; gap: 10px;
  align-items: center;
}
.fc-hud-tl { top: 0; left: 0; }
.fc-hud-tr { top: 0; right: 0; }
.fc-hud-bl { bottom: 0; left: 0; }
.fc-hud-br { bottom: 0; right: 0; }
.fc-rec {
  display: inline-flex; align-items: center; gap: 5px;
  color: #ff5240; font-weight: 700;
}
.fc-rec-dot {
  width: 8px; height: 8px; background: #ff5240; border-radius: 50%;
  animation: fc-blink 1.1s infinite;
  box-shadow: 0 0 6px #ff5240, 0 0 1px #fff;
}
@keyframes fc-blink { 0%,49% { opacity: 1; } 50%,100% { opacity: 0.25; } }
.fc-ts     { color: var(--accent-2, var(--accent)); }
.fc-mode   { color: var(--ink-dim); }
.fc-tag    { color: var(--ink-dim); }
.fc-status { color: var(--accent); }
.fc-coords { color: var(--ink-dim); font-variant-numeric: tabular-nums; }

.fc-reticle {
  position: absolute; left: 50%; top: 50%;
  width: 120px; height: 120px;
  transform: translate(-50%, -50%);
}
.fc-reticle-ring {
  position: absolute; inset: 0;
  border: 1px solid rgba(var(--accent-rgb, 255, 184, 60), 0.55);
  border-radius: 50%;
  box-shadow: inset 0 0 14px rgba(0,0,0,0.6);
}
.fc-reticle-x,
.fc-reticle-y {
  position: absolute; background: rgba(var(--accent-rgb, 255, 184, 60), 0.55);
}
.fc-reticle-x { left: 50%; top: 6px; bottom: 6px; width: 1px; transform: translateX(-50%); }
.fc-reticle-y { top: 50%; left: 6px; right: 6px; height: 1px; transform: translateY(-50%); }

.fc-targets { position: absolute; inset: 0; }
.fc-target {
  position: absolute;
  transform: translate(-50%, -100%);
  font-size: 0.64rem;
  color: var(--accent);
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(var(--accent-rgb, 255, 184, 60), 0.7);
  padding: 2px 6px;
  white-space: nowrap;
  letter-spacing: 0.1em;
  box-shadow: 0 0 8px rgba(0,0,0,0.6);
  animation: fc-target-pulse 1.6s ease-in-out infinite;
}
.fc-target::after {
  content: ''; position: absolute;
  left: 50%; top: 100%;
  width: 10px; height: 10px;
  border: 1px solid var(--accent);
  background: rgba(255,82,64,0.3);
  transform: translate(-50%, 6px) rotate(45deg);
}
.fc-target[data-hunt="1"] { border-color: #ff5240; color: #ffb4a6; background: rgba(40,0,0,0.55); }
.fc-target[data-hunt="1"]::after { border-color: #ff5240; background: rgba(255,82,64,0.5); }
@keyframes fc-target-pulse {
  0%,100% { opacity: 1; }
  50%     { opacity: 0.55; }
}

.sound-btn {
  font-family: var(--font-mono);
  font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
  background: var(--card); color: var(--ink-dim);
  border: 1px solid var(--line-bright);
  padding: 5px 12px; cursor: pointer;
  transition: background 120ms, color 120ms, border-color 120ms;
}
.sound-btn[aria-pressed="true"] {
  color: var(--accent); border-color: var(--accent);
  box-shadow: 0 0 8px rgba(var(--accent-rgb, 255, 184, 60), 0.35);
}
.sound-btn:hover { color: var(--accent); }
.fieldcam-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-top: 1px solid var(--line-bright);
  background: var(--card-elev);
  flex-wrap: wrap;
}
.hunger-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  flex: 1;
  text-transform: uppercase;
}
.hunger-bar-outer {
  flex: 1;
  max-width: 180px;
  height: 8px;
  background: var(--line-bright);
  border: 1px solid var(--line-bright);
  overflow: hidden;
}
#hunger-inner {
  height: 100%;
  width: 100%;
  background: var(--safe);
  transition: width 0.5s linear, background 0.5s;
}
.fieldcam-status {
  font-size: 0.7rem;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  min-width: 220px;
}
#feed-btn {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--card);
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  padding: 5px 14px;
  cursor: pointer;
  transition: background 100ms, color 100ms;
}
#feed-btn:hover { background: var(--accent); color: var(--bg); }
#feed-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ═══════════════════════════════════════════════════════════════════════
   SECTION HEADERS
   ═══════════════════════════════════════════════════════════════════════ */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 32px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-bright);
}
.section-head h2 {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: normal;
}
.section-head .sc-badge {
  font-size: 0.68rem;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
  border: 1px solid var(--line);
  padding: 1px 8px;
  text-transform: uppercase;
}

/* section intro paragraph */
.lead {
  color: var(--ink-dim);
  font-size: 0.86rem;
  line-height: 1.7;
  max-width: 78ch;
  margin-bottom: 16px;
}

/* muted */
.muted { color: var(--ink-faint); font-size: 0.78rem; margin-top: 8px; }

/* prompt prefix */
.prompt { color: var(--accent-dim); }

/* rule item blocks */
.rule-block {
  border-left: 2px solid var(--accent-dim);
  padding: 10px 14px;
  background: var(--card);
  margin-bottom: 10px;
  font-size: 0.84rem;
  line-height: 1.7;
}
.rule-block strong { color: var(--accent); }
.rule-block ul { padding-left: 18px; margin-top: 6px; }
.rule-block li { color: var(--ink-dim); margin-bottom: 4px; }

/* HUNGRY rule highlight */
.rule-block.hungry { border-left-color: var(--warn); background: rgba(196,160,32,0.05); }
.rule-block.hungry strong { color: var(--warn); }

/* ═══════════════════════════════════════════════════════════════════════
   TERRITORY TAGS
   ═══════════════════════════════════════════════════════════════════════ */
.zone-tag {
  display: inline-block;
  font-size: 0.6rem;
  padding: 1px 6px;
  border: 1px solid var(--line-bright);
  color: var(--ink-faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-right: 3px;
  margin-bottom: 2px;
}
.zone-tag.sanctuary { color: var(--safe); border-color: var(--safe); background: rgba(74,158,48,0.08); }
.zone-tag.arena     { color: var(--danger); border-color: var(--danger); background: rgba(196,48,32,0.08); }
.zone-tag.wallowing { color: var(--info); border-color: var(--info); background: rgba(32,144,196,0.08); }
.zone-tag.healing   { color: var(--safe); border-color: var(--safe); background: rgba(74,158,48,0.08); }
.zone-tag.hazard    { color: var(--danger); border-color: var(--danger); background: rgba(196,48,32,0.1); }
.zone-tag.migration { color: var(--omni); border-color: var(--omni); background: rgba(196,160,32,0.08); }

/* ═══════════════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════════════ */
footer {
  border-top: 1px solid var(--line-bright);
  padding: 28px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 28px;
  max-width: var(--maxw);
  margin: 0 auto;
  font-size: 0.78rem;
}
footer strong {
  display: block;
  color: var(--accent);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
footer a { display: block; color: var(--ink-faint); margin-bottom: 4px; letter-spacing: 0.04em; }
footer a:hover { color: var(--accent); text-decoration: none; }
footer p { color: var(--ink-faint); line-height: 1.6; }
.footer-bottom {
  border-top: 1px solid var(--line);
  padding: 12px 28px;
  text-align: center;
  font-size: 0.66rem;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  max-width: var(--maxw);
  margin: 0 auto;
}

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════ */
@media (max-width: 720px) {
  header.nav { padding: 0 14px; flex-wrap: wrap; min-height: unset; }
  header.nav nav { width: 100%; overflow-x: auto; }
  header.nav nav a { padding: 8px 10px; font-size: 0.7rem; }
  main { padding: 20px 14px 60px; }
  .hero h1 { font-size: 1.6rem; }
  .stats-bar { overflow-x: scroll; }
  .tier-row { grid-template-columns: 110px 1fr; }
  .tier-row .range { grid-column: 1 / -1; text-align: left; }
  .t-row { font-size: 0.76rem; }
}

/* ═══════════════════════════════════════════════════════════════════════
   LOCALE SWITCHER (Phase 2B)
   ═══════════════════════════════════════════════════════════════════════ */
.locale-switcher {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: 10px;
}
.locale-switcher select {
  background: var(--bg-elev); color: var(--ink);
  border: 1px solid var(--line-bright);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 3px 6px;
  letter-spacing: 1px;
}
.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;
}

/* ═══════════════════════════════════════════════════════════════════════
   TEXTURE PIPELINE (Phase 3A)
   -----------------------------------------------------------------------
   Layered background system. Themes can set --tex-body, --tex-panel, and
   --tex-biome-hero to PNGs dropped under /static/textures/. Each source
   ships @1x/@2x/@4x. Classes below consume the CSS variables, so theme
   definitions only need to reference filenames — not full image-set().
   ═══════════════════════════════════════════════════════════════════════ */
:root {
  --tex-body: none;
  --tex-panel: none;
  --tex-biome-hero: none;
  --tex-overlay-opacity: 0.14;
}

/* Utility: responsive background from a single --tex-* variable. */
.tex-layer {
  position: relative;
  isolation: isolate;
}
.tex-layer::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background-image: var(--tex, var(--tex-body));
  background-size: cover; background-position: center;
  opacity: var(--tex-overlay-opacity);
  pointer-events: none;
}

/* Per-biome hero stamp (used by /species and /territories detail pages). */
.biome-hero {
  position: relative;
  min-height: 280px;
  border: 1px solid var(--line);
  margin: 16px 0 22px;
  overflow: hidden;
}
.biome-hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image: var(--tex-biome-hero, none);
  background-size: cover; background-position: center;
  opacity: 0.55;
  filter: contrast(1.05) saturate(0.9);
}
.biome-hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, var(--bg) 100%);
}
.biome-hero > * { position: relative; z-index: 1; }

/* Responsive-image helper — pages can `srcset` directly on <img> too, but
   when using it as a CSS background we fall back to image-set() where
   supported (2024+ browsers) and plain url() otherwise. */
.tex-4k { --tex: image-set(var(--tex-body) 1x, var(--tex-body-2x) 2x, var(--tex-body-4x) 4x); }

/* ═══════════════════════════════════════════════════════════════════════
   PER-THEME TEXTURE BINDINGS (Phase 3A)
   Each theme nominates default backdrops; PNGs resolve from the manifest.
   ═══════════════════════════════════════════════════════════════════════ */
[data-theme="amber-terminal"] {
  /* Unsplash amber/gold photography — replaces broken Pinterest refs.
     bg.jpg     → molten amber-and-charcoal (hero backdrop, full-bleed)
     panel.jpg  → fractured amber crystal (card surfaces)
     btn.jpg    → glowing ember ore (button faces)
     accent.jpg → honey-lit smoke (hover glaze / chrome overlays) */
  --tex-body:   url('/static/textures/amber/bg.jpg');
  --tex-panel:  url('/static/textures/amber/panel.jpg');
  --tex-btn:    url('/static/textures/amber/btn.jpg');
  --tex-accent: url('/static/textures/amber/accent.jpg');
  --tex-grain:  url('/static/textures/amber/amber-smoke.jpg');
  --tex-body-opacity:  0.48;
  --tex-panel-opacity: 0.55;
  --tex-accent-opacity: 0.28;
  --tex-body-size: cover;
  --tex-panel-size: cover;
}
[data-theme="jungle-excavation"] {
  --tex-body:  url('/static/textures/jungle/bg.jpg');
  --tex-panel: url('/static/textures/jungle/panel.jpg');
  --tex-btn:   url('/static/textures/jungle/btn.jpg');
  --tex-body-opacity:  0.55;
  --tex-panel-opacity: 0.65;
  --tex-body-size: cover;
  --tex-panel-size: cover;
}
[data-theme="fossil-highland"] {
  --tex-body:  url('/static/textures/fossil/bg.jpg');
  --tex-panel: url('/static/textures/fossil/panel.jpg');
  --tex-btn:   url('/static/textures/fossil/btn.jpg');
  --tex-body-opacity:  0.60;
  --tex-panel-opacity: 0.70;
  --tex-body-size: cover;
  --tex-panel-size: cover;
}
[data-theme="coastal-deep"] {
  --tex-body:  url('/static/textures/coastal/bg.jpg');
  --tex-panel: url('/static/textures/coastal/panel.jpg');
  --tex-btn:   url('/static/textures/coastal/btn.jpg');
  --tex-body-opacity:  0.58;
  --tex-panel-opacity: 0.70;
  --tex-body-size: cover;
  --tex-panel-size: cover;
}
[data-theme="volcanic-rift"] {
  --tex-body:  url('/static/textures/volcanic/bg.jpg');
  --tex-panel: url('/static/textures/volcanic/panel.jpg');
  --tex-btn:   url('/static/textures/volcanic/btn.jpg');
  --tex-body-opacity:  0.55;
  --tex-panel-opacity: 0.68;
  --tex-body-size: cover;
  --tex-panel-size: cover;
}
[data-theme="lab"] {
  --tex-body:  url('/static/textures/lab/bg.jpg');
  --tex-panel: url('/static/textures/lab/panel.jpg');
  --tex-btn:   url('/static/textures/lab/btn.jpg');
  --tex-body-opacity:  0.35;
  --tex-panel-opacity: 0.50;
  --tex-body-size: cover;
  --tex-panel-size: cover;
}
[data-theme="dark-ops"] {
  --tex-body:  url('/static/textures/darkops/bg.jpg');
  --tex-panel: url('/static/textures/darkops/panel.jpg');
  --tex-btn:   url('/static/textures/darkops/btn.jpg');
  --tex-body-opacity:  0.55;
  --tex-panel-opacity: 0.70;
  --tex-body-size: cover;
  --tex-panel-size: cover;
}
[data-theme="field"] {
  --tex-body:  url('/static/textures/field/bg.jpg');
  --tex-panel: url('/static/textures/field/panel.jpg');
  --tex-btn:   url('/static/textures/field/btn.jpg');
  --tex-body-opacity:  0.55;
  --tex-panel-opacity: 0.65;
  --tex-body-size: cover;
  --tex-panel-size: cover;
}

/* ── THREE NEW THEMES (Apr 2026) ────────────────────────────────────── */
[data-theme="mist-tundra"] {
  --bg:        #0d1418;
  --bg-accent: #17252c;
  --ink:       #e3f3fb;
  --ink-dim:   #9ec0cf;
  --ink-faint: #5f7a86;
  --accent:    #9fe8ff;
  --accent-2:  #d4f3ff;
  --line:      #1f3641;
  --danger:    #ff8a6c;
  --safe:      #b6f1c6;
  --tex-body:   url('/static/textures/tundra/bg.jpg');
  --tex-panel:  url('/static/textures/tundra/panel.jpg');
  --tex-btn:    url('/static/textures/tundra/btn.jpg');
  --tex-accent: url('/static/textures/tundra/accent.jpg');
  --tex-body-opacity:  0.62;
  --tex-panel-opacity: 0.72;
  --tex-accent-opacity: 0.30;
  --tex-body-size: cover;
  --tex-panel-size: cover;
}
[data-theme="rainforest-canopy"] {
  --bg:        #0a1410;
  --bg-accent: #12241a;
  --ink:       #e5ffe2;
  --ink-dim:   #a8cfa5;
  --ink-faint: #5f8465;
  --accent:    #74ff9a;
  --accent-2:  #d1ffc6;
  --line:      #1d3326;
  --danger:    #ff5b5b;
  --safe:      #afffb9;
  --tex-body:   url('/static/textures/rainforest/bg.jpg');
  --tex-panel:  url('/static/textures/rainforest/panel.jpg');
  --tex-btn:    url('/static/textures/rainforest/btn.jpg');
  --tex-accent: url('/static/textures/rainforest/accent.jpg');
  --tex-body-opacity:  0.58;
  --tex-panel-opacity: 0.70;
  --tex-accent-opacity: 0.32;
  --tex-body-size: cover;
  --tex-panel-size: cover;
}
[data-theme="desert-badlands"] {
  --bg:        #1a0c07;
  --bg-accent: #2d1810;
  --ink:       #ffe0c5;
  --ink-dim:   #e0b78a;
  --ink-faint: #8a6244;
  --accent:    #ff8c42;
  --accent-2:  #ffcf96;
  --line:      #3a1e10;
  --danger:    #ff4c3a;
  --safe:      #ffe0a0;
  --tex-body:   url('/static/textures/badlands/bg.jpg');
  --tex-panel:  url('/static/textures/badlands/panel.jpg');
  --tex-btn:    url('/static/textures/badlands/btn.jpg');
  --tex-accent: url('/static/textures/badlands/accent.jpg');
  --tex-body-opacity:  0.60;
  --tex-panel-opacity: 0.70;
  --tex-accent-opacity: 0.34;
  --tex-body-size: cover;
  --tex-panel-size: cover;
}

/* ═══════════════════════════════════════════════════════════════════════
   BACKDROP BLEND — how the body texture composites over --bg.
   Dark themes use 'screen' so the texture lightens the surface a touch;
   light themes use 'multiply' so the texture shades it. The default
   'normal' (for themes that already ship a fully-designed background)
   lets the texture dominate.
   ═══════════════════════════════════════════════════════════════════════ */
[data-theme="amber-terminal"],
[data-theme="volcanic-rift"],
[data-theme="dark-ops"],
[data-theme="desert-badlands"]    { --tex-body-blend: screen; }
[data-theme="lab"],
[data-theme="fossil-highland"],
[data-theme="mist-tundra"]        { --tex-body-blend: multiply; }
[data-theme="jungle-excavation"],
[data-theme="coastal-deep"],
[data-theme="field"],
[data-theme="rainforest-canopy"]  { --tex-body-blend: overlay; }

/* Per-theme --accent-rgb so HUD/reticle can blend into theme color. */
[data-theme="amber-terminal"]    { --accent-rgb: 255, 184, 60; }
[data-theme="jungle-excavation"] { --accent-rgb: 158, 213, 120; }
[data-theme="fossil-highland"]   { --accent-rgb: 212, 170, 90; }
[data-theme="coastal-deep"]      { --accent-rgb: 120, 210, 255; }
[data-theme="volcanic-rift"]     { --accent-rgb: 255, 120, 80; }
[data-theme="lab"]                { --accent-rgb: 80, 180, 220; }
[data-theme="dark-ops"]           { --accent-rgb: 180, 60, 60; }
[data-theme="field"]              { --accent-rgb: 150, 210, 120; }
[data-theme="mist-tundra"]        { --accent-rgb: 159, 232, 255; }
[data-theme="rainforest-canopy"]  { --accent-rgb: 116, 255, 154; }
[data-theme="desert-badlands"]    { --accent-rgb: 255, 140, 66; }

/* Panel texture overlay — applied to elements using the card color. */
.card,
.sp-card,
.t-table,
.stat,
.t-row,
.biome-hero,
.panel {
  position: relative;
  isolation: isolate;
}
.card::before,
.sp-card::before,
.stat::before,
.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: var(--tex-panel, none);
  background-repeat: var(--tex-panel-repeat, no-repeat);
  background-size: var(--tex-panel-size, cover);
  background-position: center;
  opacity: var(--tex-panel-opacity, 0.5);
  pointer-events: none;
  mix-blend-mode: multiply;
}
[data-theme="lab"] .card::before,
[data-theme="lab"] .sp-card::before,
[data-theme="lab"] .stat::before,
[data-theme="lab"] .panel::before { mix-blend-mode: multiply; }
[data-theme="amber-terminal"] .card::before,
[data-theme="amber-terminal"] .sp-card::before,
[data-theme="amber-terminal"] .stat::before,
[data-theme="amber-terminal"] .panel::before,
[data-theme="volcanic-rift"] .card::before,
[data-theme="volcanic-rift"] .sp-card::before,
[data-theme="volcanic-rift"] .stat::before,
[data-theme="volcanic-rift"] .panel::before,
[data-theme="dark-ops"] .card::before,
[data-theme="dark-ops"] .sp-card::before,
[data-theme="dark-ops"] .stat::before,
[data-theme="dark-ops"] .panel::before { mix-blend-mode: screen; opacity: calc(var(--tex-panel-opacity, 0.5) * 0.55); }

/* Button texture — the .btn strip picks up a themed background image. */
.btn {
  background-image: var(--tex-btn, none);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
}
.btn:hover {
  background-image: var(--tex-btn, none);
  filter: brightness(1.15) contrast(1.05);
}
.btn.primary {
  background-image: none;  /* primary keeps solid accent fill */
}

/* ═══════════════════════════════════════════════════════════════════════
   GLOSSARY TOOLTIPS (Phase 3D.3)
   Any element with `data-term="<slug>"` lights up as an interactive
   definition target. The popover is injected once by `tooltip.js` and
   positioned relative to the viewport. Opens on pointerenter/focusin,
   closes on pointerleave/blur/Escape. Styled per active theme via vars.
   ═══════════════════════════════════════════════════════════════════════ */
[data-term] {
  cursor: help;
  border-bottom: 1px dotted var(--accent);
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color 120ms ease, background 120ms ease;
}
[data-term]:hover,
[data-term]:focus-visible {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  outline: none;
}
[data-term][data-gloss-missing="1"] {
  border-bottom-style: dashed;
  opacity: 0.82;
}

.nx-tooltip {
  position: fixed;
  z-index: 9999;
  max-width: 320px;
  min-width: 180px;
  padding: 10px 12px;
  background: var(--panel, #0c0c0c);
  color: var(--ink, #e6e6e6);
  border: 1px solid var(--line, #1d1d1d);
  border-top: 2px solid var(--accent, #ffb347);
  box-shadow: 0 6px 24px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.02);
  font-family: var(--mono, ui-monospace, "SFMono-Regular", Menlo, monospace);
  font-size: 0.78rem;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 140ms ease, transform 140ms ease;
  pointer-events: none;
}
.nx-tooltip.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.nx-tooltip .nxt-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 6px;
}
.nx-tooltip .nxt-term {
  font-weight: 700; color: var(--accent);
  letter-spacing: 0.02em;
  text-transform: uppercase; font-size: 0.72rem;
}
.nx-tooltip .nxt-kind {
  font-size: 0.62rem;
  color: var(--ink-dim, #8c8c8c);
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.nx-tooltip .nxt-body {
  color: var(--ink, #e6e6e6);
}
.nx-tooltip .nxt-foot {
  margin-top: 8px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.66rem; color: var(--ink-faint, #666);
}
.nx-tooltip .nxt-foot a {
  color: var(--accent); text-decoration: none;
  border-bottom: 1px dotted var(--accent);
}
.nx-tooltip .nxt-foot a:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* ═══════════════════════════════════════════════════════════════════════
   BIOME AFFINITY PANEL (Phase 3D.4)
   Renders on /species/<slug> — a sorted list of biomes with an inline
   affinity bar, native/forbidden badges, and a reasoning list pulled
   from the climate model.
   ═══════════════════════════════════════════════════════════════════════ */
.biome-reasoning {
  list-style: none; padding: 0 0 10px; margin: 0 0 10px;
  border-bottom: 1px dashed var(--line);
}
.biome-reasoning li {
  font-size: 0.82rem; color: var(--ink-dim);
  line-height: 1.55;
  padding: 4px 0 4px 14px;
  position: relative;
}
.biome-reasoning li::before {
  content: "›";
  color: var(--accent);
  position: absolute; left: 0; top: 4px;
  font-weight: 700;
}
.biome-bars { display: flex; flex-direction: column; gap: 6px; }
.biome-row {
  display: grid;
  grid-template-columns: 14px 150px 1fr 140px 34px auto;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
  font-size: 0.78rem;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: background 140ms ease;
}
.biome-row:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.biome-row.is-native { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.biome-row.is-forbidden .biome-score { color: #c05a5a; }
.biome-swatch {
  width: 12px; height: 12px; border-radius: 2px;
  border: 1px solid rgba(0,0,0,0.45);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04);
}
.biome-name {
  font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.biome-meta {
  font-size: 0.68rem; color: var(--ink-faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.biome-bar {
  position: relative;
  height: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.biome-fill {
  display: block; height: 100%;
  transition: width 320ms cubic-bezier(.4,.0,.2,1);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.35);
}
.biome-score {
  font-variant-numeric: tabular-nums;
  font-weight: 700; color: var(--accent);
  text-align: right;
}
@media (max-width: 720px) {
  .biome-row {
    grid-template-columns: 14px 1fr 34px;
    grid-template-areas:
      "sw name score"
      "meta meta meta"
      "bar bar bar"
      "tag tag tag";
  }
  .biome-swatch { grid-area: sw; }
  .biome-name   { grid-area: name; }
  .biome-score  { grid-area: score; }
  .biome-meta   { grid-area: meta; }
  .biome-bar    { grid-area: bar; }
  .biome-row .t-badge { grid-area: tag; justify-self: start; }
}

/* ═══════════════════════════════════════════════════════════════════════
   PALEONTOLOGY + CITATIONS PANEL (Phase 3D.5)
   Renders on /species/<slug>. `<cite>` is the semantic element for an
   author/source; we pair it with a link to the DOI or open repository.
   ═══════════════════════════════════════════════════════════════════════ */
.paleo-dl {
  display: grid;
  grid-template-columns: 140px 1fr;
  row-gap: 4px; column-gap: 12px;
  margin: 0 0 12px;
  font-size: 0.82rem;
}
.paleo-dl dt {
  color: var(--ink-faint);
  text-transform: uppercase;
  font-size: 0.70rem;
  letter-spacing: 0.08em;
  align-self: center;
}
.paleo-dl dd {
  margin: 0;
  color: var(--ink);
}
.paleo-cites-head {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 12px 0 6px;
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}
.paleo-citations {
  list-style: decimal;
  margin: 0;
  padding-left: 22px;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--ink-dim);
}
.paleo-citations li {
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.paleo-citations li:last-child { border-bottom: none; }
.paleo-citations .paleo-author {
  font-style: normal;
  font-weight: 600;
  color: var(--ink);
}
.paleo-citations .paleo-year {
  color: var(--ink-faint);
  margin-left: 2px;
}
.paleo-citations .paleo-title {
  color: var(--ink);
  font-style: italic;
}
.paleo-citations .paleo-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent);
  font-size: 0.72rem;
  font-family: var(--mono, ui-monospace, Menlo, monospace);
  word-break: break-all;
}
.paleo-citations .paleo-link:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.paleo-source-note {
  margin-top: 10px;
  font-size: 0.70rem;
  color: var(--ink-faint);
}

/* ═══════════════════════════════════════════════════════════════════════
   3D DEPTH SYSTEM (Phase 3B)
   -----------------------------------------------------------------------
   Sets up a perspective stage on <main>, gives panels/cards/buttons
   transform-capable stacking contexts and a hover-lift that translates
   on the Z axis with a softened multi-layer shadow for parallax depth.
   Every transform respects prefers-reduced-motion.
   ═══════════════════════════════════════════════════════════════════════ */
main {
  perspective: 1400px;
  perspective-origin: 50% 30%;
  transform-style: preserve-3d;
}

.t-panel,
.card,
.sp-card,
.stat,
.panel,
.biome-hero {
  transform-style: preserve-3d;
  transform: translateZ(0);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 -1px 0 rgba(0, 0, 0, 0.35) inset,
    0 6px 18px -10px rgba(0, 0, 0, 0.55),
    0 24px 48px -28px rgba(0, 0, 0, 0.6);
  transition: transform 360ms cubic-bezier(0.2, 0.9, 0.25, 1.1),
              box-shadow 360ms cubic-bezier(0.2, 0.9, 0.25, 1.1),
              border-color 240ms ease;
  will-change: transform;
}
.t-panel:hover,
.card:hover,
.sp-card:hover,
.stat:hover {
  transform: translateZ(18px) rotateX(-1.2deg);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 -1px 0 rgba(0, 0, 0, 0.45) inset,
    0 14px 28px -14px rgba(0, 0, 0, 0.55),
    0 44px 72px -30px rgba(0, 0, 0, 0.7),
    0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
}

/* Hero slab gets a stronger tilt + floating feel */
.hero {
  transform-style: preserve-3d;
  transform: translateZ(0);
  transition: transform 600ms cubic-bezier(0.2, 0.9, 0.25, 1.05);
}
.hero h1 {
  transform: translateZ(40px);
  text-shadow:
    0 1px 0 color-mix(in srgb, var(--accent) 20%, transparent),
    0 6px 22px color-mix(in srgb, var(--accent) 35%, transparent),
    0 22px 40px rgba(0, 0, 0, 0.6);
}
.hero .sub { transform: translateZ(20px); }
.hero .ctas { transform: translateZ(30px); }

/* Buttons get a bevel + press feedback */
.btn {
  transform-style: preserve-3d;
  transform: translateZ(0);
  transition: transform 180ms cubic-bezier(0.2, 0.9, 0.25, 1.2),
              filter 180ms ease,
              box-shadow 180ms ease,
              background-color 120ms,
              color 120ms,
              border-color 120ms;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 -2px 0 rgba(0, 0, 0, 0.35) inset,
    0 4px 10px -4px rgba(0, 0, 0, 0.6);
}
.btn:hover {
  transform: translateZ(8px) translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.14) inset,
    0 -2px 0 rgba(0, 0, 0, 0.5) inset,
    0 10px 22px -8px rgba(0, 0, 0, 0.7),
    0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent);
}
.btn:active {
  transform: translateZ(2px) translateY(1px);
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.4) inset,
    0 4px 10px -4px rgba(0, 0, 0, 0.5);
  filter: brightness(0.95);
}

/* Theme-switcher tiles already have a ::after gloss; upgrade to 3D press */
.theme-btn {
  transition: transform 220ms cubic-bezier(0.2, 0.9, 0.25, 1.2),
              box-shadow 220ms ease,
              border-color 220ms ease;
  box-shadow: 0 2px 6px -2px rgba(0, 0, 0, 0.4);
}
.theme-btn:hover {
  transform: translateZ(6px) scale(1.12) rotateX(-6deg);
  box-shadow:
    0 8px 16px -6px rgba(0, 0, 0, 0.5),
    0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent);
}
.theme-btn.active {
  transform: translateZ(3px) scale(1.06);
}

/* Nav links — subtle lift on hover */
header.nav nav a {
  transition: transform 160ms cubic-bezier(0.2, 0.9, 0.25, 1.1),
              color 120ms, background 120ms;
  transform: translateZ(0);
}
header.nav nav a:hover {
  transform: translateZ(6px) translateY(-1px);
}

/* ═══════════════════════════════════════════════════════════════════════
   4D AMBIENT MOTION (Phase 3B)
   -----------------------------------------------------------------------
   Time-based animations that run continuously without user action:
   drifting backdrop, shimmer on accents, breathing hero, scanline crawl,
   ember float. All gated by prefers-reduced-motion.
   ═══════════════════════════════════════════════════════════════════════ */
@keyframes nx-drift {
  0%   { background-position: center center; }
  50%  { background-position: calc(50% + 12px) calc(50% - 10px); }
  100% { background-position: center center; }
}
@keyframes nx-shimmer {
  0%, 100% { filter: brightness(1) saturate(1); }
  50%      { filter: brightness(1.12) saturate(1.15); }
}
@keyframes nx-breathe {
  0%, 100% { transform: translateZ(40px) scale(1); }
  50%      { transform: translateZ(40px) scale(1.008); }
}
@keyframes nx-scan-crawl {
  0%   { background-position: 0 0; }
  100% { background-position: 0 8px; }
}
@keyframes nx-ember-float {
  0%   { transform: translateY(0) translateZ(0); opacity: 0.7; }
  50%  { opacity: 1; }
  100% { transform: translateY(-18px) translateZ(12px); opacity: 0; }
}
@keyframes nx-accent-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 40%, transparent); }
  50%      { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent); }
}
@keyframes nx-grade-shift {
  0%   { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(6deg); }
}

body {
  animation: nx-drift 38s ease-in-out infinite;
}
.hero h1 {
  animation: nx-breathe 7s ease-in-out infinite;
}
body::before {
  /* scanlines slow crawl */
  animation: nx-scan-crawl 1.6s linear infinite;
}
.btn.primary {
  animation: nx-accent-pulse 2.6s ease-in-out infinite,
             nx-shimmer 5.2s ease-in-out infinite;
}
.live-dot {
  /* existing pulse-dot already declared; add a glow halo via shadow */
  box-shadow: 0 0 10px color-mix(in srgb, var(--danger) 65%, transparent),
              0 0 0 0 currentColor;
}

/* Floating embers layer — decorative, added on body::after of warm themes.
   We don't override the existing vignette; we add a SECOND pseudo via a
   decorative wrapper in templates. Themes that opt in set --ember-show: 1. */
[data-theme="amber-terminal"],
[data-theme="volcanic-rift"] { --ember-show: 1; }

.nx-ember-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
  opacity: var(--ember-show, 0);
}
.nx-ember-layer span {
  position: absolute;
  bottom: -10px;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 85%, transparent);
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 80%, transparent);
  animation: nx-ember-float 6s linear infinite;
}
.nx-ember-layer span:nth-child(1)  { left:  5%; animation-delay: 0s;   animation-duration: 5.5s; }
.nx-ember-layer span:nth-child(2)  { left: 15%; animation-delay: 1.3s; animation-duration: 7.2s; }
.nx-ember-layer span:nth-child(3)  { left: 28%; animation-delay: 2.1s; animation-duration: 6.0s; }
.nx-ember-layer span:nth-child(4)  { left: 41%; animation-delay: 0.4s; animation-duration: 8.5s; }
.nx-ember-layer span:nth-child(5)  { left: 55%; animation-delay: 3.2s; animation-duration: 5.8s; }
.nx-ember-layer span:nth-child(6)  { left: 68%; animation-delay: 1.9s; animation-duration: 7.6s; }
.nx-ember-layer span:nth-child(7)  { left: 78%; animation-delay: 0.8s; animation-duration: 6.4s; }
.nx-ember-layer span:nth-child(8)  { left: 89%; animation-delay: 2.7s; animation-duration: 8.0s; }

/* Scroll-parallax helper — elements with data-parallax get a slight Z-lift
   set by terminal.js in sync with window.scrollY. CSS side just declares
   willchange so browsers can promote. */
[data-parallax] { will-change: transform; transition: transform 120ms linear; }

/* ═══════════════════════════════════════════════════════════════════════
   REDUCED MOTION — disable all ambient animations for accessibility.
   ═══════════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  body { animation: none; }
  .hero h1 { animation: none; transform: translateZ(40px); }
  body::before { animation: none; }
  .nx-ember-layer { display: none; }
  .t-panel:hover, .card:hover, .sp-card:hover, .stat:hover {
    transform: none;
  }
}
