/* ============================================================ responsive */
@media (max-width: 1080px) {
  .td-nav__links { display: none; }
  .td-inside__grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .td-dose__key { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .td-dose__key { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 940px) {
  .td-hero { grid-template-columns: minmax(0, 1fr); gap: var(--st-10); min-height: 0; }
  .td-hero__media { order: -1; }
  .td-hero__media img { height: clamp(260px, 40vh, 400px); }
  /* one column puts the copy across the whole panel, so the veil goes flat
     rather than side-weighted. Kept as light as the floor allows: .56 over
     panel 01 at its darkest still measures 10.9:1 to the ink, and anything
     heavier turns the phone's first viewport into a plain white page. */
  .td-depth__scrim--surface {
    background: linear-gradient(180deg,
      rgba(var(--td-veil), .16) 0,
      rgba(var(--td-veil), .10) 420px,
      rgba(var(--td-veil), .66) 560px,
      rgba(var(--td-veil), .60) 100%);
  }
  /* Stretched over the whole tall panel, the wave photograph enlarged into
     soft blobs and read as clouds. Held to the top of the panel it stays a
     wave, breaking behind the bottle, and the panel's light takes over
     under the copy. */
  .td-depth--surface .td-depth__img {
    top: 0; height: 640px;
    object-position: 50% 70%;
    filter: none;
  }
  /* below the wave the water carries on, using the next panel's photograph
     under the same veil, so the copy reads and no bare page shows through */
  .td-depth__scrim--surface::before {
    content: "";
    position: absolute; z-index: -1;
    top: 480px; left: 0; right: 0; bottom: 0;
    background:
      linear-gradient(rgba(var(--td-veil), .62), rgba(var(--td-veil), .62)),
      url("/img/depth-02-shallows@m.jpg") center top / cover no-repeat;
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 200px);
            mask-image: linear-gradient(180deg, transparent 0, #000 200px);
  }
  .td-shallows { grid-template-columns: minmax(0, 1fr); gap: var(--st-12); }
  .td-sku__inner { grid-template-columns: minmax(0, 1fr); gap: var(--st-8); }
  .td-sku--jm .td-sku__inner { direction: ltr; }
  .td-sku__media img { height: clamp(240px, 44vw, 340px); }
  .td-sku__media--pending { min-height: clamp(200px, 40vw, 280px); }
  .td-descent__step {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--st-3);
  }
  .td-descent__step:nth-child(2),
  .td-descent__step:nth-child(3) { margin-left: 0; }
  .td-footer__inner { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  /* ---- 15px floor. The client reviews on a phone, so the tracked
     micro-labels that work at desktop size are raised here rather than
     shipped at 11–12px. Two shared tokens are overridden for this page
     only; the rest are the local hard-coded sizes. ---- */
  :root {
    --st-size-small:   .9375rem;   /* 14px -> 15px */
    --st-size-eyebrow: .9375rem;   /* 12px -> 15px */
  }
  .td-facts__row,
  .td-hero__meta,
  .td-stack__lab,
  .td-sku__spec,
  .td-range__note,
  .td-inside__status,
  .td-ledger__h,
  .td-row__common,
  .td-dose__l,
  .td-dose__tick,
  .td-dose__cap,
  .td-dose__callout-l,
  .td-uncounted__h,
  .td-mid__signoff,
  .td-footer__base,
  .td-disclaimer,
  .td-btn,
  .td-btn--sm { font-size: .9375rem; }
  .td-row__latin, .td-dose__n { font-size: .9375rem; }
  .td-mark { font-size: .8125rem; }

  /* the dropper is a 6:1 object, so on a phone the glass is only ~55px
     tall — the scale numbers drop below it and their leader lines go,
     because a 3px line at that size is noise, not a tick. The last three
     centres are 10px apart here, which is closer than the glyphs are
     wide, so they stand down and the key states them instead. */
  .td-dose__stage { padding-bottom: 40px; }
  .td-dose__tick { top: calc(100% + 6px); }
  .td-dose__tick::before { display: none; }
  .td-tick--tight { display: none; }

  .td-row {
    grid-template-columns: 16px minmax(0, 1fr);
    row-gap: 2px;
  }
  .td-row__common { grid-column: 2; text-align: left; }
  .td-hero__h1 br { display: none; }
}

@media (max-width: 520px) {
  .td-hero__actions .td-btn,
  .td-close__act,
  .td-close__act .td-btn { width: 100%; }
  .td-hero__meta { line-height: 2.1; }
  .td-footer__cols { grid-template-columns: repeat(2, 1fr); }
  .td-sku__foot { flex-direction: column; align-items: stretch; }
  .td-sku__foot .td-btn { width: 100%; }
}

@media (max-width: 380px) {
  .td-footer__cols { grid-template-columns: minmax(0, 1fr); }
  .td-nav__word { font-size: .95rem; }
}

/* ---------------------------------------------------------- motion off */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .td-snow { display: none; }
  .td-gauge__dot { transition: none; }
  .td-btn--solid:hover,
  .td-btn--foam:hover { transform: none; }
  html.td-js [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ---- the dropper on daylight -------------------------------------------
   The glass now sits on a pale field, so every mark around it inverts: the
   mono numerals go to ink, the lit state goes from the mint glow to the
   deep cyan that survives on light, and the sheen stops trying to lift a
   black interior it no longer has. Scoped to the column so the dark
   treatment above is still the file's record of how it used to look. */
.td-depth--ledger .td-dose__tick { color: var(--st-on-light-mute); }
.td-depth--ledger .td-dose__tick::before { background: var(--td-line-light); }
.td-depth--ledger .td-dose__tick.is-lit { color: var(--st-deep-cyan); }
.td-depth--ledger .td-dose__tick.is-lit::before { background: var(--st-deep-cyan); }
.td-depth--ledger .td-dose.is-lensed .td-dose__tick:not(.is-lit) { color: var(--st-on-light-mute); }
/* the sheen was switched to soft-light at .55 for a pale field. It does not
   sit on the field — it sits on the black glass, which is black on every page,
   and soft-light there flattened the tube back out. Overlay, as designed. */
.td-depth--ledger .td-ledger__h,
.td-depth--ledger .td-dose__cap,
.td-depth--ledger .td-uncounted__h { color: var(--st-on-light); }
.td-depth--ledger .td-dose__grp,
.td-depth--ledger .td-uncounted__list li { color: var(--st-on-light); }
.td-depth--ledger .td-inside__status { color: var(--st-on-light-mute); }

.td-depth--ledger .td-row { border-bottom-color: var(--td-line-light); }
.td-depth--ledger .td-row__latin { color: var(--st-on-light); }
.td-depth--ledger .td-row__common { color: var(--st-on-light-mute); }
.td-depth--ledger .td-row__mark { background: var(--td-line-light); }
.td-depth--ledger .td-row.is-marked .td-row__mark { background: var(--st-deep-cyan); }
.td-depth--ledger .td-inside__foot { color: var(--st-on-light-mute); }

/* ---- the products band, in daylight ----
   Measured against the pixels behind this copy, which run (143,147,145) to
   (190,178,150): --st-on-light-mute gave 1.96-2.94:1, --st-deep-cyan 2.41:1
   and coral #8F4433 2.43:1. No darker version of any of them clears 4.5:1
   either — deep cyan at #073A42 is still 3.99 and coral at #5A2317 is 4.00.
   On a mid-tone photograph the only readable option is full ink, so every run
   of text here is ink and the SKU colour-coding lives on the marks, the emblem
   and the squiggle, which are graphics and answer to 3:1. */
.td-depth--canopy { --td-coral-mark: #C15F49; }

.td-depth--canopy .td-sku__name,
.td-depth--canopy .td-sku__marks li,
.td-depth--canopy .td-sku__desc,
.td-depth--canopy .td-range__note,
.td-depth--canopy .td-sku__spec,
.td-depth--canopy .td-sku--jm .td-sku__spec,
.td-depth--canopy .td-sku--jm .td-sku__media--pending figcaption { color: var(--st-on-light); }

.td-depth--canopy .td-sku__marks li::before { background: var(--st-deep-cyan); }
.td-depth--canopy .td-sku,
.td-depth--canopy .td-range__note,
.td-depth--canopy .td-sku__foot { border-color: var(--td-line-light); }
.td-depth--canopy .td-sku--jm .td-squiggle { color: var(--td-coral-mark); }
.td-depth--canopy .td-sku--jm .td-sku__marks li::before { background: var(--td-coral-mark); }

/* ---- the ledger panel on daylight — ingredients.html ---------------------
   MARKER CLASS: .td-depth--ledger, carried alongside .td-depth--column on
   the one panel of ingredients.html that holds the theme control, the
   fourteen-ingredient ledger and the dose.

   Why the class exists. The dose is drawn in deep cyans with a multiply
   blend, which only reads over daylight, so that panel has to stay light.
   But every rule the ledger, the key and the theme bar inherit was written
   for deep water: white type, mint accents, mint hairlines, and a dark
   translucent substrate under the chips. On a pale field that is white on
   white, mint on white, and hairlines that are simply not there.

   .td-depth--column already inverts part of it. This block finishes the
   job — it is the delta, not a second copy, so anything the column rules
   above already get right is deliberately absent here. Equal specificity,
   later in the file, so these win where they overlap.

   THE SUBSTITUTION, once: every mint accent (--st-glow, #8CE6D8) becomes
   --st-deep-cyan (#10727F), which is the token that exists precisely
   because mint does not survive on light. Every white (--st-on-dark)
   becomes --st-on-light. Every mint hairline becomes --td-line-light.

   NO MUTED TINT. --st-on-light-mute measures 3.7:1 against this panel's
   water and everything set in it here is small text, so the tint is
   dropped for full ink — the same rule the COLOUR RULES block at the top
   of this file states for the rest of the page. */

/* ---- the field itself.

   The homepage's column panel held one display and ran about 1400px. This
   one holds a control, fourteen rows in two columns, the glass, its key and
   two notes, and runs well over twice that — content from 3% to 92% of the
   panel, with no empty tail to spend a ramp in.

   .td-depth__scrim--column thins its veil from .34 to .10 down the panel and
   lays a dark wash underneath it, so on a panel this tall the last third
   composited to #52-66 grey-blue. Measured off the render, the caption, the
   key labels and the closing note were sitting at 3.05:1 to 4.38:1 — dark
   ink on water that had already gone dark.

   So this panel does not descend; it holds daylight the whole way and the
   700 m panel below takes the step down, which is what that panel is for.
   The veil even strengthens slightly as the plate darkens.

   THE RELEASE IS THE WHOLE PROBLEM. The first version held .56 to 92% and
   then dropped to .20 at 100%, which is a 36-point fall across 8% of a panel
   that runs the better part of 3000px. That reads as a lit shelf with the
   dark cut in underneath it, and no amount of seam mask hides it, because
   the mask dissolves the PHOTOGRAPH and this is the VEIL. The panel and its
   veil are two separate edges and only one of them was being drawn softly.

   So the release now starts at 58% and runs the remaining 42% of the panel,
   which is roughly two overlaps deep. It peaks before the midnight panel
   begins riding up rather than after, so the veil is already thinning by the
   time the dark plate arrives, and the two changes happen together instead
   of in sequence.

   The homepage's scrim is untouched — this is one page-scoped override, and
   .td-depth--ledger appears on ingredients.html and nowhere else. */
.td-depth--ledger .td-depth__scrim--column {
  background: linear-gradient(180deg,
    rgba(var(--td-veil), .34) 0%,
    rgba(var(--td-veil), .46) 26%,
    rgba(var(--td-veil), .54) 58%,
    rgba(var(--td-veil), .46) 76%,
    rgba(var(--td-veil), .28) 88%,
    rgba(var(--td-veil), .10) 96%,
    rgba(var(--td-veil), 0)   100%);
}

/* AND THE PANEL BELOW OPENS TOO FAST FOR THIS JOIN. .td-depth__scrim--midnight
   is graded for the homepage, where 700 m arrives under the canopy panel and
   the water above it is already halfway down the ladder. Here it arrives under
   a panel deliberately held at daylight, so the same .26-to-.62-by-38% ramp is
   a much bigger step: it is doing the whole descent the column panel refused
   to do, over one panel instead of two.

   THE SOFTENING IS CONFINED TO THE TOP TENTH, AND THAT IS DELIBERATE. This
   panel carries its h2 and lede in light type, and the block above already
   records them measuring 3.25:1 desktop and 2.72:1 on a phone against the
   ORIGINAL grade. Copy starts one --td-pad down, which on this section is
   about 11% of its height, so anything that lightens the wash at 11% spends
   contrast that was already marginal.

   The curve therefore runs lighter than the original only across 0-10%, which
   is the band the panel above is still dissolving over and where no copy ever
   sits, then crosses back at 11% and runs slightly DARKER than the original
   from there down. Measured against the original ramp: .364 at 11% before,
   .366 after. The lede does not move. Everything below 38% is unchanged, so
   the section still bottoms out where the floor panel expects to meet it. */
.td-depth--ledger + .td-depth--midnight .td-depth__scrim--midnight {
  background: linear-gradient(180deg,
    rgba(var(--td-dark), .06) 0%,
    rgba(var(--td-dark), .20) 6%,
    rgba(var(--td-dark), .40) 12%,
    rgba(var(--td-dark), .52) 22%,
    rgba(var(--td-dark), .62) 38%,
    rgba(var(--td-dark), .82) 100%);
}

/* the theme bar carries its own substrate because it sits on a photograph.
   Deep water needed a dark wash; daylight needs a white one, or the only
   dark object in a pale section is the control itself. */

/* the pressed chip inverts to solid ink (set by .td-depth--column). The mint
   ring and mint bloom that lit it on deep water have nothing to sit on here. */

/* the status line is read, and it is small: full ink, not the tint */
.td-depth--ledger .td-inside__status { color: var(--st-on-light); }

/* ---- WHAT "MARKED" LOOKS LIKE ON DAYLIGHT.

   On deep water a marked row went mint: --st-glow measures 10:1 there, so
   the accent could carry the type itself. Nothing in this palette does that
   job on light. --st-deep-cyan is the nearest candidate and it measured
   3.51:1 on this water — and the COLOUR RULES at the top of this file
   already say it is for rules, the squiggle and focus rings, never for type.

   So the accent moves off the type and onto the MARKS. A marked row keeps
   full ink and states itself with the leader rule and the wash it sits in;
   a marked key row adds weight, which its fixed grid columns absorb without
   reflowing. Nothing on this panel signals state by giving up contrast. */

/* ---- the fourteen ---- */
.td-depth--ledger .td-ledger__h { border-bottom-color: var(--td-line-light); }
.td-depth--ledger .td-row__common { color: var(--st-on-light); }
.td-depth--ledger .td-row.is-marked { background: rgba(16, 114, 127, .14); }
.td-depth--ledger .td-row.is-marked .td-row__common { color: var(--st-on-light); }

/* ---- the key under the glass ---- */
.td-depth--ledger .td-dose__grp { border-bottom-color: var(--td-line-light); }
.td-depth--ledger .td-dose__n,
.td-depth--ledger .td-dose__l { color: var(--st-on-light); }
.td-depth--ledger .td-dose__grp:hover { background: rgba(16, 114, 127, .07); }
.td-depth--ledger .td-dose__grp:hover .td-dose__n,
.td-depth--ledger .td-dose__grp:hover .td-dose__l { color: var(--st-on-light); }
.td-depth--ledger .td-dose__grp.is-marked .td-dose__n,
.td-depth--ledger .td-dose__grp.is-marked .td-dose__l,
.td-depth--ledger .td-dose__grp[aria-pressed="true"] .td-dose__n,
.td-depth--ledger .td-dose__grp[aria-pressed="true"] .td-dose__l {
  color: var(--st-on-light);
  font-weight: var(--st-fw-med);
}
.td-depth--ledger .td-dose__grp[aria-pressed="true"] { background: rgba(16, 114, 127, .12); }
/* the swatch's selected ring: its inner stop was the abyss, which put a dark
   halo round a small mark on pale water. It becomes the field instead, so
   the ring reads as a gap and the band's own colour is the only thing added. */
.td-depth--ledger .td-dose__grp.is-marked::before,
.td-depth--ledger .td-dose__grp[aria-pressed="true"]::before {
  box-shadow: 0 0 0 1px rgba(244, 248, 249, .95), 0 0 0 3px var(--sw);
}
.td-depth--ledger .td-dose__grp:focus-visible { outline-color: var(--st-deep-cyan); }

/* the scale numbers under the glass. The column rules set the unlit ones in
   --st-on-light-mute and the lit one in deep cyan; both are small mono text
   and both measured under 4.5:1 here. All six stay in full ink and the tick
   RULE above each one — a hairline, not type — carries the lit state. */
.td-depth--ledger .td-dose__tick,
.td-depth--ledger .td-dose.is-lensed .td-dose__tick:not(.is-lit) { color: var(--st-on-light); }
.td-depth--ledger .td-dose__tick.is-lit {
  color: var(--st-on-light);
  font-weight: var(--st-fw-med);
}
.td-depth--ledger .td-dose__tick.is-lit::before { background: var(--st-deep-cyan); }

/* the callout above the glass, and the leader that drops from it to the band
   it names. Both took the selected band's own fill through --cc, which app.js
   reads off the drawing — and those fills are near-white, because they are
   lit THROUGH black glass with a screen blend. Near-white is invisible on
   this water in both roles. The number goes to ink, and the leader takes the
   token that exists for rules on light. The colour link between the callout
   and the glass is carried by the swatch in the key instead. */
.td-depth--ledger .td-dose__callout-n { color: var(--st-on-light); }
.td-depth--ledger .td-dose__leader {
  background: linear-gradient(180deg, var(--st-deep-cyan) 0%, transparent 100%);
}
.td-depth--ledger .td-dose__callout-l { color: var(--st-on-light); }

/* ---- the four the label names without a count ----
   The list itself still inherits white from the deep-water rule; only its
   items were re-inked. Nothing visible sits on the <ul> today, so set it
   too rather than leave a white default waiting for the next child. */
.td-depth--ledger .td-uncounted__list { color: var(--st-on-light); }
.td-depth--ledger .td-uncounted__list li::before { background: rgba(16, 114, 127, .45); }
.td-depth--ledger .td-uncounted__list li.is-marked {
  color: var(--st-on-light);
  font-weight: var(--st-fw-med);
}
.td-depth--ledger .td-uncounted__list li.is-marked::before { background: var(--st-deep-cyan); }

/* the register marks: hollow while the group is unmarked, because these four
   carry no band in the glass, and filled the moment the theme control marks
   them. Written here rather than beside the structure because the rule above
   sets a background these have to win against. */
.td-depth--ledger .td-dose .td-uncounted__list li {
  border-top-color: var(--td-line-light);
}
.td-depth--ledger .td-dose .td-uncounted__list li::before {
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(16, 114, 127, .55);
  transition: background-color var(--st-dur-base) var(--st-ease),
              box-shadow var(--st-dur-base) var(--st-ease);
}
.td-depth--ledger .td-dose .td-uncounted__list li.is-marked::before {
  background: var(--st-deep-cyan);
  box-shadow: inset 0 0 0 1px var(--st-deep-cyan);
}

.td-depth--ledger .td-inside__foot {
  border-top-color: var(--td-line-light);
  color: var(--st-on-light);
}

