/* ═══════════════════════════════════════════════════════
   MATHSTAR.CSS
   Unified styles for the three-act beat-driven story page.
   Layout: full-viewport, no scroll. Two columns throughout.
   Colors driven by body[data-act] and body[data-beat-type].
═══════════════════════════════════════════════════════ */

/* ─── Fonts & tokens ─────────────────────────────────── */
:root {
  --f-mono:    'Courier New', 'Lucida Console', monospace;
  --f-display: 'Playfair Display', Georgia, serif;
  --f-body:    'Inter', system-ui, sans-serif;

  /* Layout */
  --px: clamp(2.5rem, 6vw, 6rem);
  --py: clamp(3rem,   7vh, 5rem);
  --col-left:  55%;
  --col-right: 40%;
  --col-gap:   5%;
}

/* ─── Act colour tokens ──────────────────────────────── */
/* Act 1 — green phosphor terminal */
body[data-act="1"] {
  --act-bg:      #000000;
  --act-text:    #00FF41;
  --act-border:  rgba(0, 255, 65, 0.28);
  --act-panel:   rgba(0, 255, 65, 0.02);
  --act-glow:    rgba(0, 255, 65, 0.45);
  --act-dim:     rgba(0, 255, 65, 0.15);
  --act-font:    var(--f-mono);
  --act-size:    clamp(0.9rem, 1.6vw, 1.15rem);
  --act-weight:  400;
  --act-style:   normal;
  --act-lh:      1.75;
}

/* Act 2 — amber Playfair italic */
body[data-act="2"] {
  --act-bg:      #080800;
  --act-text:    #F5A623;
  --act-border:  rgba(245, 166, 35, 0.28);
  --act-panel:   rgba(245, 166, 35, 0.03);
  --act-glow:    rgba(245, 166, 35, 0.35);
  --act-dim:     rgba(245, 166, 35, 0.15);
  --act-font:    var(--f-display);
  --act-size:    clamp(1.1rem, 2vw, 1.6rem);
  --act-weight:  400;
  --act-style:   italic;
  --act-lh:      1.65;
}

/* Act 3 — white on ocean */
body[data-act="3"] {
  --act-bg:      #08080e;
  --act-text:    #ffffff;
  --act-border:  rgba(255, 255, 255, 0.20);
  --act-panel:   rgba(255, 255, 255, 0.04);
  --act-glow:    rgba(255, 255, 255, 0.20);
  --act-dim:     rgba(255, 255, 255, 0.12);
  --act-font:    var(--f-display);
  --act-size:    clamp(0.95rem, 1.70vw, 1.58rem);
  --act-weight:  700;
  --act-style:   normal;
  --act-lh:      1.3;
}


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

html, body {
  width:   100%;
  height:  100%;
  overflow: hidden;           /* locked viewport — no native scroll */
}

body {
  background: var(--act-bg, #000);
  color:      var(--act-text, #fff);
  transition: background 1.2s ease, color 0.6s ease;
  -webkit-font-smoothing: antialiased;
}


/* ═══════════════════════════════════════════════════════
   OCEAN CANVAS (Act 3 background)
═══════════════════════════════════════════════════════ */
#ocean-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0;
  transition: opacity 1.4s ease;
  pointer-events: none;
}

#ocean-canvas.is-active {
  opacity: 1;
}


/* ═══════════════════════════════════════════════════════
   STORY STAGE — two-column full-viewport layout
═══════════════════════════════════════════════════════ */
#story-stage {
  position: relative;
  z-index: 2;
  display: flex;
  gap: var(--col-gap);
  align-items: center;
  width: 100%;
  max-width: 1200px;
  height: 100vh;
  margin: 0 auto;
  padding: var(--py) var(--px);
}

/* Left column */
#story-left {
  flex: 0 0 var(--col-left);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Right column: ASCII / stats panel */
#story-right {
  flex: 0 0 var(--col-right);
  border: 1px solid var(--act-border);
  padding: 0.75rem;
  background: var(--act-panel);
  align-self: center;
  position: relative;
  overflow: hidden;
  transition: border-color 0.8s ease, background 0.8s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* CRT scanline overlay on right panel */
#story-right::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,         transparent 3px,
    rgba(0,0,0,0.07) 3px, rgba(0,0,0,0.07) 4px
  );
  pointer-events: none;
  z-index: 1;
}


/* ═══════════════════════════════════════════════════════
   BEAT TEXT
═══════════════════════════════════════════════════════ */
#beat-line-wrap {
  position: relative;
}

/* Ghost holds the full text's height — invisible but space-occupying */
#beat-line-ghost {
  visibility: hidden;
  pointer-events: none;
  user-select: none;
}

/* Visible text sits on top, absolutely positioned so it can't cause reflow */
#beat-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
}

.beat-text {
  font-family:  var(--act-font);
  font-size:    var(--act-size);
  font-weight:  var(--act-weight);
  font-style:   var(--act-style);
  line-height:  var(--act-lh);
  color:        var(--act-text);
  text-shadow:  0 0 10px var(--act-glow);
  white-space:  pre-wrap;               /* honours \n in beat text */
  letter-spacing: 0.01em;
  transition:   color 0.6s ease, text-shadow 0.6s ease;
}


/* ═══════════════════════════════════════════════════════
   PROMPT
═══════════════════════════════════════════════════════ */
#beat-prompt {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.5rem;
  font-family: var(--f-mono);
  font-size:   0.78rem;
  color:       var(--act-text);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

#beat-prompt.is-visible {
  opacity: 0.5;
}

.prompt-cursor {
  animation: blink 1.1s step-end infinite;
}

.prompt-hint {
  letter-spacing: 0.06em;
  text-shadow: 0 0 6px var(--act-glow);
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}


/* ═══════════════════════════════════════════════════════
   ASCII ART
═══════════════════════════════════════════════════════ */
.ascii-art {
  font-family:  var(--f-mono);
  font-size:    clamp(0.52rem, 0.82vw, 0.76rem);
  line-height:  1.25;
  color:        var(--act-text);
  text-shadow:  0 0 6px var(--act-glow);
  white-space:  pre;
  overflow:     hidden;
  position:     relative;
  z-index: 2;           /* above CRT ::after scanline */
  transition:   opacity 0.16s ease, color 0.6s ease, text-shadow 0.6s ease;
}


/* ═══════════════════════════════════════════════════════
   CONTENT VISIBILITY BY BEAT TYPE
   body[data-beat-type] drives what shows in left/right panels.
═══════════════════════════════════════════════════════ */

/* All special content divs hidden by default */
#content-text,
#content-video,
#content-impact,
#content-cta,
#content-system,
#content-stats,
#content-video-right,
#content-cta-right { display: none; }

/* text beat */
body[data-beat-type="text"] #content-text    { display: block; }
body[data-beat-type="text"] #ascii-display   { display: block; }

/* text beat with right-panel video (a3-1, a3-2) */
body[data-right-panel="video"] #ascii-display        { display: none; }
body[data-right-panel="video"] #content-video-right  { display: block; }

#content-video-right { width: 100%; }
#story-video-right   { width: 100%; display: block; border: 1px solid var(--act-border); }

body[data-right-panel="video"] #story-right { padding: 0.35rem; }

/* Wider right column on video beats (desktop only — mobile is column layout) */
@media (min-width: 769px) {
  body[data-right-panel="video"] #story-stage {
    --col-left:  48%;
    --col-right: 47%;
    --col-gap:   5%;
  }
}

/* right-panel CTA */
body[data-right-panel="cta"] #ascii-display    { display: none; }
body[data-right-panel="cta"] #content-cta-right { display: flex; align-items: center; justify-content: center; padding: 2.5rem 1rem; }

.cta-button-right {
  display: inline-block;
  padding: 1.4rem 3.85rem;
  background-color: #7B2FBE;
  color: #fff;
  font-family: var(--f-body);
  font-weight: 400;
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  z-index: 10;
}

.cta-button-right:hover {
  background-color: #9340e0;
  transform: translateY(-2px);
  box-shadow: 0 0 50px rgba(147, 64, 224, 0.55);
}

.cta-button-right:active { transform: translateY(0); }

.cta-right-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.cta-button-right--outline {
  background-color: transparent;
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  box-shadow: none;
}
.cta-button-right--outline:hover {
  background-color: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.75);
  box-shadow: none;
}

/* video beat — full left, right panel hidden */
body[data-beat-type="video"] #content-video  { display: block; }
body[data-beat-type="video"] #story-right    { visibility: hidden; }

/* impact beat — quotes left, stats right */
body[data-beat-type="impact"] #content-impact { display: block; }
body[data-beat-type="impact"] #content-stats  { display: block; }
body[data-beat-type="impact"] #ascii-display  { display: none; }

/* cta beat — full left, right panel hidden */
body[data-beat-type="cta"] #content-cta      { display: block; }
body[data-beat-type="cta"] #story-right       { visibility: hidden; }
body[data-beat-type="cta"] #story-left        { align-items: center; text-align: center; }


/* ═══════════════════════════════════════════════════════
   VIDEO BEAT
═══════════════════════════════════════════════════════ */
#content-video {
  width: 100%;
}

#story-video {
  width: 100%;
  max-height: 70vh;
  display: block;
  border: 1px solid var(--act-border);
  background: #000;
}

.video-caption {
  margin-top: 0.75rem;
  font-family: var(--f-body);
  font-weight: 300;
  font-size:   0.82rem;
  color:       var(--act-dim);
  letter-spacing: 0.05em;
  text-align: center;
}


/* ═══════════════════════════════════════════════════════
   IMPACT BEAT
═══════════════════════════════════════════════════════ */
.impact-heading {
  font-family:  var(--f-display);
  font-style:   italic;
  font-size:    clamp(0.95rem, 1.6vw, 1.3rem);
  font-weight:  400;
  color:        var(--act-text);
  margin-bottom: 1.25rem;
  opacity: 0.8;
}

.impact-quotes {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.impact-quotes blockquote {
  font-family: var(--f-display);
  font-style:  italic;
  font-size:   clamp(0.9rem, 1.4vw, 1.1rem);
  line-height: 1.55;
  color:       var(--act-text);
  border-left: 2px solid var(--act-border);
  padding-left: 1rem;
}

#content-stats {
  position: relative;
  z-index: 2;
}

.impact-stats {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 1.25rem;
}

.impact-stats li {
  font-family: var(--f-body);
  font-weight: 300;
  font-size:   clamp(0.85rem, 1.3vw, 1rem);
  color:       var(--act-text);
  padding-left: 1.4rem;
  position: relative;
}

.impact-stats li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--act-text);
  opacity: 0.7;
}


/* ═══════════════════════════════════════════════════════
   CTA BEAT
═══════════════════════════════════════════════════════ */
.cta-headline {
  font-family: var(--f-display);
  font-size:   clamp(1.4rem, 3.2vw, 2.75rem);
  font-weight: 700;
  color:       var(--act-text);
  line-height: 1.25;
  margin-bottom: 1rem;
}

.cta-sub {
  font-family: var(--f-body);
  font-weight: 300;
  font-size:   clamp(0.95rem, 1.6vw, 1.15rem);
  color:       var(--act-text);
  opacity:     0.65;
  margin-bottom: 2.5rem;
}

.cta-button {
  display: inline-block;
  padding: 1rem 3.25rem;
  background: var(--act-text);
  color: var(--act-bg, #000);
  font-family: var(--f-body);
  font-weight: 400;
  font-size:   0.88rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: opacity 0.25s ease, transform 0.2s ease;
  position: relative;
  z-index: 10;
}

.cta-button:hover  { opacity: 0.85; transform: translateY(-2px); }
.cta-button:active { transform: translateY(0); }

.cta-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.cta-group .cta-button {
  flex: 1;
  text-align: center;
}

.cta-button--outline {
  background: transparent;
  color: var(--act-text);
  border: 1px solid color-mix(in srgb, var(--act-text) 45%, transparent);
  box-shadow: none;
}
.cta-button--outline:hover {
  opacity: 1;
  background: color-mix(in srgb, var(--act-text) 8%, transparent);
  border-color: var(--act-text);
  transform: translateY(-2px);
}


/* ═══════════════════════════════════════════════════════
   NAVIGATION
═══════════════════════════════════════════════════════ */
#beat-nav {
  position: fixed;
  bottom: 1.75rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

#beat-counter {
  font-family: var(--f-mono);
  font-size:   0.72rem;
  letter-spacing: 0.12em;
  color:       var(--act-text);
  opacity:     0.45;
  white-space: nowrap;
  transition:  color 0.6s ease;
}

#nav-prev,
#nav-next {
  background:  none;
  border:      1px solid var(--act-border);
  color:       var(--act-text);
  font-family: var(--f-mono);
  font-size:   0.85rem;
  width:  2rem;
  height: 2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:  border-color 0.3s ease, opacity 0.3s ease;
  opacity: 0.55;
}

#nav-prev:hover,
#nav-next:hover  { opacity: 1; }
#nav-prev:disabled,
#nav-next:disabled { opacity: 0.18; cursor: default; }

#nav-skip {
  position: fixed;
  bottom: 1.75rem;
  right: 2rem;
  z-index: 20;
  background: none;
  border: 1px solid var(--act-border);
  color: var(--act-text);
  font-family: var(--f-mono);
  font-size: 0.65rem;
  letter-spacing: 0.10em;
  padding: 0.42rem 0.9rem;
  cursor: pointer;
  opacity: 0.45;
  white-space: nowrap;
  transition: opacity 0.3s ease, border-color 0.3s ease;
}

#nav-skip:hover { opacity: 1; }

#nav-skip.is-hidden {
  opacity: 0;
  pointer-events: none;
}


/* ═══════════════════════════════════════════════════════
   CLICK OVERLAY (advance on click, below all interactive)
═══════════════════════════════════════════════════════ */
#story-overlay {
  position: fixed;
  inset: 0;
  z-index: 5;
  cursor: pointer;
  outline: none;
}

/* Don't capture clicks on video player or CTA */
body[data-beat-type="video"]  #story-overlay,
body[data-beat-type="cta"]    #story-overlay,
body[data-right-panel="cta"]  #story-overlay { pointer-events: none; }


/* ═══════════════════════════════════════════════════════
   RESPONSIVE — 768px  (tablet + phone)
═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  :root {
    --px: 1.25rem;   /* tighter horizontal padding on small screens */
    --py: 1.25rem;
  }

  #story-stage {
    flex-direction: column;
    height: 100vh;
    height: 100dvh;  /* respects mobile browser chrome */
    overflow: hidden;
    gap: 0.75rem;
    align-items: stretch;
    padding: 1.25rem 1.25rem 4.5rem; /* bottom gap for nav bar */
  }

  /* Text block: fixed height so the panel below doesn't jump */
  #story-left {
    flex: 0 0 38dvh;
    width: 100%;
    overflow: visible;    /* text can spill out if a beat is long */
  }

  /* Panel: fills the remaining fixed space below */
  #story-right {
    flex: 1;
    width: 100%;
    min-height: 0;
    align-self: stretch;
    overflow: hidden;
  }

  /* Video fills the panel height on mobile */
  #content-video-right,
  #story-video-right {
    height: 100%;
    object-fit: cover;
  }
}

/* ── 480px ─────────────────────────────────────────── */
@media (max-width: 480px) {
  body[data-beat-type="cta"] #story-left { align-items: flex-start; text-align: left; }
}


/* ═══════════════════════════════════════════════════════
   SYSTEM BEAT — three product cards
═══════════════════════════════════════════════════════ */

/* Layout overrides: full-width, right panel gone */
body[data-beat-type="system"] #story-right   { display: none; }
body[data-beat-type="system"] #story-stage   { gap: 0; }
body[data-beat-type="system"] #story-overlay { pointer-events: none; }

/* stretch makes #story-left fill the full cross-axis of #story-stage */
body[data-beat-type="system"] #story-left {
  flex: 1;
  width: 100%;
  align-self: stretch;
  overflow: visible;
}

/* Two-column: lede text left, stacked cards right */
body[data-beat-type="system"] #content-system {
  display:     flex;
  flex-direction: row;
  flex:        1;
  min-height:  0;
  gap:         2rem;
  padding:     var(--py) var(--px);
  align-items: stretch;
}

/* ── Left lede — same voice as the prior typewriter beats ── */
.sys-lede {
  flex:            0 0 34%;
  display:         flex;
  align-items:     flex-start;
  justify-content: center;
  flex-direction:  column;
}

/* Inherits the act's font, size, weight, glow — identical to .beat-text */
.sys-lede-text {
  font-family:  var(--act-font);
  font-size:    var(--act-size);
  font-weight:  var(--act-weight);
  font-style:   var(--act-style);
  line-height:  var(--act-lh);
  color:        var(--act-text);
  text-shadow:  0 0 10px var(--act-glow);
  white-space:  pre-wrap;
  margin: 0;
}

/* ── Right: stacked landscape cards ── */
.sys-cards {
  flex:           1;
  display:        flex;
  flex-direction: column;
  gap:            0.65rem;
  min-height:     0;
  /* breathing room so glows aren't clipped by parent edge */
  padding:        0.5rem 0.5rem 0.5rem 0;
}

/* Individual card */
.sys-card {
  flex:        1 1 0;
  position:    relative;
  overflow:    hidden;
  border:      1px solid rgba(255, 255, 255, 0.12);
  text-decoration: none;
  display:     block;
  min-height:  0;
  min-width:   0;
  transition:  border-color 0.30s ease, box-shadow 0.35s ease, transform 0.25s ease;
}

/* Product-specific idle glows */
.sys-card:nth-child(1) {
  box-shadow:   0 0 28px rgba(0, 210, 245, 0.65), 0 0 70px rgba(0, 175, 215, 0.35), 0 0 120px rgba(0, 150, 195, 0.18);
  border-color: rgba(0, 215, 248, 0.55);
}
.sys-card:nth-child(2) {
  box-shadow:   0 0 28px rgba(255, 115, 30, 0.65), 0 0 70px rgba(230, 80, 10, 0.35), 0 0 120px rgba(200, 60, 0, 0.18);
  border-color: rgba(255, 128, 45, 0.55);
}
.sys-card:nth-child(3) {
  box-shadow:   0 0 28px rgba(255, 215, 40, 0.65), 0 0 70px rgba(210, 165, 0, 0.35), 0 0 120px rgba(180, 135, 0, 0.18);
  border-color: rgba(255, 220, 55, 0.55);
}

/* Hover: full blaze + lift */
.sys-card:nth-child(1):hover {
  box-shadow:   0 4px 36px rgba(0, 225, 255, 0.88), 0 0 90px rgba(0, 190, 230, 0.50), 0 0 150px rgba(0, 160, 210, 0.25);
  border-color: rgba(0, 230, 255, 0.80);
  transform:    translateY(-2px);
}
.sys-card:nth-child(2):hover {
  box-shadow:   0 4px 36px rgba(255, 135, 50, 0.88), 0 0 90px rgba(240, 95, 20, 0.50), 0 0 150px rgba(210, 65, 0, 0.25);
  border-color: rgba(255, 145, 65, 0.80);
  transform:    translateY(-2px);
}
.sys-card:nth-child(3):hover {
  box-shadow:   0 4px 36px rgba(255, 228, 60, 0.88), 0 0 90px rgba(220, 175, 0, 0.50), 0 0 150px rgba(190, 145, 0, 0.25);
  border-color: rgba(255, 230, 70, 0.80);
  transform:    translateY(-2px);
}

/* Video fills the card */
.sys-card-video {
  position:   absolute;
  inset:      0;
  width:      100%;
  height:     100%;
  object-fit: cover;
}

/* Dual gradient: left-to-right darkens the text zone, bottom-to-top grounds the footer */
.sys-card-overlay {
  position: absolute;
  inset:    0;
  background:
    linear-gradient(to right,  rgba(0,0,0,0.62) 0%, rgba(0,0,0,0.25) 55%, rgba(0,0,0,0.08) 100%),
    linear-gradient(to top,    rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.22) 60%, rgba(0,0,0,0.04) 100%);
  transition: background 0.25s ease;
}

.sys-card:hover .sys-card-overlay {
  background:
    linear-gradient(to right,  rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.35) 55%, rgba(0,0,0,0.12) 100%),
    linear-gradient(to top,    rgba(0,0,0,0.80) 0%, rgba(0,0,0,0.32) 60%, rgba(0,0,0,0.08) 100%);
}

/* Card footer — title left, chip right */
.sys-card-body {
  position:        absolute;
  bottom: 0; left: 0; right: 0;
  padding:         0.75rem 1rem;
  z-index:         2;
  display:         flex;
  flex-direction:  row;
  align-items:     center;
  justify-content: space-between;
  gap:             0.75rem;
}

/* "Free" sticker — gold circle, top-right corner */
.sys-card-badge {
  position:      absolute;
  top:           0.6rem;
  right:         0.65rem;
  z-index:       3;
  width:         2.1rem;
  height:        2.1rem;
  border-radius: 50%;
  background:    #ffd700;
  color:         #0a0a0a;
  font-family:   var(--f-body);
  font-size:     0.50rem;
  font-weight:   800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display:       flex;
  align-items:   center;
  justify-content: center;
  transform:     rotate(12deg);
  box-shadow:    0 2px 8px rgba(0,0,0,0.50), 0 0 12px rgba(255,215,0,0.40);
}

/* Card title */
.sys-card-title {
  font-family: var(--f-display);
  font-size:   clamp(0.82rem, 1.15vw, 1.10rem);
  font-weight: 700;
  font-style:  normal;
  color:       #ffffff;
  line-height: 1.2;
  margin: 0;
  flex: 1;
}

/* Action chip — fixed width so all three align regardless of label length */
.sys-card-chip {
  display:        inline-block;
  width:          11rem;
  text-align:     center;
  padding:        0.38rem 0.85rem;
  border:         1.5px solid rgba(255, 255, 255, 0.55);
  color:          #ffffff;
  font-family:    var(--f-body);
  font-size:      0.70rem;
  font-weight:    400;
  letter-spacing: 0.04em;
  background:     transparent;
  white-space:    nowrap;
  flex-shrink:    0;
  transition:     border-color 0.2s ease, background 0.2s ease;
}

/* Product-specific chip colours — idle */
.sys-card:nth-child(1) .sys-card-chip {
  border-color: rgba(0,   215, 248, 0.70);
  box-shadow:   0 0 8px rgba(0, 210, 245, 0.50), 0 0 20px rgba(0, 185, 220, 0.22);
}
.sys-card:nth-child(2) .sys-card-chip {
  border-color: rgba(255, 128,  45, 0.70);
  box-shadow:   0 0 8px rgba(255, 115, 30, 0.50), 0 0 20px rgba(230, 80, 10, 0.22);
}
.sys-card:nth-child(3) .sys-card-chip {
  border-color: rgba(255, 220,  55, 0.70);
  box-shadow:   0 0 8px rgba(255, 215, 40, 0.50), 0 0 20px rgba(210, 165, 0, 0.22);
}

/* Hover: blazing */
.sys-card:nth-child(1):hover .sys-card-chip {
  border-color: rgba(0,   230, 255, 1.00);
  background:   rgba(0,   200, 240, 0.12);
  box-shadow:   0 0 14px rgba(0, 225, 255, 0.80), 0 0 35px rgba(0, 190, 235, 0.38);
}
.sys-card:nth-child(2):hover .sys-card-chip {
  border-color: rgba(255, 145,  65, 1.00);
  background:   rgba(255, 115,  30, 0.12);
  box-shadow:   0 0 14px rgba(255, 135, 50, 0.80), 0 0 35px rgba(235, 90, 15, 0.38);
}
.sys-card:nth-child(3):hover .sys-card-chip {
  border-color: rgba(255, 230,  70, 1.00);
  background:   rgba(255, 215,  40, 0.12);
  box-shadow:   0 0 14px rgba(255, 228, 60, 0.80), 0 0 35px rgba(215, 170, 0, 0.38);
}


/* ─── Responsive — mobile ────────────────────────────── */
@media (max-width: 768px) {
  body[data-beat-type="system"] #story-stage {
    overflow-y:  auto;
    align-items: stretch;
    padding:     1.25rem 1.25rem 4.5rem;
  }

  body[data-beat-type="system"] #story-left  { flex: 1; overflow: visible; }

  body[data-beat-type="system"] #content-system {
    flex-direction: column;  /* lede above cards */
    flex:           none;
    height:         auto;
    padding:        0;
    gap:            1.25rem;
  }

  .sys-lede { flex: none; }

  .sys-cards {
    flex:      none;
    height:    auto;
    gap:       0.6rem;
    padding:   0;
  }

  .sys-card {
    flex:   none;
    height: 52dvh;
  }

  .sys-card-body {
    flex-direction: column;
    align-items:    flex-start;
    padding:        1.1rem 1rem 1rem;
    gap:            0.5rem;
  }
}

/* ─── 480px ──────────────────────────────────────────── */
@media (max-width: 480px) {
  .sys-card           { height: 48dvh; }
  .sys-card-title     { font-size: clamp(0.9rem, 4vw, 1.1rem); }
}


/* ═══════════════════════════════════════════════════════
   REDUCED MOTION
═══════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  body,
  .beat-text,
  .ascii-art,
  .prompt-cursor,
  .cta-button,
  .sys-card,
  .sys-card-overlay,
  .sys-card-chip,
  #ocean-canvas,
  #beat-prompt { transition: none !important; animation: none !important; }
}
