/* TwinFin landing page. Colours, fonts and the glass UI come from the game (docs/ART_BIBLE.md, game/ui/ui_tokens.gd). */
@font-face { font-family: Grandstander; src: url('assets/fonts/Grandstander-Variable.ttf') format('truetype'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: Outfit; src: url('assets/fonts/Outfit-Variable.ttf') format('truetype'); font-weight: 100 900; font-display: swap; }

:root {
  --ink: #10202A;
  --gold: #FFC24A;
  --gold-light: #FFD77E;
  --paper: #F4EDE1;
  --white: #FFFFFF;
  --muted: rgba(255, 255, 255, .74);
  --jungle: #2F7A2C;
  --jungle-deep: #1E5A26;
  --jungle-ink: #123D18;
  --sky-1: #EEF8D8; --sky-2: #E3F1C2; --sky-3: #F2EEB4; --sky-4: #E6E4A2;
  --water-1: #7CEBEF; --water-2: #22B4D4; --water-3: #0C6A9E; --water-4: #062650;
  --deep: #05203F;
  --waterline: #CFF7FF;
  --glass: rgba(14, 26, 38, .48);
  --glass-border: rgba(255, 255, 255, .22);
  --radius: 26px;
  --s: .9; /* scene scale: px per game px, set by script.js from the scene height */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--deep); color: var(--white); font: 500 17px/1.6 Outfit, system-ui, -apple-system, "Segoe UI", sans-serif; overflow-x: hidden; }
img { max-width: 100%; }
a { color: var(--gold-light); }
h1, h2, h3 { margin: 0; line-height: 1.12; }
h2 { font: 800 clamp(30px, 5vw, 48px)/1.08 Outfit, sans-serif; letter-spacing: -.01em; margin-bottom: 14px; }
h3 { font-weight: 800; font-size: 21px; margin-bottom: 6px; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.svg-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 50; padding: 10px 16px; border-radius: 12px; background: var(--gold); color: var(--ink); font-weight: 800; text-decoration: none; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.eyebrow { margin: 0 0 8px; color: var(--gold); font-weight: 800; font-size: 13px; letter-spacing: .18em; text-transform: uppercase; }
.section-lede { max-width: 62ch; color: var(--muted); font-size: 18px; margin: 0 0 14px; }
.section-lede strong { color: var(--white); }

/* ---- Glass and buttons, as in the game's UI kit ---- */
.glass-card { background: var(--glass); border: 1.5px solid var(--glass-border); border-radius: var(--radius); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2); box-shadow: 0 18px 40px rgba(0, 0, 0, .22); }
.glass-pill { display: inline-block; padding: 7px 18px; border-radius: 99px; background: rgba(14, 26, 38, .55); border: 1.5px solid rgba(255, 255, 255, .24); color: var(--white); font: 800 13px/1.4 Outfit, sans-serif; letter-spacing: .2em; text-transform: uppercase; text-shadow: 0 1px 0 rgba(0, 0, 0, .35); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.pill-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 22px; border: 3px solid var(--ink); border-radius: 99px; background: var(--gold); color: var(--ink); font: 800 14px/1 Outfit, sans-serif; letter-spacing: .16em; text-transform: uppercase; text-decoration: none; box-shadow: 0 4px 0 var(--ink); cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s; }
.pill-button:hover { background: var(--gold-light); transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink); }
.pill-button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.store-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.store-button { display: inline-flex; align-items: center; gap: 12px; min-width: 210px; padding: 11px 20px 11px 16px; border-radius: 16px; background: var(--ink); border: 2px solid rgba(255, 255, 255, .28); color: var(--white); text-decoration: none; box-shadow: 0 4px 0 rgba(0, 0, 0, .35); transition: transform .15s, border-color .15s, background .15s; }
.store-button:hover { transform: translateY(-2px); border-color: var(--gold); background: #182f3d; }
.store-button svg { width: 28px; height: 28px; flex: none; color: var(--gold); }
.store-button span { display: flex; flex-direction: column; line-height: 1.15; }
.store-button small { font-size: 12px; font-weight: 600; color: var(--muted); }
.store-button strong { font-size: 20px; font-weight: 800; }

/* ---- Header ---- */
.site-header { position: fixed; inset: 0 0 auto; z-index: 20; padding: 10px 0; background: rgba(14, 26, 38, .5); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2); box-shadow: 0 1px 0 var(--glass-border); transition: background .25s; }
.site-header.scrolled { background: rgba(14, 26, 38, .78); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--white); text-decoration: none; font: 900 24px/1 Grandstander, sans-serif; text-shadow: 0 2px 0 var(--ink); }
.brand img { width: 40px; height: 40px; border-radius: 10px; border: 2px solid var(--ink); }
.site-header nav { display: flex; align-items: center; gap: 22px; }
.nav-link { color: var(--white); font-weight: 700; text-decoration: none; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.nav-link:hover { color: var(--gold); }
.site-header .pill-button { padding: 9px 16px; font-size: 12px; }
@media (max-width: 760px) { .nav-link { display: none; } .brand span { display: none; } }

/* ---- Hero: the game's scenery, in game px × --s ---- */
.hero { position: relative; overflow: hidden; height: calc(844px * var(--s)); min-height: 620px; touch-action: manipulation; user-select: none; -webkit-user-select: none; cursor: pointer; }
.scene { position: absolute; inset: 0; }
.sky { position: absolute; inset: 0 0 auto; height: calc(422px * var(--s)); background: linear-gradient(var(--sky-1) 0%, var(--sky-2) 50%, var(--sky-3) 82%, var(--sky-4) 100%); }
.sun { position: absolute; left: 22%; top: calc(322px * var(--s)); width: calc(60px * var(--s)); height: calc(60px * var(--s)); margin: calc(-30px * var(--s)); border-radius: 50%; background: #FFFDEA; box-shadow: 0 0 0 calc(4px * var(--s)) rgba(255, 244, 190, .9), 0 0 calc(190px * var(--s)) calc(60px * var(--s)) rgba(255, 244, 190, .75); }
.water { position: absolute; inset: calc(422px * var(--s)) 0 0; background:
  radial-gradient(ellipse calc(300px * var(--s)) calc(120px * var(--s)) at 78% 0, rgba(255, 255, 255, .32), transparent 70%),
  repeating-linear-gradient(100deg, transparent 0 calc(70px * var(--s)), rgba(230, 255, 255, .10) calc(70px * var(--s)) calc(92px * var(--s))),
  linear-gradient(var(--water-1) 0%, var(--water-2) 30%, var(--water-3) 68%, var(--water-4) 100%); }
.strip, .waterline {
  /* Each PNG has a transparent margin of --m game px above and below the art (8 px in the 3x sheets), so the strip
     is drawn that much taller and higher. --tile is the whole-pixel width of one tile (script.js; the fallback is
     unrounded), and the drift moves exactly one tile per loop, so the restart is invisible. */
  --m: 2.6667; --tile: calc(var(--w) * var(--s));
  position: absolute; left: 0; right: 0; top: calc((var(--y) - var(--m)) * 1px * var(--s)); height: calc((var(--h) + 2 * var(--m)) * 1px * var(--s));
  background: var(--img) repeat-x 0 0 / calc(var(--tile) * 1px) 100%; animation: drift linear infinite; animation-duration: calc(1s * var(--w) / (var(--p) * 36)); pointer-events: none;
}
@keyframes drift { from { background-position-x: 0; } to { background-position-x: calc(var(--tile) * -1px); } }
.waterline { --img: none; background-image: url(assets/scenery/divider_wave.png); --w: 419; --h: 32; --y: 406; --m: .6667; --p: 1.4; filter: drop-shadow(0 0 calc(10px * var(--s)) rgba(255, 255, 255, .8)); }
.twin { position: absolute; z-index: 2; width: auto; height: calc(var(--th) * 1px * var(--s) * var(--zoom, 1.9)); left: var(--tx); top: 0; translate: -50% -50%; will-change: transform; pointer-events: none; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .18)); }
.macaw { --th: 40; --tx: 70%; }
.fish { --th: 40; --tx: 64%; }
@media (max-width: 760px) { .macaw { --tx: 70%; --zoom: 1.15; } .fish { --tx: 56%; --zoom: 1.15; } }

.hero-copy { position: relative; z-index: 3; height: 100%; display: flex; flex-direction: column; align-items: flex-start; padding-top: calc(70px + 30px * var(--s)); padding-bottom: 26px; pointer-events: none; }
.hero-copy > * { pointer-events: auto; }
.logo { font: 900 clamp(64px, 12vw, 132px)/.95 Grandstander, sans-serif; letter-spacing: -.01em; -webkit-text-stroke: .15em var(--ink); paint-order: stroke fill; text-shadow: 0 .1em 0 var(--ink); margin: 0 0 14px -.04em; pointer-events: none; }
.twin-word { color: var(--white); }
.fin-word { color: var(--gold); }
.hero-pills { display: flex; gap: 10px; flex-wrap: wrap; margin: 0; pointer-events: none; }
.hero-card { margin-top: auto; max-width: 520px; padding: 22px 24px; }
.hero-lede { margin: 0 0 18px; font-size: 18px; color: rgba(255, 255, 255, .92); }
.hero-lede strong { color: var(--gold); }
.try-hint { display: inline-flex; align-items: center; gap: 8px; margin: 14px 0 0; padding: 6px 14px 6px 10px; border-radius: 99px; background: rgba(14, 26, 38, .55); font-weight: 700; font-size: 15px; pointer-events: none; transition: opacity .6s; }
.try-hint svg { width: 22px; height: 22px; color: var(--gold); }
.try-hint.done { opacity: 0; }
@media (max-width: 760px) {
  .hero { min-height: 700px; }
  .hero-copy { align-items: center; text-align: center; }
  .hero-pills { justify-content: center; }
  .hero-card { padding: 12px; width: 100%; }
  .hero-card .store-buttons { justify-content: center; flex-wrap: nowrap; gap: 10px; }
  .hero-lede { display: none; } /* "How it plays" right below says it; the fish needs the room */
  .store-button { min-width: 0; flex: 1 1 0; gap: 8px; padding: 10px 12px 10px 10px; }
  .store-button svg { width: 22px; height: 22px; }
  .store-button small { font-size: 11px; white-space: nowrap; }
  .store-button strong { font-size: 17px; white-space: nowrap; }
}

/* ---- Bands: the page goes on down through the sea and back up through the jungle ---- */
.band { position: relative; padding: clamp(64px, 9vw, 110px) 0; }
.deep { background: linear-gradient(var(--deep), #062B52); }
.sea { background: linear-gradient(#0C6A9E, var(--water-4)); }
.jungle { background: radial-gradient(ellipse 70% 60% at 85% 20%, rgba(255, 244, 190, .18), transparent 70%), linear-gradient(var(--jungle), var(--jungle-deep)); padding-top: clamp(96px, 12vw, 140px); }
.fringe { position: absolute; inset: 0 0 auto; height: 74px; background: url(assets/scenery/jungle_fringe.png) repeat-x 0 0 / auto 100%; pointer-events: none; }
.band::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 6px; background: linear-gradient(90deg, transparent, rgba(207, 247, 255, .55), transparent); }
.jungle::before { content: none; }

.steps { list-style: none; padding: 0; margin: 34px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.steps li { padding: 26px 24px; }
.steps p { margin: 0; color: var(--muted); }
.step-num { display: inline-block; margin-bottom: 14px; color: var(--gold); font: 900 34px/1 Grandstander, sans-serif; -webkit-text-stroke: .12em var(--ink); paint-order: stroke fill; text-shadow: 0 3px 0 var(--ink); }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }

.daily-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center; }
.jungle .section-lede { color: rgba(255, 255, 255, .86); }
.daily-card { padding: 30px; text-align: center; }
.daily-pill { margin: 0 0 18px; }
.countdown-label { margin: 0; color: var(--muted); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: 13px; }
.countdown small { font-size: .5em; margin-left: .04em; -webkit-text-stroke-width: .2em; }
.countdown { margin: 4px 0 14px; font: 900 clamp(48px, 7vw, 68px)/1 Grandstander, sans-serif; font-variant-numeric: tabular-nums; color: var(--white); -webkit-text-stroke: .12em var(--ink); paint-order: stroke fill; text-shadow: 0 .08em 0 var(--ink); }
.daily-note { margin: 0; color: var(--muted); font-size: 15px; }
@media (max-width: 860px) { .daily-grid { grid-template-columns: 1fr; } }

.medals { list-style: none; padding: 0; margin: 34px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.medal { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 24px 12px; border-radius: var(--radius); background: rgba(255, 255, 255, .06); border: 1.5px solid rgba(255, 255, 255, .12); text-align: center; }
.medal strong { font-size: 20px; }
.medal span:last-child { color: var(--muted); font-size: 15px; }
.medal-badge { display: grid; place-items: center; width: 74px; height: 74px; margin-bottom: 10px; border-radius: 50%; border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink), inset 0 4px 0 rgba(255, 255, 255, .45); }
.medal-badge svg { width: 34px; height: 34px; color: rgba(16, 32, 42, .82); }
.bronze .medal-badge { background: radial-gradient(circle at 35% 30%, #F4B07A, #C9773A); }
.silver .medal-badge { background: radial-gradient(circle at 35% 30%, #F4F7FA, #A9B7C2); }
.gold .medal-badge { background: radial-gradient(circle at 35% 30%, #FFE08A, #F2A81D); }
.platinum .medal-badge { background: radial-gradient(circle at 35% 30%, #FFFFFF, #9FE6F0 55%, #6FC3D6); }
@media (max-width: 700px) { .medals { grid-template-columns: repeat(2, 1fr); } }

.shots { display: flex; justify-content: safe center; gap: 22px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 30px max(16px, (100% - 1120px) / 2) 10px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .3) transparent; }
.shots figure { flex: none; width: clamp(200px, calc((min(1120px, 100vw - 32px) - 88px) / 5), 260px); margin: 0; scroll-snap-align: center; }
.shots img { display: block; width: 100%; height: auto; border-radius: 30px; border: 6px solid var(--ink); box-shadow: 0 0 0 2px rgba(255, 255, 255, .25), 0 22px 40px rgba(0, 0, 0, .35); background: var(--ink); }
.shots figcaption { margin-top: 14px; text-align: center; font-weight: 800; }

.faq-list { margin-top: 26px; display: grid; gap: 12px; max-width: 820px; }
.faq-list details { border-radius: 18px; background: rgba(255, 255, 255, .06); border: 1.5px solid rgba(255, 255, 255, .12); }
.faq-list summary { display: flex; justify-content: space-between; gap: 16px; padding: 18px 22px; font-weight: 800; font-size: 18px; cursor: pointer; list-style: none; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary svg { flex: none; width: 22px; height: 22px; color: var(--gold); transition: transform .2s; }
.faq-list details[open] summary svg { transform: rotate(45deg); }
.faq-list p { margin: 0; padding: 0 22px 20px; color: var(--muted); }
.faq-list p strong { color: var(--white); }

/* The closing scene: the same world behind the card (scale from data-scale, script.js). */
.cta-band { position: relative; overflow: hidden; height: calc(844px * var(--s)); }
.cta-band .sun { left: 78%; }
.cta-wrap { position: relative; z-index: 2; height: 100%; display: grid; place-items: center; }
.cta-card { max-width: 680px; margin: 0 auto; padding: clamp(28px, 5vw, 48px); text-align: center; }
.cta-icon { width: 120px; height: 120px; border-radius: 28px; border: 3px solid var(--ink); box-shadow: 0 6px 0 var(--ink); margin-bottom: 18px; }
.cta-card p { color: rgba(255, 255, 255, .86); font-size: 18px; margin: 0 0 22px; }
.cta-card .store-buttons { justify-content: center; }

.site-footer { background: #031628; padding: 30px 0 40px; border-top: 1px solid rgba(255, 255, 255, .08); }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.footer-row p { margin: 0; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-links a, .footer-link { color: var(--white); font: 700 15px Outfit, sans-serif; text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; }
.footer-links a:hover, .footer-link:hover { color: var(--gold); }

dialog { width: min(440px, calc(100% - 32px)); padding: 30px 26px 26px; border: 2px solid var(--glass-border); border-radius: var(--radius); background: #0E1A26; color: var(--white); text-align: center; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
dialog::backdrop { background: rgba(3, 14, 28, .66); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
dialog h2 { font-size: 28px; }
dialog p { color: var(--muted); }
dialog img { margin-bottom: 10px; }
.dialog-close { position: absolute; top: 10px; right: 12px; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .08); color: var(--white); cursor: pointer; }
.dialog-close svg { width: 18px; height: 18px; }

/* ---- Sub-pages (privacy, support): a short scene with the title in the sky, the text on glass in the deep sea ---- */
.page-hero { position: relative; overflow: hidden; height: calc(844px * var(--s)); }
.page-hero .still-twin { top: calc(var(--ty) * 1px * var(--s)); animation: bob 3.4s ease-in-out infinite; }
.page-hero .fish.still-twin { animation-name: bob-mirror; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-.06rad); } }
@keyframes bob-mirror { 50% { transform: translateY(8px) rotate(.06rad); } }
.page-hero-copy { position: relative; z-index: 3; padding-top: calc(66px + 34px * var(--s)); }
.page-title { font: 900 clamp(40px, 7vw, 76px)/1 Grandstander, sans-serif; color: var(--white); -webkit-text-stroke: .15em var(--ink); paint-order: stroke fill; text-shadow: 0 .09em 0 var(--ink); margin: 14px 0 14px -.03em; }
.page-title .gold { color: var(--gold); }
.page-hero-copy .glass-pill { letter-spacing: .12em; }
@media (max-width: 760px) { .page-hero-copy { text-align: center; } .page-hero .macaw { --tx: 86%; } .page-hero .fish { --tx: 80%; } }
.doc-band { padding-top: clamp(40px, 6vw, 72px); }
.doc { max-width: 860px; margin: 0 auto; padding: clamp(24px, 5vw, 52px); }
.doc > :first-child { margin-top: 0; }
.doc h2 { font: 800 clamp(22px, 3vw, 27px)/1.2 Outfit, sans-serif; color: var(--gold); margin: 38px 0 10px; letter-spacing: 0; }
.doc h3 { font-size: 19px; margin: 24px 0 6px; }
.doc p, .doc li { color: rgba(255, 255, 255, .86); max-width: 72ch; }
.doc p { margin: 0 0 12px; }
.doc ul { padding-left: 22px; margin: 0 0 12px; }
.doc li { margin: 6px 0; }
.doc li::marker { color: var(--gold); }
.doc strong { color: var(--white); }
.doc a { color: var(--gold-light); text-underline-offset: 3px; }
.doc a.pill-button { color: var(--ink); text-decoration: none; }
.doc-summary { margin-bottom: 8px; padding: 20px 24px; border-radius: 20px; background: rgba(255, 194, 74, .08); border: 1.5px solid rgba(255, 194, 74, .38); }
.doc-summary p:last-child { margin-bottom: 0; }
.doc-summary .doc-summary-title { font-size: 20px; font-weight: 800; color: var(--white); }
.doc-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; }
.doc-contact p { margin: 0; flex: 1 1 260px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .strip, .waterline, .page-hero .still-twin { animation: none; }
  .pill-button, .store-button { transition: none; }
}
.motion-paused .strip, .motion-paused .waterline { animation-play-state: paused; }
