/* ============================================================
   BRAIN-MIMETIX · hero + reference skin  (Tovexa Digital)
   Loads AFTER style.css, so everything here wins the cascade.

   Part 1 — SKIN: retunes the AURA tokens to the reference
   image: near-black neutral ground, warm ember bloom top-right,
   silver grotesque headline. The electric blue stays as the
   *neural* colour (cortex, markers, progress, chips) — in the
   reference the object is cool while the environment is warm,
   and this keeps that split. Flip --accent-rgb to the ember
   values if you ever want the whole console warm too.

   Part 2 — HERO: the split masthead layout (unchanged logic).
   ============================================================ */

/* ═══════════════ PART 1 · SKIN ═══════════════ */

:root,
[data-theme="aura"] {
  /* neutral near-black ground, replacing the navy */
  --bg-deep: #050408;
  --bg: #0A090D;
  --bg-elev: #14121A;
  --panel-rgb: 20, 18, 25;

  /* neutral ink ramp, replacing the blue-tinted one */
  --text: #F1EFF3;
  --text-2: #C9C5CF;
  --dim: #98939F;
  --faint: #6A6572;

  --hairline: rgba(255, 255, 255, 0.09);
  --hairline-soft: rgba(255, 255, 255, 0.05);
  --shadow-rgb: 2, 1, 4;
  --spec-1: rgba(255, 255, 255, 0.16);
  --spec-2: rgba(255, 255, 255, 0.03);
  --track: rgba(255, 255, 255, 0.08);
  --panel-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 24px 70px rgba(0, 0, 0, 0.6);

  /* the warm environment accent from the reference */
  --ember-rgb: 226, 152, 74;
  --ember-hi: #FFCF9A;
}

:root {
  /* the reference headline is a neutral Swiss grotesque, not Space Grotesk */
  --font-display: "Inter Tight", "Inter", "Segoe UI", system-ui, sans-serif;
}

/* warm bloom replaces the blue radials behind everything */
[data-theme="aura"] body {
  background:
    radial-gradient(1200px 800px at 82% -12%, rgba(var(--ember-rgb), 0.16), transparent 62%),
    radial-gradient(1000px 800px at 68% 10%, rgba(var(--ember-rgb), 0.06), transparent 58%),
    radial-gradient(900px 700px at 6% 22%, rgba(122, 104, 158, 0.05), transparent 55%),
    linear-gradient(180deg, var(--bg-elev) 0%, var(--bg) 40%, var(--bg-deep) 100%);
}

/* the reference ground is clean — no blueprint grid over the whole page */
body::before { display: none; }

/* ═══════════════ PART 2 · HERO ═══════════════ */

/* ---------- ambient layers ---------- */

#neural-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  width: 100%; height: 100%;
  opacity: 0.5;
}

.aura-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }

/* warm bloom top-right, exactly where the reference puts it */
.aura-bloom {
  position: absolute; top: -34vh; right: -12vw;
  width: 76vw; height: 76vw;
  background: radial-gradient(circle at 50% 50%,
    rgba(var(--ember-rgb), 0.30) 0%,
    rgba(var(--ember-rgb), 0.13) 26%,
    rgba(122, 104, 158, 0.06) 48%,
    transparent 68%);
  filter: blur(26px);
  animation: aura-breathe 15s var(--ease-out) infinite alternate;
}
@keyframes aura-breathe {
  from { opacity: 0.72; transform: scale(1); }
  to   { opacity: 1;    transform: scale(1.06); }
}

/* hexagon field, top-left — dense at the corner, dissolved by the mask */
.aura-hex {
  position: absolute; top: -64px; left: -64px;
  width: 46vw; height: 56vh; opacity: 0.5;
  -webkit-mask-image: radial-gradient(ellipse at 12% 8%, #000 0%, transparent 72%);
  mask-image: radial-gradient(ellipse at 12% 8%, #000 0%, transparent 72%);
}

/* soft-focus watermark words, like the reference's drifting labels */
.aura-wm {
  position: absolute; font-family: var(--font-display);
  font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.05); user-select: none; white-space: nowrap;
  filter: blur(3px);
}
.aura-wm.wm-a { top: 11vh; right: 5vw;  font-size: clamp(22px, 3.2vw, 50px); }
.aura-wm.wm-b { top: 46vh; left: 40vw;  font-size: clamp(16px, 2.2vw, 34px); color: rgba(255, 255, 255, 0.035); }

.aura-grain {
  position: absolute; inset: 0; opacity: 0.13; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- top bar: room for nav between brand and status ---------- */

.topnav { display: flex; gap: 26px; margin-left: auto; margin-right: 8px; }
.topnav a {
  color: var(--dim); text-decoration: none;
  font-size: 13.5px; font-weight: 500;
  transition: color 0.22s var(--ease-out);
}
.topnav a:hover { color: var(--text); }
@media (max-width: 1080px) { .topnav { display: none; } }

/* ---------- brand mark: the TOVEXA logo fills the square ---------- */
.brand .logo {
  background: #000 url("assets/tovexa-mark.png") center / contain no-repeat;
  border-color: rgba(var(--accent-rgb), 0.28);
  overflow: hidden;
}
.brand .logo::before { content: none; }   /* drop the placeholder ◉ glyph */

/* ---------- hero: split composition ---------- */

.hero {
  text-align: left;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
  gap: 40px;
  min-height: min(82vh, 780px);
  padding: 28px 0 8px;
  position: relative;
  z-index: 2;
}

/* the overline now reads like a live readout: an amber electrical
   signal flanks the label on both sides — a thin ember track with an
   EEG waveform scrolling through it and a soft flicker, so the words
   sit between two running signal traces. */
.hero .overline {
  margin-bottom: 18px;
  color: var(--ember-hi);
  gap: 12px;
}
.hero .overline::before,
.hero .overline::after {
  content: "";
  display: block;
  flex: 0 0 auto;
  width: 44px; height: 14px;
  background:
    /* the running EEG trace */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='14'%3E%3Cpath d='M0 7 H8 l2 -5 2 10 2 -5 H24 l2 -4 2 8 2 -4 H48' fill='none' stroke='%23E2984A' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E") left center repeat-x,
    /* the baseline the trace rides on */
    linear-gradient(90deg, transparent, rgba(var(--ember-rgb), 0.32) 30%, rgba(var(--ember-rgb), 0.32) 70%, transparent) left center / 100% 1px no-repeat;
  filter: drop-shadow(0 0 3px rgba(var(--ember-rgb), 0.75));
  /* both traces fade on their OUTER edge and stay solid toward the label */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 60%);
  mask-image: linear-gradient(90deg, transparent, #000 60%);
  animation: sig-flow 1.15s linear infinite, sig-flicker 2.6s steps(1) infinite;
}
/* mirror the trailing trace so the two are perfectly symmetric about the
   label — same width, same fade, same waveform, flipped on the x-axis */
.hero .overline::after { transform: scaleX(-1); }
@keyframes sig-flow {
  from { background-position: 0 center, left center; }
  to   { background-position: -48px center, left center; }
}
@keyframes sig-flicker {
  0%, 96%, 100% { opacity: 1; }
  97%           { opacity: 0.45; }
  98.5%         { opacity: 0.9; }
}

/* the reference headline: neutral grotesque, semibold, tight,
   one silver gradient falling from lit white to smoke */
.hero h2 {
  font-size: clamp(40px, 5.4vw, 78px);
  font-weight: 600;
  line-height: 1.0;
  letter-spacing: -0.03em;
}
.hero h2 .hl { display: block; overflow: hidden; }
.hero h2 .hl > span {
  display: block; transform: translateY(104%);
  background: linear-gradient(110deg, #FFFFFF 12%, #D9D6DF 48%, #8F8A99 96%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
/* both lines wear the same silver — override style.css's blue .grad */
.hero h2 .grad {
  background: linear-gradient(110deg, #FFFFFF 12%, #D9D6DF 48%, #8F8A99 96%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
body.booted .hero h2 .hl > span {
  animation: hl-rise 1.05s var(--ease-spring) both;
}
body.booted .hero h2 .hl:nth-child(1) > span { animation-delay: 0.66s; }
body.booted .hero h2 .hl:nth-child(2) > span { animation-delay: 0.78s; }
@keyframes hl-rise { from { transform: translateY(104%); } to { transform: translateY(0); } }

.hero p {
  margin: 22px 0 0;
  max-width: 46ch;
  font-size: clamp(15px, 1.1vw, 17px);
  line-height: 1.62;
}

/* ---------- region chips ---------- */

.hero-regions {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline-soft);
}
.hr-cap {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 13px;
}
.hr-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.hr-chip {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-2);
  border: 1px solid var(--hairline);
  border-radius: 7px; padding: 6px 10px;
  background: rgba(var(--panel-rgb), 0.42);
  transition: color 0.2s var(--ease-out), border-color 0.2s var(--ease-out), background 0.2s var(--ease-out);
}
.hr-chip b { color: var(--accent-bright); font-weight: 600; letter-spacing: 0.06em; }
.hr-chip:hover {
  color: var(--text);
  border-color: rgba(var(--accent-rgb), 0.42);
  background: rgba(var(--accent-rgb), 0.09);
}
.hr-chip.hr-more { color: var(--faint); }

/* ---------- hero actions ---------- */

.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; margin-top: 36px; }

/* ---------- live cortical signal strip (replaces the CTA pair) ---------- */
/* an ember-lit readout: a pulsing live dot, a label, a flowing EEG trace
   and a frequency tag — the amber electrical-signal motif from the overline,
   scaled up into a standalone instrument. */
.signal-strip {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 12px 18px; border-radius: 12px;
  background:
    radial-gradient(120% 160% at 0% 50%, rgba(var(--ember-rgb), 0.10), transparent 60%),
    rgba(var(--panel-rgb), 0.42);
  border: 1px solid rgba(var(--ember-rgb), 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 0 26px rgba(var(--ember-rgb), 0.08);
}
.sig-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ember-hi);
  box-shadow: 0 0 0 0 rgba(var(--ember-rgb), 0.55);
  animation: sig-pulse 1.6s var(--ease-out) infinite;
}
@keyframes sig-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(var(--ember-rgb), 0.55); opacity: 1; }
  70%  { box-shadow: 0 0 0 9px rgba(var(--ember-rgb), 0); opacity: 0.7; }
  100% { box-shadow: 0 0 0 0 rgba(var(--ember-rgb), 0); opacity: 1; }
}
.sig-label {
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
  color: var(--text); letter-spacing: 0.01em;
}
/* the flowing EEG trace — same waveform as the overline, wider */
.sig-wave {
  flex: 0 0 auto; width: 118px; height: 16px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='16'%3E%3Cpath d='M0 8 H8 l2 -6 2 12 2 -6 H24 l2 -5 2 10 2 -5 H48' fill='none' stroke='%23E2984A' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") left center repeat-x,
    linear-gradient(90deg, transparent, rgba(var(--ember-rgb), 0.30) 12%, rgba(var(--ember-rgb), 0.30) 88%, transparent) left center / 100% 1px no-repeat;
  filter: drop-shadow(0 0 3px rgba(var(--ember-rgb), 0.7));
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  animation: sig-flow 1.15s linear infinite, sig-flicker 2.6s steps(1) infinite;
}
.sig-hz {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--ember-hi);
}

/* ---- state: LIVE (running) — amber, flowing, pulsing ---- */
/* the amber look defined above is the LIVE state; nothing extra needed,
   but keep the flow + pulse explicit so state toggles are unambiguous. */
.signal-strip.is-live .sig-dot  { animation: sig-pulse 1.6s var(--ease-out) infinite; }
.signal-strip.is-live .sig-wave { animation-play-state: running, running; }

/* ---- state: OFFLINE (idle) — red, still, no pulse ---- */
:root { --sig-off-rgb: 235, 78, 62; }   /* signal-red */
.signal-strip.is-offline {
  border-color: rgba(var(--sig-off-rgb), 0.30);
  background:
    radial-gradient(120% 160% at 0% 50%, rgba(var(--sig-off-rgb), 0.10), transparent 60%),
    rgba(var(--panel-rgb), 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 0 26px rgba(var(--sig-off-rgb), 0.07);
}
.signal-strip.is-offline .sig-dot {
  background: rgb(var(--sig-off-rgb));
  box-shadow: 0 0 6px rgba(var(--sig-off-rgb), 0.6);
  animation: none;                       /* offline = steady, not pulsing */
}
.signal-strip.is-offline .sig-hz { color: rgb(var(--sig-off-rgb)); }
/* red flat-line: red waveform, and the flow is frozen so it reads as "no signal" */
.signal-strip.is-offline .sig-wave {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='16'%3E%3Cpath d='M0 8 H48' fill='none' stroke='%23EB4E3E' stroke-width='1.6'/%3E%3C/svg%3E") left center repeat-x,
    linear-gradient(90deg, transparent, rgba(var(--sig-off-rgb), 0.28) 12%, rgba(var(--sig-off-rgb), 0.28) 88%, transparent) left center / 100% 1px no-repeat;
  filter: drop-shadow(0 0 3px rgba(var(--sig-off-rgb), 0.55));
  animation: sig-flicker 3.4s steps(1) infinite;   /* faint red flatline, no scroll */
}

/* ---------- cortex stage ---------- */

#brain-stage {
  height: min(78vh, 720px);
  max-width: none;
  margin: 0;
}

[data-theme="aura"] #brain-stage::before {
  width: 660px; height: 660px;
  top: 48%;
}

.stage-readout {
  position: absolute; right: 4px; bottom: 6px; z-index: 5;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--faint); pointer-events: none;
}
.stage-readout b { color: var(--accent-bright); font-weight: 600; }

/* ---------- perspective floor, moved out of the stage ---------- */

.hero-floor {
  position: relative; z-index: 0;
  height: 0; margin: 0 auto;
  pointer-events: none;
}
[data-theme="aura"] .hero-floor .terrain {
  bottom: -240px;
  height: 560px;
}

/* ---------- scan FX: neural overlay replaces the scan-line ---------- */

/* retire the old sweeping line + CRT stripes */
.preview-box .scanline { display: none !important; }
.preview-box.scanning::after {
  /* keep only a soft cool tint so the neural glow reads over the image */
  background: radial-gradient(120% 90% at 50% 40%, transparent 40%, rgba(var(--accent-rgb), 0.10) 100%);
}

/* the live neuron field, drawn by scan-fx.js over the stimulus */
.scan-neural {
  position: absolute; inset: 0; z-index: 3;
  width: 100%; height: 100%;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: screen;
  transition: opacity 0.4s var(--ease-out);
}
.preview-box.scanning .scan-neural { opacity: 1; }

/* ---------- console anchor ---------- */

#console { scroll-margin-top: 92px; margin-top: 44px; position: relative; z-index: 2; }

/* ---------- responsive ---------- */

@media (max-width: 1000px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 8px;
    padding-top: 18px;
  }
  .hero-copy { order: 2; }
  #brain-stage { order: 1; height: 44vh; }
  [data-theme="aura"] #brain-stage::before { width: 460px; height: 460px; }
  .stage-readout { display: none; }
  .hero h2 { font-size: clamp(34px, 9vw, 52px); }
  .aura-hex { width: 78vw; height: 40vh; }
}

@media (max-width: 640px) {
  .hero-actions { gap: 16px; }
  .hero-btn { width: 100%; justify-content: center; }
  #brain-stage { height: 38vh; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .aura-bloom { animation: none; }
  .hero h2 .hl > span,
  body.booted .hero h2 .hl > span { transform: none; animation: none; }
}
