/* Fishing Fun: the game's website (fishingfun.gameonline.fun). The game's own colours and fonts (V4 look,
   docs/V5-branding.md); no script, nothing from other sites. */

@font-face { font-family: 'Mali'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/mali-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Mali'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/mali-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Mitr'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/mitr-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Mitr'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/mitr-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Mitr'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/mitr-latin-600-normal.woff2') format('woff2'); }

:root {
  --ocean: #1da7a1;
  --ocean-deep: #12807b;
  --lagoon: #65d5e7;
  --coral: #f77f57;
  --coral-deep: #d9583a;
  --mango: #ffc857;
  --navy: #173b4d;
  --navy-soft: #2a5468;
  --cream: #fff6e0;
  --sand: #f6e7c4;
  --foam: #e8f8f6;
  --ink: #173b4d;
  --muted: #4a6672;
  --card: #ffffff;
  --line: rgba(23, 59, 77, 0.12);
  --shadow: 0 10px 30px rgba(23, 59, 77, 0.12);
  --radius: 22px;
  --font-display: 'Mali', 'Mitr', system-ui, sans-serif;
  --font-ui: 'Mitr', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --wrap: 1120px;
  --gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 400 1.04rem/1.65 var(--font-ui);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ocean-deep); text-underline-offset: 3px; }
a:hover { color: var(--coral-deep); }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; margin: 0 0 0.5em; color: var(--navy); }
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.25rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--navy); color: #fff; padding: 8px 14px; border-radius: 10px; z-index: 50; }
.skip:focus { left: 8px; }

/* ── The logo (as on the game's title card) ── */
.logo { position: relative; display: inline-block; font: 700 1.55rem/1 var(--font-display); color: var(--mango); -webkit-text-stroke: 5px var(--navy); paint-order: stroke fill; text-decoration: none; letter-spacing: 0.01em; white-space: nowrap; }
.logo:hover { color: var(--mango); }
.logo-wave { position: absolute; right: -24px; top: -10px; width: 26px; height: 26px; color: var(--lagoon); transform: rotate(-12deg); }
.logo-big { font-size: clamp(3rem, 11vw, 5.4rem); -webkit-text-stroke: 9px var(--navy); text-shadow: 0 7px 0 rgba(23, 59, 77, 0.3); }
.logo-big .logo-wave { width: 52px; height: 52px; right: -46px; top: -14px; }

/* ── Header and menu ── */
.site-head { position: sticky; top: 0; z-index: 20; background: rgba(255, 246, 224, 0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.head-row { display: flex; align-items: center; gap: 18px; min-height: 64px; }
.head-row .logo { margin-right: auto; }
.menu { display: flex; gap: 4px; }
.menu a { padding: 8px 12px; border-radius: 999px; color: var(--navy); text-decoration: none; font-weight: 500; white-space: nowrap; }
.menu a:hover, .menu a[aria-current='page'] { background: rgba(29, 167, 161, 0.14); color: var(--ocean-deep); }
@media (max-width: 860px) {
  .head-row { flex-wrap: wrap; gap: 8px; padding-top: 10px; }
  .menu { order: 3; width: 100%; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
  .menu::-webkit-scrollbar { display: none; }
}
@media (max-width: 480px) {
  .menu { gap: 0; }
  .menu a { padding: 7px 9px; font-size: 0.93rem; }
}

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 26px; border-radius: 999px; font: 600 1.06rem/1 var(--font-display); text-decoration: none; border: 0; cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.btn:hover { transform: translateY(-2px); }
.btn-play { background: var(--coral); color: #fff; box-shadow: 0 5px 0 var(--coral-deep), 0 12px 24px rgba(217, 88, 58, 0.3); }
.btn-play:hover { color: #fff; }
.btn-ghost { background: rgba(255, 255, 255, 0.85); color: var(--navy); box-shadow: inset 0 0 0 2px rgba(23, 59, 77, 0.18); }
.btn-ghost:hover { color: var(--navy); }
.btn-small { min-height: 40px; padding: 9px 18px; font-size: 0.98rem; }
.btn-xl { min-height: 58px; padding: 16px 36px; font-size: 1.25rem; }

/* ── Hero: Coral Bay, alive (drawn by scripts/build-site.ts from the game's own art) ── */
.hero { position: relative; overflow: hidden; min-height: max(620px, min(calc(100svh - 64px), 900px)); background: #bfe8f1; text-align: center; isolation: isolate; }
.hero-art { position: absolute; inset: 0; z-index: -1; }
.hero-svg { width: 100%; height: 100%; display: block; }
.hero-content { position: relative; padding: clamp(36px, 7vh, 80px) var(--gutter) 0; max-width: 760px; margin: 0 auto; }
/* A soft light behind the words, so they read wherever the island and the sky fall on a short or narrow screen. */
.hero-content::before { content: ''; position: absolute; z-index: -1; inset: 4% -6% -8%; border-radius: 50%; background: radial-gradient(closest-side, rgba(240, 251, 253, 0.85), rgba(240, 251, 253, 0.55) 55%, transparent); pointer-events: none; }
.night .hero-content::before { background: radial-gradient(closest-side, rgba(16, 28, 51, 0.8), rgba(16, 28, 51, 0.45) 55%, transparent); }
.tagline { margin: 22px 0 6px; font: 700 clamp(1.4rem, 3vw, 2rem)/1.25 var(--font-display); color: var(--navy); }
.hero-sub { color: var(--navy-soft); margin: 0 auto 24px; max-width: 560px; font-size: 1.1rem; font-weight: 500; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.hero-note { margin: 16px 0 0; font-size: 0.95rem; color: var(--navy-soft); font-weight: 500; }
.night .tagline, .night .hero-sub, .night .hero-note { color: #fff6e0; text-shadow: 0 2px 8px rgba(16, 28, 51, 0.6); }

/* The logo pops in like the game's; the Play button waves now and then. */
.pop { animation: pop 900ms cubic-bezier(0.34, 1.56, 0.64, 1) both; }
@keyframes pop { from { transform: scale(0.4) rotate(-6deg); opacity: 0; } }
.wiggle { animation: wiggle 5s ease-in-out 2s infinite; }
@keyframes wiggle { 0%, 88%, 100% { transform: none; } 91% { transform: rotate(-4deg) scale(1.05); } 94% { transform: rotate(4deg) scale(1.05); } 97% { transform: rotate(-2deg); } }

/* The day/night switch. */
.daynight { position: absolute; right: 16px; bottom: 18px; z-index: 2; display: none; align-items: center; gap: 8px; padding: 9px 16px 9px 10px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.85); color: var(--navy); font: 600 0.92rem/1 var(--font-ui); cursor: pointer; box-shadow: 0 6px 18px rgba(23, 59, 77, 0.18); }
.js .daynight { display: inline-flex; }
.dn-icon { width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff3c4, #ffc857 60%); box-shadow: 0 0 0 4px rgba(255, 200, 87, 0.3); }
.night .dn-icon { background: radial-gradient(circle at 60% 40%, #fff6d6 45%, transparent 46%), #3b4f8c; box-shadow: 0 0 0 4px rgba(255, 246, 214, 0.25); }
.dn-night, .night .dn-day { display: none; }
.night .dn-night { display: inline; }
.night .daynight { background: rgba(16, 28, 51, 0.8); color: #fff6e0; }

/* Day and night layers. */
.night-only { opacity: 0; transition: opacity 1.2s ease; }
.day-only { transition: opacity 1.2s ease; }
.night .night-only { opacity: 1; }
/* Night recolours the sea and dims the clouds (no dark sheet over the island). */
.sea-far, .sea-band path, .cloud ellipse { transition: fill 1.2s ease, opacity 1.2s ease; }
.night .sea-far { fill: #1e3a63; }
.night .b1 path { fill: #1b3560; }
.night .b2 path { fill: #162d54; }
.night .b3 path { fill: #112448; }
.night .cloud ellipse { fill: #56658f; }
.night .cloud { opacity: 0.55; }
.beam { transform-origin: 562px 436px; animation: beam 6s ease-in-out infinite; }
@keyframes beam { 50% { transform: rotate(12deg); opacity: 0.15; } }
.night .day-only { opacity: 0; }
.night .hero { background: #101c33; }

/* The sea moves: each band slides by one wave and starts again; clouds drift; things bob. */
.sea-band > path { animation: slide var(--t, 10s) linear infinite; }
@keyframes slide { to { transform: translateX(calc(-1 * var(--len, 200px))); } }
.cloud { animation: cloud var(--t, 80s) linear var(--d, 0s) infinite; }
@keyframes cloud { from { transform: translateX(1750px); } to { transform: translateX(-250px); } }
.spin { animation: spin 40s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.bob, .cs-bob { animation: bob 3s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(6px) rotate(-1deg); } }
.bob-slow { animation: bob-slow 6s ease-in-out infinite; }
@keyframes bob-slow { 50% { transform: translateY(4px); } }
.ripple { transform-box: fill-box; transform-origin: center; animation: ripple 2.4s ease-out infinite; }
@keyframes ripple { from { transform: scale(0.4); opacity: 0.9; } to { transform: scale(1.8); opacity: 0; } }
.gulls { animation: gulls 34s linear infinite; }
@keyframes gulls { from { transform: translate(-120px, 0); } 50% { transform: translate(800px, -40px); } to { transform: translate(1750px, 10px); } }
.pelly-fly { animation: pelly 26s linear 6s infinite both; }
/* Pelly faces right, so flies left to right (then waits off screen before coming round again). */
@keyframes pelly { from { transform: translateX(-200px); } 40% { transform: translateX(1750px); } to { transform: translateX(1750px); } }
.pelly-fly .cs-fly { animation: none; }
.pelly-fly g g { transform-box: fill-box; }
.cs-wing { transform-origin: 0 0; animation: wing 0.45s ease-in-out infinite alternate; }
@keyframes wing { to { transform: scaleY(-0.6); } }
.cs-wave-claw { animation: claw 0.6s ease-in-out infinite alternate; }
@keyframes claw { to { transform: rotate(-18deg); } }
.leap-loop { transform-box: fill-box; animation: leap 7s ease-out var(--d, 0s) infinite; opacity: 0; }
@keyframes leap { 0% { transform: translate(0, 60px) rotate(40deg); opacity: 0; } 4% { opacity: 1; } 12% { transform: translate(40px, -70px) rotate(-10deg); } 20% { transform: translate(80px, 40px) rotate(-40deg); opacity: 1; } 22%, 100% { transform: translate(80px, 60px); opacity: 0; } }
.twinkle { animation: twinkle 2.4s ease-in-out var(--d, 0s) infinite; }
@keyframes twinkle { 50% { opacity: 0.25; } }
.glow, .cs-glow { animation: glow 2.4s ease-in-out infinite; }
@keyframes glow { 50% { opacity: 0.12; } }

/* On a phone held upright the scene is narrow: bring the boat and the island in. */
@media (max-aspect-ratio: 1/1) {
  .h-boat { transform: translate(-190px, 20px); }
  .h-island { transform: translate(110px, -10px); }
  .hero-content { padding-top: 28px; }
}
.scene.is-paused *, .scene.is-paused *::before, .scene.is-paused *::after { animation-play-state: paused !important; }

/* ── Under the surface ── */
.undersea { position: relative; overflow: hidden; padding: 72px 0 96px; color: #eafcfb; background: linear-gradient(180deg, #2390a6 0%, #1f7f99 45%, #1b6b8a 100%); isolation: isolate; }
.night .undersea { background: linear-gradient(180deg, #13304f 0%, #10284a 50%, #0d2140 100%); }
.undersea h2 { color: #fff; text-shadow: 0 3px 0 rgba(10, 50, 70, 0.35); }
.undersea .lead { color: #d5f5f3; }
.eyebrow.eyebrow-light { background: rgba(255, 255, 255, 0.18); color: #fff; }
.rays { position: absolute; inset: 0 0 auto; height: 70%; z-index: -1; background: repeating-linear-gradient(100deg, rgba(255, 255, 255, 0.09) 0 40px, transparent 40px 120px); mask-image: linear-gradient(180deg, #000, transparent); -webkit-mask-image: linear-gradient(180deg, #000, transparent); animation: rays 12s ease-in-out infinite alternate; }
@keyframes rays { to { transform: translateX(60px) skewX(-4deg); } }
.bubbles { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.bubble { position: absolute; left: var(--x); bottom: -40px; width: var(--s); height: var(--s); border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.5); background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.05) 60%); animation: bubble var(--t) linear var(--d) infinite; }
@keyframes bubble { to { transform: translate(20px, -1400px); } }
.school { position: absolute; z-index: -1; width: 260px; pointer-events: none; opacity: 0.85; }
.school-a { top: 18%; animation: swim-l 32s linear infinite; }
.school-b { top: 62%; width: 180px; animation: swim-r 26s linear -8s infinite; }
.school-b svg { transform: scaleX(-1); }
@keyframes swim-l { from { transform: translateX(-300px); } to { transform: translateX(110vw); } }
@keyframes swim-r { from { transform: translateX(110vw); } to { transform: translateX(-300px); } }
.school g g { animation: wiggle-fish 0.9s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
@keyframes wiggle-fish { to { transform: rotate(5deg) translateY(2px); } }

.fgrid { margin-top: 40px; }
.fcard { position: relative; padding: 18px 20px 22px; border-radius: 28px; background: #fffaf0; color: var(--ink); box-shadow: 0 14px 0 rgba(10, 60, 80, 0.18), 0 20px 40px rgba(5, 40, 60, 0.25); border: 3px solid #fff; transition: transform 0.25s ease; }
.fcard:nth-child(odd) { transform: rotate(-1deg); }
.fcard:nth-child(even) { transform: rotate(1deg); }
.fcard:hover { transform: translateY(-8px) rotate(0); }
.fcard h3 { margin: 12px 0 6px; font-size: 1.3rem; }
.fcard p { color: var(--muted); margin: 0; }
.fcard .who { margin-top: 10px; padding: 8px 12px; border-radius: 14px; background: rgba(255, 200, 87, 0.22); color: var(--navy); font-size: 0.92rem; font-weight: 500; }
.fart { height: 150px; border-radius: 20px; background: linear-gradient(180deg, #d9f3f6, #bfe8ee); display: grid; place-items: center; overflow: hidden; }
.fart svg { width: 100%; height: 100%; }
.tik-says { display: flex; align-items: center; gap: 16px; max-width: 640px; margin: 44px auto 0; padding: 16px 22px; border-radius: 26px; background: rgba(255, 255, 255, 0.14); border: 2px dashed rgba(255, 255, 255, 0.4); }
.tik-says svg { flex: 0 0 72px; height: 60px; }
.tik-says p { margin: 0; color: #fff; }

/* ── The dive goes on: each section a little deeper than the last ── */
.tour, .reef, .deep, .treasure, .seafloor { position: relative; overflow: hidden; color: #eafcfb; isolation: isolate; }
.tour h2, .reef h2, .deep h2, .treasure h2 { color: #fff; text-shadow: 0 3px 0 rgba(5, 30, 50, 0.35); }
.tour .lead, .reef .lead, .deep .lead, .treasure .lead { color: #cdeeee; }
.tour { padding: 64px 0 72px; background: linear-gradient(180deg, #1b6b8a, #175f7f); }

/* The tour of the islands: a row to swipe (or scroll) through, one card each. */
.isles { list-style: none; margin: 36px 0 0; padding: 8px max(var(--gutter), calc((100vw - var(--wrap)) / 2 + var(--gutter))) 26px; display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.4) transparent; }
.isle { flex: 0 0 min(270px, 78vw); scroll-snap-align: center; padding: 14px 16px 18px; border-radius: 26px; background: #fffaf0; color: var(--ink); box-shadow: 0 10px 0 rgba(5, 40, 60, 0.25); }
.isle-pic { height: 150px; border-radius: 18px; background: linear-gradient(180deg, var(--sky), #fff 140%); display: grid; place-items: end center; overflow: hidden; }
.isle-art { width: 92%; height: auto; margin-bottom: -6px; transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
.isle:hover .isle-art { transform: translateY(-6px) scale(1.04); }
.isle-no { display: inline-block; margin-top: 12px; padding: 2px 10px; border-radius: 999px; background: rgba(29, 167, 161, 0.14); color: var(--ocean-deep); font-size: 0.8rem; font-weight: 600; }
.isle h3 { margin: 6px 0 4px; }
.isle p { margin: 0; color: var(--muted); font-size: 0.97rem; }

/* The reef: real pictures as polaroids, and one in a phone. */
.reef { padding: 72px 0 80px; background: linear-gradient(180deg, #175f7f, #134f6e); }
.polaroids { display: grid; grid-template-columns: repeat(2, 1fr); gap: 34px 28px; margin-top: 40px; }
.polaroid { margin: 0; padding: 12px 12px 14px; background: #fffdf7; border-radius: 6px; box-shadow: 0 18px 34px rgba(0, 20, 40, 0.35); transform: rotate(var(--r, 0deg)); position: relative; }
.polaroid::before { content: ''; position: absolute; top: -12px; left: 50%; width: 92px; height: 26px; transform: translateX(-50%) rotate(-3deg); background: rgba(255, 220, 140, 0.75); border-radius: 3px; }
.polaroid img { border-radius: 3px; aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }
.polaroid figcaption { margin-top: 10px; text-align: center; color: var(--navy); font: 600 1.05rem/1.3 var(--font-display); }
.js .polaroid.reveal.is-in { transform: rotate(var(--r, 0deg)); }
.phone { grid-column: 1 / -1; justify-self: center; width: min(760px, 100%); margin: 8px 0 0; }
.phone-screen { padding: 14px 18px; border-radius: 34px; background: #10202b; box-shadow: inset 0 0 0 3px #2b3e4a, 0 22px 40px rgba(0, 20, 40, 0.4); }
.phone-screen img { border-radius: 18px; width: 100%; }
.phone figcaption { margin-top: 12px; text-align: center; color: #e6fbf9; font-weight: 500; }
@media (max-width: 700px) { .polaroids { grid-template-columns: 1fr; } }
.steps-sea { margin-top: 56px; }
.steps-sea li { background: rgba(255, 255, 255, 0.95); }

/* The deep: dark water, glowing motes, a Megalodon gliding by. */
.deep { padding: 96px 0 104px; background: linear-gradient(180deg, #134f6e 0%, #0e3352 30%, #081a2c 100%); }
.motes { position: absolute; inset: 0; z-index: -1; }
.mote { position: absolute; left: var(--x); top: var(--y); width: 4px; height: 4px; border-radius: 50%; background: #8ff0e4; box-shadow: 0 0 8px 2px rgba(143, 240, 228, 0.6); animation: mote 4s ease-in-out var(--d) infinite; }
@keyframes mote { 50% { opacity: 0.2; transform: translateY(-14px); } }
.mega { position: absolute; z-index: -1; top: 22%; left: 0; width: min(720px, 90vw); opacity: 0.9; animation: mega 38s linear infinite; }
@keyframes mega { from { transform: translateX(110vw); } to { transform: translateX(-120%); } }
.mega { transform-origin: center; }
.glow-stats .stat { background: rgba(143, 240, 228, 0.06); border-color: rgba(143, 240, 228, 0.25); }
.glow-stats .stat b { color: #fff3b0; text-shadow: 0 0 18px rgba(255, 200, 87, 0.75), 0 0 2px #ffc857; }
.glow-stats .stat span { color: #bfe7e3; }

/* The chest: GO, if you want it. */
.treasure { padding: 80px 0; background: linear-gradient(180deg, #081a2c, #0b2236); }
.small-note { color: #a9c9cf; font-size: 0.95rem; }
.btn-gold { background: var(--mango); color: var(--navy); box-shadow: 0 5px 0 #d9a23c, 0 12px 24px rgba(255, 200, 87, 0.25); }
.btn-gold:hover { color: var(--navy); }
.chest-wrap { display: grid; place-items: center; }
.chest { width: min(320px, 80%); filter: drop-shadow(0 18px 30px rgba(255, 200, 87, 0.25)); }
.chest-lid { transform-box: fill-box; transform-origin: 0% 100%; animation: lid 4s ease-in-out infinite; }
@keyframes lid { 0%, 60%, 100% { transform: none; } 75% { transform: rotate(-8deg); } }

/* The sea floor: the last questions, the big button, then sand. */
.seafloor { padding: 80px 0 0; background: linear-gradient(180deg, #0b2236 0%, #1d4f63 45%, #5b9c9c 80%, #c9dcc0 100%); }
.seafloor h2 { color: #fff; }
.seafloor .faq details { background: #fffaf0; }
.seafloor > .wrap > p.center a { color: #fff3b0; }
.final { margin: 48px auto 0; padding: 34px 24px 38px; max-width: 640px; border-radius: 32px; background: rgba(255, 255, 255, 0.92); color: var(--ink); box-shadow: 0 14px 0 rgba(5, 40, 60, 0.2); }
.final h2 { color: var(--navy); }
.final p { color: var(--muted); }
.floor-art { display: block; width: 100%; height: 160px; margin-top: 24px; }
.weed { animation: weed 4s ease-in-out var(--d, 0s) infinite alternate; }
@keyframes weed { to { transform: rotate(7deg); } }
.tik-walk { animation: tik-walk 30s linear infinite; }
@keyframes tik-walk { 0% { transform: translateX(200px); } 48% { transform: translateX(1400px); } 50% { transform: translateX(1400px) scaleX(-1); } 98% { transform: translateX(200px) scaleX(-1); } 100% { transform: translateX(200px); } }

/* Things float up into view (only when the script runs; without it everything is simply there). */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.34, 1.3, 0.64, 1); transition-delay: calc(var(--i, 0) * 90ms); }
.js .reveal.is-in { opacity: 1; transform: none; }
.js .fcard.reveal.is-in:nth-child(odd) { transform: rotate(-1deg); }
.js .fcard.reveal.is-in:nth-child(even) { transform: rotate(1deg); }
.js .fcard.reveal.is-in:hover { transform: translateY(-8px); }

/* A wave between sections (an SVG at the bottom edge). */
.wave-edge { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 70px; color: var(--cream); }
.wave-edge.to-foam { color: var(--foam); }

/* ── Sections ── */
.section { padding: 72px 0; }
.section-foam { background: var(--foam); }
.section-navy { background: var(--navy); color: #eaf6f5; }
.section-navy h2, .section-navy h3 { color: #fff; }
.section-navy a { color: var(--mango); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 720px; }
.center { text-align: center; }
.center .lead { margin-left: auto; margin-right: auto; }
.eyebrow { display: inline-block; margin-bottom: 10px; padding: 4px 12px; border-radius: 999px; background: rgba(29, 167, 161, 0.14); color: var(--ocean-deep); font-weight: 600; font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase; }

/* Feature cards */
.grid { display: grid; gap: 18px; grid-template-columns: repeat(3, 1fr); margin-top: 32px; }
@media (max-width: 960px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid { grid-template-columns: 1fr; } }
.card { background: var(--card); border-radius: var(--radius); padding: 24px 22px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.card p { color: var(--muted); margin: 0; }
.card h3 { margin-top: 12px; }
.card-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: rgba(29, 167, 161, 0.14); color: var(--ocean-deep); }
.card-icon svg { width: 28px; height: 28px; }
.card-icon.coral { background: rgba(247, 127, 87, 0.15); color: var(--coral-deep); }
.card-icon.mango { background: rgba(255, 200, 87, 0.3); color: #a06a00; }
.card-icon.navy { background: rgba(23, 59, 77, 0.1); color: var(--navy); }

/* Numbers strip */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 28px; }
.stat { text-align: center; padding: 18px 10px; border-radius: 18px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.15); }
.stat b { display: block; font: 700 2.2rem/1.1 var(--font-display); color: var(--mango); }
.stat span { font-size: 0.95rem; color: #cfe7e5; }

/* Screenshots */
.shots { display: grid; gap: 18px; grid-template-columns: repeat(2, 1fr); margin-top: 32px; }
@media (max-width: 700px) { .shots { grid-template-columns: 1fr; } }
.shot { margin: 0; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); }
.shot img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.shot figcaption { padding: 12px 16px 14px; color: var(--muted); font-size: 0.95rem; }
.shot-wide { grid-column: 1 / -1; }
.shot-wide img { aspect-ratio: auto; }

/* Steps */
.steps { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); counter-reset: step; }
.steps li { position: relative; padding: 26px 22px 22px 76px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); counter-increment: step; }
.steps li::before { content: counter(step); position: absolute; left: 20px; top: 22px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--mango); color: var(--navy); font: 700 1.2rem/1 var(--font-display); }
.steps h3 { margin-bottom: 4px; }
.steps p { margin: 0; color: var(--muted); }

/* A split block: text beside a picture */
.split { display: grid; gap: 32px; align-items: center; grid-template-columns: 1.1fr 1fr; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.split img { border-radius: var(--radius); box-shadow: var(--shadow); }

/* Call to action band */
.cta { position: relative; padding: 72px 0; background: linear-gradient(135deg, var(--ocean) 0%, #1793a6 100%); color: #fff; text-align: center; overflow: hidden; }
.cta h2 { color: #fff; }
.cta p { color: #e6fbf9; }
.cta .btn-ghost { background: rgba(255, 255, 255, 0.16); color: #fff; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.5); }

/* Notes and warnings */
.note { padding: 18px 20px; border-radius: 18px; background: rgba(29, 167, 161, 0.1); border: 1px solid rgba(29, 167, 161, 0.3); }
.warn { padding: 20px 22px; border-radius: 18px; background: #fff3e8; border: 2px solid rgba(247, 127, 87, 0.45); }
.warn h3 { color: var(--coral-deep); }
.warn ul { margin: 0; padding-left: 1.2em; }

/* Long text pages */
/* Each page's head: a strip of sky and sea with the page's own character (drawn by scripts/build-site.ts). */
.page-head { position: relative; overflow: hidden; padding: 56px 0 96px; background: linear-gradient(180deg, #a9e1ec 0%, #dff5f8 70%); isolation: isolate; }
.night .page-head { background: linear-gradient(180deg, #16243f 0%, #2f4277 75%); }
.night .page-head h1, .night .page-head p { color: #fff6e0; }
.night .page-head .eyebrow { background: rgba(255, 255, 255, 0.15); color: #fff; }
.page-head p { color: var(--navy-soft); margin: 0; font-size: 1.12rem; font-weight: 500; }
.page-head .wrap { position: relative; padding-right: 220px; }
.ph-art { position: absolute; z-index: -1; right: max(16px, calc((100vw - 1100px) / 2)); bottom: 46px; width: 230px; height: 190px; display: grid; place-items: end center; }
.ph-art svg { width: 100%; height: 100%; }
.ph-sea { position: absolute; z-index: -1; left: 0; right: 0; bottom: -1px; width: 100%; height: 90px; }
.pelly-hover { animation: bob 3s ease-in-out infinite; }
.dangle { transform-origin: 52px -56px; animation: dangle 2.6s ease-in-out infinite alternate; }
@keyframes dangle { from { transform: rotate(-7deg); } to { transform: rotate(7deg); } }
.page-head .lead + p { margin-top: 20px; }
@media (max-width: 760px) {
  .page-head { padding-bottom: 150px; }
  .page-head .wrap { padding-right: var(--gutter); }
  .ph-art { width: 150px; height: 120px; bottom: 36px; right: 16px; }
}
/* A long page reads in one column: its head lines up with its text. */
.page-head .wrap, .wrap.prose { max-width: calc(780px + 2 * var(--gutter)); }
.prose h2 { margin-top: 1.6em; font-size: 1.6rem; }
.prose h3 { margin-top: 1.3em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: 0.4em; }
table { width: 100%; border-collapse: collapse; margin: 1em 0 1.5em; font-size: 0.98rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--navy); background: rgba(29, 167, 161, 0.08); }
.table-scroll { overflow-x: auto; }
kbd { display: inline-block; min-width: 1.8em; padding: 1px 7px; border-radius: 7px; background: #fff; border: 1px solid var(--line); box-shadow: 0 2px 0 var(--line); font: 600 0.9em/1.5 var(--font-ui); text-align: center; }
code, .addr { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 0.88em; word-break: break-all; }

/* FAQ (details/summary, no script) */
.faq { display: grid; gap: 12px; margin-top: 24px; }
.faq details { background: var(--card); border-radius: 18px; border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(23, 59, 77, 0.06); }
.faq summary { cursor: pointer; padding: 16px 20px; font-weight: 600; color: var(--navy); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font: 700 1.3rem/1 var(--font-display); color: var(--ocean); }
.faq details[open] summary::after { content: '–'; }
.faq details > div { padding: 0 20px 16px; color: var(--muted); }
.faq details > div p:last-child { margin: 0; }

/* ── Footer ── */
.site-foot { background: var(--navy); color: #cfe2e6; padding: 48px 0 32px; font-size: 0.95rem; }
.foot-grid { display: grid; gap: 28px; grid-template-columns: 1.4fr 1fr 1fr; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr; } }
.site-foot h2 { font-size: 1rem; color: #fff; font-family: var(--font-ui); font-weight: 600; margin-bottom: 10px; }
.site-foot ul { list-style: none; padding: 0; margin: 0; }
.site-foot li { margin-bottom: 6px; }
.site-foot a { color: #e6f4f3; }
.site-foot a:hover { color: var(--mango); }
.foot-small { margin-top: 28px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, 0.12); color: #9fbcc4; font-size: 0.88rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
  .btn:hover { transform: none; }
  /* A still picture: nothing moves, nothing hides. */
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .leap-loop, .bubble, .school, .gulls, .pelly-fly { display: none; }
  .js .reveal { opacity: 1; transform: none; }
}
