/* ==========================================================================
   ProspectRow intro ("/"): a night game under the lights, styled after the Prospect Row
   flyer (lettering-ref2.png). Only the PR logo, PROSPECT ROW, BASEBALL, MORE THAN A GAME,
   the HARD WORK | GOOD PEOPLE | BRIGHT FUTURES tagline, 11U / 9U and the Enter links.

   Hex values sampled from the photos:
     wordmark fill (chrome, top -> bottom)  #F5FAFA #E8FAFC #CCD9DD #CEE3E8
     inner line / outer edge                #0A0909      night background #05070A
     outline orange                          #DC6034      brush swash #D55D2F
     PR fill / 11U + 9U fill                 #58C0D8
     BASEBALL / rules                        #B8B9B8 / #BCBCBC
     MORE THAN A GAME                        #C7C7CB      tagline #E7DDD7
     sky #1D252F, horizon glow #906445 -> #C47A44, dirt #6E4428 / #5A3620 / #3C2112
   Fonts (self-hosted, SIL OFL, Google Fonts):
     Orbitron 900 slanted -12deg  PROSPECT ROW, 11U, 9U
     Michroma                     BASEBALL
     Kaushan Script               MORE THAN A GAME (brush script)
     Rajdhani SemiBold            tagline
   Timeline (s): lights on 0-0.9 | Prospect/Row slide 0.45-1.35, impact 1.3 |
     BASEBALL + PR logo pop 1.65 | MORE THAN A GAME wipe 2.25-3.0, swash 2.95 |
     11U 3.05, 9U 3.2 | Enter 3.45 | tagline 3.7. Ends ~4.2.
   ========================================================================== */
@font-face { font-family: "Orbitron"; font-weight: 900; font-display: block; src: url("/fonts/orbitron-black.woff2") format("woff2"); }
@font-face { font-family: "Michroma"; font-weight: 400; font-display: block; src: url("/fonts/michroma.woff2") format("woff2"); }
@font-face { font-family: "Kaushan Script"; font-weight: 400; font-display: block; src: url("/fonts/kaushan-script.woff2") format("woff2"); }
@font-face { font-family: "Rajdhani"; font-weight: 600; font-display: swap; src: url("/fonts/rajdhani-semibold.woff2") format("woff2"); }

:root {
  --night: #05070a; --white: #fefdfd; --orange: #f65506;
  --wm-1: #f5fafa; --wm-2: #e8fafc; --wm-3: #ccd9dd; --wm-4: #cee3e8;
  --wm-edge: #0a0909; --wm-orange: #dc6034; --wm-gray: #b8b9b8; --wm-rule: #bcbcbc; --pr-teal: #58c0d8;
  --mtag: #c7c7cb; --swash: #d55d2f; --tag: #e7ddd7;

  --bar: clamp(92px, 13.5svh, 118px);      /* enter buttons + tagline */
  --clear: 28px;                           /* room for the 11U / 9U labels under the plate line */

  /* Field geometry (fractions of the stage width W), generated with the SVG (tools: gen/field.py). */
  --V: .76; --hy: .300; --mound: .496; --home: .6887; --gap: .300; --base2: .4245;
  --W: min(100vw, calc((100svh - var(--bar) - var(--clear)) / .6887));
  --f-title: min(calc(var(--W) * .05), 8.2vw);  /* keeps PROSPECT ROW between 1st and 3rd */
  --f-team: min(calc(var(--W) * .045), 8vw);
  --team-dx: .07;
}
/* Portrait (phones, tall tablets): higher camera, taller field. */
@media (max-aspect-ratio: 4/5) {
  :root {
    --V: 1.96; --hy: .85; --mound: 1.3486; --home: 1.8576; --gap: .436; --base2: 1.1647;
    --W: min(100vw, calc((100svh - var(--bar) - var(--clear)) / 1.8576));
    --f-title: min(calc(var(--W) * .072), 7.8vw);
    --f-team: min(calc(var(--W) * .075), 8vw);
    --team-dx: .10;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body.intro { background: var(--night); color: var(--white); overflow: hidden; font-family: system-ui, sans-serif; }
.ballpark { position: relative; width: 100vw; height: 100vh; height: 100svh; overflow: hidden; background: #0b0f15; }
svg.defs { position: absolute; width: 0; height: 0; }

/* Field: SVG in stage coordinates (1000 wide), drawn past its box on every side. */
.field {
  position: absolute; left: 50%; width: var(--W); height: calc(var(--W) * var(--V)); margin-left: calc(var(--W) / -2);
  top: calc(100svh - var(--bar) - var(--clear) - var(--W) * var(--home)); overflow: visible; display: block;
}
.field-port { display: none; }
@media (max-aspect-ratio: 4/5) { .field-land { display: none; } .field-port { display: block; } }

.stage {
  position: absolute; left: 50%; width: var(--W); height: calc(var(--W) * var(--V)); margin-left: calc(var(--W) / -2);
  top: calc(100svh - var(--bar) - var(--clear) - var(--W) * var(--home));
}
.stage > * { position: absolute; }

/* ---------- Floodlight banks (top corners) ---------- */
.lights { position: absolute; top: max(8px, 1.6svh); width: clamp(84px, 12vw, 190px); aspect-ratio: 1.55; pointer-events: none; z-index: 1; }
.lights-l { left: max(-12px, -1vw); }
.lights-r { right: max(-12px, -1vw); }
.lights::before { /* glow */
  content: ""; position: absolute; left: 50%; top: 45%; width: 520%; aspect-ratio: 1; translate: -50% -50%;
  background: radial-gradient(circle, rgb(255 255 255 / .55) 0, rgb(214 228 255 / .28) 9%, rgb(160 185 230 / .12) 22%, rgb(120 140 180 / 0) 48%);
  mix-blend-mode: screen;
}
.lights::after { /* rays */
  content: ""; position: absolute; left: 50%; top: 45%; width: 620%; aspect-ratio: 1; translate: -50% -50%;
  background: repeating-conic-gradient(from 3deg, rgb(255 255 255 / .07) 0 1.4deg, rgb(255 255 255 / 0) 1.4deg 7deg);
  -webkit-mask: radial-gradient(circle, #000 4%, rgb(0 0 0 / .5) 18%, transparent 46%);
          mask: radial-gradient(circle, #000 4%, rgb(0 0 0 / .5) 18%, transparent 46%);
  mix-blend-mode: screen;
}
.bank { /* 4 x 3 bulbs on a dark frame */
  position: absolute; inset: 0; z-index: 1; border-radius: 4px;
  background:
    radial-gradient(circle, #fff 0 34%, rgb(236 244 255 / .9) 42%, rgb(200 220 255 / 0) 64%) 0 0 / 25% 33.34%,
    linear-gradient(#1a1f27, #0d1015);
  box-shadow: 0 0 0 2px #0d1015, 0 0 30px 8px rgb(230 240 255 / .45);
}
.bank::after { /* pole */
  content: ""; position: absolute; left: 50%; top: 100%; width: max(3px, 4%); height: 60svh; translate: -50% 0;
  background: linear-gradient(#20252d, rgb(20 24 30 / 0));
}

/* ---------- Banner-style lettering ----------
   Layers, back to front: dark outer edge (::before), orange outline (element), fill + thin dark line (::after). */
.w, .team { position: relative; display: inline-block; isolation: isolate; white-space: nowrap; }
.w::before, .w::after, .team::before, .team::after {
  content: attr(data-text); content: attr(data-text) / "";
  position: absolute; left: 0; top: 0; pointer-events: none;
}
.w, .team { color: var(--wm-orange); -webkit-text-stroke: .17em var(--wm-orange); }
.w::before, .team::before { z-index: -1; -webkit-text-stroke: .29em var(--wm-edge); color: var(--wm-edge); }
.w::after, .team::after   { z-index: 1; -webkit-text-stroke: .075em var(--wm-edge); }
.w::after {
  color: var(--wm-2); -webkit-text-fill-color: transparent;
  background: linear-gradient(180deg, var(--wm-1) 0%, var(--wm-1) 34%, var(--wm-2) 50%, var(--wm-3) 58%, var(--wm-4) 100%);
  -webkit-background-clip: text; background-clip: text;
}
.team::after { color: var(--pr-teal); -webkit-text-stroke-width: .05em; }

/* Title: PROSPECT ROW centered on the pitcher's mound. */
.title {
  left: 50%; top: calc(var(--mound) / var(--V) * 100%); margin: 0; isolation: isolate; z-index: 2;
  translate: -50% calc(var(--f-title) * -.5);
  display: grid; justify-items: center; font-weight: 400; line-height: 1;
}
.title::before {
  content: ""; position: absolute; z-index: -1; inset: -.5em -.6em -.9em; font-size: var(--f-title);
  background: radial-gradient(closest-side, rgb(1 3 6 / .5), rgb(1 3 6 / .25) 60%, rgb(1 3 6 / 0));
}
.wordmark {
  display: flex; gap: .42em; align-items: baseline; transform: skewX(-12deg);
  font: 900 var(--f-title) / 1 "Orbitron", "Arial Black", sans-serif; text-transform: uppercase; letter-spacing: .07em;
  filter: drop-shadow(0 .08em .06em rgb(1 3 6 / .6));
}
.w { margin-right: -.07em; }
.w-baseball {
  display: flex; align-items: center; gap: .9em; width: 100%; margin-top: calc(var(--f-title) * .5);
  font: 400 max(12px, calc(var(--f-title) * .42)) / 1 "Michroma", Arial, sans-serif; color: var(--wm-gray);
}
.bb { text-transform: uppercase; letter-spacing: .72em; margin-right: -.72em; text-shadow: 0 0 .12em var(--wm-edge), 0 0 .3em var(--wm-edge); }
.w-baseball .rule, .tagline .rule { flex: 1; min-width: 1.2em; height: max(1.5px, .12em); border-radius: 1px; }
.w-baseball .rule { box-shadow: 0 0 .2em var(--wm-edge); }
.w-baseball .rule:first-child { background: linear-gradient(90deg, rgb(188 188 188 / .1), var(--wm-rule) 45%); }
.w-baseball .rule:last-child  { background: linear-gradient(270deg, rgb(188 188 188 / .1), var(--wm-rule) 45%); }

/* PR logo, directly above the wordmark. */
.pr-logo {
  left: 50%; top: calc(var(--mound) / var(--V) * 100%); z-index: 2;
  height: calc(var(--f-title) * 3.4); width: auto; translate: -50% calc(-100% - var(--f-title) * .72);
  transform-origin: 50% 100%; filter: drop-shadow(0 .4em .5em rgb(0 0 0 / .55)); font-size: var(--f-title);
}

/* 11U / 9U beside home plate. */
.teams { inset: 0; pointer-events: none; z-index: 2; }
.team {
  position: absolute; top: calc(var(--home) / var(--V) * 100%); pointer-events: auto; text-decoration: none;
  font: 900 var(--f-team) / 1 "Orbitron", "Arial Black", sans-serif; letter-spacing: .05em;
  padding: .2em .22em; transform: skewX(-12deg); translate: 0 -50%;
  filter: drop-shadow(0 .07em .05em rgb(1 3 6 / .6)); transition: scale .15s ease;
}
.team::before, .team::after { left: .22em; top: .2em; }
.t11 { right: calc(50% + var(--W) * var(--team-dx)); }
.t9  { left:  calc(50% + var(--W) * var(--team-dx)); }
.team:hover, .team:focus-visible { scale: 1.12; }
.team:focus-visible { outline: 3px solid var(--white); outline-offset: 4px; border-radius: 8px; }

/* MORE THAN A GAME: top right, left of the right-hand lights (centered at the top on phones). */
.mtag {
  position: absolute; z-index: 3; margin: 0; top: calc(1.05em + 1.5svh); right: calc(clamp(84px, 12vw, 190px) + 3vw);
  font: 400 clamp(17px, min(2.9vw, 5.4svh), 46px) / .98 "Kaushan Script", "Brush Script MT", cursive; color: var(--mtag); -webkit-text-stroke: .03em var(--mtag);
  text-transform: uppercase; transform: rotate(-11deg); transform-origin: 0 100%;
  display: grid; justify-items: start; text-shadow: 0 .05em .12em rgb(0 0 0 / .6);
}
.mtag span { display: block; }
.mtag .l2 { margin-left: .5em; }
.mtag .l3 { margin-left: .95em; }
.mtag .swash { position: absolute; left: .5em; top: 100%; width: 5.4em; height: auto; margin-top: -.18em; fill: var(--swash); overflow: visible; }
@media (max-aspect-ratio: 4/5) {
  .mtag { right: auto; left: 50%; translate: -46% 0; top: max(14px, 5svh); font-size: clamp(20px, min(6.4vw, 4.2svh), 34px); transform-origin: 50% 50%; }
}

/* Bottom: enter buttons + tagline. */
.bottom {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--bar); z-index: 3;
  display: grid; align-content: center; justify-items: center; gap: max(8px, 1.4svh);
  padding: 0 1rem env(safe-area-inset-bottom);
  background: linear-gradient(rgb(5 7 10 / 0), rgb(5 7 10 / .55) 45%, rgb(5 7 10 / .8));
}
.enter { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; }
.enter-btn {
  font: 800 clamp(.9rem, 2vh, 1.05rem) system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--white); background: var(--wm-orange); border: 2px solid var(--wm-edge); border-radius: 999px;
  padding: .55em 1.1em; text-decoration: none; box-shadow: 0 2px 10px rgb(0 0 0 / .5); white-space: nowrap;
}
.enter-btn:hover { background: #b94d27; }
.enter-btn:focus-visible { outline: 3px solid var(--white); outline-offset: 3px; }
.tagline {
  margin: 0; display: flex; align-items: center; gap: 1.1em; width: min(100%, 60em);
  font: 600 clamp(9px, 1.15vw, 14px) / 1 "Rajdhani", "Arial Narrow", sans-serif; color: var(--tag);
  text-transform: uppercase; letter-spacing: .32em; white-space: nowrap;
}
.tagline .tg { margin-right: -.32em; }
.tagline i { font-style: normal; margin: 0 .8em; opacity: .85; }
.tagline .rule { background: rgb(231 221 215 / .7); height: 1px; min-width: 2em; }
@media (max-width: 480px) {
  .tagline { font-size: 9.5px; letter-spacing: .18em; gap: .7em; }
  .tagline .tg { margin-right: -.18em; }
  .tagline i { margin: 0 .45em; }
}

/* Dust ring when the words meet. */
.impact {
  left: 50%; top: calc(var(--mound) / var(--V) * 100%); width: calc(var(--W) * .34); aspect-ratio: 1.8;
  translate: -50% -50%; border-radius: 50%; border: calc(var(--W) * .008) solid rgb(230 214 190 / .8); opacity: 0; pointer-events: none;
}

/* ---------- Animation (final state = the un-animated styles above) ---------- */
.lights       { animation: lights-on .9s steps(1, end) both; }
.lights-r     { animation-delay: .12s; }
.field        { animation: dusk 1.2s ease-out both; }
.w-prospect   { animation: from-left .9s cubic-bezier(.16,.84,.3,1.04) .45s both; }
.w-row        { animation: from-right .9s cubic-bezier(.16,.84,.3,1.04) .45s both; }
.wordmark     { animation: thump .32s ease-out 1.3s both; }
.title::before{ animation: fade .5s ease-out 1.2s both; }
.impact       { animation: ring .7s ease-out 1.3s forwards; }
.w-baseball   { animation: pop .6s cubic-bezier(.3,1.5,.5,1) 1.65s both; }
.pr-logo      { animation: pop .6s cubic-bezier(.3,1.5,.5,1) 1.65s both; }
.mtag .l1     { animation: wipe .36s ease-out 2.25s both; }
.mtag .l2     { animation: wipe .32s ease-out 2.5s both; }
.mtag .l3     { animation: wipe .4s ease-out 2.72s both; }
.mtag .swash  { animation: wipe .35s cubic-bezier(.5,0,.2,1) 2.98s both; }
.t11          { animation: pop .5s cubic-bezier(.3,1.6,.5,1) 3.05s both; }
.t9           { animation: pop .5s cubic-bezier(.3,1.6,.5,1) 3.2s both; }
.enter        { animation: rise .5s ease-out 3.45s both; }
.tagline      { animation: fade .7s ease-out 3.7s both; }

@keyframes lights-on { 0% { opacity: 0; } 18% { opacity: .9; } 26% { opacity: .15; } 40% { opacity: 1; } 52% { opacity: .5; } 60%, 100% { opacity: 1; } }
@keyframes dusk { from { filter: brightness(.35); } to { filter: none; } }
@keyframes from-left  { 0% { translate: -110vw 0; } 78% { translate: .12em 0; } 100% { translate: 0 0; } }
@keyframes from-right { 0% { translate: 110vw 0; }  78% { translate: -.12em 0; } 100% { translate: 0 0; } }
@keyframes thump { 0%, 100% { scale: 1; } 40% { scale: 1.07; } }
@keyframes ring { 0% { opacity: .9; scale: .2; } 100% { opacity: 0; scale: 1.5; } }
@keyframes pop { 0% { scale: 0; opacity: 0; } 55% { scale: 1.22; opacity: 1; } 78% { scale: .93; } 100% { scale: 1; opacity: 1; } }
@keyframes wipe { from { clip-path: inset(-20% 100% -20% -10%); } to { clip-path: inset(-20% -10% -20% -10%); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; translate: 0 40%; } to { opacity: 1; translate: 0 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
