/* Home page: hero with the 3D court, product sections and 3D phones. */

.section {
  max-width: 1160px;
  margin: 0 auto;
  padding: 120px 24px 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-head { max-width: 720px; margin-bottom: 56px; }
.section-head h2 {
  font-size: clamp(32px, 4.6vw, 54px);
  line-height: 1.1;
  margin: 12px 0 16px;
}
.section-head p { color: var(--muted); font-size: 19px; margin: 0; }

.gradient-text {
  background: linear-gradient(120deg, #ffffff 10%, #bff5d6 55%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Buttons */

.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn-primary {
  color: #141004;
  background: linear-gradient(180deg, #ffd46b, var(--gold-deep));
  box-shadow: 0 10px 40px -10px rgba(242, 193, 78, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 50px -12px rgba(242, 193, 78, 0.85); }

.btn-ghost {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--rule);
}
.btn-ghost:hover { background: var(--surface-strong); }

/* Hero */

.hero {
  min-height: 100svh;
  margin-top: calc(-12px - 58px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hero-content {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 118px 24px 0;
  text-align: center;
}

/* The court takes whatever height the copy leaves, and never less than this. */
.hero-court { position: relative; flex: 1; min-height: 400px; }
@media (min-width: 961px) { .hero-court { min-height: 560px; } }
.hero-court canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.hero-court.no-webgl { background: url("/img/court-poster.webp") center / cover no-repeat; }

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 10px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: rgba(13, 17, 16, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--muted);
  font-size: 14px;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(91, 228, 155, 0.6);
  animation: pulse 2.2s infinite;
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 10px rgba(91, 228, 155, 0); }
  100% { box-shadow: 0 0 0 0 rgba(91, 228, 155, 0); }
}

.hero h1 {
  font-size: clamp(44px, 6vw, 80px);
  font-weight: 700;
  line-height: 1.05;
  margin: 20px 0 16px;
  letter-spacing: -0.03em;
}

.hero-lead {
  max-width: 600px;
  margin: 0 auto 26px;
  color: #c9d2cc;
  font-size: clamp(17px, 1.6vw, 20px);
}

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

.hero-platforms { margin-top: 14px; color: var(--muted); font-size: 14px; }
.hero-platforms a { color: var(--link); }

/* How to film */

.film-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.film-card {
  padding: 28px 24px;
  border: 1px solid var(--rule);
  border-radius: 24px;
  background: linear-gradient(180deg, var(--surface-strong), rgba(255, 255, 255, 0.01));
}
.film-card svg { width: 100%; max-width: 220px; height: auto; color: var(--green); }
.film-card h3 { font-size: 20px; margin: 18px 0 8px; }
.film-card p { color: var(--muted); font-size: 15px; margin: 0; }

.film-checks {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  margin: 24px 0 0;
}
.film-checks li {
  margin: 0;
  padding: 6px 14px 6px 32px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: #c9d2cc;
  font-size: 14px;
  position: relative;
}
.film-checks li::before {
  content: "✓";
  position: absolute;
  left: 13px;
  color: var(--green);
  font-weight: 700;
}

/* Install steps in the closing section */

.install-steps {
  max-width: 560px;
  margin: 0 auto 32px;
  padding: 0;
  list-style: none;
  counter-reset: step;
  text-align: left;
}
.install-steps li {
  counter-increment: step;
  position: relative;
  margin: 0 0 12px;
  padding: 14px 18px 14px 58px;
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: var(--surface);
  color: #d6ddd8;
}
.install-steps li::before {
  content: counter(step);
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--gold);
  color: #141004;
  font-weight: 700;
  font-size: 14px;
}
.install-note { margin-top: 18px !important; color: var(--faint) !important; font-size: 14px !important; }

/* 3D court canvas and touch labels */

.court3d canvas { display: block; width: 100%; height: 100%; }

.court3d.no-webgl {
  background: url("/img/court-poster.webp") center / cover no-repeat;
}

.court-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

.court-label {
  position: absolute;
  left: 0;
  top: 0;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: #07090a;
  background: var(--label-color, var(--green));
  box-shadow: 0 0 20px var(--label-color, var(--green));
  transition: opacity 0.4s;
}

/* 3D phones */

.phone {
  perspective: 1400px;
  display: flex;
  justify-content: center;
}

.phone-frame {
  --rx: 6deg;
  --ry: -16deg;
  position: relative;
  width: min(280px, 72vw);
  aspect-ratio: 402 / 874;
  padding: 10px;
  border-radius: 48px;
  background: linear-gradient(145deg, #3a4540, #0e1211 45%, #1c2320);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.14),
    0 40px 80px -30px rgba(0, 0, 0, 0.9),
    0 0 90px -20px rgba(91, 228, 155, 0.35);
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.phone.flip .phone-frame { --ry: 16deg; }

.phone-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 38px;
  background: #000;
}

.phone-frame::after {
  /* glass reflection */
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 38px;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 38%);
  pointer-events: none;
}

/* How it works */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.step {
  position: relative;
  padding: 32px 28px 40px;
  border: 1px solid var(--rule);
  border-radius: 28px;
  background: linear-gradient(180deg, var(--surface-strong), rgba(255, 255, 255, 0.01));
  overflow: hidden;
}

.step-num {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--gold);
}

.step h3 { font-size: 24px; margin: 8px 0 8px; }
.step p { color: var(--muted); margin: 0 0 32px; }
.step .phone-frame { width: min(210px, 60vw); --ry: -10deg; }

/* Feature chapters: sticky index, sticky phone, scrolling chapters */

.chapter-index {
  position: sticky;
  top: var(--bar-h);
  z-index: 10;
  display: flex;
  gap: 6px;
  margin: 0 -24px 24px;
  padding: 12px 24px;
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(7, 9, 10, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--rule);
}
.chapter-index::-webkit-scrollbar { display: none; }

.chapter-index a {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.25s, background 0.25s, border-color 0.25s;
}
.chapter-index a span { color: var(--faint); font-variant-numeric: tabular-nums; font-size: 12px; }
.chapter-index a:hover { color: var(--text); }
.chapter-index a.is-active {
  color: #07090a;
  background: var(--green);
  border-color: var(--green);
}
.chapter-index a.is-active span { color: rgba(7, 9, 10, 0.6); }

.chapter-progress {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: -1px;
  height: 2px;
  background: transparent;
}
.chapter-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--green), var(--gold));
  transition: width 0.5s ease;
}

.chapter-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 64px;
}

.chapter-stage {
  position: sticky;
  top: calc(var(--bar-h) + 89px);
  align-self: start;
  height: calc(100svh - var(--bar-h) - 129px);
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chapter-stage::before {
  content: "";
  position: absolute;
  inset: 12% 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91, 228, 155, 0.2), rgba(91, 228, 155, 0) 68%);
  filter: blur(24px);
  z-index: -1;
}

.chapter-stage .phone-frame {
  width: min(300px, 26vw);
  transition: transform 0.26s ease-in;
}

.chapter-stage .phone-frame.is-turning { transform: rotateX(var(--rx)) rotateY(90deg); }

.chapter {
  min-height: 72svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 0;
  opacity: 0.32;
  transition: opacity 0.5s ease;
}
.chapter.is-active { opacity: 1; }

.chapter-num {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.06em;
}

.chapter h3 {
  font-size: clamp(30px, 3.6vw, 44px);
  line-height: 1.12;
  margin: 10px 0 14px;
}

.chapter p { color: var(--muted); font-size: 18px; margin: 0; max-width: 520px; }

.chapter ul {
  list-style: none;
  padding: 0;
  margin: 22px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chapter li {
  margin: 0;
  padding: 4px 12px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: #c9d2cc;
  font-size: 14px;
}

.chapter .phone { display: none; }

/* Engine: real footage beside the synced 3D replay */

.replay {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.replay-video {
  position: relative;
  margin: 0;
  aspect-ratio: 16 / 9;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: #000;
}

.replay-video video, .replay-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.replay-video video { object-fit: fill; }
.replay-overlay { pointer-events: none; }

.replay-video figcaption {
  position: absolute;
  left: 16px;
  bottom: 14px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(7, 9, 10, 0.7);
  color: #c9d2cc;
  font-size: 12px;
}

.replay .court-panel { height: auto; aspect-ratio: 16 / 9; }
.replay .court-controls { grid-column: 1 / -1; margin-top: 0; }

.engine-points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* Engine: interactive court */

.engine-points { list-style: none; padding: 0; margin: 28px 0 0; }
.engine-points li {
  position: relative;
  padding-left: 28px;
  margin: 0 0 14px;
  color: #c9d2cc;
}
.engine-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 2px solid var(--green);
  transform: rotate(45deg) scale(0.8);
}

.court-panel {
  position: relative;
  height: 520px;
  border: 1px solid var(--rule);
  border-radius: 28px;
  background: radial-gradient(90% 70% at 50% 40%, #0f1a15, #07090a);
  overflow: hidden;
}

.court-panel .court3d { position: absolute; inset: 0; cursor: grab; }
.court-panel .court3d:active { cursor: grabbing; }

.court-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: 20px;
  background: var(--surface);
}

.court-play {
  flex: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--green);
  cursor: pointer;
  position: relative;
}
/* pause bars */
.court-play::before, .court-play::after {
  content: "";
  position: absolute;
  top: 13px;
  width: 4px;
  height: 14px;
  border-radius: 2px;
  background: #07090a;
}
.court-play::before { left: 14px; }
.court-play::after { left: 22px; }
/* play triangle */
.court-play.is-paused::before {
  left: 16px;
  top: 12px;
  width: 0;
  height: 0;
  border-radius: 0;
  background: none;
  border-style: solid;
  border-width: 8px 0 8px 13px;
  border-color: transparent transparent transparent #07090a;
}
.court-play.is-paused::after { display: none; }

.court-track { position: relative; flex: 1 1 220px; height: 40px; }

.court-track input {
  position: absolute;
  inset: 0;
  width: 100%;
  margin: 0;
  accent-color: var(--green);
  cursor: pointer;
}

.court-marks { position: absolute; left: 8px; right: 8px; top: 0; height: 10px; pointer-events: none; }
.court-marks button {
  position: absolute;
  top: 0;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--label-color);
  box-shadow: 0 0 8px var(--label-color);
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.15s;
}
.court-marks button:hover { transform: scale(1.5); }

.court-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.court-chips button {
  padding: 5px 12px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.court-chips button:hover { color: var(--text); }
.court-chips button.is-active { color: #07090a; background: var(--text); border-color: var(--text); }

.court-hint {
  position: absolute;
  left: 18px;
  bottom: 16px;
  color: var(--muted);
  font-size: 13px;
  pointer-events: none;
}

.court-legend {
  position: absolute;
  right: 16px;
  top: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 70%;
  pointer-events: none;
}

.court-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(7, 9, 10, 0.7);
  border: 1px solid var(--rule);
  color: #c9d2cc;
  font-size: 12px;
}

.court-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--label-color);
  box-shadow: 0 0 8px var(--label-color);
}

/* Stats */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--rule);
  border-radius: 28px;
  background: var(--surface);
  overflow: hidden;
}

.stat { padding: 36px 28px; }
.stat + .stat { border-left: 1px solid var(--rule); }

.stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(36px, 4vw, 52px);
  line-height: 1;
  letter-spacing: -0.03em;
}

.stat span { display: block; margin-top: 12px; color: var(--muted); font-size: 15px; line-height: 1.5; }

.footnote { margin-top: 14px; color: var(--faint); font-size: 13px; }

/* Audiences and plans */

.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.card {
  padding: 28px 24px;
  border: 1px solid var(--rule);
  border-radius: 24px;
  background: linear-gradient(180deg, var(--surface-strong), rgba(255, 255, 255, 0.01));
  transition: transform 0.3s, border-color 0.3s;
}

.card:hover { transform: translateY(-4px); border-color: rgba(91, 228, 155, 0.35); }

.card, .plan, .step { position: relative; }
.card::after, .plan::after, .step::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), rgba(91, 228, 155, 0.12), transparent 60%);
}
.card:hover::after, .plan:hover::after, .step:hover::after { opacity: 1; }

.card svg { width: 30px; height: 30px; color: var(--green); }
.card h3 { font-size: 20px; margin: 18px 0 8px; }
.card h3 .tag { vertical-align: middle; margin-left: 6px; font-size: 12px; }
.card p { color: var(--muted); font-size: 15px; margin: 0; }

.plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 420px));
  gap: 20px;
}

.plan {
  padding: 32px 28px;
  border: 1px solid var(--rule);
  border-radius: 28px;
  background: var(--surface);
}

.plan.featured {
  border-color: rgba(242, 193, 78, 0.45);
  background: linear-gradient(180deg, rgba(242, 193, 78, 0.1), rgba(242, 193, 78, 0.02));
}

.plan-name { color: var(--muted); font-weight: 600; }
.plan-price {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 6px 0 4px;
}
.plan-unit { margin-left: 6px; font-size: 17px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan-sub { color: var(--muted); font-size: 14px; min-height: 1.6em; }
.plan li strong { color: var(--text); }
.plan ul { list-style: none; padding: 0; margin: 20px 0 0; }
.plan li { padding-left: 26px; position: relative; color: #c9d2cc; margin: 0 0 10px; }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 700; }
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(242, 193, 78, 0.16);
  color: var(--gold);
  font-size: 13px;
  font-weight: 600;
}

/* Final call to action */

.final {
  position: relative;
  margin-top: 120px;
  padding: 72px 24px 96px;
  text-align: center;
  overflow: hidden;
  background: radial-gradient(60% 80% at 50% 100%, rgba(45, 95, 63, 0.55), rgba(7, 9, 10, 0) 70%);
}

.final img {
  width: 150px;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.6));
  animation: float 5s ease-in-out infinite;
}

@keyframes float {
  50% { transform: translateY(-12px) rotate(-3deg); }
}

.final h2 { font-size: clamp(32px, 4.6vw, 54px); line-height: 1.1; margin: 20px 0 12px; }
.final p { color: var(--muted); font-size: 19px; margin: 0 0 32px; }
.final .actions { justify-content: center; }

/* Scroll reveal (only when JS runs) */

.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { transform: none; transition: opacity 0.4s; }
  .pulse, .final img { animation: none; }
  .phone-frame { transition: none; }
}

/* Layout breakpoints */

@media (max-width: 960px) {
  .film-cards { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .replay { grid-template-columns: 1fr; }
  .engine-points { grid-template-columns: 1fr; gap: 0; }
  .chapter-layout { grid-template-columns: 1fr; gap: 0; }
  .chapter-stage { display: none; }
  .chapter { min-height: 0; opacity: 1; padding: 40px 0; }
  .chapter .phone { display: flex; margin-top: 32px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--rule); }
  .court-panel { height: 420px; }
}

@media (max-width: 560px) {
  .section { padding: 88px 16px 0; }
  .chapter-index { margin: 0 -16px 8px; padding: 10px 16px; }
  .hero-content { padding: 100px 16px 0; }
  .cards, .plans { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .stat + .stat { border-left: 0; border-top: 1px solid var(--rule); }
  .court-panel { height: 360px; border-radius: 20px; }
  .btn { width: 100%; justify-content: center; }
}

/* Anchored jumps land below the sticky header and chapter index. */
.section[id] { scroll-margin-top: var(--bar-h); }
.chapter { scroll-margin-top: calc(var(--bar-h) + 69px); }
