/* UX fixes from round 1 draft page testing (Oct 2026).
   Draft-review visibility, form fallback, mobile header, landing page layout. */

/* ===== 1. Draft-review content visibility =====
   Banners, [WE/I], [PENDING CALUM] and other review markers show only when logged in.
   
   USAGE FOR EDITORS:
   - Add class="draft-review-banner" to any draft/review banner element
   - Add class="draft-marker" to any element with bracketed review markers
   - These will automatically hide for logged-out users
   
   Example in page content:
   <div class="draft-review-banner">Draft: awaiting approval</div>
   <p>This section <span class="draft-marker">[WE/I]</span> needs revision.</p>
*/

body:not(.logged-in) .draft-review-banner,
body:not(.logged-in) .draft-marker {
  display: none !important;
}

/* For inline markers that shouldn't break flow when hidden */
.draft-marker {
  display: inline;
}

/* ===== 2. Form fallback: Email us instead =====
   When form isn't configured, show a clear mailto button instead of generic error.
   Used on /start/, /care-signup/, /rescue/ and anywhere else forms may not load.
*/

.form-fallback {
  max-width: 44rem;
  margin: 0 auto;
  text-align: center;
  padding: 2.5rem 1.5rem;
  border: 1px solid var(--u-line);
  border-radius: 16px;
  background: var(--u-surface);
}

.form-fallback .lead {
  margin-bottom: 1.5rem;
  color: var(--u-text);
}

.form-fallback .btn {
  background: var(--u-action);
  color: var(--u-on-action);
  padding: 1rem 2rem;
  min-height: 52px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.form-fallback .btn:hover {
  filter: brightness(.94);
  color: var(--u-on-action);
}

.form-fallback .reply-time {
  margin-top: 1rem;
  font-size: .9375rem;
  color: var(--u-text-2);
}

/* ===== 3. Form styling: 48px inputs, full-width buttons, mobile usable =====
   Landing forms need larger tap targets and clearer buttons.
*/

/* 48px minimum height for all form inputs on landing pages */
.landing-form input[type=text],
.landing-form input[type=email],
.landing-form input[type=url],
.landing-form input[type=tel],
.landing-form input[type=number],
.landing-form select,
.frm-fluent-form input[type=text],
.frm-fluent-form input[type=email],
.frm-fluent-form input[type=url],
.frm-fluent-form input[type=tel],
.frm-fluent-form input[type=number],
.frm-fluent-form select {
  min-height: 48px;
  font-size: 1rem;
}

/* Full-width primary buttons on forms - brand olive with 8px radius */
.landing-form .ff-btn-submit,
.landing-form .ff_btn_style,
.frm-fluent-form .ff-btn-submit,
.frm-fluent-form .ff_btn_style {
  width: 100%;
  min-height: 52px;
  padding: 1rem 1.4rem;
  font-size: 1rem;
  background: var(--u-action) !important;
  color: var(--u-on-action) !important;
  border-radius: 8px !important;
}

@media (max-width: 820px) {
  .landing-form .ff-btn-submit,
  .landing-form .ff_btn_style,
  .frm-fluent-form .ff-btn-submit,
  .frm-fluent-form .ff_btn_style {
    width: 100%;
    min-height: 52px;
  }
}

/* ===== 4. Mobile header fixes: no overflow, 44px tap targets, slim landing bar =====
   Header must not cause horizontal scroll at <=820px.
   Landing pages (Founding Clients, Health Check) get a slim wordmark-only bar.
*/

@media (max-width: 820px) {
  /* Prevent header overflow */
  .top,
  .top .wrap,
  .top nav {
    overflow: visible;
    max-width: 100%;
  }
  
  .top .wrap {
    overflow-x: clip;
  }
  
  /* 44px minimum tap target for all interactive elements */
  .top nav a,
  .top nav button,
  .btn,
  button,
  a.btn {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Mobile button display: don't override [hidden] attribute */
  .btn:not([hidden]),
  button:not([hidden]) {
    display: inline-flex;
  }
  
  .top nav .btn {
    padding: .75rem 1.2rem;
  }

  /* Funnel door cards must stay grid, and hidden elements must stay hidden */
  .sf-door{display:grid;justify-content:stretch;align-items:start}
  .sf-back[hidden],.sf-nav [hidden]{display:none}
}

/* Slim landing page header (Founding Clients, Health Check pages only)
   
   USAGE FOR EDITORS:
   Apply via body class in page settings or template:
   - Add "landing-page" class to body
   OR use the page-specific classes:
   - Body class "page-founding-clients" or "page-health-check" 
*/

body.landing-page .top,
body.page-founding-clients .top,
body.page-health-check .top {
  border-bottom: 1px solid var(--u-line);
}

body.landing-page .top .wrap,
body.page-founding-clients .top .wrap,
body.page-health-check .top .wrap {
  min-height: 64px;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

body.landing-page .top nav,
body.page-founding-clients .top nav,
body.page-health-check .top nav {
  display: none;
}

/* Sticky mobile CTA bar on landing pages
   
   USAGE FOR EDITORS:
   Add id="form" to your form section so the CTA can scroll to it.
   The bar will auto-hide when both the hero and form are visible.
   
   Targets pages with body classes:
   - landing-page
   - page-founding-clients
   - page-health-check
   
   AND content wrappers with classes:
   - .lp-founding
   - .lp-landing
*/

.sticky-cta-bar {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  z-index: 50;
  background: var(--u-surface);
  border: 1px solid var(--u-line);
  box-shadow: var(--u-shadow);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  display: none;
  align-items: center;
  gap: 1rem;
  transition: transform .3s ease, opacity .3s ease;
}

/* Hidden until JS runs: prevents flash of bar before script loads */
.sticky-cta-bar:not(.is-on) {
  transform: translateY(calc(100% + 2rem));
  opacity: 0;
  pointer-events: none;
}

.sticky-cta-bar.is-on {
  transform: none;
  opacity: 1;
  pointer-events: auto;
}

.sticky-cta-bar .btn {
  flex-shrink: 0;
  white-space: nowrap;
  min-height: 48px;
  padding: .9rem 1.6rem;
  background: var(--u-action);
  color: var(--u-on-action);
  border-radius: 8px;
}

.sticky-cta-bar .btn:hover {
  filter: brightness(.94);
  color: var(--u-on-action);
}

.sticky-cta-bar span {
  font-size: .875rem;
  color: var(--u-text-2);
  flex: 1;
}

/* Show sticky bar on landing pages at mobile width */
@media (max-width: 820px) {
  body.landing-page:has(.lp-landing) .sticky-cta-bar,
  body.landing-page:has(.lp-founding) .sticky-cta-bar,
  body.page-founding-clients:has(.lp-landing) .sticky-cta-bar,
  body.page-founding-clients:has(.lp-founding) .sticky-cta-bar,
  body.page-health-check:has(.lp-landing) .sticky-cta-bar,
  body.page-health-check:has(.lp-founding) .sticky-cta-bar {
    display: flex;
  }
  
  /* Pad page bottom so sticky bar doesn't cover footer */
  body.landing-page:has(.lp-landing),
  body.landing-page:has(.lp-founding),
  body.page-founding-clients:has(.lp-landing),
  body.page-founding-clients:has(.lp-founding),
  body.page-health-check:has(.lp-landing),
  body.page-health-check:has(.lp-founding) {
    padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  }
}

/* Button-only right-aligned at 621-820px */
@media (min-width: 621px) and (max-width: 820px) {
  body.landing-page:has(.lp-landing) .sticky-cta-bar,
  body.landing-page:has(.lp-founding) .sticky-cta-bar,
  body.page-founding-clients:has(.lp-landing) .sticky-cta-bar,
  body.page-founding-clients:has(.lp-founding) .sticky-cta-bar,
  body.page-health-check:has(.lp-landing) .sticky-cta-bar,
  body.page-health-check:has(.lp-founding) .sticky-cta-bar {
    left: auto;
    right: 1rem;
    padding: .5rem;
    border-radius: 12px;
    gap: 0;
  }
  
  body.landing-page:has(.lp-landing) .sticky-cta-bar span,
  body.landing-page:has(.lp-founding) .sticky-cta-bar span,
  body.page-founding-clients:has(.lp-landing) .sticky-cta-bar span,
  body.page-founding-clients:has(.lp-founding) .sticky-cta-bar span,
  body.page-health-check:has(.lp-landing) .sticky-cta-bar span,
  body.page-health-check:has(.lp-founding) .sticky-cta-bar span {
    display: none;
  }
}

/* Full-width stacked layout on narrow screens */
@media (max-width: 620px) {
  .sticky-cta-bar {
    flex-direction: column;
    align-items: stretch;
    gap: .75rem;
  }
  
  .sticky-cta-bar .btn {
    width: 100%;
  }
  
  .sticky-cta-bar span {
    text-align: center;
  }
}

/* Respect reduced motion preference */
@media (max-width: 820px) and (prefers-reduced-motion: reduce) {
  body.landing-page:has(.lp-landing) .sticky-cta-bar,
  body.landing-page:has(.lp-founding) .sticky-cta-bar,
  body.page-founding-clients:has(.lp-landing) .sticky-cta-bar,
  body.page-founding-clients:has(.lp-founding) .sticky-cta-bar,
  body.page-health-check:has(.lp-landing) .sticky-cta-bar,
  body.page-health-check:has(.lp-founding) .sticky-cta-bar {
    transition: none;
  }
}

/* Crisp chat launcher: position above sticky bar on landing pages */
@media (max-width: 820px) {
  body:has(.lp-landing) .crisp-client #crisp-chatbox [data-maximized="false"],
  body:has(.lp-founding) .crisp-client #crisp-chatbox [data-maximized="false"] {
    bottom: 84px;
  }
}

/* ===== 5. Layout CSS fixes =====
   Home carousels, Founding H1, packages grid, Health Check hero, Care card.
*/

/* Home carousels stack on mobile
   Apply class="home-carousel" to carousel containers */

.home-carousel {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 821px) {
  .home-carousel {
    display: flex;
    gap: 2rem;
  }
}

@media (max-width: 820px) {
  .home-carousel {
    grid-template-columns: 1fr;
  }
  
  /* Before/after swap gallery inside home carousel should stack on mobile */
  .home-carousel .swap {
    grid-template-columns: 1fr !important;
    gap: 2rem;
  }
  
  .home-carousel .swap-list,
  .home-carousel .swap-stage {
    grid-column: auto;
  }
  
  /* Stack the swap items (before/after panels) vertically */
  .home-carousel .swap-panel {
    position: relative;
    opacity: 1;
    visibility: visible;
    transform: none;
  }
}

/* Founding Clients H1 with clamp() sizing
   
   USAGE FOR EDITORS:
   Add class="founding-h1" to the H1 element on Founding Clients page
*/

.founding-h1 {
  font-size: clamp(2.5rem, 5.5vw, 4rem);
  line-height: 1.05;
  letter-spacing: -.01em;
}

/* 4-column packages grid with "Most picked" badge
   
   USAGE FOR EDITORS:
   - Wrap package cards in div with class="packages-grid"
   - Add class="most-picked" to the recommended package card
   
   Example:
   <div class="packages-grid">
     <div class="package-card">...</div>
     <div class="package-card most-picked">...</div>
     <div class="package-card">...</div>
     <div class="package-card">...</div>
   </div>
*/

.packages-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

@media (max-width: 980px) {
  .packages-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 620px) {
  .packages-grid {
    grid-template-columns: 1fr;
  }
}

.package-card.most-picked {
  border: 2px solid var(--u-olive);
  position: relative;
  padding-top: 2.25rem;
}

.package-card.most-picked::before {
  content: "Most picked";
  position: absolute;
  top: 1rem;
  left: 1.5rem;
  background: var(--u-olive);
  color: var(--u-paper);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .35rem .75rem;
  border-radius: 999px;
}

/* Two-column Health Check hero (stacks on mobile)
   
   USAGE FOR EDITORS:
   Add class="health-check-hero" to the hero section wrapper
*/

.health-check-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

@media (max-width: 820px) {
  .health-check-hero {
    grid-template-columns: 1fr;
  }
  
  /* Form comes second on mobile for above-fold priority */
  .health-check-hero .form-card {
    order: -1;
  }
}

/* Care plan card: 760px max width, no stray bullets, 16px price column gap
   
   USAGE FOR EDITORS:
   Add class="care-plan-card" to the care plan card container
*/

.care-plan-card {
  max-width: 760px;
  margin: 0 auto;
}

.care-plan-card ul,
.care-plan-card .plan ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Remove the bullet dots that appear from li::before in components.css */
.care-plan-card .plan li::before,
.care-plan-card li::before {
  display: none;
}

.care-plan-card .plan .price {
  gap: 1rem;
  column-gap: 16px;
}

/* Guarantee badge styling - keep brand yellow ONLY for guarantee
   
   USAGE FOR EDITORS:
   Add class="guarantee-badge" to guarantee elements that should use gold accent
*/

.guarantee-badge {
  background: var(--u-gold);
  color: var(--u-ink);
}

/* Brand button colors: Olive (action) for standard buttons, Paper for ink backgrounds.
   Gold is reserved exclusively for guarantee badges. */

/* Dark band buttons use Paper fill per spec, but exclude .btn.quiet to keep outline buttons outline
   (e.g. Home 'See Site Care', Site Care 'Ask a question first') */
[data-ground="ink"] .btn:not(.quiet) {
  background: var(--u-paper);
  color: var(--u-ink);
  border-color: transparent;
}

[data-ground="ink"] .btn:not(.quiet):hover {
  filter: brightness(.94);
}

/* ===== 6. Round 4 additions: typography, header, tap targets, forms =====
   Styles from round 4 draft pages folded into theme. */

/* Link2: underlined links with 44px tap target */
.link2 {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 15px;
  font-weight: 600;
  color: var(--u-text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.link2:hover {
  color: var(--u-text);
  text-decoration-thickness: 2px;
}

.link2:focus-visible {
  outline: 2px solid var(--u-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Paragraph spacing */
.sec p + p,
.hero-say p + p,
.hero-split p + p {
  margin-top: 1em;
}

/* Header: no horizontal overflow at narrow widths, 44px tap targets */
@media (max-width: 768px) {
  /* 44px minimum tap targets for all interactive header and footer elements */
  .top .wm,
  footer .wm {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    min-width: 44px;
  }
  
  .top nav .mtrig {
    min-height: 44px;
    min-width: 44px;
  }
  
  .top nav a.btn.sm {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    box-sizing: border-box;
  }
  
  /* Footer links get 44px tap target */
  footer li a,
  footer .cols a:not(.wm) {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  
  /* Email and inline links */
  a.mail {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  
  /* Form radio/checkbox rows */
  .lead-form label:has(input[type=checkbox]),
  .lead-form label:has(input[type=radio]) {
    display: flex;
    align-items: center;
    min-height: 44px;
  }
  
  /* About page link (specific fix) */
  p > a[href="/about/"]:only-child {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}

/* Header: tighter layout at very narrow widths (360-480px) */
@media (max-width: 480px) {
  .top .wrap {
    gap: .5rem;
  }
  
  /* Logo scales down to 84px */
  .top .wm svg {
    width: 84px;
    height: auto;
  }
  
  /* Nav tighter */
  .top nav {
    gap: .25rem;
    min-width: 0;
  }
  
  .top nav .mtrig {
    padding-left: .4rem;
    padding-right: .4rem;
  }
  
  .top nav a.btn.sm {
    margin-left: 0;
    padding: .5rem .75rem;
    font-size: .8125rem;
    white-space: nowrap;
  }
}

/* Landing page form fields: white inputs, olive buttons, error states */
.landing-form .lead-form {
  background: var(--u-surface);
  color: var(--u-text);
  border-radius: 16px;
  padding: clamp(1.25rem, 3vw, 2rem);
  display: grid;
  gap: 1rem;
  box-shadow: var(--u-shadow);
  text-align: left;
}

.landing-form .lead-form .f {
  display: grid;
  gap: .4rem;
  min-width: 0;
}

.landing-form .lead-form .f[hidden],
.landing-form .lead-form .err[hidden] {
  display: none;
}

.landing-form .lead-form fieldset.f {
  border: 0;
  margin: 0;
  padding: 0;
}

.landing-form .lead-form label,
.landing-form .lead-form legend {
  font-size: .875rem;
  font-weight: 600;
  padding: 0;
}

.landing-form .lead-form .opt {
  font-weight: 400;
  color: var(--u-text-2);
}

/* White background inputs with #8C8C7A borders */
.landing-form .lead-form input:not([type=radio]),
.landing-form .lead-form select,
.landing-form .lead-form textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  border: 1px solid #8C8C7A;
  border-radius: 8px;
  background: #fff;
  color: var(--u-ink);
  font: inherit;
  font-size: 1rem;
  padding: .7rem .9rem;
}

.landing-form .lead-form textarea {
  min-height: 8.5rem;
  resize: vertical;
}

.landing-form .lead-form input:focus-visible,
.landing-form .lead-form select:focus-visible,
.landing-form .lead-form textarea:focus-visible {
  outline: 2px solid var(--u-focus);
  outline-offset: 1px;
}

/* Radio button rows */
.landing-form .lead-form .radios {
  display: grid;
  gap: .5rem;
  margin-top: .4rem;
}

.landing-form .lead-form .radios label {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-height: 48px;
  box-sizing: border-box;
  border: 1px solid #8C8C7A;
  border-radius: 8px;
  background: #fff;
  padding: 0 .9rem;
  font-weight: 500;
  font-size: .9375rem;
  cursor: pointer;
}

.landing-form .lead-form .radios input {
  accent-color: var(--u-olive);
  width: 18px;
  height: 18px;
  margin: 0;
}

/* Submit button: olive #505044 / #F5F5EF with 8px radius */
.landing-form .lead-form .send {
  width: 100%;
  min-height: 52px;
  font-size: 1rem;
}

/* Disabled/placeholder state: olive colors with reduced opacity, not-allowed cursor */
.landing-form .lead-form .send[disabled],
.landing-form .lead-form .btn.send,
.landing-form .lead-form .btn.send[disabled],
.landing-form .lead-form .btn.send:disabled {
  background: #505044;
  color: #F5F5EF;
  border: 0;
  border-radius: 8px;
  opacity: .5;
  cursor: not-allowed;
}

/* Error states: #8A3B2E borders and text */
.landing-form .lead-form [aria-invalid=true] {
  border-color: #8A3B2E;
  box-shadow: inset 0 0 0 1px #8A3B2E;
}

.landing-form .lead-form .f.is-invalid label,
.landing-form .lead-form .f.is-invalid legend {
  color: #8A3B2E;
}

.landing-form .lead-form .err {
  margin: 0;
  color: #8A3B2E;
  font-size: .875rem;
  font-weight: 600;
}

/* Form messages */
.landing-form .lead-form .form-msg {
  margin: 0;
  border-radius: 8px;
  padding: .6rem .85rem;
  font-size: .9375rem;
  font-weight: 600;
}

.landing-form .lead-form .form-msg[hidden] {
  display: none;
}

.landing-form .lead-form .form-summary,
.landing-form .lead-form .form-fail,
.landing-form .lead-form .form-spam {
  color: #8A3B2E;
  background: #fff;
  border: 1px solid #8A3B2E;
}

.landing-form .lead-form .form-fail a {
  color: #8A3B2E;
  text-decoration: underline;
}

.landing-form .lead-form .form-ok {
  color: var(--u-ink);
  background: var(--u-stone);
  border-left: 3px solid var(--u-olive);
}

.landing-form .lead-form .guarantee {
  margin: 0;
  background: var(--u-stone);
  border-left: 3px solid var(--u-olive);
  border-radius: 8px;
  padding: .6rem .85rem;
  font-size: .9375rem;
  font-weight: 600;
  color: var(--u-ink);
}

.landing-form .lead-form .reply {
  margin: 0;
  font-size: .875rem;
  color: var(--u-text-2);
}

.landing-form .lead-form .alt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1rem;
}

.landing-form .draft-review-banner {
  margin: 0;
  padding: .5rem .75rem;
  border-radius: 8px;
  background: #F2D9A6;
  color: #5A3D00;
  font-size: .8125rem;
  font-weight: 600;
}

/* Home split hero: two-column layout with image, single column on mobile */
.hero-split {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 640px;
  background: #F2EBE4;
  color: var(--u-ink);
}

.hero-split .l {
  background: #F2EBE4;
}

.hero-split .r {
  position: relative;
  overflow: hidden;
}

.hero-split .r img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-split .stage {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 1160px;
  margin: 0 auto;
  box-sizing: border-box;
}

.hero-split .stage h1.d {
  font-size: clamp(56px, 7.4vw, 112px);
  line-height: .92;
  font-weight: 900;
  text-transform: lowercase;
  max-width: 13ch;
  margin: 0;
  color: var(--u-ink);
}

.hero-split .sub {
  max-width: 40ch;
  margin: 24px 0 0;
  font-size: 18px;
}

.hero-split .btns {
  margin-top: 26px;
}

.hero-split .trust {
  margin-top: 22px;
  max-width: 44ch;
}

/* Home hero H1: gradient text split (ink left, light right) */
.hero-split .stage h1.d.h1-home {
  text-transform: none;
  text-shadow: none;
  background-color: transparent;
  max-width: none;
  font-size: clamp(46px, 6.4vw, 96px);
  line-height: .96;
  margin: 0;
}

.hero-split .stage h1.h1-home .line {
  display: block;
  white-space: nowrap;
}

@media (min-width: 821px) {
  .hero-split .stage h1.d.h1-home {
    background: linear-gradient(to right, var(--ink, #231F20) 0, var(--ink, #231F20) 50%, #F5F5EF 50%, #F5F5EF 100%) fixed;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
  }
  
  .hero-split .stage .btns {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .5rem;
  }
  
  .hero-split .stage .sub,
  .hero-split .stage .trust,
  .hero-split .stage .btns {
    max-width: min(40ch, calc(50vw - 6rem));
  }
}

/* Mobile: single column, image below */
@media (max-width: 820px) {
  .hero-split {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  
  .hero-split .l {
    display: none;
  }
  
  .hero-split .r {
    order: 2;
    height: 56vw;
    min-height: 220px;
  }
  
  .hero-split .stage {
    position: relative;
    order: 1;
    padding: 84px 20px 36px;
    background: #F2EBE4;
  }
  
  .hero-split .stage h1.d {
    font-size: 46px;
  }
  
  .hero-split .stage h1.d.h1-home {
    color: var(--ink, #231F20);
    font-size: clamp(2.25rem, 9vw, 3.25rem);
  }
  
  .hero-split .stage h1.h1-home .line {
    display: inline;
    white-space: normal;
  }
}

/* Home intro section */
.home-intro {
  padding: clamp(2.5rem, 5vw, 4rem) 0;
}

.home-intro .hero-more {
  max-width: 62ch;
  font-size: 1.0625rem;
}

/* Package grid: improved minmax for proper wrapping */
.packages-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

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

.package-card.most-picked {
  padding-top: 3.25rem;
}

/* Home carousel: flex items with proper sizing */
.home-carousel > .carousel-item {
  min-width: 0;
}

.home-carousel > .carousel-item > .case {
  height: 100%;
  box-sizing: border-box;
}

@media (min-width: 821px) {
  .home-carousel > .carousel-item {
    flex: 1 1 0;
  }
}

/* Home carousel swap gallery: stacks on mobile */
@media (max-width: 900px) {
  .home-carousel .swap {
    grid-auto-flow: row;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-auto-columns: auto;
    overflow: visible;
    scroll-snap-type: none;
    margin: 0;
    padding: 0;
    gap: .75rem;
  }
  
  .home-carousel .swap-item:nth-of-type(n),
  .home-carousel .swap-panel:nth-of-type(n) {
    grid-column: 1;
  }
  
  .home-carousel .swap-panel:nth-of-type(1) { grid-row: 1; }
  .home-carousel .swap-item:nth-of-type(1) { grid-row: 2; }
  .home-carousel .swap-panel:nth-of-type(2) { grid-row: 3; }
  .home-carousel .swap-item:nth-of-type(2) { grid-row: 4; }
  .home-carousel .swap-panel:nth-of-type(3) { grid-row: 5; }
  .home-carousel .swap-item:nth-of-type(3) { grid-row: 6; }
  
  .home-carousel .swap-item {
    margin-bottom: 1.75rem;
  }
  
  .home-carousel .swap-panel .fig .scene {
    height: 240px;
  }
}

/* Health Check hero: two-column at desktop, form order */
@media (min-width: 1024px) {
  .health-check-hero {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  }
}

.health-check-hero h1.d {
  font-size: clamp(2.5rem, 3.9vw, 3.5rem);
  line-height: 1.04;
  max-width: 16ch;
}

/* Health Check: H1 before form on mobile and tablet */
@media (max-width: 1024px) {
  .health-check-hero {
    grid-template-columns: minmax(0, 1fr);
  }
  
  .health-check-hero .form-card {
    order: 0;
  }
}
