/* Red Clay Open. Palette sampled from Omar Saeed's illustration. */
:root {
  --oxblood: #7a0b1a;
  --crimson: #d30524;
  --disc-dark: #66101a;
  --disc-lit: #9a3a29;
  --ball: #e98f1c;
  --ball-deep: #e2621f;
  --ball-shade: #ca3921;
  --clay: #b4472a;
  --clay-dark: #8f3420;
  --cream: #f1eadb;
  --cream-dim: #d9cfbb;
  --ink: #0d0b0c;
  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Inter Tight", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  --vh: 1vh;
}

* { box-sizing: border-box; }
html { background: var(--oxblood); -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0;
  background: var(--oxblood);
  color: var(--cream);
  font: 400 17px/1.5 var(--sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; }
h2 {
  margin: 0;
  font: 800 clamp(48px, 7.4vw, 124px)/0.9 var(--display);
  text-transform: uppercase;
  letter-spacing: -0.01em;
}
h2 em { text-transform: none; letter-spacing: -0.02em; font-size: 0.92em; }
.eyebrow {
  display: inline-block;
  font: 600 12px/1 var(--sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

/* film grain over everything, matches the printed texture of the art */
.grain {
  position: fixed; inset: -50%;
  z-index: 60; pointer-events: none;
  background-image: url("../assets/grain.png");
  background-size: 256px 256px;
  opacity: 0.16;
  mix-blend-mode: overlay;
  animation: grain 0.6s steps(3) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-61px, 37px); }
  66% { transform: translate(43px, -89px); }
  100% { transform: translate(0, 0); }
}

/* the one real-time 3D object: the ball, travelling the whole page */
#ball3d {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  z-index: 40; pointer-events: none;
}
.ballshadow {
  position: fixed; left: 0; top: 0;
  width: 100px; height: 100px;
  z-index: 39; pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(40, 6, 4, 0.55), rgba(40, 6, 4, 0));
  opacity: 0;
  transform-origin: 0 0;
  will-change: transform, opacity;
}

/* nav */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 20px var(--gutter);
  transition: transform 0.5s cubic-bezier(.2,.7,.2,1), color 0.4s;
}
.nav.is-hidden { transform: translateY(-110%); }
.nav.on-light { color: var(--ink); }
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
  font: 800 22px/1 var(--display);
  text-transform: uppercase; letter-spacing: 0.02em;
}
.brand-ball { width: 26px; height: 26px; }
.brand-ball circle { fill: var(--ball); }
.brand-ball path { fill: none; stroke: var(--cream); stroke-width: 2.4; stroke-linecap: round; }
.nav-links { display: flex; gap: 32px; }
.nav-links a {
  text-decoration: none;
  font: 500 14px/1 var(--sans);
  letter-spacing: 0.04em;
  opacity: 0.85;
}
.nav-links a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 5px; }
.pill {
  display: inline-flex; align-items: center;
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--cream); color: var(--ink);
  text-decoration: none;
  font: 600 14px/1 var(--sans);
  letter-spacing: 0.02em;
  transition: transform 0.25s, background 0.25s;
}
.pill:hover { transform: translateY(-2px); background: #fff; }
.nav.on-light .pill { background: var(--ink); color: var(--cream); }
.pill-lg { padding: 18px 30px; font-size: 16px; }

/* ---------- 1+2 hero and serve ---------- */
.serve { position: relative; height: 340vh; }
.serve-sticky {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  overflow: hidden;
}
.sky {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, var(--oxblood) 0%, #a5081f 30%, var(--crimson) 52%, var(--crimson) 100%);
}
.layer { position: absolute; inset: 0; will-change: transform; }

/* the stage is the 1350x1800 plate every clip was generated on */
.stage-poster, .stage-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.stage-poster { opacity: 1; transition: opacity 0.4s; }
.stage.is-live .stage-poster { opacity: 0; }
#serveCanvas { opacity: 0; }

/* disc sits where it sits in the art: centre (684, 1131), r 387 on the 1350x1800 plate */
.stage, .stage-box {
  position: absolute; bottom: 0; left: 50%;
  height: 100%;
  aspect-ratio: 3 / 4;
  transform: translateX(-50%);
}
.disc {
  position: absolute;
  left: 22%; top: 41.33%; width: 57.33%;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(120% 120% at 70% 18%, rgba(255, 140, 90, 0.38), rgba(255, 140, 90, 0) 45%),
    radial-gradient(90% 90% at 30% 75%, var(--disc-dark), rgba(102, 16, 26, 0) 70%),
    linear-gradient(200deg, #b01e24 0%, #8d1a1e 45%, #6c1219 100%);
  box-shadow: inset -30px -40px 80px rgba(60, 4, 10, 0.35);
}

.title {
  position: absolute; left: 0; right: 0; top: 50%;
  transform: translateY(-62%);
  display: flex; flex-direction: column; align-items: center;
  color: var(--cream);
  pointer-events: none;
  user-select: none;
}
.title-kicker {
  font: italic 400 clamp(36px, 7vw, 120px)/1 var(--serif);
  margin-bottom: -0.12em;
  align-self: center;
  transform: translateX(-24vw);
}
.title-open {
  font: 900 clamp(150px, 36vw, 640px)/0.8 var(--display);
  letter-spacing: -0.01em;
}

.hero-ui {
  position: absolute; inset: auto var(--gutter) 30px var(--gutter);
  display: flex; justify-content: space-between; align-items: flex-end;
  z-index: 5;
  transition: opacity 0.4s;
}
.hero-date { display: flex; flex-direction: column; gap: 4px; max-width: 280px; text-shadow: 0 2px 22px rgba(90, 0, 14, 0.6); }
.hero-date .eyebrow { margin-bottom: 8px; }
.hero-date strong { font: 800 clamp(30px, 3.2vw, 46px)/1 var(--display); text-transform: uppercase; }
.hero-date span:last-child { font-size: 14px; opacity: 0.85; }
.hero-cue {
  display: flex; align-items: center; gap: 12px;
  font: 600 12px/1 var(--sans); letter-spacing: 0.18em; text-transform: uppercase;
}
.cue-ball {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--ball);
  animation: cue 1.4s cubic-bezier(.5,0,.5,1) infinite;
}
@keyframes cue {
  0%, 100% { transform: translateY(-10px); }
  50% { transform: translateY(6px) scale(1.12, 0.86); }
}

.serve-caption {
  position: absolute; left: var(--gutter); bottom: 30px;
  display: flex; gap: 18px;
  font: 900 clamp(40px, 5vw, 80px)/0.95 var(--display);
  text-transform: uppercase;
  z-index: 5;
}
.serve-caption span { opacity: 0.12; transition: opacity 0.3s, transform 0.3s; transform: translateX(-6px); }
.serve-caption span.on { opacity: 1; transform: none; }

.ball-wipe {
  position: absolute; inset: 0;
  background: var(--ball);
  opacity: 0;
  z-index: 6;
  pointer-events: none;
}

/* ---------- 3 numbers ---------- */
.numbers {
  position: relative;
  background: var(--ball);
  color: var(--ink);
  padding: clamp(120px, 16vh, 200px) var(--gutter) clamp(100px, 14vh, 180px);
}
.numbers-lead {
  margin: 0 0 clamp(60px, 9vh, 110px);
  max-width: 15ch;
  font: 800 clamp(44px, 6.4vw, 108px)/0.92 var(--display);
  text-transform: uppercase;
}
.numbers-lead em { text-transform: none; font-size: 0.95em; }
.numbers-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 2px solid var(--ink);
}
.num { padding: 26px 24px 0 0; display: flex; flex-direction: column; gap: 10px; }
.num + .num { border-left: 2px solid var(--ink); padding-left: 24px; }
.num b { font: 900 clamp(84px, 11vw, 190px)/0.82 var(--display); font-variant-numeric: tabular-nums; }
.num span { font-size: 16px; max-width: 18ch; }

/* ---------- 4 the week ---------- */
.week {
  position: relative;
  background:
    radial-gradient(140% 60% at 50% 0%, rgba(0,0,0,0.0), rgba(60,12,4,0.35) 100%),
    var(--clay);
  padding: clamp(120px, 16vh, 200px) var(--gutter) clamp(140px, 20vh, 240px);
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(40px, 6vw, 120px);
}
.court { position: absolute; inset: 0; pointer-events: none; }
.court-lines {
  position: absolute; left: 50%; top: 0;
  height: 100%; width: min(100%, 1100px);
  transform: translateX(-50%);
  opacity: 0.5;
}
.court-lines path {
  fill: none; stroke: var(--cream);
  stroke-width: 0.35; vector-effect: non-scaling-stroke;
  stroke-dasharray: 1; stroke-dashoffset: 1;
}
.court-lines path { stroke-width: 3px; }
.court-lines .net { stroke-dasharray: 0.004 0.006; stroke-width: 6px; opacity: 0.8; }
.week-head { position: relative; align-self: start; position: sticky; top: 22vh; }
.week-head p { max-width: 34ch; margin-top: 24px; font-size: 18px; }
.days { list-style: none; margin: 0; padding: 0; position: relative; }
.day {
  display: grid;
  grid-template-columns: 7.5ch 1fr;
  grid-template-areas: "date round" "date note";
  column-gap: 26px;
  padding: 34px 0 34px 0;
  border-bottom: 2px solid rgba(241, 234, 219, 0.4);
  position: relative;
}
.day::after {
  /* bounce mark: where the ball lands for this day */
  content: ""; position: absolute; right: 6%; top: 50%;
  width: 46px; height: 14px; border-radius: 50%;
  background: rgba(241, 234, 219, 0.0);
  transform: translateY(-50%) scale(0.6);
  transition: background 0.3s, transform 0.3s;
}
.day:nth-child(even)::after { right: 30%; }
.day.hit::after { background: rgba(241, 234, 219, 0.32); transform: translateY(-50%) scale(1); }
.d-date { grid-area: date; font: 800 34px/1 var(--display); text-transform: uppercase; padding-top: 2px; }
.d-round { grid-area: round; font: 800 clamp(34px, 3.6vw, 56px)/0.95 var(--display); text-transform: uppercase; }
.d-note { grid-area: note; font-size: 16px; opacity: 0.85; margin-top: 6px; }
.day.final .d-round { color: var(--ball); }

/* ---------- 5 anatomy ---------- */
.anatomy { position: relative; height: 420vh; background: var(--crimson); }
.anatomy-sticky {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  overflow: hidden;
  background: linear-gradient(180deg, var(--oxblood), var(--crimson) 55%);
}
.anatomy-head { position: absolute; left: var(--gutter); top: clamp(90px, 13vh, 140px); z-index: 2; }
.strip {
  position: absolute; left: 0; bottom: 0;
  height: 62%;
  display: flex; align-items: flex-end;
  gap: clamp(10px, 2vw, 40px);
  padding-left: 46vw;
  will-change: transform;
}
.pose {
  position: relative; margin: 0;
  height: 100%;
  aspect-ratio: 3 / 4;
  flex: none;
}
.pose img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; object-position: bottom;
  transition: transform 0.6s cubic-bezier(.2,.7,.2,1);
}
.pose-disc {
  position: absolute; left: 50%; bottom: 18%;
  width: 62%; aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: linear-gradient(200deg, #b01e24, #6c1219);
}
.pose figcaption {
  position: absolute; left: 6%; top: 4%;
  font: 900 clamp(34px, 4vw, 64px)/0.9 var(--display);
  text-transform: uppercase;
}
.pose figcaption b { display: block; font: 600 13px/1 var(--sans); letter-spacing: 0.18em; margin-bottom: 8px; color: var(--ball); }
.strip-progress {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: 26px;
  height: 2px; background: rgba(241, 234, 219, 0.25);
}
.strip-progress span { display: block; height: 100%; width: 0; background: var(--cream); }

/* ---------- 6 centre court ---------- */
.centre {
  position: relative;
  min-height: 100vh;
  display: flex; align-items: flex-end;
  overflow: hidden;
  background: var(--clay-dark);
}
.centre-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.centre::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(40, 6, 8, 0.75) 0%, rgba(40, 6, 8, 0) 55%);
}
.centre-copy { position: relative; z-index: 1; padding: 0 var(--gutter) clamp(60px, 10vh, 120px); }
.centre-copy p { max-width: 40ch; margin-top: 22px; font-size: 18px; }

/* ---------- 7 tickets ---------- */
.tickets {
  background: var(--cream); color: var(--ink);
  padding: clamp(110px, 15vh, 180px) var(--gutter) clamp(110px, 15vh, 180px);
}
.tickets-head { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 60px; align-items: end; margin-bottom: clamp(50px, 8vh, 90px); }
.tickets-head .eyebrow { grid-column: 1 / -1; margin: 0; }
.tickets-head p { max-width: 38ch; font-size: 18px; margin: 0; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(14px, 1.6vw, 26px); perspective: 1200px; }
.card {
  position: relative;
  min-height: 420px;
  padding: 30px 28px;
  border-radius: 22px;
  display: flex; flex-direction: column;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(.2,.7,.2,1), box-shadow 0.5s;
  box-shadow: 0 1px 0 rgba(0,0,0,0.05);
  cursor: pointer;
  overflow: hidden;
}
.card:hover { box-shadow: 0 40px 60px -30px rgba(70, 10, 10, 0.55); }
.card h3 { margin: auto 0 12px; font: 900 clamp(46px, 4.4vw, 72px)/0.88 var(--display); text-transform: uppercase; transform: translateZ(30px); }
.card p { margin: 0 0 26px; font-size: 16px; max-width: 30ch; transform: translateZ(20px); }
.card-tag { font: 600 12px/1 var(--sans); letter-spacing: 0.18em; text-transform: uppercase; }
.card-cta {
  align-self: flex-start;
  font: 600 14px/1 var(--sans);
  padding: 12px 18px; border-radius: 999px;
  border: 2px solid currentColor;
  transform: translateZ(26px);
}
.card::before {
  /* a ball that rolls in on hover */
  content: ""; position: absolute; right: 26px; top: 26px;
  width: 64px; height: 64px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffc55a, var(--ball) 40%, var(--ball-shade) 100%);
  transform: translateX(140px) rotate(180deg);
  transition: transform 0.6s cubic-bezier(.2,.7,.2,1);
}
.card:hover::before { transform: none; }
.c-early { background: var(--crimson); color: var(--cream); }
.c-mid { background: var(--ink); color: var(--cream); }
.c-final { background: var(--ball); color: var(--ink); }
.c-final::before { background: radial-gradient(circle at 35% 30%, #fff1d6, var(--cream) 45%, var(--cream-dim) 100%); }

/* ---------- 8 sunset footer ---------- */
.sunset {
  position: relative;
  min-height: 110vh;
  overflow: hidden;
  background: linear-gradient(180deg, var(--crimson) 0%, #a3091f 50%, var(--oxblood) 100%);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 0 var(--gutter) 36px;
}
.sunset-disc {
  position: absolute; left: 50%; top: 18vh;
  width: min(62vw, 70vh); aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: linear-gradient(200deg, #b01e24 0%, #8d1a1e 45%, #6c1219 100%);
}
.sunset-copy { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; margin-bottom: 70px; }
.sunset-copy h2 { font-size: clamp(70px, 12vw, 210px); }
.credits {
  position: relative; z-index: 1;
  display: flex; justify-content: space-between; gap: 30px;
  border-top: 1px solid rgba(241, 234, 219, 0.3);
  padding-top: 20px;
  font-size: 13px; opacity: 0.8;
}
.credits p { margin: 0; max-width: 60ch; }

/* ---------- small screens ---------- */
@media (max-width: 820px) {
  .nav-links { display: none; }
  .stage, .stage-box { height: auto; width: 128vw; }
  .title { top: 46%; }
  .title-kicker { transform: translateX(-18vw); }
  .title-open { font-size: 44vw; }
  .hero-ui { bottom: 22px; }
  .hero-cue { display: none; }
  .serve-caption { bottom: 26px; gap: 14px; font-size: 34px; }
  .centre-video { object-position: 68% 50%; }
  .numbers-grid { grid-template-columns: 1fr 1fr; }
  .num:nth-child(3) { border-left: 0; padding-left: 0; }
  .num:nth-child(n+3) { border-top: 2px solid var(--ink); margin-top: 26px; }
  .week { grid-template-columns: 1fr; }
  .week-head { position: relative; top: 0; }
  .day::after { right: 0; }
  .strip { height: 62%; padding-left: 70vw; }
  .tickets-head { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .card { min-height: 300px; }
  .sunset-copy { flex-direction: column; align-items: flex-start; }
  .credits { flex-direction: column; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .grain, .cue-ball { animation: none; }
}
