/* ============================================================
   RESPONSIVE LAYER  ·  phone + tablet
   Was an inline <style id="rwd"> at the bottom of index.html, which meant
   the other pages never got it. Now a real sheet, linked as the LAST
   element before </body> on every page — so it still cascades after the
   per-section <style> blocks in the document, exactly as before.
   Tiers:  <=767 phone  ·  768-1179 tablet  ·  >=1180 + fine pointer = deck
   ============================================================ */

/* ---------- 0 · page frame ------------------------------------ */

/* iOS Safari reports 100vh as the *expanded* viewport, so a 100vh block
   sits 60-90px under the collapsing toolbar. svh is the honest unit. */
:root { --safe-b: env(safe-area-inset-bottom, 0px); }

/* The foam blobs are drawn to bleed off a ≥1200px canvas. They only ever fit
   because `.deck .vp` clips them at overflow:hidden — with the deck off they
   push the document 150px past the viewport, and `overflow-x:clip` then crops
   the real content instead of showing a scrollbar. So: deck on, or gone. */
@media (max-width:1179px), (pointer:coarse) {
  .blob { display:none !important; }
}

@media (max-width:1023px) {
  /* nothing may out-run the viewport once the blobs are gone */
  .slab, .slab__in, .vp { max-width:100%; }
}

/* ---------- 1 · header --------------------------------------- */

@media (max-width:767px) {
  /* the Free-Estimate button was being dropped on phones, leaving the
     floating mascot as the only route to the form. Keep it, just narrower. */
  .topnav__actions > .btn { display:inline-flex; padding:11px 15px; font-size:12px; letter-spacing:.04em; }
  .topnav__actions .header__phone { display:none; }   /* the cyan bar above already carries the number */
  .topnav__actions { gap:6px; }
  .topnav__bar { font-size:13px; }
  .topnav__bar a { min-height:44px; display:inline-flex; align-items:center; padding-inline:6px; }
}
@media (max-width:389px) {
  /* iPhone SE: the pill runs out of room before the CTA text does */
  .topnav__actions > .btn { padding:10px 11px; font-size:11px; }
}

/* app.css:264 sets the burger bars to currentColor — then app.css:319 wins with
   var(--white), so all three bars are white on a white pill in both the resting
   and the scrolled state. The only mobile nav affordance on the page is
   invisible at every width under 1080px. Put currentColor back. */
.burger span { background:currentColor; }

/* --chrome-h assumes the utility bar is showing. Once .is-scrolled collapses
   that bar to height:0, the panel still starts ~40px lower than the header
   ends, leaving a strip of the page visible between the two. */
.topnav.is-scrolled + .mobile-nav { top:var(--header-h); }

/* the burger is 44×44 already — give the mobile nav real targets too */
@media (max-width:1179px) {
  .mobile-nav a { min-height:56px; display:flex; align-items:center; }
  .mobile-nav { padding-bottom:calc(var(--s-7) + var(--safe-b)); }
}

/* ---------- 2 · sticky CTA ----------------------------------- */

/* Touch has no mouse-out, so app.css pins the speech cloud permanently open.
   Cloud + mascot then occupy ~264px of the bottom-right corner on every
   screen — on top of the estimate form's phone/town fields, the calculator's
   CTA and the job-reel card stack. Shrink it, and get it out of the way over
   the sections where it duplicates or blocks the real control. */
@media (max-width:1023px) {
  .sticky-cta { right:12px; bottom:calc(12px + var(--safe-b)); }
  .sticky-cta__say { width:clamp(140px,42vw,168px); }
  .sticky-cta__cloudtext { font-size:11px; letter-spacing:.02em; }
  .sticky-cta__mascot { width:60px; }
}
/* set 4.5s after the CTA first appears on a touch pointer: the cloud retracts
   and FOAMiE stays as a plain 60px floating button. */
@media (pointer:coarse) {
  .sticky-cta.is-quiet .sticky-cta__say {
    opacity:0; transform:translateY(10px) scale(.9);
    animation:none; pointer-events:none;
  }
}

/* ---------- 3 · S2 · savings calculator ---------------------- */

@media (max-width:767px) {
  /* `justify-content:space-between` + a 1.5rem display numeral pushes
     "2,000 SQ FT" and "$240/MO" clean off the right edge. Stack them. */
  .slider label {
    display:grid; grid-template-columns:1fr; justify-content:start;
    gap:2px; margin-bottom:var(--s-4);
  }
  .slider output { font-size:1.75rem; line-height:1; }

  /* four era pills on one flex line clip the last one; two rows of two fit */
  .era__opts { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
  .era__opt { flex:none; }
  .era__pill { min-height:46px; white-space:normal; text-align:center; padding:6px 8px; }

  .calc__out { padding:var(--s-6) var(--s-4); }
  .calc__out .btn { width:100%; }
}

/* a 4px-tall track is a 4px-tall touch target, on tablets as much as phones.
   Keep the 6px line, give the input a 48px box, re-centre the 32px thumb. */
@media (pointer:coarse) {
  input[type=range] { height:48px; background:transparent; }
  input[type=range]::-webkit-slider-runnable-track {
    height:6px; border-radius:3px; background:rgba(0,0,0,.18);
  }
  input[type=range]::-webkit-slider-thumb { margin-top:-13px; }
  input[type=range]::-moz-range-track { height:6px; border-radius:3px; background:rgba(0,0,0,.18); }
  .s-pink input[type=range]::-webkit-slider-runnable-track,
  .s-void input[type=range]::-webkit-slider-runnable-track { background:rgba(255,255,255,.24); }
  .s-pink input[type=range]::-moz-range-track,
  .s-void input[type=range]::-moz-range-track { background:rgba(255,255,255,.24); }
}

/* ---------- 4 · S4 · thermal index --------------------------- */

/* app.css hides the six-item index below 900px and stacks every panel at
   full size instead: 4,945px on a 390px phone, 5,890px on an iPad mini —
   roughly six screens for one section. Keep the tabs at every width and
   run the panel underneath; the interaction is already built and the JS
   binds its click handlers regardless of viewport. */
@media (max-width:1179px) {
  .tindex__body { display:grid; grid-template-columns:1fr; gap:var(--s-6); }
  .tindex__list { display:flex; }

  .tindex__stage { display:grid; min-height:0; }
  .tpanel {
    grid-area:1/1; display:grid; grid-template-columns:1fr;
    gap:var(--s-5); padding:0; border-top:0;
    visibility:hidden; opacity:0;
  }
  .tpanel.is-on { visibility:visible; opacity:1; }
  .tpanel__fig { height:auto; max-width:none; }
  .tpanel__fig .ph, .tpanel__fig img { aspect-ratio:16/10; height:auto; }
  .tpanel__c { margin-top:0; align-self:start; }
  .tpanel__c p { max-width:none; }
  .tpanel__n, .tpanel__c h3, .tpanel__c p, .tpanel__chip { opacity:1; transform:none; }
}
@media (max-width:767px) {
  .tix { gap:var(--s-3); padding:12px var(--s-3); min-height:52px; }
  .tix__n { font-size:1.125rem; min-width:1.5em; }
  .tix__t { font-size:.9375rem; }
  .tix::after { display:none; }          /* the active pill already reads as selected */
  .tix.is-on { box-shadow:4px 4px 0 var(--cyan); }
  .tindex__head { gap:var(--s-4); }
  .tpanel__c h3 { font-size:var(--fs-h3); }
}
/* tablet has the width for the designed side-by-side stage */
@media (min-width:768px) and (max-width:1179px) {
  .tpanel { grid-template-columns:minmax(0,1fr) minmax(0,1.05fr); align-items:center; }
  .tpanel__fig .ph, .tpanel__fig img { aspect-ratio:4/5; }
}

/* ---------- 5 · S5 · job reel -------------------------------- */

@media (max-width:767px) {
  .reel__card { min-width:56px; }
  .reel__stack { bottom:calc(var(--reel-pad-b) + var(--safe-b)); }
}

/* ---------- 6 · S8 / S-process / S10 — tablet two-up --------- */

/* 768–1179 currently collapses to the phone's single column and leaves
   half the iPad empty. These grids all fit at two columns. */
@media (min-width:768px) and (max-width:1179px) {
  .calc { grid-template-columns:1fr 1fr; gap:var(--s-7); align-items:start; }
  .terr8__body { grid-template-columns:1fr 1fr; gap:var(--s-6); align-items:center; }
  .split--wide { grid-template-columns:1.1fr .9fr; }
  .form-grid { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
}

/* ---------- 7 · S10 · estimate form -------------------------- */

@media (max-width:767px) {
  /* nowrap on a display-scale headline is what pushes this section wide */
  .est10 .est10__h { white-space:normal; font-size:clamp(1.875rem, 1rem + 4.4vw, 2.75rem); }
  .est10__head { flex-direction:column; align-items:flex-start; gap:var(--s-3); }
  .towndrop__opts { grid-template-columns:1fr; }
}

/* ≤16px on a focusable field makes iOS Safari zoom the page on focus and
   never zoom back out. 16px is the documented floor. */
@media (max-width:1023px) {
  input, select, textarea, .field input, .field select, .field textarea { font-size:16px; }
  .field input, .field select, .field textarea { padding:14px var(--s-4); min-height:52px; }
  .consent { font-size:13px; }
  .consent input { width:24px; height:24px; }
}

/* ---------- 8 · touch targets -------------------------------- */

/* WCAG 2.2 AA (2.5.8) asks 24px; Apple HIG and Material both ask 44/48.
   Padding rather than height, so nothing in the layout has to move. */
@media (pointer:coarse) {
  .btn { min-height:48px; }
  .btn--lg { min-height:54px; }
  .header__phone { min-height:44px; display:inline-flex; align-items:center; }
  .acc__b { min-height:56px; }
  .terrmap__go, .faq-link, .card__go {
    display:inline-flex; align-items:center; min-height:44px;
  }
  .reel__card, .proc__node, .tsk, .tix, .chip span, .need, .era__pill { touch-action:manipulation; }
  .towndrop__o { min-height:48px; }
  /* the desktop nav is still on screen at iPad landscape widths */
  .topnav__link, .navdrop__trigger { min-height:44px; display:inline-flex; align-items:center; }
  .navdrop__panel a { min-height:52px; }
  .drawer__x { width:48px; height:48px; }
  /* the ring-badge phone link in the hero is 96×20 of live text */
  .phone-ring + a, a[href^="tel:"] { min-height:44px; }
}

/* ---------- 9 · type floors ---------------------------------- */

@media (max-width:767px) {
  /* 12px body-weight text is below the readable floor on a phone.
     The 11px tracked uppercase eyebrows stay — caps at that tracking read fine. */
  .navdrop__panel em { font-size:13px; }
  .creds li { font-size:14px; }
  .form-note { font-size:13px; }
  .spray-hint {
    white-space:normal; text-align:center; max-width:min(88vw,340px);
    font-size:13px; padding:12px 18px; line-height:1.35;
  }
  .spray-cta { padding:16px var(--s-5); font-size:.9375rem; }
}

/* ---------- 10 · motion -------------------------------------- */

/* the hint's bob and ring both animate box-shadow/transform behind a
   fixed CTA on a phone; on touch it is noise, not affordance. */
@media (pointer:coarse) and (max-width:767px) {
  .spray-hint { animation:none; }
}

/* ============================================================
   ROUND 2 · itemised phone + tablet fixes
   ============================================================ */

/* ---------- 11 · mobile menu ---------------------------------- */

@media (max-width:1179px) {
  /* both CTAs pinned to the bottom of the panel so they are reachable with a
     thumb no matter how far the link list is scrolled */
  .mobile-nav { padding-bottom:calc(var(--s-7) + var(--safe-b) + 190px); }
  /* pinned pair: fix the height so the two offsets are arithmetic, not guesswork
     (btn--lg's padding + min-height otherwise lands wherever the type does) */
  .mobile-nav .btn {
    position:fixed; left:var(--gutter); right:var(--gutter);
    width:auto; margin:0; z-index:2;
    height:64px; min-height:0; padding-block:0;
  }
  .mobile-nav .btn--outline { bottom:calc(20px + var(--safe-b)); }
  .mobile-nav .btn--pink    { bottom:calc(98px + var(--safe-b)); }  /* 20 + 64 + 14 gap */
}
@media (max-width:767px) {
  .mobile-nav a:not(.btn) { font-size:1.625rem; min-height:52px; }
  .mobile-nav { gap:0; }
}

/* ---------- 12 · sticky mascot -------------------------------- */

@media (max-width:767px)  { .sticky-cta__mascot { width:78px; } }
@media (min-width:768px) and (max-width:1179px) {
  .sticky-cta__mascot { width:104px; }
  .sticky-cta__say { width:clamp(180px,26vw,220px); }
  .sticky-cta__cloudtext { font-size:13px; }
}

/* ---------- 13 · hero aside (tablet) -------------------------- */

/* pink CTA on the left, the ringed phone number on its right */
@media (min-width:768px) and (max-width:1179px) {
  /* the aside is the grid's `auto` column, so it parks on the right edge —
     give it the full row so the CTA can start at the container's left */
  .hero-top { grid-template-columns:1fr; }
  .hero-top__aside {
    flex-direction:row; justify-content:flex-start;
    align-items:center; gap:var(--s-6); text-align:left;
  }
  .hero-top__aside .btn { order:1; flex:none; }
  .hero-top__aside .phone-ring { order:2; }
}

/* ---------- 14 · services drag row ---------------------------- */

/* the orb is a cursor-follower; on touch it degrades to a static badge that
   reads as a control but is not one. The row still drags. */
@media (max-width:1179px) {
  .drag-orb, .drag-orb.is-static, .drag-orb.is-on { display:none; }
}

/* ---------- 15 · S4 · thermal index head + stage -------------- */

@media (max-width:1179px) {
  /* seal back beside the headline, headline broken onto two lines */
  .tindex__head {
    display:grid; grid-template-columns:1fr auto;
    align-items:center; gap:var(--s-4) var(--s-5);
  }
  .tindex__head h2 .ex-pink { display:block; }
  .tindex__seal { justify-self:end; align-self:center; }

  /* photo and copy side by side, centred against each other */
  .tpanel {
    grid-template-columns:minmax(0,1fr) minmax(0,1.12fr);
    gap:clamp(16px,3vw,32px); align-items:center;
  }
  .tpanel__fig .ph, .tpanel__fig img { aspect-ratio:3/4; }
}
@media (max-width:767px) {
  .tindex__seal { width:clamp(84px,20vw,104px); }
  .tindex__seal-n { font-size:1.5rem; }
  .tindex__seal text { font-size:8.5px; letter-spacing:.1em; }
  .tpanel__c h3 { font-size:1.125rem; line-height:1.15; }
  .tpanel__c p { font-size:.875rem; line-height:1.45; margin-top:var(--s-3); }
  .tpanel__n { font-size:1rem; margin-bottom:6px; }
  .tpanel__chip { margin-top:var(--s-4); font-size:9.5px; padding:5px 9px; }
}

/* ---------- 16 · S2 · calculator (phone) ---------------------- */

@media (max-width:767px) {
  /* the tag hangs from a rope and grows on scroll — at this width it just
     makes the section tall and the card jump under the reader's thumb */
  .calc__out, .calc__out.is-hung {
    transform:none; translate:none; scale:none;
    animation:none; will-change:auto; transition:none;
  }
  .calc__out::before, .calc__out::after { display:none; }

  /* compact: the numbers carry this section, not the padding */
  .calc { gap:var(--s-5); }
  .calc__controls { gap:var(--s-5); }
  .calc__out { padding:var(--s-5) var(--s-4); }
  .calc__money { font-size:clamp(3rem,17vw,4.5rem); }
  .calc__label { margin-bottom:var(--s-3); font-size:10px; letter-spacing:.12em; }
  .calc__sub { font-size:10px; }
  .calc .lede { font-size:var(--fs-small); }
}

/* ---------- 17 · S-cells · open / closed ---------------------- */

@media (max-width:767px) {
  /* heading and switch each take the full container width */
  .info .head.split { display:block; }
  .info .head.split > div:first-child { margin-bottom:var(--s-4); }
  .info__switch { justify-self:stretch !important; align-items:stretch; }
  .swx { width:100%; }
  .swx__o { flex:1 1 0; }
  .swx__o span { text-align:center; padding:12px 6px; font-size:1rem; }

  /* "By the numbers" was six label/value/bar stacks plus a key and a
     paragraph — one dense block of text. Tighten the rows and let the
     value sit on the label's line so each metric reads as one unit. */
  .info__card { padding:var(--s-4); }
  .meters { gap:11px; }
  .meter { grid-template-columns:1fr auto; gap:2px 10px; align-items:baseline; }
  .meter__k { font-size:.8125rem; line-height:1.25; }
  .meter__k em { display:block; font-size:.6875rem; line-height:1.2; }
  .meter__v { font-size:1.125rem; }
  .meter__bar { height:7px; margin-top:3px; }
  .meters__key { margin-top:12px; font-size:9.5px; letter-spacing:.1em; }
  .info__line { font-size:.8125rem; line-height:1.45; }
  .info__card figcaption b { font-size:1rem; }
  .info__card figcaption em { font-size:.8125rem; }
}

/* ---------- 18 · S8 · territory ------------------------------- */

@media (max-width:1179px) {
  .terr8__head { grid-template-columns:1fr; gap:var(--s-4); }
  .terr8__lede { max-width:none; }
}
@media (max-width:767px) {
  /* the "See service areas" link belongs with the copy it follows, not
     stranded under the illustration */
  .terrfig figcaption { order:-1; margin-bottom:var(--s-4); }
  .terrfig { align-items:stretch; }
  .terrmap__go { justify-content:flex-start; }
}

/* ---------- 19 · S9 · FAQ ------------------------------------- */

/* tablet: FOAMiE stands beside the heading block, questions run full width */
@media (min-width:768px) and (max-width:1179px) {
  .faq-slab .split--wide { grid-template-columns:1fr; gap:var(--s-7); }
  .faq-aside {
    display:grid; grid-template-columns:minmax(0,1fr) auto;
    gap:var(--s-4) var(--s-7); align-items:center;
  }
  .faq-aside > h2       { grid-column:1; grid-row:1; }
  .faq-aside > .lede    { grid-column:1; grid-row:2; max-width:52ch; }
  .faq-aside > .btn-row { grid-column:1; grid-row:3; }
  .faq-aside > .faq-foamie {
    grid-column:2; grid-row:1 / 4;
    width:min(280px,30vw); margin-top:0; align-self:center;
  }
}
/* phone: heading and copy full width, FOAMiE after the questions */
@media (max-width:767px) {
  .faq-slab .split--wide { display:flex; flex-direction:column; gap:var(--s-6); }
  .faq-aside { display:contents; }
  .faq-slab .acc { order:2; }
  .faq-slab .faq-foamie { order:3; margin-top:var(--s-5); align-self:center; }
  .faq-slab .lede { max-width:none; }
}

/* ---------- 20 · S10 · estimate (tablet) ---------------------- */

@media (min-width:768px) and (max-width:1179px) {
  /* copy above, form below — both the full width of the container */
  .est10 .split--wide { grid-template-columns:1fr; gap:var(--s-7); }
  .est10__panel { align-self:stretch; }
  .est10 .est10__h { white-space:normal; }
}

/* ---------- 21 · footer (phone) ------------------------------- */

@media (max-width:767px) {
  .footer .logo-chip { width:132px; padding:10px; }
  .footer__grid > div:first-child > p:first-of-type { max-width:none !important; }
  .footer__grid > div:first-child > p:last-of-type { display:block; }
}

/* ============================================================
   ROUND 3
   ============================================================ */

/* ---------- 22 · hero art ------------------------------------ */

/* the three crops have three different shapes, so the frame follows the source */
@media (max-width:767px)  { .hero-shot { aspect-ratio:941/1672; } }
@media (min-width:768px) and (max-width:1179px) { .hero-shot { aspect-ratio:1448/1086; } }
.hero-shot picture { display:block; width:100%; height:100%; }

/* Rounded at rest, squaring off as the stage grows. --p and --scale come from
   scrollx.js; dividing by --scale keeps the corner a constant on-screen size
   while the whole stage is being scaled up, and the radius lands on 0 at the
   same progress point (.82) where the image reaches full width. */
.scrollx__stage,
.scrollx__stage.is-ready {
  --hero-r:clamp(12px,2.2vw,26px);
  border-radius:calc(var(--hero-r) * (1 - min(var(--p) / .82, 1)) / var(--scale));
}

/* ---------- 23 · mobile menu type ---------------------------- */

@media (max-width:767px) {
  .mobile-nav .btn { font-size:.9375rem; letter-spacing:.04em; }
}

/* ---------- 24 · S2 · build era + heading -------------------- */

@media (max-width:767px) {
  /* S2 is a .split--wide, not .calc — its 64px column gap is what sits between
     the era pills and the price tag once the columns stack */
  [data-calc] .split { gap:var(--s-5); }
  [data-calc] .display-m br { display:none; }
  [data-calc] .display-m, [data-calc] .lede { max-width:none; }
  [data-calc] .calc__controls { max-width:none !important; margin-top:20px !important; }

  /* four eras on one row: icon over label, every tile the same box */
  .era__opts { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; }
  .era__opt { flex:none; }
  .era__pill {
    flex-direction:column; justify-content:center; gap:5px;
    height:100%; min-height:66px; padding:9px 3px;
    white-space:normal; text-align:center;
    font-size:9.5px; letter-spacing:.04em; line-height:1.1;
  }
  .era__pill svg { width:20px; height:22px; flex:none; }

  /* the era picker and the price tag were a full section-gap apart */
  .calc__controls { gap:var(--s-4); }
  .calc { gap:var(--s-4); }
  .era { margin-bottom:0; }
}

/* ---------- 25 · S4 · index as a drag strip ------------------ */

@media (max-width:767px) {
  /* a grid item's min-width is `auto`, so the nowrap strip would size the whole
     column to its 1550px scroll width and drag the stage out with it */
  .tindex__body > *, .tindex__side, .tindex__list, .tindex__stage, .tpanel { min-width:0; }

  .tindex__list {
    flex-direction:row; flex-wrap:nowrap;
    overflow-x:auto; overscroll-behavior-x:contain;
    scroll-snap-type:x proximity; gap:8px;
    scrollbar-width:none; -webkit-overflow-scrolling:touch;
    margin-inline:calc(var(--slab-pad-x) * -1);
    padding:4px var(--slab-pad-x) 10px;
  }
  .tindex__list::-webkit-scrollbar { display:none; }
  .tix {
    flex:0 0 auto; width:auto; scroll-snap-align:start;
    grid-template-columns:auto auto; align-items:center;
    padding:11px 14px; min-height:48px;
  }
  .tix__t { white-space:nowrap; }
  .tix.is-on { padding-bottom:calc(11px + 6px); }

  /* image over copy, both the full width of the container */
  .tpanel { grid-template-columns:minmax(0,1fr); gap:var(--s-5); }
  .tpanel__fig { max-width:none; width:100%; }
  .tpanel__fig .ph, .tpanel__fig img { aspect-ratio:16/10; width:100%; }
  .tpanel__c h3 { font-size:var(--fs-h3); }
  .tpanel__c p  { font-size:var(--fs-small); }
}

/* ---------- 26 · S4 · tablet stage --------------------------- */

@media (min-width:768px) and (max-width:1179px) {
  /* real air between the photo and the copy, and the pair centred in the slab
     rather than stretched across the full container */
  .tindex__stage { max-width:940px; margin-inline:auto; width:100%; }
  .tpanel {
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    gap:clamp(32px,5vw,60px); align-items:center; justify-items:stretch;
  }
  .tpanel__fig { align-self:center; }
  .tpanel__c   { align-self:center; }
}

/* ---------- 27 · headings that must not break ---------------- */

@media (max-width:1179px) {
  /* the hard <br> holds these to two lines however much room there is;
     the markup carries a space so dropping the break still reads right */
  .info .head h2 br, .terr8__head h2 br { display:none; }
  .terr8__lede, .terr8__head p { max-width:none; }
}
@media (max-width:767px) {
  .info .head h2, .terr8__head h2 { font-size:clamp(1.75rem,7.6vw,2.25rem); }
}

/* ---------- 28 · S8 · territory trim ------------------------- */

@media (max-width:767px) {
  /* no rule above the link, no underline under it, and it sits up against
     the paragraph it belongs to */
  .terrfig figcaption {
    border-top:0; padding-top:0;
    margin:0 0 var(--s-5);
  }
  .terrmap__go { border-bottom:0; padding-bottom:0; }
  .terr8__head { gap:var(--s-3); }
  /* air between the illustration and the crew cards */
  .terrfig { margin-bottom:var(--s-6); }
  .terr8__body { gap:var(--s-6); }
  .terr8__stack { padding-right:0; }
}

/* ---------- 29 · S9 · FAQ rhythm ----------------------------- */

/* the split carries an inline style="gap:64px", which outranks any class rule —
   hence !important rather than a louder selector */
@media (max-width:1179px) {
  .faq-slab .split--wide { gap:var(--s-5) !important; }
  .faq-aside h2 { margin-bottom:var(--s-3); }
  .faq-slab .faq-aside .lede { margin:0 0 var(--s-4); }
  .faq-aside .btn-row { margin-top:0; }
}
@media (min-width:768px) and (max-width:1179px) {
  .faq-aside { gap:var(--s-3) var(--s-7); align-items:start; }
  .faq-aside > .faq-foamie { align-self:center; }
}
@media (max-width:767px) {
  .faq-slab .split--wide { gap:var(--s-4) !important; align-items:stretch; }
  .faq-slab .faq-aside .lede { margin-bottom:var(--s-3); }
  .faq-aside h2 { margin-bottom:var(--s-2); }
}

/* ---------- 30 · S10 · estimate copy (tablet) ---------------- */

@media (min-width:768px) and (max-width:1179px) {
  .est10__left, .est10 .lede, .est10 .steps { max-width:none; width:100%; }
  .est10 .steps__b p { max-width:none; }
  /* four pills, four equal columns, edge to edge */
  .est10 .trustrow {
    display:grid; grid-template-columns:repeat(4,minmax(0,1fr));
    gap:var(--s-3);
  }
  .est10 .trustrow__i { justify-content:center; padding:8px 14px 8px 7px; }
}

/* ---------- 31 · footer -------------------------------------- */

@media (max-width:767px) {
  .footer__grid > div:first-child > .logo { margin-bottom:2px !important; }
  .footer__grid > div:first-child > p:first-of-type { margin-top:0; }
}

/* ============================================================
   ROUND 4
   ============================================================ */

/* ---------- 32 · top nav breathing room ---------------------- */

/* --header-h is the pill's fixed height and --chrome-h derives from it, so
   raising it lifts the mobile-nav offset and the first slab's padding too. */
@media (max-width:833px) {
  :root { --header-h:78px; --pill-scrolled-h:70px; }
  .topnav .logo-chip { height:70px; }
  .topnav.is-scrolled .logo-chip { height:56px; }
}
@media (min-width:834px) and (max-width:1179px) {
  .topnav .logo-chip { height:90px; }   /* the pill is 92px here — do not poke out of it */
  .topnav.is-scrolled .logo-chip { height:62px; }
}
@media (max-width:1179px) {
  /* the links were sitting a full --s-7 below the bar */
  .mobile-nav { padding-top:var(--s-4); }
}
@media (min-width:834px) and (max-width:1179px) {
  :root { --pill-scrolled-h:74px; }
}
@media (max-width:1179px) {
  .topnav.is-scrolled .topnav__pill { height:var(--pill-scrolled-h); }
  /* the panel has to start exactly where the collapsed bar ends, or a strip of
     the page shows through between the two */
  .topnav.is-scrolled + .mobile-nav { top:var(--pill-scrolled-h); }
}

/* ---------- 33 · mobile menu type ---------------------------- */

@media (max-width:1179px) {
  /* .mobile-nav a catches the CTAs too, so both buttons were rendering in
     Anton at 2.25rem instead of the pill type used everywhere else */
  .mobile-nav a:not(.btn) {
    font-family:var(--font-core); font-weight:600;
    font-size:1.125rem; letter-spacing:0; text-transform:none;
  }
  .mobile-nav .btn {
    font-family:var(--font-core); font-weight:700;
    font-size:var(--fs-small); letter-spacing:.03em; text-transform:uppercase;
    border-bottom:0;
  }
}
@media (max-width:767px) {
  .mobile-nav a:not(.btn) { font-size:1.0625rem; min-height:48px; padding-block:var(--s-2); }
  .mobile-nav .btn { font-size:.875rem; }
}

/* ---------- 34 · sticky mascot ------------------------------- */

/* it stays put for the whole scroll now — the cloud still retracts, so what
   remains parked in the corner is FOAMiE alone */
@media (min-width:768px) and (max-width:1179px) {
  .sticky-cta__mascot { width:83px; }              /* 0.8 × 104 */
  .sticky-cta__say { width:clamp(150px,21vw,178px); }
  .sticky-cta__cloudtext { font-size:12px; }
}

/* ---------- 35 · S2 · era pills ------------------------------ */

@media (max-width:767px) {
  .era__pill { border-radius:var(--r-2); }
}

/* ---------- 36 · S4 · panel headings ------------------------- */

@media (max-width:767px) {
  /* the hard break held these to two short lines inside a full-width column */
  .tpanel__c h3 br { display:none; }
  .tpanel__c h3 { max-width:none; }
}

/* ---------- 37 · hero copy ----------------------------------- */

.m-narrow { display:none; }
@media (max-width:767px) {
  .m-wide { display:none; }
  .m-narrow { display:inline; }
}

/* ---------- 38 · footer contact box -------------------------- */

@media (max-width:767px) {
  .footer__grid > div:first-child > p:last-of-type { width:100%; max-width:none; }
}
/* street and town stack by default; on one row once there is width for it */
.f-addr { display:block; }
.f-addr > span { display:block; }
@media (max-width:767px) {
  .f-addr > span { display:inline; }
  .f-addr > span:first-child::after { content:", "; }
}

/* ---------- 39 · inner pages --------------------------------- */

/* Block 6 above keeps every .split--wide two-up from 768px so an iPad is not
   left half empty. That is right for the homepage's calculator, FAQ and
   estimate, which were laid out for it. The inner pages pair a display
   headline with a form panel or a tall photo, and 1.1fr of a 768px viewport
   is about seven characters of Anton. Those splits opt out and stack. */
@media (min-width:768px) and (max-width:1023px) {
  .split--stack-pad { grid-template-columns:1fr; gap:var(--s-7); }
}

/* a right-aligned button row reads as orphaned once the pair has stacked */
@media (max-width:899px) {
  .split > .btn-row[style*="flex-end"] { justify-content:flex-start !important; }
}

/* service detail — the rail is full-bleed cards on a phone, so the hard
   offset shadow has to shrink or it eats the slab's own gutter */
@media (max-width:599px) {
  .sidecard--lead { box-shadow:inset 0 0 0 var(--keyline) var(--ink), 5px 5px 0 var(--cyan); }
  .sidecard--call { box-shadow:5px 5px 0 var(--pink); }
  .svc__block > h2 { font-size:clamp(1.625rem,6.4vw,2.125rem); }
  .steps { gap:var(--s-3); }
  .step { padding:var(--s-4); }
  .step__n { font-size:2rem; }
}

/* the comparison tables carry photos and five columns — they must scroll
   inside their own box, never widen the document */
@media (max-width:1179px) {
  .tablewrap { margin-inline:0; }
  .matrix td .shot { width:120px; }
}
@media (max-width:599px) {
  .matrix td .shot { width:96px; }
  .matrix th, .matrix td { padding:var(--s-3); }
  .matrix thead th { font-size:1rem; }
}

/* breadcrumb + spec pills: real tap targets once there is no mouse */
@media (pointer:coarse) {
  .crumb a { min-height:32px; display:inline-flex; align-items:center; }
  .linklist a { min-height:48px; }
}
