/* AquaRestore landing page. No web fonts, no third-party assets. */
:root {
  --surface: #0a4a78;
  --mid: #04304f;
  --deep: #021526;
  --abyss: #010a14;
  --text: #e4f3ff;
  --muted: #98b6cc;
  --line: rgba(160, 220, 255, .14);
  --glass: rgba(8, 40, 66, .55);
  --teal: #3ee6c8;
  --cyan: #4fc3ff;
  --sand: #f0b880;
  --coral: #ff7a59;
  --radius: 18px;
  --depth: 0;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
html:lang(zh-Hant) { --font: system-ui, -apple-system, "PingFang TC", "PingFang HK", "Noto Sans TC", "Microsoft JhengHei", sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font: 16px/1.65 var(--font);
  color: var(--text);
  background: var(--deep);
  overflow-x: hidden;
}
:lang(zh-Hant) body, body:lang(zh-Hant) { line-height: 1.8; letter-spacing: .02em; }
img, svg { display: block; max-width: 100%; }
a { color: var(--teal); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h2 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.6rem); letter-spacing: -.01em; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; color: var(--muted); }
p b, li b { color: var(--text); }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
code { color: var(--sand); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: 16px; top: -60px; z-index: 100; padding: 8px 14px; border-radius: 10px; background: var(--teal); color: #012; font-weight: 700; }
.skip:focus { top: 12px; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(820px, 100% - 32px); }

/* ───────── Ocean backdrop: gets darker as you dive (scroll) ───────── */
.ocean { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: linear-gradient(180deg, var(--surface) 0%, var(--mid) 38%, var(--deep) 75%, var(--abyss) 100%); }
.abyss { position: absolute; inset: 0; background: var(--abyss); opacity: calc(var(--depth) * .72); }
.ocean::before { /* rippling surface light */
  content: ""; position: absolute; inset: -20% -10% auto; height: 60%;
  background:
    radial-gradient(60% 40% at 30% 0%, rgba(140, 230, 255, .35), transparent 70%),
    radial-gradient(50% 35% at 75% 5%, rgba(110, 240, 220, .22), transparent 70%);
  opacity: calc(1 - var(--depth) * 1.4);
  animation: shimmer 9s ease-in-out infinite alternate;
}
.rays { position: absolute; inset: 0; opacity: calc(.9 - var(--depth) * 1.2); }
.rays i {
  position: absolute; top: -10%; width: 9vw; min-width: 60px; height: 95vh;
  background: linear-gradient(180deg, rgba(190, 240, 255, .22), rgba(190, 240, 255, 0) 85%);
  transform-origin: top center; filter: blur(6px); mix-blend-mode: screen;
  animation: ray 11s ease-in-out infinite alternate;
}
.rays i:nth-child(1) { left: 12%; transform: rotate(14deg); animation-duration: 13s; }
.rays i:nth-child(2) { left: 30%; width: 5vw; transform: rotate(10deg); animation-delay: -4s; }
.rays i:nth-child(3) { left: 48%; transform: rotate(6deg); animation-duration: 15s; animation-delay: -7s; }
.rays i:nth-child(4) { left: 66%; width: 6vw; transform: rotate(2deg); animation-delay: -2s; }
.rays i:nth-child(5) { left: 84%; transform: rotate(-3deg); animation-duration: 12s; animation-delay: -9s; }
@keyframes ray { from { opacity: .35; translate: -2vw 0; } to { opacity: 1; translate: 2vw 0; } }
@keyframes shimmer { from { transform: translateX(-3%) scaleY(1); } to { transform: translateX(3%) scaleY(1.1); } }

#bubbles { position: absolute; inset: 0; width: 100%; height: 100%; }

.school { position: absolute; display: flex; gap: 14px; flex-wrap: wrap; width: 140px; color: rgba(150, 215, 240, .32);
  animation: swim 46s linear infinite; }
.school svg { width: 34px; height: 15px; fill: currentColor; animation: wiggle 1.4s ease-in-out infinite alternate; }
.school svg:nth-child(2n) { margin-top: 8px; animation-delay: -.5s; }
.school svg:nth-child(3n) { width: 26px; animation-delay: -.9s; }
.school.s1 { top: 24%; animation-delay: -8s; }
.school.s2 { top: 58%; width: 100px; animation-duration: 64s; animation-delay: -40s; color: rgba(240, 184, 128, .26); }
.school.s3 { top: 80%; animation-duration: 54s; animation-direction: reverse; animation-delay: -20s; }
.school.s3 svg { scale: -1 1; }
@keyframes swim { from { transform: translateX(110vw); } to { transform: translateX(-30vw); } }
@keyframes wiggle { from { rotate: -4deg; } to { rotate: 5deg; } }

.manta-swim { position: absolute; top: 34%; left: 0; width: 260px; height: 214px; fill: rgba(2, 20, 40, .55);
  animation: glide 80s linear infinite; animation-delay: -30s; }
@keyframes glide {
  0% { transform: translate(-30vw, 10vh) rotate(98deg) scale(.8); }
  50% { transform: translate(50vw, -6vh) rotate(84deg) scale(1); }
  100% { transform: translate(130vw, 8vh) rotate(96deg) scale(.8); }
}

/* Dive-computer depth gauge */
.gauge { position: fixed; right: 18px; top: 50%; translate: 0 -50%; z-index: 20; display: grid; justify-items: center; gap: 8px;
  font: 600 11px/1 ui-monospace, Menlo, monospace; color: var(--muted); letter-spacing: .08em; }
.gauge-track { width: 4px; height: 160px; border-radius: 4px; background: rgba(160, 220, 255, .12); overflow: hidden; }
.gauge-track i { display: block; height: 100%; background: linear-gradient(var(--teal), var(--cyan)); transform-origin: top; transform: scaleY(var(--depth)); }
.gauge-val { color: var(--teal); }
.gauge-label { text-transform: uppercase; }

/* ───────── Top bar ───────── */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 20px;
  padding: 12px max(16px, calc((100% - 1180px) / 2)); background: rgba(2, 21, 38, .55);
  backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.1rem; letter-spacing: -.01em; }
.brand img { border-radius: 8px; }
.brand b { color: var(--teal); }
.topbar nav { display: flex; gap: 22px; margin-left: auto; }
.topbar nav a { color: var(--muted); text-decoration: none; font-size: .92rem; white-space: nowrap; }
.topbar nav a:hover { color: var(--text); }
.top-actions { display: flex; gap: 10px; align-items: center; }
.topbar nav + .top-actions { margin-left: 8px; }
.lang { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(62, 230, 200, .08); color: var(--text); font: 600 .85rem/1 var(--font); }
.lang:hover { border-color: var(--teal); }
.lang svg { color: var(--teal); }

/* ───────── Buttons & chips ───────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 999px;
  font-weight: 650; text-decoration: none; transition: transform .2s, box-shadow .2s, background .2s; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { color: #01231f; background: linear-gradient(135deg, var(--teal), var(--cyan)); box-shadow: 0 10px 30px -10px rgba(62, 230, 200, .7); }
.btn-ghost { color: var(--text); border: 1px solid var(--line); background: rgba(255, 255, 255, .04); }
.btn-ghost:hover { background: rgba(255, 255, 255, .08); }
.btn-sm { padding: 8px 14px; font-size: .88rem; }
.btn-block { width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 0; margin: 22px 0 0; list-style: none; }
.chips li { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: rgba(2, 21, 38, .35); font-size: .82rem; color: var(--muted); }

/* ───────── Hero ───────── */
.hero { position: relative; padding: clamp(48px, 8vw, 96px) 0 40px; text-align: center; overflow: hidden; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px; border-radius: 999px; font-size: .85rem;
  background: rgba(2, 21, 38, .4); border: 1px solid var(--line); color: var(--text); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 0 rgba(62, 230, 200, .6); animation: ping 2.2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 10px rgba(62, 230, 200, 0); } 100% { box-shadow: 0 0 0 0 rgba(62, 230, 200, 0); } }
.hero h1 { font-size: clamp(2.1rem, 1.2rem + 4.4vw, 4.2rem); letter-spacing: -.02em; margin: 22px auto 18px; max-width: 16ch; }
:lang(zh-Hant) .hero h1 { max-width: 14em; letter-spacing: .01em; }
.grad { background: linear-gradient(90deg, var(--sand), var(--coral) 40%, var(--teal) 75%, var(--cyan));
  -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 200% 100%; animation: flow 8s ease-in-out infinite alternate; }
@keyframes flow { to { background-position: 100% 0; } }
.lede { max-width: 640px; margin: 0 auto 28px; font-size: 1.1rem; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.hero-art { margin-top: 48px; margin-bottom: 0; perspective: 1400px; }
.porthole { position: relative; border-radius: 26px; padding: 8px; background: linear-gradient(145deg, rgba(160, 230, 255, .35), rgba(62, 230, 200, .08) 40%, rgba(240, 184, 128, .25));
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .7), 0 0 0 1px var(--line); animation: bob 7s ease-in-out infinite; }
.porthole img { width: 100%; height: auto; border-radius: 20px; }
.porthole::after { content: ""; position: absolute; inset: 8px; border-radius: 20px; pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, .14), transparent 30%); }
@keyframes bob { 50% { transform: translateY(-10px) rotateX(1.5deg); } }

.kelp { position: absolute; bottom: -10px; width: 120px; height: 300px; fill: none; stroke-linecap: round; opacity: .55;
  transform-origin: bottom center; animation: sway 6s ease-in-out infinite alternate; }
.kelp path { stroke: #0f6b5c; stroke-width: 9; }
.kelp path:nth-child(2) { stroke: #138a6f; stroke-width: 7; }
.kelp path:nth-child(3) { stroke: #0c5a52; stroke-width: 6; }
.kelp-l { left: -10px; }
.kelp-r { right: -10px; scale: -1 1; animation-delay: -3s; }
@keyframes sway { from { transform: skewX(-4deg); } to { transform: skewX(5deg); } }

/* ───────── Sections ───────── */
.section { padding: clamp(64px, 9vw, 120px) 0; content-visibility: auto; contain-intrinsic-size: auto 800px; }
.sec-head { text-align: center; max-width: 720px; margin: 0 auto 48px; }
.kicker { display: inline-block; margin-bottom: 10px; font: 700 .78rem/1 ui-monospace, Menlo, monospace; text-transform: uppercase; letter-spacing: .16em; color: var(--teal); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.fine { font-size: .82rem; opacity: .8; }

.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* Compare */
.compare { --pos: 50%; position: relative; aspect-ratio: 1; border-radius: 24px; overflow: hidden; user-select: none;
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .8), 0 0 0 1px var(--line); }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare .before { filter: url(#cast); clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.seam { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; translate: -1px 0; background: rgba(255, 255, 255, .9); pointer-events: none; }
.knob { position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; translate: -50% -50%; border-radius: 50%; background: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .4); }
.knob::before, .knob::after { content: ""; position: absolute; top: 50%; translate: 0 -50%; border: 7px solid transparent; }
.knob::before { left: 6px; border-right-color: #2c7bc4; }
.knob::after { right: 6px; border-left-color: #2bae9a; }
.tag { position: absolute; bottom: 16px; padding: 4px 12px; border-radius: 999px; background: rgba(2, 21, 38, .6); font-weight: 650; font-size: .85rem; pointer-events: none; }
.tag-b { left: 16px; }
.tag-a { right: 16px; }
.cmp-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.cmp-range:focus-visible ~ .seam .knob, .compare:has(.cmp-range:focus-visible) .knob { outline: 3px solid var(--teal); outline-offset: 2px; }

/* Steps */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: s; }
.steps li { position: relative; padding: 26px 24px; border-radius: var(--radius); background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.steps .n { display: block; margin-bottom: 14px; font: 800 2rem/1 ui-monospace, Menlo, monospace;
  background: linear-gradient(135deg, var(--teal), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.steps p { margin: 0; }
.steps li:nth-child(2) { transition-delay: .08s; } .steps li:nth-child(3) { transition-delay: .16s; }
.steps li:nth-child(5) { transition-delay: .08s; } .steps li:nth-child(6) { transition-delay: .16s; }

/* Smart grading */
.ticks { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 30px; color: var(--muted); }
.ticks li::before { content: ""; position: absolute; left: 0; top: .45em; width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff 0 18%, rgba(62, 230, 200, .9) 20% 55%, rgba(62, 230, 200, .25) 60%); }
.scenes { display: grid; gap: 14px; }
.frames { position: relative; display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; padding: 12px 12px 30px; border-radius: 14px;
  background: rgba(2, 21, 38, .5); border: 1px solid var(--line); }
.frames i { aspect-ratio: 16 / 10; border-radius: 6px; background: url("img/reef.jpg") center / 260% no-repeat; filter: url(#cast); animation: scan 6s ease-in-out infinite; }
.frames i:nth-child(1) { background-position: 10% 30%; }
.frames i:nth-child(2) { background-position: 30% 60%; animation-delay: .5s; }
.frames i:nth-child(3) { background-position: 50% 20%; animation-delay: 1s; }
.frames i:nth-child(4) { background-position: 70% 70%; animation-delay: 1.5s; }
.frames i:nth-child(5) { background-position: 85% 40%; animation-delay: 2s; }
.frames i:nth-child(6) { background-position: 100% 90%; animation-delay: 2.5s; }
@keyframes scan { 0%, 30% { filter: url(#cast); } 50%, 80% { filter: none; } 100% { filter: url(#cast); } }
.frames-scale { position: absolute; left: 12px; right: 12px; bottom: 8px; display: flex; justify-content: space-between; font: 600 .72rem/1 ui-monospace, Menlo, monospace; color: var(--muted); }
.scene { padding: 18px 20px 16px 22px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line); border-left: 4px solid; }
.scene p { margin: 0; font-size: .93rem; }
.scene.murky { border-left-color: #9fc9c0; }
.scene.blue { border-left-color: var(--cyan); }
.scene.deep { border-left-color: #3d5bd9; }

/* Feature cards */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card { padding: 26px 24px; border-radius: var(--radius); background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: transform .3s, border-color .3s, opacity .8s ease; }
.card:hover { transform: translateY(-4px); border-color: rgba(62, 230, 200, .4); }
.card p { margin: 0; font-size: .95rem; }
.ico { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 16px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(62, 230, 200, .22), rgba(79, 195, 255, .12)); border: 1px solid rgba(62, 230, 200, .3); }
.ico svg { width: 24px; height: 24px; fill: var(--teal); }

/* Export */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--glass); }
table { width: 100%; border-collapse: collapse; min-width: 620px; font-size: .94rem; }
th, td { padding: 14px 18px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
tbody tr:last-child > * { border-bottom: 0; }
thead th { font: 700 .78rem/1.2 ui-monospace, Menlo, monospace; text-transform: uppercase; letter-spacing: .1em; color: var(--teal); background: rgba(62, 230, 200, .06); }
tbody th { white-space: nowrap; color: var(--text); }
td { color: var(--muted); }
.safe { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 28px; }
.safe > div { padding: 22px; border-radius: var(--radius); border: 1px dashed rgba(62, 230, 200, .3); }
.safe p { margin: 0; font-size: .93rem; }

/* Limits */
.limits { border-radius: var(--radius); background: var(--glass); border: 1px solid var(--line); }
.limits summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 24px; cursor: pointer; list-style: none; font-weight: 700; font-size: 1.1rem; }
.limits summary::-webkit-details-marker { display: none; }
.chev { width: 10px; height: 10px; border-right: 2px solid var(--teal); border-bottom: 2px solid var(--teal); rotate: 45deg; transition: rotate .3s; }
.limits[open] .chev { rotate: 225deg; }
.limits ul { margin: 0; padding: 0 24px 22px 44px; color: var(--muted); display: grid; gap: 8px; }

/* Download */
.dl { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; max-width: 900px; margin: 0 auto; }
.dl-card { display: flex; flex-direction: column; }
.dl-card .btn { margin-top: auto; }
.dl-card p { margin-bottom: 18px; }
pre { margin: 0 0 18px; padding: 14px 16px; border-radius: 12px; background: rgba(1, 10, 20, .7); border: 1px solid var(--line); overflow-x: auto; }

/* Footer */
.foot { position: relative; padding: 70px 0 36px; margin-top: 40px; color: var(--muted); font-size: .9rem; }
.seabed { position: absolute; top: 0; left: 0; width: 100%; height: 90px; fill: #0b1c26; opacity: .9; }
.foot::before { content: ""; position: absolute; inset: 88px 0 0; background: #0b1c26; opacity: .9; z-index: -1; }
.foot .wrap { position: relative; display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: center; justify-content: space-between; }
.foot .brand { font-size: 1rem; }
.foot .brand img { border-radius: 6px; }

/* ───────── Responsive ───────── */
@media (max-width: 980px) {
  .topbar nav { display: none; }
  .top-actions { margin-left: auto; }
  .split { grid-template-columns: 1fr; }
  .steps, .grid { grid-template-columns: repeat(2, 1fr); }
  .safe { grid-template-columns: 1fr; }
  .gauge { display: none; }
}
@media (max-width: 640px) {
  .steps, .grid, .dl { grid-template-columns: 1fr; }
  .gh span { display: none; }
  .gh { padding: 8px 10px; }
  .kelp { width: 70px; height: 180px; opacity: .4; }
  .hero-art { margin-top: 36px; }
  .porthole { border-radius: 18px; padding: 5px; }
  .porthole img, .porthole::after { border-radius: 14px; }
  .porthole::after { inset: 5px; }
  .manta-swim { width: 160px; height: 132px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .school, .manta-swim { display: none; }
}
