/* Moonjunk Studios · BASE JUMP: FREEFALL site. Brand: Branding/BRAND_GUIDE.md */
@font-face { font-family: "Bowlby One"; src: url("../fonts/bowlby-one.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("../fonts/montserrat-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --night: #121a2e; --ink: #0b1120; --cream: #f3e7cb; --gold: #ffc94d; --orange: #ff9b2f; --red: #e8502e;
  --amber: #ffb23f; --paper: #f7f1e3; --line: rgba(243, 231, 203, 0.14); --muted: rgba(243, 231, 203, 0.72);
  --display: "Bowlby One", Impact, sans-serif; --ui: "Montserrat", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 48px); --max: 1180px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ink); color: var(--cream); font: 500 17px/1.6 var(--ui); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, video { display: block; max-width: 100%; }
a { color: inherit; }
.wrap { width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto; }
.label { font: 800 13px/1.2 var(--ui); letter-spacing: 0.32em; text-transform: uppercase; color: var(--amber); }
h1, h2, h3 { font-family: var(--display); font-weight: 400; text-transform: uppercase; line-height: 0.95; margin: 0; letter-spacing: 0.01em; }
h2 { font-size: clamp(40px, 7vw, 84px); }
h3 { font-size: clamp(22px, 2.4vw, 30px); }
p { margin: 0; }
.lede { font-size: clamp(17px, 1.6vw, 20px); color: var(--muted); max-width: 46ch; }

/* ---------- buttons */
.btn { display: inline-flex; align-items: center; gap: 0.6em; padding: 0.95em 1.6em; border-radius: 999px; border: 0; cursor: pointer;
  font: 800 15px/1 var(--ui); letter-spacing: 0.18em; text-transform: uppercase; text-decoration: none; transition: transform 0.15s, box-shadow 0.15s, background 0.15s; }
.btn-gold { background: var(--gold); color: var(--night); box-shadow: 0 6px 0 #c98f16, 0 14px 30px rgba(255, 201, 77, 0.25); }
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 8px 0 #c98f16, 0 18px 36px rgba(255, 201, 77, 0.35); }
.btn-gold:active { transform: translateY(4px); box-shadow: 0 2px 0 #c98f16; }
.btn-ghost { background: rgba(11, 17, 32, 0.45); color: var(--cream); box-shadow: inset 0 0 0 2px var(--line); backdrop-filter: blur(6px); }
.btn-ghost:hover { box-shadow: inset 0 0 0 2px var(--cream); }
.btn:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* ---------- top bar */
.topbar { position: fixed; inset: 0 0 auto; z-index: 50; display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--gutter); background: linear-gradient(rgba(11, 17, 32, 0.85), rgba(11, 17, 32, 0)); pointer-events: none; }
.topbar > * { pointer-events: auto; }
.topbar { transition: background 0.3s, box-shadow 0.3s; }
.topbar.scrolled { background: rgba(11, 17, 32, 0.9); backdrop-filter: blur(10px); box-shadow: 0 1px 0 var(--line); }
.topbar .mark img { height: 34px; width: auto; }
.topbar .btn { padding: 0.75em 1.25em; font-size: 13px; }

/* ---------- freefall HUD (styled after the game's own HUD) */
.hud { position: fixed; right: var(--gutter); top: 50%; transform: translateY(-50%); z-index: 40; display: grid; justify-items: end; gap: 18px;
  font-family: var(--ui); text-align: right; pointer-events: none; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6); }
.hud .num { font: 700 44px/1 var(--ui); color: #fff; font-variant-numeric: tabular-nums; }
.hud .unit { font: 800 12px/1 var(--ui); letter-spacing: 0.2em; color: var(--amber); margin-left: 4px; }
.hud .alt.low .num { color: var(--red); }
.hud .mode { font: 800 12px/1 var(--ui); letter-spacing: 0.28em; color: var(--amber); }
.hud .track { position: relative; width: 4px; height: 26vh; background: var(--line); border-radius: 4px; margin-right: 14px; }
.hud .track i { position: absolute; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; border: 2px solid var(--gold); background: var(--ink); }
.hud .track b { position: absolute; left: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: var(--gold);
  box-shadow: 0 0 18px rgba(255, 201, 77, 0.8); }
.hud .track i.hit { background: var(--gold); }
.score { position: absolute; left: 50%; transform: translateX(-50%); display: flex; align-items: baseline; gap: 14px; pointer-events: none;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6); }
.score .num { font: 700 26px/1 var(--ui); font-variant-numeric: tabular-nums; min-width: 3ch; text-align: right; }
.score .rings { font: 800 12px/1 var(--ui); letter-spacing: 0.2em; color: var(--amber); }
.popup { position: fixed; left: 50%; top: 92px; z-index: 45; transform: translateX(-50%); pointer-events: none; white-space: nowrap;
  font: 800 clamp(16px, 2vw, 22px)/1 var(--ui); letter-spacing: 0.12em; color: var(--amber); text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
  animation: pop 1.6s ease-out forwards; }
.popup.big { color: var(--gold); font-size: clamp(22px, 3vw, 34px); }
@keyframes pop { 0% { opacity: 0; transform: translate(-50%, 10px) scale(0.9); } 12% { opacity: 1; transform: translate(-50%, 0) scale(1.05); }
  70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -24px); } }
.flyring { position: fixed; left: 50%; top: 50%; z-index: 30; width: 40vmin; height: 40vmin; margin: -20vmin 0 0 -20vmin; border-radius: 50%;
  border: 2.2vmin solid rgba(233, 196, 120, 0.9); box-shadow: 0 0 40px rgba(255, 201, 77, 0.35), inset 0 0 30px rgba(255, 201, 77, 0.25);
  pointer-events: none; animation: flythrough 0.85s cubic-bezier(0.4, 0, 0.9, 0.5) forwards; }
@keyframes flythrough { 0% { transform: scale(0.15); opacity: 0; } 25% { opacity: 1; } 100% { transform: scale(6); opacity: 0; } }

/* ---------- sections */
section { position: relative; scroll-margin-top: 64px; }
.hero { min-height: 100svh; display: grid; place-items: center; text-align: center; overflow: hidden; }
.hero video, .hero .poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background:
  radial-gradient(ellipse at 50% 45%, rgba(11, 17, 32, 0.15), rgba(11, 17, 32, 0.62) 72%), linear-gradient(rgba(11, 17, 32, 0.05) 60%, var(--ink) 99%); }
.hero .inner { position: relative; z-index: 2; padding: 120px var(--gutter) 140px; display: grid; justify-items: center; gap: 22px; }
.title { font-family: var(--display); text-transform: uppercase; line-height: 0.86; filter: drop-shadow(0 8px 0 var(--ink)) drop-shadow(0 18px 30px rgba(0, 0, 0, 0.5)); }
.title .a { display: block; font-size: clamp(54px, 10vw, 150px); color: var(--cream); -webkit-text-stroke: 0.02em var(--ink); }
.title .b { display: block; font-size: clamp(36px, 6.6vw, 100px); color: var(--amber); -webkit-text-stroke: 0.02em var(--ink); }
.hero .lede { margin-inline: auto; color: var(--cream); font-weight: 600; }
.hero .ctas { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 8px; }
.prompt { position: absolute; z-index: 2; bottom: 34px; left: 50%; transform: translateX(-50%); display: grid; justify-items: center; gap: 8px;
  font: 800 12px/1 var(--ui); letter-spacing: 0.3em; color: var(--amber); white-space: nowrap; animation: blink 1.4s steps(2, jump-none) infinite; }
.prompt kbd { font: inherit; padding: 6px 10px; border: 2px solid var(--amber); border-radius: 6px; }
@keyframes blink { 50% { opacity: 0.35; } }
.prompt .k-touch { display: none; }
@media (hover: none) and (pointer: coarse) { .prompt .k-desk { display: none; } .prompt .k-touch { display: block; } }

.gate { padding: clamp(90px, 14vh, 160px) 0; }
.gate .head { display: grid; gap: 14px; margin-bottom: 44px; }
.alt-tag { font: 700 13px/1 var(--ui); letter-spacing: 0.2em; color: var(--muted); font-variant-numeric: tabular-nums; }

.trailer .frame { position: relative; border-radius: 18px; overflow: hidden; box-shadow: 0 0 0 2px var(--line), 0 30px 80px rgba(0, 0, 0, 0.5); aspect-ratio: 16 / 9; background: #000; }
.trailer video { width: 100%; height: 100%; object-fit: cover; }
.trailer .play { position: absolute; inset: 0; display: grid; place-items: center; border: 0; background: rgba(11, 17, 32, 0.25); cursor: pointer; }
.trailer .play span { width: 96px; height: 96px; border-radius: 50%; background: var(--gold); display: grid; place-items: center; box-shadow: 0 6px 0 #c98f16;
  transition: transform 0.15s; }
.trailer .play:hover span { transform: scale(1.06); }
.trailer .play svg { width: 34px; margin-left: 6px; fill: var(--night); }
.trailer .note { margin-top: 14px; font-size: 14px; color: var(--muted); }

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.tile { position: relative; border-radius: 16px; overflow: hidden; background: var(--night); box-shadow: 0 0 0 2px var(--line); }
.tile video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.tile .txt { padding: 20px 22px 24px; display: grid; gap: 8px; }
.tile p { color: var(--muted); font-size: 15.5px; }
.tile .k { position: absolute; top: 14px; left: 14px; font: 800 11px/1 var(--ui); letter-spacing: 0.22em; padding: 7px 10px; border-radius: 6px;
  background: rgba(11, 17, 32, 0.72); color: var(--amber); }

.courses .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.course { border-radius: 16px; overflow: hidden; background: var(--night); box-shadow: 0 0 0 2px var(--line); display: grid; grid-template-rows: auto 1fr; }
.course .media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; }
.course .media img, .course .media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity 0.3s; }
.course .media video { opacity: 0; }
.course:hover .media video, .course.playing .media video { opacity: 1; }
.course .n { position: absolute; top: 12px; left: 14px; font: 400 44px/1 var(--display); color: var(--cream); text-shadow: 0 3px 0 var(--ink); }
.course .body { padding: 18px 20px 22px; display: grid; gap: 10px; align-content: start; }
.course p { color: var(--muted); font-size: 15px; }
.medals { display: flex; flex-wrap: wrap; gap: 6px 14px; font: 800 11px/1.4 var(--ui); letter-spacing: 0.14em; }
.medals .b { color: #e09a5a; } .medals .s { color: #d8e2ea; } .medals .g { color: #ffd34a; }
.lock { font: 700 12px/1.3 var(--ui); letter-spacing: 0.08em; color: var(--muted); }

/* ---------- landing zone */
.landing { padding: clamp(80px, 12vh, 140px) 0 90px; text-align: center; overflow: hidden; }
.landing .bg { position: absolute; inset: 0; background: url("../img/canopy-1920.webp") center 30% / cover; opacity: 0.22; mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); }
.landing .inner { position: relative; display: grid; justify-items: center; gap: 22px; }
.target { position: relative; width: min(84vw, 520px); aspect-ratio: 1.6; display: grid; place-items: center; margin: 6px 0 0; }
.disc { position: absolute; left: 0; right: 0; top: 50%; aspect-ratio: 1; translate: 0 -50%; border-radius: 50%;
  background: radial-gradient(circle, #ffcf3f 0 15%, #0b1120 15% 15.8%, #d93a2c 15.8% 31%, #0b1120 31% 31.8%, #f3efe6 31.8% 47%,
    #0b1120 47% 47.8%, #d93a2c 47.8% 63%, #0b1120 63% 63.8%, #f3efe6 63.8% 79%, #0b1120 79% 80.5%, transparent 80.5%);
  transform: perspective(900px) rotateX(58deg); filter: blur(0.35px) drop-shadow(0 30px 30px rgba(0, 0, 0, 0.45)); }
.disc::before { content: ""; position: absolute; inset: 6%; border-radius: 50%; border: 4px solid rgba(255, 201, 77, 0.9); animation: halo 2.2s ease-in-out infinite; }
@keyframes halo { 50% { inset: 1%; opacity: 0.3; } }
.target .btn { position: relative; font-size: 18px; padding: 1.1em 2em; }
.landing .facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 26px; font: 800 12.5px/1.4 var(--ui); letter-spacing: 0.18em; text-transform: uppercase; }
.landing .facts span::before { content: "◆ "; color: var(--gold); }
.result { min-height: 48px; font: 700 15px/1.5 var(--ui); color: var(--muted); }
.result strong { color: var(--gold); font-size: 22px; }

/* ---------- support (Ko-fi): a quiet card after the landing, never during play */
.support { padding: 0 0 clamp(56px, 9vh, 96px); }
.support .card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 22px 40px; padding: clamp(24px, 3.4vw, 40px);
  border-radius: 16px; background: var(--night); box-shadow: 0 0 0 2px var(--line); }
.support .txt { display: grid; gap: 12px; flex: 1 1 420px; }
.support h2 { font-size: clamp(26px, 3.2vw, 38px); line-height: 1.05; }
.support .emoji { font-size: 0.8em; vertical-align: 0.06em; }
.support p { color: var(--muted); font-size: 16px; max-width: 60ch; }
.support .btn { flex: none; }
.support .btn:hover { color: var(--gold); box-shadow: inset 0 0 0 2px var(--gold); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- footer */
footer { border-top: 2px solid var(--line); padding: 48px 0 60px; background: var(--night); }
footer .row { display: flex; flex-wrap: wrap; gap: 26px 40px; align-items: center; justify-content: space-between; }
footer img { width: 220px; height: auto; }
footer .tag { flex: 0 1 470px; font: 800 13px/1.5 var(--ui); letter-spacing: 0.22em; text-transform: uppercase; color: var(--cream); }
footer small { display: block; margin-top: 6px; color: var(--muted); font-size: 13px; letter-spacing: 0.02em; text-transform: none; font-weight: 500; }
footer nav { display: flex; flex-wrap: wrap; gap: 14px 22px; font: 700 14px/1 var(--ui); letter-spacing: 0.14em; text-transform: uppercase; }
footer nav a { text-decoration: none; color: var(--muted); }
footer nav a:hover { color: var(--gold); }

/* ---------- responsive */
@media (max-width: 1279px) {
  .hud { top: auto; bottom: 18px; transform: none; grid-auto-flow: column; gap: 18px; align-items: end; }
  .hud .num { font-size: 30px; } .hud .track { display: none; }
}
@media (max-width: 960px) {
  .courses .grid { grid-template-columns: 1fr; }
  .course { grid-template-columns: 44% 1fr; grid-template-rows: none; }
  .course .media { aspect-ratio: auto; min-height: 170px; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .tiles { grid-template-columns: 1fr; }
  .course { grid-template-columns: 1fr; }
  .course .media { aspect-ratio: 16 / 10; min-height: 0; }
  .hud { top: auto; bottom: 14px; right: 14px; transform: none; grid-auto-flow: column; gap: 14px; align-items: end; }
  .hud .num { font-size: 22px; } .hud .track, .hud .mode { display: none; }
  .score .num { font-size: 20px; } .score .rings { display: none; }
  .topbar .mark img { height: 26px; }
  .prompt { bottom: 74px; }
  .support .btn { width: 100%; justify-content: center; padding-inline: 1em; font-size: 13px; letter-spacing: 0.1em; white-space: nowrap; }
}
@media (max-width: 360px) {
  .support .btn { font-size: 12px; letter-spacing: 0.05em; padding-inline: 0.8em; gap: 0.4em; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .flyring, .prompt, .disc::before { animation: none; }
  .flyring { display: none; }
}

/* ---------- input disclosure + touch-only path (the game needs a keyboard or gamepad) */
.touch-only-show { display: none !important; }
html.touch-only .desk-only { display: none !important; }
html.touch-only .touch-only-show { display: revert !important; }
html.touch-only .ctas.touch-only-show, html.touch-only .target .touch-only-show { display: inline-flex !important; }
html.touch-only .hero .ctas.touch-only-show { display: flex !important; }
.needs { font: 600 14px/1.5 var(--ui); color: var(--cream); opacity: 0.85; max-width: 44ch; margin-inline: auto; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 60; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 12px 18px; border-radius: 999px; background: var(--cream); color: var(--night); font: 800 13px/1.3 var(--ui); letter-spacing: 0.06em;
  transition: opacity 0.25s, transform 0.25s; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- the HUD waits until you leave the exit, so the hero has one clear way in: Play free */
.hud, .topbar .score { transition: opacity 0.35s; }
body.on-hero .hud, body.on-hero .topbar .score { opacity: 0; }
.prompt kbd { padding: 3px 7px; margin: 0 2px; }

/* ---------- analytics consent (assets/js/analytics.js): small, bottom-left, above the game */
.consent { position: fixed; left: 16px; bottom: 16px; z-index: 50; width: min(380px, calc(100% - 32px)); display: grid; gap: 12px;
  padding: 16px 18px; border-radius: 16px; background: var(--night); box-shadow: inset 0 0 0 2px var(--line), 0 18px 40px rgba(0, 0, 0, 0.45);
  font-size: 14px; line-height: 1.5; color: var(--muted); }
.consent a { color: var(--cream); }
.consent .row { display: flex; gap: 10px; flex-wrap: wrap; }
.consent .btn { padding: 0.6em 1.2em; font-size: 13px; }
.consent .btn-gold { box-shadow: 0 4px 0 #c98f16; }

/* ---------- privacy page */
.legal { padding: clamp(40px, 8vh, 80px) 0; }
.legal .wrap { max-width: 760px; display: grid; gap: 18px; }
.legal h1 { font-size: clamp(36px, 6vw, 64px); }
.legal h2 { font-size: clamp(22px, 3vw, 30px); margin-top: 18px; }
.legal p, .legal li { color: var(--muted); }
.legal ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.legal strong { color: var(--cream); }
.legal .choice { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 18px; border-radius: 16px; box-shadow: inset 0 0 0 2px var(--line); }
.legal .choice .btn { padding: 0.7em 1.3em; font-size: 13px; }
