/* The Sounds switch with the mixer that follows the scroll. Colours in :root (the Playground palette): the near black
   of the page, the warm white of the words, one accent for each sport. The script writes --v (the volume of the
   section, 0 to 1) on every section and strip, and --live (the accent of the loudest section) on the mixer. GSAP moves
   .sound__knob (x) and squashes .sound__ball inside it; the CSS styles both. */
:root {
  --page: #0b0c0e;          /* the near black of the page */
  --page-2: #121418;        /* the lifted black of the cards */
  --ink: #f2efe9;           /* the warm white of the words */
  --soft: #8d8f94;          /* the small grey words */
  --ride: #8ef0cf;          /* ride: mint */
  --court: #d8f25e;         /* court: ball yellow */
  --swim: #7cc4ff;          /* swim: pool blue */
  --run: #ff9b52;           /* run: track orange */
  --glass: rgba(24, 26, 31, 0.56); /* the frosted glass of the mixer */
  --ease-smooth: cubic-bezier(.32, .72, 0, 1); /* the site's switch curve */
  --ease-out-expo: cubic-bezier(.19, 1, .22, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--page); }
html, body { overflow-x: clip; }
body {
  --pad: clamp(14px, 3.2vw, 44px);
  --mw: clamp(196px, 23vw, 300px);
  background: var(--page);
  color: var(--ink);
  font-family: 'Inter Tight Variable', 'Inter Tight', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
/* a veil of grain over everything, still */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0.07;
  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='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ------------------------------------------------ the club mark, fixed */
.brand {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 6;
  padding: var(--pad) var(--pad) 26px;
  background: linear-gradient(180deg, var(--page) 0%, var(--page) 62%, color-mix(in srgb, var(--page) 70%, transparent) 82%, transparent);
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(11px, 1vw, 13px);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.brand__mark { width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.brand__name em { font-style: normal; font-weight: 400; color: var(--soft); }

/* ------------------------------------------------ the four sections */
.sport {
  --v: 0;
  position: relative;
  height: 100vh;
  overflow: hidden;
  padding: calc(var(--pad) + 34px) var(--pad) var(--pad);
  isolation: isolate;
  background:
    radial-gradient(70% 60% at 82% 38%, color-mix(in srgb, var(--accent) calc(4% + var(--v) * 9%), transparent), transparent 70%),
    linear-gradient(180deg, var(--page), #0d0f12);
}
.sport + .sport { border-top: 1px solid rgba(255, 255, 255, 0.05); }

/* the thin lines of each sport, behind: a wheel, a court, the lanes, a track */
.sport__lines {
  position: absolute;
  z-index: -1;
  top: 50%;
  right: -8%;
  width: min(118vh, 92vw);
  height: min(118vh, 92vw);
  translate: 0 -50%;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  opacity: calc(0.07 + var(--v) * 0.16);
}
.sport__lines * { vector-effect: non-scaling-stroke; }
.sport__net { stroke-width: 2; }
.sport__dash { stroke-dasharray: 6 10; }

.sport__head { position: relative; max-width: min(760px, 100%); }
.sport__tag {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: clamp(11px, 1.05vw, 14px);
  font-weight: 500;
  color: var(--soft);
}
.sport__time {
  padding: 2px 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 99px;
  color: var(--accent);
  font-family: 'Geist Mono Variable', ui-monospace, monospace;
  font-size: 0.86em;
}
.sport__title {
  margin-top: clamp(6px, 1.2vh, 14px);
  font-family: 'Big Shoulders Display Variable', 'Big Shoulders Display', Impact, sans-serif;
  font-weight: 800;
  font-size: min(30vw, 30vh, 300px);
  line-height: 0.84;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.sport__title .ch { display: inline-block; transform-origin: 0 100%; }
.sport__title .ch:last-child { color: var(--accent); }
.sport__line {
  margin-top: clamp(8px, 1.6vh, 18px);
  max-width: 34ch;
  font-size: clamp(12.5px, 1.35vw, 18px);
  line-height: 1.38;
  color: color-mix(in srgb, var(--ink) 76%, transparent);
}

.sport__stats {
  position: absolute;
  left: var(--pad);
  bottom: var(--pad);
  display: flex;
  gap: clamp(10px, 2.4vw, 40px);
  max-width: calc(100vw - var(--mw) - var(--pad) * 3);
}
.sport__stats div { border-left: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); padding-left: 10px; }
.sport__stats dt { font-size: clamp(10px, 0.9vw, 12px); color: var(--soft); }
.sport__stats dd {
  margin-top: 2px;
  font-family: 'Big Shoulders Display Variable', 'Big Shoulders Display', Impact, sans-serif;
  font-weight: 700;
  font-size: clamp(18px, 2.6vw, 34px);
  line-height: 1;
}
@media (max-width: 620px) {
  .sport__stats { flex-direction: column; gap: 8px; }
}

/* ------------------------------------------------ the mixer, fixed in the corner */
.mixer {
  --live: var(--ride);
  position: fixed;
  right: var(--pad);
  bottom: var(--pad);
  z-index: 6;
  width: var(--mw);
  padding: clamp(10px, 1.1vw, 14px);
  border-radius: clamp(16px, 1.6vw, 22px);
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02) 46%, rgba(255, 255, 255, 0.04)),
    var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3),
    0 1px 2px rgba(0, 0, 0, 0.4),
    0 10px 24px -8px rgba(0, 0, 0, 0.6),
    0 30px 60px -20px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  isolation: isolate;
}
.mixer__grain {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.12;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* the light on the top edge takes the colour of the loudest section */
.mixer__shine {
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  z-index: 1;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--live) 80%, white), transparent);
  opacity: 0.35;
  transition: opacity 0.4s ease;
}
.mixer.is-on .mixer__shine { opacity: 0.9; }

.mixer__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mixer__name { font-size: clamp(11px, 0.95vw, 13px); font-weight: 600; white-space: nowrap; }
.mixer__state {
  margin-left: 4px;
  font-family: 'Geist Mono Variable', ui-monospace, monospace;
  font-size: 0.8em;
  font-weight: 400;
  color: var(--soft);
  transition: color 0.3s ease;
}
.mixer.is-on .mixer__state { color: var(--live); }

/* the Sounds switch: the words swap on hover like the site's, the ball slides on a spring */
.sound {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 8px;
  border: 0;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  color: var(--ink);
  font: inherit;
  font-size: clamp(11px, 0.95vw, 13px);
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}
.sound::after { content: ''; position: absolute; inset: -10px -8px; }
.sound:focus-visible { outline: 1px solid var(--live); outline-offset: 3px; }
.sound__words { position: relative; display: block; }
.sound__text { display: block; white-space: nowrap; }
.sound__text--b { position: absolute; inset: 0; }
.sound__text .c { display: inline-block; transition: translate 0.6s var(--ease-out-expo), transform 0.25s ease-out, opacity 0.15s ease-out; }
.sound__text--b .c { translate: 18px 0 0; transform: skew(-14deg); opacity: 0; }
@media (hover: hover) {
  .sound:hover { background: rgba(255, 255, 255, 0.07); }
  .sound:hover .sound__text--a .c { translate: -18px 0 0; transform: skew(-14deg); opacity: 0; transition-delay: calc(var(--i) * 22ms); }
  .sound:hover .sound__text--b .c {
    translate: 0 0 0; transform: skew(0); opacity: 1;
    transition: translate 0.6s calc(var(--i) * 22ms) var(--ease-out-expo), transform 0.25s calc(var(--i) * 29ms) ease-out, opacity 0.15s calc(var(--i) * 22ms) ease-out;
  }
}
.sound__track {
  position: relative;
  display: block;
  width: 34px;
  height: 18px;
  border-radius: 99px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22), inset 0 1px 3px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.sound__fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, color-mix(in srgb, var(--live) 100%, white 10%), color-mix(in srgb, var(--live) 85%, black));
  opacity: 0;
  transition: opacity 0.15s ease-out;
}
.sound[aria-pressed='true'] .sound__fill { opacity: 1; }
.sound__knob { position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; display: block; }
.sound__ball {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff, #d9dce1 55%, #a3a8b0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 0 0 0.5px rgba(0, 0, 0, 0.2);
  transition: background 0.15s ease-out;
}
.sound[aria-pressed='true'] .sound__ball { background: radial-gradient(circle at 35% 30%, #3a3d44, #15171b 60%, #0b0c0e); }

/* the four strips */
.mixer__strips {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-top: clamp(8px, 1vw, 12px);
}
.strip {
  --v: 0;
  --lit: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 0 5px;
  border-radius: 10px;
  isolation: isolate;
}
/* the loudest section lights its strip */
.strip__glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 16%, transparent), color-mix(in srgb, var(--accent) 4%, transparent));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
  opacity: var(--lit);
}
.strip__num {
  font-family: 'Geist Mono Variable', ui-monospace, monospace;
  font-size: clamp(10px, 0.95vw, 13px);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: color-mix(in srgb, var(--ink) calc(45% + var(--lit) * 55%), transparent);
}
.strip__meter {
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
  width: clamp(14px, 1.5vw, 20px);
  height: clamp(56px, 13vh, 118px);
  margin: 6px 0 6px;
}
.strip__meter i {
  flex: 1;
  border-radius: 1.5px;
  background: rgba(255, 255, 255, 0.07);
}
.strip__meter i.on { background: color-mix(in srgb, var(--ink) 82%, var(--accent)); }
.strip__meter i.hot.on { background: var(--accent); box-shadow: 0 0 6px color-mix(in srgb, var(--accent) 50%, transparent); }
.strip__meter i.peak { background: var(--accent); }
.strip__name {
  font-size: clamp(10.5px, 0.95vw, 13px);
  font-weight: 600;
  line-height: 1.1;
  color: color-mix(in srgb, var(--ink) calc(55% + var(--lit) * 45%), transparent);
}
.strip__sub {
  font-family: 'Geist Mono Variable', ui-monospace, monospace;
  font-size: clamp(8.5px, 0.75vw, 10px);
  line-height: 1.2;
  color: color-mix(in srgb, var(--accent) calc(40% + var(--lit) * 60%), var(--soft));
}
/* the map of the page: the four triangles side by side and a hairline where the scroll is */
.mixer__map { display: block; width: 100%; height: clamp(14px, 1.8vh, 22px); margin-top: 8px; overflow: hidden; }
.mixer__map path, .mixer__map line { fill: none; vector-effect: non-scaling-stroke; }
.mixer__base { stroke: rgba(255, 255, 255, 0.12); stroke-width: 1; }
.mixer__tri { stroke-width: 1.25; stroke-linejoin: round; opacity: 0.35; transition: opacity 0.3s ease; }
.mixer__tri.is-live { opacity: 1; }
.mixer__head { stroke: var(--ink); stroke-width: 1; opacity: 0.8; }
/* with the sounds off the strips still move, fainter and greyer */
.mixer:not(.is-on) .strip__meter { opacity: 0.55; filter: saturate(0.35); }
.mixer .strip__meter { transition: opacity 0.4s ease, filter 0.4s ease; }

@media (prefers-reduced-motion: reduce) {
  .sound__text .c, .sound:hover .sound__text .c { transition: opacity 0.2s ease !important; translate: none !important; transform: none !important; }
}
