/* AquaPace site. Palette and type: see DESIGN-NOTES.md. */
:root {
  --bg: #F3F7FC;
  --ink: #0B1A33;
  --muted: #55657C;
  --tick: #8A97A8;
  --rule: rgba(11, 26, 51, 0.12);
  --accent: #1F7AFF;
  --melt: #7FD3FF;
  --abyss: #06204F;
  --glass: rgba(255, 255, 255, 0.55);
  --header: rgba(243, 247, 252, 0.78);
  --font: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "PingFang SC", "PingFang TC", "Apple SD Gothic Neo", "Noto Sans CJK JP", sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #060B14;
    --ink: #E6EEF8;
    --muted: #93A3B8;
    --tick: #5B6B80;
    --rule: rgba(230, 238, 248, 0.12);
    --glass: rgba(20, 32, 52, 0.6);
    --header: rgba(6, 11, 20, 0.72);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px;
}
h1, h2, h3 { font-weight: 600; letter-spacing: -0.025em; line-height: 1.08; margin: 0; }
p { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 28px;
  padding: 14px var(--gutter);
  background: var(--header);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.top.scrolled { border-bottom-color: var(--rule); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; letter-spacing: -0.01em; }
.brand img { border-radius: 7px; }
.top nav { display: flex; gap: 22px; margin-left: auto; }
.top nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
.top nav a:hover { color: var(--ink); }
.lang select {
  appearance: none; -webkit-appearance: none;
  font: inherit; font-size: 14px; color: var(--ink);
  background: transparent; border: 1px solid var(--rule); border-radius: 8px;
  padding: 6px 26px 6px 10px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 13px) 55%, calc(100% - 8px) 55%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.lang select option { color: #0B1A33; }
.btn {
  display: inline-block; padding: 9px 16px; border-radius: 10px;
  background: var(--accent); color: #fff; text-decoration: none; font-weight: 600; font-size: 15px;
  white-space: nowrap;
}
.btn:hover { background: #136BEB; }

/* Stage: story text + sticky glass column */
.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(220px, 30vw, 380px);
  gap: clamp(24px, 6vw, 96px);
  padding: 0 var(--gutter);
  max-width: 1320px; margin: 0 auto;
}
.hero { min-height: calc(92vh - 64px); display: flex; flex-direction: column; justify-content: center; padding: 48px 0 64px; }
.hero h1 { font-size: clamp(2.6rem, 6.4vw, 5.8rem); letter-spacing: -0.04em; line-height: 0.98; }
.hero .lede { margin-top: 28px; max-width: 34em; font-size: clamp(1.05rem, 1.5vw, 1.25rem); color: var(--muted); }
.get { margin-top: 36px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.get p { color: var(--muted); font-size: 14px; }
.badge img { display: block; height: 48px; width: auto; }

.step {
  min-height: 78vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 40px 0;
  max-width: 34em;
  opacity: .28;
  transition: opacity .5s ease;
}
.step.active { opacity: 1; }
.step:last-child { min-height: 90vh; }
.clock { font-size: clamp(3rem, 7vw, 5.2rem); font-weight: 500; letter-spacing: -0.05em; line-height: 1; color: var(--accent); }
.step h2 { margin-top: 18px; font-size: clamp(1.6rem, 2.8vw, 2.4rem); }
.step p:not(.clock) { margin-top: 14px; color: var(--muted); font-size: 1.08rem; }

.column-wrap { position: relative; }
.column {
  position: sticky; top: 84px;
  height: calc(100vh - 120px); max-height: 820px; min-height: 440px;
  margin-top: 24px;
}
.column canvas, .fallback-water { position: absolute; inset: 0 0 56px 0; width: 100%; height: calc(100% - 56px); }
.fallback-water { display: none; }
.no-webgl .fallback-water {
  display: block;
  left: 22%; right: 22%; width: auto;
  border: 1.5px solid var(--rule); border-top: 0; border-radius: 0 0 28px 28px;
  background: linear-gradient(to top, var(--abyss), var(--accent) calc(var(--level, 0) * 70%), var(--melt) calc(var(--level, 0) * 100%), transparent calc(var(--level, 0) * 100%));
}
.scale { position: absolute; left: 0; top: 0; width: 22%; height: calc(100% - 56px); overflow: visible; }
.scale line { stroke: var(--tick); stroke-width: 1; }
.scale line.major { stroke: var(--ink); opacity: .55; }
.scale text { fill: var(--muted); font-size: 11px; font-family: var(--font); text-anchor: end; }
.marker {
  position: absolute; right: 4%; display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--muted);
  transform: translateY(50%); transition: bottom .6s cubic-bezier(.2, .8, .2, 1), opacity .3s;
}
.marker span { width: 0; height: 0; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-right: 9px solid #FF9F0A; }
.goal-line {
  position: absolute; left: 22%; right: 22%; height: 0;
  border-top: 1.5px dashed #34C77B;
  transition: bottom .9s cubic-bezier(.2, .8, .2, 1);
}
.goal-line span { position: absolute; right: -4px; transform: translate(100%, -55%); font-size: 12px; font-weight: 600; color: #22A866; white-space: nowrap; }
.readout { position: absolute; left: 0; right: 0; bottom: 0; height: 44px; display: flex; justify-content: center; align-items: baseline; gap: 14px; }
.readout time { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.readout span { font-size: 15px; color: var(--muted); }
.toast {
  position: absolute; left: 50%; top: 14%; width: min(270px, 110%);
  display: flex; gap: 10px; align-items: center;
  padding: 11px 13px; border-radius: 18px;
  background: var(--glass); border: 1px solid var(--rule);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 18px 40px -18px rgba(6, 32, 79, .45);
  font-size: 13px; line-height: 1.3;
  opacity: 0; transform: translate(-50%, -14px) scale(.96);
  transition: opacity .45s ease, transform .6s cubic-bezier(.2, 1.3, .3, 1);
  pointer-events: none;
}
.toast img { border-radius: 6px; flex: none; }
.toast b { display: block; font-weight: 600; }
.toast span { color: var(--muted); }
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* Ruler divider */
.ticks {
  height: 14px; margin-bottom: 56px;
  background:
    linear-gradient(var(--tick), var(--tick)) bottom / 100% 1px no-repeat,
    repeating-linear-gradient(90deg, var(--tick) 0 1px, transparent 1px 60px) bottom / 100% 14px no-repeat,
    repeating-linear-gradient(90deg, var(--tick) 0 1px, transparent 1px 12px) bottom / 100% 6px no-repeat;
  opacity: .55;
}

section.free, section.science, section.insights, section.faq, section.closing {
  max-width: 1320px; margin: 0 auto; padding: 96px var(--gutter) 40px;
}
section h2 { font-size: clamp(2rem, 4.2vw, 3.4rem); max-width: 16em; }
section .lede, section .body { margin-top: 22px; color: var(--muted); font-size: 1.15rem; max-width: 40em; }

.compare { margin-top: 56px; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--rule); }
.compare > div { padding: 32px 40px 8px 0; }
.compare > .pro { padding-left: 40px; border-left: 1px solid var(--rule); }
.compare h3 { font-size: 1.3rem; }
.compare .pro h3 { color: var(--accent); }
.compare ul { list-style: none; padding: 0; margin: 22px 0 0; }
.compare li { position: relative; padding: 11px 0 11px 26px; border-bottom: 1px solid var(--rule); }
.compare li::before { content: ""; position: absolute; left: 0; top: 50%; width: 14px; height: 1.5px; background: var(--tick); }
.compare .pro li::before { background: var(--accent); }
.price { margin-top: 20px; color: var(--muted); font-size: 15px; }

.science .body { color: var(--ink); font-size: clamp(1.15rem, 1.8vw, 1.4rem); line-height: 1.6; max-width: 44em; }
.science h3 { margin-top: 48px; font-size: 1rem; color: var(--muted); font-weight: 600; }
.sources { margin: 14px 0 0; padding-left: 1.2em; max-width: 52em; font-size: 15px; }
.sources li { padding: 6px 0; }
.sources a { color: var(--ink); text-decoration-color: var(--rule); }
.sources a:hover { text-decoration-color: var(--accent); }
.disclaimer { margin-top: 28px; font-size: 14px; color: var(--muted); max-width: 52em; }

.insights { display: grid; grid-template-columns: 1.1fr .9fr; column-gap: 72px; align-items: end; }
.insights .ticks { grid-column: 1 / -1; }
.ins-points { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule); }
.ins-points li { padding: 16px 0; border-bottom: 1px solid var(--rule); font-size: 1.08rem; }

.faq details { border-bottom: 1px solid var(--rule); max-width: 52em; }
.faq h2 + details { margin-top: 40px; border-top: 1px solid var(--rule); }
.faq summary, .doc details summary {
  list-style: none; cursor: pointer; padding: 22px 40px 22px 0; position: relative;
  font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em;
}
.faq summary::-webkit-details-marker, .doc summary::-webkit-details-marker { display: none; }
.faq summary::after, .doc details summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 12px; height: 12px; margin-top: -6px;
  background: linear-gradient(var(--ink), var(--ink)) center / 12px 1.5px no-repeat, linear-gradient(var(--ink), var(--ink)) center / 1.5px 12px no-repeat;
  transition: transform .3s ease;
}
details[open] > summary::after { transform: rotate(45deg); }
.faq details p, .doc details p { padding: 0 40px 24px 0; color: var(--muted); }

.closing { text-align: center; padding-bottom: 96px; }
.closing .badge { display: inline-block; }
.closing .badge img { height: 56px; }

.foot { max-width: 1320px; margin: 0 auto; padding: 0 var(--gutter) 40px; }
.foot .ticks { margin-bottom: 28px; }
.foot-row { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.foot nav { display: flex; gap: 22px; flex-wrap: wrap; }
.foot nav a { color: var(--muted); text-decoration: none; }
.foot nav a:hover { color: var(--ink); }
.fine { margin-top: 14px; font-size: 12px; color: var(--tick); }

/* Document pages */
.doc-main { max-width: 760px; margin: 0 auto; padding: 72px var(--gutter) 96px; }
.doc-main h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: -0.035em; }
.doc-main h2 { margin-top: 44px; font-size: 1.35rem; }
.doc-main p { margin-top: 14px; }
.doc-main .updated { color: var(--muted); font-size: 14px; margin-top: 16px; }
.doc-main .lede { margin-top: 20px; color: var(--muted); font-size: 1.15rem; margin-bottom: 36px; }
.doc details { border-bottom: 1px solid var(--rule); }
.doc details:first-of-type { border-top: 1px solid var(--rule); }

/* Reveal */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .8, .2, 1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .step, .toast, .marker, .goal-line { transition: none; }
}

/* Tablet & phone */
@media (max-width: 900px) {
  .top nav { display: none; }
  .lang { margin-left: auto; }
  .insights { grid-template-columns: 1fr; }
  .ins-points { margin-top: 36px; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .top { gap: 12px; padding-top: 10px; padding-bottom: 10px; }
  .brand span { display: none; }
  .btn { padding: 8px 12px; font-size: 14px; }
  .stage { grid-template-columns: minmax(0, 1fr) 34vw; gap: 14px; }
  .hero { min-height: auto; padding: 40px 0 24px; }
  .hero h1 { font-size: clamp(1.9rem, 8.6vw, 2.6rem); letter-spacing: -0.035em; }
  .hero .lede { font-size: 1rem; margin-top: 18px; }
  .get { margin-top: 24px; }
  .badge img { height: 42px; }
  .step { min-height: 72vh; padding: 24px 0; }
  .clock { font-size: 2.4rem; }
  .step h2 { font-size: 1.35rem; }
  .step p:not(.clock) { font-size: 0.98rem; }
  .column { top: 70px; height: calc(100svh - 96px); min-height: 380px; }
  .scale text { font-size: 9px; }
  .marker { font-size: 0; right: 0; }
  .goal-line span { font-size: 0; }
  .toast { width: 52vw; left: auto; right: -2px; top: 6%; font-size: 12px; transform: translate(0, -14px) scale(.96); }
  .toast.show { transform: none; }
  .readout { flex-direction: column; align-items: center; gap: 0; height: 48px; }
  .readout time { font-size: 17px; }
  .readout span { font-size: 12px; }
  .compare { grid-template-columns: 1fr; }
  .compare > .pro { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); margin-top: 24px; }
  .compare > div { padding-right: 0; }
  section.free, section.science, section.insights, section.faq { padding-top: 72px; }
}

/* CJK headings: break only between phrases (build.py inserts <wbr> via BudouX for zh/ja;
   Korean already has spaces). overflow-wrap is the safety net for a phrase wider than its column.
   CJK glyphs are wider than Latin ones, so the hero headline runs one size smaller. */
:is(:lang(ja), :lang(zh), :lang(ko)) :is(h1, h2) { word-break: keep-all; overflow-wrap: anywhere; letter-spacing: 0; }
:is(:lang(ja), :lang(zh)) .hero h1 { font-size: clamp(2.3rem, 4.6vw, 4.4rem); line-height: 1.12; }
@media (max-width: 720px) {
  :is(:lang(ja), :lang(zh)) .hero h1 { font-size: clamp(1.6rem, 7vw, 2rem); }
}
