/* ============================================================
 * site.css: layout and motion for every public page. Colors come from
 * theme.css (built from content.json), never typed here.
 *
 * TABLE OF CONTENTS
 *   1. Tokens and font
 *   2. Base            reset, type, focus, skip link
 *   3. Floating menu   pill at the top, mobile panel, feature switches
 *   4. Buttons
 *   5. Hero            white room, stars canvas, copy, scene
 *   6. Scene art       silhouettes and their motion
 *   7. Pages           sections, cards, lists, video, articles
 *   8. Forms and consult dialog
 *   9. Motion          reveal on scroll, reduced-motion off switch
 *  10. Sequenced sale  popups, tick, confetti, gift box
 *  11. Policies        legal pages, notes, footer operator line
 *
 * Security notes: no url() to other origins, no @import.
 * ============================================================ */

/* ---------- 1. Tokens and font ---------- */
@font-face { font-family: "Bebas Neue"; src: url("/fonts/bebas-neue-latin.woff2") format("woff2"); font-display: swap; }
:root {
  --space-1: .5rem; --space-2: 1rem; --space-3: 1.5rem; --space-4: 2.5rem; --space-5: 4rem;
  --radius: 18px;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  --display: "Bebas Neue", "Arial Narrow", Impact, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --max: 70rem;
  --edge: color-mix(in srgb, var(--ink) 12%, transparent);
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1.0625rem/1.55 var(--body); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: .01em; line-height: 1.02; margin: 0 0 var(--space-2); }
h1 { font-size: clamp(2.75rem, 8vw, 5rem); }
h2 { font-size: clamp(2rem, 5vw, 3rem); }
h3 { font-size: 1.6rem; }
p { margin: 0 0 var(--space-2); max-width: 65ch; }
a { color: inherit; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.skip { position: absolute; left: -999px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: var(--space-1) var(--space-2); border-radius: 8px; }
.skip:focus { left: var(--space-2); top: var(--space-1); }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* ---------- 3. Floating menu ---------- */
.float { position: fixed; top: 12px; left: 0; right: 0; z-index: 30; display: flex; justify-content: center; padding: 0 12px; pointer-events: none; }
.pill { pointer-events: auto; display: flex; align-items: center; gap: var(--space-2); width: 100%; max-width: 62rem; padding: 8px 10px 8px 16px; border: 1px solid var(--edge); border-radius: 999px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 14px 40px -22px color-mix(in srgb, var(--ink) 55%, transparent); }
.brand { display: flex; align-items: center; gap: 8px; margin-right: auto; text-decoration: none; font-family: var(--display); font-size: 1.35rem; white-space: nowrap; }
/* Full name stacked like the logo: short name on top, the rest underneath. */
.brand .name { display: flex; flex-direction: column; line-height: 1; }
.brand .sub { font-size: .62em; letter-spacing: .04em; }
.links { display: none; }
.links a { text-decoration: none; font-size: .95rem; color: var(--muted); padding: 10px 4px; white-space: nowrap; transition: color .2s; }
.links a:hover, .links a[aria-current="page"] { color: var(--ink); }
.links a[aria-current="page"] { box-shadow: inset 0 -2px var(--accent); }
/* Close button exists only inside the open phone menu. Two classes so the shared button style below cannot override it. */
.links .menu-close { display: none; }
/* Pages switched on and off from /dev. Shop and Sign in start hidden. */
[data-feature="shop"], [data-feature="signin"] { display: none !important; }
html.feat-shop .links [data-feature="shop"], html.feat-signin .links [data-feature="signin"] { display: inline-block !important; }
html.off-develop [data-feature="develop"], html.off-resources [data-feature="resources"] { display: none !important; }
/* Mobile panel */
.links.open { display: flex; flex-direction: column; position: fixed; inset: 0; z-index: 60; height: 100dvh; background: var(--bg); padding: var(--space-3); gap: var(--space-1); overflow: auto; animation: rise .25s var(--ease); }
.links.open a { font-family: var(--display); font-size: 2.2rem; color: var(--ink); }
.links.open .menu-close { display: inline-flex; align-self: flex-end; }
/* backdrop-filter on the pill would trap the fixed panel inside it, so drop it while open */
.pill:has(.links.open) { backdrop-filter: none; -webkit-backdrop-filter: none; }
@media (min-width: 56rem) {
  .links { display: flex; align-items: center; gap: var(--space-3); }
  .menu-open { display: none !important; }
}

/* ---------- 4. Buttons ---------- */
.btn, .menu-open, .menu-close, .dialog-close, .motion { font: 600 1rem/1.3 var(--body); cursor: pointer; border-radius: 999px; border: 1px solid transparent; min-height: 44px; padding: .7rem 1.4rem; display: inline-flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; }
.btn { background: var(--accent); color: var(--accent-ink); box-shadow: 0 12px 28px -14px var(--accent); transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.btn:hover { transform: translateY(-2px); box-shadow: 0 18px 34px -14px var(--accent); }
.btn:disabled { opacity: .6; cursor: default; transform: none; }
.btn-small { padding: .45rem 1rem; min-height: 40px; font-size: .9rem; white-space: nowrap; }
.btn-wide { max-width: 28rem; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--edge); box-shadow: none; }
.menu-open, .menu-close, .dialog-close, .motion { background: transparent; color: var(--ink); border-color: var(--edge); }
.menu-open { padding: .45rem .9rem; min-height: 40px; font-size: .9rem; }
.quiet-link { color: var(--muted); font-size: .95rem; padding: 10px; }
/* Phones: tighten up so the full name still fits; the laurel steps aside first. */
@media (max-width: 30rem) {
  .pill { gap: 8px; padding-left: 14px; }
  .brand { font-size: 1.15rem; }
  .brand img { display: none; }
  .pill .btn-small, .pill .menu-open { padding-left: .7rem; padding-right: .7rem; font-size: .82rem; }
}
/* Very narrow phones: the consultation button gives up its spot (it is still on the page). */
@media (max-width: 22rem) { .pill .btn-small { display: none; } }

/* ---------- 5. Hero (the white room) ---------- */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(60% 34% at 50% 92%, color-mix(in srgb, var(--glow) 10%, transparent), transparent 70%),
    linear-gradient(to bottom, var(--bg) 0%, var(--bg) 58%, var(--surface) 82%, var(--bg) 100%); }
.stars { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.hero-copy { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 96px var(--space-3) var(--space-2); animation: rise .8s var(--ease) both; }
.hero-copy h1 { margin-bottom: var(--space-1); background: linear-gradient(100deg, var(--ink) 35%, var(--accent) 75%, var(--glow)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tagline { font-size: clamp(1.05rem, 2vw, 1.3rem); font-weight: 600; max-width: 42rem; }
.hero-about { color: var(--muted); max-width: 40rem; margin-bottom: var(--space-1); font-size: 1rem; }
.actions { display: flex; flex-direction: column; align-items: center; margin-top: var(--space-2); }
.scene { margin-top: auto; height: clamp(260px, 42vh, 460px); }
.scene svg { display: block; width: 100%; height: 100%; }
.motion { position: absolute; right: 14px; bottom: 14px; font-size: .8rem; min-height: 36px; padding: .35rem .8rem; background: color-mix(in srgb, var(--bg) 80%, transparent); }
.motion .when-paused, html.still .motion .when-playing { display: none; }
html.still .motion .when-paused { display: inline; }
@media (max-width: 48rem) { .scene { height: 360px; } }

/* ---------- 6. Scene art ---------- */
.scene .sil { fill: var(--silhouette); }
.scene .edge { opacity: .75; }
.scene .limb { fill: none; stroke: var(--silhouette); stroke-linecap: round; stroke-linejoin: round; }
.scene .spark { fill: none; stroke: var(--glow); stroke-linecap: round; stroke-linejoin: round; }
.scene .board { fill: color-mix(in srgb, var(--glow) 20%, var(--bg)); stroke: var(--silhouette); stroke-width: 3; stroke-linejoin: round; }
.scene .court { fill: none; stroke: var(--silhouette); stroke-width: 1.1; opacity: .45; }
.scene .net { fill: none; stroke: var(--silhouette); stroke-width: 1.2; }
.scene .ball { fill: var(--glow); }
.scene .shadow { fill: var(--silhouette); opacity: .08; }
/* The rally: three rows, fading with distance, each person bouncing on their own beat */
.scene .crowd.far { opacity: .26; }
.scene .crowd.mid { opacity: .42; }
.scene .crowd.near { opacity: .66; }
.fan { animation: cheer 1.1s ease-in-out infinite; }
.fan.beat1 { animation-delay: -.28s; }
.fan.beat2 { animation-delay: -.55s; }
.fan.beat3 { animation-delay: -.83s; }
/* The game (drawn by game.js): dark team and blue team */
.player polyline { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.player .torso { stroke-width: 7.5; }
.player .leg { stroke-width: 4.4; }
.player .arm { stroke-width: 3.6; }
.player.team-a polyline { stroke: var(--silhouette); }
.player.team-a .head { fill: var(--silhouette); }
.player.team-b polyline { stroke: var(--accent); }
.player.team-b .head { fill: var(--accent); }
.player .shadow { opacity: .16; }
.scene .players .ball { fill: var(--glow); stroke: var(--silhouette); stroke-width: 1.4; }
.burst .ray { stroke: var(--glow); stroke-width: 3; stroke-linecap: round; }
.rally-arm { transform-origin: 293px 222px; animation: pump 1.8s ease-in-out infinite; }
.shout { animation: blink 1.8s ease-in-out infinite; }
.tassel { transform-origin: 920px 166px; animation: sway 3.4s ease-in-out infinite; }
@keyframes pump { 50% { transform: rotate(-9deg); } }
@keyframes blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes sway { 50% { transform: rotate(4deg); } }
@keyframes cheer { 50% { transform: translateY(-7px); } }
html.still .scene * { animation-play-state: paused; }

/* ---------- 7. Pages ---------- */
main > section:not(.hero), main > div > section, .footer { max-width: var(--max); margin-left: auto; margin-right: auto; padding-left: var(--space-3); padding-right: var(--space-3); }
.page-head { padding-top: 130px; padding-bottom: var(--space-2); }
.section { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.closing { text-align: center; padding-bottom: var(--space-5); }
.closing p { margin-left: auto; margin-right: auto; }
.lead { font-size: 1.2rem; color: var(--muted); }
.cards, .grid { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius); padding: var(--space-3); display: flex; flex-direction: column; align-items: flex-start; }
.card img { border-radius: 10px; margin-bottom: var(--space-2); aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.card .meta { color: var(--muted); font-size: .9rem; font-weight: 600; }
.card .body, .article p { white-space: pre-line; }
.card .row { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: auto; padding-top: var(--space-2); }
.group-title { margin-top: var(--space-4); }
.video { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 12px; background: var(--ink); margin-bottom: var(--space-2); }
.article { border-bottom: 1px solid var(--edge); padding: var(--space-2) 0; }
.article summary { cursor: pointer; font-family: var(--display); font-size: 1.6rem; min-height: 44px; }
.footer { padding-top: var(--space-4); padding-bottom: var(--space-4); color: var(--muted); border-top: 1px solid var(--edge); }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; }
.footer-links a:hover { color: var(--accent); }

/* Social icons and photo. An empty link or picture is hidden. */
.social-row { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.social { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid var(--edge); border-radius: 999px; color: var(--ink); transition: transform .2s var(--ease), color .2s; }
.social:hover { color: var(--accent); transform: translateY(-2px); }
.social svg { width: 22px; height: 22px; }
.social[href=""], img[src=""] { display: none; }
.photo { display: block; width: min(100%, 22rem); aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); margin-bottom: var(--space-3); }

/* ---------- 8. Forms and consult dialog ---------- */
.form { display: grid; gap: 4px; max-width: 34rem; }
.form label { font-size: .9rem; font-weight: 600; margin-top: var(--space-1); }
.form input:not(.hp):not([type="hidden"]), .form textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid color-mix(in srgb, var(--ink) 25%, transparent); border-radius: 12px; padding: .7rem .9rem; min-height: 44px; width: 100%; }
.form .btn { justify-self: start; }
.help { font-size: .85rem; color: var(--muted); margin: var(--space-1) 0 0; }
.form-msg { min-height: 1.5em; margin: 0; font-size: .95rem; }
.form-msg.bad { color: #b3261e; }
.done { animation: rise .45s var(--ease); }
.dialog-close { display: none; }
dialog.consult { width: min(36rem, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; border: 1px solid var(--edge); border-radius: 24px; padding: 0; background: var(--bg); color: var(--ink); animation: rise .3s var(--ease); }
dialog.consult::backdrop { background: color-mix(in srgb, var(--ink) 45%, transparent); backdrop-filter: blur(4px); }
dialog.consult #consult-card { padding: var(--space-3); position: relative; }
dialog.consult h1 { font-size: 2.2rem; padding-right: 6rem; }
dialog.consult .dialog-close { display: inline-flex; position: absolute; top: 14px; right: 14px; }
html:has(dialog.consult[open]), body.locked { overflow: hidden; }

/* ---------- 9. Motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s var(--ease), transform .5s var(--ease); transition-delay: var(--d, 0ms); }
  .js .reveal.in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .motion { display: none; }
}

/* ---------- 10. Sequenced sale ---------- */
.resume, .actions-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.resume { max-width: var(--max); margin: 0 auto; padding: 0 var(--space-3); }
dialog.wizard { width: min(34rem, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; overflow-x: hidden; border: 1px solid var(--edge); border-radius: 26px; padding: var(--space-3); background: var(--bg); color: var(--ink); text-align: center; animation: rise .3s var(--ease); }
dialog.wizard::backdrop { background: color-mix(in srgb, var(--ink) 55%, transparent); backdrop-filter: blur(5px); }
html:has(dialog.wizard[open]) { overflow: hidden; }
.wizard-top { display: flex; align-items: center; gap: var(--space-2); }
.wizard-top .btn { min-height: 40px; padding: .4rem 1rem; font-size: .9rem; }
.wizard-track { flex: 1; height: 8px; border-radius: 99px; background: var(--surface); overflow: hidden; }
.wizard-track span { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--glow)); transition: width .5s var(--ease); }
.wizard-screen { display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: var(--space-3); animation: slide .35s var(--ease); position: relative; }
.wizard-screen h2 { font-size: 2.3rem; outline: none; }
.wizard-screen .meta { margin: 0; color: var(--muted); font-weight: 600; font-size: .9rem; }
.body-text { white-space: pre-line; }
.wizard-count { font-family: var(--display); font-size: 1.8rem; color: var(--accent); margin-bottom: var(--space-1); }
.wizard-links { display: flex; flex-direction: column; gap: var(--space-1); width: 100%; max-width: 22rem; }
.wizard-check { display: flex; align-items: center; gap: 10px; min-height: 48px; font-weight: 600; cursor: pointer; }
.wizard-check input { width: 24px; height: 24px; accent-color: var(--accent); }
.wizard-nav { display: flex; justify-content: center; gap: var(--space-2); margin-top: var(--space-1); }
.wizard-tick { width: 84px; height: 84px; fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; margin-bottom: var(--space-2); }
.wizard-tick circle { stroke-dasharray: 227; animation: draw-ring .7s var(--ease) both; }
.wizard-tick path { stroke-dasharray: 60; animation: draw-tick .45s .55s var(--ease) both; }
.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.confetti span { position: absolute; top: -12px; left: var(--x); width: 8px; height: 14px; border-radius: 2px; animation: fall 1.9s var(--delay) ease-in both; }
.confetti .tone0 { background: var(--accent); }
.confetti .tone1 { background: var(--glow); }
.confetti .tone2 { background: var(--ink); }
/* Gift box */
.gift-title { animation: rise .8s var(--ease) both; }
.gift-stage { position: relative; width: 100%; height: 260px; display: flex; align-items: center; justify-content: center; animation: drop-in .7s .9s var(--ease) both; }
.gift { --power: .5; background: none; border: 0; padding: 0; width: 200px; height: 200px; cursor: pointer; animation: wiggle 2.2s 1.6s ease-in-out infinite; }
.gift svg { width: 100%; height: 100%; overflow: visible; }
.gift.shake { animation: shake .55s ease-in-out; }
.gift-box { fill: var(--accent); stroke: var(--ink); stroke-width: 3; }
.gift-ribbon { fill: var(--glow); }
.gift-bow { fill: var(--glow); stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.gift-glow { fill: var(--glow); opacity: 0; transform-origin: 100px 105px; }
.gift-lid { transform-origin: 100px 90px; }
.gift-stage.open .gift-lid { animation: pop-lid .9s var(--ease) forwards; }
.gift-stage.open .gift-glow { animation: burst .9s var(--ease) forwards; }
.gift-stage.open .gift-word { opacity: 0; }
.gift-word { position: absolute; font-family: var(--display); font-size: 1.5rem; color: var(--accent); animation: float 3s ease-in-out infinite; pointer-events: none; }
.gift-word.w0 { left: 4%; top: 12%; }
.gift-word.w1 { right: 3%; top: 26%; animation-delay: -.8s; }
.gift-word.w2 { left: 8%; bottom: 12%; animation-delay: -1.6s; }
.gift-word.w3 { right: 10%; bottom: 4%; animation-delay: -2.3s; }
.gift-dots { display: flex; gap: 8px; }
.gift-dots span { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--accent); transition: background .2s, transform .2s; }
.gift-dots span.on { background: var(--accent); transform: scale(1.2); }
@keyframes slide { from { opacity: 0; transform: translateX(32px); } }
@keyframes draw-ring { from { stroke-dashoffset: 227; } }
@keyframes draw-tick { from { stroke-dashoffset: 60; } }
@keyframes fall { to { transform: translate(var(--drift), 460px) rotate(var(--spin)); opacity: 0; } }
@keyframes drop-in { from { opacity: 0; transform: translateY(-60px) scale(.6); } }
@keyframes wiggle { 0%, 70%, 100% { transform: rotate(0); } 76% { transform: rotate(-5deg); } 82% { transform: rotate(5deg); } 88% { transform: rotate(-3deg); } }
@keyframes shake {
  15% { transform: translateX(calc(var(--power) * -14px)) rotate(calc(var(--power) * -9deg)); }
  30% { transform: translateX(calc(var(--power) * 14px)) rotate(calc(var(--power) * 9deg)); }
  45% { transform: translateY(calc(var(--power) * -16px)) rotate(calc(var(--power) * -6deg)) scale(1.06); }
  65% { transform: translateX(calc(var(--power) * 8px)) rotate(calc(var(--power) * 4deg)); }
  82% { transform: translateX(calc(var(--power) * -4px)); }
}
@keyframes pop-lid { 30% { transform: translateY(-24px) rotate(-8deg); } 100% { transform: translate(60px, -150px) rotate(48deg); opacity: 0; } }
@keyframes burst { 20% { opacity: .9; } 100% { opacity: 0; transform: scale(9); } }
@keyframes float { 50% { transform: translateY(-12px) rotate(4deg); opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } }

/* ---------- 11. Policies ---------- */
.legal h1 { font-size: clamp(2.4rem, 6vw, 3.6rem); }
.legal h2 { font-size: 1.7rem; margin-top: var(--space-4); }
.legal-body { white-space: pre-line; }
.legal li { margin-bottom: var(--space-1); }
.note { max-width: var(--max); margin: 0 auto; padding: 0 var(--space-3); color: var(--muted); font-size: .95rem; }
.operator { font-size: .9rem; }
.optional[href=""] { display: none; }
.btn.is-off { opacity: .45; cursor: default; box-shadow: none; transform: none; }
