/* ==========================================================================
   Vibe Code Racing — Race to Space visual
   DougState Spring2 palette (classic dark + signature gradient)
   Visual-first: abstract motion, not a content layout
   ========================================================================== */

:root {
  color-scheme: dark;

  --ds-burgundy: #400101;
  --ds-red: #f22f31;
  --ds-gold: #d3a567;
  --ds-teal: #038c8c;

  --ds-bg: #120606;
  --ds-card: rgba(255, 255, 255, 0.08);
  --ds-border: rgba(255, 255, 255, 0.16);
  --ds-text: #f7efe8;
  --ds-muted: #cdb9aa;

  --ds-gradient: linear-gradient(
    90deg,
    #400101 0%,
    #f22f31 38%,
    #d3a567 70%,
    #038c8c 100%
  );

  --font: Helvetica, "Helvetica Neue", Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

html,
body {
  min-height: 100%;
}

body.race-stage {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--ds-text);
  background: var(--ds-bg);
  -webkit-font-smoothing: antialiased;
  cursor: crosshair;
  overflow-x: hidden;
  overflow-y: auto;
}

/* —— Fixed race stage (stays under first panel) —— */
.stage-race {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* —— Scroll panels —— */
.scroll-flow {
  position: relative;
  z-index: 5;
}

.panel {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
}

.panel-race {
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* Transparent so fixed stage-race shows through */
  background: transparent;
}

/* —— Priestess → sky goddess (scroll-driven sticky stage) —— */
.panel-sky-myth {
  --sky-dissolve: 0;
  --sky-night: 0;
  --sky-progress: 0;
  z-index: 6;
  /* Tall track so sticky stage can animate over scroll */
  min-height: 280vh;
  background: var(--ds-bg);
  isolation: isolate;
}

.sky-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(260px, 38%) 1fr;
  grid-template-rows: 1fr auto;
  background: var(--ds-bg);
}

.sky-visual {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.priestess-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Bias figure to the right so left column can hold type */
  object-position: 68% 18%;
  filter: saturate(calc(1.05 - var(--sky-dissolve) * 0.85))
    contrast(calc(1.04 + var(--sky-dissolve) * 0.2))
    brightness(calc(0.9 - var(--sky-dissolve) * 0.55))
    blur(calc(var(--sky-dissolve) * 10px));
  opacity: calc(1 - var(--sky-dissolve) * 0.92);
  transform: scale(calc(1 + var(--sky-dissolve) * 0.08));
  z-index: 0;
  transition: none;
}

#sky-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  display: block;
  pointer-events: none;
}

.priestess-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    /* Left reading column scrim (stronger as night arrives) */
    linear-gradient(
      90deg,
      rgba(18, 6, 6, calc(0.72 + var(--sky-night) * 0.2)) 0%,
      rgba(18, 6, 6, calc(0.45 + var(--sky-night) * 0.25)) 28%,
      rgba(18, 6, 6, calc(0.1 + var(--sky-dissolve) * 0.35)) 52%,
      transparent 72%
    ),
    radial-gradient(
      ellipse 55% 50% at 62% 42%,
      transparent 0%,
      rgba(18, 6, 6, calc(0.12 + var(--sky-dissolve) * 0.35)) 55%,
      rgba(18, 6, 6, calc(0.4 + var(--sky-dissolve) * 0.4)) 100%
    ),
    linear-gradient(
      180deg,
      rgba(18, 6, 6, 0.45) 0%,
      transparent 18%,
      transparent 62%,
      rgba(64, 1, 1, calc(0.3 + var(--sky-night) * 0.25)) 82%,
      rgba(18, 6, 6, calc(0.75 + var(--sky-night) * 0.15)) 100%
    ),
    radial-gradient(
      ellipse 50% 40% at 12% 20%,
      rgba(211, 165, 103, calc(0.1 - var(--sky-dissolve) * 0.06)) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse 45% 35% at 88% 80%,
      rgba(3, 140, 140, calc(0.08 + var(--sky-night) * 0.1)) 0%,
      transparent 55%
    );
}

.constellation-glow {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: var(--sky-night);
  background:
    radial-gradient(
      ellipse 70% 45% at 62% 38%,
      rgba(211, 165, 103, 0.1) 0%,
      transparent 55%
    ),
    radial-gradient(
      ellipse 50% 40% at 70% 70%,
      rgba(3, 140, 140, 0.08) 0%,
      transparent 50%
    );
  mix-blend-mode: screen;
}

/* White body copy — left of priestess */
.sky-copy {
  position: relative;
  z-index: 8;
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  padding: clamp(4.5rem, 12vh, 6rem) clamp(1.25rem, 3vw, 2.5rem)
    2rem clamp(1.25rem, 4vw, 3rem);
  max-width: 28rem;
  pointer-events: none;
}

.sky-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ds-gold);
  margin-bottom: 1.1rem;
}

.sky-text {
  color: #ffffff;
  font-size: clamp(1.05rem, 2.1vw, 1.35rem);
  line-height: 1.55;
  font-weight: 400;
  letter-spacing: 0.01em;
  text-wrap: pretty;
  text-shadow: 0 1px 18px rgba(18, 6, 6, 0.65);
}

.sky-progress-label {
  margin-top: 1.75rem;
  font-size: 0.65rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ds-muted);
  opacity: calc(0.35 + (1 - var(--sky-progress)) * 0.45);
}

.panel-sky-myth .chrome-foot {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: 8;
  grid-column: 1 / -1;
  grid-row: 2;
}

/* —— Tron grid panel (below Egyptian priestess) —— */
.panel-tron {
  z-index: 7;
  min-height: 100vh;
  min-height: 100dvh;
  background: #02040a;
  isolation: isolate;
  border-top: 1px solid rgba(0, 200, 255, 0.18);
}

.tron-stage {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: clamp(4.5rem, 10vh, 6rem) 1.25rem 2rem;
}

.tron-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 50% 45%, rgba(0, 40, 80, 0.45) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 20% 80%, rgba(80, 0, 20, 0.25) 0%, transparent 55%),
    #02040a;
}

/* Faint static circuit grid */
.tron-grid-static {
  position: absolute;
  inset: -20%;
  background-image:
    linear-gradient(rgba(0, 180, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 180, 255, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(255, 40, 60, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 40, 60, 0.04) 1px, transparent 1px);
  background-size:
    48px 48px,
    48px 48px,
    192px 192px,
    192px 192px;
  opacity: 0.85;
  animation: tron-grid-drift 40s linear infinite;
}

@keyframes tron-grid-drift {
  from { transform: translate(0, 0); }
  to { transform: translate(48px, 48px); }
}

/*
 * Light-cycle bars: travel straight, then turn 90° every 5s.
 * Full square loop = 20s (4 legs × 5s).
 */
.tron-cycle {
  position: absolute;
  width: 140px;
  height: 3px;
  border-radius: 2px;
  will-change: transform;
  transform-origin: center center;
  opacity: 0.95;
}

.tron-cycle--blue {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 220, 255, 0.15) 10%,
    #00e5ff 45%,
    #7ef9ff 55%,
    rgba(0, 220, 255, 0.15) 90%,
    transparent 100%
  );
  box-shadow:
    0 0 6px 1px rgba(0, 220, 255, 0.9),
    0 0 18px 4px rgba(0, 160, 255, 0.55),
    0 0 40px 8px rgba(0, 120, 255, 0.25);
}

.tron-cycle--red {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 40, 60, 0.15) 10%,
    #ff2a3c 45%,
    #ff7a88 55%,
    rgba(255, 40, 60, 0.15) 90%,
    transparent 100%
  );
  box-shadow:
    0 0 6px 1px rgba(255, 40, 60, 0.9),
    0 0 18px 4px rgba(220, 20, 40, 0.55),
    0 0 40px 8px rgba(180, 0, 30, 0.25);
}

/* Each cycle: different start corner / phase; 90° turns every 5s */
.tron-cycle--a {
  top: 18%;
  left: 8%;
  animation: tron-path-a 20s linear infinite;
}
.tron-cycle--b {
  top: 32%;
  left: 55%;
  animation: tron-path-b 20s linear infinite;
  animation-delay: -5s;
}
.tron-cycle--c {
  top: 55%;
  left: 20%;
  animation: tron-path-c 20s linear infinite;
  animation-delay: -10s;
}
.tron-cycle--d {
  top: 72%;
  left: 40%;
  animation: tron-path-d 20s linear infinite;
  animation-delay: -15s;
}
.tron-cycle--e {
  top: 12%;
  left: 70%;
  width: 100px;
  animation: tron-path-e 20s linear infinite;
  animation-delay: -2.5s;
}
.tron-cycle--f {
  top: 48%;
  left: 5%;
  width: 110px;
  animation: tron-path-f 20s linear infinite;
  animation-delay: -7.5s;
}

/* Right → down → left → up */
@keyframes tron-path-a {
  0%, 0.01%   { transform: translate(0, 0) rotate(0deg); }
  24.9%       { transform: translate(55vw, 0) rotate(0deg); }
  25%         { transform: translate(55vw, 0) rotate(90deg); }
  49.9%       { transform: translate(55vw, 42vh) rotate(90deg); }
  50%         { transform: translate(55vw, 42vh) rotate(180deg); }
  74.9%       { transform: translate(0, 42vh) rotate(180deg); }
  75%         { transform: translate(0, 42vh) rotate(270deg); }
  99.9%       { transform: translate(0, 0) rotate(270deg); }
  100%        { transform: translate(0, 0) rotate(360deg); }
}

/* Leftward first then down, etc. */
@keyframes tron-path-b {
  0%, 0.01%   { transform: translate(0, 0) rotate(180deg); }
  24.9%       { transform: translate(-40vw, 0) rotate(180deg); }
  25%         { transform: translate(-40vw, 0) rotate(270deg); }
  49.9%       { transform: translate(-40vw, 35vh) rotate(270deg); }
  50%         { transform: translate(-40vw, 35vh) rotate(0deg); }
  74.9%       { transform: translate(0, 35vh) rotate(0deg); }
  75%         { transform: translate(0, 35vh) rotate(90deg); }
  99.9%       { transform: translate(0, 0) rotate(90deg); }
  100%        { transform: translate(0, 0) rotate(180deg); }
}

@keyframes tron-path-c {
  0%, 0.01%   { transform: translate(0, 0) rotate(90deg); }
  24.9%       { transform: translate(0, 30vh) rotate(90deg); }
  25%         { transform: translate(0, 30vh) rotate(0deg); }
  49.9%       { transform: translate(45vw, 30vh) rotate(0deg); }
  50%         { transform: translate(45vw, 30vh) rotate(270deg); }
  74.9%       { transform: translate(45vw, 0) rotate(270deg); }
  75%         { transform: translate(45vw, 0) rotate(180deg); }
  99.9%       { transform: translate(0, 0) rotate(180deg); }
  100%        { transform: translate(0, 0) rotate(90deg); }
}

@keyframes tron-path-d {
  0%, 0.01%   { transform: translate(0, 0) rotate(270deg); }
  24.9%       { transform: translate(0, -28vh) rotate(270deg); }
  25%         { transform: translate(0, -28vh) rotate(180deg); }
  49.9%       { transform: translate(-38vw, -28vh) rotate(180deg); }
  50%         { transform: translate(-38vw, -28vh) rotate(90deg); }
  74.9%       { transform: translate(-38vw, 0) rotate(90deg); }
  75%         { transform: translate(-38vw, 0) rotate(0deg); }
  99.9%       { transform: translate(0, 0) rotate(0deg); }
  100%        { transform: translate(0, 0) rotate(270deg); }
}

@keyframes tron-path-e {
  0%, 0.01%   { transform: translate(0, 0) rotate(0deg); }
  24.9%       { transform: translate(-50vw, 0) rotate(0deg); }
  25%         { transform: translate(-50vw, 0) rotate(90deg); }
  49.9%       { transform: translate(-50vw, 50vh) rotate(90deg); }
  50%         { transform: translate(-50vw, 50vh) rotate(180deg); }
  74.9%       { transform: translate(0, 50vh) rotate(180deg); }
  75%         { transform: translate(0, 50vh) rotate(270deg); }
  99.9%       { transform: translate(0, 0) rotate(270deg); }
  100%        { transform: translate(0, 0) rotate(360deg); }
}

@keyframes tron-path-f {
  0%, 0.01%   { transform: translate(0, 0) rotate(0deg); }
  24.9%       { transform: translate(60vw, 0) rotate(0deg); }
  25%         { transform: translate(60vw, 0) rotate(-90deg); }
  49.9%       { transform: translate(60vw, -25vh) rotate(-90deg); }
  50%         { transform: translate(60vw, -25vh) rotate(-180deg); }
  74.9%       { transform: translate(0, -25vh) rotate(-180deg); }
  75%         { transform: translate(0, -25vh) rotate(-270deg); }
  99.9%       { transform: translate(0, 0) rotate(-270deg); }
  100%        { transform: translate(0, 0) rotate(-360deg); }
}

.tron-video-shell {
  position: relative;
  z-index: 3;
  width: min(920px, 92vw);
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  overflow: hidden;
  border: 2px solid rgba(0, 220, 255, 0.55);
  box-shadow:
    0 0 0 1px rgba(2, 4, 10, 0.8),
    0 0 24px rgba(0, 200, 255, 0.25),
    0 0 48px rgba(255, 40, 60, 0.12),
    0 24px 80px rgba(0, 0, 0, 0.65);
  background: #000;
}

.tron-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  vertical-align: middle;
}

.tron-caption {
  position: relative;
  z-index: 4;
  margin-top: 1.35rem;
  text-align: center;
  max-width: 36rem;
}

.tron-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #00e5ff;
  margin-bottom: 0.45rem;
  text-shadow: 0 0 12px rgba(0, 220, 255, 0.45);
}

.tron-title {
  font-size: clamp(1.35rem, 3.5vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ds-text);
  margin: 0;
  line-height: 1.15;
}

@media (prefers-reduced-motion: reduce) {
  .tron-cycle,
  .tron-grid-static {
    animation: none !important;
  }
}

@media (max-width: 720px) {
  .tron-stage {
    padding-top: 5rem;
  }
  .tron-video-shell {
    width: 94vw;
  }
}

/* —— Cotton-to-compute painting + video (below priestess) —— */
.panel-cotton {
  z-index: 7;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--ds-bg);
  isolation: isolate;
}

.cotton-stage {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: clamp(4.5rem, 10vh, 6rem) 1.25rem 2rem;
}

.cotton-painting {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  z-index: 0;
  filter: saturate(1.05) contrast(1.04) brightness(0.78);
}

.cotton-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse 70% 55% at 50% 48%,
      rgba(18, 6, 6, 0.15) 0%,
      rgba(18, 6, 6, 0.55) 70%,
      rgba(18, 6, 6, 0.82) 100%
    ),
    linear-gradient(
      180deg,
      rgba(18, 6, 6, 0.55) 0%,
      transparent 22%,
      transparent 70%,
      rgba(18, 6, 6, 0.75) 100%
    );
}

/* Video sits inside / over the painting as a framed “window” */
.cotton-video-shell {
  position: relative;
  z-index: 3;
  width: min(920px, 92vw);
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  overflow: hidden;
  border: 2px solid var(--ds-gold);
  box-shadow:
    0 0 0 1px rgba(18, 6, 6, 0.5),
    0 24px 80px rgba(0, 0, 0, 0.55),
    0 0 40px rgba(211, 165, 103, 0.12);
  background: #000;
}

.cotton-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0a0505;
  vertical-align: middle;
}

.cotton-still {
  object-fit: cover;
  object-position: center;
}

.cotton-kicker time {
  color: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
}

/* Newest policy panels share stacking */
.panel-commoditization {
  z-index: 7;
  border-top: 1px solid var(--ds-border);
}

.cotton-caption {
  position: relative;
  z-index: 4;
  margin-top: 1.35rem;
  text-align: center;
  max-width: 36rem;
}

.cotton-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ds-gold);
  margin-bottom: 0.45rem;
}

.cotton-title {
  font-size: clamp(1.35rem, 3.5vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ds-text);
  margin: 0 0 0.75rem;
  line-height: 1.15;
}

.cotton-link {
  display: inline-block;
  color: var(--ds-muted);
  text-decoration: none;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid var(--ds-border);
  padding: 0.5rem 0.95rem;
  border-radius: 2px;
  background: var(--ds-card);
  backdrop-filter: blur(8px);
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.cotton-link:hover {
  color: var(--ds-text);
  border-color: var(--ds-gold);
  background: rgba(211, 165, 103, 0.12);
}

@media (max-width: 720px) {
  .cotton-stage {
    padding-top: 5rem;
  }

  .cotton-video-shell {
    width: 94vw;
  }
}

/* Dis-Alignment panel sits below China cotton panel */
.panel-disalignment {
  z-index: 7;
  border-top: 1px solid var(--ds-border);
}

/* —— Policy Briefs section —— */
.panel-briefs {
  z-index: 8;
  min-height: auto;
  background:
    radial-gradient(circle at 15% 0%, rgba(242, 47, 49, 0.07), transparent 45%),
    radial-gradient(circle at 90% 100%, rgba(3, 140, 140, 0.09), transparent 50%),
    var(--ds-bg);
  isolation: isolate;
  border-top: 1px solid var(--ds-border);
}

.briefs-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(3.5rem, 8vh, 5rem) 1.25rem 4.5rem;
}

.briefs-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ds-gold);
  margin-bottom: 0.55rem;
}

.briefs-heading {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 0.65rem;
  color: var(--ds-text);
}

.briefs-lead {
  color: var(--ds-muted);
  font-size: 1.02rem;
  max-width: 32rem;
  margin: 0 0 2rem;
  line-height: 1.55;
}

.briefs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.15rem;
}

.briefs-card {
  display: flex;
  flex-direction: column;
  background: var(--ds-card);
  border: 1px solid var(--ds-border);
  border-radius: 6px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
  cursor: pointer;
}

.briefs-card:hover {
  border-color: var(--ds-gold);
  transform: translateY(-2px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
}

.briefs-card:focus-visible {
  outline: 2px solid var(--ds-teal);
  outline-offset: 3px;
}

.briefs-card-media {
  aspect-ratio: 16 / 9;
  background: #0a0505;
  border-bottom: 1px solid var(--ds-border);
  overflow: hidden;
}

.briefs-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.briefs-card-media--svg img {
  object-fit: contain;
  background: #120606;
  padding: 0.35rem;
}

.briefs-card-body {
  padding: 1.05rem 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.briefs-card-tag {
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ds-teal);
  font-weight: 700;
  margin-bottom: 0.45rem;
}

.briefs-card:nth-child(2) .briefs-card-tag {
  color: var(--ds-gold);
}

.briefs-card-title {
  font-size: 1.15rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--ds-text);
}

.briefs-card-dek {
  font-size: 0.92rem;
  color: var(--ds-muted);
  line-height: 1.5;
  margin: 0 0 1rem;
  flex: 1;
}

.briefs-card-cta {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ds-gold);
  font-weight: 700;
}

.briefs-card:hover .briefs-card-cta {
  color: var(--ds-red);
}

.briefs-all {
  margin: 1.75rem 0 0;
  text-align: center;
}

.briefs-all a {
  color: var(--ds-muted);
  text-decoration: none;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.briefs-all a:hover {
  color: var(--ds-gold);
  border-bottom-color: var(--ds-gold);
}

@media (max-width: 720px) {
  .briefs-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .sky-sticky {
    grid-template-columns: 1fr;
  }

  .priestess-img {
    object-position: 55% 18%;
  }

  .sky-copy {
    max-width: none;
    padding: clamp(4rem, 10vh, 5rem) 1.25rem 1.5rem;
    background: linear-gradient(
      180deg,
      rgba(18, 6, 6, 0.55) 0%,
      rgba(18, 6, 6, 0.25) 70%,
      transparent 100%
    );
  }

  .sky-text {
    font-size: 1.02rem;
  }
}

.scroll-cue {
  position: absolute;
  bottom: 1.75rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  font-size: 0.65rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--ds-muted);
  opacity: 0.7;
  pointer-events: none;
  animation: scroll-cue-bob 2.4s ease-in-out infinite;
}

.scroll-cue::after {
  content: "";
  display: block;
  width: 1px;
  height: 28px;
  margin: 0.45rem auto 0;
  background: linear-gradient(
    180deg,
    var(--ds-gold),
    transparent
  );
}

@keyframes scroll-cue-bob {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
    opacity: 0.55;
  }
  50% {
    transform: translateX(-50%) translateY(6px);
    opacity: 0.9;
  }
}

/* —— Character plate (jetpack driver lunar survey) —— */
.character-plate {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--ds-bg);
}

.character-img {
  position: absolute;
  /* Bias framing toward the flying driver (left-center of the plate) */
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 32% 42%;
  transform: scale(1.06);
  filter: saturate(0.92) contrast(1.05) brightness(0.72);
  animation: character-drift 28s ease-in-out infinite alternate;
  will-change: transform;
}

/* Spring2 tint + readability scrim over the photo */
.character-scrim {
  position: absolute;
  inset: 0;
  background:
    /* Brand vignette corners */
    radial-gradient(
      ellipse 70% 60% at 12% 10%,
      rgba(242, 47, 49, 0.18) 0%,
      transparent 55%
    ),
    radial-gradient(
      ellipse 65% 55% at 90% 88%,
      rgba(3, 140, 140, 0.16) 0%,
      transparent 55%
    ),
    /* Soft focus on hero type band */
    radial-gradient(
      ellipse 55% 42% at 50% 48%,
      rgba(18, 6, 6, 0.55) 0%,
      rgba(18, 6, 6, 0.22) 45%,
      transparent 72%
    ),
    /* Edge falloff into brand near-black */
    linear-gradient(
      180deg,
      rgba(18, 6, 6, 0.55) 0%,
      transparent 22%,
      transparent 58%,
      rgba(64, 1, 1, 0.45) 82%,
      rgba(18, 6, 6, 0.88) 100%
    ),
    linear-gradient(
      90deg,
      rgba(18, 6, 6, 0.35) 0%,
      transparent 28%,
      transparent 72%,
      rgba(18, 6, 6, 0.4) 100%
    );
  mix-blend-mode: normal;
}

@keyframes character-drift {
  from {
    transform: scale(1.06) translate(0, 0);
  }
  to {
    transform: scale(1.1) translate(-1.5%, 1.2%);
  }
}

/* —— Canvas field (particles / trails over the plate) —— */
#race-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: block;
  pointer-events: none;
}

/* —— Narrow / short viewports: keep driver framed —— */
@media (max-aspect-ratio: 3/4) {
  .character-img {
    object-position: 28% 38%;
  }
}

@media (min-aspect-ratio: 2/1) {
  .character-img {
    object-position: 38% 48%;
  }
}

/* —— Atmospheric glows (signature vignette) —— */
.atmosphere {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  will-change: transform, opacity;
}

.glow-red {
  width: min(70vw, 640px);
  height: min(70vw, 640px);
  top: -12%;
  left: -8%;
  background: radial-gradient(
    circle,
    rgba(242, 47, 49, 0.28) 0%,
    transparent 68%
  );
  animation: drift-a 18s ease-in-out infinite alternate;
}

.glow-teal {
  width: min(65vw, 560px);
  height: min(65vw, 560px);
  bottom: -18%;
  right: -10%;
  background: radial-gradient(
    circle,
    rgba(3, 140, 140, 0.26) 0%,
    transparent 70%
  );
  animation: drift-b 22s ease-in-out infinite alternate;
}

.glow-gold {
  width: min(40vw, 360px);
  height: min(40vw, 360px);
  top: 42%;
  left: 55%;
  background: radial-gradient(
    circle,
    rgba(211, 165, 103, 0.14) 0%,
    transparent 72%
  );
  animation: drift-c 14s ease-in-out infinite alternate;
}

.horizon {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: 0;
  height: 42%;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(64, 1, 1, 0.35) 45%,
    rgba(18, 6, 6, 0.92) 100%
  );
}

.scanlines {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.4) 2px,
    rgba(0, 0, 0, 0.4) 3px
  );
  mix-blend-mode: multiply;
}

@keyframes drift-a {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(8%, 12%) scale(1.12);
  }
}

@keyframes drift-b {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(-10%, -8%) scale(1.08);
  }
}

@keyframes drift-c {
  from {
    transform: translate(0, 0) scale(1);
    opacity: 0.7;
  }
  to {
    transform: translate(-14%, 10%) scale(1.2);
    opacity: 1;
  }
}

/* —— Orbital geometry —— */
.orbits {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  display: grid;
  place-items: center;
}

.orbit {
  position: absolute;
  border-radius: 50%;
  border: 1px solid transparent;
  border-top-color: rgba(242, 47, 49, 0.35);
  border-right-color: rgba(211, 165, 103, 0.2);
  border-bottom-color: rgba(3, 140, 140, 0.28);
  border-left-color: rgba(64, 1, 1, 0.5);
}

.orbit-a {
  width: min(92vmin, 720px);
  height: min(92vmin, 720px);
  transform: rotateX(68deg) rotateZ(0deg);
  animation: spin-orbit 48s linear infinite;
  box-shadow:
    0 0 40px rgba(242, 47, 49, 0.08),
    inset 0 0 40px rgba(3, 140, 140, 0.05);
}

.orbit-b {
  width: min(68vmin, 520px);
  height: min(68vmin, 520px);
  transform: rotateX(72deg) rotateZ(40deg);
  animation: spin-orbit 32s linear infinite reverse;
  border-top-color: rgba(211, 165, 103, 0.45);
  border-bottom-color: rgba(242, 47, 49, 0.22);
}

.orbit-c {
  width: min(48vmin, 360px);
  height: min(48vmin, 360px);
  transform: rotateX(64deg) rotateZ(-25deg);
  animation: spin-orbit 22s linear infinite;
  border-top-color: rgba(3, 140, 140, 0.5);
  border-right-color: rgba(242, 47, 49, 0.18);
}

.ring-stack {
  position: absolute;
  width: min(28vmin, 200px);
  height: min(28vmin, 200px);
  display: grid;
  place-items: center;
  animation: pulse-core 6s ease-in-out infinite;
}

.ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--ds-gold);
  opacity: 0.35;
}

.ring.r1 {
  width: 40%;
  height: 40%;
  border-color: var(--ds-red);
  animation: ring-expand 4s ease-out infinite;
}

.ring.r2 {
  width: 70%;
  height: 70%;
  border-color: var(--ds-gold);
  animation: ring-expand 4s ease-out 1.2s infinite;
}

.ring.r3 {
  width: 100%;
  height: 100%;
  border-color: var(--ds-teal);
  animation: ring-expand 4s ease-out 2.4s infinite;
}

@keyframes spin-orbit {
  to {
    transform: rotateX(68deg) rotateZ(360deg);
  }
}

.orbit-b {
  animation-name: spin-orbit-b;
}

@keyframes spin-orbit-b {
  from {
    transform: rotateX(72deg) rotateZ(40deg);
  }
  to {
    transform: rotateX(72deg) rotateZ(400deg);
  }
}

.orbit-c {
  animation-name: spin-orbit-c;
}

@keyframes spin-orbit-c {
  from {
    transform: rotateX(64deg) rotateZ(-25deg);
  }
  to {
    transform: rotateX(64deg) rotateZ(335deg);
  }
}

@keyframes pulse-core {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

@keyframes ring-expand {
  0% {
    transform: scale(0.55);
    opacity: 0.55;
  }
  70% {
    opacity: 0.12;
  }
  100% {
    transform: scale(1.45);
    opacity: 0;
  }
}

/* —— Spring2 race ribbons (ascending) —— */
.ribbons {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  overflow: hidden;
}

.ribbon {
  position: absolute;
  width: 2px;
  height: 140%;
  bottom: -20%;
  background: var(--ds-gradient);
  opacity: 0.55;
  filter: blur(0.4px);
  transform-origin: bottom center;
  border-radius: 2px;
  box-shadow:
    0 0 18px rgba(242, 47, 49, 0.35),
    0 0 40px rgba(3, 140, 140, 0.2);
}

.ribbon::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border-radius: 50%;
  background: var(--ds-text);
  box-shadow:
    0 0 12px var(--ds-red),
    0 0 28px var(--ds-gold);
}

.ribbon-1 {
  left: 18%;
  transform: rotate(-8deg) skewX(-4deg);
  animation: launch 9s cubic-bezier(0.22, 0.8, 0.28, 1) infinite;
  animation-delay: 0s;
  width: 3px;
}

.ribbon-2 {
  left: 38%;
  transform: rotate(4deg) skewX(2deg);
  animation: launch 11s cubic-bezier(0.22, 0.8, 0.28, 1) infinite;
  animation-delay: -2.5s;
  opacity: 0.4;
  width: 2px;
}

.ribbon-3 {
  left: 62%;
  transform: rotate(-3deg);
  animation: launch 8s cubic-bezier(0.22, 0.8, 0.28, 1) infinite;
  animation-delay: -5s;
  width: 4px;
  opacity: 0.65;
}

.ribbon-4 {
  left: 82%;
  transform: rotate(7deg) skewX(3deg);
  animation: launch 12s cubic-bezier(0.22, 0.8, 0.28, 1) infinite;
  animation-delay: -7s;
  opacity: 0.35;
}

@keyframes launch {
  0% {
    transform: translateY(30%) rotate(var(--r, -4deg)) scaleY(0.4);
    opacity: 0;
  }
  12% {
    opacity: 0.7;
  }
  70% {
    opacity: 0.45;
  }
  100% {
    transform: translateY(-110%) rotate(var(--r, -4deg)) scaleY(1.1);
    opacity: 0;
  }
}

.ribbon-1 {
  --r: -8deg;
}
.ribbon-2 {
  --r: 4deg;
}
.ribbon-3 {
  --r: -3deg;
}
.ribbon-4 {
  --r: 7deg;
}

/* —— Chrome / brand —— */
.chrome {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 0.75rem;
  pointer-events: none;
}

.chrome-bar {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: var(--ds-gradient);
}

.chrome-mark {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ds-gold);
  pointer-events: auto;
}

.chrome-logo {
  pointer-events: auto;
  display: block;
  line-height: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--ds-border);
  box-shadow: 0 0 20px rgba(242, 47, 49, 0.15);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chrome-logo:hover {
  border-color: var(--ds-gold);
  box-shadow: 0 0 24px rgba(211, 165, 103, 0.25);
}

.chrome-logo img {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: cover;
  background: #000;
}

.chrome-nav {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.45rem;
}

.chrome-nav a {
  color: var(--ds-muted);
  text-decoration: none;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid var(--ds-border);
  padding: 0.45rem 0.85rem;
  border-radius: 2px;
  background: var(--ds-card);
  backdrop-filter: blur(8px);
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.chrome-nav a:hover {
  color: var(--ds-text);
  border-color: var(--ds-gold);
  background: rgba(211, 165, 103, 0.12);
}

.chrome-nav a.chrome-x {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  letter-spacing: 0.12em;
}

.chrome-nav a.chrome-x svg {
  display: block;
  flex-shrink: 0;
}

/* —— Hero copy —— */
.hero {
  position: relative;
  z-index: 8;
  text-align: center;
  padding: 0 1.5rem;
  pointer-events: none;
  margin-top: -4vh;
}

.hero-kicker {
  font-size: 0.7rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ds-gold);
  margin-bottom: 1.25rem;
  opacity: 0;
  animation: fade-up 1.1s ease 0.2s forwards;
}

.hero-title {
  font-weight: 700;
  /* ≥1 so descenders (g, y) on “Racing” aren’t clipped */
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-size: clamp(2.8rem, 10vw, 6.5rem);
  overflow: visible;
}

.hero-title .line {
  display: block;
  opacity: 0;
  animation: fade-up 1s ease forwards;
  overflow: visible;
  /* Extra room for descenders + gradient text clip */
  padding-bottom: 0.08em;
  margin-bottom: -0.04em;
}

.hero-title .line:first-child {
  color: var(--ds-text);
  animation-delay: 0.35s;
}

.hero-title .line.accent {
  background: var(--ds-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* background-clip:text often crops glyph bottoms without padding */
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  animation-delay: 0.55s;
  filter: drop-shadow(0 0 40px rgba(242, 47, 49, 0.25));
  padding-bottom: 0.12em;
}

.hero-tagline {
  margin-top: 1.15rem;
  font-size: clamp(1rem, 2.4vw, 1.35rem);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--ds-muted);
  font-weight: 400;
  line-height: 1.35;
  opacity: 0;
  animation: fade-up 1s ease 0.75s forwards;
}

.hero-gradient-line {
  width: min(220px, 40vw);
  height: 3px;
  margin: 1.5rem auto 0;
  background: var(--ds-gradient);
  border-radius: 2px;
  opacity: 0;
  animation: line-in 1.2s ease 0.95s forwards;
  box-shadow: 0 0 24px rgba(242, 47, 49, 0.4);
}

.hero-sub {
  margin-top: 1rem;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(205, 185, 170, 0.65);
  opacity: 0;
  animation: fade-up 1s ease 1.15s forwards;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes line-in {
  from {
    opacity: 0;
    transform: scaleX(0.2);
  }
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

/* —— Footer (bottom of priestess panel) —— */
.chrome-foot {
  position: absolute;
  z-index: 10;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  padding: 1rem 1.5rem 1.25rem;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ds-muted);
  pointer-events: none;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(18, 6, 6, 0.55) 60%,
    rgba(18, 6, 6, 0.85)
  );
}

.chrome-foot .muted {
  color: rgba(205, 185, 170, 0.55);
  text-align: right;
}

/* —— Reduced motion —— */
@media (prefers-reduced-motion: reduce) {
  .character-img,
  .glow,
  .orbit,
  .orbit-a,
  .orbit-b,
  .orbit-c,
  .ring,
  .ring-stack,
  .ribbon,
  .scroll-cue,
  .hero-kicker,
  .hero-title .line,
  .hero-tagline,
  .hero-gradient-line,
  .hero-sub {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .character-img {
    transform: scale(1.06);
  }

  .scroll-cue {
    transform: translateX(-50%);
    opacity: 0.55;
  }

  .hero-title .line,
  .hero-title .line.accent {
    transform: none;
  }

  .hero-gradient-line {
    transform: none;
  }

  .ribbon {
    opacity: 0.25;
    transform: translateY(-20%) rotate(-4deg);
  }
}

/* —— Narrow screens —— */
@media (max-width: 560px) {
  .chrome-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .chrome-foot .muted {
    text-align: left;
  }

  .hero-tagline {
    letter-spacing: 0.22em;
  }
}
