/* ============================================================
   SeaTox — Direction 04 "TIDEWATER"
   ------------------------------------------------------------
   Photographic, imagery-led, light-first. The page is ONE column
   of water. It opens at the surface and sinks; six full-bleed
   panels carry the descent and everything else sits on top of
   them. There are no cards, no white rectangles behind product,
   and no box render anywhere — the client asked for bottle-only
   product shots and this page has exactly one product image.

   Built on /shared/tokens.css. No token is redefined except the
   two type sizes raised on phones (the 15px floor, at the bottom
   of this file). Every local variable is namespaced --td-*.

   ------------------------------------------------------------
   THE DEPTH LADDER — the one decision the whole page hangs on

   Six panels, seven stops. D0 and D4/D5/D6 are shared tokens;
   D1–D3 sit on the straight line between --st-glass and
   --st-navy, so the column is monotonic and nothing on the page
   is a colour the brand does not already own.

     d0  #F2F7F8     0 m   near white
     d1  #E1ECEF   -12 m
     d2  #CBDFE6   -60 m                  the products
     d3  #A8C6D4  -200 m                  the dropper
     d4  #6E93A8  -700 m                  the light goes here
     d5  #1C3D52 -1100 m
     d6  #060F1A   floor   --st-abyss

   READ THAT TABLE, NOT YOUR MEMORY OF IT. Until recently this block
   documented a completely different ladder — D2 #4E7E95 at 60 m, D4
   #0C1F30 at 700 m — and a contrast table measured against it that
   claimed things like "white on canopy scrim .80 = 14.55:1". The
   ladder had since been relightened and the table had not. White on
   the canopy now measures about 1.5:1.

   That stale table was not a documentation nit. product.html was
   built by reading it: its 60 m and 200 m bands kept td-deep, white
   type and mint marks on water that had gone pale underneath them,
   and forty-seven text runs shipped between 1.00:1 and 2.90:1 —
   pack names, prices, per-bottle figures, every ritual step. Text
   nobody could see. If you relight the ladder, the same edit has to
   walk every page's zone classes and this block, or the next person
   reads a number that has not been true for months.

   ------------------------------------------------------------
   COLOUR RULES FOR THIS DIRECTION

   · Blue only. Green appears nowhere in the UI.
     NOTE: the photography does not currently honour this. The 700 m
     and 1100 m plates are gold-green kelp, on the homepage and on
     ingredients.html alike. DEPTH-SPEC.md requires those frames to
     be graded navy. Unresolved, and flagged to the client.
   · The Coral that the SKU system assigns to Joint + Muscle is
     #C15F49, which measures 3.56:1 on deep water and cannot carry
     text there. --td-coral lifts it to #EFA893 for that one band.
   · No muted tint anywhere on a photograph. --st-on-light-mute and
     --st-on-dark-mute both fall under 4.5:1 once a panel is shading
     underneath them, so body copy is always full-strength ink or
     full-strength --st-on-dark-body. This rule is the one the
     product page broke; it is not advisory.
   · --st-deep-cyan is for rules, the squiggle and focus rings on
     light — never for type.

   ------------------------------------------------------------
   CONTRAST — MEASURE IT, DO NOT ESTIMATE IT.

   There is deliberately no table of figures here any more. A panel's
   text sits on a photograph under a scrim over a ladder stop, all
   three of which move independently, and a hardcoded number goes
   stale silently and then lies to the next reader.

   The method that works: screenshot the page twice, once normally
   and once with every text run forced transparent, then sample the
   transparent-text shot at each run's GLYPH rects — not its element
   box, which picks up ::before dots and pill corners outside the
   border radius and invents failures that are not there. Worst
   sample wins. Body 4.5:1, large text 3:1.

   No text on this page is set at reduced opacity.
   ============================================================ */

:root {
  /* ---- the ladder, as CSS ---- */
  /* An even walk, not a cliff. The old ladder spent two stops in daylight
     and then fell to navy at the third, which is why the page read as
     "light, light, black". These step by roughly equal perceptual amounts
     down to d4, and the dark is spent in the last quarter where it belongs. */
  --td-d0: #F2F7F8;   /* 0 m    — near white     */
  --td-d1: #E1ECEF;   /* 12 m                    */
  --td-d2: #CBDFE6;   /* 60 m   — products       */
  --td-d3: #A8C6D4;   /* 200 m  — the dropper    */
  --td-d4: #6E93A8;   /* 700 m  — the light goes */
  --td-d5: #1C3D52;
  --td-d6: #060F1A;   /* --st-abyss */

  /* ---- the light that sits between the type and the water ---- */
  --td-veil: 244, 248, 249;      /* --st-glass-2 as a triple */
  --td-dark: 6, 15, 26;          /* --st-abyss  as a triple */

  /* ---- hairlines ---- */
  --td-line-light: rgba(12, 31, 48, .16);
  --td-line-soft:  rgba(12, 31, 48, .09);
  --td-line-dark:  rgba(199, 242, 234, .22);
  --td-line-dim:   rgba(199, 242, 234, .12);

  /* Joint + Muscle's Coral, lifted off the token so it clears
     4.5:1 on deep water. The token itself is untouched. */
  --td-coral: #EFA893;

  --td-pad:       clamp(88px, 11vw, 176px);
  /* how far each panel rides up into the one above it, and the extra bottom
     padding that keeps that overlap off the copy */
  --td-overlap:   clamp(160px, 18vh, 320px);
  --td-pad-tight: clamp(56px, 7vw, 96px);
  --td-gutter:    clamp(20px, 4vw, 56px);
  --td-nav-h:     70px;

  /* Archivo wants more negative tracking than the shared token
     at display sizes */
  --td-track-display: -.03em;
}

/* ---------------------------------------------------------- base */
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--td-nav-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  /* the ladder as a fallback field, so a slow panel never flashes
     white and the page is the right colour at every scroll depth
     before the images arrive */
  background: linear-gradient(180deg,
              var(--td-d0) 0%, var(--td-d1) 14%, var(--td-d2) 32%,
              var(--td-d3) 52%, var(--td-d4) 72%, var(--td-d5) 88%,
              var(--td-d6) 100%);
  color: var(--st-on-light);
  font-family: var(--st-font-ui);
  font-size: var(--st-size-body);
  font-weight: var(--st-fw-reg);
  line-height: var(--st-lead-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p, figure, dl, dd, dt, figcaption { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }

.td-mono {
  font-family: var(--st-font-data);
  font-weight: var(--st-fw-reg);
  font-variant-numeric: tabular-nums;
}

.td-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* tokens.css sets the focus ring to --st-glow, which is a mint on a
   pale field. Correct it per zone: cyan on light water, mint on deep. */
:focus-visible { outline-color: var(--st-deep-cyan); }
.td-deep :focus-visible,
.td-footer :focus-visible,
.td-skip:focus-visible { outline-color: var(--st-glow); }

.td-skip {
  position: absolute; left: 16px; top: -80px; z-index: 120;
  padding: 12px 20px; border-radius: var(--st-r-pill);
  background: var(--st-navy); color: var(--st-on-dark);
  font-size: var(--st-size-small); text-decoration: none;
  transition: top var(--st-dur-base) var(--st-ease);
}
.td-skip:focus { top: 16px; }

.td-wrap {
  position: relative; z-index: 2;
  width: min(100% - (var(--td-gutter) * 2), var(--st-container));
  margin-inline: auto;
}

.td-sep {
  display: inline-block; width: 3px; height: 3px; border-radius: 50%;
  background: currentColor; opacity: .55;
  margin-inline: 12px; vertical-align: middle;
}

/* ---------------------------------------------------------- type */
.td-h2 {
  font-family: var(--st-font-ui);
  font-weight: var(--st-fw-med);
  font-size: var(--st-size-h2);
  line-height: 1.12;
  letter-spacing: var(--td-track-display);
  color: var(--st-on-light);
  max-width: 19ch;
  text-wrap: balance;
}
.td-h2--dark { color: var(--st-on-dark); }

.td-body {
  font-size: var(--st-size-body-lg);
  line-height: 1.6;
  color: var(--st-on-light);            /* full ink: see COLOUR RULES */
  max-width: 54ch;
}
.td-body--dark { color: var(--st-on-dark-body); }

.td-squiggle {
  display: block; width: 56px; height: 10px;
  color: var(--st-deep-cyan);
}
.td-squiggle--foam { color: var(--st-glow); }

/* ---------------------------------------------------------- buttons */
.td-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 54px; padding-inline: var(--st-8);
  border: 1px solid transparent; border-radius: var(--st-r-pill);
  font-family: var(--st-font-ui);
  font-size: .78rem; font-weight: var(--st-fw-med);
  letter-spacing: var(--st-track-button); text-transform: uppercase;
  text-decoration: none; cursor: pointer;
  transition: background-color var(--st-dur-base) var(--st-ease),
              border-color var(--st-dur-base) var(--st-ease),
              color var(--st-dur-base) var(--st-ease),
              transform var(--st-dur-base) var(--st-ease-out);
}
.td-btn--solid { background: var(--st-navy); color: var(--st-on-dark); }   /* 16.0:1 */
.td-btn--solid:hover { background: var(--st-navy-raised); transform: translateY(-2px); }

.td-btn--line {
  background: transparent; color: var(--st-on-light);
  border-color: rgba(12, 31, 48, .38);
}
.td-btn--line:hover { border-color: var(--st-navy); background: rgba(255, 255, 255, .34); }

/* on deep water a navy pill disappears — this is the white one */
.td-btn--foam { background: #FFFFFF; color: var(--st-navy); }              /* 16.0:1 */
.td-btn--foam:hover {
  background: var(--st-foam); color: var(--st-navy);                       /* 13.0:1 */
  transform: translateY(-2px);
}

.td-btn--sm { min-height: 46px; padding-inline: var(--st-6); font-size: .72rem; }
.td-btn--lg { min-height: 62px; padding-inline: var(--st-10); }

/* ---------------------------------------------------------- nav
   Transparent on the bright surface, navy once the page has sunk
   past the waterline. app.js flips .is-deep at the 60 m seam. */
.td-nav {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  background: rgba(244, 248, 249, .74);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: background-color var(--st-dur-slow) var(--st-ease),
              border-color var(--st-dur-slow) var(--st-ease),
              color var(--st-dur-slow) var(--st-ease);
}
.td-nav__inner {
  min-height: var(--td-nav-h);
  display: flex; align-items: center; gap: clamp(12px, 2vw, 28px);
}
.td-nav__brand {
  display: inline-flex; align-items: center; gap: var(--st-3);
  min-height: 44px; text-decoration: none; color: var(--st-on-light);
}
.td-nav__emblem { width: 34px; height: 34px; color: var(--st-deep-cyan); flex: none; }
/* the one place the serif is allowed: the wordmark, matched to the bottle */
.td-nav__word { font-size: 1.04rem; font-weight: var(--st-fw-med); }

.td-nav__links {
  display: flex; gap: clamp(18px, 2.2vw, 30px); margin-inline: auto;
  font-size: var(--st-size-eyebrow); font-weight: var(--st-fw-med);
  letter-spacing: var(--st-track-eyebrow); text-transform: uppercase;
}
.td-nav__links a {
  text-decoration: none; color: var(--st-on-light);
  padding-block: var(--st-3);
  transition: color var(--st-dur-base) var(--st-ease);
}
.td-nav__links a:hover { color: var(--st-deep-cyan); }
/* the page you are already on. The site is small enough that the nav is the
   only wayfinding it has, so the current destination has to look spent
   rather than offered — same cyan the hover uses, held permanently. */
.td-nav__links a[aria-current="page"] { color: var(--st-deep-cyan); }

.td-nav__depth {
  display: none;
  font-size: .72rem; letter-spacing: .1em;
  color: var(--st-on-light);
}
.td-nav__cta { flex: none; }

/* sunk past the waterline */
.td-nav.is-deep {
  background: rgba(10, 27, 42, .82);
  border-bottom-color: var(--td-line-dim);
}
.td-nav.is-deep .td-nav__brand,
.td-nav.is-deep .td-nav__links a,
.td-nav.is-deep .td-nav__depth { color: var(--st-on-dark); }        /* 17.45:1 */
.td-nav.is-deep .td-nav__emblem { color: var(--st-glow); }
.td-nav.is-deep .td-nav__links a:hover,
.td-nav.is-deep .td-nav__links a[aria-current="page"] { color: var(--st-glow); }
.td-nav.is-deep .td-btn--solid { background: #FFFFFF; color: var(--st-navy); }
.td-nav.is-deep .td-btn--solid:hover { background: var(--st-foam); }
.td-nav.is-deep :focus-visible { outline-color: var(--st-glow); }

/* ---------------------------------------------------------- depth gauge
   The instrument that makes six photographs read as one column of
   water. aria-hidden: every zone it names is a real heading below. */
.td-gauge {
  position: fixed; z-index: 55;
  right: clamp(14px, 2.2vw, 34px); top: 50%;
  transform: translateY(-50%);
  /* Reserved width. Without it the box shrink-wraps its widest child — the
     depth reading — so the rail drifted sideways every time the number
     gained a digit. Wide enough for "1100 m". */
  width: 4.5rem;
  display: none;
  flex-direction: column; align-items: center; gap: var(--st-3);
  transition: color var(--st-dur-slow) var(--st-ease);
  /* the rail is interactive now; the reading and the zone name are not */
  pointer-events: none;
  /* LEGIBILITY ON PHOTOGRAPHY. The gauge used to run at --st-on-light, the
     navy ink the rest of the page uses, which measured 3.3:1 against the
     mid-tone water in the 200 m and 400 m panels. At 9-13px with this much
     letter-spacing that was not readable. No scrim and no halo: the gauge is
     an instrument floating in the water and it stays one. It runs pure black
     instead, which is the darkest the panel can go and takes the same
     measurement to 4.2:1. */
  color: #000;
}
.td-gauge__rail { pointer-events: auto; }
.td-gauge.is-deep { color: var(--st-glow); }

.td-gauge__read {
  font-size: .82rem; letter-spacing: .04em;
  display: flex; align-items: baseline; justify-content: center; gap: 2px;
  /* The instrument must not move while it reads. The number runs 0 -> 1100,
     so without a reserved width and tabular figures the box grows, and
     because the gauge is pinned by its RIGHT edge the rail slides left on
     every change. Fixed width + tabular digits: the rail never moves. */
  width: 100%;
  font-variant-numeric: tabular-nums;
}
.td-gauge__unit { font-size: .62rem; opacity: .8; }

.td-gauge__rail {
  position: relative;
  width: 1px; height: clamp(140px, 22vh, 220px);
  background: currentColor;
  opacity: .50;
}
.td-gauge.is-deep .td-gauge__rail { opacity: .60; }
/* ---- the stops. Each one is a real link to a section on this page, so the
   gauge is the page's table of contents as well as its depth instrument.

   The label sits OUTSIDE the gauge's reserved width, hanging to the left of
   the rail. That is deliberate: the gauge is pinned by its right edge and its
   4.5rem box exists to stop the rail sliding when the depth reading gains a
   digit. Letting labels grow inside that box would reintroduce exactly the
   drift the reserved width was added to prevent, so they are positioned
   absolutely and take part in no layout at all.

   They are quiet until you go looking — .34 at rest, full strength on hover,
   focus, or when you are inside that section. A permanent list of six labels
   down the right edge would compete with the page; a rail that answers when
   asked does not. ---- */
.td-gauge__stop {
  position: absolute; right: -3px;
  top: calc(var(--t) * 100%);
  display: flex; align-items: center; justify-content: flex-end;
  gap: 8px;
  width: 7px; height: 1px;
  color: inherit; text-decoration: none;
  pointer-events: auto;
}
.td-gauge__stop::after {
  /* The tick itself, drawn at its FULL length and scaled down at rest rather
     than grown on hover. Transitioning width would put a layout pass on every
     frame of a hover that can fire six times as the pointer crosses the rail;
     scaleX is composited and costs nothing. Origin right, because the tick
     hangs off the rail and has to extend leftward into the margin. */
  content: ""; flex: none;
  width: 13px; height: 1px;
  background: currentColor;
  transform: scaleX(.538);              /* 7 of 13 */
  transform-origin: right center;
  transition: transform var(--st-dur-base) var(--st-ease);
}
.td-gauge__stop-label {
  position: absolute; right: 14px;
  font-size: .64rem; letter-spacing: .12em; text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(4px);
  transition: opacity var(--st-dur-base) var(--st-ease),
              transform var(--st-dur-base) var(--st-ease);
}
.td-gauge__stop:hover::after,
.td-gauge__stop:focus-visible::after,
.td-gauge__stop.is-here::after { transform: scaleX(1); }

.td-gauge__stop:hover .td-gauge__stop-label,
.td-gauge__stop:focus-visible .td-gauge__stop-label,
.td-gauge__stop.is-here .td-gauge__stop-label {
  opacity: 1; transform: none;
}
/* hovering anywhere on the instrument offers the whole menu at once */
.td-gauge:hover .td-gauge__stop-label { opacity: .62; transform: none; }
.td-gauge:hover .td-gauge__stop:hover .td-gauge__stop-label,
.td-gauge:hover .td-gauge__stop.is-here .td-gauge__stop-label { opacity: 1; }

.td-gauge__stop:focus-visible {
  outline: 2px solid currentColor; outline-offset: 6px;
}
.td-gauge__dot {
  position: absolute; left: 50%;
  top: calc(var(--p, 0) * 100%);
  width: 7px; height: 7px; margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 1;
  transition: top 120ms linear;
}
.td-gauge__zone {
  font-size: .6rem; letter-spacing: .14em; text-transform: uppercase;
  writing-mode: vertical-rl;
  /* Fixed, not max-: the zone names are different lengths ("Surface",
     "Shallows", "The column", "The floor"), so a shrink-to-fit height
     changed the column's total height on every zone change and the whole
     gauge re-centred. A reserved height holds every part still. */
  height: 14ch; overflow: hidden;
  white-space: nowrap;
}

@media (min-width: 1180px) {
  .td-gauge { display: flex; }
  /* The gauge is fixed in the right margin, and the depth mark runs the
     full width of the panel — so above this width the mark's reading
     collided with the gauge's. Hold the mark clear of the gauge column:
     its right offset (max 34px), its own width, and a gap. */
  .td-mark { padding-right: clamp(96px, 9vw, 132px); }
}
@media (max-width: 1179px) {
  .td-nav__depth { display: block; margin-left: auto; }
  .td-nav__links { margin-inline: 0; }
}

