/* Litewater — mobile layout pass.

   Site-wide overrides for phones and small tablets. Kept in one file rather
   than in each page's <style> block because the six pages share a header, a
   footer and most band structure, and because the .dc runtime rewrites inline
   style attributes on every state change — a stylesheet rule with !important
   is the only override that survives a re-render.

   Selectors lean on structure (the sections carry inline styles, not classes),
   so they are anchored to a class or an attribute wherever one exists.

   Breakpoints:
     <=900px  tablet / large phone — single column, drawer nav
     <=560px  phone — tighter type and spacing

   The nav drawer itself lives in nav-menu.css alongside the desktop menu. */

/* ==========================================================================
   1. Site-wide
   ========================================================================== */

@media (max-width: 900px) {
  /* The page must never scroll sideways. `clip`, not `hidden`: hidden on body
     makes body a scroll container, which strands the whole page inside an
     812px box and breaks every scroll-driven set piece on the homepage. */
  html, body { overflow-x: clip; }

  :root { --gutter: 20px; --band-y: clamp(48px, 9vw, 80px); }

  /* The fixed vertical wordmark is 58vh tall and sits over the content on a
     phone. It is decorative — the header carries the home link. */
  a[aria-label="Litewater"] { display: none !important; }

  img, video, svg, canvas, iframe { max-width: 100%; }
}

/* ==========================================================================
   2. Homepage — §1 hero
   ========================================================================== */

@media (max-width: 900px) {
  /* The hero is a fixed 100vh-minus-chrome card on desktop with the copy
     centred in it. On a phone it has to share the first screen with the
     announcement bar (37px), the header (45px) and the review ticker that
     follows it (53px) — so the card is sized to what is left, and the copy
     below is trimmed to fit inside that without overflowing it.

     min-height, not height: if the copy ever does outgrow the box the hero
     grows with it rather than clipping, since the card hides its overflow. */
  section:has(> .lw-hero-copy) {
    height: auto !important;
    min-height: calc(100svh - 139px) !important;
    padding: 28px 0 !important;
  }

  /* The copy block is inset 150-210px on desktop to clear the vertical
     wordmark. With that hidden the inset is dead space. */
  .lw-hero-copy {
    padding-left: var(--gutter) !important;
    padding-right: var(--gutter) !important;
    font-size: 16px !important;
  }
  .lw-hero-h1 {
    font-size: clamp(2.5rem, 10.93vw, 3.9rem) !important;
    font-weight: 800 !important;
    letter-spacing: -.02em !important;
    max-width: 15ch !important;
    margin: 10px 0 12px !important;
  }
  .lw-hero-lede {
    font-size: 1rem !important;
    max-width: 42ch !important;
    line-height: 1.45 !important;
    margin: 0 0 40px !important;
  }
  .lw-hero-copy .lw-cta.lg { padding: 13px 26px !important; font-size: 1rem !important; }

  /* The eyebrow is set at the headline's own weight on desktop, where it sits
     in a wide column and reads as a label. Stacked, it ran nearly the full
     width on two lines and competed with the headline — so it drops well
     below the h1's size and reads as the caption it is. */
  .lw-hero-copy .lw-pill {
    font-size: .63rem !important;
    letter-spacing: .06em !important;
    padding: 6px 13px !important;
    margin-bottom: 12px !important;
    /* It is an inline-block, so it only hugs its text while that text fits on
       one line — wrapped, it stretches to the full column and stops reading
       as a caption. The size above is what keeps all 41 characters on one
       line at 375px. */
    white-space: nowrap !important;
  }

  /* Centred stack. The h1 and lede are width-capped, so they need auto
     margins as well as the inherited text-align.

     The copy block is stretched to the full height of the card and its
     content centred inside that, which lets the eyebrow come out of the flow
     and pin to the top of the card while the headline group stays centred. */
  section:has(> .lw-hero-copy) { align-items: stretch !important; }
  /* Anchored to the top rather than centred, so the gaps are set explicitly:
     the eyebrow sits at 28, the headline starts at 90 (a 32px gap, half what
     centring gave), and the lede's bottom margin drops the button/rating pair
     to sit just above the "#1" badge instead of floating mid-card. */
  .lw-hero-copy {
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    /* 46, not the 62 reviewed first: Joey asked for the eyebrow to sit
       closer to the headline (2026-11-18), so the gap under the pill now
       roughly matches the gap above it */
    padding-top: 46px !important;
    /* The "#1" badge is positioned off the card's bottom, so it reserves no
       space and the copy ran straight under it — the rating row sat behind
       the badge on every real phone. This is exactly the badge (35) and its
       offset (20), and no more: at the reviewed 375x812 the card has 56px of
       slack under the rating, so anything larger grows the hero and pushes
       the review ticker out of the first screen. It is a floor, not a gap —
       where there is slack the copy stays top-anchored and none of it shows. */
    padding-bottom: 56px !important;
  }
  .lw-hero-copy .lw-pill {
    position: absolute !important;
    top: 0 !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin: 0 !important;
  }
  .lw-hero-h1,
  .lw-hero-lede { margin-left: auto !important; margin-right: auto !important; }
  /* "by" belongs to "depleting deuterium", not to "cellular energy". Where
     the two land depends on the width and the font size, so the break is set
     here rather than left to the wrap: the tail is one block, so it always
     starts a line and "by" always leads the accent. */
  .lw-hero-tail { display: block; }
  /* the CTA row */
  .lw-hero-copy > div:nth-of-type(1) {
    gap: 10px !important;
    margin-bottom: 9px !important;
    justify-content: center !important;
  }
  /* the star rating row */
  .lw-hero-copy > div:last-child { justify-content: center !important; }


  /* The "#1 most recommended" badge is pinned to the hero's bottom-right
     corner on desktop. Here it is centred under the rating to match the rest
     of the stack, and sized to hug its own text rather than span the card.

     The caption is 41 characters, so keeping it on one line inside a box
     narrower than the card forces the type down to 8px: measured, the run is
     227px at 8px/.04em, which with the "#1", the gap and the padding lands
     the badge at ~283px inside a 343px card. */
  .lw-hero-copy + div {
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    bottom: 20px !important;
    max-width: calc(100% - 2 * var(--gutter)) !important;
    gap: 8px !important;
    padding: 8px 12px !important;
    text-align: center;
  }
  .lw-hero-copy + div span:first-child { font-size: 1.05rem !important; }
  .lw-hero-copy + div span:last-child {
    font-size: .5rem !important;
    letter-spacing: .04em !important;
    white-space: nowrap !important;
  }

  /* The rating is the last thing in the flow; the clearance under it is the
     copy block's padding-bottom above. */
  .lw-hero-copy > div:last-child { margin-bottom: 0 !important; flex-wrap: wrap; }
  .lw-hero-copy > div:last-child span { white-space: normal; }
}

@media (max-width: 560px) {
  /* 41px at 375px — the 36px above plus 5 */
  .lw-hero-h1 { font-size: clamp(2.4rem, 10.93vw, 3.3rem) !important; max-width: 14ch !important; }
  .lw-hero-lede { font-size: .95rem !important; }
  /* Stacked and centred. Side by side, the column only leaves 120px a button,
     which drags the labels down to 10.5px to keep them on one line — stacked,
     they can hold a proper 15px label and a 46px tap target. */
  .lw-hero-copy > div:nth-of-type(1) {
    flex-wrap: wrap !important;
    width: auto !important;
  }
  .lw-hero-copy .lw-cta.lg {
    flex: 0 0 auto !important;
    width: min(292px, 100%) !important;
    padding: 14px 20px !important;
    font-size: .95rem !important;
    white-space: nowrap !important;
  }

  /* The rating is one long run — stars, score and count. Sized to land on a
     single line so "reviews" is not orphaned under a centred row. */
  .lw-hero-copy > div:last-child span { font-size: .95rem !important; letter-spacing: 1px !important; }
  .lw-hero-copy > div:last-child span span { font-size: .82rem !important; }
}

/* ==========================================================================
   3. Homepage — §3 ATP spine
   ==========================================================================
   Desktop is a two-column sticky panel: the motor iframe beside four
   crossfading story beats. Squeezed to a phone the motor column is ~165px
   wide, its control bar wraps over the copy, and the copy runs under it.
   Restacked here as motor over copy inside the same 100vh sticky panel, so
   the scroll choreography in motor-scroll.js keeps working untouched. */

@media (max-width: 900px) {
  .lw-spine { height: 330vh !important; }

  /* the sticky panel */
  .lw-spine > div {
    grid-template-columns: 1fr !important;
    /* The copy block takes exactly the height its tallest beat needs and the
       motor flexes into everything left over, so the panel fills the screen
       on any phone instead of stranding dead space under the paragraph. */
    grid-template-rows: minmax(0, 1fr) auto !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 52px var(--gutter) 26px !important;
  }

  /* The motor page renders its own rpm slider and buttons below the canvas.
     They wrap onto three rows at this width and swamp the model. Crop them
     off by overflowing the iframe past a clipping stage: motor-scroll.js
     still reaches the controls through the DOM, which is all it needs. */
  .lw-spine-stage {
    height: 100% !important;
    min-height: 170px !important;
    overflow: hidden;
  }
  /* the bar wraps to ~184px at this width; measured, not guessed */
  .lw-spine-stage iframe { height: calc(100% + 190px) !important; }

  /* The beats are absolutely stacked inside this wrapper, so it needs a real
     height of its own or it collapses and the panel reads bottom-heavy. */
  .lw-spine-beats { align-self: end !important; }
  /* All four beats are stacked absolutely in this one box, so it has to be as
     tall as the tallest of them (beat 3, "What slows it"). Measured at 375px
     with the type sizes below; shorter beats leave their own slack inside it
     and there is no way around that without four separate boxes. */
  .lw-spine-beats > div {
    min-height: clamp(344px, 43vh, 360px) !important;
    width: 100% !important;
  }
  .lw-spine-beats .lw-eyebrow.is-glass {
    margin: 0 0 14px !important;
    font-size: .64rem !important;
    padding: 6px 14px !important;
  }
  .lw-spine-beats h2 {
    font-size: clamp(1.7rem, 6.9vw, 2.3rem) !important;
    line-height: 1.08 !important;
    margin: 0 0 14px !important;
  }
  /* the beat-2 heading breaks by hand for a wide column */
  .lw-spine-beats h2 br { display: none; }
  .lw-spine-beats p { font-size: 1.06rem !important; line-height: 1.45 !important; }
  /* the research-status footnote in beat 3 */
  .lw-spine-beats p[style*=".8rem"] { font-size: .72rem !important; }
  .lw-spine-beats a { font-size: .84rem !important; padding: 10px 18px !important; }
  .lw-spine-beats > div > div > div:last-child { margin-top: 20px !important; }

  /* the vertical "SCROLL" rail — no room beside the copy at this width
     (7th of the sticky panel's 8 children; the scroll cue is the 8th) */
  .lw-spine > div > div:nth-last-child(2) { display: none !important; }
}

@media (max-width: 560px) {
  .lw-spine-beats h2 { font-size: clamp(1.55rem, 7.5vw, 2rem) !important; }
  .lw-spine-beats p { font-size: 1.02rem !important; }
}

/* ==========================================================================
   3b. Homepage — §2 best sellers carousel
   ==========================================================================
   The track snaps to `start` with a 300px card in a 335px column, so the
   first card sits 17px left of centre and the next one peeks 35px in on one
   side only. Centre-snap it and pad the track by half the leftover on both
   ends, which is what lets the first and last cards reach the middle. The
   card width is capped in vw so it cannot outgrow a narrow phone. */

@media (max-width: 900px) {
  .fyf-scroll {
    --fyf-card: min(300px, 84vw);
    gap: 22px !important;
    padding-top: 6px !important;
    padding-bottom: 20px !important;
    padding-left: calc(50% - var(--fyf-card) / 2) !important;
    padding-right: calc(50% - var(--fyf-card) / 2) !important;
  }
  .fyf-card {
    flex: 0 0 var(--fyf-card) !important;
    scroll-snap-align: center !important;
  }
  /* The arrows are hung 22px outside the track for a desktop band, which puts
     them past both screen edges here — the next one ran to 377px on a 375px
     phone. Tuck them in and take them down from 52px. */
  button[aria-label="Previous products"],
  button[aria-label="Next products"] {
    width: 40px !important;
    height: 40px !important;
    top: 34% !important;
    box-shadow: 0 6px 18px rgba(14,13,69,.22) !important;
  }
  button[aria-label="Previous products"] { left: 2px !important; }
  button[aria-label="Next products"] { right: 2px !important; }
}

/* ==========================================================================
   4. Homepage — section headings
   ==========================================================================
   Four bands (§2 best sellers, §5 offers, §6 comparison, §7 reviews) share a
   hard-coded 3.85rem display heading with -2.2px tracking. At 375px that is
   62px on a 335px column: five or six lines, and the negative tracking closes
   the letters up. Matched on the inline value since the bands carry no class. */

@media (max-width: 900px) {
  h2[style*="3.85rem"] {
    font-size: clamp(1.85rem, 7.6vw, 2.6rem) !important;
    line-height: 1.08 !important;
    letter-spacing: -.03em !important;
  }
  /* §3b "Benefits of deuterium depletion" scales on vh, so it stays huge */
  h2[style*="6.2vh"] {
    font-size: clamp(1.85rem, 7.6vw, 2.6rem) !important;
    margin: 6px 0 26px !important;
  }
  section > div > div[style*="text-align:center"] > p,
  section > div > div[style*="text-align: center"] > p { font-size: 1rem !important; }
}

/* ==========================================================================
   5. Homepage — §3b benefits, §4b timeline, §7b experts
   ==========================================================================
   Three multi-column grids that only ever had a desktop shape. */

@media (max-width: 900px) {
  /* The .dc runtime rewrites inline styles through the CSSOM, which
     normalises them — `.88fr` becomes `0.88fr`, `minmax(0,` becomes
     `minmax(0px,`, commas gain spaces. Selectors below match the *rendered*
     form, not the form written in the markup. */

  /* §3b: features | bottle | features. Anchored on the section rather than
     the grid's own track list, which is the more stable of the two. */
  section[style*="6.4vh"] { min-height: 0 !important; }
  section[style*="6.4vh"] div[style*="grid-template-columns"] {
    /* minmax(0,1fr), not 1fr: the bottle box is sized from its height via
       aspect-ratio, so its min-content width (365px) would otherwise stretch
       the single track wider than the viewport and drag the whole grid with it */
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 30px !important;
  }
  section[style*="6.4vh"] div[style*="aspect-ratio: 3 / 4"] {
    height: auto !important;
    width: min(100%, 290px) !important;
    margin: 0 auto;
  }
  /* the "depleted to 5 PPM" callout is hung 13% off the bottle's right edge */
  section[style*="6.4vh"] div[style*="right: -13%"] { right: 0 !important; }
  section[style*="6.4vh"] div[style*="right: -13%"] span[style*="width: 64px"] {
    width: 22px !important;
  }
  section[style*="6.4vh"] img[alt="Litewater 5 PPM"] {
    height: auto !important;
    max-height: 340px;
  }

  /* §4b timeline: heading + collage beside the dated track. The left column
     is sticky, which in a single stack would pin the heading over the track
     it is meant to introduce. */
  div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  div[style*="grid-template-columns: 1fr 1fr"] > div[style*="sticky"] {
    position: static !important;
  }

  /* §7b experts: portrait beside the quote */
  div[style*="minmax(0px, 0.72fr)"] {
    grid-template-columns: 1fr !important;
    gap: 26px !important;
  }
}

/* ==========================================================================
   5b. Homepage — §4 "two ways to enjoy" band
   ==========================================================================
   Desktop is copy in a left column over a photo: the panel is capped at 54%
   with a 120-260px left indent, and a 90deg white scrim fades the photo out
   behind it. At 375px that 54% is 202px, and the indent eats 148 of them —
   the paragraph gets a 37px column and wraps one word per line, then the
   section's own `overflow: hidden` cuts it off. Full width here, with the
   scrim re-aimed down the page so the copy keeps a ground, and the glass bar
   dropped into normal flow so it cannot sit on top of the text. */

@media (max-width: 900px) {
  section:has(> div[style*="min(760px, 54%)"]) {
    min-height: 0 !important;
    overflow: visible !important;
  }
  /* The photo stays a full-bleed background, as on desktop, and nothing is
     laid over it: the 90deg scrim was tuned for copy in a left column, so
     once the copy spans the full width it veiled the whole picture. Instead
     the copy gets its own white card near the foot of the section, which
     leaves the photo clean above it and needs no wash and no text-shadow. */
  div[style*="rgba(255, 255, 255, 0.96) 0%"] { display: none !important; }
  section:has(> div[style*="min(760px, 54%)"]) {
    justify-content: flex-end !important;
    min-height: clamp(430px, 66vh, 620px) !important;
  }
  /* The bottle is the subject and `cover` could never show it. Both shots are
     2400x1151, near 2.1:1, and covering a 375-wide portrait section crops a
     ~600px-wide slot out of the middle of them — the bottle sits in the
     bottom right of the wide shot, so it fell outside the slot horizontally
     AND sat behind the copy card vertically. No pan fixes that; the photo has
     to stop covering the section. It runs as a landscape band across the top
     instead, sized by height and hung on the right edge, which frames her and
     the bottle together, and the card overlaps its last 50px so the glass
     still has a picture behind it. The band is masked out over its final
     50px rather than cut, or its bottom edge draws a hard line either side
     of the card. Below it the section's own #dfeef7 carries the rest. */
  div[style*="holding litewater wide.webp"],
  div[style*="pour water kitchen.webp"] {
    background-size: auto 250px !important;
    background-position: right top !important;
    -webkit-mask-image: linear-gradient(180deg, #000 0, #000 200px, transparent 250px);
    mask-image: linear-gradient(180deg, #000 0, #000 200px, transparent 250px);
  }
  /* same glass as the bar below it: 42% white, 20px blur, saturate 160% */
  div[style*="min(760px, 54%)"] {
    width: auto !important;
    max-width: 100% !important;
    /* top margin is the window onto the photo band, less the 50px the card
       overlaps it; bottom is the gap to the bar */
    margin: 200px var(--gutter) 18px !important;
    padding: 18px 18px 20px !important;
    background: rgba(255,255,255,.58) !important;
    backdrop-filter: saturate(160%) blur(20px) !important;
    -webkit-backdrop-filter: saturate(160%) blur(20px) !important;
    border: 1px solid rgba(255,255,255,.6) !important;
    border-radius: 18px !important;
    box-shadow: 0 16px 40px rgba(14,13,69,.14) !important;
  }
  /* Both methods ride one flex track twice the card wide and slid sideways
     by the toggle, so the card was always as tall as the taller of the two:
     Method 2's ratio table left ~150px of dead glass under Method 1's three
     lines, and the clipped left edge of Method 2's eyebrow and heading bled
     a seam down the card's right side. Show one method at a time and the
     card is only as tall as what is on screen. The selectors read the
     track's own inline transform — the only place wayIdx lands in the DOM. */
  div[style*="min(760px, 54%)"] div[style*="width: 200%"] {
    width: 100% !important;
    transform: none !important;
  }
  div[style*="min(760px, 54%)"] div[style*="width: 200%"] > div {
    flex: 0 0 100% !important;
    width: 100% !important;
  }
  div[style*="min(760px, 54%)"] div[style*="translateX(0%)"] > div:nth-child(2),
  div[style*="min(760px, 54%)"] div[style*="translateX(-50%)"] > div:nth-child(1) {
    display: none !important;
  }

  /* the card was 491px of the 697px section — trimmed so the photo gets a
     real showing above it without the band growing overall */
  div[style*="min(760px, 54%)"] .lw-eyebrow.is-glass-lite {
    margin-bottom: 12px !important;
  }
  /* the heading takes the hero accent's blue glass — same gradient and inset
     highlight as .lw-hero-accent, and deliberately no backdrop-filter: on
     text that breaks across lines the browser filters one rectangle covering
     every fragment and drops a slab over the gap. `fit-content` keeps the
     panel on the type instead of stretching the card. */
  div[style*="min(760px, 54%)"] h3 {
    font-size: 1.62rem !important;
    margin-bottom: 12px !important;
    align-self: flex-start !important;
    width: fit-content !important;
    color: #fff !important;
    background: linear-gradient(180deg, rgba(0,174,239,.88), rgba(0,174,239,.68));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 6px 18px rgba(14,13,69,.18);
    padding: 8px 14px !important;
    border-radius: 12px;
  }
  div[style*="min(760px, 54%)"] h3 + div {
    font-size: 1.05rem !important;
    margin-bottom: 7px !important;
  }
  /* slate on translucent glass over a photo was the unreadable pairing */
  div[style*="min(760px, 54%)"] p {
    font-size: .95rem !important;
    color: var(--navy,#0E0D45) !important;
    font-weight: 500 !important;
  }
  /* the glass bar is hung on the foot of the photo; in flow it stacks under */
  section:has(> div[style*="min(760px, 54%)"]) > div[style*="z-index: 3"] {
    position: static !important;
    flex-direction: column !important;
    gap: 12px !important;
    padding: 16px var(--gutter) 22px !important;
  }
  section:has(> div[style*="min(760px, 54%)"]) > div[style*="z-index: 3"] h2 {
    white-space: normal !important;
    text-align: center !important;
  }
  section:has(> div[style*="min(760px, 54%)"]) > div[style*="z-index: 3"] > div {
    justify-content: center !important;
  }
}

/* ==========================================================================
   5c. Homepage — peel sticker and water orb, off on phones
   ==========================================================================
   Both are scroll-driven set pieces choreographed against a desktop-height
   §4b: the sticker peels to uncover the orb, which then rides the screen and
   rolls off along the ribbon. Restacked to one column the geometry no longer
   lands — the orb tracks across the timeline copy — so both come off below
   900px. Their scroll handlers keep running and simply move hidden nodes. */

@media (max-width: 900px) {
  div:has(> iframe[src="water-orb.html"]) { display: none !important; }
  div:has(> div > img[src="uploads/sticker-deuterium.webp"]) { display: none !important; }
}

/* ==========================================================================
   5d. Homepage — "as seen in" ribbon
   ==========================================================================
   The band is sized for a 2.1rem italic marquee across a desktop viewport.
   At phone width two words fill the screen, so the strip reads as a headline
   rather than a press ticker. */

@media (max-width: 900px) {
  div[style*="height: 152px"] { height: 96px !important; }
  .lw-ribbon { margin: -30px 0 !important; }   /* desktop lifts it 40px clear of the Method 1 eyebrow; phones keep the original */
  div[style*="rotate(-8deg)"],
  div[style*="var(--rib-tilt"] { padding: 12px 0 !important; }   /* the ribbon, now with an adjustable tilt */
  div[style*="lw-marq-l"][style*="64s"] { gap: 22px !important; }
  div[style*="lw-marq-l"][style*="64s"] > span { font-size: 1.15rem !important; }
  div[style*="lw-marq-l"][style*="64s"] > span[style*="border-radius: 50%"] {
    width: 5px !important;
    height: 5px !important;
  }
}

/* ==========================================================================
   6. Homepage — §5 offers coverflow
   ==========================================================================
   Three absolutely-positioned slides, the centre one in focus at 58% width
   and the flanking two at 34%, dimmed. On a 335px column that is a 194px
   hero card between two 114px slivers, with a 38px headline inside it.
   Flattened here into three full-width cards in normal flow: the coverflow's
   whole point is the peek at the neighbours, and there is no room for one.
   The dots below still switch focus; they just have nothing left to move. */

@media (max-width: 900px) {
  .lw-offer-track {
    /* narrower than the column on purpose: the leftover padding shows a
       sliver of the neighbouring cards, which is the only cue that the row
       scrolls now that the dots are gone */
    --lw-offer-card: min(266px, 76vw);
    height: auto !important;
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-left: calc(50% - var(--lw-offer-card) / 2);
    padding-right: calc(50% - var(--lw-offer-card) / 2);
    /* overflow-x:auto forces the vertical axis to clip too, which sliced the
       cards' drop shadows off top and bottom — this is their room */
    padding-top: 20px;
    padding-bottom: 26px;
  }
  .lw-offer-track::-webkit-scrollbar { display: none; }
  .lw-offer-slide {
    /* relative, NOT static: the image layer and the caption inside are
       `position:absolute; inset:0`, so a static slide throws their
       containing block up to the track — the art rendered 355px wide inside
       a 300px card, which is the stray shadow edge and the clipped seal */
    position: relative !important;
    flex: 0 0 var(--lw-offer-card) !important;
    width: auto !important;
    height: 230px !important;
    top: auto !important; left: auto !important; right: auto !important;
    transform: none !important;
    opacity: 1 !important;
    cursor: default !important;
    scroll-snap-align: center;
    box-shadow: 0 18px 40px rgba(14,13,69,.18) !important;
  }
  /* undo the dim on the two that are not in focus */
  .lw-offer-slide > div:first-child > div { filter: none !important; }
  /* The caption is the slide's last child. It carries the coverflow's
     out-of-focus state inline — opacity 0, nudged down, pointer-events off —
     which the centre slide alone cleared. Swiped, every card is the centre
     one, so all three captions show and all three CTAs take a tap. */
  .lw-offer-slide > div:last-child {
    left: 18px !important;
    right: 18px !important;
    bottom: 16px !important;
    padding: 0 !important;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
  }
  .lw-offer-slide h3 { font-size: 1.42rem !important; margin-bottom: 5px !important; }
  .lw-offer-slide p {
    font-size: .88rem !important;
    line-height: 1.32 !important;
    margin-bottom: 11px !important;
  }
  /* The pill is drawn for a desktop slide: 56px tall with a 38px arrow ball
     inside it, which on a 230px card is a fifth of the card's height sitting
     under the pitch. Sized down here — the ball, the left padding that makes
     room for it, and the hover swap all move together or the arrow lands off
     centre. */
  .lw-offer-slide .lw-offer-cta {
    font-size: .82rem !important;
    min-height: 42px !important;
    padding: 7px 18px 7px 44px !important;
    box-shadow: 0 8px 20px rgba(0,134,189,.4) !important;
  }
  .lw-offer-slide .lw-offer-cta-ball {
    left: 7px !important;
    width: 28px !important;
    height: 28px !important;
    font-size: .78rem !important;
  }
  .lw-offer-slide .lw-offer-cta:hover { padding: 7px 44px 7px 18px !important; }
  .lw-offer-slide .lw-offer-cta:hover .lw-offer-cta-ball { left: calc(100% - 35px) !important; }
  /* The "our best offer" seal is hung 26px off the slide's right edge, where
     a full-width card puts it past the viewport. Tuck it inside. */
  /* the seal rocks on a ~10deg transform, so its box reaches above whatever
     `top` is set to — 10px let the corner poke past the card edge */
  .lw-offer-slide div[style*="lw-seal-rock"] {
    top: 20px !important;
    right: 12px !important;
    z-index: 3 !important;
    padding: 8px 15px !important;
    gap: 2px !important;
  }
  .lw-offer-slide div[style*="lw-seal-rock"] span:first-child { font-size: .88rem !important; }
  .lw-offer-slide div[style*="lw-seal-rock"] span:last-child { font-size: .56rem !important; }

  /* The dots set offerIdx, which moved the slides by transform — overridden
     here, so a tap would leave them looking broken. Swipe is the control. */
  .lw-offer-track + div { display: none !important; }
}

/* ==========================================================================
   7. Homepage — §6 comparison table
   ==========================================================================
   A row of columns: the labels axis plus one column per water. It cannot
   compress below about 620px without the labels wrapping to four lines each,
   so it scrolls sideways inside its own band with the axis column pinned. */

@media (max-width: 900px) {
  .lw-comp-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }
  .lw-comp-table > div:not(:first-child) {
    flex: 0 0 118px !important;
    scroll-snap-align: start;
  }
  /* Every column opens with a 200px spacer holding the bottle shot, which is
     a third of the table's height before a single row of data. */
  .lw-comp-table div[style*="height: 200px"] { height: 112px !important; }

  /* Landscape cards replace the table outright below 900px — see
     comp-mobile.js, which repeats the axis labels inside each card. */
  .lw-comp-table { display: none !important; }
  /* Five stacked cards ran 1652px — three times the table they replaced.
     Swiped instead, the section is one card tall and the labels still travel
     with every water, which the sideways table could not do.

     Litewater is the thing every other card is being measured against, so it
     does not scroll away with them: its card is sticky at the left edge and
     the competitors slide over it, leaving a rail of its own values standing
     beside whichever water is on screen. Nothing resizes to do it — the card
     keeps its full width under the one covering it, and how much of it shows
     is simply where that card's left edge has got to. The waters settle at
     `--lw-comp-rail` (scroll-padding-left), which is what sets the width of
     the rail once one is snapped.

     Full-bleed, because a rail pinned at the gutter rather than the screen
     edge would leave a 20px stripe of background running down beside it. */
  .lw-comp-cards {
    --lw-comp-rail: 100px;
    --lw-comp-card: min(268px, calc(100vw - var(--lw-comp-rail) - 34px));
    display: flex !important;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-left: var(--lw-comp-rail);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-left: calc(-1 * var(--gutter));
    margin-right: calc(-1 * var(--gutter));
    padding-left: 12px;
    /* room for the last water to still reach the rail's edge */
    padding-right: max(12px, calc(100vw - var(--lw-comp-rail) - var(--lw-comp-card)));
    /* same clipped-shadow problem as the offers track */
    padding-top: 16px;
    padding-bottom: 24px;
  }
  .lw-comp-cards::-webkit-scrollbar { display: none; }
}

/* the cards are built on every page load; only phones ever show them */
.lw-comp-cards { display: none; }

@media (max-width: 900px) {
  .lw-comp-card {
    flex: 0 0 var(--lw-comp-card);
    scroll-snap-align: start;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    padding: 14px 16px 10px;
    box-shadow: 0 10px 26px rgba(14,13,69,.07);
    position: relative;
    z-index: 1;
  }
  .lw-comp-card.is-hero {
    background: linear-gradient(180deg, #00AEEF 0%, #0086bd 100%);
    border-color: transparent;
    box-shadow: 0 18px 44px rgba(0,134,189,.34);
    /* On top of the waters, not under them: a card that has already scrolled
       past the rail is still sitting on those coordinates, and under it the
       rail was painted over by whichever card had gone by. comp-mobile.js
       cuts the card back to the rail with a clip-path — clipping, not
       resizing, so the row never reflows and the scroll never jumps. */
    position: sticky;
    left: -12px;
    z-index: 2;
  }
  /* Reversed, so the values are the part of the card the rail keeps on
     screen and the labels are what goes under the covering water. The value
     column is sized to end just inside the rail, so a snapped water lands on
     the gap between the two and never crops a value or half a label. */
  .lw-comp-card.is-hero .lw-comp-card-row { flex-direction: row-reverse; justify-content: flex-end; }
  .lw-comp-card.is-hero .lw-comp-card-value { flex: 0 0 68px; text-align: left; }
  .lw-comp-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    /* the bottle and the wordmark read as one mark, so they sit centred in
       the card rather than ranged left against a ragged right-hand gap */
    justify-content: center;
    /* every card's first row has to start at the same height as the rail's,
       or the pinned values read against the wrong labels */
    min-height: 56px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
  }
  .lw-comp-card.is-hero .lw-comp-card-head { border-bottom-color: rgba(255,255,255,.26); }
  /* the cloned line art carries its desktop 62x74 as inline attributes */
  .lw-comp-card-head svg {
    width: 30px !important;
    height: 30px !important;
    opacity: .75;
    flex: 0 0 auto;
  }
  .lw-comp-card-name {
    font-family: var(--font-grotesk);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-strong);
  }
  /* the Litewater Logo face ships in 400 only — asking for 900 here just
     gets a synthesised bold, so the size carries the weight instead. Sized
     to run the rest of the card's width beside the bottle: the face has a
     very small x-height, so it needs a number this large to read as a
     wordmark rather than a caption. */
  .lw-comp-card.is-hero .lw-comp-card-name {
    color: #fff;
    font-size: 3.2rem;
    line-height: .9;
    flex: 0 1 auto;
    /* comp-mobile.js fades this out as the card narrows into the rail, and
       glides the bottle to the middle of what is left — a wordmark sliced
       through mid-letter by the covering card is what reads as broken */
    white-space: nowrap;
  }
  .lw-comp-card.is-hero .lw-comp-card-head img {
    height: 46px !important;
    width: auto !important;
    flex: 0 0 auto;
    object-fit: contain;
  }
  /* Fixed, not content-sized: the rail's values have to sit on the same
     baselines as the labels of whichever water is beside them, and the two
     cards are different widths, so a label that wraps in one and not the
     other would walk every row below it out of line. */
  .lw-comp-card-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    /* three lines at the rail's label width, which is the narrowest column
       any of the labels has to wrap into */
    height: 54px;
    border-bottom: 1px solid var(--border);
  }
  .lw-comp-card-row:last-child { border-bottom: 0; }
  .lw-comp-card.is-hero .lw-comp-card-row { border-bottom-color: rgba(255,255,255,.18); }
  .lw-comp-card-label {
    font-size: .8rem;
    color: var(--text-body);
    line-height: 1.25;
  }
  .lw-comp-card.is-hero .lw-comp-card-label { color: rgba(255,255,255,.9); }
  .lw-comp-card-value {
    font-family: var(--font-mono);
    font-size: .82rem;
    font-weight: 700;
    color: var(--text-strong);
    white-space: nowrap;
    flex: 0 0 auto;
  }
  .lw-comp-card.is-hero .lw-comp-card-value { color: #fff; }
  .lw-comp-card-value.is-yes { color: var(--cyan,#00AEEF); font-size: 1.05rem; }
  .lw-comp-card.is-hero .lw-comp-card-value.is-yes { color: #fff; }
  .lw-comp-card-value.is-no { color: var(--text-muted); opacity: .8; }
  /* The labels column stays put while the waters scroll past it. Sized, not
     content-width: "Transparent practices & lab results" sets on one line at
     308px and would leave 27px of the first water visible. */
  .lw-comp-table > div:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    flex: 0 0 150px !important;
    background: #fff;
    box-shadow: 8px 0 12px -8px rgba(14,13,69,.18);
  }
  .lw-comp-table > div:first-child > div {
    padding: 0 12px !important;
    font-size: .78rem !important;
    line-height: 1.2;
  }
  /* the decorative bottle behind the band is 60% wide and drags the eye */
  img[src="uploads/4.webp"] { display: none !important; }

  /* the lab results link is hung on the right of a desktop-width band */
  div:has(> a[href$="litewater-lab-results.pdf"]) {
    justify-content: center !important;
    margin-top: 30px !important;
  }
}

/* ==========================================================================
   7b. Homepage — §7 reviews
   ==========================================================================
   The quote cards carry a literal `width: 380px`, drawn on the canvas for a
   desktop row. That is wider than the whole 335px phone column, so each card
   runs past the screen edge and the type inside it reads oversized. */

@media (max-width: 900px) {
  div[style*="width: 380px"][style*="flex: 0 0 auto"] {
    width: 268px !important;
    padding: 18px 20px !important;
  }
  div[style*="width: 380px"][style*="flex: 0 0 auto"] p {
    font-size: .92rem !important;
    margin: 9px 0 11px !important;
  }
}

/* ==========================================================================
   8. Homepage — §8 email capture and footer
   ========================================================================== */

@media (max-width: 900px) {
  /* The card was sized on the design canvas and still carries the literal
     `width: 1460px; height: 546px` it was drawn at, with the tint overlay
     inside it pinned to 1420px. Nothing about it is fluid. */
  section > div[style*="min-height: clamp(460px"] {
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    background-attachment: scroll !important;
  }
  /* The tint is a left-to-right gradient that runs clear by 86% — it protects
     the copy on a 1270px card, not on a 335px one where the text crosses the
     whole width. Re-aim it top-to-bottom so the white type keeps a ground. */
  section > div[style*="min-height: clamp(460px"] > div[style*="width: 1420px"] {
    width: 100% !important;
    background: linear-gradient(180deg, rgba(0,174,239,.88) 0%, rgba(0,134,189,.78) 100%) !important;
  }
  section > div[style*="min-height: clamp(460px"] > div:last-child {
    padding: 34px 22px !important;
    margin-left: 0 !important;
  }
  /* the field and its button sit on one row from 260px up — too tight here */
  /* 3.8vw never binds on a phone, so this sits at its 2rem floor */
  h2[style*="clamp(2rem, 3.8vw, 3.2rem)"] { font-size: 1.72rem !important; }
  section form input[type="email"] { flex: 1 1 100% !important; }
  section form button[type="submit"] { flex: 1 1 100% !important; }

  /* The footer height is hard-coded for a three-column info row. Stacked, the
     content is taller than that and the bottom of it is cut off. */
  footer { height: auto !important; padding-bottom: 44px !important; }
  footer > div > div[style*="1fr auto 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 26px !important;
    margin-top: 34px !important;
    text-align: center !important;
    justify-items: center;
  }
  footer > div > div[style*="1fr auto 1fr"] svg[aria-label="Litewater Scientific"],
  footer img.lw-ft-logo {
    width: 190px !important;
    margin: 0 auto;
  }
  footer > div > div:first-child { gap: 7px !important; font-size: .86rem !important; }
  /* The social column is the third of the three info columns and carries
     `justify-self: end; text-align: left` inline for the desktop row. Stacked
     into one centred column those two win over the parent's `justify-items`
     and strand the block against the right edge, reading left. */
  footer > div > div[style*="1fr auto 1fr"] > div:last-child {
    justify-self: center !important;
    text-align: center !important;
  }
  footer > div > div[style*="1fr auto 1fr"] > div:last-child > div:last-child {
    justify-content: center !important;
  }
}

/* ==========================================================================
   9. Sticky sidebars
   ==========================================================================
   Several pages set a column `position: sticky` inline so it holds while the
   column beside it scrolls. Stacked into one column that column pins itself
   over the content it was meant to sit beside. The PDP already had a
   max-width:1200px rule for its gallery, but the sticky is written inline and
   an inline style outranks a class rule — so it never took effect. */

@media (max-width: 900px) {
  .pdp-gallery { position: static !important; }
  div[style*="sticky"][style*="top: 120px"],
  div[style*="sticky"][style*="top: 110px"],
  div[style*="sticky"][style*="top: 96px"] { position: static !important; }
}

/* ==========================================================================
   10. Product detail pages (PDP + Niuvai)
   ========================================================================== */

@media (max-width: 900px) {
  .pdp-grid { padding-top: 12px !important; }
  .pdp-gallery { grid-template-columns: 72px minmax(0, 1fr) !important; }

  /* the subscribe card puts the strike-through and the live price on one row
     with the label; at this width the price runs out of the card */
  .pdp-grid h1 { font-size: clamp(1.7rem, 7vw, 2.3rem) !important; }
}

@media (max-width: 560px) {
  /* the thumbnail rail costs more than it gives on a phone — the main image
     is already tappable and the variant chips below name every option */
  .pdp-gallery { grid-template-columns: 64px minmax(0, 1fr) !important; }
}

/* ==========================================================================
   11. Shop All
   ========================================================================== */

@media (max-width: 900px) {
  /* The banner still carries the literal `width: 1388px; height: 346px` it
     was drawn at on the design canvas, so its max-width never applies. */
  section[data-shopbanner] {
    width: auto !important;
    height: clamp(180px, 42vw, 260px) !important;
    margin-left: var(--gutter) !important;
    margin-right: var(--gutter) !important;
  }

  /* Three product cards side by side is 95px each — narrower than the price
     row inside them. Two up, and one up on a phone. */
  div[style*="repeat(3, minmax(0px, 1fr))"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 26px 16px !important;
  }
}

@media (max-width: 560px) {
  div[style*="repeat(3, minmax(0px, 1fr))"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* ==========================================================================
   12. Calculator
   ========================================================================== */

@media (max-width: 900px) {
  /* The hero eyebrow, headline and lede were resized by hand on the design
     canvas and kept the literal pixel box they were dragged to. */
  section [style*="width: 819px"],
  section [style*="width: 420px"],
  section [style*="width: 359px"] {
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
  }
  h1 .lwname { font-size: 1.3em !important; }   /* the calculator hero pins its wordmark at 89px */

  /* The four-step rail is repeat(4,1fr), but each button's label sets a
     min-content wider than its share, so the tracks total 437px. */
  div[style*="repeat(4"] { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  div[style*="repeat(4"] > button {
    flex-direction: column !important;
    gap: 5px !important;
    padding: 13px 4px !important;
    min-width: 0 !important;
  }
  div[style*="repeat(4"] > button span:last-child {
    font-size: .7rem !important;
    line-height: 1.15 !important;
    text-align: center;
  }
}

/* ==========================================================================
   13. Niuvai
   ========================================================================== */

@media (max-width: 900px) {
  /* the buy layout is a two-column grid written inline, so the .pdp-grid
     media rule the page already ships does not reach it */
  div[style*="minmax(0px, 1.05fr)"] {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 26px !important;
  }
  .pdp-gallery { width: 100% !important; }
  #buy h1 { font-size: clamp(1.5rem, 6.6vw, 2.1rem) !important; }
}

/* ==========================================================================
   14. Decorative canvas art
   ==========================================================================
   The palm-frond and bottle overlays are positioned with the literal pixel
   coordinates they were dragged to on the design canvas (`left: -227px;
   top: 3350px`). On a phone they land on top of copy or off-screen, and none
   of them carries meaning. */

@media (max-width: 900px) {
  img[src="uploads/2.webp"],
  img[src="uploads/3.webp"],
  img[src="uploads/4.webp"] { display: none !important; }
}

/* ==========================================================================
   15. History of Deuterium
   ========================================================================== */

@media (max-width: 900px) {
  /* the headline uses a non-breaking hyphen in "deuterium-depleted", so the
     word cannot split — at 48px it is wider than the phone */
  section h1[style*="6.4vw"] {
    font-size: clamp(1.9rem, 8vw, 2.7rem) !important;
    max-width: none !important;
  }

  /* chapter body beside a 320px notes rail */
  section[data-chapter] { grid-template-columns: minmax(0, 1fr) !important; }
  /* the 200px date column that runs down every chapter */
  div[style*="200px minmax(0px, 1fr)"] {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px !important;
  }
  /* body beside the portrait block */
  div[style*="minmax(0px, 1fr) minmax(280px, 420px)"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  /* The ppm chart rows are label | bar | value on one line, which leaves the
     bar 5px wide here. Label and value keep the top line; the bar takes the
     full width underneath, which is what makes the comparison readable. */
  div[style*="170px minmax(0px, 1fr) 120px"] {
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 8px 12px !important;
  }
  div[style*="170px minmax(0px, 1fr) 120px"] > span:first-child { grid-area: 1 / 1; }
  div[style*="170px minmax(0px, 1fr) 120px"] > span:last-child { grid-area: 1 / 2; }
  div[style*="170px minmax(0px, 1fr) 120px"] > div { grid-area: 2 / 1 / 3 / 3; }

  /* the two big blur orbs behind the hero are sized and placed in px */
  div[style*="width: 760px"][style*="border-radius"],
  div[style*="width: 420px"][style*="border-radius"] { display: none !important; }
}

/* ==========================================================================
   16. Three-up stat strips
   ==========================================================================
   `repeat(3,1fr)` without a minmax floor: each cell's min-content ("2,400+
   Reviews" plus 20px of padding a side) pushes its track past its share. */

@media (max-width: 900px) {
  div[style*="repeat(3, 1fr)"] { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  div[style*="repeat(3, 1fr)"] > div { padding-left: 8px !important; padding-right: 8px !important; }
}

/* ==========================================================================
   7c. Homepage — §7b founder panel
   ==========================================================================
   Desktop stands Victor in a .46fr column beside the quote. At phone width
   that column is ~110px, so the cut-out shrank to a thumbnail and the quote
   column was too narrow for the newsletter pill, which ran off the panel.
   One column instead, as Joey laid it out: Victor at the top, the newsletter
   pill straight under him and over his lower half, so he stands behind it,
   then the quote and his name below. */

@media (max-width: 900px) {
  div[style*="minmax(0px, 0.46fr)"] {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
    padding: 30px 24px 36px !important;
  }
  /* the portrait cell; the cut-out fades out low down so the pill can sit
     over him without a hard edge where the PNG ends */
  div[style*="minmax(0px, 0.46fr)"] > div:first-child { min-height: 340px !important; }
  div[style*="minmax(0px, 0.46fr)"] > div:first-child > div {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background-size: contain !important;
    -webkit-mask-image: linear-gradient(180deg, #000 62%, transparent 96%);
    mask-image: linear-gradient(180deg, #000 62%, transparent 96%);
  }
  div[style*="minmax(0px, 0.46fr)"] > div:nth-child(2) {
    align-items: center !important;
    text-align: center !important;
    padding: 0 !important;
  }
  div[style*="minmax(0px, 0.46fr)"] > div:nth-child(2) > div { align-items: center !important; }
  /* the pill leads the copy and is lifted up over the portrait */
  div[style*="minmax(0px, 0.46fr)"] > div:nth-child(2) > a {
    order: -1;
    position: relative;
    z-index: 2;
    margin: -64px 0 30px !important;
    white-space: normal !important;
    max-width: 100%;
    box-sizing: border-box;
  }
}

/* ==========================================================================
   7d. Homepage — §5b subscribe-and-save benefit chips
   ==========================================================================
   The list is set at 1.49rem for a desktop row of three pills. On a phone
   each benefit wraps to four or five lines, and a 999px radius on a box that
   tall turns the pill into an oval with the text crowding its curve. Phone
   type, a card radius, and full width so the copy wraps on two lines. */

@media (max-width: 900px) {
  ul[style*="font-size: 1.49rem"] {
    font-size: 1rem !important;
    line-height: 1.4 !important;
    gap: 10px !important;
    align-items: stretch !important;
  }
  ul[style*="font-size: 1.49rem"] > li {
    border-radius: 18px !important;
    padding: 14px 18px 14px 14px !important;
    gap: 12px !important;
  }
}
