/* Reef SIGNALS — Iteration 19
   Layout concept: the page is a dive. Scrolling is the descent, a depth gauge is the navigation,
   and every category is a stop on the way down. Dark water by default, shallows in light mode. */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Deep water (default) */
  --bg: #04141d;
  --ink: #edf9f5;
  --ink-2: rgba(237, 249, 245, .78);
  --ink-3: rgba(237, 249, 245, .58);
  --title: #ffffff;
  --reef: #76d9ff;
  --mint: #b9f2df;
  --sun: #ebaf67;
  --glow: #37d3ff;
  --line: rgba(185, 242, 223, .18);
  --line-2: rgba(185, 242, 223, .36);
  --glass: rgba(6, 33, 46, .62);
  --glass-2: rgba(6, 30, 42, .93);
  --panel: rgba(5, 34, 48, .55);
  --btn-bg: #edf9f5;
  --btn-ink: #062631;
  --veil-a: rgba(3, 20, 29, .34);
  --veil-b: rgba(3, 20, 29, .52);
  --depth-tint: #010b12;
  --depth-max: .64;
  --stage-bg: #03131c;
  --stage-glow: rgba(18, 104, 150, .42);
  --good: #79e6b6;
  --bad: #ff9787;
  --shadow: 0 24px 70px rgba(0, 8, 14, .36);
  --text-shadow: 0 2px 18px rgba(0, 22, 32, .35);

  --sans: "Helvetica Neue", Helvetica, "Archivo", Arial, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --rail: 0px;
  --gutter: clamp(16px, 4vw, 56px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}

/* The shallows (light) */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #cfe7ec; --ink: #0b3442; --ink-2: rgba(11, 52, 66, .8); --ink-3: rgba(11, 52, 66, .62);
    --title: #0b3442; --reef: #1b7a85; --mint: #17707a; --sun: #d4893a; --glow: #37d3ff;
    --line: rgba(11, 52, 66, .14); --line-2: rgba(11, 52, 66, .3);
    --glass: rgba(241, 250, 250, .72); --glass-2: rgba(244, 251, 251, .96); --panel: rgba(244, 251, 251, .58);
    --btn-bg: #0b3442; --btn-ink: #f1fbfa;
    --veil-a: rgba(236, 248, 248, .58); --veil-b: rgba(218, 240, 244, .7);
    --depth-tint: #0a4a63; --depth-max: .34; --stage-bg: #d9eef3; --stage-glow: rgba(255, 255, 255, .75);
    --good: #12744d; --bad: #b0372a;
    --shadow: 0 24px 70px rgba(12, 62, 78, .16); --text-shadow: none;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #cfe7ec; --ink: #0b3442; --ink-2: rgba(11, 52, 66, .8); --ink-3: rgba(11, 52, 66, .62);
  --title: #0b3442; --reef: #1b7a85; --mint: #17707a; --sun: #d4893a; --glow: #37d3ff;
  --line: rgba(11, 52, 66, .14); --line-2: rgba(11, 52, 66, .3);
  --glass: rgba(241, 250, 250, .72); --glass-2: rgba(244, 251, 251, .96); --panel: rgba(244, 251, 251, .58);
  --btn-bg: #0b3442; --btn-ink: #f1fbfa;
  --veil-a: rgba(236, 248, 248, .58); --veil-b: rgba(218, 240, 244, .7);
  --depth-tint: #0a4a63; --depth-max: .34; --stage-bg: #d9eef3; --stage-glow: rgba(255, 255, 255, .75);
  --good: #12744d; --bad: #b0372a;
  --shadow: 0 24px 70px rgba(12, 62, 78, .16); --text-shadow: none;
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
body {
  margin: 0; min-height: 100%;
  background: var(--bg); color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
html, main { overflow-x: clip; }
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 16px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 10px; background: var(--btn-bg); color: var(--btn-ink); text-decoration: none; }
.skip:focus { top: 12px; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
svg .fill { fill: currentColor; stroke: none; }
.wrap { max-width: 1240px; margin: 0 auto; padding-inline: var(--gutter); }
main { padding-left: var(--rail); }

/* ---------- Water ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg > div { position: absolute; inset: 0; }
.bg-water {
  inset: -4% !important;
  background: #0b5d82 url("../reef-signals-water.webp") center / cover no-repeat;
  transform: translate3d(var(--wx, 0px), var(--wy, 0px), 0) scale(1.06);
  transition: transform 1.4s var(--ease);
}
.bg-veil { background: linear-gradient(180deg, var(--veil-a), var(--veil-b)); }
.bg-depth { background: var(--depth-tint); opacity: calc(var(--d, 0) * var(--depth-max)); }
.bg-spot {
  background: radial-gradient(circle 280px at var(--mx, 70%) var(--my, 30%), rgba(255, 255, 255, .12), transparent 70%);
  mix-blend-mode: soft-light;
}
[data-motion="off"] .bg-spot { display: none; }

/* ---------- Header ---------- */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 12px 0;
  pointer-events: none;
}
.bar {
  pointer-events: auto;
  max-width: 1000px; margin: 0 auto;
  display: flex; align-items: center; gap: 22px;
  min-height: 60px; padding: 7px 10px 7px 12px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(1.2); backdrop-filter: blur(22px) saturate(1.2);
  box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand img { width: 40px; height: 40px; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .18)); }
:root[data-theme="light"] .brand img { filter: brightness(.4) sepia(.2); }
.brand-text { line-height: 1; }
.brand { position: relative; }
.brand-top { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand-top .brand-text { padding-bottom: 15px; }
.brand-by {
  position: absolute; left: 50px; top: 50%; margin-top: -3px; padding: 6px 0;
  font: 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3);
  text-decoration: none; white-space: nowrap; transition: color .2s;
}
.brand-by:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.brand-text b { display: block; font-size: 15.5px; font-weight: 650; letter-spacing: -.035em; white-space: nowrap; }
.brand-reef { font-size: .78em; font-weight: 500; color: var(--mint); margin-right: 1px; }
.dot { color: var(--sun); }
.brand-text small { display: block; margin-top: 5px; font: 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.bar-links { display: flex; gap: 4px; margin-left: auto; }
.bar-links a {
  position: relative; padding: 10px 12px; border-radius: 999px;
  font-size: 14.5px; font-weight: 500; text-decoration: none; color: var(--ink-2);
  transition: color .2s, background .2s;
}
.bar-links a:hover { color: var(--ink); background: var(--line); }
.bar-links a.on { color: var(--ink); }
.bar-links a.on::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--sun); }
.bar-tools { display: flex; align-items: center; gap: 2px; }
.ig { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; text-decoration: none; color: var(--ink-2); font: 11px/1 var(--mono); letter-spacing: .06em; }
.ig:hover { color: var(--ink); background: var(--line); }
.ig svg { width: 19px; height: 19px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--ink-2);
  transition: background .2s, color .2s;
}
.icon-btn:hover { background: var(--line); color: var(--ink); }
#motionBtn[aria-pressed="false"] { color: var(--ink-3); }
#motionBtn[aria-pressed="false"] svg { opacity: .5; }
.i-moon { display: none; }
:root[data-theme="light"] .i-sun { display: none; }
:root[data-theme="light"] .i-moon { display: block; }

/* ---------- Depth gauge (desktop rail) ---------- */
.gauge { position: fixed; left: 0; top: 0; bottom: 0; width: 104px; z-index: 40; display: none; }
.gauge-scale { position: absolute; left: 0; right: 0; top: 118px; bottom: 64px; }
.g-line { position: absolute; left: 40px; top: 0; bottom: 0; width: 1px; background: var(--line-2); }
.g-tick { position: absolute; left: 40px; height: 1px; width: 6px; background: var(--line-2); }
.g-tick.major { width: 12px; background: var(--ink-3); }
.g-num { position: absolute; left: 0; width: 32px; transform: translateY(-50%); text-align: right; font: 10.5px/1 var(--mono); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.g-stop {
  position: absolute; left: 34px; width: 13px; height: 13px; margin-top: -6.5px; padding: 0;
  border: 1.5px solid var(--ink-3); border-radius: 50%; background: var(--bg);
  transition: background .25s, border-color .25s, transform .25s;
}
.g-stop:hover, .g-stop:focus-visible { border-color: var(--ink); transform: scale(1.25); }
.g-stop.passed { background: var(--ink-3); }
.g-stop.on { background: var(--sun); border-color: var(--sun); }
.g-stop .g-tip {
  position: absolute; left: 22px; top: 50%; transform: translate(-4px, -50%); opacity: 0; pointer-events: none;
  padding: 6px 10px; border-radius: 8px; background: var(--glass-2); border: 1px solid var(--line);
  font-size: 13px; white-space: nowrap; color: var(--ink); transition: opacity .2s, transform .2s;
}
.g-stop:hover .g-tip, .g-stop:focus-visible .g-tip { opacity: 1; transform: translate(0, -50%); }
.gauge-needle { position: absolute; left: 50px; top: 118px; transform: translateY(var(--ny, 0px)); will-change: transform; pointer-events: none; }
.gauge-read {
  display: inline-block; transform: translateY(-50%);
  padding: 5px 8px 5px 7px; border-radius: 7px;
  background: var(--sun); color: #2a1702;
  font: 600 12px/1 var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.gauge-read::before { content: ""; position: absolute; left: -5px; top: 50%; margin-top: -5px; border: 5px solid transparent; border-right-color: var(--sun); border-left: 0; }
.gauge-read { position: relative; }
.gauge-where { display: block; max-width: 70px; margin-top: -6px; font-size: 11.5px; line-height: 1.2; color: var(--ink-2); }

/* ---------- Mobile dock ---------- */
.dock {
  position: fixed; left: 10px; right: 10px; bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); z-index: 45;
  display: flex; align-items: center; gap: 6px; height: 60px; padding: 6px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--glass-2);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  transform: translateY(calc(100% + 30px)); transition: transform .45s var(--ease);
}
.dock.on { transform: none; }
.dock-depth {
  flex: none; display: grid; place-items: center; align-content: center; width: 48px; height: 48px;
  border-radius: 50%; background: var(--sun); color: #2a1702; line-height: 1;
  font-family: var(--mono); font-variant-numeric: tabular-nums;
}
.dock-depth b { font-size: 15px; }
.dock-depth small { font-size: 9px; margin-top: 2px; }
.dock-stops {
  flex: 1; min-width: 0; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
  scroll-snap-type: x proximity; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10px, #000 calc(100% - 14px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10px, #000 calc(100% - 14px), transparent);
}
.dock-stops::-webkit-scrollbar { display: none; }
.dock-stops a {
  flex: none; scroll-snap-align: center; padding: 11px 13px; border-radius: 999px;
  font-size: 14px; font-weight: 500; text-decoration: none; color: var(--ink-2); white-space: nowrap;
}
.dock-stops a.on { background: var(--ink); color: var(--bg); }
.dock-say {
  flex: none; display: grid; place-items: center; width: 48px; height: 48px; padding: 0;
  border: 0; border-radius: 50%; background: var(--btn-bg); color: var(--btn-ink);
}
.dock-say .dots { stroke-width: 2.6; }
.float-say {
  position: fixed; right: 28px; bottom: 28px; z-index: 45; display: none; align-items: center; gap: 10px;
  min-height: 52px; padding: 0 22px 0 18px; border: 1px solid var(--line-2); border-radius: 999px;
  background: var(--glass-2); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: var(--shadow); font-size: 15px; font-weight: 500;
  opacity: 0; transform: translateY(16px); pointer-events: none; transition: opacity .3s, transform .4s var(--ease);
}
.float-say.on { opacity: 1; transform: none; pointer-events: auto; }
.float-say:hover { border-color: var(--mint); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border: 0; border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-ink);
  font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: transform .2s, box-shadow .2s, background .2s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(0, 0, 0, .18); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-2); }
.btn.ghost:hover { border-color: var(--mint); box-shadow: none; }
.btn svg { width: 18px; height: 18px; }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); align-items: center;
  gap: clamp(28px, 4vw, 72px);
  max-width: 1320px; margin: 0 auto; min-height: min(94svh, 940px);
  padding: clamp(120px, 16vh, 156px) var(--gutter) clamp(48px, 7vh, 80px);
}
.title { margin: 0; color: var(--title); text-shadow: var(--text-shadow); line-height: 1; }
.t-reef {
  display: block; margin: 0 0 .06em .02em;
  font-size: clamp(44px, 5.6vw, 88px); font-weight: 600; letter-spacing: -.065em; line-height: .86;
  color: var(--reef);
}
.t-signals {
  display: block; white-space: nowrap;
  font-size: clamp(76px, 10.2vw, 160px); font-weight: 650; letter-spacing: -.085em; line-height: .8;
}
.sub {
  display: flex; align-items: center; gap: 14px; margin: clamp(22px, 3vh, 34px) 0 0;
  font-size: clamp(16px, 1.4vw, 19px); letter-spacing: -.015em; color: var(--ink-2);
}
.sub::before { content: ""; flex: none; width: 46px; height: 1px; background: var(--mint); opacity: .5; }
.say-launch { margin-top: clamp(34px, 6vh, 64px); max-width: 560px; }
.say-label { display: block; margin-bottom: 14px; font-size: clamp(22px, 2.2vw, 30px); font-weight: 550; letter-spacing: -.035em; line-height: 1.1; }
.say-field {
  display: flex; align-items: center; gap: 8px; height: 62px; padding: 6px 6px 6px 22px;
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--panel);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: border-color .2s, box-shadow .2s;
}
.say-field:focus-within { border-color: var(--mint); box-shadow: 0 0 0 4px rgba(185, 242, 223, .12); }
.say-field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font-size: 17px; }
.say-field input::placeholder { color: var(--ink-3); opacity: 1; }
.say-field button { height: 48px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--btn-bg); color: var(--btn-ink); font-size: 15px; font-weight: 600; }
.say-try { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.say-try > span { font-size: 13.5px; color: var(--ink-3); margin-right: 2px; }
.say-try button {
  padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px; background: transparent;
  font-size: 13.5px; color: var(--ink-2); transition: border-color .2s, color .2s;
}
.say-try button:hover { border-color: var(--mint); color: var(--ink); }

.hero-diver { margin: 0; justify-self: center; width: min(100%, 470px); }
.ring { position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%; background: none; }
.ring:focus-visible { outline-offset: 10px; }
.ring-glow, .orb {
  border: 2px solid rgba(55, 211, 255, .92);
  background: radial-gradient(circle at 50% 34%, rgba(10, 104, 162, .62), rgba(2, 56, 98, .88) 70%);
  box-shadow: 0 0 8px rgba(47, 208, 255, .8), 0 0 24px rgba(25, 169, 244, .46), inset 0 0 18px rgba(50, 192, 255, .18);
}
.ring-glow { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 12px rgba(47, 208, 255, .85), 0 0 46px rgba(25, 169, 244, .5), inset 0 0 34px rgba(50, 192, 255, .22); }
.ring-art {
  position: absolute; left: -15%; right: -15%; top: -22%; bottom: 0;
  clip-path: polygon(0% 0%,100% 0%,100% 59.02%,88.46% 59.02%,88.22% 63.61%,87.50% 68.14%,86.30% 72.55%,84.65% 76.80%,82.57% 80.82%,80.07% 84.57%,77.20% 88.00%,73.98% 91.06%,70.46% 93.72%,66.69% 95.94%,62.70% 97.70%,58.56% 98.97%,54.31% 99.74%,50.00% 100.00%,45.69% 99.74%,41.44% 98.97%,37.30% 97.70%,33.31% 95.94%,29.54% 93.72%,26.02% 91.06%,22.80% 88.00%,19.93% 84.57%,17.43% 80.82%,15.35% 76.80%,13.70% 72.55%,12.50% 68.14%,11.78% 63.61%,11.54% 59.02%,0% 59.02%);
}
.ring-art .art { position: absolute; left: 12%; width: 76%; bottom: 0; height: auto; transition: opacity .55s ease; filter: drop-shadow(0 18px 28px rgba(0, 20, 30, .28)); }
.ring-art .b { opacity: 0; }
.ring-art .ov { opacity: 0; filter: none; transition: opacity .5s ease; }
.ring-art .ov.on { opacity: 1; }
.bubbles { position: absolute; left: 41%; top: 18%; width: 0; height: 0; }
.bubbles i {
  position: absolute; left: 0; top: 0; width: var(--s, 8px); height: var(--s, 8px); border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .85); background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .7), rgba(255, 255, 255, .08) 60%);
  animation: rise var(--t, 2.6s) ease-in forwards; opacity: 0;
}
@keyframes rise {
  0% { opacity: 0; transform: translate(0, 0) scale(.5); }
  12% { opacity: .95; }
  50% { transform: translate(var(--x1, -6px), -90px) scale(1); }
  100% { opacity: 0; transform: translate(var(--x2, 8px), -210px) scale(1.15); }
}
.hero-cap { display: grid; justify-items: center; gap: 10px; margin-top: 26px; text-align: center; }
.hero-cap q { quotes: none; font-size: clamp(22px, 2.1vw, 28px); font-weight: 500; letter-spacing: -.03em; line-height: 1.15; min-height: 1.15em; transition: opacity .3s; }
.hero-sign { font: 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.hero-dots { display: flex; gap: 6px; }
.hero-dots i { width: 6px; height: 6px; border-radius: 6px; background: var(--line-2); transition: width .35s var(--ease), background .35s; }
.hero-dots i.on { width: 22px; background: var(--sun); }

/* ---------- Library intro and stops ---------- */
.library { padding-block: clamp(40px, 8vh, 90px) 30px; }
.lib-head, .sec-head { max-width: 680px; }
.lib-head h2, .sec-head h2 { margin: 0; font-size: clamp(40px, 5vw, 64px); font-weight: 560; letter-spacing: -.055em; line-height: .95; color: var(--title); }
.lib-head p, .sec-head p { margin: 16px 0 0; font-size: 18px; line-height: 1.5; color: var(--ink-2); max-width: 56ch; }
.stops { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-top: 44px; }
.stop-tile {
  display: grid; justify-items: center; gap: 4px; padding: 20px 10px 22px;
  border: 1px solid transparent; border-radius: 30px; background: transparent; text-align: center; text-decoration: none;
  transition: border-color .3s, background .3s;
}
.stop-tile:hover { border-color: var(--line); background: var(--panel); }
.tile-depth, .cat-mark, .gauge-read { word-spacing: -.32em; }
.tile-depth { font: 12px/1 var(--mono); color: var(--sun); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.tile-ring { position: relative; width: min(150px, 100%); aspect-ratio: 1; margin: 12px 0 14px; transition: transform .45s var(--ease); }
.stop-tile:hover .tile-ring { transform: translateY(-4px); }
.tile-ring .orb { position: absolute; inset: 0; width: 100%; max-width: none; }
.tile-ring .back { position: absolute; top: 2%; width: 66%; opacity: .55; filter: drop-shadow(0 8px 12px rgba(0, 20, 30, .25)); transition: transform .45s var(--ease), opacity .3s; }
.tile-ring .back.l { left: -19%; transform: rotate(-10deg); }
.tile-ring .back.r { right: -19%; transform: rotate(10deg); }
.stop-tile:hover .back.l { transform: rotate(-14deg) translateX(-6px); opacity: .75; }
.stop-tile:hover .back.r { transform: rotate(14deg) translateX(6px); opacity: .75; }
.tile-name { font-size: 19px; font-weight: 600; letter-spacing: -.03em; line-height: 1.15; }
.tile-count { font-size: 13.5px; color: var(--ink-3); }

.lib-tools {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 28px;
  margin-top: 40px; padding: 16px 0; border-block: 1px solid var(--line);
}
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; font-size: 14px; color: var(--ink-2); }
.legend-title { font-weight: 600; color: var(--ink); }
.legend-item { display: inline-flex; align-items: center; gap: 8px; }
.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.bars b { width: 4px; border-radius: 1px; background: var(--line-2); }
.bars b:nth-child(1) { height: 6px; } .bars b:nth-child(2) { height: 10px; } .bars b:nth-child(3) { height: 14px; }
.bars.s1 b:nth-child(1), .bars.s2 b:nth-child(-n+2), .bars.s3 b { background: var(--mint); }
.switch { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { position: relative; width: 40px; height: 24px; border-radius: 24px; background: var(--line-2); transition: background .25s; }
.switch-ui::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); transition: transform .25s var(--ease); }
.switch input:checked + .switch-ui { background: var(--mint); }
.switch input:checked + .switch-ui::after { transform: translateX(16px); background: var(--bg); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--mint); outline-offset: 3px; }
.agree { margin: 16px 0 0; font-size: 14px; color: var(--ink-3); }

/* ---------- Category stops ---------- */
.cat { padding-block: clamp(56px, 9vh, 96px) 20px; }
.cat-in { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: clamp(28px, 4vw, 60px); }
.cat-mark { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; font: 12px/1 var(--mono); color: var(--sun); font-variant-numeric: tabular-nums; }
.cat-mark::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-2), transparent); }
.cat-aside { position: sticky; top: 104px; align-self: start; }
.cat-aside h2 { margin: 0; font-size: clamp(42px, 4.6vw, 64px); font-weight: 560; letter-spacing: -.06em; line-height: .92; color: var(--title); }
.cat-aside p { margin: 16px 0 0; font-size: 17px; line-height: 1.5; color: var(--ink-2); }
.cat-count { display: block; margin-top: 12px; font-size: 14px; color: var(--ink-3); }
.cat-aside .btn { margin-top: 22px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 30px 18px; }
.sig { display: grid; justify-items: center; align-content: start; gap: 12px; padding: 0; border: 0; background: none; color: var(--ink); text-align: center; }
.sig:focus-visible { outline: none; }
.sig:focus-visible .orb { outline: 3px solid var(--mint); outline-offset: 4px; }
.orb { position: relative; display: block; width: 100%; max-width: 186px; aspect-ratio: 1; border-radius: 50%; overflow: hidden; transition: transform .4s var(--ease), box-shadow .3s, border-color .3s; }
.orb img { position: absolute; left: 7%; top: 7%; width: 86%; height: auto; filter: drop-shadow(0 10px 14px rgba(0, 18, 26, .2)); }
.orb .ov { opacity: 0; filter: none; transition: opacity .3s; }
.orb .ov, .ring-art .ov { clip-path: inset(0 0 11.5% 0); }
.sig:hover .orb { transform: translateY(-4px) scale(1.03); border-color: #5ee3ff; box-shadow: 0 0 10px rgba(67, 220, 255, .98), 0 0 32px rgba(25, 169, 244, .62), inset 0 0 20px rgba(50, 192, 255, .24); }
.sig:hover .orb .ov, .show-lines .orb .ov { opacity: 1; }
.sig-name { font-size: 15px; font-weight: 500; line-height: 1.25; letter-spacing: -.01em; max-width: 17ch; }

/* ---------- Conversations ---------- */
.convos { padding-block: clamp(80px, 12vh, 130px) 30px; }
.convo-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 40px; }
.convo {
  display: flex; flex-direction: column; gap: 14px; padding: 22px 20px 20px;
  border: 1px solid var(--line); border-radius: 26px; background: var(--panel);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  text-align: left; transition: border-color .3s, transform .35s var(--ease);
}
.convo:hover { border-color: var(--line-2); transform: translateY(-3px); }
.convo h3 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.03em; line-height: 1.15; }
.story { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.story { gap: 5px; }
.story .orb { width: 38px; max-width: none; border-width: 1.5px; }
.story .orb.buddy, .actor.b .orb, .legend-buddy { border-color: rgba(235, 175, 103, .95); box-shadow: 0 0 6px rgba(235, 175, 103, .6), 0 0 16px rgba(235, 175, 103, .3), inset 0 0 12px rgba(235, 175, 103, .16); }
.convo p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-2); flex: 1; }
.convo .btn { align-self: flex-start; min-height: 40px; padding: 0 16px; font-size: 14px; }
.who-key { display: flex; gap: 16px; margin-top: 18px; font-size: 13.5px; color: var(--ink-3); }
.who-key span { display: inline-flex; align-items: center; gap: 7px; }
.who-key i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(55, 211, 255, .92); }
.who-key i.legend-buddy { border-color: rgba(235, 175, 103, .95); }

/* ---------- Practice ---------- */
.practice { padding-block: clamp(80px, 12vh, 130px) 30px; }
.quiz {
  display: grid; grid-template-columns: minmax(220px, 320px) minmax(0, 1fr); align-items: center; gap: clamp(24px, 4vw, 56px);
  margin-top: 40px; padding: clamp(22px, 3.4vw, 40px);
  border: 1px solid var(--line); border-radius: 34px; background: var(--panel);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.quiz-art .orb.big { max-width: 320px; margin: 0 auto; }
.quiz-meta { display: flex; justify-content: space-between; gap: 16px; font: 12px/1 var(--mono); letter-spacing: .04em; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.quiz-q { margin: 14px 0 20px; font-size: clamp(24px, 2.6vw, 34px); font-weight: 550; letter-spacing: -.04em; line-height: 1.1; }
.quiz-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quiz-options button {
  min-height: 58px; padding: 12px 16px; border: 1px solid var(--line-2); border-radius: 16px;
  background: transparent; text-align: left; font-size: 16px; font-weight: 500; line-height: 1.25;
  transition: border-color .2s, background .2s;
}
.quiz-options button:hover:not(:disabled) { border-color: var(--mint); background: var(--line); }
.quiz-options button:disabled { cursor: default; }
.quiz-options button.right { border-color: var(--good); background: color-mix(in srgb, var(--good) 20%, transparent); }
.quiz-options button.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 16%, transparent); }
.quiz-options button.dim { opacity: .5; }
.quiz-feedback { min-height: 1.5em; margin: 16px 0 0; font-size: 15px; color: var(--ink-2); }
.quiz-feedback b { color: var(--ink); }
.quiz-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.quiz-total { margin: 0; font-size: clamp(40px, 5vw, 64px); font-weight: 600; letter-spacing: -.06em; line-height: 1; }
.quiz-verdict { margin: 10px 0 0; font-size: 17px; color: var(--ink-2); max-width: 44ch; }

/* ---------- About ---------- */
.about { padding-block: clamp(90px, 13vh, 140px) 20px; }
.about-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 5vw, 72px); }
.about-col h2 { margin: 0 0 18px; font-size: clamp(32px, 3.4vw, 44px); font-weight: 560; letter-spacing: -.05em; line-height: 1; color: var(--title); }
.about-col p { margin: 0 0 16px; font-size: 16.5px; line-height: 1.68; color: var(--ink-2); max-width: 62ch; }
.about-col strong { color: var(--ink); font-weight: 600; }
.about-col .tagline { margin-top: -6px; font-size: 19px; font-style: italic; color: var(--mint); }
.follow {
  grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 22px;
  padding: 20px 24px 20px 20px; border: 1px solid var(--line); border-radius: 30px; background: var(--panel);
  text-decoration: none; transition: border-color .3s, transform .35s var(--ease);
}
.follow:hover { border-color: var(--mint); transform: translateY(-2px); }
.follow img { width: 84px; height: 84px; object-fit: contain; }
:root[data-theme="light"] .follow img { filter: brightness(.4) sepia(.2); }
.follow-text b { display: block; font-size: 22px; font-weight: 600; letter-spacing: -.03em; }
.follow-text span { display: block; margin-top: 4px; font-size: 15px; color: var(--ink-2); }

/* ---------- Footer ---------- */
.foot { padding-block: clamp(90px, 14vh, 150px) 60px; }
.foot-in { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 28px 40px; }
.limit p { margin: 0; color: var(--ink-2); font-size: 16px; }
.limit-depth { display: flex; align-items: baseline; gap: 14px; margin-bottom: 10px !important; color: var(--ink-3) !important; font-size: 14px !important; }
.limit-depth b small { font-size: .5em; margin-left: .08em; }
.limit-depth b { font: 600 clamp(48px, 6vw, 80px)/1 var(--mono); color: var(--sun); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.ascend { display: grid; justify-items: center; gap: 10px; padding: 0; border: 0; background: none; font-size: 15px; font-weight: 600; }
.ascend .orb.small { width: 92px; }
.ascend:hover .orb { transform: translateY(-6px); }
.fine { grid-column: 1 / -1; margin: 18px 0 0; padding-top: 22px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); max-width: none; }

/* ---------- Dialogs (shared) ---------- */
dialog { padding: 0; border: 0; color: var(--ink); background: transparent; max-width: none; max-height: none; overflow: visible; }
dialog::backdrop { background: rgba(1, 12, 18, .6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
dialog[open] { animation: pop .42s var(--ease); }
dialog[open]::backdrop { animation: fade .35s ease; }
dialog.closing { animation: drop .22s ease forwards; }
dialog.closing::backdrop { animation: fade .22s ease reverse forwards; }
@keyframes pop { from { opacity: 0; transform: translateY(18px) scale(.985); } }
@keyframes drop { to { opacity: 0; transform: translateY(12px) scale(.99); } }
@keyframes fade { from { opacity: 0; } }
.x {
  position: absolute; top: 16px; right: 16px; z-index: 5; display: grid; place-items: center;
  width: 44px; height: 44px; padding: 0; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .4); background: rgba(0, 40, 72, .45); color: #fff;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.x:hover { background: rgba(0, 40, 72, .7); }
.x.inline { position: static; flex: none; border-color: var(--line-2); background: transparent; color: var(--ink); }

/* ---------- Signal detail ---------- */
.detail {
  width: min(1180px, calc(100vw - 48px)); height: min(790px, calc(100vh - 48px));
  border-radius: 30px; overflow: hidden; box-shadow: 0 40px 120px rgba(0, 6, 12, .5);
  color: #fff;
}
.d-wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); height: 100%; }
.d-art { position: relative; overflow: hidden; background: #e7f2fb url("../backgrounds/detail-artwork-bg.webp") center / cover no-repeat; touch-action: pan-y; }
.d-img, .d-ov { position: absolute; left: 5%; top: 6%; width: 90%; height: 94%; object-fit: contain; object-position: 50% 100%; }
.d-img { filter: drop-shadow(0 22px 30px rgba(0, 32, 60, .2)); transition: opacity .25s, transform .35s var(--ease); }
.d-img.swap { opacity: 0; transform: translateX(var(--sx, 20px)); }
.d-ov { opacity: 0; transition: opacity .3s; pointer-events: none; }
.d-art.lines .d-ov { opacity: 1; }
[data-motion="on"] .d-art.lines .d-ov { animation: guide 4.2s ease-in-out infinite; }
@keyframes guide { 0%, 18%, 100% { opacity: 0; } 30%, 74% { opacity: 1; } 86% { opacity: 0; } }
.d-ctx { position: absolute; left: 20px; top: 20px; z-index: 2; display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 500; color: #0b3442; }
.d-ctx b { padding: 7px 12px; border-radius: 999px; background: rgba(255, 255, 255, .78); font-weight: 600; }
.d-lines {
  position: absolute; left: 20px; bottom: 20px; z-index: 2; display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border: 1px solid rgba(11, 52, 66, .22); border-radius: 999px;
  background: rgba(255, 255, 255, .8); color: #0b3442; font-size: 13.5px; font-weight: 600;
}
.d-lines::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #1985c9; }
.d-lines[aria-pressed="true"]::before { background: #1985c9; }
.d-arrow {
  position: absolute; top: 50%; z-index: 2; display: grid; place-items: center; width: 48px; height: 48px; margin-top: -24px; padding: 0;
  border: 1px solid rgba(11, 52, 66, .2); border-radius: 50%; background: rgba(255, 255, 255, .82); color: #0b3442;
  transition: transform .2s, opacity .2s;
}
.d-arrow:hover:not(:disabled) { transform: scale(1.08); }
.d-arrow:disabled { opacity: .3; cursor: default; }
.d-arrow.prev { left: 18px; } .d-arrow.next { right: 18px; }
.d-copy {
  overflow-y: auto; overscroll-behavior: contain; padding: 58px clamp(28px, 4vw, 54px) 40px;
  background: #00528f url("../backgrounds/detail-copy-bg.webp") center / cover no-repeat;
}
.d-name { margin: 0; padding-right: 40px; font-size: clamp(44px, 5vw, 68px); font-weight: 540; letter-spacing: -.06em; line-height: .92; }
.d-meaning { margin: 16px 0 0; font-size: 22px; line-height: 1.32; letter-spacing: -.02em; max-width: 32ch; }
.d-strength { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 18px; font-size: 13.5px; color: rgba(255, 255, 255, .86); }
.d-strength .bars b { background: rgba(255, 255, 255, .28); }
.d-strength .bars.s1 b:nth-child(1), .d-strength .bars.s2 b:nth-child(-n+2), .d-strength .bars.s3 b { background: #c9f7e7; }
.d-strength strong { font-weight: 600; color: #fff; }
.d-strength small { flex-basis: 100%; font-size: 13px; line-height: 1.45; color: rgba(255, 255, 255, .74); }
.d-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 26px; margin: 24px 0 0; }
.d-facts > div { padding: 16px 0 18px; border-top: 1px solid rgba(255, 255, 255, .2); }
.d-facts dt, .d-label, .d-fun span { display: block; font-size: 12.5px; font-weight: 600; letter-spacing: .02em; color: #c9f7e7; }
.d-facts dd { margin: 7px 0 0; font-size: 15px; line-height: 1.52; color: rgba(255, 255, 255, .95); }
.d-fun { margin: 10px 0 0; padding: 18px 20px; border: 1px solid rgba(255, 255, 255, .26); border-radius: 18px; background: rgba(0, 28, 64, .3); }
.d-fun p { margin: 7px 0 0; font-size: 18px; line-height: 1.4; letter-spacing: -.01em; }
.d-related, .d-also { margin-top: 22px; }
.d-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.d-chips button {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 14px 4px 4px;
  border: 1px solid rgba(255, 255, 255, .28); border-radius: 999px; background: rgba(255, 255, 255, .08);
  color: #fff; font-size: 14px; transition: background .2s, border-color .2s;
}
.d-chips button.text { padding: 8px 14px; }
.d-chips button:hover { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .5); }
.d-chips img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; object-position: 50% 12%; background: rgba(2, 56, 98, .9); border: 1px solid rgba(55, 211, 255, .8); }
.d-bar { display: none; }

/* ---------- Translator ---------- */
.say {
  width: min(880px, calc(100vw - 32px)); margin: 9vh auto auto;
  border: 1px solid var(--line-2); border-radius: 28px; background: var(--glass-2);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  box-shadow: 0 40px 120px rgba(0, 6, 12, .45); overflow: hidden;
}
.say-in { display: flex; flex-direction: column; max-height: 82vh; }
.say-top { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 22px; border-bottom: 1px solid var(--line); }
.say-top > svg { flex: none; color: var(--ink-3); }
.say-top input { flex: 1; min-width: 0; height: 52px; border: 0; outline: 0; background: transparent; font-size: clamp(19px, 2.2vw, 24px); letter-spacing: -.02em; }
.say-top input::placeholder { color: var(--ink-3); opacity: 1; }
.say-body { overflow-y: auto; overscroll-behavior: contain; padding: 22px 24px 26px; }
.say-empty p, .say-none p { margin: 0; font-size: 15.5px; color: var(--ink-2); max-width: 60ch; }
.say-none .say-none-t { font-size: 20px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.say-body .say-try { margin-top: 16px; }
.say-read { margin: 0 0 18px; font-size: 15px; color: var(--ink-2); }
.say-read b { color: var(--ink); font-weight: 600; }
.seq { display: flex; flex-wrap: wrap; gap: 14px 30px; margin: 0; padding: 0; list-style: none; }
.seq li { position: relative; }
.seq li + li::before {
  content: ""; position: absolute; left: -22px; top: 62px; width: 14px; height: 14px;
  border-top: 2px solid var(--mint); border-right: 2px solid var(--mint); transform: rotate(45deg); opacity: .7;
}
.step {
  display: grid; justify-items: center; gap: 4px; width: 158px; padding: 14px 10px 16px;
  border: 1px solid var(--line); border-radius: 22px; background: transparent; text-align: center; transition: border-color .2s, background .2s;
}
.step:hover { border-color: var(--mint); background: var(--line); }
.step .orb { width: 112px; margin-bottom: 8px; }
.step-n { font: 11px/1 var(--mono); color: var(--sun); font-variant-numeric: tabular-nums; }
.step b { font-size: 15.5px; font-weight: 600; line-height: 1.2; }
.step small { font-size: 13px; line-height: 1.35; color: var(--ink-2); }
.say-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

/* ---------- Player ---------- */
.stage { width: 100vw; height: 100vh; height: 100dvh; margin: 0; background: radial-gradient(ellipse 70% 60% at 50% 40%, var(--stage-glow), transparent 70%), var(--stage-bg); color: var(--ink); }
.stage::backdrop { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.stage-in {
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto auto auto; gap: 14px;
  height: 100%; max-width: 1100px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 20px calc(env(safe-area-inset-bottom, 0px) + 22px);
}
.stage-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.stage-head h2 { margin: 0; font-size: clamp(20px, 2.4vw, 28px); font-weight: 600; letter-spacing: -.03em; }
.stage-floor { display: flex; align-items: center; justify-content: center; gap: clamp(16px, 6vw, 90px); min-height: 0; }
.actor { display: grid; justify-items: center; gap: 12px; transition: opacity .45s, transform .55s var(--ease), filter .45s; }
.actor-who { font: 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.orb.huge { width: min(38vw, 46vh, 420px); max-width: none; }
.orb.huge img { transition: opacity .35s; }
.orb.huge .ov { transition: opacity .4s .35s; }
.actor.quiet { opacity: .38; transform: scale(.84); filter: saturate(.6); }
.actor.quiet .ov { opacity: 0 !important; }
.actor.talk .ov.on { opacity: 1; }
.stage.solo .actor.b, .stage.solo .actor-who { display: none; }
.stage.solo .orb.huge { width: min(70vw, 54vh, 500px); }
.stage-cap { display: grid; justify-items: center; gap: 10px; text-align: center; min-height: 92px; }
.stage-line { margin: 0; font-size: clamp(24px, 3.2vw, 38px); font-weight: 550; letter-spacing: -.04em; line-height: 1.12; max-width: 24ch; }
.stage-sign { padding: 7px 14px; border: 1px solid var(--line-2); border-radius: 999px; background: transparent; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.stage-sign:hover { border-color: var(--mint); color: var(--ink); }
.stage-note { justify-self: center; max-width: 60ch; min-height: 1.4em; text-align: center; font-size: 14.5px; color: var(--ink-3); }
.stage-ctrl { display: flex; justify-content: center; align-items: center; gap: 14px; }
.stage-ctrl .icon-btn { width: 48px; height: 48px; border: 1px solid var(--line-2); color: var(--ink); }
.stage-ctrl .play { width: 62px; height: 62px; border: 0; background: var(--btn-bg); color: var(--btn-ink); }
.stage-ctrl .play:hover { background: var(--btn-bg); }
.stage .i-play { display: none; }
.stage.paused .i-play { display: block; }
.stage.paused .i-pause { display: none; }
.stage-progress { display: flex; gap: 5px; max-width: 520px; width: 100%; justify-self: center; }
.stage-progress span { position: relative; flex: 1; height: 3px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.stage-progress span i { position: absolute; inset: 0; background: var(--sun); transform-origin: left; transform: scaleX(0); }
.stage-progress span.done i { transform: scaleX(1); }
.stage-progress span.now i { animation: fill var(--dur, 3s) linear forwards; }
.stage.paused .stage-progress span.now i { animation-play-state: paused; }
@keyframes fill { to { transform: scaleX(1); } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 92px); z-index: 200;
  padding: 11px 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--glass-2);
  font-size: 14px; transform: translate(-50%, 10px); opacity: 0; pointer-events: none; transition: opacity .25s, transform .3s var(--ease);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (min-width: 1100px) {
  :root { --rail: 104px; }
  .gauge { display: block; }
  .float-say { display: inline-flex; }
  .dock { display: none; }
}
@media (max-width: 1099px) {
  .foot { padding-bottom: 120px; }
  .toast { bottom: calc(env(safe-area-inset-bottom, 0px) + 86px); }
}
@media (max-width: 1180px) {
  .convo-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .bar-links { display: none; }
  .bar-tools { margin-left: auto; }
  .hero { grid-template-columns: minmax(0, 1fr); justify-items: start; min-height: 0; }
  .hero-diver { justify-self: center; width: min(78vw, 420px); }
  .stops { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scrollbar-width: none; }
  .stops::-webkit-scrollbar { display: none; }
  .stop-tile { flex: none; width: clamp(150px, 36vw, 200px); scroll-snap-align: start; }
  .cat-in { grid-template-columns: 1fr; gap: 26px; }
  .cat-aside { position: static; }
  .cat-aside h2 { font-size: clamp(40px, 9vw, 56px); }
  .detail .d-facts { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  html { scroll-padding-top: 84px; }
  .top { padding-top: calc(env(safe-area-inset-top, 0px) + 10px); }
  .bar { gap: 10px; min-height: 54px; padding: 6px 6px 6px 9px; }
  .brand img { width: 34px; height: 34px; }
  .brand-by { left: 44px; }
  .ig span { display: none; }
  .ig { padding: 10px; }
  .hero { padding-top: calc(env(safe-area-inset-top, 0px) + 100px); gap: 30px; }
  .hero-copy { width: 100%; }
  .t-reef { font-size: clamp(38px, 11vw, 56px); }
  .t-signals { font-size: clamp(60px, 19.4vw, 104px); }
  .say-launch { margin-top: 30px; }
  .say-field { height: 58px; padding-left: 18px; }
  .say-field input { font-size: 16px; }
  .say-field button { padding: 0 16px; height: 46px; }
  .hero-diver { width: min(80vw, 360px); margin-top: 26px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 10px; }
  .sig { gap: 9px; }
  .sig-name { font-size: 13px; }
  .lib-tools { flex-direction: column; align-items: flex-start; }
  .legend { gap: 8px 16px; font-size: 13px; }
  .legend-title { flex-basis: 100%; }
  .convo-list { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: calc(var(--gutter) * -1); padding: 0 var(--gutter) 6px; scrollbar-width: none; }
  .convo-list::-webkit-scrollbar { display: none; }
  .convo { flex: none; width: min(80vw, 320px); scroll-snap-align: start; }
  .quiz { grid-template-columns: 1fr; text-align: left; }
  .quiz-art .orb.big { max-width: 220px; }
  .quiz-options { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .follow { grid-template-columns: auto minmax(0, 1fr); }
  .follow img { width: 64px; height: 64px; }
  .follow .btn { grid-column: 1 / -1; }
  .foot-in { grid-template-columns: 1fr; justify-items: start; }

  /* Detail becomes a full-screen sheet */
  .detail { width: 100vw; height: 100vh; height: 100dvh; margin: 0; border-radius: 0; }
  .d-wrap { display: block; height: 100%; overflow-y: auto; overscroll-behavior: contain; }
  .d-art { height: 50vh; height: 50svh; min-height: 330px; }
  .d-img, .d-ov { top: 9%; height: 91%; }
  .d-arrow { display: none; }
  .d-ctx { left: 14px; top: calc(env(safe-area-inset-top, 0px) + 16px); }
  .d-lines { left: 14px; bottom: 14px; }
  .d-copy { overflow: visible; padding: 28px 20px calc(env(safe-area-inset-bottom, 0px) + 100px); min-height: 50vh; }
  .d-meaning { font-size: 20px; }
  .x { top: calc(env(safe-area-inset-top, 0px) + 12px); right: 12px; }
  .d-bar {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 14px calc(env(safe-area-inset-bottom, 0px) + 10px);
    background: rgba(0, 50, 96, .9); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border-top: 1px solid rgba(255, 255, 255, .18); font: 12px/1 var(--mono); color: rgba(255, 255, 255, .8); font-variant-numeric: tabular-nums;
  }
  .d-bar .btn { min-height: 42px; color: #fff; border-color: rgba(255, 255, 255, .35); }
  .d-bar .btn:disabled { opacity: .35; }

  /* Translator becomes a full-screen sheet */
  .say { width: 100vw; height: 100vh; height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .say-in { height: 100%; max-height: none; }
  .say-top { padding: calc(env(safe-area-inset-top, 0px) + 10px) 10px 10px 18px; }
  .say-body { flex: 1; padding: 18px 16px 30px; }
  .seq { flex-direction: column; gap: 10px; }
  .seq li + li::before { left: 47px; top: -10px; width: 10px; height: 10px; transform: rotate(135deg); }
  .step { grid-template-columns: 76px minmax(0, 1fr); justify-items: start; align-items: center; column-gap: 14px; row-gap: 2px; width: 100%; padding: 10px 14px 10px 10px; text-align: left; }
  .step .orb { grid-row: 1 / span 3; width: 76px; margin: 0; }
  .orb.huge { width: min(42vw, 34vh, 300px); }
  .stage.solo .orb.huge { width: min(76vw, 46vh, 420px); }
  .stage-floor { gap: 10px; }
}
@media (max-width: 400px) {
  .brand-text small { display: none; }
  .brand-by { font-size: 9px; letter-spacing: .1em; }
  .brand-text b { font-size: 14px; }
  .grid { gap: 20px 8px; }
  .say-try button { font-size: 13px; padding: 7px 11px; }
}
@media (hover: none) {
  .sig:hover .orb { transform: none; }
  .sig:hover .orb .ov { opacity: 0; }
  .show-lines .sig .orb .ov { opacity: 1; }
}

/* Motion off: the system setting or the toggle */
[data-motion="off"] *, [data-motion="off"] *::before, [data-motion="off"] *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
[data-motion="off"] .bubbles { display: none; }
[data-motion="off"] .bg-water { transform: scale(1.06); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .bubbles { display: none; }
}
