@import url('https://fonts.googleapis.com/css2?family=Archivo:wdth,wght@75..125,500..900&family=Atkinson+Hyperlegible:wght@400;700&display=swap');

:root {
  --deep: oklch(23% 0.052 236);
  --deep-2: oklch(18% 0.04 236);
  --pool: oklch(66% 0.119 217);
  --pool-dark: oklch(43% 0.09 222);
  --tile: oklch(98.5% 0.005 230);
  --surface: oklch(100% 0 0);
  --surface-blue: oklch(95% 0.025 220);
  --ink: oklch(23% 0.03 230);
  --muted: oklch(40% 0.035 230);
  --rule: oklch(85% 0.018 225);
  --lane: oklch(70% 0.195 40);
  --lane-dark: oklch(55% 0.18 40);
  --warning-bg: oklch(94% 0.045 74);
  --warning-ink: oklch(34% 0.09 53);

  --font-display: 'Archivo', 'Arial Narrow', sans-serif;
  --font-body: 'Atkinson Hyperlegible', system-ui, sans-serif;
  --shell: min(1180px, calc(100% - 2rem));
  --depth-width: 0px;

  --space-2xs: .5rem;
  --space-xs: .75rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4.5rem;
  --space-3xl: 6rem;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --z-nav: 20;
  --z-depth: 30;
  --z-mobile-cta: 40;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  overflow-x: hidden;
  background: var(--tile);
  color: var(--ink);
  font: 400 1rem/1.6 var(--font-body);
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select { font: inherit; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--lane); outline-offset: 3px; }
[hidden] { display: none !important; }

.shell { width: var(--shell); margin-inline: auto; }
.page { padding-left: var(--depth-width); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1;
  text-wrap: balance;
}
h1 { font-size: clamp(2.6rem, 7vw, 5.75rem); max-width: 11ch; }
h2 { font-size: clamp(2rem, 4vw, 3.5rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.6rem); line-height: 1.15; }
p { text-wrap: pretty; }
.kicker {
  margin-bottom: var(--space-sm);
  color: var(--pool);
  font: 700 .82rem/1.2 var(--font-body);
  letter-spacing: .07em;
}

.depth-nav { display: none; }

.notice {
  padding: .75rem 1rem;
  border-bottom: 1px solid oklch(82% 0.07 72);
  background: var(--warning-bg);
  color: var(--warning-ink);
  text-align: center;
  font-size: .92rem;
}

.nav {
  position: absolute;
  inset: 0 0 auto var(--depth-width);
  z-index: var(--z-nav);
  color: var(--surface);
}
.nav-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  border-bottom: 1px solid oklch(100% 0 0 / .18);
}
.brand {
  font: 900 .95rem/1 var(--font-display);
  letter-spacing: .015em;
  text-decoration: none;
  text-transform: uppercase;
}
.nav-links { display: none; margin-left: auto; align-items: center; gap: var(--space-lg); }
.nav-links a { min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; font-weight: 700; }
.nav-links a:hover { color: var(--pool); }
.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: .75rem 1.1rem;
  border: 0;
  border-radius: 8px;
  background: var(--lane);
  color: var(--deep-2);
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms var(--ease-out), background-color 180ms var(--ease-out);
}
.button:hover { background: var(--lane-dark); transform: translateY(-2px); }
.button:active { transform: translateY(0); }
.button-secondary { background: transparent; color: var(--surface); box-shadow: inset 0 0 0 1px oklch(100% 0 0 / .5); }

.hero {
  position: relative;
  min-height: min(820px, 92svh);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  padding: 8rem 0 clamp(4rem, 9vw, 7rem);
  background: var(--deep-2);
  color: var(--surface);
  isolation: isolate;
}
.hero::before, .hero::after { content: ''; position: absolute; inset: 0; z-index: -2; }
.hero::before {
  background-image: image-set(url('img/caustics.webp') type('image/webp'), url('img/caustics.png') type('image/png'));
  background-size: cover;
  background-position: center;
  filter: saturate(1.08) contrast(1.08);
  transform: scale(1.025);
  animation: water-arrive 900ms var(--ease-out) both;
}
.hero::after {
  z-index: -1;
  background:
    linear-gradient(90deg, oklch(18% 0.04 236 / .96) 0%, oklch(18% 0.04 236 / .77) 52%, oklch(18% 0.04 236 / .28) 100%),
    linear-gradient(0deg, oklch(16% 0.035 236 / .8), transparent 60%);
}
.hero-rope {
  position: absolute;
  z-index: -1;
  top: -12%;
  right: -24%;
  width: min(900px, 78vw);
  height: 125%;
  background-image: image-set(url('img/rope.webp') type('image/webp'), url('img/rope.png') type('image/png'));
  background-size: cover;
  background-position: 55% center;
  mix-blend-mode: screen;
  opacity: .72;
  transform: rotate(5deg);
}
.hero-layout { display: grid; gap: var(--space-xl); align-items: end; }
.hero-copy { animation: copy-arrive 700ms 120ms var(--ease-out) both; }
.hero-copy h1 { margin-bottom: var(--space-md); }
.hero-copy h1 span { color: var(--pool); }
.hero-lead { max-width: 48ch; margin-bottom: var(--space-lg); color: oklch(90% 0.025 225); font-size: 1.12rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.rating-proof {
  max-width: 340px;
  padding-top: var(--space-md);
  border-top: 1px solid oklch(100% 0 0 / .28);
}
.rating-line { display: flex; align-items: baseline; gap: var(--space-sm); }
.rating-number { font: 900 clamp(2.2rem, 4vw, 3rem)/.9 var(--font-display); letter-spacing: -.025em; }
.rating-label { color: oklch(90% 0.025 225); }
.rating-meta { margin: var(--space-sm) 0 0; font-size: .95rem; color: oklch(90% 0.025 225); }

.ledger { padding: var(--space-xl) 0; background: var(--deep); color: var(--surface); }
.ledger-grid { display: grid; gap: var(--space-lg); }
.ledger-intro h2 { max-width: 12ch; margin-bottom: var(--space-sm); }
.ledger-intro p { max-width: 52ch; margin-bottom: 0; color: oklch(87% 0.025 225); }
.ledger-list { margin: 0; display: grid; }
.ledger-row { display: grid; grid-template-columns: 7rem 1fr; gap: var(--space-md); padding: var(--space-sm) 0; border-top: 1px solid oklch(100% 0 0 / .16); }
.ledger-row dt { color: var(--pool); font-weight: 700; }
.ledger-row dd { margin: 0; }
.ledger-row a { color: var(--surface); text-underline-offset: 4px; }

.archive { padding: var(--space-2xl) 0 var(--space-3xl); background: var(--tile); }
.archive-head { display: grid; gap: var(--space-md); margin-bottom: var(--space-xl); }
.archive-head h2 { margin-bottom: var(--space-sm); }
.archive-head p { max-width: 60ch; margin-bottom: 0; color: var(--muted); }
.filter-panel { display: grid; gap: var(--space-sm); align-content: end; }
.search-row { display: grid; gap: var(--space-xs); }
.field-label { font-weight: 700; }
.search-input, .sort-select {
  min-height: 48px;
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: .75rem .9rem;
}
.search-input::placeholder { color: var(--muted); opacity: 1; }
.filters { display: flex; flex-wrap: wrap; gap: .55rem; }
.chip {
  min-height: 44px;
  padding: .65rem .95rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  transition: color 160ms var(--ease-out), background-color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}
.chip:hover { border-color: var(--pool-dark); }
.chip[aria-pressed='true'] { border-color: var(--deep); background: var(--deep); color: var(--surface); }
.chip:disabled { cursor: not-allowed; opacity: .55; }
.coach-disclosure { margin-top: var(--space-xs); }
.coach-disclosure summary { min-height: 44px; display: inline-flex; align-items: center; font-weight: 700; cursor: pointer; }
.coach-filters { display: flex; flex-wrap: wrap; gap: .5rem; padding-top: var(--space-xs); }

.archive-layout { display: grid; gap: var(--space-xl); align-items: start; }
.featured-review {
  position: relative;
  padding: clamp(1.5rem, 4vw, 3rem);
  background: var(--deep);
  color: var(--surface);
  border-radius: 12px;
  overflow: hidden;
}
.featured-review::after {
  content: '“';
  position: absolute;
  top: -.35em;
  right: .08em;
  color: var(--pool);
  font: 900 12rem/1 var(--font-display);
  opacity: .16;
}
.featured-review .review-quote { position: relative; z-index: 1; margin-bottom: var(--space-lg); font-size: clamp(1.35rem, 2.5vw, 2rem); line-height: 1.35; }
.featured-review .review-author { font-weight: 700; }
.featured-review .review-meta { color: oklch(87% 0.025 225); }
.review-column { min-width: 0; }
.results-bar { min-height: 44px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-sm); margin-bottom: var(--space-xs); }
.result-count { margin: 0; color: var(--muted); font-weight: 700; }
.sort-wrap { display: flex; align-items: center; gap: .6rem; }
.sort-select { width: auto; min-width: 155px; }
.review-list { border-top: 1px solid var(--rule); }
.review-row { padding: var(--space-md) 0; border-bottom: 1px solid var(--rule); }
.review-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-xs); margin-bottom: .55rem; }
.review-author { font-weight: 700; font-size: 1.08rem; }
.review-date { color: var(--muted); font-size: .92rem; }
.review-rating { min-height: 24px; margin-bottom: .55rem; color: var(--lane-dark); font-size: .9rem; font-weight: 700; }
.review-rating svg { width: 16px; height: 16px; display: inline-block; fill: var(--lane); vertical-align: -2px; }
.review-text { max-width: 68ch; margin-bottom: var(--space-sm); line-height: 1.65; }
.review-text.is-clamped { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; overflow: hidden; }
.review-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); }
.text-button, .source-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border: 0;
  background: transparent;
  color: var(--pool-dark);
  padding: .4rem 0;
  font-weight: 700;
  text-underline-offset: 4px;
  cursor: pointer;
}
.tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag { padding: .25rem .55rem; border-radius: 999px; background: var(--surface-blue); color: var(--pool-dark); font-size: .82rem; font-weight: 700; }
.empty { padding: var(--space-xl) 0; color: var(--muted); }
.load-more { margin-top: var(--space-lg); min-width: 180px; background: var(--deep); }
.capnote { max-width: 68ch; margin: var(--space-lg) 0 0; color: var(--muted); }
.capnote a { color: var(--pool-dark); }

.trial { padding: var(--space-3xl) 0; background: var(--pool); color: var(--deep-2); }
.trial-grid { display: grid; gap: var(--space-xl); }
.trial-copy h2 { max-width: 12ch; margin-bottom: var(--space-md); }
.trial-copy > p { max-width: 54ch; font-size: 1.1rem; }
.trial-facts { margin: var(--space-lg) 0 0; display: grid; }
.trial-fact { display: grid; grid-template-columns: 7rem 1fr; gap: var(--space-md); padding: var(--space-sm) 0; border-top: 1px solid oklch(23% 0.052 236 / .24); }
.trial-fact dt { font-weight: 700; }
.trial-fact dd { margin: 0; }
.trial-fact a { text-underline-offset: 4px; }
.trial-steps { padding: var(--space-lg); border-radius: 12px; background: var(--deep); color: var(--surface); }
.trial-steps h3 { margin-bottom: var(--space-md); }
.trial-steps ol { margin: 0 0 var(--space-lg); padding-left: 1.25rem; }
.trial-steps li + li { margin-top: var(--space-sm); }
.trial-steps .button { width: 100%; }

.footer { padding: var(--space-xl) 0 calc(var(--space-3xl) + env(safe-area-inset-bottom)); background: var(--deep-2); color: oklch(87% 0.025 225); }
.footer-grid { display: grid; gap: var(--space-lg); }
.footer strong { color: var(--surface); }
.footer p { max-width: 72ch; margin-bottom: 0; }
.footer a { color: var(--surface); text-underline-offset: 4px; }
.footer-actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); align-items: flex-start; }
.footer .button-secondary { min-width: 170px; }
.fine { font-size: .88rem; color: oklch(75% 0.025 225); }

.mobile-cta {
  position: fixed;
  z-index: var(--z-mobile-cta);
  left: 1rem;
  right: 1rem;
  bottom: max(1rem, env(safe-area-inset-bottom));
  box-shadow: 0 6px 8px oklch(10% 0.025 236 / .28);
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}
.mobile-cta.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }

@keyframes water-arrive { from { opacity: .3; transform: scale(1.08); filter: saturate(.7) blur(5px); } }
@keyframes copy-arrive { from { opacity: 0; transform: translateY(18px); } }

@media (min-width: 720px) {
  :root { --shell: min(1180px, calc(100% - 4rem)); }
  .nav-links { display: flex; }
  .hero-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .ledger-grid, .archive-head, .trial-grid, .footer-grid { grid-template-columns: minmax(0, 1fr) minmax(320px, .8fr); }
  .search-row { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
  .mobile-cta { display: none; }
}

@media (min-width: 1040px) {
  :root { --depth-width: 72px; }
  .depth-nav {
    position: fixed;
    z-index: var(--z-depth);
    inset: 0 auto 0 0;
    width: var(--depth-width);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem .45rem;
    background: var(--deep);
    color: var(--surface);
  }
  .depth-track { position: absolute; inset: 4.2rem auto 4.2rem 50%; width: 1px; background: oklch(100% 0 0 / .2); }
  .depth-bead { position: absolute; top: 4.2rem; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--lane); box-shadow: 0 0 0 4px oklch(70% 0.195 40 / .22); will-change: transform; }
  .depth-label { position: relative; z-index: 1; font-size: .72rem; font-weight: 700; }
  .depth-links { position: relative; z-index: 1; display: grid; gap: var(--space-lg); }
  .depth-links a { min-width: 58px; min-height: 44px; display: grid; place-items: center; color: oklch(88% 0.025 225); font-size: .72rem; text-decoration: none; text-align: center; }
  .depth-links a:hover { color: var(--surface); }
  .archive-layout { grid-template-columns: minmax(310px, .72fr) minmax(0, 1.28fr); }
  .featured-review { position: sticky; top: 2rem; }
}

@media (max-width: 719px) {
  .hero { min-height: 760px; }
  .hero-rope { right: -62%; width: 120vw; opacity: .42; }
  .nav-inner { min-height: 64px; }
  .brand { max-width: 12ch; line-height: 1.05; }
  .nav .button { padding-inline: .85rem; font-size: .9rem; }
  .archive, .trial { padding-block: var(--space-2xl); }
  .ledger-row, .trial-fact { grid-template-columns: 1fr; gap: .25rem; }
  .featured-review { border-radius: 10px; }
  body { padding-bottom: calc(5rem + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  .depth-nav, .nav, .hero-rope, .mobile-cta, .filter-panel, .load-more, .trial .button { display: none !important; }
  .page { padding: 0; }
  .hero, .ledger, .trial, .footer { background: white; color: black; min-height: auto; }
  .hero::before, .hero::after { display: none; }
  .review-row { break-inside: avoid; }
}
