/* ===================================================================
   HOME FLOW (2026-11-09): Experience the game -> numbers -> statement
   -> Beyond the score. Three surfaces (navy reel, ink numbers, paper
   sheet), one orange court line drawn through all of them as you read.
   Connected by the line, separate by surface.
   =================================================================== */

.fl {
  position: relative;
  --fl-x: max(20px, calc((100vw - var(--container-w)) / 2 + 12px));
  background: var(--ink);
  overflow-x: clip;
}

/* The court line: one SVG over the whole flow, path built in js/flow.js
   from where the pieces actually are. */
.fl-line {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 4;
  pointer-events: none;
  overflow: visible;
}
.fl-line-path {
  fill: none;
  stroke: var(--orange);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- 1. reel ---------- */
.fl-reel {
  position: relative;
  background: var(--navy);
  padding: 96px 0 0; /* film strip runs straight into the numbers section: no gap */
  overflow: hidden;
}
.fl-reel::before { /* the old outline type, kept as a watermark */
  content: 'EXPERIENCE THE GAME';
  position: absolute;
  left: 50%;
  top: 40px;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: clamp(5rem, 15vw, 15rem);
  font-weight: 900;
  letter-spacing: -0.05em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.07);
  pointer-events: none;
}
.fl-reel-head { position: relative; padding-left: 48px; }
.fl-eyebrow { margin-bottom: 14px; }
.fl-reel-title {
  font-size: clamp(2.1rem, 5vw, 4.4rem);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.035em;
  max-width: 14ch;
  color: #fff;
}
.fl-reel-title span { color: var(--orange); }
.fl-reel-meta {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--white-62);
}

/* Film strip: a photo roll that runs on its own (not tied to scroll)
   and stops while hovered. Frames sit back to back with a 3px film
   border. js/flow.js clones the frames once (aria-hidden) so the loop
   has no seam; -50% is exactly one set because every frame carries its
   own 3px margin (a flex gap would leave the seam 1.5px off).
   Reduced motion: no clone, no movement, swipe/scroll it by hand. */
.fl-strip {
  position: relative;
  margin-top: 40px;
  padding: 24px 0;
  background:
    radial-gradient(circle, var(--navy) 4px, transparent 4.5px) 0 6px / 26px 12px repeat-x,
    radial-gradient(circle, var(--navy) 4px, transparent 4.5px) 0 calc(100% - 6px) / 26px 12px repeat-x,
    #050E1C;
  overflow-x: auto;
  scrollbar-width: none;
}
.fl-strip::-webkit-scrollbar { display: none; }
.fl-strip-track {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  width: max-content;
}
.fl-frame { margin: 0; flex: none; padding: 0 8px; background: #050E1C; } /* blank gap between photos (16px); equal padding keeps -50% exact */
.fl-strip.is-rolling { overflow: hidden; }
.fl-strip.is-rolling .fl-strip-track {
  animation: fl-roll var(--roll-dur, 60s) linear infinite;
  will-change: transform;
}
.fl-strip.is-rolling:hover .fl-strip-track,
.fl-strip.is-rolling.is-held .fl-strip-track { animation-play-state: paused; }
@keyframes fl-roll { to { transform: translate3d(-50%, 0, 0); } }

.fl-frame figure { margin: 0; position: relative; }
.fl-frame-img {
  height: clamp(200px, 21vw, 310px);
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(110deg, var(--navy-2) 30%, #16345f 50%, var(--navy-2) 70%) 0 0 / 200% 100%;
}
.fl-frame--tall .fl-frame-img { aspect-ratio: 2 / 3; }
.fl-frame--wide .fl-frame-img { aspect-ratio: 3 / 2; }
.fl-frame-img img { width: 100%; height: 100%; max-width: none; object-fit: cover; display: block; transform: scale(1.04); transition: transform 0.8s var(--ease); }
.fl-frame:hover .fl-frame-img img { transform: scale(1.1); }
/* Caption printed on the frame, like edge code on film. */
.fl-frame figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 40px 14px 12px;
  background: linear-gradient(180deg, rgba(5, 14, 28, 0) 0%, rgba(5, 14, 28, 0.85) 100%);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  pointer-events: none;
}
.fl-frame-no { font-family: var(--font-mono); font-size: 12px; color: var(--orange); }

/* ---------- 2. numbers + statement ---------- */
.fl-numbers {
  position: relative;
  background: var(--ink);
  padding: 110px 0 120px;
}
.fl-stats {
  list-style: none;
  margin: 0;
  padding: 0 0 0 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}
.fl-stat { display: flex; flex-direction: column; }
.fl-stat-num {
  font-size: clamp(3.4rem, 7.6vw, 7.6rem);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 0.9;
  color: #fff;
  padding-bottom: 18px; /* the court line runs here */
  font-variant-numeric: tabular-nums;
}
.fl-stat-label {
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--white-62);
}
.fl-statement {
  margin: 120px 0 0;
  padding-left: 16px;
  max-width: 22ch;
  font-size: clamp(2rem, 4.6vw, 4.4rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: #fff;
}
.fl-statement em { font-style: normal; color: var(--orange); }
.fl-word { transition: none; }

/* ---------- 3. beyond ---------- */
.fl-beyond { position: relative; background: var(--ink); padding-top: 20px; }
.fl-sheet {
  background: var(--paper);
  color: var(--ink);
  border-radius: 44px 44px 0 0;
  padding: 120px 0 130px;
  transform-origin: 50% 0;
}
.fl-beyond-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 64px;
  align-items: center;
  padding-left: 48px;
}
.fl-beyond-copy .eyebrow { color: #B9461A; }
.fl-beyond-title {
  font-size: clamp(2.6rem, 6vw, 5.6rem);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 0.95;
  margin: 14px 0 26px;
  padding-bottom: 14px; /* the line ends under this */
}
.fl-beyond-copy .body-text { color: var(--ink-62); max-width: 46ch; }
.fl-btn {
  margin-top: 32px;
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  min-height: 52px;
  padding: 0 26px;
  display: inline-flex;
  align-items: center;
}
.fl-btn:hover { background: var(--orange); }

/* Deck: five photos stacked, fanned open by scroll (js/flow.js). */
.fl-deck {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
  height: clamp(340px, 46vw, 560px);
}
.fl-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58%;
  aspect-ratio: 4 / 5;
  border-radius: 18px;
  overflow: hidden;
  border: 6px solid #fff;
  box-shadow: 0 30px 50px -24px rgba(8, 24, 47, 0.45);
  transform: translate(-50%, -50%) rotate(calc((var(--i) - 2) * 7deg * var(--fan, 1))) translateX(calc((var(--i) - 2) * 28% * var(--fan, 1)));
  scale: var(--pop, 1);
  transition: box-shadow 0.3s;
  cursor: pointer;
}
.fl-card:hover { box-shadow: 0 40px 60px -24px rgba(8, 24, 47, 0.6); }
.fl-deck { --fan: 1; }
.fl-card img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- phone ---------- */
@media (max-width: 768px) {
  .fl { --fl-x: 16px; }
  .fl-reel { padding: 72px 0 0; overflow: hidden; overflow: clip; } /* film strip runs straight into the numbers: no navy gap under it; clip so the 3000px track can never widen the page on iOS */
  .fl { overflow-x: clip; }
  .fl-reel::before { font-size: 22vw; top: 30px; }
  .fl-reel-head, .fl-stats, .fl-statement, .fl-beyond-grid { padding-left: 34px; padding-right: 20px; }
  .fl-reel-head { padding-left: 34px; }
  .fl-strip { margin-top: 28px; }
  .fl-frame-img { height: 260px; }
  .fl-frame--wide .fl-frame-img { aspect-ratio: 4 / 3; }
  .fl-numbers { padding: 72px 0 80px; }
  .fl-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 40px; }
  .fl-stat-num { font-size: 3.4rem; }
  .fl-stat-label { font-size: 11.5px; }
  .fl-statement { margin-top: 72px; font-size: 1.9rem; }
  .fl-sheet { border-radius: 28px 28px 0 0; padding: 72px 0 80px; }
  .fl-beyond-grid { grid-template-columns: 1fr; gap: 40px; }
  .fl-deck { height: 360px; }
  .fl-card { width: 62%; }
}

@media (prefers-reduced-motion: reduce) {
  .fl-frame-img img { transition: none; transform: none; }
}


/* ===================================================================
   BACKGROUNDS (2026-11-25): the flow used to be flat navy / flat ink.
   Now: grain on every dark ground, a floodlight glow behind the reel
   head, a drifting navy+orange mesh and a faint pickleball court
   behind the numbers. Layers are pseudo-elements; js/flow.js nudges
   --gy on scroll. Reduced motion: no drift, no scroll nudge.
   =================================================================== */
.fl-reel, .fl-numbers, .fl-beyond {
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .55 0'/></filter><rect width='180' height='180' filter='url(%23n)' opacity='.09'/></svg>");
}
.fl-reel {
  background:
    var(--grain),
    radial-gradient(ellipse 60% 70% at 18% 8%, rgba(255, 138, 61, 0.20), transparent 62%),
    radial-gradient(ellipse 50% 60% at 92% 100%, rgba(40, 110, 220, 0.28), transparent 65%),
    linear-gradient(180deg, #0c2a52 0%, var(--navy) 55%, #07172e 100%);
}
.fl-reel-head, .fl-strip { z-index: 1; }

.fl-numbers {
  isolation: isolate;
  overflow: hidden;
  background:
    var(--grain),
    linear-gradient(180deg, #07172e 0%, var(--ink) 40%, #060f1f 100%);
}
.fl-numbers::before { /* drifting mesh */
  content: '';
  position: absolute;
  inset: -25% -10%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 38% 34% at 20% 30%, rgba(255, 106, 26, 0.26), transparent 70%),
    radial-gradient(ellipse 42% 40% at 78% 24%, rgba(38, 104, 214, 0.34), transparent 70%),
    radial-gradient(ellipse 40% 36% at 62% 82%, rgba(255, 138, 61, 0.16), transparent 70%);
  transform: translate3d(0, var(--gy, 0px), 0);
  animation: fl-drift 26s ease-in-out infinite alternate;
}
.fl-numbers::after { /* faint pickleball court: outline, net, kitchen lines */
  content: '';
  position: absolute;
  inset: 8% 4%;
  z-index: -1;
  pointer-events: none;
  opacity: 0.9;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 440 200' fill='none' stroke='white' stroke-opacity='.07' stroke-width='1.2' preserveAspectRatio='xMidYMid meet'><rect x='10' y='10' width='420' height='180'/><path d='M220 10V190M130 10V190M310 10V190M130 100H310'/></svg>") center / contain no-repeat;
  transform: translate3d(0, calc(var(--gy, 0px) * -0.5), 0);
}
@keyframes fl-drift {
  from { translate: -2.5% 0; }
  to { translate: 2.5% 3%; }
}
.fl-numbers .container { position: relative; z-index: 1; }
.fl-beyond { background: var(--grain), var(--ink); }
@media (prefers-reduced-motion: reduce) {
  .fl-numbers::before { animation: none; }
}


/* PHONE: the reel never stops. iOS leaves :hover stuck after a tap and
   the pointerdown "hold" in flow.js fires on every touch, so a thumb
   resting on the reel (or just scrolling past) froze it. On phones the
   film runs whatever you touch. */
@media (max-width: 768px) {
  .fl-strip.is-rolling:hover .fl-strip-track,
  .fl-strip.is-rolling.is-held .fl-strip-track { animation-play-state: running; }
  .fl-strip { touch-action: pan-y; }
}
