/* ==========================================================================
   The Gain Games — portfolio case study
   Brand tokens lifted from the Gain Games app (DM Sans + Anton, SWC blue/clay)
   ========================================================================== */

:root {
  --blue: #0082cd;
  --blue-deep: #006da9;
  --clay: #fa854f;
  --clay-soft: #ffd6c2;
  --ink: #02131b;
  --ink-soft: #2a3a44;
  --fg-2: #52606b;
  --bone: #fbfdfe;
  --bone-soft: #eef2f5;
  --paper: #ffffff;
  --line: rgba(2, 19, 27, 0.08);

  --navy-950: #041220;
  --navy-900: #06192c;
  --navy-800: #0a2238;
  --navy-700: #0e3050;

  --on-dark: #f4f8fb;
  --on-dark-soft: rgba(244, 248, 251, 0.72);
  --line-dark: rgba(244, 248, 251, 0.14);

  --font-display: "Anton", "Arial Narrow", sans-serif;
  --font-body: "DM Sans", -apple-system, system-ui, sans-serif;

  --wrap: 1180px;
  --pad: clamp(20px, 4vw, 48px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bone);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--blue); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.9em;
  background: rgba(2, 19, 27, 0.06);
  padding: 0.1em 0.35em;
  border-radius: 6px;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }

section { padding: clamp(72px, 11vw, 140px) 0; position: relative; }

/* ---------- type ---------- */

.eyebrow {
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--clay);
  margin: 0 0 1rem;
}

h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.1rem, 4.6vw, 3.9rem);
  line-height: 1.04;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  margin: 0 0 1.4rem;
}

h3 {
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
}

p { margin: 0 0 1.1rem; }
.lede { font-size: 1.18rem; max-width: 46em; }

.inline-stat {
  font-family: var(--font-display);
  color: var(--blue);
  font-size: 1.15em;
  letter-spacing: 0.02em;
}

/* dark sections share these */
.is-dark { background: var(--navy-900); color: var(--on-dark); }
.is-dark p { color: var(--on-dark-soft); }
.is-dark h2, .is-dark h3 { color: var(--on-dark); }

/* ---------- shared bits ---------- */

.cols {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }

.stat-n {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  line-height: 1;
  color: var(--clay);
  letter-spacing: 0.01em;
}
.stat-l {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-top: 0.35rem;
}

/* plus-sign brand motif */
.plus-layer {
  position: absolute; inset: -10% -5%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cpath d='M57 38h6v13h13v6H63v13h-6V57H44v-6h13z' fill='rgba(255,255,255,0.05)'/%3E%3C/svg%3E");
  pointer-events: none;
}
.plus-b {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cpath d='M104 70h12v22h22v12h-22v22h-12v-22H82V92h22z' fill='rgba(255,255,255,0.035)'/%3E%3C/svg%3E");
}

/* checkered finish-line strip */
.checker {
  position: absolute; left: 0; right: 0; height: 28px;
  background-image: repeating-conic-gradient(rgba(255,255,255,0.9) 0% 25%, transparent 0% 50%);
  background-size: 28px 28px;
  opacity: 0.9;
}
.checker-bottom { bottom: 0; }
.checker-top { top: 0; }

/* ---------- device frames ---------- */

.phone {
  width: min(310px, 78vw);
  border-radius: 52px;
  padding: 11px;
  background: #0b0f14;
  box-shadow:
    0 2px 0 rgba(255,255,255,0.06) inset,
    0 30px 60px -18px rgba(2, 19, 27, 0.45);
  position: relative;
  margin: 0 auto;
}
.phone::before {
  content: "";
  position: absolute; top: 22px; left: 50%; transform: translateX(-50%);
  width: 34%; height: 26px; border-radius: 20px; background: #0b0f14;
  z-index: 3;
}
.phone-screen {
  position: relative;
  border-radius: 42px;
  overflow: hidden;
  aspect-ratio: 393 / 852;
  background: var(--navy-900);
  isolation: isolate;
}
.phone-screen img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
}
.phone-sm { width: min(250px, 70vw); }
.phone-sm::before { height: 22px; top: 18px; }

.tv {
  width: 100%;
  border-radius: 18px;
  padding: clamp(8px, 1vw, 14px);
  background: #0a0d10;
  box-shadow: 0 40px 80px -24px rgba(2, 19, 27, 0.6);
  position: relative;
}
.tv::after {
  content: "";
  position: absolute; left: 50%; bottom: -26px; transform: translateX(-50%);
  width: 22%; height: 26px;
  background: linear-gradient(#0a0d10, #05070a);
  clip-path: polygon(8% 0, 92% 0, 100% 100%, 0 100%);
  border-radius: 0 0 10px 10px;
}
.tv-screen {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--navy-950);
  isolation: isolate;
}
.tv-screen img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

.browser-frame {
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 30px 60px -22px rgba(2, 19, 27, 0.35);
}
.browser-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 14px;
  background: var(--bone-soft);
  border-bottom: 1px solid var(--line);
}
.browser-bar i {
  width: 11px; height: 11px; border-radius: 50%;
  background: rgba(2, 19, 27, 0.16);
}
.browser-bar span {
  margin-left: 8px;
  font-size: 0.78rem; font-weight: 700;
  color: var(--fg-2);
  letter-spacing: 0.04em;
}

/* crossfading stacks */
.seq-img, .tv-img, .wr-img { opacity: 0; z-index: 1; }
.seq-img.is-active, .tv-img.is-active, .wr-img.is-active { opacity: 1; z-index: 2; }

/* ==========================================================================
   HERO
   ========================================================================== */

.hero {
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  background:
    radial-gradient(120% 90% at 50% 0%, var(--navy-700) 0%, var(--navy-900) 55%, var(--navy-950) 100%);
  color: var(--on-dark);
  overflow: clip;
  position: relative;
  padding: 72px 0 96px;
}
.hero-inner {
  position: relative; z-index: 2;
  padding: 0 var(--pad) 56px;
  max-width: 980px;
}

.hero-eyebrow { color: var(--clay-soft); opacity: 0.95; }

.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  line-height: 0.92;
  margin: 0.4rem 0 1.4rem;
  font-size: clamp(4.2rem, min(15vw, 24svh), 10.5rem);
  letter-spacing: 0.01em;
}
.ht-line { display: block; overflow: hidden; padding: 0.02em 0.08em; }
.ht-gain {
  color: var(--clay);
  transform: skewX(-6deg);
  text-shadow: 0 0 60px rgba(250, 133, 79, 0.35);
}

.hero-sub {
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  color: var(--on-dark-soft);
  max-width: 38em;
  margin: 0 auto 0.6rem;
}
.hero-byline { font-size: 0.95rem; color: var(--on-dark-soft); margin-bottom: 1.8rem; }
.hero-byline strong { color: var(--on-dark); }

.hero-stats {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: clamp(18px, 4vw, 56px);
}
.hero-stats .stat-n { color: var(--on-dark); }
.hero-stats li:nth-child(3) .stat-n { color: var(--clay); }

.scroll-cue {
  margin: 1.8rem auto 0;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.sc-label {
  font-size: 0.72rem; font-weight: 800;
  letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--clay-soft);
  margin-bottom: 6px;
}
.sc-chev {
  width: 14px; height: 14px;
  border-right: 3px solid var(--clay);
  border-bottom: 3px solid var(--clay);
  transform: rotate(45deg);
  animation: chevdrop 1.5s ease-in-out infinite;
}
.sc-chev:nth-child(3) { animation-delay: 0.15s; opacity: 0.66; }
.sc-chev:nth-child(4) { animation-delay: 0.3s; opacity: 0.33; }
@keyframes chevdrop {
  0%, 100% { transform: rotate(45deg) translate(0, 0); }
  50% { transform: rotate(45deg) translate(4px, 4px); }
}

/* ==========================================================================
   IDEA + TIMELINE
   ========================================================================== */

.idea { background: var(--bone); padding-bottom: 0; }
.col-art { margin: 0; }
.col-art img { border-radius: 18px; box-shadow: 0 30px 60px -24px rgba(2,19,27,0.35); }
.col-art figcaption { font-size: 0.85rem; color: var(--fg-2); margin-top: 0.8rem; }

.timeline { margin-top: clamp(56px, 8vw, 110px); overflow: clip; }
.tl-pin { padding: clamp(40px, 6vw, 80px) 0; background: var(--ink); color: var(--on-dark); }
@media (min-width: 1024px) {
  /* pinned: fill the viewport so no bare seam shows beneath during the scrub */
  .tl-pin {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0;
  }
}
.tl-eyebrow { color: var(--clay); padding: 0 var(--pad); max-width: var(--wrap); margin: 0 auto 1.6rem; }

/* full-bleed chevron runway marching behind the cards: full height,
   tips touching the next chevron's body so it reads as one surface */
.tl-chevrons {
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='170' height='800' viewBox='0 0 170 800' preserveAspectRatio='none'%3E%3Cpath d='M25 -20 L160 400 L25 820' fill='none' stroke='rgba(250,133,79,0.13)' stroke-width='62' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-position: 0 50%;
  background-size: 170px 100%;
  pointer-events: none;
  will-change: background-position;
}
.timeline .tl-pin { position: relative; overflow: clip; }

.tl-track {
  display: flex; gap: 22px;
  width: max-content;
  padding: 0 var(--pad);
  align-items: stretch;
  position: relative; z-index: 1;
}
.tl-item {
  width: 380px; flex: none;
  background: rgba(6, 25, 44, 0.78);
  border: 1px solid var(--line-dark);
  border-radius: 22px;
  padding: 30px 30px 26px;
  min-height: min(44svh, 360px);
  display: flex; flex-direction: column; justify-content: center;
  backdrop-filter: blur(2px);
}
.tl-item h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.7rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--on-dark);
  margin: 0 0 0.6rem;
}
.tl-item p { margin: 0; color: var(--on-dark-soft); font-size: 1.02rem; }
.tl-date {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--blue);
  display: block;
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.tl-hot { background: rgba(250, 133, 79, 0.14); border-color: rgba(250, 133, 79, 0.55); }
.tl-hot .tl-date { color: var(--clay); }

/* the dev-peak card gets the spotlight */
.tl-peak {
  background: linear-gradient(140deg, rgba(250,133,79,0.22), rgba(0,130,205,0.18));
  border: 2px solid var(--clay);
  box-shadow: 0 0 60px rgba(250, 133, 79, 0.25);
  width: 420px;
}
.tl-peak .tl-date { color: var(--clay); }
.tl-peak h3 { color: var(--clay); }

.tl-season { width: 480px; }
.tl-chips {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.tl-chips li {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--on-dark);
}

@media (max-width: 1023px) {
  .tl-track { width: auto; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 10px; }
  .tl-item, .tl-peak, .tl-season { scroll-snap-align: start; width: 300px; min-height: 0; }
  .tl-chevrons { background-size: 150px 60%; }
}

/* ==========================================================================
   REGISTRATION
   ========================================================================== */

.reg { background: var(--bone-soft); }
.reg .cols { align-items: center; }
/* browser frame with the login phone overlapping its corner */
.reg-art { position: relative; padding: 0 clamp(28px, 4vw, 56px) 56px 0; }
.reg-phone {
  position: absolute; right: 0; bottom: 0;
  width: min(200px, 26vw);
  margin: 0;
  filter: drop-shadow(0 24px 40px rgba(2, 19, 27, 0.35));
}
@media (max-width: 900px) {
  .reg-art { padding: 0 0 24px; }
  .reg-phone { width: min(180px, 38vw); right: -6px; bottom: -8px; }
}

/* ==========================================================================
   APP SHOWCASE (pinned)
   ========================================================================== */

.app-show { background: var(--navy-900); color: var(--on-dark); padding: 0; }
.app-pin { padding: clamp(56px, 8svh, 110px) 0; }
@media (min-width: 1024px) {
  /* keep the device inside one viewport while pinned, even on short laptops */
  .app-device .phone { width: min(310px, calc((100svh - 200px) * 0.4612)); }
}
.app-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.app-copy .eyebrow { color: var(--clay); }
.app-copy p { color: var(--on-dark-soft); }

.app-steps { list-style: none; margin: 2rem 0 0; padding: 0; position: relative; }
.app-step { transition: opacity 0.3s; }
.app-step h3 { color: var(--on-dark); font-size: 1.3rem; }
.app-step p { max-width: 34em; }

@media (min-width: 1024px) {
  .app-steps { display: grid; }
  .app-step { grid-area: 1 / 1; opacity: 0; pointer-events: none; }
  .app-step.is-active { opacity: 1; pointer-events: auto; }
}
@media (max-width: 1023px) {
  .app-grid { grid-template-columns: 1fr; }
  .app-device { order: -1; }
  .app-step { margin-bottom: 2rem; opacity: 1; }
}

/* step counter for pinned sequences (#app phone, #tv reel) */
.seq-count {
  display: flex; align-items: center; gap: 14px;
  margin-top: 2.2rem;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.12em;
  color: var(--on-dark-soft);
}
.seq-count .seq-now { color: var(--clay); font-size: 1.5rem; }
.seq-ticks { display: flex; gap: 7px; }
.seq-ticks i {
  width: 30px; height: 4px; border-radius: 2px;
  background: var(--line-dark);
  transition: background 0.3s;
}
.seq-ticks i.is-on { background: var(--clay); }
@media (max-width: 1023px) { .seq-count { display: none; } }

/* skip out of a pinned sequence */
.skip-btn {
  position: absolute; right: 22px; bottom: 22px; z-index: 5;
  font-size: 0.78rem; font-weight: 800;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--on-dark-soft);
  text-decoration: none;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  padding: 9px 16px;
  background: rgba(2, 19, 27, 0.5);
  transition: color 0.2s, border-color 0.2s;
}
.skip-btn:hover { color: var(--clay); border-color: var(--clay); }
@media (max-width: 1023px) { .skip-btn { display: none; } }
.app-pin, .tv-pin { position: relative; }
.app-device { position: static; }

/* ==========================================================================
   SCORING
   ========================================================================== */

.scoring { background: var(--ink); color: var(--on-dark); }
.pipeline {
  list-style: none;
  margin: 3rem 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  counter-reset: pipe;
}
.pipe-step {
  background: rgba(255,255,255,0.045);
  border: 1px solid var(--line-dark);
  border-radius: 16px;
  padding: 18px 18px 14px;
  position: relative;
}
.pipe-step h3 { font-size: 1.02rem; color: var(--on-dark); }
.pipe-step p { font-size: 0.88rem; margin: 0; color: var(--on-dark-soft); }
.pipe-k {
  font-family: var(--font-display);
  color: var(--clay);
  font-size: 1.1rem;
  display: block;
  margin-bottom: 0.5rem;
}
.pipe-step::after {
  content: "→";
  position: absolute; right: -14px; top: 50%;
  transform: translateY(-50%);
  color: var(--clay);
  font-weight: 800;
  z-index: 2;
}
.pipe-step:last-child::after { content: none; }

@media (max-width: 1023px) {
  .pipeline { grid-template-columns: 1fr 1fr; }
  .pipe-step::after { content: none; }
}
@media (max-width: 540px) { .pipeline { grid-template-columns: 1fr; } }

.fair-card {
  background: linear-gradient(120deg, rgba(250,133,79,0.14), rgba(0,130,205,0.14));
  border: 1px solid rgba(250, 133, 79, 0.4);
  border-radius: 18px;
  padding: clamp(22px, 3vw, 34px);
  max-width: 760px;
}
.fair-card h3 { color: var(--clay); }
.fair-card p { margin: 0; }

.mini-stats {
  list-style: none; margin: 3rem 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: clamp(24px, 5vw, 64px);
}

/* ==========================================================================
   TV SHOWCASE (pinned)
   ========================================================================== */

.tv-show {
  background:
    radial-gradient(100% 120% at 50% 100%, var(--navy-700) 0%, var(--navy-900) 60%, var(--navy-950) 100%);
  color: var(--on-dark);
  padding: 0;
}
.tv-pin { padding: clamp(44px, 6svh, 72px) 0 clamp(64px, 8svh, 96px); }
@media (min-width: 1024px) {
  /* center the whole TV block so the screen sits mid-viewport while pinned */
  .tv-pin {
    min-height: 100svh;
    display: flex; flex-direction: column; justify-content: center;
    padding: 0;
  }
}
.tv-wrap { max-width: 1040px; }
.tv-head { text-align: center; max-width: 620px; margin: 0 auto 0.9rem; }
.tv-head h2 { margin-bottom: 0.8rem; }
.tv-head .lede { margin-left: auto; margin-right: auto; font-size: 1.02rem; max-width: 34em; }
.tv-head .eyebrow { color: var(--clay); margin-bottom: 0.6rem; }
@media (min-width: 1024px) {
  /* fit head + screen + caption inside one viewport while pinned;
     330px of reserved chrome keeps the screen big and high */
  .tv-show .tv {
    width: min(100%, calc((100svh - 330px) * 1.7778));
    min-width: min(100%, 580px);
    margin-inline: auto;
  }
}
/* slide counter rides right-aligned directly above the screen */
.tv-count {
  justify-content: flex-end;
  margin: 0 auto 10px;
  width: min(100%, calc((100svh - 330px) * 1.7778));
  min-width: min(100%, 580px);
}
@media (max-width: 1023px) { .tv-count { display: none; } }

.tv-caption {
  margin: 1.5rem auto 0;
  text-align: center;
  min-height: 3.6em;
  position: relative;
  max-width: 640px;
  font-size: 1.02rem;
  color: var(--on-dark-soft);
}
.tvc { position: absolute; inset: 0; opacity: 0; }
.tvc.is-active { opacity: 1; }
.tvc-final { font-size: 1.3rem; color: var(--on-dark); font-weight: 700; }
.tvc-final strong {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.35em;
  letter-spacing: 0.04em;
  color: var(--clay);
}

/* ==========================================================================
   SHOUTOUT WALL
   ========================================================================== */

.wall { background: var(--bone); }
.wall-art {
  position: relative;
  margin: 2.6rem 0 1rem;
  padding-right: clamp(0px, 6vw, 80px);
}
.tv-sm { max-width: 860px; }
.wall-phone {
  position: absolute;
  right: 0; bottom: -40px;
  width: min(220px, 30vw);
  margin: 0;
}
@media (max-width: 700px) {
  .wall-phone { position: static; width: min(240px, 70vw); margin: 1.6rem auto 0; }
  .wall-art { padding-right: 0; }
}

.bubbles {
  list-style: none;
  margin: 3.4rem 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 12px;
  max-width: 640px;
}
.bubble {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px 20px 20px 6px;
  padding: 12px 18px;
  box-shadow: 0 10px 24px -14px rgba(2,19,27,0.25);
  font-size: 1.02rem;
  width: fit-content;
}
.bubble-blue {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue-deep);
  border-radius: 20px 20px 6px 20px;
  align-self: flex-end;
}

/* ==========================================================================
   COMMS
   ========================================================================== */

.comms { background: var(--bone-soft); }
.arc-chips {
  list-style: none; margin: 0 0 1.6rem; padding: 0;
  display: flex; flex-wrap: wrap; gap: 10px;
}
.arc-chips li {
  background: var(--ink);
  color: var(--on-dark);
  font-weight: 700;
  font-size: 0.86rem;
  letter-spacing: 0.06em;
  padding: 8px 16px;
  border-radius: 999px;
}
.arc-chips li:nth-child(2) { background: var(--blue); }
.arc-chips li:nth-child(3) { background: var(--clay); }
.arc-chips li:nth-child(4) { background: var(--blue-deep); }

.email-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 3vw, 36px);
  margin-top: 2.6rem;
  max-width: 920px;
}
@media (max-width: 700px) { .email-row { grid-template-columns: 1fr; } }
.email-card {
  margin: 0;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--paper);
  overflow: hidden;
  height: clamp(420px, 56vw, 600px);
  position: relative;
  box-shadow: 0 24px 48px -22px rgba(2,19,27,0.3);
}
.email-card img { width: 100%; }
.email-card figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 14px 18px 12px;
  font-weight: 800; font-size: 0.85rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--on-dark);
  background: linear-gradient(transparent, rgba(2,19,27,0.85) 55%);
}

/* ==========================================================================
   FINALE
   ========================================================================== */

.finale { background: var(--navy-900); color: var(--on-dark); }
.fin-grid { display: grid; gap: clamp(28px, 4vw, 48px); margin-top: 2.4rem; }

.fin-block {
  background: rgba(255,255,255,0.045);
  border: 1px solid var(--line-dark);
  border-radius: 22px;
  padding: clamp(24px, 4vw, 44px);
}
.fin-block > p { max-width: 56em; }

.fin-wrapped {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  background: linear-gradient(140deg, rgba(250,133,79,0.18), rgba(0,130,205,0.12));
  border-color: rgba(250, 133, 79, 0.45);
  position: relative;
  overflow: hidden;
  padding-top: clamp(40px, 5vw, 58px);
}
.fin-wrapped::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 18px;
  background-image: repeating-conic-gradient(rgba(255,255,255,0.55) 0% 25%, transparent 0% 50%);
  background-size: 18px 18px;
}
@media (max-width: 900px) { .fin-wrapped { grid-template-columns: 1fr; } }

.fin-wr-art { position: relative; min-height: 480px; display: grid; place-items: center; }
.fin-wr-art .phone { z-index: 2; }

.card-fan {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  z-index: 1;
}
.card-fan img {
  position: absolute;
  width: min(150px, 20vw);
  border-radius: 14px;
  box-shadow: 0 18px 40px -16px rgba(2,19,27,0.6);
}
.card-fan img:nth-child(1) { transform: translate(-130%, -6%) rotate(-9deg); }
.card-fan img:nth-child(2) { transform: translate(128%, -12%) rotate(8deg); }
.card-fan img:nth-child(3) { transform: translate(118%, 52%) rotate(-5deg); }
@media (max-width: 520px) { .card-fan img { width: 110px; } }

/* punchy accent words in the scoring headline */
.h2-punch em { font-style: normal; color: var(--clay); }

/* ==========================================================================
   NUMBERS
   ========================================================================== */

.numbers { background: var(--ink); color: var(--on-dark); overflow: clip; }
.marquee {
  overflow: clip;
  margin-bottom: clamp(48px, 7vw, 90px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: flex; gap: clamp(28px, 5vw, 64px);
  width: max-content;
  animation: marquee 56s linear infinite;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  text-transform: uppercase;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(244, 248, 251, 0.3);
}
.marquee-track span:nth-child(4n+1) { -webkit-text-stroke-color: rgba(250, 133, 79, 0.55); }
@keyframes marquee { to { transform: translateX(-50%); } }

.num-grid {
  list-style: none; margin: 2.4rem 0 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(22px, 3.5vw, 44px) clamp(18px, 3vw, 36px);
}
@media (max-width: 900px) { .num-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .num-grid { grid-template-columns: repeat(2, 1fr); } }

.podium-line {
  margin-top: 3rem;
  font-size: 1.1rem;
  color: var(--on-dark-soft);
}
.podium-line strong { color: var(--clay); }

/* ==========================================================================
   STACK
   ========================================================================== */

.stack { background: var(--bone-soft); }
.chips-hint { font-size: 0.85rem; font-weight: 700; color: var(--fg-2); margin: 1.8rem 0 0.2rem; }
.stack-chips {
  list-style: none; margin: 0.6rem 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 10px;
  max-width: 760px;
}
.stack-chips li { margin: 0; padding: 0; }
.stack-chips button {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 18px;
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s, background 0.2s;
}
.stack-chips button:hover { border-color: var(--blue); transform: translateY(-1px); }
.stack-chips li.tip-open button { background: var(--ink); color: #fff; border-color: var(--ink); }

.tip-pop {
  position: fixed; z-index: 90;
  max-width: 300px;
  background: var(--ink);
  color: var(--on-dark);
  border-radius: 12px;
  padding: 12px 15px;
  font-size: 0.88rem;
  line-height: 1.5;
  box-shadow: 0 18px 40px rgba(2, 19, 27, 0.4);
}
.tip-pop::after {
  content: "";
  position: absolute; top: 100%; left: var(--arrow-x, 24px);
  border: 7px solid transparent;
  border-top-color: var(--ink);
}
.console-art { margin: 3rem 0 0; max-width: 980px; }
.console-art figcaption { font-size: 0.85rem; color: var(--fg-2); margin-top: 0.9rem; }

/* ==========================================================================
   CREDITS
   ========================================================================== */

.credits {
  position: relative;
  background:
    radial-gradient(110% 100% at 50% 100%, var(--navy-700) 0%, var(--navy-900) 55%, var(--navy-950) 100%);
  color: var(--on-dark);
  text-align: center;
  padding: clamp(90px, 13vw, 170px) 0 clamp(70px, 9vw, 110px);
  overflow: clip;
}
.credits .eyebrow { color: var(--clay); }
.credits-h {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5.5vw, 4.2rem);
  text-transform: uppercase;
  line-height: 1.05;
  margin: 0 0 1rem;
}
.credits-h span { color: var(--clay); }
.credits-sub { color: var(--on-dark-soft); font-size: 1.05rem; }
.credits-sub a { color: var(--on-dark); }
.credits-fine { margin-top: 2.4rem; font-size: 0.88rem; color: var(--on-dark-soft); opacity: 0.85; }

/* ==========================================================================
   Motion guards
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee-track { animation: none; }
  .scroll-cue span { animation: none; }
}
