/* ---- the scale: the three widest bands carry their count ---- */
.td-dose__tick {
  position: absolute;
  left: var(--c); top: 74%;
  transform: translateX(-50%);
  font-size: .7rem; letter-spacing: .04em;
  color: var(--st-on-dark-body);                            /* 9.07:1 */
  transition: color var(--st-dur-base) var(--st-ease);
}
.td-dose__tick::before {
  content: "";
  position: absolute; left: 50%; bottom: calc(100% + 4px);
  /* the stub used to run 6-12px and stopped well short of the tube, so the
     six counts floated in open water under a drawing they belong to. It now
     reaches the bore it names. */
  width: 1px; height: clamp(16px, 2.4vw, 34px);
  background: var(--td-line-dark);
  transition: background-color var(--st-dur-base) var(--st-ease);
}
.td-dose__tick.is-lit { color: var(--st-glow); }
.td-dose__tick.is-lit::before { background: var(--st-glow); }
.td-dose.is-lensed .td-dose__tick:not(.is-lit) { color: var(--st-on-dark-mute); }

/* ---- the callout: what a selected band actually is, above the glass,
   on a leader down to the band it names ---- */
.td-dose__leader {
  position: absolute;
  left: var(--c, 50%); top: -14px;
  width: 1px; height: calc(50% + 14px);
  background: linear-gradient(180deg,
    var(--cc, var(--st-glow)) 0%, transparent 100%);
  opacity: 0;
  transition: opacity var(--st-dur-base) var(--st-ease),
              left var(--st-dur-slow) var(--st-ease-out);
}
/* The number stacks ABOVE its label rather than sitting beside it, so the
   count lands square on the leader and therefore square on its band. Set
   inline, the leader dropped from the middle of "40+ TRACE MINERALS" —
   between the two words — and the number read as floating off to one side.

   The clamp keeps the block on the page for the bands at 88–98% of the
   run without moving the leader, which stays on the band's true centre. */
.td-dose__callout {
  position: absolute;
  left: clamp(96px, var(--c, 50%), calc(100% - 96px));
  bottom: calc(100% + 18px);
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center;
  gap: 6px;
  white-space: nowrap; text-align: center;
  opacity: 0;
  transition: opacity var(--st-dur-base) var(--st-ease),
              left var(--st-dur-slow) var(--st-ease-out);
  pointer-events: none;
}
.td-dose.is-called .td-dose__callout,
.td-dose.is-called .td-dose__leader { opacity: 1; }
/* the callout takes its band's own colour, so the eye connects the number
   above the glass to the colour inside it without reading a word */
.td-dose__callout-n {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  line-height: 1;
  color: var(--cc, var(--st-glow));      /* every band clears 7:1 on the column */
}
.td-dose__callout-l {
  font-size: .72rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--st-on-dark);
}

.td-dose__cap {
  margin-top: clamp(18px, 2.4vw, 28px);
  font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--st-on-dark-body);
}

/* ---- the key: every one of the six in readable text, and the control
   that drives the glass ---- */
.td-dose__key {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: clamp(24px, 3.5vw, 56px);
  margin-top: clamp(26px, 3.2vw, 40px);
}
.td-dose__grp {
  display: grid;
  grid-template-columns: 16px 3.6ch minmax(0, 1fr);
  align-items: baseline; gap: var(--st-4);
  width: 100%;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--td-line-dim);
  background: transparent;
  text-align: left; cursor: pointer;
  transition: background-color var(--st-dur-base) var(--st-ease);
}
/* the swatch: the same 16px hairline the ledger rows use, but carrying its
   band's colour, because colour is what identifies a group in the glass */
.td-dose__grp::before {
  content: "";
  grid-column: 1;
  align-self: center;
  width: 16px; height: 3px;
  background: var(--sw);
  transition: box-shadow var(--st-dur-base) var(--st-ease),
              opacity var(--st-dur-base) var(--st-ease);
}
.td-dose__key li:nth-child(1) .td-dose__grp { --sw: var(--td-sw1); }
.td-dose__key li:nth-child(2) .td-dose__grp { --sw: var(--td-sw2); }
.td-dose__key li:nth-child(3) .td-dose__grp { --sw: var(--td-sw3); }
.td-dose__key li:nth-child(4) .td-dose__grp { --sw: var(--td-sw4); }
.td-dose__key li:nth-child(5) .td-dose__grp { --sw: var(--td-sw5); }
.td-dose__key li:nth-child(6) .td-dose__grp { --sw: var(--td-sw6); }
.td-dose__n {
  font-size: .86rem; text-align: right;
  color: var(--st-on-dark);
  transition: color var(--st-dur-base) var(--st-ease);
}
.td-dose__l {
  font-size: .78rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--st-on-dark-body);
  transition: color var(--st-dur-base) var(--st-ease);
}
.td-dose__grp:hover { background: rgba(199, 242, 234, .05); }
.td-dose__grp:hover .td-dose__n,
.td-dose__grp:hover .td-dose__l { color: var(--st-on-dark); }
.td-dose__grp:focus-visible { outline: 2px solid var(--st-glow); outline-offset: 2px; }

.td-dose__grp.is-marked .td-dose__n,
.td-dose__grp.is-marked .td-dose__l,
.td-dose__grp[aria-pressed="true"] .td-dose__n,
.td-dose__grp[aria-pressed="true"] .td-dose__l { color: var(--st-glow); }
.td-dose__grp.is-marked::before,
.td-dose__grp[aria-pressed="true"]::before {
  box-shadow: 0 0 0 1px rgba(6, 15, 26, .9), 0 0 0 3px var(--sw);
}
.td-dose__grp[aria-pressed="true"] { background: rgba(140, 230, 216, .09); }

/* ---- the one authored moment on this panel: the dose is drawn, from
   the tip back toward the bulb, the first time the glass is seen ---- */
/* The reveal is a CSS clip-path on the SVG element itself. Animating a
   transform on a <rect> inside a <clipPath> froze the referencing element
   mid-wipe and left the first and largest band permanently unpainted;
   clip-path on the host element repaints reliably. Left inset 100% -> 0
   grows the window leftward FROM the tip, which is the direction a dropper
   actually fills. */
html.td-js .td-dose__liquid {
  clip-path: inset(0 0 0 99%);
  transition: clip-path 1100ms var(--st-ease-out);
}
html.td-js .td-dose.is-drawn .td-dose__liquid { clip-path: inset(0 0 0 0); }

@media (prefers-reduced-motion: reduce) {
  html.td-js .td-dose__liquid { clip-path: none; transition: none; }
}

.td-uncounted { margin-top: clamp(28px, 3.5vw, 40px); }
.td-uncounted__h {
  font-size: .68rem; font-weight: var(--st-fw-med);
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--st-on-dark-body);
}
.td-uncounted__list {
  display: flex; flex-wrap: wrap; gap: var(--st-2) var(--st-6);
  margin-top: var(--st-4);
  font-size: .82rem;
  color: var(--st-on-dark);
}
.td-uncounted__list li { display: flex; align-items: center; gap: var(--st-3); }
.td-uncounted__list li::before {
  content: ""; width: 4px; height: 4px; border-radius: 50%; flex: none;
  background: rgba(185, 203, 214, .55);
  transition: background-color var(--st-dur-base) var(--st-ease);
}
.td-uncounted__list li.is-marked { color: var(--st-glow); }
.td-uncounted__list li.is-marked::before { background: var(--st-glow); }

/* ---- the four the label names without a count, set as a register ----
   These four are the same class of object as the six in the key above them:
   nutrient groups printed on the same label, marked by the same control.
   They were a wrapped row of dotted chips, which read as a footnote to the
   key instead of as the rest of it, and left four loose items floating in
   the gap between two much heavier objects.

   They now run as one row of four on the key's own rhythm: the same 16px
   mark, the same uppercase label at the same size, the same 12px row
   padding, the same hairline. The mark is hollow at rest because these four
   have no band in the glass, which is what the heading above them says, and
   it fills when the theme control marks them. The Joint + Muscle list on the
   midnight panel is six names with no counts and no themes, so it keeps the
   chip treatment and this is scoped to the dose. */
.td-dose .td-uncounted { margin-top: clamp(34px, 4.2vw, 52px); }
.td-dose .td-uncounted__h { font-size: .72rem; letter-spacing: .18em; }
.td-dose .td-uncounted__list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: clamp(24px, 3.5vw, 56px);
  row-gap: 0;
  margin-top: var(--st-4);
}
.td-dose .td-uncounted__list li {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: var(--st-4);
  padding: 12px 0;
  border-top: 1px solid var(--td-line-dim);
  /* Mono, because these four are label data like every other count on this
     panel. Archivo made them read as prose sitting in a table of readings. */
  font-family: var(--st-font-data);
  font-size: .78rem; letter-spacing: .1em; text-transform: uppercase;
}
.td-dose .td-uncounted__list li::before {
  width: 16px; height: 3px; border-radius: 0;
}

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

.td-inside__foot {
  margin-top: clamp(36px, 4.5vw, 56px);
  padding-top: var(--st-6);
  border-top: 1px solid var(--td-line-dim);
  font-size: var(--st-size-small);
  color: var(--st-on-dark-body);
  max-width: 68ch;
}

/* ============================================================ 700 m — ORIGIN */
.td-mid__head { max-width: 60ch; }
.td-mid__head .td-body { margin-top: var(--st-6); }

/* three statements descending — each one further down the column than
   the last, which is the section's whole argument */
.td-descent { margin-top: clamp(56px, 7vw, 96px); }
.td-descent__step {
  padding: clamp(24px, 3vw, 36px) 0;
  border-top: 1px solid var(--td-line-dim);
  display: grid;
  grid-template-columns: minmax(0, 16ch) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 64px);
  align-items: baseline;
  margin-left: 0;
}
.td-descent__step:nth-child(2) { margin-left: clamp(0px, 6vw, 96px); }
.td-descent__step:nth-child(3) { margin-left: clamp(0px, 12vw, 192px); }
.td-descent__h {
  font-family: var(--st-font-ui);
  font-weight: var(--st-fw-med);
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  line-height: 1.15;
  letter-spacing: -.022em;
  color: var(--st-on-dark);
}
.td-descent__p {
  font-size: var(--st-size-body-lg);
  line-height: 1.6;
  color: var(--st-on-dark-body);
  max-width: 50ch;
}

.td-mid__signoff {
  margin-top: clamp(48px, 6vw, 80px);
  font-size: .74rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--st-glow);
  text-align: center;
}

/* ============================================================ THE FLOOR */
.td-depth--floor { padding-block: clamp(96px, 12vw, 180px); }
.td-close {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
}
.td-close__emblem { width: 58px; height: 58px; color: var(--st-glow); }
.td-close__h {
  margin-top: var(--st-8);
  font-family: var(--st-font-ui);
  font-weight: var(--st-fw-med);
  font-size: clamp(2.4rem, 6vw, 4.75rem);
  line-height: 1.02;
  letter-spacing: -.036em;
  color: var(--st-on-dark);
  max-width: 16ch;
  text-wrap: balance;
}
.td-close__lede {
  margin-top: var(--st-6);
  font-size: var(--st-size-body-lg);
  line-height: 1.6;
  color: var(--st-on-dark-body);
  max-width: 52ch;
}
/* the reveal pins transform:none when it lands, which would cancel the
   button's own hover lift — so it sits on this wrapper instead */
.td-close__act { margin-top: var(--st-10); }

/* ---------------------------------------------------------- footer */
/* The footer is not a panel, so it never got a dissolve — and the seabed
   plate was still showing above its hard top edge, which drew the last line
   on the page. Same treatment as a panel: ride up into the floor by the
   overlap, take that distance back as padding so the columns do not move,
   and start the background transparent so the plate above dissolves into it
   rather than stopping against it. */
.td-footer {
  position: relative;
  margin-top: calc(var(--td-overlap) * -1);
  background: linear-gradient(to bottom,
    rgba(6, 15, 26, 0) 0,
    var(--td-d6) var(--td-overlap),
    var(--td-d6) 100%);
  color: var(--st-on-dark);
  padding-top: calc(clamp(72px, 9vw, 120px) + var(--td-overlap));
}
/* the floor is the last panel, so :has(+ .td-depth) misses it */
.td-depth--floor {
  padding-bottom: calc(var(--td-pad) + var(--td-overlap));
}
.td-footer__inner {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: clamp(40px, 6vw, 96px);
  padding-bottom: clamp(56px, 7vw, 88px);
}
.td-footer__crest { max-width: 34ch; }
.td-footer__emblem { width: 50px; height: 50px; color: var(--st-glow); }
/* the wordmark, in the serif, matched to the bottle */
.td-footer__word { margin-top: var(--st-6); font-size: clamp(1.75rem, 3.4vw, 2.5rem); }
.td-footer__crest .td-squiggle { margin-top: var(--st-6); }
.td-footer__tag {
  margin-top: var(--st-6);
  font-size: var(--st-size-small);
  color: var(--st-on-dark-body);
}

.td-footer__cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--st-8); }
.td-footer__colh {
  font-size: var(--st-size-eyebrow); font-weight: var(--st-fw-med);
  letter-spacing: var(--st-track-eyebrow); text-transform: uppercase;
  color: var(--st-glow);
  margin-bottom: var(--st-3);
}
.td-footer__col a {
  display: inline-block;
  padding-block: 11px;
  text-decoration: none; font-size: var(--st-size-small);
  color: var(--st-on-dark-body);                            /* 11.5:1 */
  transition: color var(--st-dur-base) var(--st-ease);
}
.td-footer__col a:hover { color: var(--st-glow); }

.td-footer__legal {
  border-top: 1px solid var(--td-line-dim);
  padding-block: var(--st-8) var(--st-12);
}
.td-disclaimer {
  max-width: 78ch; font-size: .78rem; line-height: 1.6;
  color: var(--st-on-dark-body);
}
.td-footer__base {
  display: flex; flex-wrap: wrap; align-items: center;
  margin-top: var(--st-6);
  font-size: .72rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--st-on-dark-body);
}
/* the studio credit sits at the far right of the line; on a narrow screen it
   wraps to its own line and stays right-aligned */
.td-footer__credit { margin-left: auto; padding-left: var(--st-6); }
.td-footer__base a {
  color: inherit;
  text-decoration: underline; text-underline-offset: 3px;
  transition: color var(--st-dur-base) var(--st-ease);
}
.td-footer__base a:hover { color: var(--st-glow); }

/* ---------------------------------------------------------- reveal */
html.td-js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--st-dur-tide) var(--st-ease-out),
              transform var(--st-dur-tide) var(--st-ease-out);
  transition-delay: calc(var(--d, 0) * 90ms);
}
html.td-js [data-reveal].is-in { opacity: 1; transform: none; }

