/* UP! website. Palette mirrors Sources/UP/UI/Theme.swift. */

@font-face {
  font-family: "League Spartan";
  font-style: normal;
  font-weight: 500 900;
  font-display: swap;
  src: url("../assets/fonts/league-spartan-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "League Spartan";
  font-style: normal;
  font-weight: 500 900;
  font-display: swap;
  src: url("../assets/fonts/league-spartan-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: dark;

  --void: #060a14;
  --navy: #0a1020;
  --surface: #0f1729;
  --raised: #152039;
  --hover: #1b2849;
  --line: #21304f;
  --line-strong: #2e4270;
  --ink: #eaf1ff;
  --ink-2: #9aabcb;
  --ink-3: #62739a;
  --ink-note: color-mix(in srgb, var(--ink-2) 70%, var(--ink-3));
  --blue: #3987e5;
  --blue-bright: #6db0ff;
  --blue-deep: #184f95;
  --blue-track: #14294a;
  --gold: #d9a441;
  --gold-bright: #ffc94d;
  --good: #2fbf71;
  --loss: #e66767;
  --warn: #fab219;

  --blue-rgb: 57 135 229;
  --bright-rgb: 109 176 255;
  --gold-rgb: 217 164 65;
  --void-rgb: 6 10 20;

  --font-display: "League Spartan", "Futura", "Avenir Next", "Trebuchet MS", sans-serif;
  --font-text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(16px, 4vw, 44px);
  --max: 1240px;
  --nav-h: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  background: var(--void);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--void);
  color: var(--ink);
  font: 400 17px/1.55 var(--font-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: inherit;
}

::selection {
  background: rgb(var(--blue-rgb) / 0.45);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: 3px;
  border-radius: 6px;
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 1.6em;
  padding: 0.1em 0.4em;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--raised);
  font: 600 0.82em/1.2 var(--font-text);
  color: var(--ink);
}

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

.wrap {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Type */

.display {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 0.95;
  text-wrap: balance;
  margin: 0;
}

.h2 {
  font-size: clamp(40px, 5.4vw, 76px);
}

.h3 {
  font-size: clamp(32px, 3.6vw, 52px);
  line-height: 1;
}

.lede {
  font-size: clamp(18px, 1.5vw, 21px);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 34em;
  margin: 0;
}

.muted {
  color: var(--ink-note);
}

.display:has(> .rise-mask) {
  display: flex;
  flex-direction: column;
}

.rise-mask {
  padding-block: 0.06em 0.14em;
  margin-block: -0.06em -0.14em;
}

/* Buttons */

.btn {
  --btn-bg: var(--raised);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: var(--btn-bg);
  color: var(--ink);
  font: 600 16px/1 var(--font-text);
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background-color 0.25s, border-color 0.25s;
  will-change: transform;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.btn:hover {
  border-color: var(--blue);
  background: var(--hover);
}

.btn-primary {
  border-color: rgb(var(--bright-rgb) / 0.5);
  background: linear-gradient(180deg, var(--blue-bright), var(--blue));
  color: #fff;
  box-shadow: 0 10px 30px -8px rgb(var(--blue-rgb) / 0.7), inset 0 1px 0 rgb(255 255 255 / 0.25);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #82bcff, var(--blue));
  border-color: rgb(var(--bright-rgb) / 0.8);
  box-shadow: 0 16px 44px -10px rgb(var(--blue-rgb) / 0.9), inset 0 1px 0 rgb(255 255 255 / 0.3);
}

.btn-small {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 11px;
  font-size: 14px;
}

/* Nav */

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgb(var(--void-rgb) / 0.62);
  backdrop-filter: saturate(140%) blur(16px);
  -webkit-backdrop-filter: saturate(140%) blur(16px);
  border-bottom: 1px solid rgb(33 48 79 / 0.6);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: var(--nav-h);
}

.brand {
  display: inline-flex;
  border-radius: 12px;
}

.brand img {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.08), 0 8px 24px -10px rgb(var(--blue-rgb) / 0.8);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.brand:hover img {
  transform: scale(1.06) rotate(-4deg);
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.12), 0 12px 30px -8px rgb(var(--blue-rgb) / 0.95);
}

.nav-links {
  position: relative;
  display: flex;
  gap: 4px;
  margin-right: auto;
}

.nav-links a {
  position: relative;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s, background-color 0.2s;
}

.nav-links a:hover {
  color: var(--ink);
  background: rgb(27 40 73 / 0.7);
}

.nav-links a[aria-current="true"] {
  color: var(--ink);
}

.nav-indicator {
  position: absolute;
  left: 0;
  bottom: 2px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--blue-bright);
  box-shadow: 0 0 10px var(--blue-bright);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.6s var(--ease), width 0.6s var(--ease), opacity 0.3s;
}

.nav-indicator.is-jumping {
  transition: opacity 0.3s;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.btn-github svg {
  width: 17px;
  height: 17px;
}

/* Hero */

.hero {
  position: relative;
  isolation: isolate;
  padding-top: calc(var(--nav-h) + env(safe-area-inset-top, 0px) + clamp(48px, 8vw, 104px));
  padding-bottom: clamp(56px, 8vw, 120px);
  overflow: clip;
}

.rift {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(60% 55% at 70% 38%, rgb(var(--blue-rgb) / 0.35), transparent 70%),
    radial-gradient(45% 45% at 18% 70%, rgb(24 79 149 / 0.5), transparent 70%),
    linear-gradient(180deg, #0b1630, var(--void) 85%);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgb(var(--void-rgb) / 0.82) 0%, rgb(var(--void-rgb) / 0.55) 38%, rgb(var(--void-rgb) / 0) 62%);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 240px;
  z-index: -1;
  background: linear-gradient(180deg, transparent, var(--void));
  pointer-events: none;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 4vw, 64px);
}

.hero-title {
  font-size: clamp(46px, 5.5vw, 84px);
  line-height: 0.92;
}

.hero-title .line {
  display: block;
  overflow: hidden;
  padding-block: 0.04em 0.1em;
  margin-block: -0.04em -0.1em;
}

.hero-title .line > span {
  display: inline-block;
}

.hero-lede {
  margin-top: 28px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

.hero-note {
  margin: 18px 0 0;
  font-size: 14px;
  color: var(--ink-note);
}

.hero-stage {
  perspective: 1700px;
  perspective-origin: 40% 40%;
}

.hero-scene {
  position: relative;
  aspect-ratio: 16 / 11.5;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx, 7deg)) rotateY(var(--ry, -15deg));
  will-change: transform;
}

.hero-window {
  position: absolute;
  inset: 6% 0 auto 4%;
  width: 96%;
  border-radius: 14px;
  box-shadow: 0 60px 120px -40px rgb(0 0 0 / 0.9), 0 0 0 1px rgb(46 66 112 / 0.5), 0 0 90px -20px rgb(var(--blue-rgb) / 0.45);
  transform: translateZ(0);
}

.hero-hud {
  position: absolute;
  right: -6%;
  top: 30%;
  width: 29%;
  border-radius: 16px;
  box-shadow: 0 40px 80px -30px rgb(0 0 0 / 0.95), 0 0 60px -12px rgb(var(--blue-rgb) / 0.5);
  transform: translateZ(150px);
}

.hero-ready {
  position: absolute;
  left: 2%;
  bottom: -2%;
  transform: translateZ(210px);
}

.hero-grade {
  position: absolute;
  left: 8%;
  top: -2%;
  transform: translateZ(180px);
}

/* Shared app-style panel */

.panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgb(21 32 57 / 0.96), rgb(15 23 41 / 0.96));
  box-shadow: 0 30px 70px -30px rgb(0 0 0 / 0.9), inset 0 1px 0 rgb(255 255 255 / 0.04);
}

/* Ready check */

.ready {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px 14px 14px;
}

.ready-ring {
  width: 54px;
  height: 54px;
  flex: none;
  transform: rotate(-90deg);
}

.ready-ring circle {
  fill: none;
  stroke-width: 5;
}

.ready-track {
  stroke: var(--blue-track);
}

.ready-bar {
  stroke: var(--blue-bright);
  stroke-linecap: round;
  stroke-dasharray: 163.36;
  stroke-dashoffset: 0;
  transition: stroke 0.3s;
}

.ready-check {
  fill: none;
  stroke: var(--good);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 34;
  stroke-dashoffset: 34;
  transform: rotate(90deg);
  transform-origin: 32px 32px;
}

.ready[data-state="accepted"] .ready-bar {
  stroke: var(--good);
}

.ready[data-state="accepted"] .ready-check {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.45s var(--ease) 0.1s;
}

.ready-copy {
  display: grid;
  gap: 4px;
}

.ready-copy strong {
  font: 700 18px/1 var(--font-display);
  letter-spacing: -0.01em;
}

.ready-status {
  font-size: 14px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ready[data-state="accepted"] .ready-status {
  color: var(--good);
}

/* Grade medal */

.medal {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px 12px 12px;
}

.medal-ring {
  position: relative;
  width: 64px;
  height: 64px;
  flex: none;
}

.medal-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  overflow: visible;
}

.medal-ring circle {
  fill: none;
  stroke-width: 4.5;
}

.medal-track {
  stroke: rgb(46 66 112 / 0.6);
}

.medal-bar {
  stroke: var(--gold-bright);
  stroke-linecap: round;
  stroke-dasharray: 169.65;
  stroke-dashoffset: 0;
  filter: drop-shadow(0 0 6px rgb(255 201 77 / 0.7));
}

.medal-letter {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1px;
  color: var(--gold-bright);
  font: 800 21px/1 var(--font-display);
  text-shadow: 0 0 18px rgb(255 201 77 / 0.55);
}

.medal-letter small {
  font: 600 10px/1 var(--font-text);
  color: var(--ink-2);
  text-shadow: none;
}

.medal-copy {
  display: grid;
  gap: 6px;
}

.medal-copy strong {
  font: 800 20px/1 var(--font-display);
  letter-spacing: -0.01em;
}

.tag-mvp {
  justify-self: start;
  padding: 3px 9px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffd978, var(--gold));
  color: #2a1c00;
  font: 800 11px/1.2 var(--font-text);
  letter-spacing: 0.06em;
}

/* Facts */

.facts {
  position: relative;
  padding-block: clamp(28px, 4vw, 44px);
  border-block: 1px solid var(--line);
  background: linear-gradient(180deg, rgb(10 16 32 / 0.6), rgb(6 10 20 / 0.2));
}

.facts ul {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.facts li {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.facts .icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgb(var(--blue-rgb) / 0.35);
  background: rgb(24 79 149 / 0.25);
  color: var(--blue-bright);
}

.facts .icon svg {
  width: 20px;
  height: 20px;
}

.scroll-fx .facts .icon svg {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
}

.scroll-fx .facts.is-drawn .icon svg {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1.6s var(--ease) calc(0.25s + var(--i, 0) * 0.14s);
}

.facts li:nth-child(2) {
  --i: 1;
}

.facts li:nth-child(3) {
  --i: 2;
}

.facts li:nth-child(4) {
  --i: 3;
}

.facts strong {
  display: block;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.3;
}

.facts span {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.45;
}

/* Match chapters */

.match {
  padding-top: clamp(96px, 12vw, 180px);
  padding-bottom: clamp(24px, 4vw, 64px);
  overflow: clip;
}

.match-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: end;
  margin-bottom: clamp(24px, 4vw, 48px);
}

.chapters {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}

.chapter-list {
  --rail-gap: 44px;
  position: relative;
}

.chapter-list {
  padding-left: var(--rail-gap);
}

.chapter-rail {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 20px;
  background: linear-gradient(var(--line), var(--line)) center / 2px 100% no-repeat;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 5%, #000 95%, transparent);
  pointer-events: none;
}

.chapter-rail span {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 9px;
  width: 2px;
  border-radius: 2px;
  background: var(--blue-bright);
  box-shadow: 0 0 12px rgb(var(--bright-rgb) / 0.75);
  transform: scaleY(0);
  transform-origin: top;
}

.chapter {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  min-height: 86vh;
  padding-block: 64px;
  scroll-margin-top: calc(var(--nav-h) + 24px);
}

.chapter-time {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.chapter-time time {
  display: inline-grid;
  place-items: center;
  min-width: 70px;
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font: 700 17px/1 var(--font-text);
  font-variant-numeric: tabular-nums;
  transition: border-color 0.4s, box-shadow 0.4s, color 0.4s;
}

.chapter.is-active .chapter-time time {
  border-color: rgb(var(--bright-rgb) / 0.7);
  box-shadow: 0 0 0 4px rgb(var(--blue-rgb) / 0.15), 0 0 26px -4px rgb(var(--blue-rgb) / 0.8);
}

.chapter[data-phase="after"].is-active .chapter-time time {
  border-color: rgb(255 201 77 / 0.75);
  color: var(--gold-bright);
  box-shadow: 0 0 0 4px rgb(var(--gold-rgb) / 0.15), 0 0 26px -4px rgb(255 201 77 / 0.8);
}

.chapter-time {
  position: relative;
}

.chapter-time::before,
.chapter-time::after {
  content: "";
  position: absolute;
  left: calc(3px - var(--rail-gap));
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border-radius: 50%;
  pointer-events: none;
}

.chapter-time::before {
  border: 2px solid var(--line-strong);
  background: var(--void);
  transition: border-color 0.4s, background-color 0.4s, box-shadow 0.4s;
}

.chapter-time::after {
  border: 1px solid var(--blue-bright);
  opacity: 0;
}

.chapter-time.is-reached::before {
  border-color: var(--blue-bright);
  background: var(--blue-bright);
  box-shadow: 0 0 0 4px rgb(var(--blue-rgb) / 0.18), 0 0 14px rgb(var(--bright-rgb) / 0.85);
}

.chapter[data-phase="after"] .chapter-time.is-reached::before {
  border-color: var(--gold-bright);
  background: var(--gold-bright);
  box-shadow: 0 0 0 4px rgb(var(--gold-rgb) / 0.2), 0 0 14px rgb(255 201 77 / 0.85);
}

.chapter[data-phase="after"] .chapter-time::after {
  border-color: var(--gold-bright);
}

.chapter.is-active .chapter-time.is-reached::after {
  animation: node-ping 2.4s var(--ease) infinite;
}

@keyframes node-ping {
  from {
    opacity: 0.9;
    transform: scale(1);
  }

  to {
    opacity: 0;
    transform: scale(2.8);
  }
}

.chapter h3 {
  transition: color 0.5s;
}

.js .chapter:not(.is-active) h3 {
  color: rgb(234 241 255 / 0.55);
}

.chapter p {
  margin: 0;
  max-width: 32em;
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1.6;
}

.points {
  display: grid;
  gap: 12px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.points li {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
}

.points li:nth-child(2) {
  --i: 1;
}

.points li:nth-child(3) {
  --i: 2;
}

.points li::before {
  content: "";
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 6px;
  background: rgb(24 79 149 / 0.45);
}

.points li::after {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  width: 18px;
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%236DB0FF' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 10.5l3.2 3.2L15 7'/%3E%3C/svg%3E") center / 14px no-repeat;
}

.scroll-fx .chapter .points li::after {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.55s var(--ease) calc(0.35s + var(--i, 0) * 0.16s);
}

.scroll-fx .chapter.is-done .points li::after {
  clip-path: inset(0);
}

.scroll-fx .chapter.is-done .points li::before {
  animation: tick 0.6s var(--ease) calc(0.35s + var(--i, 0) * 0.16s);
}

@keyframes tick {
  45% {
    transform: scale(1.22);
    background-color: rgb(var(--blue-rgb) / 0.65);
  }
}

.chapter-visual {
  display: none;
  margin-top: 8px;
}

.chapter-visual img {
  width: 100%;
  border-radius: 14px;
  box-shadow: 0 30px 60px -30px rgb(0 0 0 / 0.9);
}

.chapter-visual-ready {
  padding-block: 24px 8px;
  background: radial-gradient(closest-side, rgb(var(--blue-rgb) / 0.22), transparent) center / 100% 100% no-repeat;
}

.chapter-visual-ready .ready {
  width: fit-content;
  margin-inline: auto;
}

.stage {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  height: calc(100vh - var(--nav-h) - 48px);
  min-height: 560px;
  max-height: 860px;
  perspective: 1800px;
}

.stage-glow {
  position: absolute;
  inset: 10% 6%;
  filter: blur(30px);
  pointer-events: none;
}

.stage-glow::before,
.stage-glow::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  transition: opacity 0.9s var(--ease);
}

.stage-glow::before {
  background: radial-gradient(closest-side, rgb(var(--blue-rgb) / 0.32), transparent);
}

.stage-glow::after {
  background: radial-gradient(closest-side, rgb(var(--gold-rgb) / 0.3), transparent);
  opacity: 0;
}

.stage[data-phase="after"] .stage-glow::before {
  opacity: 0;
}

.stage[data-phase="after"] .stage-glow::after {
  opacity: 1;
}

.scene {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transform-style: preserve-3d;
}

.js .scene:not([data-scene="queue"]) {
  visibility: hidden;
  opacity: 0;
}

.scene-shot {
  position: absolute;
  border-radius: 14px;
  box-shadow: 0 50px 100px -40px rgb(0 0 0 / 0.95), 0 0 0 1px rgb(46 66 112 / 0.45);
}

/* Queue scene */

.scene-queue {
  align-content: center;
  gap: 40px;
}

.ready-big {
  padding: 26px 34px 26px 26px;
  gap: 24px;
  transform: translateZ(60px);
}

.ready-big .ready-ring {
  width: 108px;
  height: 108px;
}

.ready-big .ready-copy strong {
  font-size: clamp(28px, 2.6vw, 40px);
}

.ready-big .ready-status {
  font-size: 17px;
}

.dock {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 22px;
  border: 1px solid rgb(46 66 112 / 0.6);
  background: rgb(21 32 57 / 0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.dock-app {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 13px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--tint) 86%, #fff), color-mix(in srgb, var(--tint) 62%, #000));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.2), 0 10px 20px -8px rgb(0 0 0 / 0.8);
  color: rgb(255 255 255 / 0.92);
  opacity: 0.62;
  filter: saturate(0.65);
}

.dock-app svg {
  width: 26px;
  height: 26px;
}

.dock img {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  box-shadow: 0 10px 20px -8px rgb(0 0 0 / 0.8);
}

.dock .dock-up {
  position: relative;
}

.dock .dock-up::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -9px;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background: var(--ink-2);
}

.queue-wave {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  border: 1px solid rgb(var(--bright-rgb) / 0.4);
  opacity: 0;
  pointer-events: none;
}

/* Champ select scene */

.shot-champ {
  width: 92%;
  left: 0;
  top: 8%;
  transform: translateZ(-40px) rotateY(-6deg);
}

.score-card {
  position: absolute;
  right: 0;
  bottom: 6%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  width: min(430px, 70%);
  padding: 18px 20px;
  transform: translateZ(160px);
}

.score-ring {
  position: relative;
  width: 76px;
  height: 76px;
}

.score-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-ring circle {
  fill: none;
  stroke-width: 6;
}

.score-ring .track {
  stroke: var(--blue-track);
}

.score-ring .bar {
  stroke: var(--blue);
  stroke-linecap: round;
  stroke-dasharray: 201.06;
  stroke-dashoffset: 78.4;
}

.score-ring b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 700 22px/1 var(--font-text);
  font-variant-numeric: tabular-nums;
  color: var(--blue-bright);
}

.score-name {
  font: 800 24px/1 var(--font-display);
  letter-spacing: -0.01em;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.chip-good {
  color: var(--blue-bright);
  background: rgb(var(--bright-rgb) / 0.12);
  border-color: rgb(var(--bright-rgb) / 0.32);
}

.chip-bad {
  color: var(--loss);
  background: rgb(230 103 103 / 0.12);
  border-color: rgb(230 103 103 / 0.32);
}

/* In-game scene */

.shot-overview {
  width: 88%;
  left: 0;
  top: 4%;
  transform: translateZ(-80px) rotateY(-8deg);
  filter: saturate(0.9) brightness(0.85);
}

.hud {
  position: absolute;
  right: 2%;
  top: 14%;
  width: min(300px, 44%);
  padding: 14px;
  display: grid;
  gap: 10px;
  border-radius: 14px;
  border: 1px solid rgb(var(--blue-rgb) / 0.35);
  background: rgb(6 10 20 / 0.92);
  box-shadow: 0 40px 90px -30px rgb(0 0 0 / 0.95), 0 0 50px -14px rgb(var(--blue-rgb) / 0.6);
  transform: translateZ(180px);
  font-size: 13px;
}

.hud-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-time {
  font: 700 16px/1 var(--font-text);
  font-variant-numeric: tabular-nums;
}

.hud-kills {
  color: var(--ink-2);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.hud-gold {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgb(var(--blue-rgb) / 0.16);
  color: var(--blue);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.hud-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.hud-row svg {
  width: 15px;
  height: 15px;
  color: var(--gold);
}

.hud-row b {
  font-variant-numeric: tabular-nums;
}

.hud-row[data-alive] b {
  color: var(--good);
}

.hud-row .soon {
  color: var(--warn);
}

.hud hr {
  width: 100%;
  height: 1px;
  margin: 2px 0;
  border: 0;
  background: var(--line);
}

.hud-goal {
  display: grid;
  gap: 6px;
}

.hud-goal-top {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.hud-goal[data-ready] .hud-goal-top {
  color: var(--good);
}

.meter {
  height: 4px;
  border-radius: 999px;
  background: rgb(var(--gold-rgb) / 0.18);
  overflow: hidden;
}

.meter i {
  display: block;
  height: 100%;
  width: 62%;
  border-radius: inherit;
  background: var(--gold);
  transition: background-color 0.4s;
}

.hud-goal[data-ready] .meter i {
  background: var(--good);
}

.hud-skills {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 600;
}

.key {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: var(--blue-deep);
  color: var(--ink);
  font-weight: 700;
  font-size: 11.5px;
}

.hud-next {
  margin-left: auto;
  color: var(--gold);
  font-weight: 700;
}

/* After-the-game scene */

.scene-after {
  align-content: center;
  gap: 24px;
}

.medal-big {
  transform: translateZ(120px);
  padding: 20px 28px 20px 20px;
  gap: 22px;
}

.medal-big .medal-ring {
  width: 116px;
  height: 116px;
}

.medal-big .medal-letter {
  font-size: 38px;
}

.medal-big .medal-letter small {
  font-size: 13px;
}

.medal-big .medal-copy strong {
  font-size: clamp(26px, 2.4vw, 34px);
}

.medal-kda {
  color: var(--ink-2);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.lp-card {
  width: min(520px, 90%);
  padding: 18px 20px 14px;
  transform: translateZ(60px);
}

.lp-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.lp-top span {
  color: var(--ink-2);
  font-size: 14px;
}

.lp-top .lp-gain {
  font: 800 30px/1 var(--font-display);
  color: var(--blue-bright);
  font-variant-numeric: tabular-nums;
}

.lp-chart {
  width: 100%;
  height: 120px;
  margin-top: 10px;
  overflow: visible;
}

.lp-chart .area {
  fill: url(#lpFill);
}

.lp-chart .line {
  fill: none;
  stroke: var(--blue-bright);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lp-chart .grid {
  stroke: var(--line);
  stroke-width: 1;
}

.lp-chart .dot {
  fill: var(--blue-bright);
  stroke: var(--void);
  stroke-width: 2;
}

.lp-chart text {
  fill: var(--ink-3);
  font: 600 11px var(--font-text);
}

/* App tour */

.tour {
  padding-block: clamp(96px, 12vw, 180px) clamp(64px, 8vw, 120px);
}

.tour-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: end;
}

.tour-tabs {
  display: flex;
  gap: 4px;
  width: max-content;
  max-width: 100%;
  margin: clamp(40px, 5vw, 64px) auto 0;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgb(10 16 32 / 0.85);
  overflow-x: auto;
  scrollbar-width: none;
}

.tour-tabs::-webkit-scrollbar {
  display: none;
}

.tour-tab {
  position: relative;
  flex: none;
  padding: 12px 20px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--ink-2);
  font: 600 15px/1 var(--font-text);
  cursor: pointer;
  overflow: hidden;
  transition: color 0.25s, background-color 0.25s, box-shadow 0.25s;
}

.tour-tab:hover {
  color: var(--ink);
  background: rgb(27 40 73 / 0.7);
}

.tour-tab[aria-selected="true"] {
  color: #fff;
  background: linear-gradient(180deg, var(--blue), #2a6fc4);
  box-shadow: 0 8px 24px -10px rgb(var(--blue-rgb) / 0.95), inset 0 1px 0 rgb(255 255 255 / 0.2);
}

.tour-tab i {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 5px;
  height: 2px;
  border-radius: 2px;
  background: rgb(255 255 255 / 0.8);
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left center;
}

.tour.is-playing .tour-tab[aria-selected="true"] i {
  opacity: 1;
  animation: tour-progress 7s linear forwards;
}

.tour.is-playing.is-paused .tour-tab[aria-selected="true"] i {
  animation-play-state: paused;
}

@keyframes tour-progress {
  to {
    transform: scaleX(1);
  }
}

.tour-stage {
  display: grid;
  margin-top: 28px;
}

.tour-panel {
  grid-area: 1 / 1;
  margin: 0;
  visibility: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.985);
  transition: opacity 0.55s var(--ease), transform 0.9s var(--ease), visibility 0s linear 0.55s;
}

.tour-panel.is-current {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition-delay: 0s;
}

.tour-panel img {
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 70px 140px -60px #000, 0 0 0 1px rgb(46 66 112 / 0.55), 0 0 120px -40px rgb(var(--blue-rgb) / 0.55);
}

.tour-panel figcaption {
  max-width: 62ch;
  margin: 24px auto 0;
  color: var(--ink-2);
  font-size: 16.5px;
  line-height: 1.5;
  text-align: center;
  text-wrap: balance;
}

.section-copy {
  display: grid;
  gap: 24px;
}

/* Victory marquee */

.victory {
  padding-block: clamp(40px, 6vw, 80px);
  border-block: 1px solid var(--line);
  overflow: hidden;
  background: linear-gradient(180deg, rgb(10 16 32 / 0.8), rgb(6 10 20));
}

.victory-caption {
  margin: 0 0 clamp(16px, 2vw, 28px);
  color: var(--ink-2);
  font-size: 16px;
}

.victory-track {
  display: flex;
  width: max-content;
  gap: 0.6em;
  font: 900 clamp(64px, 11vw, 170px)/1 var(--font-display);
  letter-spacing: -0.04em;
  white-space: nowrap;
  animation: marquee 48s linear infinite;
}

.victory-track span:nth-child(odd) {
  color: var(--ink);
}

.victory-track span:nth-child(even) {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--line-strong);
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

/* Install */

.install {
  padding-block: clamp(64px, 8vw, 120px);
}

.install-inner {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}

.install-steps {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.install-steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 18px 22px 18px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 17px;
  line-height: 1.5;
}

.install-steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--raised), var(--navy));
  border: 1px solid var(--line-strong);
  font: 800 28px/1 var(--font-display);
  color: var(--blue-bright);
}

.install-steps li:nth-child(2) {
  --i: 1;
}

.install-steps li:nth-child(3) {
  --i: 2;
}

.install.is-lit .install-steps li::before {
  animation: step-lit 1.3s var(--ease) calc(0.1s + var(--i, 0) * 0.35s) both;
}

@keyframes step-lit {
  from {
    border-color: var(--line-strong);
    box-shadow: none;
  }

  35% {
    border-color: var(--blue-bright);
    color: #fff;
    box-shadow: 0 0 0 5px rgb(var(--blue-rgb) / 0.18), 0 0 30px -2px rgb(var(--blue-rgb) / 0.9);
    transform: scale(1.08);
  }

  to {
    border-color: rgb(var(--bright-rgb) / 0.55);
    box-shadow: 0 0 22px -8px rgb(var(--blue-rgb) / 0.7);
  }
}

.install-steps small {
  display: block;
  margin-top: 2px;
  color: var(--ink-2);
  font-size: 14.5px;
}

.install-steps a {
  color: var(--blue-bright);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

.install-steps a:hover {
  color: var(--ink);
}

.requirements {
  margin: 18px 0 0;
  color: var(--ink-note);
  font-size: 14px;
}

/* Final call to action */

.final {
  position: relative;
  padding-block: clamp(96px, 12vw, 180px);
  text-align: center;
  overflow: clip;
}

.final-mark {
  position: relative;
  width: clamp(180px, 24vw, 300px);
  aspect-ratio: 1;
  margin: 0 auto clamp(40px, 5vw, 64px);
}

.final-glow,
.final-tile {
  position: absolute;
  inset: 0;
  border-radius: 28%;
}

.final-glow {
  inset: -3px;
  background: conic-gradient(from var(--spin, 0deg), var(--blue-deep), var(--blue-bright), var(--gold-bright), var(--blue), var(--blue-deep));
  filter: blur(22px);
  opacity: 0.8;
  animation: spin 9s linear infinite;
}

.final-tile {
  display: grid;
  place-items: center;
  background: #000;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.08), 0 60px 120px -40px rgb(var(--blue-rgb) / 0.8);
  font: 900 clamp(60px, 8.6vw, 108px)/1 var(--font-display);
  letter-spacing: -0.05em;
  color: #fff;
  padding-top: 0.08em;
}

@property --spin {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@keyframes spin {
  to {
    --spin: 360deg;
  }
}

.final h2 {
  max-width: 14ch;
  margin-inline: auto;
}

.final .hero-actions {
  justify-content: center;
}

/* Footer */

.footer {
  padding-block: 40px 56px;
  border-top: 1px solid var(--line);
  color: var(--ink-note);
  font-size: 13.5px;
  line-height: 1.6;
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: start;
}

.footer p {
  margin: 0 0 10px;
  max-width: 72ch;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.footer-links a {
  color: var(--ink-2);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Responsive */

@media (max-width: 1180px) {
  .nav-links {
    display: none;
  }
}

@media (max-width: 1060px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero::before {
    background: linear-gradient(180deg, rgb(var(--void-rgb) / 0.78) 0%, rgb(var(--void-rgb) / 0.5) 50%, rgb(var(--void-rgb) / 0.1) 100%);
  }

  .hero-stage {
    max-width: 760px;
    margin-inline: auto;
    width: 100%;
    padding-inline: 4%;
  }

  .facts ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .match-intro,
  .tour-intro,
  .install-inner {
    grid-template-columns: minmax(0, 1fr);
  }


  .chapters {
    grid-template-columns: minmax(0, 1fr);
  }

  .stage {
    display: none;
  }

  .chapter {
    min-height: 0;
    padding-block: 48px;
  }

  .chapter-visual {
    display: block;
  }

  .js .chapter:not(.is-active) h3 {
    color: var(--ink);
  }
}

html:not(.js) .stage {
  display: none;
}

html:not(.js) .chapter-visual {
  display: block;
}

html:not(.js) .tour-tabs {
  display: none;
}

html:not(.js) .tour-stage {
  gap: 56px;
  margin-top: clamp(40px, 5vw, 64px);
}

html:not(.js) .tour-panel {
  grid-area: auto;
  visibility: visible;
  opacity: 1;
  transform: none;
}

@media (max-width: 720px) {
  body {
    font-size: 16px;
  }

  .chapter-list {
    --rail-gap: 30px;
  }

  .facts ul {
    grid-template-columns: minmax(0, 1fr);
  }


  .hero-hud {
    width: 34%;
    right: -3%;
  }

  .hero-ready {
    left: 0;
    bottom: -10%;
    transform: translateZ(210px) scale(0.86);
    transform-origin: left bottom;
  }

  .hero-grade {
    display: none;
  }

  .footer-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .install-steps li {
    grid-template-columns: 44px minmax(0, 1fr);
    padding: 14px;
  }

  .install-steps li::before {
    width: 44px;
    height: 44px;
    font-size: 22px;
  }

  .tour-tabs {
    width: 100%;
    justify-content: space-between;
  }

  .tour-tab {
    padding: 11px 10px;
    font-size: 13.5px;
  }
}

@media (max-width: 460px) {
  .nav .btn-small {
    padding: 0 12px;
  }

  .nav .btn-github {
    width: 38px;
    padding: 0;
    justify-content: center;
  }

  .btn-github span {
    display: none;
  }

  .hero-actions .btn {
    flex: 1 1 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .victory-track {
    animation: none;
    flex-wrap: wrap;
    width: auto;
    white-space: normal;
  }

  .scroll-fx .chapter .points li::after {
    clip-path: none;
  }

  .scroll-fx .facts .icon svg {
    stroke-dashoffset: 0;
  }
}
