@charset "UTF-8";
/* ==========================================================================
   OCEANS 97 — Deep Field
   Flat abyssal substrate. One accent. Restrained glass. No background art.
   Mobile-first: every rule below is phone-first, widened by min-width only.
   ========================================================================== */

/* ---------- Font: one family, self-hosted, variable ---------- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens ---------- */
:root {
  /* Substrate — flat, near-black with a blue undertone. Never a gradient blob. */
  --abyss:      #05080d;
  --abyss-rise: #080d15;
  --abyss-deep: #03060a;

  /* Ink */
  --ink:     #f2f6fa;
  --ink-2:   #a8b6c6;
  --ink-3:   #6f8093;
  --ink-4:   #48576a;

  /* The single accent — brand blue sampled from the Oceans 97 mark (#3078b4),
     lifted for legibility on the abyss. */
  --brand:  #3078b4;
  --lume:   #5ab6ee;
  --lume-d: #2b7fb8;

  /* Glass */
  --glass:        rgba(255, 255, 255, 0.038);
  --glass-strong: rgba(255, 255, 255, 0.062);
  --edge:         rgba(255, 255, 255, 0.075);
  --edge-bright:  rgba(255, 255, 255, 0.145);
  --specular:     rgba(255, 255, 255, 0.10);

  /* Elevation — dual-tone, neumorphic in feel but never puffy */
  --lift-1: 0 1px 2px rgba(0, 0, 0, 0.5), 0 6px 18px -10px rgba(0, 0, 0, 0.8);
  --lift-2: 0 1px 2px rgba(0, 0, 0, 0.5), 0 18px 44px -18px rgba(0, 0, 0, 0.9);
  --lift-3: 0 2px 4px rgba(0, 0, 0, 0.55), 0 34px 70px -26px rgba(0, 0, 0, 0.95);

  /* Rhythm */
  --gutter: clamp(1.15rem, 5vw, 2.5rem);
  --measure: 66ch;
  --shell: 1180px;
  --radius: 18px;
  --radius-s: 12px;
  --radius-l: 26px;

  /* Motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.4, 0, 0.2, 1);

  --band: clamp(4.5rem, 11vw, 8.5rem);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Anchor targets clear the sticky header */
  scroll-padding-top: 5.5rem;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--abyss);
  color: var(--ink-2);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
  /* Nothing may ever scroll sideways. clip (not hidden) keeps body from becoming
     a scroll container, which would unstick the header. */
  overflow-x: hidden;
  overflow-x: clip;
  min-height: 100svh;
}

img, picture, svg, video { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
ul, ol { list-style: none; padding: 0; }

::selection { background: color-mix(in srgb, var(--lume) 32%, transparent); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--lume);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Type scale ---------- */
h1, h2, h3, h4 {
  color: var(--ink);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.032em;
  text-wrap: balance;
}

.display {
  font-size: clamp(2.6rem, 10.5vw, 5.4rem);
  font-weight: 620;
  letter-spacing: -0.042em;
  line-height: 0.97;
}
h1 { font-size: clamp(2.15rem, 7.6vw, 3.7rem); }
h2 { font-size: clamp(1.72rem, 5.4vw, 2.85rem); }
h3 { font-size: clamp(1.12rem, 3.2vw, 1.42rem); letter-spacing: -0.022em; line-height: 1.25; }
h4 { font-size: 1rem; letter-spacing: -0.012em; }

p { text-wrap: pretty; }
.lede {
  font-size: clamp(1.06rem, 3.1vw, 1.32rem);
  line-height: 1.55;
  color: var(--ink-2);
  letter-spacing: -0.014em;
}

/* The eyebrow — small caps label in the accent. Used sparingly. */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--lume);
  margin-bottom: 1.1rem;
}
.eyebrow::before {
  content: '';
  width: 1.6rem;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
  flex: none;
}
.eyebrow.center { justify-content: center; }
.eyebrow.center::after {
  content: '';
  width: 1.6rem;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
  flex: none;
}

a { color: var(--lume); text-decoration: none; }
.prose a,
a.underline {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--lume) 40%, transparent);
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
  transition: text-decoration-color 0.25s var(--ease-io);
}
.prose a:hover, a.underline:hover { text-decoration-color: var(--lume); }

.prose > * + * { margin-top: 1.15em; }
.prose { max-width: var(--measure); }

/* ---------- Layout ---------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.shell-wide { max-width: 1380px; }
.band { padding-block: var(--band); }
.band-t { padding-top: var(--band); }
.band-b { padding-bottom: var(--band); }

/* A hairline rule — the primary separator. Boxes are the exception, not the rule. */
.rule {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--edge) 12%, var(--edge) 88%, transparent);
}

.stack   { display: flex; flex-direction: column; }
.gap-s   { gap: 0.75rem; }
.gap-m   { gap: 1.4rem; }
.gap-l   { gap: 2.4rem; }
.center  { text-align: center; }
.center .eyebrow { justify-content: center; }
.center .lede, .center .prose { margin-inline: auto; }

.grid { display: grid; gap: 1.1rem; }
@media (min-width: 640px)  { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 860px)  { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 640px)  { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } }

/* ==========================================================================
   GLASS — the core surface.
   Specular top edge + hairline border + blur. Restraint is the point:
   low alpha, thin borders, no coloured haze behind.
   ========================================================================== */
.glass {
  position: relative;
  background: linear-gradient(180deg, var(--glass-strong), var(--glass));
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 var(--specular), var(--lift-1);
  overflow: hidden;
  isolation: isolate;
}

/* The specular sweep — a thin band of light that traverses the surface on
   hover. This is the one flourish; it reads as physical glass, not decoration. */
.glass-sweep::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 38%,
    rgba(255, 255, 255, 0.07) 47%, rgba(255, 255, 255, 0.11) 50%,
    rgba(255, 255, 255, 0.07) 53%, transparent 62%);
  transform: translateX(-120%);
  transition: transform 0.85s var(--ease);
  pointer-events: none;
  z-index: 3;
}
@media (hover: hover) {
  .glass-sweep:hover::after, .glass-sweep:focus-within::after { transform: translateX(120%); }
}

.interactive {
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease-io),
              box-shadow 0.4s var(--ease);
}
@media (hover: hover) {
  .interactive:hover {
    transform: translateY(-3px);
    border-color: var(--edge-bright);
    box-shadow: inset 0 1px 0 var(--specular), var(--lift-2);
  }
}
/* Tactile: everything interactive physically depresses. */
.interactive:active { transform: translateY(0); transition-duration: 0.08s; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--glass-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  /* 48px min target on every device */
  min-height: 48px;
  padding: 0.82rem 1.5rem;
  border-radius: 999px;
  border: 1px solid var(--edge);
  background: var(--btn-bg);
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 550;
  letter-spacing: -0.008em;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 var(--specular), var(--lift-1);
  transition: transform 0.3s var(--ease), background 0.3s var(--ease-io),
              border-color 0.3s var(--ease-io), box-shadow 0.3s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
  .btn:hover {
    transform: translateY(-2px);
    border-color: var(--edge-bright);
    box-shadow: inset 0 1px 0 var(--specular), var(--lift-2);
  }
}
.btn:active { transform: translateY(1px) scale(0.988); transition-duration: 0.08s; }

.btn-primary {
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--brand) 88%, #ffffff 12%),
    var(--brand));
  border-color: color-mix(in srgb, var(--lume) 45%, transparent);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26),
              0 1px 2px rgba(0, 0, 0, 0.5),
              0 14px 34px -14px color-mix(in srgb, var(--brand) 75%, transparent);
}
@media (hover: hover) {
  .btn-primary:hover {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3),
                0 1px 2px rgba(0, 0, 0, 0.5),
                0 20px 44px -14px color-mix(in srgb, var(--brand) 88%, transparent);
  }
}
.btn-ghost { background: transparent; box-shadow: none; }
@media (hover: hover) { .btn-ghost:hover { background: var(--glass); } }
.btn-s { min-height: 40px; padding: 0.5rem 1.05rem; font-size: 0.85rem; }
.btn-full { width: 100%; }

.arrow { transition: transform 0.35s var(--ease); flex: none; }
@media (hover: hover) { .btn:hover .arrow, .card-link:hover .arrow { transform: translateX(3px); } }

/* ==========================================================================
   HEADER
   ========================================================================== */
.scroll-line {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--lume-d), var(--lume));
  z-index: 100;
  will-change: transform;
}

.header {
  position: sticky;
  top: 0;
  z-index: 90;
  padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--abyss) 72%, transparent);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid transparent;
  transition: background 0.4s var(--ease-io), border-color 0.4s var(--ease-io);
}
.header.stuck {
  background: color-mix(in srgb, var(--abyss-deep) 86%, transparent);
  border-bottom-color: var(--edge);
}
.header-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 60px;
}
@media (min-width: 900px) { .header-in { min-height: 72px; } }

.brand { display: flex; align-items: center; gap: 0.6rem; flex: none; }
.brand img { width: auto; height: 34px; }
@media (min-width: 900px) { .brand img { height: 40px; } }
.brand-txt { display: none; }

.nav-d { display: none; }
@media (min-width: 980px) {
  .nav-d { display: flex; align-items: center; gap: 0.15rem; }
  .nav-d a {
    position: relative;
    padding: 0.5rem 0.78rem;
    border-radius: 8px;
    color: var(--ink-2);
    font-size: 0.885rem;
    font-weight: 500;
    letter-spacing: -0.008em;
    transition: color 0.25s var(--ease-io), background 0.25s var(--ease-io);
  }
  .nav-d a:hover { color: var(--ink); background: var(--glass); }
  .nav-d a[aria-current='page'] { color: var(--ink); }
  /* Active marker: a small luminous dot, not an underline. */
  .nav-d a[aria-current='page']::after {
    content: '';
    position: absolute;
    left: 50%; bottom: 1px;
    width: 3px; height: 3px;
    margin-left: -1.5px;
    border-radius: 50%;
    background: var(--lume);
    box-shadow: 0 0 7px var(--lume);
  }
}
.header-cta { display: none; }
@media (min-width: 980px) { .header-cta { display: inline-flex; } }

/* Menu button — 44px target */
.menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  margin-right: -8px;
  border: 0;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
@media (min-width: 980px) { .menu-btn { display: none; } }
.menu-btn span {
  display: block;
  width: 19px; height: 1.5px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.42s var(--ease), opacity 0.2s var(--ease-io);
}
.menu-btn span + span { margin-top: 5px; }
.menu-btn[aria-expanded='true'] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.menu-btn[aria-expanded='true'] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded='true'] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Full-screen mobile menu */
.nav-m {
  position: fixed;
  inset: 0;
  z-index: 89;
  display: flex;
  flex-direction: column;
  padding: calc(env(safe-area-inset-top) + 76px) var(--gutter)
           calc(env(safe-area-inset-bottom) + 2rem);
  background: color-mix(in srgb, var(--abyss-deep) 92%, transparent);
  backdrop-filter: blur(30px) saturate(150%);
  -webkit-backdrop-filter: blur(30px) saturate(150%);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.35s var(--ease-io), transform 0.45s var(--ease), visibility 0.35s;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.nav-m.open { opacity: 1; visibility: visible; transform: none; }
.nav-m ul { display: flex; flex-direction: column; }
.nav-m li { border-bottom: 1px solid var(--edge); }
.nav-m a {
  /* staggered entrance */
  opacity: 0;
  transform: translateY(10px);
}
.nav-m li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.02rem 0.25rem;
  color: var(--ink);
  font-size: 1.32rem;
  font-weight: 550;
  letter-spacing: -0.024em;
}
/* Short phones: every item stays on screen without scrolling. */
@media (max-height: 760px) {
  .nav-m li a { padding: 0.74rem 0.25rem; font-size: 1.18rem; }
  .nav-m-foot { padding-top: 1.2rem; }
}
.nav-m.open a { animation: navIn 0.55s var(--ease) forwards; }
.nav-m li a span { color: var(--ink-4); font-size: 0.78rem; font-weight: 500; letter-spacing: 0.04em; }
.nav-m li a[aria-current='page'] { color: var(--lume); }
@keyframes navIn { to { opacity: 1; transform: none; } }
.nav-m-foot { margin-top: auto; padding-top: 2rem; }

body.locked { overflow: hidden; }

/* ==========================================================================
   HERO
   ========================================================================== */
.hero { position: relative; padding-top: clamp(2.5rem, 8vw, 4.5rem); padding-bottom: clamp(2rem, 6vw, 3.5rem); }
.hero-grid { display: grid; gap: clamp(2.2rem, 6vw, 3rem); align-items: center; }
@media (min-width: 940px) {
  .hero-grid { grid-template-columns: 1.02fr 0.98fr; gap: 3.5rem; }
}
.hero h1 { margin-bottom: 1.25rem; }
.hero .lede { max-width: 34ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.9rem; }
@media (max-width: 400px) { .hero-actions .btn { width: 100%; } }

/* The hero product sits on a soft contact shadow — grounded, not floating in a haze. */
.hero-art { position: relative; }
.hero-art img { width: 100%; filter: drop-shadow(0 34px 46px rgba(0, 0, 0, 0.62)); }
.hero-art::after {
  content: '';
  position: absolute;
  left: 50%; bottom: 2%;
  width: 62%; height: 14px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.55), transparent 72%);
  filter: blur(9px);
  z-index: -1;
}

/* Trust strip under the hero */
.trust {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 1.5rem;
  font-size: 0.775rem;
  font-weight: 500;
  letter-spacing: 0.075em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.trust li { display: flex; align-items: center; gap: 0.5rem; }
.trust li::before {
  content: '';
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--lume);
  opacity: 0.75;
  flex: none;
}

/* ==========================================================================
   STATS
   ========================================================================== */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--edge); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--edge); }
@media (min-width: 780px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--abyss); padding: clamp(1.3rem, 4vw, 2rem) clamp(1rem, 3vw, 1.5rem); }
.stat-v {
  display: flex;
  align-items: baseline;
  gap: 0.05em;
  font-size: clamp(2rem, 7vw, 2.9rem);
  font-weight: 640;
  letter-spacing: -0.045em;
  color: var(--ink);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-v em { font-style: normal; color: var(--lume); font-size: 0.62em; }
.stat-l { margin-top: 0.6rem; font-size: 0.895rem; font-weight: 500; color: var(--ink); letter-spacing: -0.01em; }
.stat-s { margin-top: 0.12rem; font-size: 0.78rem; color: var(--ink-3); }

/* ==========================================================================
   PRODUCT CARDS
   ========================================================================== */
.p-card {
  display: flex;
  flex-direction: column;
  /* --tint is set per flavor inline; used only at low intensity. */
  --tint: var(--brand);
}
.p-card-art {
  position: relative;
  display: grid;
  place-items: center;
  padding: clamp(1.4rem, 4vw, 2rem) clamp(1rem, 3vw, 1.6rem) 0.5rem;
  background:
    radial-gradient(120% 88% at 50% 108%,
      color-mix(in srgb, var(--tint) 15%, transparent), transparent 68%);
}
.p-card-art img {
  width: 100%;
  max-width: 258px;
  transition: transform 0.55s var(--ease), filter 0.55s var(--ease);
  filter: drop-shadow(0 16px 22px rgba(0, 0, 0, 0.58));
}
@media (hover: hover) {
  .p-card:hover .p-card-art img {
    transform: translateY(-6px) scale(1.028);
    filter: drop-shadow(0 26px 34px rgba(0, 0, 0, 0.7));
  }
}
.p-card-body { padding: 0.4rem clamp(1.1rem, 3.4vw, 1.6rem) clamp(1.3rem, 3.6vw, 1.7rem); display: flex; flex-direction: column; flex: 1; }
.p-card h3 { margin-bottom: 0.4rem; }
.p-card-note {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  font-size: 0.715rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--tint) 78%, #ffffff);
  margin-bottom: 0.7rem;
}
.p-card-note::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--tint);
  box-shadow: 0 0 8px color-mix(in srgb, var(--tint) 70%, transparent);
  flex: none;
}
.p-card p { font-size: 0.92rem; line-height: 1.6; }
.p-card-foot { margin-top: auto; padding-top: 1.15rem; display: flex; align-items: center; gap: 0.6rem; }

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.885rem;
  font-weight: 550;
  color: var(--lume);
}

/* Stretched link — whole card is the target, buttons inside stay clickable. */
.stretch::before { content: ''; position: absolute; inset: 0; z-index: 2; }
.above { position: relative; z-index: 4; }

/* ==========================================================================
   NUTRITION PANEL — real HTML, not a photograph of a label.
   ========================================================================== */
.nfp {
  max-width: 380px;
  padding: 1.5rem 1.45rem;
  font-variant-numeric: tabular-nums;
}
.nfp-h { font-size: clamp(1.9rem, 6vw, 2.35rem); font-weight: 750; letter-spacing: -0.045em; line-height: 0.94; color: var(--ink); }
.nfp hr { border: 0; height: 1px; background: var(--edge); margin: 0.72rem 0; }
.nfp hr.thick { height: 6px; background: var(--edge-bright); border-radius: 1px; }
.nfp hr.med { height: 3px; background: var(--edge-bright); border-radius: 1px; }
.nfp-serv { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.875rem; }
.nfp-cal { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.nfp-cal span { font-size: 0.95rem; font-weight: 650; color: var(--ink); }
.nfp-cal strong { font-size: clamp(2.1rem, 7vw, 2.7rem); font-weight: 750; letter-spacing: -0.05em; color: var(--ink); line-height: 1; }
.nfp-dv { display: flex; justify-content: flex-end; font-size: 0.78rem; font-weight: 600; color: var(--ink); }
.nfp-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.44rem 0; border-top: 1px solid var(--edge); font-size: 0.875rem; }
.nfp-row:first-of-type { border-top: 0; }
.nfp-row b { font-weight: 600; color: var(--ink); }
.nfp-row .ind { padding-left: 1.05rem; font-weight: 400; color: var(--ink-2); }
.nfp-row .dv { font-weight: 600; color: var(--ink); }
.nfp-micro { display: flex; justify-content: space-between; gap: 0.6rem; font-size: 0.78rem; padding: 0.28rem 0; }
.nfp-note { font-size: 0.7rem; line-height: 1.45; color: var(--ink-3); }

/* Protein bar — the one number worth drawing attention to. */
.protein { margin-top: 1.15rem; }
.protein-t { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.78rem; color: var(--ink-3); margin-bottom: 0.42rem; }
.protein-t b { color: var(--ink); font-size: 0.95rem; font-weight: 600; }
.protein-bar { height: 5px; border-radius: 3px; background: var(--glass-strong); overflow: hidden; border: 1px solid var(--edge); }
.protein-fill {
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--lume-d), var(--lume));
  transition: width 1.5s var(--ease);
}
.is-in .protein-fill { width: var(--pct, 36%); }

/* ---------- Scoville scale (Jalapeño only) ---------- */
.scoville { margin-top: 1.4rem; }
.scoville-t { display: flex; justify-content: space-between; font-size: 0.74rem; color: var(--ink-3); margin-bottom: 0.5rem; }
.scoville-track { position: relative; height: 6px; border-radius: 3px; background: linear-gradient(90deg, #2f6b46, #b0932f, #b8452f); opacity: 0.42; }
.scoville-band {
  position: absolute; top: -3px; height: 12px;
  border-radius: 3px;
  border: 1.5px solid var(--ink);
  background: color-mix(in srgb, var(--ink) 18%, transparent);
  backdrop-filter: blur(2px);
}
.scoville-l { display: flex; justify-content: space-between; font-size: 0.68rem; color: var(--ink-4); margin-top: 0.42rem; letter-spacing: 0.03em; }

/* ==========================================================================
   INGREDIENTS / SPEC LIST
   ========================================================================== */
.spec { display: grid; gap: 0; }
.spec-row { display: grid; gap: 0.25rem 1.5rem; padding: 0.95rem 0; border-top: 1px solid var(--edge); }
@media (min-width: 620px) { .spec-row { grid-template-columns: 12rem 1fr; align-items: baseline; } }
.spec-row:first-child { border-top: 0; }
.spec-k { font-size: 0.735rem; font-weight: 600; letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-3); }
.spec-v { color: var(--ink); font-size: 0.95rem; line-height: 1.55; }
.spec-v.muted { color: var(--ink-2); font-size: 0.875rem; }

/* ==========================================================================
   RECIPES
   ========================================================================== */
.r-card { display: flex; flex-direction: column; }
.r-card-art { position: relative; aspect-ratio: 16 / 11; overflow: hidden; background: var(--abyss-rise); }
.r-card-art img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.75s var(--ease); }
@media (hover: hover) { .r-card:hover .r-card-art img { transform: scale(1.045); } }
.r-card-body { padding: clamp(1.15rem, 3.4vw, 1.55rem); display: flex; flex-direction: column; flex: 1; }
.r-card h3 { margin-bottom: 0.5rem; }
.r-card p { font-size: 0.9rem; line-height: 1.58; }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
  padding: 0.3rem 0.66rem;
  border-radius: 999px;
  border: 1px solid var(--edge);
  background: var(--glass);
  font-size: 0.72rem;
  font-weight: 550;
  letter-spacing: 0.015em;
  color: var(--ink-2);
}
.chip i { width: 5px; height: 5px; border-radius: 50%; background: var(--tint, var(--lume)); flex: none; }

/* Recipe detail */
.recipe-layout { display: grid; gap: clamp(2rem, 5vw, 3rem); }
@media (min-width: 900px) { .recipe-layout { grid-template-columns: 0.85fr 1.15fr; align-items: start; } }
@media (min-width: 900px) { .recipe-aside { position: sticky; top: 6rem; } }

.ing li {
  display: flex;
  gap: 0.85rem;
  padding: 0.62rem 0;
  border-top: 1px solid var(--edge);
  font-size: 0.925rem;
  line-height: 1.5;
}
.ing li:first-child { border-top: 0; }
.ing li::before {
  content: '';
  flex: none;
  width: 5px; height: 5px;
  margin-top: 0.6em;
  border-radius: 50%;
  background: var(--lume);
  opacity: 0.6;
}
.ing li.uses { color: var(--ink); font-weight: 500; }
.ing li.uses::before { opacity: 1; box-shadow: 0 0 8px var(--lume); }

.steps { counter-reset: s; display: flex; flex-direction: column; gap: 1.6rem; }
.steps li { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start; }
.steps li::before {
  counter-increment: s;
  content: counter(s, decimal-leading-zero);
  display: grid;
  place-items: center;
  width: 2.1rem; height: 2.1rem;
  border-radius: 50%;
  border: 1px solid var(--edge);
  background: var(--glass);
  box-shadow: inset 0 1px 0 var(--specular);
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--lume);
}
.steps li p { font-size: 0.95rem; line-height: 1.66; }

/* ==========================================================================
   AVAILABILITY
   ========================================================================== */
.retailer { padding: clamp(1.2rem, 3.5vw, 1.6rem); }
.retailer-h { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.9rem; }
.retailer h3 { font-size: clamp(1.05rem, 3vw, 1.22rem); }
.pill {
  flex: none;
  padding: 0.24rem 0.6rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--lume) 32%, transparent);
  background: color-mix(in srgb, var(--lume) 11%, transparent);
  color: var(--lume);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}
.states { display: flex; flex-wrap: wrap; gap: 0.36rem; }
.state {
  padding: 0.28rem 0.6rem;
  border-radius: 7px;
  background: var(--glass);
  border: 1px solid var(--edge);
  font-size: 0.775rem;
  color: var(--ink-2);
  letter-spacing: -0.005em;
}
.retailer-map { margin-top: 1.1rem; border-radius: var(--radius-s); overflow: hidden; border: 1px solid var(--edge); background: var(--abyss-rise); }
.retailer-map img { width: 100%; }

/* ==========================================================================
   PRESS
   ========================================================================== */
.press-item {
  display: grid;
  gap: 1rem;
  padding: clamp(1.1rem, 3.4vw, 1.5rem);
  align-items: start;
}
@media (min-width: 680px) { .press-item { grid-template-columns: 150px 1fr; gap: 1.5rem; } }
.press-art { border-radius: var(--radius-s); overflow: hidden; aspect-ratio: 4 / 3; background: var(--abyss-rise); border: 1px solid var(--edge); }
.press-art img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease); }
@media (hover: hover) { .press-item:hover .press-art img { transform: scale(1.05); } }
.press-kind {
  display: inline-block;
  font-size: 0.665rem;
  font-weight: 650;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.55rem;
}
.press-item h3 { font-size: clamp(1.02rem, 2.8vw, 1.2rem); margin-bottom: 0.5rem; line-height: 1.32; }
.press-item p { font-size: 0.895rem; line-height: 1.58; }
.press-meta { margin-top: 0.8rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; font-size: 0.79rem; color: var(--ink-3); }

/* ==========================================================================
   CERTIFICATIONS / PARTNER LOGOS
   ========================================================================== */
.cert {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: clamp(1.3rem, 3.6vw, 1.7rem);
  min-height: 100%;
}
.cert-logo {
  --plate: 62px;
  display: grid;
  place-items: center;
  height: var(--plate);
  padding: 0.7rem 1rem;
  border-radius: var(--radius-s);
  /* Logos are supplied on white; a light plate keeps them legible and honest
     rather than inverting brand marks we do not own. */
  background: rgba(255, 255, 255, 0.93);
  overflow: hidden;
}
/* Percentage max-height is ignored inside an auto-sized grid track, so the
   logo is bounded in pixels against the plate it sits on. */
.cert-logo img {
  height: auto;
  width: auto;
  max-width: 100%;
  max-height: calc(var(--plate) - 1.4rem);
  object-fit: contain;
}
.cert h3 { font-size: 0.99rem; line-height: 1.35; }
.cert-link { margin-top: auto; padding-top: 0.9rem; font-size: 0.83rem; }

/* ==========================================================================
   CTA BAND
   ========================================================================== */
.cta {
  position: relative;
  padding: clamp(2.2rem, 6vw, 3.4rem) clamp(1.3rem, 4.5vw, 3rem);
  text-align: center;
  border-radius: var(--radius-l);
}
.cta h2 { margin-bottom: 0.85rem; }
.cta .lede { max-width: 46ch; margin-inline: auto; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; justify-content: center; margin-top: 1.9rem; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  border-top: 1px solid var(--edge);
  background: var(--abyss-deep);
  padding-bottom: calc(env(safe-area-inset-bottom) + 2rem);
}
.footer-grid { display: grid; gap: 2.4rem; padding-block: clamp(2.6rem, 7vw, 4rem); }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; gap: 3rem; } }
.footer h4, .footer .foot-h { font-size: 0.735rem; font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 1rem; }
.footer-links { display: flex; flex-direction: column; gap: 0.6rem; }
.footer-links a { color: var(--ink-2); font-size: 0.9rem; transition: color 0.25s var(--ease-io); }
.footer-links a:hover { color: var(--ink); }
.footer-brand img { height: 46px; width: auto; margin-bottom: 1.1rem; }
.footer-brand p { font-size: 0.875rem; max-width: 38ch; }
.footer-bot {
  display: flex; flex-wrap: wrap; gap: 0.7rem 1.5rem;
  justify-content: space-between; align-items: center;
  padding-top: 1.6rem;
  border-top: 1px solid var(--edge);
  font-size: 0.78rem;
  color: var(--ink-4);
}
.sig { height: 34px; width: auto; opacity: 0.5; }

/* ==========================================================================
   EDITORIAL / IMAGERY
   ========================================================================== */
.figure { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--edge); background: var(--abyss-rise); box-shadow: var(--lift-2); }
.figure img { width: 100%; }
.figure figcaption { padding: 0.85rem 1.1rem; font-size: 0.79rem; color: var(--ink-3); border-top: 1px solid var(--edge); }

.split { display: grid; gap: clamp(2rem, 5vw, 3.2rem); align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .split-r > *:first-child { order: 2; } }

.portrait { position: relative; }
.portrait img { width: 100%; filter: drop-shadow(0 26px 40px rgba(0, 0, 0, 0.6)); }

.quote {
  padding: clamp(1.4rem, 4vw, 2.1rem);
  border-left: 2px solid var(--lume);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.quote p { font-size: clamp(1.05rem, 3vw, 1.24rem); line-height: 1.52; color: var(--ink); letter-spacing: -0.016em; }
.quote cite { display: block; margin-top: 0.9rem; font-style: normal; font-size: 0.82rem; color: var(--ink-3); }

/* Page hero for interior pages */
.phero { padding-top: clamp(2.6rem, 8vw, 4.5rem); padding-bottom: clamp(1.6rem, 4vw, 2.4rem); }
.phero .lede { max-width: 52ch; }

.crumb { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: var(--ink-4); margin-bottom: 1.1rem; }
.crumb a { color: var(--ink-3); }
.crumb a:hover { color: var(--lume); }

/* Section heading block */
.sec-h { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: flex-end; justify-content: space-between; margin-bottom: clamp(1.8rem, 4.5vw, 2.6rem); }
.sec-h .lede { max-width: 48ch; margin-top: 0.7rem; }

/* Prev/next flavor rail */
.rail { display: flex; gap: 0.7rem; overflow-x: auto; padding-bottom: 0.5rem; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; flex: 0 0 clamp(150px, 42vw, 190px); }
.rail-item { padding: 0.9rem; display: flex; flex-direction: column; gap: 0.6rem; --tint: var(--brand); }
.rail-item img { width: 100%; max-width: 118px; margin-inline: auto; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.5)); }
.rail-item span { font-size: 0.83rem; font-weight: 550; color: var(--ink); letter-spacing: -0.012em; }

/* ==========================================================================
   MOTION — reveal on scroll. Subtle, once, and fully opt-out.
   ========================================================================== */
.reveal { opacity: 0; transform: translateY(15px); }
.reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.75s var(--ease) var(--d, 0ms), transform 0.75s var(--ease) var(--d, 0ms);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .glass-sweep::after { display: none; }
  .protein-fill { transition: none; }
}

/* No-JS: never hide content behind an animation that will not run. */
.no-js .reveal { opacity: 1; transform: none; }

/* Cross-page transitions where supported — a quiet fade, nothing theatrical. */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) { animation: vtOut 0.2s var(--ease-io) both; }
  ::view-transition-new(root) { animation: vtIn 0.32s var(--ease) both; }
}
@keyframes vtOut { to { opacity: 0; } }
@keyframes vtIn { from { opacity: 0; transform: translateY(6px); } }

/* Utilities */
.muted { color: var(--ink-3); }
.small { font-size: 0.85rem; }
.xs { font-size: 0.775rem; }
.mt-s { margin-top: 0.8rem; }
.mt-m { margin-top: 1.5rem; }
.mt-l { margin-top: 2.6rem; }
.tint-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tint); box-shadow: 0 0 10px var(--tint); flex: none; }
.sr {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; top: 0; left: 0;
  transform: translateY(-120%);
  z-index: 200;
  margin: 0.6rem;
  transition: transform 0.25s var(--ease);
}
.skip:focus { transform: none; }

/* The signature invites a tap. */
.sig { cursor: pointer; transition: opacity 0.3s; }
.sig:hover { opacity: 0.85; }

/* Numbers are always the true value. They arrive; they never count. */
.counted .stat-v, .counted .fact-v { animation: numIn 0.55s var(--ease) both; }
@keyframes numIn { from { opacity: 0.35; transform: translateY(6px) scale(0.96); } }
@media (prefers-reduced-motion: reduce) { .counted .stat-v, .counted .fact-v { animation: none; } }

/* ---------- The can stack: current packaging, pyramid like the old photo ---------- */
.can-stack { position: relative; width: 100%; max-width: 560px; margin-inline: auto; padding-top: 0.5rem; }
.cs-row { display: flex; justify-content: center; align-items: flex-end; gap: 2%; }
.cs-row img {
  width: 30%;
  height: auto;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.55));
  transition: transform 0.55s var(--ease);
}
/* The top pair tucks in behind the bottom row, the way stacked cans sit. */
.cs-top { position: relative; z-index: 1; transform: translateY(12%); }
.cs-bottom { position: relative; z-index: 2; }
@media (hover: hover) {
  .can-stack:hover .cs-top img { transform: translateY(-4px); }
}

/* Credit line under the footer. */
.footer-credit {
  margin-top: 1.4rem;
  font-size: 0.74rem;
  line-height: 1.8;
  color: var(--ink-4);
  text-align: center;
}
.footer-credit a {
  color: var(--ink-3);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255, 255, 255, 0.22);
  transition: color 0.2s var(--ease-io);
}
.footer-credit a:hover { color: var(--ink); }

/* The menu's CTA and social buttons: centered content, always. */
.nav-m-foot .btn { justify-content: center; text-align: center; }
.nav-m-foot .socials { display: flex; justify-content: center; gap: 0.7rem; }
.nav-m-foot .soc-icon, .soc-icon { display: inline-grid; place-items: center; padding: 0; }
.soc-icon svg { display: block; }

/* Credit block: the Outlier.Systems mark above the two lines. */
.footer-credit { display: grid; justify-items: center; gap: 0.55rem; }
.footer-credit p { margin: 0; }
.credit-mark { display: inline-block; line-height: 0; opacity: 0.85; transition: opacity 0.25s var(--ease-io), transform 0.3s var(--ease); }
.credit-mark img { height: 40px; width: auto; filter: drop-shadow(0 0 10px rgba(120, 90, 255, 0.35)); }
.credit-mark:hover { opacity: 1; transform: translateY(-2px); }

/* ==========================================================================
   THEME: REEF
   An underwater world — descending from the sunlit shallows to the abyss.
   Flat vector life, saturated colour, playful motion. Everything here is
   scoped to [data-theme="reef"]; Deep Field is untouched.
   ========================================================================== */

/* ---------- Theme switch control ---------- */
.theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 999px;
  border: 1px solid var(--edge);
  background: var(--glass-strong);
  color: var(--lume);
  cursor: pointer;
  box-shadow: inset 0 1px 0 var(--specular);
  transition: transform 0.4s var(--ease), color 0.35s var(--ease-io),
              border-color 0.35s var(--ease-io), background 0.35s var(--ease-io);
  -webkit-tap-highlight-color: transparent;
}
.theme-btn .ico { transition: transform 0.55s var(--ease); }
@media (hover: hover) {
  .theme-btn:hover { border-color: var(--edge-bright); transform: translateY(-2px); }
  .theme-btn:hover .ico { transform: translateY(1.5px); }
}
.theme-btn:active { transform: translateY(1px) scale(0.94); transition-duration: 0.08s; }

/* Sprite icons */
.ico { display: block; flex: none; }

/* ==========================================================================
   Token swap
   ========================================================================== */
[data-theme='reef'] {
  --abyss:      #052033;
  --abyss-rise: #073047;
  --abyss-deep: #03121f;

  --ink:   #f4fbff;
  --ink-2: #b7d5e6;
  --ink-3: #7fa8c0;
  --ink-4: #5b809a;

  --brand: #00a6c4;
  --lume:  #3dd9c0;
  --lume-d: #00a6c4;

  --glass:        rgba(255, 255, 255, 0.055);
  --glass-strong: rgba(255, 255, 255, 0.095);
  --edge:         rgba(160, 232, 255, 0.155);
  --edge-bright:  rgba(160, 232, 255, 0.34);
  --specular:     rgba(255, 255, 255, 0.16);

  /* Creature palette */
  --c-coral: #ff7a59;
  --c-kelp:  #4ecb71;
  --c-sun:   #ffd166;
  --c-jelly: #e85d9e;
  --c-aqua:  #3dd9c0;

  /* Rounder, friendlier geometry */
  --radius:   26px;
  --radius-s: 18px;
  --radius-l: 34px;
}

/* The depth gradient: sunlit shallows at the top of the document, abyss at the
   bottom. Fixed behind the content so scrolling reads as descending. This is a
   vertical depth ramp, not ambient background art. */
[data-theme='reef'] body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background: linear-gradient(180deg,
    #0d6e93 0%, #0a5b80 12%, #084a6c 26%,
    #063b58 44%, #052d45 62%, #041f31 80%, #03121f 100%);
}

/* Sunlight shafts from the surface — soft-edged beams that drift, so where
   they cross you get a gentle brightening, not a hard-edged polygon. */
[data-theme='reef'] body::after {
  content: '';
  position: fixed;
  inset: 0 0 auto 0;
  height: 78svh;
  z-index: -1;
  pointer-events: none;
  opacity: 0.55;
  background:
    linear-gradient(172deg, transparent 0%, rgba(190,245,255,0.10) 1.6%, rgba(190,245,255,0.10) 2.6%, transparent 4.4%) 6% 0/38% 100% no-repeat,
    linear-gradient(186deg, transparent 0%, rgba(190,245,255,0.07) 1.3%, rgba(190,245,255,0.07) 2.1%, transparent 3.6%) 34% 0/34% 100% no-repeat,
    linear-gradient(177deg, transparent 0%, rgba(190,245,255,0.09) 1.5%, rgba(190,245,255,0.09) 2.4%, transparent 4.1%) 62% 0/40% 100% no-repeat,
    linear-gradient(191deg, transparent 0%, rgba(190,245,255,0.06) 1.2%, rgba(190,245,255,0.06) 1.9%, transparent 3.3%) 88% 0/30% 100% no-repeat;
  mask-image: linear-gradient(180deg, #000 0%, #000 34%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 34%, transparent 100%);
  animation: shaftDrift 16s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes shaftDrift { to { transform: translateX(2.2%); } }
@media (prefers-reduced-motion: reduce) { [data-theme='reef'] body::after { animation: none; } }

[data-theme='reef'] .header {
  background: color-mix(in srgb, #06364f 66%, transparent);
}
[data-theme='reef'] .header.stuck {
  background: color-mix(in srgb, #052a3f 88%, transparent);
}
[data-theme='reef'] .nav-m { background: color-mix(in srgb, #052a3f 94%, transparent); }
[data-theme='reef'] .footer { background: #03121f; }

/* Bolder, rounder type in the Reef world */
[data-theme='reef'] h1,
[data-theme='reef'] h2,
[data-theme='reef'] .display { font-weight: 700; letter-spacing: -0.038em; }
[data-theme='reef'] .display { letter-spacing: -0.046em; }

[data-theme='reef'] .eyebrow { letter-spacing: 0.16em; }

[data-theme='reef'] .btn-primary {
  background: linear-gradient(180deg, #4ee6cc, #10b3a4);
  border-color: rgba(255, 255, 255, 0.4);
  color: #04303a;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5),
              0 1px 2px rgba(0, 0, 0, 0.4),
              0 16px 32px -14px rgba(61, 217, 192, 0.72);
}
@media (hover: hover) {
  [data-theme='reef'] .btn-primary:hover {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55),
                0 1px 2px rgba(0, 0, 0, 0.4),
                0 22px 44px -14px rgba(61, 217, 192, 0.9);
  }
}

[data-theme='reef'] .stat { background: rgba(4, 32, 50, 0.62); }
[data-theme='reef'] .stat-v em { color: var(--c-sun); }
[data-theme='reef'] .steps li::before { color: var(--c-aqua); }
[data-theme='reef'] .pill {
  border-color: rgba(255, 209, 102, 0.5);
  background: rgba(255, 209, 102, 0.16);
  color: var(--c-sun);
}
[data-theme='reef'] .quote { border-left-color: var(--c-sun); }

/* The nutrition panel becomes a bright instrument card */
[data-theme='reef'] .nfp { background: linear-gradient(180deg, rgba(255,255,255,.13), rgba(255,255,255,.06)); }
[data-theme='reef'] .protein-fill { background: linear-gradient(90deg, var(--c-aqua), var(--c-sun)); }

/* ==========================================================================
   Illustration layers — Reef only
   ========================================================================== */
.reef-life, .seabed, .bubbles { display: none; }

[data-theme='reef'] .reef-life,
[data-theme='reef'] .bubbles {
  display: block;
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
[data-theme='reef'] .seabed { display: block; }

/* Content must always sit above the decoration. */
[data-theme='reef'] .has-life { position: relative; }
[data-theme='reef'] .has-life > *:not(.reef-life):not(.bubbles):not(.seabed) { position: relative; z-index: 1; }

.rl {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: scale(var(--s));
  opacity: 0.5;
  animation: drift var(--dur, 18s) ease-in-out var(--delay, 0s) infinite;
}
.rl-fish, .rl-fish2 { animation-name: swim; }
.rl-turtle { animation-name: swim; opacity: 0.38; }

@keyframes drift {
  0%, 100% { transform: scale(var(--s)) translate(0, 0) rotate(0deg); }
  33%      { transform: scale(var(--s)) translate(10px, -16px) rotate(4deg); }
  66%      { transform: scale(var(--s)) translate(-8px, 10px) rotate(-3deg); }
}
@keyframes swim {
  0%   { transform: scale(var(--s)) translateX(-40px); }
  50%  { transform: scale(var(--s)) translateX(40px); }
  100% { transform: scale(var(--s)) translateX(-40px); }
}

.bub {
  position: absolute;
  left: var(--x);
  bottom: -40px;
  transform: scale(var(--s));
  opacity: 0;
  animation: rise var(--dur, 14s) linear var(--delay, 0s) infinite;
}
@keyframes rise {
  0%   { opacity: 0;   transform: scale(var(--s)) translateY(0) translateX(0); }
  10%  { opacity: 0.6; }
  50%  { transform: scale(var(--s)) translateY(-46vh) translateX(14px); }
  90%  { opacity: 0.35; }
  100% { opacity: 0; transform: scale(var(--s)) translateY(-92vh) translateX(-10px); }
}

/* Seabed: a strip of coral and kelp that closes a section. */
[data-theme='reef'] .seabed {
  position: relative;
  height: 96px;
  margin-top: -18px;
  pointer-events: none;
}
[data-theme='reef'] .seabed::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 100vw;
  margin-left: -50vw;
  height: 34px;
  background: linear-gradient(180deg, transparent, rgba(4, 24, 38, 0.85));
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.sb {
  position: absolute;
  bottom: 6px;
  left: var(--x);
  transform: scale(var(--s));
  transform-origin: bottom center;
  opacity: 0.6;
  animation: sway 7s ease-in-out var(--d, 0s) infinite;
}
@keyframes sway {
  0%, 100% { transform: scale(var(--s)) rotate(-2.5deg); }
  50%      { transform: scale(var(--s)) rotate(2.5deg); }
}

/* ==========================================================================
   Symbolic section markers — one creature/glyph per section
   ========================================================================== */
.sym {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 18px;
  border: 1px solid var(--edge);
  background: var(--glass-strong);
  box-shadow: inset 0 1px 0 var(--specular);
  color: var(--lume);
  margin-bottom: 1.1rem;
  transition: transform 0.5s var(--ease), border-color 0.4s var(--ease-io);
}
[data-theme='reef'] .sym { border-radius: 50%; }
@media (hover: hover) {
  .glass:hover > .sym, .sym:hover { transform: translateY(-2px) rotate(-4deg); border-color: var(--edge-bright); }
}
.sym-coral  { color: var(--c-kelp, #4ecb71); }
.sym-warm   { color: var(--c-coral, #ff7a59); }
.sym-sun    { color: var(--c-sun, #ffd166); }
.sym-jelly  { color: var(--c-jelly, #e85d9e); }

/* ==========================================================================
   Green Reef Foundation
   ========================================================================== */
.reef-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-l);
  padding: clamp(1.8rem, 6vw, 3.4rem);
  background: linear-gradient(160deg, rgba(78, 203, 113, 0.15), rgba(0, 166, 196, 0.09));
  border: 1px solid var(--edge);
  box-shadow: inset 0 1px 0 var(--specular), var(--lift-2);
}
.reef-logo {
  display: inline-grid;
  place-items: center;
  width: 76px; height: 76px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--edge);
  margin-bottom: 1.2rem;
  color: var(--c-kelp, #4ecb71);
}

.pillar { padding: clamp(1.3rem, 3.6vw, 1.8rem); display: flex; flex-direction: column; height: 100%; }
.pillar h3 { margin-bottom: 0.55rem; }
.pillar p { font-size: 0.92rem; line-height: 1.62; }

.fact { padding: clamp(1.2rem, 3.4vw, 1.7rem); }
.fact-v {
  display: flex; align-items: baseline; gap: 0.04em;
  font-size: clamp(2.1rem, 8vw, 3rem);
  font-weight: 720; letter-spacing: -0.045em; line-height: 1;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.fact-v em { font-style: normal; color: var(--c-sun, #ffd166); font-size: 0.6em; }
.fact-l { margin-top: 0.5rem; font-size: 0.9rem; color: var(--ink); font-weight: 500; }
.fact-s { margin-top: 0.1rem; font-size: 0.79rem; color: var(--ink-3); }

.person { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.25rem; }
.person-av {
  display: grid; place-items: center;
  width: 46px; height: 46px; flex: none;
  border-radius: 50%;
  background: var(--glass-strong);
  border: 1px solid var(--edge);
  font-weight: 650; font-size: 0.92rem; color: var(--lume);
  letter-spacing: -0.02em;
}
.person b { display: block; color: var(--ink); font-weight: 600; font-size: 0.96rem; letter-spacing: -0.012em; }
.person span { font-size: 0.82rem; color: var(--ink-3); }

.involve { padding: clamp(1.3rem, 3.6vw, 1.75rem); display: flex; flex-direction: column; height: 100%; }
.involve h3 { font-size: 1.06rem; margin-bottom: 0.5rem; }
.involve p { font-size: 0.9rem; line-height: 1.6; }
.involve .btn { margin-top: auto; }
.involve-foot { margin-top: 1.2rem; }

/* ==========================================================================
   Social
   ========================================================================== */
.socials { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.soc {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--edge);
  background: var(--glass);
  color: var(--ink-2);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: inset 0 1px 0 var(--specular);
  transition: transform 0.35s var(--ease), color 0.3s var(--ease-io),
              border-color 0.3s var(--ease-io), background 0.3s var(--ease-io);
}
@media (hover: hover) {
  .soc:hover { color: var(--ink); border-color: var(--edge-bright); background: var(--glass-strong); transform: translateY(-2px); }
}
.soc:active { transform: translateY(1px); transition-duration: 0.08s; }
.soc .ico { color: var(--lume); }
.soc b { font-weight: 600; color: inherit; }

.soc-icon {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--edge);
  background: var(--glass);
  color: var(--ink-2);
  transition: transform 0.35s var(--ease), color 0.3s var(--ease-io), border-color 0.3s var(--ease-io);
}
@media (hover: hover) {
  .soc-icon:hover { color: var(--lume); border-color: var(--edge-bright); transform: translateY(-2px); }
}

/* ==========================================================================
   Motion opt-out — the whole reef holds still.
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .rl, .bub, .sb { animation: none !important; }
  .bub { opacity: 0.32; }
}

/* ==========================================================================
   DEPTH SPINE — the descent through the five ocean zones
   ========================================================================== */
.zones { display: flex; flex-direction: column; gap: 0; counter-reset: z; }
.zone { display: grid; grid-template-columns: 26px 1fr; gap: 0 1rem; --tint: var(--lume); }
@media (min-width: 720px) { .zone { grid-template-columns: 34px 1fr; gap: 0 1.5rem; } }

/* The rail is the line you descend. */
.zone-rail { position: relative; display: flex; justify-content: center; }
.zone-rail::before {
  content: '';
  position: absolute;
  top: 0; bottom: -2px;
  width: 2px;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--tint) 60%, transparent),
    color-mix(in srgb, var(--tint) 12%, transparent));
}
.zone:first-child .zone-rail::before { top: 26px; }
.zone:last-child .zone-rail::before { bottom: auto; height: 26px; }
.zone-dot {
  position: relative;
  margin-top: 22px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--tint);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--tint) 18%, transparent),
              0 0 14px color-mix(in srgb, var(--tint) 65%, transparent);
}

.zone-card { padding: clamp(1.1rem, 3.4vw, 1.6rem); margin-bottom: 1rem; }
.zone-head { display: flex; align-items: center; gap: 0.85rem; margin-bottom: 0.7rem; }
.zone-head .sym { width: 46px; height: 46px; margin-bottom: 0; color: var(--tint); border-radius: 14px; }
[data-theme='reef'] .zone-head .sym { border-radius: 50%; }
.zone-head > div { flex: 1; min-width: 0; }
.zone-depth {
  display: block;
  font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--tint);
  margin-bottom: 0.18rem;
}
.zone-head h3 { font-size: clamp(1.02rem, 3vw, 1.24rem); }
.zone-n {
  flex: none;
  font-size: 0.78rem; font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--ink-4);
  letter-spacing: 0.04em;
}
.zone-card p { font-size: 0.92rem; line-height: 1.6; }

/* ==========================================================================
   DEPTH GAUGE — a live readout of how far down the page you are.
   Reef world only. Decorative, so it is hidden from assistive tech; the
   equivalent information is in the depth-spine section as real text.
   ========================================================================== */
.gauge { display: none; }
[data-theme='reef'] .gauge {
  display: flex;
  position: fixed;
  z-index: 70;
  left: max(0.85rem, env(safe-area-inset-left));
  bottom: calc(0.9rem + env(safe-area-inset-bottom));
  align-items: stretch;
  gap: 0.6rem;
  padding: 0.6rem 0.8rem 0.6rem 0.6rem;
  border-radius: 16px;
  border: 1px solid var(--edge);
  background: color-mix(in srgb, #041d2e 78%, transparent);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  box-shadow: inset 0 1px 0 var(--specular), var(--lift-2);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
  pointer-events: none;
}
[data-theme='reef'] .gauge.on { opacity: 1; transform: none; }

.gauge-track {
  position: relative;
  width: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}
.gauge-fill {
  position: absolute;
  inset: 0 0 auto 0;
  height: var(--p, 0%);
  border-radius: 2px;
  background: linear-gradient(180deg, var(--c-aqua), var(--zone, var(--c-aqua)));
  transition: height 0.18s linear, background 0.6s var(--ease-io);
}
.gauge-read { display: flex; align-items: baseline; gap: 0.12rem; flex-wrap: wrap; max-width: 8.5rem; }
.gauge-m {
  font-size: 1.02rem; font-weight: 700; color: var(--ink);
  font-variant-numeric: tabular-nums; letter-spacing: -0.03em; line-height: 1.1;
}
.gauge-u { font-size: 0.7rem; color: var(--ink-3); font-weight: 600; }
.gauge-zone {
  flex-basis: 100%;
  font-style: normal;
  font-size: 0.62rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--zone, var(--c-aqua));
  transition: color 0.6s var(--ease-io);
  line-height: 1.3;
}

/* ==========================================================================
   Parallax planes — the water gets thickness.
   Far life is small, dim and slightly blurred; near life is large and sharp.
   ========================================================================== */
.rl-p0 { opacity: 0.24; filter: blur(1.4px); z-index: 0; }
.rl-p1 { opacity: 0.36; filter: blur(0.4px); z-index: 0; }
.rl-p2 { opacity: 0.5;  z-index: 0; }

[data-theme='reef'] .rl[data-anim='swim']  { animation-name: swim; }
[data-theme='reef'] .rl[data-anim='drift'] { animation-name: drift; }

/* Creatures that make their own light. Down here, most of them do. */
.is-lum { filter: drop-shadow(0 0 10px rgba(184, 255, 240, 0.55)); }
.rl-p0.is-lum { filter: blur(1.4px) drop-shadow(0 0 12px rgba(184, 255, 240, 0.5)); }
.rl-p1.is-lum { filter: blur(0.4px) drop-shadow(0 0 11px rgba(184, 255, 240, 0.55)); }
[data-theme='reef'] .is-lum { animation-name: swim, pulseGlow; animation-duration: var(--dur, 18s), 4.5s; }
@keyframes pulseGlow {
  0%, 100% { opacity: 0.42; }
  50%      { opacity: 0.72; }
}

/* Section-level life layer */
[data-theme='reef'] .reef-life { z-index: 0; }

/* The deeper the section, the darker its own ground. */
[data-theme='reef'] [data-depth='twilight'] { --sec-tint: #00a6c4; }
[data-theme='reef'] [data-depth='midnight'] { --sec-tint: #5b7fe8; }
[data-theme='reef'] [data-depth='abyss']    { --sec-tint: #4ecb71; }
[data-theme='reef'] [data-depth='hadal']    { --sec-tint: #e85d9e; }

/* ==========================================================================
   Pixar-grade idle: creatures blink and breathe rather than merely translate.
   ========================================================================== */
@keyframes breathe {
  0%, 100% { transform: scale(var(--s)) rotate(-1.5deg); }
  50%      { transform: scale(calc(var(--s) * 1.04)) rotate(1.5deg); }
}
[data-theme='reef'] .sym .ico { transition: transform 0.5s var(--ease); }
@media (hover: hover) {
  [data-theme='reef'] .glass:hover .sym .ico { transform: scale(1.12) rotate(-6deg); }
}

/* A creature tucked into a card corner — small, warm, and only on hover. */
.card-critter {
  position: absolute;
  right: 0.8rem; bottom: 0.8rem;
  opacity: 0;
  transform: translateY(6px) scale(0.9);
  transition: opacity 0.45s var(--ease), transform 0.55s var(--ease);
  pointer-events: none;
  z-index: 2;
}
[data-theme='reef'] .glass:hover .card-critter { opacity: 0.5; transform: none; }
[data-theme='deep'] .card-critter { display: none; }

@media (prefers-reduced-motion: reduce) {
  .is-lum, .rl { animation: none !important; }
  .gauge-fill { transition: none; }
}

/* Parallax rides on `translate`, which composes independently of the
   `transform` the drift/swim keyframes are already animating. */
[data-theme='reef'] .rl { translate: 0 var(--py, 0px); will-change: translate; }

/* The life found in each zone, shown as a small row inside its card. */
.zone-life { display: none; }
[data-theme='reef'] .zone-life {
  display: flex;
  gap: 0.55rem;
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--edge);
}
.zl {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--edge);
  opacity: 0.8;
  transition: transform 0.45s var(--ease), opacity 0.35s var(--ease-io);
}
@media (hover: hover) { .zl:hover { transform: translateY(-3px) scale(1.08); opacity: 1; } }
.zone { position: relative; }

/* Document viewer — for the trade sheet and the pouch label. */
.doc {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--edge);
  background: #fff;
  box-shadow: var(--lift-3);
}
.doc img { width: 100%; display: block; }
.doc-cap {
  padding: 0.85rem 1.1rem;
  background: var(--abyss-rise);
  border-top: 1px solid var(--edge);
  font-size: 0.79rem;
  color: var(--ink-3);
  display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; justify-content: space-between;
}

/* The descent, made literal: a fixed darkening veil driven by --descent (0 at
   the surface, 1 in the trench). The page substrate visibly loses light as
   you scroll, and the sun shafts fade away below the photic zone. */
[data-theme='reef'] .veil {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: #010912;
  opacity: calc(var(--descent, 0) * 0.62);
  transition: opacity 0.12s linear;
}
[data-theme='deep'] .veil { display: none; }
[data-theme='reef'] body::after {
  opacity: calc(0.5 * (1 - var(--descent, 0) * 1.6));
}

/* ==========================================================================
   THE DEEP GAME — spotting, field guide, zone banners, the whale, confetti
   ========================================================================== */

/* The gauge is a real button now. */
.gauge { font: inherit; text-align: left; }
[data-theme='reef'] .gauge { pointer-events: auto; cursor: pointer; }
[data-theme='reef'] .gauge:active { transform: translateY(1px); }
.gauge-spot {
  flex-basis: 100%;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  line-height: 1.4;
}

/* Creatures are tappable in the Reef world. */
[data-theme='reef'] .reef-life .rl { pointer-events: auto; cursor: pointer; }
.rl.startle { animation: startle 0.55s var(--ease) 1 !important; }
@keyframes startle {
  0%   { scale: 1; rotate: 0deg; }
  30%  { scale: 1.35; rotate: -10deg; }
  60%  { scale: 0.92; rotate: 6deg; }
  100% { scale: 1; rotate: 0deg; }
}

/* Toast — one quiet line, bottom centre. */
.deep-toast {
  position: fixed;
  left: 50%;
  bottom: calc(1.1rem + env(safe-area-inset-bottom));
  transform: translate(-50%, 14px);
  z-index: 120;
  max-width: min(88vw, 26rem);
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--edge-bright);
  background: color-mix(in srgb, var(--abyss-deep) 88%, transparent);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  box-shadow: inset 0 1px 0 var(--specular), var(--lift-2);
  color: var(--ink-2);
  font-size: 0.86rem;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease-io), transform 0.4s var(--ease), visibility 0.3s;
  pointer-events: none;
}
.deep-toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.deep-toast b { color: var(--ink); font-weight: 650; }

/* Field guide */
.guide {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(2, 10, 18, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease-io), visibility 0.3s;
}
.guide.open { opacity: 1; visibility: visible; }
.guide-panel {
  width: min(100%, 30rem);
  max-height: min(84svh, 44rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: var(--radius-l);
  border: 1px solid var(--edge-bright);
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03)),
              var(--abyss-deep);
  box-shadow: inset 0 1px 0 var(--specular), var(--lift-3);
  padding: 1.2rem 1.2rem 1.4rem;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.45s var(--ease);
}
.guide.open .guide-panel { transform: none; }
.guide-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.4rem;
}
.guide-head b { color: var(--ink); font-size: 1.12rem; font-weight: 700; letter-spacing: -0.02em; }
.guide-count { font-size: 0.78rem; color: var(--lume); font-weight: 600; }
.guide-close {
  margin-left: auto;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--edge);
  background: var(--glass);
  color: var(--ink);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}
.guide-zone { padding: 0.9rem 0 0.2rem; }
.guide-zone h4 { font-size: 0.78rem; letter-spacing: 0.13em; text-transform: uppercase; color: var(--lume); }
.guide-zone p { font-size: 0.72rem; color: var(--ink-4); margin: 0.15rem 0 0.6rem; }
.guide-row { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.fg {
  display: grid;
  justify-items: center;
  gap: 0.25rem;
  width: 74px;
  padding: 0.55rem 0.25rem 0.5rem;
  border-radius: 14px;
  border: 1px solid var(--edge);
  background: var(--glass);
  margin: 0;
}
.fg svg { filter: grayscale(1) brightness(0.45); opacity: 0.5; transition: filter 0.5s var(--ease-io), opacity 0.5s var(--ease-io); }
.fg figcaption { font-size: 0.58rem; color: var(--ink-4); text-align: center; line-height: 1.2; }
.fg.found svg { filter: none; opacity: 1; }
.fg.found { border-color: var(--edge-bright); }
.fg.found figcaption { color: var(--ink-2); }

/* The whale crosses once, far behind the content. */
.whale-flyby {
  position: fixed;
  top: 32svh;
  left: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.34;
  filter: blur(0.6px);
  animation: whaleCross 34s linear 1 both;
}
@keyframes whaleCross {
  0%   { transform: translateX(-240px) translateY(0); }
  50%  { transform: translateX(50vw) translateY(-3.5vh); }
  100% { transform: translateX(calc(100vw + 240px)) translateY(1vh); }
}

/* Super Bowl confetti */
.confetti { position: fixed; inset: 0; z-index: 130; pointer-events: none; overflow: hidden; }
.confetti i {
  position: absolute;
  top: -3vh;
  width: 8px; height: 13px;
  border-radius: 2px;
  animation: cfall linear both;
}
@keyframes cfall {
  to { transform: translateY(106vh) rotate(660deg); }
}

@media (prefers-reduced-motion: reduce) {
  .whale-flyby, .confetti i, .rl.startle { animation: none !important; }
  .whale-flyby { display: none; }
}

/* ==========================================================================
   Round: sound toggle, golden gauge, tap bubbles, guide facts
   ========================================================================== */
.guide-sound {
  margin-left: auto;
  min-height: 34px;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--edge);
  background: var(--glass);
  color: var(--ink-2);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.guide-sound[aria-pressed='true'] { color: var(--lume); border-color: var(--edge-bright); }
.guide-head .guide-close { margin-left: 0; }

/* All species found: the gauge turns gold. */
[data-theme='reef'] .gauge.complete {
  border-color: rgba(255, 209, 102, 0.55);
  box-shadow: inset 0 1px 0 var(--specular), 0 0 22px -4px rgba(255, 209, 102, 0.45), var(--lift-2);
}
.gauge.complete .gauge-spot { color: var(--c-sun, #ffd166); }
.gauge.complete .gauge-fill { background: linear-gradient(180deg, var(--c-sun, #ffd166), var(--zone, var(--c-aqua))); }

/* Tap bubbles */
.tap-bubbles { position: fixed; z-index: 60; pointer-events: none; }
.tap-bubbles i {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(244, 251, 255, 0.55);
  background: rgba(244, 251, 255, 0.12);
  animation: tapRise var(--dur, 0.9s) ease-out both;
}
@keyframes tapRise {
  0%   { opacity: 0.9; transform: translate(0, 0) scale(0.5); }
  100% { opacity: 0; transform: translate(var(--dx, 0px), -74px) scale(1.15); }
}

/* ==========================================================================
   MOTION, REBUILT — nose-first, lifelike, per-family.
   Swimmers cruise with a gentle bob and TURN AROUND at each end of their run
   (the inner sprite flips exactly at the turn, so nobody swims backwards).
   --f0 is native facing: 1 = drawn facing right, -1 = drawn facing left.
   ========================================================================== */
[data-theme='reef'] .rl[data-anim='swim']    { animation-name: swimPath; }
[data-theme='reef'] .rl[data-anim='jelly']   { animation-name: jellyDrift; }
[data-theme='reef'] .rl[data-anim='scuttle'] { animation-name: scuttle; animation-duration: calc(var(--dur) / 2); }
[data-theme='reef'] .rl[data-anim='bob']     { animation-name: bobSway; animation-duration: calc(var(--dur) / 2); }
[data-theme='reef'] .rl[data-anim='jet']     { animation-name: jetDart; animation-duration: calc(var(--dur) / 3); }
[data-theme='reef'] .rl[data-anim='drift']   { animation-name: driftSoft; }

/* The turn: the sprite flips at the far end of each pass, where speed is ~0. */
[data-theme='reef'] .rl[data-anim='swim'] .ico {
  animation: faceTurn var(--dur) linear var(--delay, 0s) infinite;
}
@keyframes faceTurn {
  0%, 49.9%  { transform: scaleX(var(--f0, 1)); }
  50%, 100%  { transform: scaleX(calc(-1 * var(--f0, 1))); }
}

@keyframes swimPath {
  0%   { transform: scale(var(--s)) translateX(-52px) translateY(0)    rotate(0deg); }
  12%  { transform: scale(var(--s)) translateX(-30px) translateY(-5px) rotate(-3deg); }
  30%  { transform: scale(var(--s)) translateX(14px)  translateY(3px)  rotate(2deg); }
  46%  { transform: scale(var(--s)) translateX(48px)  translateY(-2px) rotate(-1deg); }
  50%  { transform: scale(var(--s)) translateX(52px)  translateY(2px)  rotate(0deg); }
  62%  { transform: scale(var(--s)) translateX(30px)  translateY(-5px) rotate(3deg); }
  80%  { transform: scale(var(--s)) translateX(-14px) translateY(3px)  rotate(-2deg); }
  96%  { transform: scale(var(--s)) translateX(-48px) translateY(-2px) rotate(1deg); }
  100% { transform: scale(var(--s)) translateX(-52px) translateY(0)    rotate(0deg); }
}

/* Jellies: the bell does the work — contract, rise, relax, sink. */
[data-theme='reef'] .rl[data-anim='jelly'] .ico {
  animation: jellyBell 3.4s cubic-bezier(0.45, 0, 0.2, 1) var(--delay, 0s) infinite;
  transform-origin: 50% 28%;
}
@keyframes jellyBell {
  0%, 100% { transform: scale(1, 1) translateY(0); }
  12%      { transform: scale(1.09, 0.85) translateY(-1px); }
  28%      { transform: scale(0.93, 1.07) translateY(-7px); }
  58%      { transform: scale(1.01, 0.99) translateY(-3px); }
}
@keyframes jellyDrift {
  0%, 100% { transform: scale(var(--s)) translate(0, 16px); }
  50%      { transform: scale(var(--s)) translate(9px, -16px); }
}

/* Crabs: quick sideways dashes with wary pauses. */
@keyframes scuttle {
  0%, 9%   { transform: scale(var(--s)) translateX(-34px); }
  16%      { transform: scale(var(--s)) translateX(-10px) translateY(-3px); }
  20%, 36% { transform: scale(var(--s)) translateX(-7px); }
  43%      { transform: scale(var(--s)) translateX(19px) translateY(-3px); }
  47%, 60% { transform: scale(var(--s)) translateX(22px); }
  67%      { transform: scale(var(--s)) translateX(35px) translateY(-3px); }
  70%, 84% { transform: scale(var(--s)) translateX(33px); }
  93%      { transform: scale(var(--s)) translateX(-12px) translateY(-3px); }
  100%     { transform: scale(var(--s)) translateX(-34px); }
}

/* Upright hoverers: seahorse, puffer, krill — a soft vertical tread. */
@keyframes bobSway {
  0%, 100% { transform: scale(var(--s)) translateY(0)     rotate(-3deg); }
  25%      { transform: scale(var(--s)) translateY(-9px)  rotate(2deg); }
  50%      { transform: scale(var(--s)) translateY(-3px)  rotate(4deg); }
  75%      { transform: scale(var(--s)) translateY(-11px) rotate(-2deg); }
}

/* Jet propulsion: one sharp backwards dart, then a long glide home.
   Shrimp and nautiluses genuinely travel this way. */
@keyframes jetDart {
  0%   { transform: scale(var(--s)) translateX(0); }
  6%   { transform: scale(var(--s)) translateX(var(--jx, -30px)) rotate(-5deg); }
  13%  { transform: scale(var(--s)) translateX(calc(var(--jx, -30px) * 1.18)) rotate(-2deg); }
  58%  { transform: scale(var(--s)) translateX(calc(var(--jx, -30px) * 0.42)); }
  100% { transform: scale(var(--s)) translateX(0); }
}

/* Non-directional drifters breathe as they float. */
@keyframes driftSoft {
  0%, 100% { transform: scale(var(--s)) translate(0, 0) rotate(0deg); }
  33%      { transform: scale(calc(var(--s) * 1.04)) translate(10px, -16px) rotate(4deg); }
  66%      { transform: scale(calc(var(--s) * 0.97)) translate(-8px, 10px) rotate(-3deg); }
}

/* Luminous species keep their glow, matched to their own motion. */
[data-theme='reef'] .rl.is-lum[data-anim='swim']  { animation-name: swimPath, pulseGlow; animation-duration: var(--dur), 4.5s; }
[data-theme='reef'] .rl.is-lum[data-anim='jelly'] { animation-name: jellyDrift, pulseGlow; animation-duration: var(--dur), 4.5s; }
[data-theme='reef'] .rl.is-lum[data-anim='drift'] { animation-name: driftSoft, pulseGlow; animation-duration: var(--dur), 4.5s; }

/* The whale is drawn facing left; its flyby travels left-to-right. Turn it. */
.whale-flyby svg { transform: scaleX(-1); }

@media (prefers-reduced-motion: reduce) {
  .rl .ico { animation: none !important; }
}

/* ==========================================================================
   THE WAVE MENU — three lines of moving water that flood the screen
   ========================================================================== */
.menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px; height: 46px;
  margin-right: -6px;
  border: 0;
  background: transparent;
  border-radius: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
@media (min-width: 980px) { .menu-btn { display: none; } }

.mw { width: 30px; height: 22px; overflow: visible; }
.mw-l {
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
  fill: none;
  transform-origin: 50% 50%;
  transition: transform 0.5s var(--ease), opacity 0.3s var(--ease-io);
}
/* The lines never stop moving — it's water, not a hamburger. */
.mw-1 { animation: mwFlow 3.2s ease-in-out infinite; }
.mw-2 { animation: mwFlow 3.2s ease-in-out 0.28s infinite; opacity: 0.82; }
.mw-3 { animation: mwFlow 3.2s ease-in-out 0.56s infinite; opacity: 0.64; }
@keyframes mwFlow {
  0%, 100% { transform: translateX(0) scaleY(1); }
  50%      { transform: translateX(-4px) scaleY(-1); }
}

/* Open state: the swell gathers into a single crest, then a close mark. */
.menu-btn[aria-expanded='true'] .mw-l { animation: none; }
.menu-btn[aria-expanded='true'] .mw-1 { transform: translateY(5px) rotate(45deg) scale(0.74, 0.22); }
.menu-btn[aria-expanded='true'] .mw-2 { opacity: 0; transform: scaleX(0.2); }
.menu-btn[aria-expanded='true'] .mw-3 { transform: translateY(-5px) rotate(-45deg) scale(0.74, 0.22); }

/* ---------- The flood ---------- */
.wave-veil {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  transform: translateY(102%);
  transition: transform 0.86s cubic-bezier(0.62, 0, 0.2, 1);
}
.nav-m.open .wave-veil { transform: translateY(0); }

.wave-crest {
  position: absolute;
  left: 0;
  top: 0;
  width: 200%;
  height: 108px;
  transform: translateY(-92px);
}
.wc-back  { fill: #0a5b80; opacity: 0.62; animation: crestRun 9s linear infinite; }
.wc-front { fill: #063b58; animation: crestRun 6.2s linear infinite reverse; }
@keyframes crestRun {
  from { transform: translate(0, -92px); }
  to   { transform: translate(-50%, -92px); }
}

.wave-body {
  position: absolute;
  inset: 14px 0 -20px 0;
  background: linear-gradient(180deg, #063b58 0%, #052d45 42%, #03121f 100%);
}

/* The menu itself now rides on the water. */
.nav-m {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.nav-m > ul, .nav-m > .nav-m-foot { position: relative; z-index: 1; }
.nav-m ul { padding-top: 0.5rem; }
.nav-m a { transition-delay: 0.1s; }

/* Foam flecks riding the crest as it climbs */
.nav-m.open .wave-veil::after {
  content: '';
  position: absolute;
  left: 0; right: 0; top: -4px;
  height: 3px;
  background: radial-gradient(circle, rgba(244,251,255,.8) 1px, transparent 1.6px) 0 0/26px 3px repeat-x;
  opacity: 0.5;
  animation: foamRun 3.4s linear infinite;
}
@keyframes foamRun { to { background-position: 260px 0; } }

@media (prefers-reduced-motion: reduce) {
  .mw-l, .wc-back, .wc-front, .nav-m.open .wave-veil::after { animation: none !important; }
  .wave-veil { transition-duration: 0.2s; }
}

/* The hero's creatures live below the headline, never across it. */
.hero .reef-life { top: 31%; }

/* On the phone the gauge tucks itself away when you stop diving, so it never
   sits on top of a button. Tap it any time to open the field guide. */
@media (max-width: 720px) {
  [data-theme='reef'] .gauge {
    max-width: 11.5rem;
    padding: 0.5rem 0.7rem 0.5rem 0.55rem;
    overflow: hidden;
    transition: opacity 0.5s var(--ease), transform 0.5s var(--ease),
                max-width 0.45s var(--ease), padding 0.45s var(--ease);
  }
  [data-theme='reef'] .gauge.idle { max-width: 5.4rem; padding-right: 0.55rem; }
  .gauge-zone, .gauge-spot { transition: opacity 0.3s var(--ease-io), max-height 0.35s var(--ease); max-height: 2rem; }
  .gauge.idle .gauge-zone, .gauge.idle .gauge-spot { opacity: 0; max-height: 0; overflow: hidden; }
  .gauge-m { font-size: 0.96rem; }
}

/* Page heroes: the creatures live below the title block. */
.phero .reef-life { top: 60%; }

/* On the phone the zone toast rises above the gauge instead of colliding with it. */
@media (max-width: 720px) {
  .deep-toast { bottom: calc(5.6rem + env(safe-area-inset-bottom)); }
}

/* ==========================================================================
   THE PEARL — the field guide's door on every page without a gauge
   ========================================================================== */
.dive { display: none; }
[data-theme='reef'] .dive {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  position: fixed;
  z-index: 70;
  left: max(0.85rem, env(safe-area-inset-left));
  bottom: calc(0.9rem + env(safe-area-inset-bottom));
  min-height: 44px;
  padding: 0.35rem 0.85rem 0.35rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--edge);
  background: color-mix(in srgb, #041d2e 78%, transparent);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  box-shadow: inset 0 1px 0 var(--specular), var(--lift-2);
  color: var(--ink-2);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: border-color 0.3s var(--ease-io), transform 0.2s var(--ease);
}
[data-theme='reef'] .dive:active { transform: translateY(1px); }
.dive-pearl {
  width: 24px; height: 24px;
  flex: none;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fff, #f0e6c8 45%, #cdb87e);
  box-shadow: 0 0 12px rgba(255, 231, 166, 0.55);
}
.dive.complete { border-color: rgba(255, 209, 102, 0.55); color: var(--c-sun, #ffd166); }
.dive.bump { animation: diveBump 0.6s var(--ease) 1; }
@keyframes diveBump { 30% { transform: scale(1.1); } 60% { transform: scale(0.97); } 100% { transform: none; } }

/* Guide header: a title row that can never overflow, then a toolbar that wraps. */
.guide-panel { overflow-x: hidden; padding-top: 0; }
.guide-head {
  position: sticky;
  top: 0;
  z-index: 2;
  align-items: flex-start;
  margin: 0 -1.2rem 0;
  padding: 1.1rem 1.2rem 0.6rem;
  background: color-mix(in srgb, var(--abyss-deep) 90%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.guide-t { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; flex: 1; }
.guide-head .guide-close, .guide-close { margin-left: auto; flex: none; width: 44px; height: 44px; }
.guide-tools { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.6rem 0 0.2rem; }
.guide-head .guide-road, .guide-head .guide-sound { margin-left: 0; }
.guide-sound { margin-left: 0; }
.guide-road, .guide-share, .guide-sound { min-height: 38px; padding: 0.35rem 0.85rem; }
.guide-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 0.45rem; }
.fg { width: auto; }
.road .guide-tools { display: none; }

/* On the phone both dialogs become bottom sheets. */
@media (max-width: 720px) {
  .guide, .mg { place-items: end center; padding: 0; }
  .guide-panel, .mg-panel {
    width: 100%;
    max-width: 100%;
    max-height: 92svh;
    border-radius: 24px 24px 0 0;
    border-bottom: 0;
    padding-bottom: calc(1.2rem + env(safe-area-inset-bottom));
    transform: translateY(28px);
  }
  .guide.open .guide-panel, .mg.open .mg-panel { transform: none; }
  .guide-panel::before, .mg-panel::before {
    content: '';
    display: block;
    width: 40px; height: 4px;
    margin: 0.6rem auto 0;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.22);
  }
  .guide-head { padding-top: 0.5rem; }
  .mg-panel { padding-top: 0.2rem; }
  .deep-toast { bottom: calc(4.4rem + env(safe-area-inset-bottom)); }
  body.has-gauge .deep-toast { bottom: calc(5.6rem + env(safe-area-inset-bottom)); }
}

/* Room under the footer so the fixed pearl or gauge never covers the credit line. */
@media (max-width: 720px) {
  .footer { padding-bottom: calc(5.2rem + env(safe-area-inset-bottom)); }
}

/* ==========================================================================
   WONDERLAND — catch cards, sparks, the flight to the pearl, wanderers, motes
   ========================================================================== */
[data-theme='reef'] .reef-life .rl, .wander-rl {
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.rl.holding svg { filter: drop-shadow(0 0 14px rgba(255, 231, 166, 0.95)); transition: filter 0.45s var(--ease-io); }

/* Catch card */
.catch {
  position: fixed;
  left: 50%;
  bottom: calc(4.6rem + env(safe-area-inset-bottom));
  z-index: 100;
  width: min(92vw, 26rem);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.55rem 0.8rem;
  align-items: center;
  padding: 0.8rem 0.85rem 0.85rem 0.8rem;
  border-radius: 20px;
  border: 1px solid var(--edge-bright);
  background: color-mix(in srgb, var(--abyss-deep) 90%, transparent);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  box-shadow: inset 0 1px 0 var(--specular), var(--lift-3);
  transform: translate(-50%, 18px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease-io), transform 0.45s var(--ease), visibility 0.3s;
}
.catch.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
body.has-gauge .catch { bottom: calc(5.8rem + env(safe-area-inset-bottom)); }
.catch-ico {
  width: 58px; height: 58px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--glass-strong);
  border: 1px solid var(--edge);
}
.catch.new .catch-ico {
  border-color: rgba(255, 209, 102, 0.6);
  box-shadow: 0 0 24px -4px rgba(255, 209, 102, 0.65);
  animation: catchPop 0.6s var(--ease) both;
}
@keyframes catchPop { 0% { transform: scale(0.6); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
.catch-t { min-width: 0; display: grid; gap: 0.12rem; }
.catch-t i { font-style: normal; font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--lume); font-weight: 650; }
.catch.new .catch-t i { color: var(--c-sun, #ffd166); }
.catch-t b { color: var(--ink); font-size: 1.02rem; font-weight: 700; letter-spacing: -0.02em; }
.catch-t span { font-size: 0.76rem; color: var(--ink-3); line-height: 1.4; }
.catch-x {
  width: 36px; height: 36px;
  align-self: start;
  border-radius: 50%;
  border: 1px solid var(--edge);
  background: var(--glass);
  color: var(--ink);
  font-size: 1.2rem; line-height: 1;
  cursor: pointer;
}
.catch-acts { grid-column: 1 / -1; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.catch-play {
  flex: 1 1 auto;
  min-height: 42px;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(135deg, var(--c-aqua), #1fb59d);
  color: #04121b;
  font: inherit; font-weight: 700; font-size: 0.84rem;
  cursor: pointer;
  box-shadow: 0 6px 18px -8px rgba(61, 217, 192, 0.8);
}
.catch-guide {
  min-height: 42px;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--edge);
  background: var(--glass);
  color: var(--ink-2);
  font: inherit; font-weight: 600; font-size: 0.8rem;
  cursor: pointer;
}

/* Sparks */
.sparks { position: fixed; z-index: 99; width: 0; height: 0; pointer-events: none; }
.sparks i {
  position: absolute;
  left: 0; top: 0;
  width: 6px; height: 6px;
  margin: -3px;
  border-radius: 50%;
  background: #d6f5ff;
  box-shadow: 0 0 8px rgba(184, 255, 240, 0.9);
  animation: sparkOut var(--t, 0.7s) ease-out both;
}
.sparks.gold i { background: #ffe7a6; box-shadow: 0 0 8px rgba(255, 209, 102, 0.9); }
@keyframes sparkOut {
  0%   { transform: rotate(var(--a)) translateX(0) scale(1); opacity: 1; }
  100% { transform: rotate(var(--a)) translateX(var(--d)) scale(0.2); opacity: 0; }
}
.fly {
  position: fixed;
  z-index: 101;
  pointer-events: none;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 10px rgba(255, 231, 166, 0.8));
}

/* Wanderers */
.wander {
  position: fixed;
  top: var(--y, 40vh);
  left: 0;
  z-index: 66;
  pointer-events: none;
}
.wander.to-right { animation: wanderR var(--dur, 18s) linear both; }
.wander.to-left  { animation: wanderL var(--dur, 18s) linear both; }
@keyframes wanderR { from { transform: translateX(-180px); } to { transform: translateX(calc(100vw + 180px)); } }
@keyframes wanderL { from { transform: translateX(calc(100vw + 180px)); } to { transform: translateX(-180px); } }
.wander-face { display: block; transform: scaleX(var(--sx, 1)); animation: wanderBob 3.4s ease-in-out infinite; }
@keyframes wanderBob { 50% { transform: scaleX(var(--sx, 1)) translateY(-10px) rotate(2deg); } }
.wander-rl {
  display: block;
  pointer-events: auto;
  cursor: pointer;
  opacity: 0.94;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
  transition: opacity 0.8s var(--ease-io);
}
.wander-rl.is-lum { filter: drop-shadow(0 0 12px rgba(184, 255, 240, 0.6)); }
.wander.caught .wander-rl { opacity: 0; }

/* Motes */
.motes { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.motes i {
  position: absolute;
  left: var(--x); top: var(--y);
  width: var(--s); height: var(--s);
  border-radius: 50%;
  background: rgba(214, 245, 255, 0.9);
  box-shadow: 0 0 6px rgba(184, 255, 240, 0.7);
  opacity: var(--o, 0.3);
  animation: moteDrift var(--t, 24s) ease-in-out infinite alternate;
  animation-delay: var(--d, 0s);
}
@keyframes moteDrift {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(14px, -22px); }
  50%  { transform: translate(-10px, -40px); }
  75%  { transform: translate(16px, -58px); }
  100% { transform: translate(0, -80px); }
}

@media (prefers-reduced-motion: reduce) {
  .wander, .motes, .sparks, .fly { display: none; }
}
@media (max-width: 720px) {
  .catch { width: calc(100vw - 1.4rem); }
}
.deep-toast.lift { bottom: calc(13.5rem + env(safe-area-inset-bottom)); }
@media (max-width: 720px) { .deep-toast.lift, body.has-gauge .deep-toast.lift { bottom: calc(15rem + env(safe-area-inset-bottom)); } }

/* On phones the near planes sit lighter over long hero text, so words win. */
@media (max-width: 720px) {
  .phero .rl-p2, .hero .rl-p2 { opacity: 0.34; }
  .phero .rl-p1, .hero .rl-p1 { opacity: 0.28; }
  .phero .reef-life { top: 66%; }
}
@media (max-width: 720px) {
  .has-life .rl-p2 { opacity: 0.38; }
  .has-life .rl-p1 { opacity: 0.3; }
}

/* ==========================================================================
   THE JOURNEY — rank and road ahead, lessons kept, welcome card, golden catch
   ========================================================================== */
.guide-next { font-size: 0.74rem; color: var(--ink-3); line-height: 1.45; margin-top: 0.15rem; }
.guide-next b { color: var(--ink-2); font-weight: 600; }

.guide-lessons {
  margin: 0.5rem 0 0.2rem;
  padding: 0.8rem 0.9rem 0.85rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 209, 102, 0.28);
  background: linear-gradient(180deg, rgba(255, 209, 102, 0.07), rgba(255, 255, 255, 0.02));
}
.guide-lessons h4 {
  display: flex; justify-content: space-between; gap: 0.6rem;
  font-size: 0.72rem; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--c-sun, #ffd166);
}
.guide-lessons h4 span { color: var(--ink-4); letter-spacing: 0.04em; text-transform: none; font-weight: 500; font-variant-numeric: tabular-nums; }
.guide-lessons ul { list-style: none; padding: 0; margin: 0.55rem 0 0; display: grid; gap: 0.45rem; }
.guide-lessons li { display: flex; gap: 0.55rem; align-items: flex-start; font-size: 0.8rem; line-height: 1.45; color: var(--ink-2); }
.guide-lessons li i {
  flex: none;
  width: 9px; height: 9px;
  margin-top: 0.32rem;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fff, #f0e6c8 45%, #cdb87e);
  box-shadow: 0 0 6px rgba(255, 231, 166, 0.7);
}
.guide-lessons p { font-size: 0.78rem; color: var(--ink-4); margin: 0.45rem 0 0; }
.guide-lessons p[hidden] { display: none; }
.road .guide-lessons { display: none; }

/* Welcome card */
.catch-pearl {
  display: block;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fff, #f0e6c8 45%, #cdb87e);
  box-shadow: 0 0 14px rgba(255, 231, 166, 0.8);
}
.catch.hello .catch-t i { color: var(--c-sun, #ffd166); }
.catch.hello .catch-ico { border-color: rgba(255, 209, 102, 0.5); }
.catch-ok {
  flex: 1 1 auto;
  min-height: 42px;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(135deg, var(--c-aqua), #1fb59d);
  color: #04121b;
  font: inherit; font-weight: 700; font-size: 0.84rem;
  cursor: pointer;
  box-shadow: 0 6px 18px -8px rgba(61, 217, 192, 0.8);
}

/* Golden wanderer */
.wander.gold .wander-rl {
  opacity: 1;
  filter: sepia(1) saturate(4) hue-rotate(-8deg) brightness(1.2) drop-shadow(0 0 16px rgba(255, 209, 102, 0.95));
  animation: goldPulse 1.6s ease-in-out infinite;
}
@keyframes goldPulse {
  50% { filter: sepia(1) saturate(4) hue-rotate(-8deg) brightness(1.5) drop-shadow(0 0 28px rgba(255, 231, 166, 1)); }
}
.wander.gold.caught .wander-rl { opacity: 0; }

/* ==========================================================================
   THE WATER ANSWERS — catch chip, the orb, the flash, the lantern
   ========================================================================== */
.sr-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

.catch-chip {
  position: fixed;
  z-index: 101;
  transform: translate(-50%, 0);
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--edge-bright);
  background: color-mix(in srgb, var(--abyss-deep) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: none;
  animation: chipUp 1.6s var(--ease) both;
}
.catch-chip.gold { color: var(--c-sun, #ffd166); border-color: rgba(255, 209, 102, 0.6); }
@keyframes chipUp {
  0%   { opacity: 0; transform: translate(-50%, 10px) scale(0.9); }
  14%  { opacity: 1; transform: translate(-50%, 0) scale(1); }
  78%  { opacity: 1; transform: translate(-50%, -6px); }
  100% { opacity: 0; transform: translate(-50%, -26px); }
}

/* The orb */
.orb { position: fixed; z-index: 64; width: 0; height: 0; pointer-events: none; }
.orb-core {
  position: absolute; left: 0; top: 0;
  width: 28px; height: 28px; margin: -14px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fff, #b8fff0 30%, rgba(61, 217, 192, 0.6) 58%, transparent 72%);
  box-shadow: 0 0 24px rgba(184, 255, 240, 0.85), 0 0 64px rgba(61, 217, 192, 0.5);
  animation: orbGrow 1.2s var(--ease) both, orbBreathe 1.1s ease-in-out 1s infinite;
}
@keyframes orbGrow { from { transform: scale(0.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes orbBreathe { 50% { transform: scale(1.2); } }
.orb-arc {
  position: absolute; left: 0; top: 0;
  width: 64px; height: 64px; margin: -32px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: rgba(184, 255, 240, 0.95);
  border-right-color: rgba(184, 255, 240, 0.25);
  filter: drop-shadow(0 0 6px rgba(184, 255, 240, 0.9));
  animation: arcSpin 1s linear infinite, arcIn 0.6s var(--ease) both;
}
.orb-arc.a2 { width: 86px; height: 86px; margin: -43px; animation-duration: 1.5s, 0.8s; animation-direction: reverse, normal; }
.orb-arc.a3 { width: 108px; height: 108px; margin: -54px; animation-duration: 2.1s, 1s; }
@keyframes arcSpin { to { transform: rotate(360deg); } }
@keyframes arcIn { from { opacity: 0; } to { opacity: 0.9; } }
.orb.lit .orb-core { animation: orbBurst 0.5s ease-out both; }
@keyframes orbBurst { to { transform: scale(4.5); opacity: 0; } }
.orb.lit .orb-arc { animation: arcOut 0.45s ease-out both; }
@keyframes arcOut { to { transform: scale(2.6) rotate(90deg); opacity: 0; } }
.orb.out:not(.lit) .orb-core, .orb.out:not(.lit) .orb-arc { animation: orbFizz 0.4s ease-in both; }
@keyframes orbFizz { to { transform: scale(0.1); opacity: 0; } }
.orb-flash {
  position: fixed;
  z-index: 63;
  width: 560px; height: 560px;
  margin: -280px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(184, 255, 240, 0.55), rgba(61, 217, 192, 0.18) 40%, transparent 70%);
  mix-blend-mode: screen;
  animation: flashOut 0.95s ease-out both;
}
@keyframes flashOut { 0% { transform: scale(0.3); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }

/* The lantern */
.lantern {
  position: fixed;
  left: 0; top: 0;
  z-index: 2;
  width: 520px; height: 520px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(184, 255, 240, 0.11), rgba(184, 255, 240, 0.04) 36%, transparent 70%);
  mix-blend-mode: screen;
  transition: opacity 0.4s var(--ease-io);
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .orb, .orb-flash, .lantern, .catch-chip { display: none; }
}

/* ==========================================================================
   MORE LIGHT — the wake, the Dive button, drifting stones, page crossfades
   ========================================================================== */
.wake {
  position: fixed;
  z-index: 3;
  width: 5px; height: 5px;
  margin: -2px;
  border-radius: 50%;
  background: rgba(214, 245, 255, 0.95);
  box-shadow: 0 0 8px rgba(184, 255, 240, 0.9), 0 0 18px rgba(61, 217, 192, 0.5);
  pointer-events: none;
  animation: wakeFade 0.9s ease-out both;
}
@keyframes wakeFade {
  0%   { opacity: 0.9; transform: scale(1) translateY(0); }
  100% { opacity: 0; transform: scale(0.3) translateY(-18px); }
}

.guide-dive {
  min-height: 38px;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(61, 217, 192, 0.5);
  background: rgba(61, 217, 192, 0.12);
  color: var(--c-aqua, #3dd9c0);
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.guide-dive[hidden] { display: none; }

.mgb-stone { animation: stoneDrift 5s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -0.7s); }
@keyframes stoneDrift { 50% { transform: translateY(-3px); } }

/* Pages crossfade into each other where the browser supports it. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation-duration: 0.22s; }
::view-transition-new(root) { animation-duration: 0.32s; }

@media (prefers-reduced-motion: reduce) {
  .wake { display: none; }
  .mgb-stone { animation: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* Wide screens: page heroes keep their words on the left and their life on the
   right, in the water the layout leaves open. */
@media (min-width: 940px) {
  .phero .reef-life { left: 52%; width: 48%; top: 12%; height: 88%; }
}

/* ==========================================================================
   DEMOCRATIC REPUBLIC OF THE CONGO — the dropdown, the flag, the page
   ========================================================================== */
.flag-cd { display: inline-block; vertical-align: middle; border-radius: 3px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18); flex: none; }

/* Desktop dropdown */
.nav-dd { position: relative; display: none; }
@media (min-width: 980px) {
  .nav-dd { display: block; }
  .nav-dd-btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 0.7rem;
    border-radius: 8px;
    border: 0;
    background: transparent;
    color: var(--ink-2);
    font: inherit; font-size: 0.885rem; font-weight: 500; letter-spacing: -0.008em;
    cursor: pointer;
    transition: color 0.25s var(--ease-io), background 0.25s var(--ease-io);
  }
  .nav-dd-btn:hover, .nav-dd.open .nav-dd-btn, .nav-dd:focus-within .nav-dd-btn { color: var(--ink); background: var(--glass); }
  .nav-dd.is-current .nav-dd-btn { color: var(--ink); }
  .nav-dd-chev { transition: transform 0.25s var(--ease); }
  .nav-dd.open .nav-dd-chev, .nav-dd:hover .nav-dd-chev { transform: rotate(180deg); }
  .nav-dd-l-full { display: none; }
  .nav-dd-l-short { display: inline; }
  @media (min-width: 1280px) {
    .nav-dd-l-full { display: inline; }
    .nav-dd-l-short { display: none; }
  }
  .nav-dd-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 95;
    width: 21rem;
    padding: 0.55rem;
    border-radius: 16px;
    border: 1px solid var(--edge-bright);
    background: color-mix(in srgb, var(--abyss-deep) 92%, transparent);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    box-shadow: inset 0 1px 0 var(--specular), var(--lift-3);
    opacity: 0; visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.22s var(--ease-io), transform 0.3s var(--ease), visibility 0.22s;
  }
  .nav-dd:hover .nav-dd-menu, .nav-dd.open .nav-dd-menu, .nav-dd:focus-within .nav-dd-menu { opacity: 1; visibility: visible; transform: none; }
  .nav-dd-menu::before { content: ''; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
  .nav-dd-head {
    display: flex; align-items: center; gap: 0.7rem;
    padding: 0.55rem 0.6rem 0.7rem;
    border-bottom: 1px solid var(--edge);
    margin-bottom: 0.35rem;
  }
  .nav-dd-head b { display: block; color: var(--ink); font-size: 0.9rem; font-weight: 650; letter-spacing: -0.015em; line-height: 1.25; }
  .nav-dd-head span { display: block; color: var(--ink-4); font-size: 0.7rem; margin-top: 0.15rem; }
  .nav-dd-menu a {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.55rem 0.6rem;
    border-radius: 10px;
    color: var(--ink-2);
    font-size: 0.84rem; font-weight: 500;
  }
  .nav-dd-menu a:hover, .nav-dd-menu a:focus-visible { color: var(--ink); background: var(--glass); }
  .nav-dd-menu a[aria-current='page'] { color: var(--lume); }
  .nav-dd-menu .nav-geo { margin: 0.35rem 0.6rem 0.2rem; padding-top: 0.6rem; border-top: 1px solid var(--edge); }
}

/* "Viewing from" line */
.nav-geo { display: flex; align-items: center; gap: 0.45rem; font-size: 0.74rem; color: var(--ink-4); }
.nav-geo[hidden] { display: none; }
.nav-geo b { color: var(--ink-2); font-weight: 600; }
.nav-geo img { width: 20px; height: 15px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18); object-fit: cover; }
.nav-geo-m { justify-content: center; margin-bottom: 0.9rem; }
.geo-line { margin-top: 0.9rem; font-size: 0.8rem; }

/* Mobile menu item with the flag */
.nav-m-lab { display: inline-flex; align-items: center; gap: 0.6rem; }

/* The page */
.flagline { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.4rem; }
.flagline .eyebrow { margin: 0; }
.fact-card { padding: 1.1rem 1.15rem; display: grid; gap: 0.25rem; }
.fact-k { font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--lume); font-weight: 650; }
.fact-v2 { color: var(--ink); font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; }
.fact-s { font-size: 0.78rem; color: var(--ink-3); line-height: 1.45; }
.partner-card { padding: 1.3rem 1.3rem 1.2rem; display: grid; gap: 0.5rem; align-content: start; }
.partner-card h3 { font-size: 1.2rem; letter-spacing: -0.02em; }
.partner-card p { font-size: 0.9rem; color: var(--ink-2); line-height: 1.55; }
.congo-quote { padding: 1.4rem 1.5rem; margin: 0; display: grid; gap: 0.9rem; }
.congo-quote p { font-size: 1.05rem; line-height: 1.55; color: var(--ink); letter-spacing: -0.01em; }
.congo-quote footer { display: grid; gap: 0.1rem; font-size: 0.8rem; }
.congo-quote footer b { color: var(--lume); font-weight: 650; }
.congo-quote footer span { color: var(--ink-4); }
.invite-card { padding: 1.3rem 1.4rem; display: grid; gap: 0.6rem; }
.invite-card p { color: var(--ink-2); line-height: 1.55; }
.report-card { display: grid; gap: 1.4rem; padding: 1.3rem; }
@media (min-width: 760px) { .report-card { grid-template-columns: 220px 1fr; align-items: center; } }
.report-cover { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--edge); background: #fff; box-shadow: var(--lift-2); transition: transform 0.35s var(--ease); }
.report-cover img { display: block; width: 100%; height: auto; }
@media (hover: hover) { .report-cover:hover { transform: translateY(-3px); } }
.report-body { display: grid; gap: 0.6rem; }
.report-body h3 { font-size: 1.15rem; letter-spacing: -0.02em; line-height: 1.3; }
.report-body p { color: var(--ink-2); font-size: 0.92rem; line-height: 1.55; }
.report-body .hero-actions { margin-top: 0.4rem; }
.report-view { margin-top: 1.2rem; }
.report-view summary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  min-height: 44px; padding: 0.6rem 1.1rem;
  border-radius: 999px; border: 1px solid var(--edge);
  background: var(--glass); color: var(--ink-2);
  font-size: 0.86rem; font-weight: 550; cursor: pointer; list-style: none;
}
.report-view summary::-webkit-details-marker { display: none; }
.report-view summary::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--lume); box-shadow: 0 0 8px var(--lume); }
.report-view[open] summary { color: var(--ink); border-color: var(--edge-bright); }
.report-frame { margin-top: 1rem; border-radius: 14px; overflow: hidden; border: 1px solid var(--edge); background: #f3f4f6; box-shadow: var(--lift-2); }
.report-frame iframe { display: block; width: 100%; height: min(80vh, 1000px); border: 0; }
/* The Congo item in the phone menu reads like every other item. */
.nav-m li a .nav-m-lab { color: inherit; font-size: inherit; font-weight: inherit; letter-spacing: inherit; }

/* ==========================================================================
   PERFORMANCE — glass without per-frame blur, creatures without filters,
   sections rendered only when near, and the water made of cheap layers
   ========================================================================== */
/* Cards: the glass look from gradient, edge and specular — no backdrop blur.
   Backdrop blur stays only on the few floating overlays. */
.glass {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.035)),
              color-mix(in srgb, var(--abyss-deep) 58%, transparent);
}
.header { backdrop-filter: blur(12px) saturate(140%); -webkit-backdrop-filter: blur(12px) saturate(140%); }
[data-theme='reef'] .gauge, [data-theme='reef'] .dive {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: color-mix(in srgb, #041d2e 90%, transparent);
}
/* Far creatures: depth from size and opacity, not blur. */
.rl-p0 { filter: none; }
.rl-p1 { filter: none; }
.rl-p0.is-lum, .rl-p1.is-lum { filter: none; }
.whale-flyby { filter: none; }
/* Long pages render only what is near the viewport. */
section.band-b { content-visibility: auto; contain-intrinsic-size: auto 720px; }
/* Phones carry fewer animated creatures and motes. */
@media (max-width: 720px) {
  .reef-life .rl:nth-child(n+6) { display: none; }
  .motes i:nth-child(n+13) { display: none; }
}
/* The lantern: plain light, no blend mode. */
.lantern { mix-blend-mode: normal; background: radial-gradient(circle, rgba(184, 255, 240, 0.09), rgba(184, 255, 240, 0.03) 36%, transparent 70%); }
/* Parallax is set once per section; each plane takes its share. */
[data-theme='reef'] .has-life { --py: 0px; }
[data-theme='reef'] .rl { translate: 0 var(--py, 0px); will-change: auto; }
[data-theme='reef'] .rl-p0 { translate: 0 calc(var(--py, 0px) * 0.28); }
[data-theme='reef'] .rl-p1 { translate: 0 calc(var(--py, 0px) * 0.56); }
[data-theme='reef'] .rl-p2 { translate: 0 var(--py, 0px); }

/* ==========================================================================
   THE SURFACE — two layered swells rolling at different speeds under the
   header, a lift of foam, and slow caustic light moving through the shallows
   ========================================================================== */
main { position: relative; }
.surface {
  position: absolute;
  left: 0; right: 0; top: -2px;
  height: 150px;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.surface svg { position: absolute; left: 0; top: 0; width: 200%; height: 100%; }
.swell {
  position: absolute; left: 0; top: 0;
  width: 200%; height: 100%;
  will-change: transform;
}
.swell-back  { animation: swellRun 14s linear infinite; opacity: 0.55; }
.swell-front { animation: swellRun 9s linear infinite reverse; opacity: 0.8; }
.swell path { fill: url(#swell-fill); }
.swell-front path { fill: url(#swell-fill-2); }
@keyframes swellRun { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-50%, 0, 0); } }
.surface-foam {
  position: absolute; left: 0; right: 0; top: 0; height: 150px;
  background: linear-gradient(180deg, rgba(220, 245, 255, 0.16), rgba(220, 245, 255, 0.05) 40%, transparent 100%);
  animation: foamBreathe 6s ease-in-out infinite alternate;
}
@keyframes foamBreathe { to { opacity: 0.55; transform: translateY(6px); } }
.caustics {
  position: absolute; left: -10%; right: -10%; top: 0;
  height: 62svh;
  pointer-events: none;
  z-index: 0;
  opacity: 0.32;
  background:
    radial-gradient(ellipse 22% 9% at 20% 24%, rgba(220, 250, 255, 0.35), transparent 70%),
    radial-gradient(ellipse 18% 8% at 62% 12%, rgba(220, 250, 255, 0.28), transparent 70%),
    radial-gradient(ellipse 26% 10% at 84% 32%, rgba(220, 250, 255, 0.22), transparent 70%),
    radial-gradient(ellipse 20% 8% at 42% 40%, rgba(220, 250, 255, 0.24), transparent 70%);
  mask-image: linear-gradient(180deg, #000 0%, #000 40%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 40%, transparent 100%);
  animation: causticDrift 26s ease-in-out infinite alternate;
  will-change: transform;
}
.caustics.c2 { opacity: 0.22; animation-duration: 33s; animation-direction: alternate-reverse; transform-origin: 30% 20%; }
@keyframes causticDrift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(3%, 1.5%, 0) scale(1.06); }
  100% { transform: translate3d(-2%, 3%, 0) scale(1.02); }
}
/* The flood's crest: a third, slower layer and a line of foam on the front. */
.wave-crest .wc-mid { fill: #084a6c; opacity: 0.55; animation: crestRun 12s linear infinite; }
.wave-crest .wc-front { filter: drop-shadow(0 -2px 0 rgba(220, 245, 255, 0.35)); }
@media (prefers-reduced-motion: reduce) {
  .swell, .surface-foam, .caustics { animation: none; }
}

/* ==========================================================================
   FINAL ENGINES — merge, blocks, runner, catch; black pearls; the daily
   ========================================================================== */
/* Guide: five dots, a black pearl marker, the daily button */
.lv i { width: 5px; height: 5px; }
.fg.black::before {
  content: '';
  position: absolute;
  top: 5px; left: 5px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #cfd8e3, #46506a 45%, #141a2b);
  box-shadow: 0 0 7px rgba(120, 140, 255, 0.6);
}
.guide-daily {
  min-height: 38px;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(232, 93, 158, 0.45);
  background: rgba(232, 93, 158, 0.1);
  color: #ff9ccb;
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.guide-daily.done { border-color: var(--edge); background: var(--glass); color: var(--ink-2); text-transform: none; letter-spacing: 0.02em; }
.mgb-end.pearl.black b { color: #b9c6ff; }
.mgb-end.black .mgb-pearl { background: radial-gradient(circle at 34% 30%, #cfd8e3, #46506a 45%, #141a2b); box-shadow: 0 0 26px rgba(120, 140, 255, 0.7); }

/* merge */
.mgb-merge { position: absolute; inset: 0; display: grid; grid-template-rows: 1fr auto; gap: 0.4rem; padding: 0.6rem; }
.mgb-mgrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 0.35rem;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.mgb-mgrid i {
  display: grid; place-items: center;
  border-radius: 10px;
  border: 1px solid var(--edge);
  background: rgba(255, 255, 255, 0.04);
  font-style: normal; font-weight: 800; font-size: 1.05rem; letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.mgb-mgrid i.t1 { background: rgba(61, 217, 192, 0.14); }
.mgb-mgrid i.t2 { background: rgba(61, 217, 192, 0.24); }
.mgb-mgrid i.t3 { background: rgba(0, 166, 196, 0.34); }
.mgb-mgrid i.t4 { background: rgba(91, 127, 232, 0.4); }
.mgb-mgrid i.t5 { background: rgba(232, 93, 158, 0.4); }
.mgb-mgrid i.t6 { background: rgba(255, 122, 89, 0.45); }
.mgb-mgrid i.t7 { background: rgba(255, 209, 102, 0.5); color: #04121b; }
.mgb-mgrid i.t8 { background: rgba(255, 231, 166, 0.7); color: #04121b; }
.mgb-mgrid i.t9, .mgb-mgrid i.t10 { background: #fff; color: #04121b; box-shadow: 0 0 18px rgba(255, 231, 166, 0.8); }
.mgb-mpad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.35rem; }
.mgb-mpad button {
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid var(--edge);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink-2);
  font-size: 1rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mgb-mpad button:active { background: rgba(61, 217, 192, 0.2); }

/* blocks */
.mgb-blocks { position: absolute; inset: 0; display: grid; grid-template-rows: 1fr auto; gap: 0.4rem; padding: 0.55rem; }
.mgb-bgrid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(6, 1fr);
  gap: 3px;
  align-self: center;
  justify-self: center;
  width: min(100%, 210px);
  aspect-ratio: 1;
}
.mgb-bcell {
  border-radius: 5px;
  border: 1px solid rgba(160, 232, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  padding: 0;
  cursor: pointer;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.mgb-bcell.on { background: linear-gradient(180deg, #ff9d82, #ff7a59); border-color: rgba(255, 141, 122, 0.7); box-shadow: 0 0 8px rgba(255, 122, 89, 0.45); }
.mgb-hand { display: flex; justify-content: center; gap: 0.6rem; min-height: 56px; }
.mgb-piece {
  display: grid;
  grid-template-columns: repeat(var(--w, 1), 12px);
  grid-template-rows: repeat(var(--h, 1), 12px);
  gap: 2px;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid var(--edge);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  align-self: center;
  -webkit-tap-highlight-color: transparent;
}
.mgb-piece i { border-radius: 3px; background: linear-gradient(180deg, #ff9d82, #ff7a59); }
.mgb-piece.sel { border-color: var(--c-aqua); box-shadow: 0 0 14px rgba(61, 217, 192, 0.5); }
.mgb-piece.used { opacity: 0.25; pointer-events: none; min-width: 34px; min-height: 34px; }

/* runner */
.mgb-runner { position: absolute; inset: 0; overflow: hidden; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.mgb-runner.hurt { box-shadow: inset 0 0 0 3px rgba(255, 141, 122, 0.6); }
.mgb-swim { position: absolute; left: calc(26% - 22px); top: -22px; width: 44px; height: 44px; will-change: transform; filter: drop-shadow(0 0 8px rgba(61, 217, 192, 0.5)); }
.mgb-col {
  position: absolute;
  left: 0;
  width: 26px;
  border-radius: 8px;
  background: linear-gradient(90deg, #2fa455, #4ecb71 50%, #2fa455);
  border: 1px solid rgba(78, 203, 113, 0.5);
  will-change: transform;
}
.mgb-col.top { border-radius: 0 0 8px 8px; top: 0; }
.mgb-col.bot { border-radius: 8px 8px 0 0; }

/* catch */
.mgb-catch { position: absolute; inset: 0; overflow: hidden; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.mgb-catcher {
  position: absolute;
  bottom: 10px;
  left: calc((var(--lane, 2) + 0.5) * 20% - 23px);
  width: 46px; height: 46px;
  transition: left 0.18s var(--ease);
  filter: drop-shadow(0 0 8px rgba(61, 217, 192, 0.5));
  z-index: 2;
}
.mgb-item {
  position: absolute;
  top: -30px;
  left: calc((var(--lane, 2) + 0.5) * 20% - 13px);
  width: 26px; height: 26px;
  display: grid; place-items: center;
  animation: itemFall linear both;
  will-change: transform;
}
@keyframes itemFall { to { transform: translate3d(0, 330px, 0); } }
.mgb-item.got { animation-play-state: paused; opacity: 0; transition: opacity 0.15s; }
.mgb-plastic {
  display: block;
  width: 18px; height: 22px;
  border-radius: 4px 4px 6px 6px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 141, 122, 0.45));
  border: 1px solid rgba(255, 141, 122, 0.8);
  transform: rotate(14deg);
}
/* The surface stays in the top band, under the header and above the words. */
.surface { height: 118px; }
.swell-back { transform-origin: top; }
.surface-foam { height: 118px; }

/* ==========================================================================
   MOBILE LOCK + THE SURFACE, REDRAWN IN LIGHT
   ========================================================================== */
/* Nothing may widen the page. Clip does not create a scroll container, so the
   sticky header keeps working. */
html { overflow-x: clip; scroll-behavior: smooth; }
main { overflow-x: clip; }
.caustics { left: 0; right: 0; opacity: 0.26; }
.caustics.c2 { opacity: 0.18; }
/* Soft surface layers: gradients that fade to nothing, moved only by transform. */
.surface { height: 132px; }
.surface-light {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(224, 246, 255, 0.2), rgba(224, 246, 255, 0.07) 38%, transparent 100%);
}
.ripples {
  position: absolute; left: 0; top: 0;
  width: 200%; height: 100%;
  background-repeat: repeat-x;
  will-change: transform;
  mask-image: linear-gradient(180deg, #000 0%, #000 45%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 45%, transparent 100%);
}
.ripples-a {
  background-image: radial-gradient(ellipse 24% 58% at 50% 26%, rgba(236, 252, 255, 0.17), transparent 72%);
  background-size: 25% 100%;
  animation: rippleRun 15s linear infinite;
}
.ripples-b {
  background-image: radial-gradient(ellipse 18% 46% at 50% 40%, rgba(236, 252, 255, 0.11), transparent 72%);
  background-size: 16.6667% 100%;
  animation: rippleRun 10s linear infinite reverse;
  opacity: 0.9;
}
@keyframes rippleRun { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-50%, 0, 0); } }
.surface-foam { height: 132px; animation-duration: 7s; }
.surface svg, .swell { display: none; }
/* The hero cans breathe on the water. */
.can-stack { animation: canFloat 7s ease-in-out infinite; }
@keyframes canFloat { 50% { transform: translateY(-6px); } }
/* Life fades in as a section comes into view. */
[data-theme='reef'] .reef-life { animation: lifeIn 1.4s var(--ease-io) both; }
@keyframes lifeIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ripples, .can-stack, .surface-foam { animation: none; }
  [data-theme='reef'] .reef-life { animation: none; }
}

/* ==========================================================================
   THE HORIZON — one line between air and water, with light running along it
   ========================================================================== */
.surface svg.horizon { display: block; }
.horizon {
  position: absolute; left: 0; top: 0;
  width: 200%; height: 100%;
  fill: none;
  animation: rippleRun 22s linear infinite;
  will-change: transform;
  overflow: visible;
}
.hz-glow { stroke: rgba(200, 245, 255, 0.16); stroke-width: 16; stroke-linecap: round; }
.hz-line { stroke: rgba(236, 252, 255, 0.62); stroke-width: 1.5; }
.hz-pulse {
  stroke: #ffffff;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-dasharray: 70 1370;
  animation: hzPulse 7s linear infinite;
  opacity: 0.95;
}
@keyframes hzPulse { to { stroke-dashoffset: -1440; } }
.surface { animation: surfaceBreathe 9s ease-in-out infinite alternate; }
@keyframes surfaceBreathe { to { transform: translateY(4px); } }
.ripples-a { opacity: 0.75; }
.ripples-b { opacity: 0.6; }

/* Intentional motion on the phone: press, sweep, arrive. */
.btn:active { transform: scale(0.98); }
.can-stack { position: relative; overflow: hidden; }
.can-stack::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, 0.13) 50%, transparent 58%);
  transform: translateX(-130%);
  animation: canSweep 10s ease-in-out infinite;
  pointer-events: none;
}
@keyframes canSweep { 0%, 72% { transform: translateX(-130%); } 100% { transform: translateX(130%); } }
[data-theme='reef'] .dive { overflow: hidden; }
[data-theme='reef'] .dive::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.16) 50%, transparent 60%);
  transform: translateX(-130%);
  animation: canSweep 12s ease-in-out infinite;
  pointer-events: none;
}
main { animation: pageIn 0.6s var(--ease-io) both; }
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .horizon, .hz-pulse, .surface, .can-stack::after, [data-theme='reef'] .dive::after, main { animation: none; }
}
/* The horizon hugs the band under the header, above every word. */
.surface { height: 100px; }
.surface-foam { height: 100px; }
.hz-glow { stroke: rgba(200, 245, 255, 0.11); stroke-width: 14; }
.hz-line { stroke: rgba(236, 252, 255, 0.46); stroke-width: 1.3; }
.hz-pulse { stroke-width: 2; opacity: 0.85; stroke-dasharray: 60 1380; }
.ripples { mask-image: linear-gradient(180deg, #000 0%, #000 30%, transparent 100%); -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 30%, transparent 100%); }
/* Phones: the near plane stays off the intro text of inner pages. */
@media (max-width: 720px) {
  .phero .rl-p2 { display: none; }
  .surface { height: 84px; }
  .surface-foam { height: 84px; }
}

/* ==========================================================================
   THE SURFACE, FINAL — a field of soft light. No stroke, no dash, no seam.
   ========================================================================== */
.hz-line, .hz-pulse { display: none; }
.hz-glow { stroke: rgba(214, 246, 255, 0.13); stroke-width: 26; stroke-linecap: round; }
.horizon { animation-duration: 28s; }
.surface { height: 110px; }
.surface-foam { height: 110px; }
.surface-light { background: linear-gradient(180deg, rgba(224, 246, 255, 0.16), rgba(224, 246, 255, 0.05) 42%, transparent 100%); }
.ripples-a { opacity: 0.55; animation-duration: 21s; }
.ripples-b { opacity: 0.45; animation-duration: 14s; }
/* One slow glint of sun crossing the surface, tiled so it never runs out. */
.glint {
  background-image: radial-gradient(ellipse 30% 80% at 25% 20%, rgba(255, 255, 255, 0.13), transparent 70%);
  background-size: 50% 100%;
  animation: rippleRun 26s linear infinite;
  opacity: 0.9;
}
@media (max-width: 720px) {
  .surface, .surface-foam { height: 88px; }
  .hz-glow { stroke-width: 20; }
}
/* Anchors land below the sticky header; keyboard focus is visible. */
[id] { scroll-margin-top: 92px; }
:focus-visible { outline: 2px solid var(--lume); outline-offset: 3px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { .glint { animation: none; } }

/* ==========================================================================
   FINAL PASS — the floating menu, the soft flood, and lifelike motion
   ========================================================================== */

/* ---------- The menu button floats; the bar steps aside while you read ---------- */
@media (max-width: 979px) {
  .menu-btn {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 7px);
    right: 12px;
    z-index: 120;
    margin: 0;
    width: 46px; height: 46px;
    border-radius: 50%;
    border: 1px solid var(--edge);
    background: color-mix(in srgb, var(--abyss-deep) 80%, transparent);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    transition: background 0.35s var(--ease-io), box-shadow 0.35s var(--ease-io), transform 0.35s var(--ease);
  }
  .menu-btn:active { transform: scale(0.94); }
  .menu-btn[aria-expanded='true'] { background: rgba(255, 255, 255, 0.09); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2); }
  .header-in { padding-right: 52px; }
  .header { transition: transform 0.55s var(--ease), background 0.4s var(--ease-io), border-color 0.4s var(--ease-io); }
  body.hdr-hide .header { transform: translateY(-100%); }
  body.locked .header { transform: none; }
}
/* The three lines gather into a close mark one after another. */
.mw-l { transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s var(--ease-io); }
.mw-1 { transition-delay: 0.04s; }
.mw-3 { transition-delay: 0.08s; }

/* ---------- The flood, refined: one soft tide rising. No crest, no seam. ---------- */
.nav-m, .nav-m.open { transform: none; }
.nav-m.open { transition: opacity 0.15s var(--ease-io), visibility 0s; }
.nav-m:not(.open) { transition: opacity 0.3s var(--ease-io) 0.35s, visibility 0s 0.65s; }
.wave-veil {
  inset: -30% 0 0 0;
  overflow: hidden;
  background: linear-gradient(180deg,
    rgba(4, 32, 48, 0) 0%, rgba(4, 32, 48, 0.55) 10%, #04202f 22%, #031a2a 55%, #020d18 100%);
  transform: translateY(105%);
  transition: transform 0.55s cubic-bezier(0.55, 0, 0.85, 0.5);
}
.nav-m.open .wave-veil { transform: translateY(0); transition: transform 0.95s cubic-bezier(0.16, 1, 0.3, 1); }
.wave-crest, .wave-body, .wave-veil::after, .nav-m.open .wave-veil::after { display: none; }
.veil-light {
  position: absolute; left: 0; top: 26%;
  width: 200%; height: 50%;
  background-repeat: repeat-x;
  background-size: 50% 100%;
  background-image:
    radial-gradient(ellipse 20% 34% at 28% 42%, rgba(120, 222, 255, 0.14), transparent 70%),
    radial-gradient(ellipse 16% 28% at 74% 64%, rgba(120, 222, 255, 0.1), transparent 70%);
  animation: rippleRun 34s linear infinite;
  opacity: 0;
  transition: opacity 1s var(--ease-io) 0.35s;
  will-change: transform;
}
.veil-light.v2 {
  top: 52%; height: 46%;
  animation: rippleRun 24s linear infinite reverse;
  background-image: radial-gradient(ellipse 18% 30% at 50% 50%, rgba(61, 217, 192, 0.11), transparent 70%);
}
.nav-m.open .veil-light { opacity: 1; }
.nav-m a { transform: translateY(16px); }
.nav-m.open a { animation: navIn 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }

/* ---------- Motion, lifelike ----------
   Every creature has two layers: the path (.rl) and the body (.body/.ico).
   The body turns through the camera plane at each end of a run instead of
   flipping; near swimmers beat their tails; jellies contract fast and relax
   slow; jets squeeze; mantas beat their wings; coral is rooted and sways. */
[data-theme='reef'] .rl .body { display: block; transform-origin: 50% 50%; }

@keyframes swimPath {
  0%   { transform: scale(var(--s)) translate(-66px, 0)    rotate(0deg);  animation-timing-function: cubic-bezier(0.3, 0, 0.2, 1); }
  9%   { transform: scale(var(--s)) translate(-48px, -5px) rotate(-4deg); animation-timing-function: cubic-bezier(0.35, 0, 0.35, 1); }
  22%  { transform: scale(var(--s)) translate(-14px, -9px) rotate(-1deg); animation-timing-function: cubic-bezier(0.3, 0, 0.2, 1); }
  34%  { transform: scale(var(--s)) translate(18px, -2px)  rotate(3deg);  animation-timing-function: cubic-bezier(0.35, 0, 0.35, 1); }
  44%  { transform: scale(var(--s)) translate(50px, 4px)   rotate(1deg);  animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1); }
  50%  { transform: scale(var(--s)) translate(66px, 2px)   rotate(0deg);  animation-timing-function: cubic-bezier(0.3, 0, 0.2, 1); }
  59%  { transform: scale(var(--s)) translate(48px, -4px)  rotate(4deg);  animation-timing-function: cubic-bezier(0.35, 0, 0.35, 1); }
  72%  { transform: scale(var(--s)) translate(14px, -9px)  rotate(1deg);  animation-timing-function: cubic-bezier(0.3, 0, 0.2, 1); }
  84%  { transform: scale(var(--s)) translate(-18px, -2px) rotate(-3deg); animation-timing-function: cubic-bezier(0.35, 0, 0.35, 1); }
  94%  { transform: scale(var(--s)) translate(-50px, 4px)  rotate(-1deg); animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1); }
  100% { transform: scale(var(--s)) translate(-66px, 0)    rotate(0deg); }
}
/* The turn happens on the body wrapper, through the plane, at the slow ends. */
[data-theme='reef'] .rl[data-anim='swim'] .ico { animation: none; }
[data-theme='reef'] .rl[data-anim='swim'] .body,
[data-theme='reef'] .rl[data-anim='glide'] .body { animation: faceTurn var(--dur) linear var(--delay, 0s) infinite; }
@keyframes faceTurn {
  0%       { transform: scaleX(calc(0.12 * var(--f0, 1))); }
  3%, 47%  { transform: scaleX(var(--f0, 1)); }
  50%      { transform: scaleX(calc(0.12 * var(--f0, 1))); }
  53%, 97% { transform: scaleX(calc(-1 * var(--f0, 1))); }
  100%     { transform: scaleX(calc(-0.12 * var(--f0, 1))); }
}
/* Tail beat, pivoting at the head, on the two nearer planes. */
[data-theme='reef'] .rl-p1[data-anim='swim'] .ico,
[data-theme='reef'] .rl-p2[data-anim='swim'] .ico {
  animation: swimBody calc(var(--dur) / 13) ease-in-out var(--delay, 0s) infinite;
  transform-origin: calc(50% + var(--f0, 1) * 22%) 50%;
}
@keyframes swimBody {
  0%, 100% { transform: skewX(0deg) scaleX(1); }
  25%      { transform: skewX(2.4deg) scaleX(0.985) rotate(0.5deg); }
  75%      { transform: skewX(-2.4deg) scaleX(0.985) rotate(-0.5deg); }
}

/* Jellies: a quick contraction, a slow relax, a pause; the drift tilts with it. */
[data-theme='reef'] .rl[data-anim='jelly'] .ico { animation: jellyBell 3.8s linear var(--delay, 0s) infinite; transform-origin: 50% 22%; }
@keyframes jellyBell {
  0%   { transform: scale(1, 1) translateY(0);           animation-timing-function: cubic-bezier(0.55, 0, 0.3, 1); }
  13%  { transform: scale(1.1, 0.84) translateY(-2px);   animation-timing-function: cubic-bezier(0.2, 0.7, 0.25, 1); }
  30%  { transform: scale(0.94, 1.06) translateY(-10px); animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1); }
  56%  { transform: scale(1.02, 0.99) translateY(-6px);  animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1); }
  100% { transform: scale(1, 1) translateY(0); }
}
@keyframes jellyDrift {
  0%, 100% { transform: scale(var(--s)) translate(0, 18px)    rotate(-5deg); }
  30%      { transform: scale(var(--s)) translate(8px, -2px)   rotate(2deg); }
  55%      { transform: scale(var(--s)) translate(12px, -18px) rotate(6deg); }
  80%      { transform: scale(var(--s)) translate(4px, -6px)   rotate(1deg); }
}

/* Crabs: a lean into each dash, dead still between. */
@keyframes scuttle {
  0%, 9%   { transform: scale(var(--s)) translateX(-36px) rotate(0deg); animation-timing-function: cubic-bezier(0.2, 0.8, 0.3, 1); }
  15%      { transform: scale(var(--s)) translateX(-12px) translateY(-3px) rotate(2deg); }
  19%, 36% { transform: scale(var(--s)) translateX(-8px) rotate(0deg); animation-timing-function: cubic-bezier(0.2, 0.8, 0.3, 1); }
  42%      { transform: scale(var(--s)) translateX(18px) translateY(-3px) rotate(2deg); }
  46%, 60% { transform: scale(var(--s)) translateX(22px) rotate(0deg); animation-timing-function: cubic-bezier(0.2, 0.8, 0.3, 1); }
  66%      { transform: scale(var(--s)) translateX(36px) translateY(-3px) rotate(2deg); }
  69%, 84% { transform: scale(var(--s)) translateX(34px) rotate(0deg); animation-timing-function: cubic-bezier(0.2, 0.8, 0.3, 1); }
  92%      { transform: scale(var(--s)) translateX(-14px) translateY(-3px) rotate(-3deg); }
  100%     { transform: scale(var(--s)) translateX(-36px) rotate(0deg); }
}

/* Upright hoverers tread water; the dorsal fin flutters on the near planes. */
@keyframes bobSway {
  0%, 100% { transform: scale(var(--s)) translate(0, 0)       rotate(-3deg); }
  25%      { transform: scale(var(--s)) translate(3px, -9px)   rotate(2deg); }
  50%      { transform: scale(var(--s)) translate(1px, -3px)   rotate(4deg); }
  75%      { transform: scale(var(--s)) translate(-2px, -11px) rotate(-2deg); }
}
[data-theme='reef'] .rl-p1[data-anim='bob'] .ico,
[data-theme='reef'] .rl-p2[data-anim='bob'] .ico { animation: finFlutter 0.7s ease-in-out var(--delay, 0s) infinite; transform-origin: 50% 40%; }
@keyframes finFlutter { 0%, 100% { transform: skewX(0deg); } 50% { transform: skewX(1.6deg) scaleX(0.99); } }

/* Jets: one sharp squeeze and dart, then a long glide home. */
@keyframes jetDart {
  0%   { transform: scale(var(--s)) translateX(0) rotate(0deg); animation-timing-function: cubic-bezier(0.1, 0.9, 0.2, 1); }
  6%   { transform: scale(var(--s)) translateX(var(--jx, -30px)) rotate(-6deg); animation-timing-function: cubic-bezier(0.2, 0.6, 0.3, 1); }
  14%  { transform: scale(var(--s)) translateX(calc(var(--jx, -30px) * 1.2)) translateY(-2px) rotate(-2deg); animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1); }
  60%  { transform: scale(var(--s)) translateX(calc(var(--jx, -30px) * 0.4)) translateY(3px) rotate(1deg); animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1); }
  100% { transform: scale(var(--s)) translateX(0) rotate(0deg); }
}
[data-theme='reef'] .rl[data-anim='jet'] .ico { animation: jetSqueeze calc(var(--dur) / 3) linear var(--delay, 0s) infinite; transform-origin: 50% 50%; }
@keyframes jetSqueeze {
  0%        { transform: scale(1, 1);       animation-timing-function: cubic-bezier(0.1, 0.9, 0.2, 1); }
  5%        { transform: scale(0.9, 1.08);  animation-timing-function: cubic-bezier(0.3, 0, 0.3, 1); }
  16%       { transform: scale(1.04, 0.97); animation-timing-function: ease-out; }
  32%, 100% { transform: scale(1, 1); }
}

/* Mantas: wide, even arcs, wings beating slowly. */
[data-theme='reef'] .rl[data-anim='glide'] { animation-name: glidePath; }
@keyframes glidePath {
  0%   { transform: scale(var(--s)) translate(-70px, 6px)  rotate(0deg);  animation-timing-function: ease-in-out; }
  18%  { transform: scale(var(--s)) translate(-34px, -10px) rotate(-5deg); animation-timing-function: ease-in-out; }
  36%  { transform: scale(var(--s)) translate(20px, -8px)  rotate(2deg);  animation-timing-function: ease-in-out; }
  50%  { transform: scale(var(--s)) translate(70px, 2px)   rotate(0deg);  animation-timing-function: ease-in-out; }
  64%  { transform: scale(var(--s)) translate(34px, -10px) rotate(5deg);  animation-timing-function: ease-in-out; }
  82%  { transform: scale(var(--s)) translate(-20px, -8px) rotate(-2deg); animation-timing-function: ease-in-out; }
  100% { transform: scale(var(--s)) translate(-70px, 6px)  rotate(0deg); }
}
[data-theme='reef'] .rl[data-anim='glide'] .ico { animation: wingBeat 2.8s ease-in-out var(--delay, 0s) infinite; transform-origin: 50% 50%; }
@keyframes wingBeat { 0%, 100% { transform: scaleY(1) translateY(0); } 50% { transform: scaleY(0.84) translateY(-2px); } }

/* Octopus: mantle pulses lift it, then it sinks. */
[data-theme='reef'] .rl[data-anim='pulse'] { animation-name: pulseSwim; animation-duration: calc(var(--dur) / 3); }
@keyframes pulseSwim {
  0%   { transform: scale(var(--s)) translate(0, 12px)   rotate(0deg);  animation-timing-function: cubic-bezier(0.1, 0.9, 0.2, 1); }
  10%  { transform: scale(var(--s)) translate(3px, -4px)  rotate(-3deg); animation-timing-function: cubic-bezier(0.3, 0, 0.3, 1); }
  24%  { transform: scale(var(--s)) translate(6px, -14px) rotate(-1deg); animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1); }
  62%  { transform: scale(var(--s)) translate(3px, -4px)  rotate(2deg);  animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1); }
  100% { transform: scale(var(--s)) translate(0, 12px)   rotate(0deg); }
}
[data-theme='reef'] .rl[data-anim='pulse'] .ico { animation: jetSqueeze calc(var(--dur) / 3) linear var(--delay, 0s) infinite; transform-origin: 50% 30%; }

/* Rooted life sways from its base; starfish and urchins barely stir. */
[data-theme='reef'] .rl[data-anim='sway'] { animation-name: swayRoot; animation-duration: calc(var(--dur) / 3); transform-origin: 50% 100%; }
@keyframes swayRoot {
  0%, 100% { transform: scale(var(--s)) rotate(-2.5deg) skewX(1deg); }
  50%      { transform: scale(var(--s)) rotate(2.5deg) skewX(-1deg); }
}
[data-theme='reef'] .rl[data-anim='still'] { animation-name: stillTurn; animation-duration: calc(var(--dur) * 2); }
@keyframes stillTurn {
  0%, 100% { transform: scale(var(--s)) rotate(-3deg) translateY(0); }
  50%      { transform: scale(var(--s)) rotate(3deg) translateY(-2px); }
}

@media (prefers-reduced-motion: reduce) {
  .rl .body, .rl .ico, .veil-light { animation: none !important; }
  .wave-veil, .nav-m.open .wave-veil { transition-duration: 0.2s; }
  .header { transition: none; }
}
/* Each line of the menu mark turns about its own centre, so the open state
   is a true X and the idle flow ripples in place. */
.mw-l { transform-box: fill-box; transform-origin: 50% 50%; }

/* ==========================================================================
   SWIPE BETWEEN SECTIONS — the pill that names where you are going, and the
   slide between pages. Header and floating controls hold still.
   ========================================================================== */
.swipe-hint {
  position: fixed; top: 50%; z-index: 95;
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.52rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--edge);
  background: color-mix(in srgb, var(--abyss-deep) 84%, transparent);
  color: var(--ink);
  font-size: 0.8rem; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.32);
  opacity: 0; pointer-events: none;
  transform: translate3d(0, -50%, 0);
  transition: opacity 0.18s var(--ease-io), border-color 0.18s var(--ease-io), color 0.18s var(--ease-io), box-shadow 0.18s var(--ease-io);
}
.swipe-hint.right { right: 14px; flex-direction: row-reverse; }
.swipe-hint.left { left: 14px; }
.swipe-hint .sh-arrow { font-size: 0.95rem; line-height: 1; }
.swipe-hint.armed { border-color: var(--lume); color: var(--lume); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.32), 0 0 22px rgba(184, 255, 240, 0.28); }
@media (min-width: 980px) { .swipe-hint { display: none; } }
/* Without cross-document transitions the new page slides in on its own. */
@keyframes swipeInNext { from { transform: translate3d(12%, 0, 0); opacity: 0; } }
@keyframes swipeInPrev { from { transform: translate3d(-12%, 0, 0); opacity: 0; } }
main.swipe-in-next { animation: swipeInNext 0.38s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
main.swipe-in-prev { animation: swipeInPrev 0.38s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
/* With them, the two pages slide past each other while the chrome stays put. */
.header { view-transition-name: header; }
.menu-btn { view-transition-name: menu; }
.dive { view-transition-name: dive; }
.gauge { view-transition-name: gauge; }
@keyframes vtOutL { to { transform: translate3d(-14%, 0, 0); opacity: 0; } }
@keyframes vtInR  { from { transform: translate3d(14%, 0, 0); opacity: 0; } }
@keyframes vtOutR { to { transform: translate3d(14%, 0, 0); opacity: 0; } }
@keyframes vtInL  { from { transform: translate3d(-14%, 0, 0); opacity: 0; } }
html:active-view-transition-type(swipe-next)::view-transition-old(root) { animation: vtOutL 0.3s cubic-bezier(0.4, 0, 1, 1) both; }
html:active-view-transition-type(swipe-next)::view-transition-new(root) { animation: vtInR 0.38s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
html:active-view-transition-type(swipe-prev)::view-transition-old(root) { animation: vtOutR 0.3s cubic-bezier(0.4, 0, 1, 1) both; }
html:active-view-transition-type(swipe-prev)::view-transition-new(root) { animation: vtInL 0.38s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@media (prefers-reduced-motion: reduce) { main.swipe-in-next, main.swipe-in-prev { animation: none; } }

/* ==========================================================================
   PRESS ITEM PAGES — one page per piece of coverage, at the URL the original
   site used, so every card clicks and every old link still resolves.
   ========================================================================== */
.press-read { max-width: 64ch; }
.press-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}
.press-step {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  color: var(--ink);
  transition: border-color 0.3s var(--ease-io), transform 0.3s var(--ease);
}
.press-step:hover { border-color: var(--lume); transform: translateY(-2px); }
.press-step.next { text-align: right; }
.press-step span { color: var(--ink-4); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.press-step b { font-size: 0.94rem; font-weight: 600; line-height: 1.35; letter-spacing: -0.01em; }
.press-item .press-meta span + span::before { content: '·'; margin: 0 0.45rem; color: var(--ink-4); }
@media (max-width: 720px) {
  .press-nav { grid-template-columns: 1fr; }
  .press-step.next { text-align: left; }
}

/* ==========================================================================
   REACTIONS — every tap draws a different move
   ========================================================================== */
.rl.rx-startle { animation: startle 0.55s var(--ease) 1 !important; }
.rl.rx-spin    { animation: rxSpin 0.7s var(--ease) 1 !important; }
.rl.rx-flip    { animation: rxFlip 0.65s var(--ease) 1 !important; }
.rl.rx-dart    { animation: rxDart 0.8s var(--ease) 1 !important; }
.rl.rx-bounce  { animation: rxBounce 0.7s var(--ease) 1 !important; }
.rl.rx-shimmy  { animation: rxShimmy 0.6s var(--ease-io) 1 !important; }
.rl.rx-puff    { animation: rxPuff 0.9s var(--ease) 1 !important; }
.rl.rx-flash   { filter: drop-shadow(0 0 18px rgba(184, 255, 240, 0.95)); transition: filter 0.6s var(--ease-io); }

@keyframes rxSpin   { to { transform: scale(var(--s)) rotate(360deg); } }
@keyframes rxFlip   { 50% { transform: scale(var(--s)) rotateY(180deg); } 100% { transform: scale(var(--s)) rotateY(360deg); } }
@keyframes rxDart   { 30% { transform: scale(var(--s)) translateX(46px) rotate(8deg); } 70% { transform: scale(var(--s)) translateX(-18px) rotate(-5deg); } 100% { transform: scale(var(--s)); } }
@keyframes rxBounce { 30% { transform: scale(var(--s)) translateY(-30px); } 60% { transform: scale(var(--s)) translateY(6px); } 100% { transform: scale(var(--s)); } }
@keyframes rxShimmy { 20% { transform: scale(var(--s)) rotate(-9deg); } 40% { transform: scale(var(--s)) rotate(9deg); } 60% { transform: scale(var(--s)) rotate(-6deg); } 80% { transform: scale(var(--s)) rotate(4deg); } 100% { transform: scale(var(--s)); } }
@keyframes rxPuff   { 40% { transform: scale(calc(var(--s) * 1.55)); } 65% { transform: scale(calc(var(--s) * 0.9)); } 100% { transform: scale(var(--s)); } }

.ink-cloud {
  position: fixed;
  z-index: 55;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: rgba(10, 16, 30, 0.85);
  pointer-events: none;
  animation: inkSpread 1.2s ease-out both;
}
@keyframes inkSpread {
  0%   { transform: translate(-50%, -50%) scale(1); opacity: 0.9; }
  100% { transform: translate(-50%, -50%) scale(9); opacity: 0; }
}

/* Pearl marker in the field guide */
.fg { position: relative; }
.fg.pearl::after {
  content: '';
  position: absolute;
  top: 5px; right: 5px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fff, #f0e6c8 45%, #cdb87e);
  box-shadow: 0 0 7px rgba(255, 231, 166, 0.8);
}
.fg.found { cursor: pointer; transition: transform 0.35s var(--ease), border-color 0.3s var(--ease-io); }
@media (hover: hover) { .fg.found:hover { transform: translateY(-3px); border-color: var(--edge-bright); } }

/* ==========================================================================
   ARCADE OVERLAY
   ========================================================================== */
.mg {
  position: fixed;
  inset: 0;
  z-index: 115;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(2, 10, 18, 0.66);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease-io), visibility 0.3s;
}
.mg.open { opacity: 1; visibility: visible; }
.mg-panel {
  width: min(100%, 26rem);
  border-radius: var(--radius-l);
  border: 1px solid var(--edge-bright);
  background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.03)), var(--abyss-deep);
  box-shadow: inset 0 1px 0 var(--specular), var(--lift-3);
  padding: 1.15rem 1.15rem 1.25rem;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.45s var(--ease);
}
.mg.open .mg-panel { transform: none; }
.mg-head { display: flex; align-items: center; gap: 0.75rem; }
.mg-ico {
  display: grid; place-items: center;
  width: 54px; height: 54px; flex: none;
  border-radius: 50%;
  background: var(--glass-strong);
  border: 1px solid var(--edge);
}
.mg-title { min-width: 0; }
.mg-title b { display: block; color: var(--ink); font-size: 1.06rem; font-weight: 700; letter-spacing: -0.02em; }
.mg-title span { font-size: 0.72rem; color: var(--ink-3); }
.mg-close {
  margin-left: auto;
  width: 40px; height: 40px; flex: none;
  border-radius: 50%;
  border: 1px solid var(--edge);
  background: var(--glass);
  color: var(--ink);
  font-size: 1.3rem; line-height: 1;
  cursor: pointer;
}
.mg-desc { font-size: 0.82rem; color: var(--ink-3); margin: 0.7rem 0; }
.mg-stage {
  position: relative;
  height: 300px;
  border-radius: var(--radius);
  border: 1px solid var(--edge);
  background: linear-gradient(180deg, rgba(9, 48, 72, 0.5), rgba(3, 18, 31, 0.8));
  overflow: hidden;
  touch-action: manipulation;
}
.mg-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; margin-top: 0.85rem; min-height: 40px; }
.mg-status { font-size: 0.84rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* pop */
.mgb-bubble {
  position: absolute;
  bottom: -60px;
  border-radius: 50%;
  border: 2px solid rgba(244, 251, 255, 0.65);
  background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.5), rgba(255,255,255,.08) 60%);
  cursor: pointer;
  animation: mgbRise linear both;
  -webkit-tap-highlight-color: transparent;
}
@keyframes mgbRise { to { transform: translateY(-380px); } }

/* whack */
.mgb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
  padding: 0.7rem;
  height: 100%;
}
.mgb-cell {
  border-radius: 14px;
  border: 1px solid var(--edge);
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.mgb-cell.lit {
  background: radial-gradient(circle, rgba(184, 255, 240, 0.85) 0%, rgba(61, 217, 192, 0.35) 60%, transparent 100%);
  box-shadow: 0 0 22px rgba(61, 217, 192, 0.7);
}

/* timing */
.mgb-timing {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mgb-ring, .mgb-pulse {
  position: absolute;
  left: 50%; top: 50%;
  border-radius: 50%;
  pointer-events: none;
}
.mgb-ring {
  width: 218px; height: 218px;
  transform: translate(-50%, -50%);
  border: 3px solid rgba(255, 209, 102, 0.85);
  box-shadow: 0 0 18px rgba(255, 209, 102, 0.45), inset 0 0 18px rgba(255, 209, 102, 0.25);
}
.mgb-pulse {
  width: 280px; height: 280px;
  transform: translate(-50%, -50%) scale(0.15);
  border: 3px solid var(--c-aqua);
  background: rgba(61, 217, 192, 0.09);
}
.mgb-timing.hit .mgb-ring { border-color: #7dffa8; box-shadow: 0 0 26px rgba(125, 255, 168, 0.8); }
.mgb-timing.miss .mgb-ring { border-color: #ff8d7a; box-shadow: 0 0 26px rgba(255, 141, 122, 0.7); }

/* shells */
.mgb-shells { position: relative; height: 100%; }
.mgb-shell {
  position: absolute;
  top: 50%;
  left: calc(16% + var(--pos) * 27%);
  transform: translateY(-50%);
  width: 76px; height: 76px;
  display: grid; place-items: center;
  border-radius: 18px;
  border: 1px solid var(--edge);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: left 0.3s var(--ease-io), transform 0.3s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.mgb-shell.peek { transform: translateY(-72%); border-color: var(--c-sun); box-shadow: 0 0 18px rgba(255, 209, 102, 0.5); }
.mgb-shell.reveal-win { border-color: #7dffa8; box-shadow: 0 0 22px rgba(125, 255, 168, 0.7); transform: translateY(-72%); }
.mgb-shell.reveal-miss { border-color: #ff8d7a; }

/* simon */
.mgb-simon {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  padding: 1.4rem;
  height: 100%;
}
.mgb-pad {
  border-radius: 18px;
  border: 1px solid var(--edge);
  opacity: 0.5;
  cursor: pointer;
  transition: opacity 0.18s, box-shadow 0.18s, transform 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.mgb-pad:active { transform: scale(0.97); }
.mgb-pad-0 { background: rgba(61, 217, 192, 0.4); }
.mgb-pad-1 { background: rgba(255, 209, 102, 0.4); }
.mgb-pad-2 { background: rgba(232, 93, 158, 0.4); }
.mgb-pad-3 { background: rgba(91, 127, 232, 0.4); }
.mgb-pad.on { opacity: 1; box-shadow: 0 0 26px rgba(244, 251, 255, 0.4); }

/* pairs */
.mgb-pairs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
  padding: 0.7rem;
  height: 100%;
}
.mgb-pairs.four-wide { grid-template-columns: repeat(4, 1fr); }
.mgb-card {
  position: relative;
  border: 0;
  background: transparent;
  cursor: pointer;
  perspective: 500px;
  -webkit-tap-highlight-color: transparent;
}
.mgb-card-in {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 0.4s var(--ease);
}
.mgb-card.up .mgb-card-in, .mgb-card.done .mgb-card-in { transform: rotateY(180deg); }
.mgb-card-back, .mgb-card-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--edge);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.mgb-card-back {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink-4);
  font-weight: 700;
  font-size: 0.9rem;
}
.mgb-card-face { background: rgba(61, 217, 192, 0.12); transform: rotateY(180deg); }
.mgb-card.done .mgb-card-face { border-color: rgba(125, 255, 168, 0.6); }

@media (prefers-reduced-motion: reduce) {
  .rl[class*='rx-'] { animation: none !important; }
  .ink-cloud { display: none; }
}

/* Dive log — level dots on each species card */
.lv { display: flex; gap: 3px; margin-top: 2px; }
.lv i {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid var(--edge);
}
.lv i.on {
  background: var(--c-aqua, #3dd9c0);
  border-color: transparent;
  box-shadow: 0 0 5px rgba(61, 217, 192, 0.7);
}
.fg.pearl .lv i.on { background: #f0e6c8; box-shadow: 0 0 5px rgba(255, 231, 166, 0.8); }

/* ==========================================================================
   THE ROAD — chapters of the real story
   ========================================================================== */
.guide-road {
  min-height: 34px;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 209, 102, 0.45);
  background: rgba(255, 209, 102, 0.1);
  color: var(--c-sun, #ffd166);
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.guide-head .guide-road { margin-left: auto; }
.guide-head .guide-sound { margin-left: 0; }

.road-lede { font-size: 0.8rem; color: var(--ink-3); margin: 0.4rem 0 0.9rem; }
.road-list { display: flex; flex-direction: column; gap: 0.6rem; }
.road-ch {
  border: 1px solid var(--edge);
  border-radius: 16px;
  background: var(--glass);
  padding: 0.85rem 0.95rem;
  opacity: 0.55;
}
.road-ch.open {
  opacity: 1;
  border-color: rgba(255, 209, 102, 0.35);
  background: linear-gradient(180deg, rgba(255, 209, 102, 0.07), rgba(255, 255, 255, 0.03));
}
.road-ch-head { display: flex; align-items: baseline; gap: 0.6rem; }
.road-n {
  flex: none;
  font-size: 0.72rem; font-weight: 700;
  color: var(--c-sun, #ffd166);
  font-variant-numeric: tabular-nums;
}
.road-ch-head b { color: var(--ink); font-size: 0.95rem; font-weight: 650; letter-spacing: -0.015em; }
.road-when { margin-left: auto; font-size: 0.66rem; color: var(--ink-4); text-align: right; }
.road-ch p { font-size: 0.83rem; line-height: 1.55; color: var(--ink-2); margin-top: 0.5rem; }
.road-principle {
  color: var(--c-sun, #ffd166) !important;
  font-weight: 550;
  border-top: 1px solid var(--edge);
  padding-top: 0.5rem;
}

/* ==========================================================================
   ORDER ENGINE — stones in sequence
   ========================================================================== */
.mgb-order {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.55rem;
  padding: 0.7rem;
  height: 100%;
  align-content: center;
}
.mgb-stone {
  min-height: 56px;
  border-radius: 14px;
  border: 1px solid var(--edge);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.mgb-stone span { transition: opacity 0.5s var(--ease-io); }
.mgb-order.veiled .mgb-stone:not(.done) span { opacity: 0; }
.mgb-stone.done {
  background: rgba(61, 217, 192, 0.16);
  border-color: rgba(61, 217, 192, 0.5);
  color: var(--c-aqua, #3dd9c0);
}
.mgb-stone.done span { opacity: 1; }
.mgb-stone.bad { border-color: #ff8d7a; background: rgba(255, 141, 122, 0.14); }

/* ==========================================================================
   PARADE — a second line across the bottom of the screen
   ========================================================================== */
.parade {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(4.4rem + env(safe-area-inset-bottom));
  z-index: 105;
  pointer-events: none;
  height: 64px;
}
.parade span {
  position: absolute;
  left: -80px;
  bottom: 0;
  animation: paradeCross 7.5s linear both;
}
@keyframes paradeCross {
  0%   { transform: translateX(0); }
  100% { transform: translateX(calc(100vw + 160px)); }
}
@media (prefers-reduced-motion: reduce) { .parade { display: none; } }

/* Road actions — the principle becomes a door */
.road-act {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.6rem;
  min-height: 40px;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(61, 217, 192, 0.4);
  background: rgba(61, 217, 192, 0.1);
  color: var(--c-aqua, #3dd9c0);
  font-size: 0.78rem;
  font-weight: 600;
}
.road-act:hover { border-color: rgba(61, 217, 192, 0.7); }

/* Share button in the guide head */
.guide-share {
  min-height: 34px;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--edge);
  background: var(--glass);
  color: var(--ink-2);
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.guide-share:hover { color: var(--ink); border-color: var(--edge-bright); }

/* ==========================================================================
   SONAR — ping the dark, follow the warmth
   ========================================================================== */
.mgb-sonar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.45rem;
  padding: 0.7rem;
  height: 100%;
  align-content: center;
}
.mgb-ping {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--edge);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-3);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.3s, border-color 0.3s, transform 0.25s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.mgb-ping:active { transform: scale(0.92); }
.mgb-ping.cold { background: rgba(91, 127, 232, 0.16); border-color: rgba(91, 127, 232, 0.4); color: #9db4f5; }
.mgb-ping.warm { background: rgba(255, 209, 102, 0.18); border-color: rgba(255, 209, 102, 0.45); color: #ffd166; }
.mgb-ping.hot  { background: rgba(255, 122, 89, 0.24); border-color: rgba(255, 122, 89, 0.6); color: #ff9d82; }
.mgb-ping.found {
  background: rgba(61, 217, 192, 0.28);
  border-color: var(--c-aqua);
  box-shadow: 0 0 24px rgba(61, 217, 192, 0.7);
  animation: pingFound 0.5s var(--ease);
}
@keyframes pingFound { 40% { transform: scale(1.28); } }

/* ==========================================================================
   TIDE — tap as each swell peaks
   ========================================================================== */
.mgb-tide {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.mgb-tide-line {
  position: absolute;
  left: 8%; right: 8%;
  top: 50%;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 209, 102, 0.75);
  box-shadow: 0 0 16px rgba(255, 209, 102, 0.5);
}
.mgb-tide-swell {
  position: absolute;
  left: 8%; right: 8%;
  bottom: -46%;
  height: 92%;
  border-radius: 46% 46% 0 0 / 60% 60% 0 0;
  background: linear-gradient(180deg, rgba(61, 217, 192, 0.55), rgba(0, 166, 196, 0.18));
  border-top: 3px solid var(--c-aqua);
  opacity: 0;
}
.mgb-tide-swell.in { animation: swellRise linear both; }
@keyframes swellRise {
  0%   { transform: translateY(0);     opacity: 0.25; }
  72%  { transform: translateY(-46%);  opacity: 1; }
  100% { transform: translateY(-70%);  opacity: 0.15; }
}
.mgb-tide.hit  .mgb-tide-line { background: #7dffa8; box-shadow: 0 0 26px rgba(125, 255, 168, 0.9); }
.mgb-tide.miss .mgb-tide-line { background: #ff8d7a; box-shadow: 0 0 26px rgba(255, 141, 122, 0.8); }

/* ==========================================================================
   CURRENT — steer through the kelp
   ========================================================================== */
.mgb-current { position: relative; height: 100%; overflow: hidden; }
.mgb-swimmer {
  position: absolute;
  left: calc(14% + var(--lane, 1) * 26%);
  bottom: 16%;
  z-index: 2;
  transition: left 0.22s var(--ease);
  filter: drop-shadow(0 0 10px rgba(61, 217, 192, 0.5));
}
.mgb-kelp {
  position: absolute;
  top: -18%;
  left: 0; right: 0;
  height: 46px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  padding: 0 8%;
  animation: kelpFall linear both;
}
.mgb-kelp span {
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(78, 203, 113, 0.6), rgba(47, 164, 85, 0.35));
  border: 1px solid rgba(78, 203, 113, 0.5);
}
.mgb-kelp span.gap { background: transparent; border-color: transparent; }
.mgb-kelp.hit span:not(.gap) { background: rgba(255, 141, 122, 0.55); border-color: #ff8d7a; }
@keyframes kelpFall { to { transform: translateY(420px); } }

.mgb-lanes {
  position: absolute;
  inset: auto 0 0 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  padding: 0.5rem 8%;
  z-index: 3;
}
.mgb-lanes button {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--edge);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mgb-lanes button:active { background: rgba(61, 217, 192, 0.2); }

/* ==========================================================================
   ARCADE — refinements: sheet layout, lives, judgments, count-in, end cards
   ========================================================================== */
.mg-panel { max-height: 94svh; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
.mg-close { width: 44px; height: 44px; }
.mg-stage {
  height: clamp(240px, 42svh, 320px);
  user-select: none;
  -webkit-user-select: none;
}
.mg-foot { flex-wrap: wrap; gap: 0.6rem 0.8rem; }
.mg-meta { flex: 1 1 12rem; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.mg-lives { display: inline-flex; gap: 4px; flex: none; }
.mg-lives i {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--edge);
  transition: background 0.25s, box-shadow 0.25s;
}
.mg-lives i.on {
  background: radial-gradient(circle at 34% 30%, #fff, #f0e6c8 45%, #cdb87e);
  border-color: transparent;
  box-shadow: 0 0 6px rgba(255, 231, 166, 0.7);
}
.mg-action { margin-left: auto; }
@media (max-width: 480px) {
  .mg-action { flex-basis: 100%; width: 100%; justify-content: center; }
  .mg-panel { padding: 1rem 1rem 1.1rem; }
}

/* Idle stage before the first start: the creature, waiting. */
.mgb-idle { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0.85; animation: idleBob 3.4s ease-in-out infinite; }
@keyframes idleBob { 50% { transform: translateY(-8px); } }

/* Judgment word */
.mgb-judge {
  position: absolute;
  left: 50%; top: 14%;
  z-index: 6;
  transform: translate(-50%, 0);
  pointer-events: none;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}
.mgb-judge.hit  { color: #7dffa8; animation: judgePop 0.7s var(--ease) both; }
.mgb-judge.miss { color: #ff8d7a; animation: judgePop 0.7s var(--ease) both; }
@keyframes judgePop {
  0%   { opacity: 0; transform: translate(-50%, 8px) scale(0.9); }
  25%  { opacity: 1; transform: translate(-50%, 0) scale(1.08); }
  100% { opacity: 0; transform: translate(-50%, -14px) scale(1); }
}

/* Ready … Go */
.mgb-ready {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: grid;
  place-items: center;
  background: rgba(2, 10, 18, 0.35);
  pointer-events: none;
}
.mgb-ready b {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  animation: readyIn 0.65s var(--ease) both;
}
.mgb-ready.go b { color: #7dffa8; animation: readyIn 0.35s var(--ease) both; }
@keyframes readyIn { 0% { opacity: 0; transform: scale(0.8); } 40% { opacity: 1; transform: scale(1.06); } 100% { opacity: 1; transform: scale(1); } }

/* Burst ring */
.mgb-burst {
  position: absolute;
  z-index: 5;
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(244, 251, 255, 0.85);
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: burstOut 0.45s ease-out both;
}
@keyframes burstOut { to { transform: translate(-50%, -50%) scale(5); opacity: 0; } }

/* Clock bar */
.mgb-clock { position: absolute; left: 0; right: 0; top: 0; height: 4px; z-index: 4; background: rgba(255, 255, 255, 0.08); }
.mgb-clock i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--c-sun, #ffd166), #ff8d7a);
  transform-origin: left;
  transform: scaleX(1);
  transition: transform 0s linear;
}

/* End card */
.mgb-end {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.35rem;
  padding: 1rem 1.4rem;
  text-align: center;
  background: rgba(2, 10, 18, 0.74);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(4px);
  animation: endIn 0.45s var(--ease) both;
}
.mgb-end b { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.mgb-end span { font-size: 0.8rem; color: var(--ink-2); max-width: 24rem; }
.mgb-end.win b { color: #7dffa8; }
.mgb-end.lose b { color: #ff8d7a; }
.mgb-end.pearl b { color: var(--c-sun, #ffd166); }
.mgb-end-ico { filter: drop-shadow(0 0 14px rgba(61, 217, 192, 0.5)); animation: idleBob 3s ease-in-out infinite; }
.mgb-pearl {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fff, #f0e6c8 45%, #cdb87e);
  box-shadow: 0 0 26px rgba(255, 231, 166, 0.8);
  animation: pearlIn 0.7s var(--ease) both;
}
@keyframes endIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pearlIn { 0% { transform: scale(0.3); opacity: 0; } 60% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }

/* pop — the button rides the animation; its inner circle does the popping */
.mgb-bubble { border: 0; background: transparent; padding: 0; }
.mgb-bubble i {
  display: block;
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 2px solid rgba(244, 251, 255, 0.65);
  background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.5), rgba(255,255,255,.08) 60%);
  transition: transform 0.16s var(--ease), opacity 0.16s;
}
.mgb-bubble.pop i { transform: scale(1.5); opacity: 0; }

/* whack — the creature surfaces; the decoy glows red */
.mgb-cell { display: grid; place-items: center; color: var(--ink); }
.mgb-cell.hit { animation: cellHit 0.3s var(--ease); }
@keyframes cellHit { 40% { transform: scale(0.9); } }
.mgb-cell.decoy {
  background: radial-gradient(circle, rgba(255, 141, 122, 0.55) 0%, rgba(255, 141, 122, 0.18) 60%, transparent 100%);
  box-shadow: 0 0 18px rgba(255, 141, 122, 0.5);
}
.mgb-x { font-size: 1.4rem; font-weight: 800; color: #ff8d7a; line-height: 1; }

/* shells — the hider peeks above its coral */
.mgb-hider {
  position: absolute;
  left: 50%; top: -22px;
  transform: translate(-50%, 10px);
  opacity: 0;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease-io);
  filter: drop-shadow(0 0 8px rgba(61, 217, 192, 0.6));
}
.mgb-shell.peek .mgb-hider, .mgb-shell.reveal-win .mgb-hider { opacity: 1; transform: translate(-50%, 0); }

/* sonar — a ripple on each ping */
.mgb-ping { position: relative; }
.mgb-ping.ripple::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid currentColor;
  animation: pingRipple 0.7s ease-out both;
  pointer-events: none;
}
@keyframes pingRipple { to { transform: scale(2.1); opacity: 0; } }

/* tide — a beat marker per swell */
.mgb-tide-beats {
  position: absolute;
  left: 8%; right: 8%; top: 10%;
  display: flex;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
}
.mgb-tide-beats i {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid var(--edge);
  transition: background 0.25s, box-shadow 0.25s;
}
.mgb-tide-beats i.on { background: var(--c-aqua); border-color: transparent; box-shadow: 0 0 8px rgba(61, 217, 192, 0.8); }

/* current — the swimmer sits above the lane markers; the active lane glows */
.mgb-swimmer { bottom: 24%; }
.mgb-lanes button { display: grid; place-items: center; }
.mgb-lanes button i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.2); transition: background 0.2s, box-shadow 0.2s; }
.mgb-lanes button.on { border-color: rgba(61, 217, 192, 0.5); background: rgba(61, 217, 192, 0.12); }
.mgb-lanes button.on i { background: var(--c-aqua); box-shadow: 0 0 8px rgba(61, 217, 192, 0.8); }

@media (prefers-reduced-motion: reduce) {
  .mgb-idle, .mgb-end-ico { animation: none; }
}

/* The hidden attribute must win over the button's own display. */
.mg-action[hidden], .mg-lives[hidden] { display: none !important; }

/* On the phone the arcade is a bottom sheet too. (Lives here, after the base
   rules, so it wins the cascade.) */
@media (max-width: 720px) {
  .mg { place-items: end center; padding: 0; }
  .mg-panel {
    width: 100%;
    max-width: 100%;
    max-height: 94svh;
    border-radius: 24px 24px 0 0;
    border-bottom: 0;
    padding: 0.2rem 1rem calc(1.2rem + env(safe-area-inset-bottom));
    transform: translateY(28px);
  }
  .mg.open .mg-panel { transform: none; }
  .mg-title span { display: block; line-height: 1.35; }
}

/* Level twists */
.mgb-bubble i { position: relative; }
.mgb-bubble.gold i {
  border-color: rgba(255, 209, 102, 0.9);
  background: radial-gradient(circle at 32% 28%, rgba(255, 240, 200, 0.85), rgba(255, 209, 102, 0.25) 60%);
  box-shadow: 0 0 14px rgba(255, 209, 102, 0.6);
}
.mgb-bubble.spiky i {
  border-color: rgba(255, 141, 122, 0.9);
  background: radial-gradient(circle at 32% 28%, rgba(255, 200, 190, 0.5), rgba(255, 141, 122, 0.15) 60%);
  box-shadow: 0 0 0 3px rgba(255, 141, 122, 0.25), 0 0 12px rgba(255, 141, 122, 0.5);
}
.mgb-bubble.spiky i::after {
  content: '\2715';
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: #ff8d7a; font-weight: 800; font-size: 0.9rem;
}
.mgb-shells.four .mgb-shell { left: calc(5% + var(--pos) * 23.5%); width: 62px; height: 62px; }
.mgb-simon.dark .mgb-pad { background: rgba(255, 255, 255, 0.07); opacity: 0.6; }
.mgb-simon.dark .mgb-pad.on { background: rgba(244, 251, 255, 0.75); opacity: 1; }
