/* ================================================================
   CAROLINA SKIES MARKETING — styles.css
   ================================================================
   TABLE OF CONTENTS
   1.  CSS Variables (Design System)
   2.  Reset & Base
   3.  Typography
   4.  Utilities & Layout
   5.  Buttons
   6.  Header & Navigation
   7.  Hero Section
   8.  Solution Section (Problem + Solution split)
   9.  Services Section (Expand Cards + Comparison Table)
   10. Trusted Execution Partners Section
   11. About Section
   12. Contact Section (Form)
   13. Footer
   14. Animations & Scroll Effects
   15. Responsive / Media Queries
   ================================================================ */


/* ================================================================
   1. CSS VARIABLES — Design System
   Edit colors, fonts, spacing, and shadows here.
   ================================================================ */
:root {
  /* ── BRAND COLORS ──────────────────────────────────────────── */
  --sky:        #77c3ec;   /* Carolina sky blue */
  --white:      #ffffff;
  --navy:       #183b49;   /* Deep coastal navy */
  --terracotta: #d4967d;   /* Warm accent */
  --light-sky:  #e9f2f7;   /* Soft background tint */
  --navy-80:    rgba(24, 59, 73, 0.80);
  --navy-60:    rgba(24, 59, 73, 0.60);
  --navy-20:    rgba(24, 59, 73, 0.20);
  --sky-30:     rgba(119, 195, 236, 0.30);
  --sky-15:     rgba(119, 195, 236, 0.15);
  --sky-08:     rgba(119, 195, 236, 0.08);

  /* ── FONTS ─────────────────────────────────────────────────── */
  /* To change fonts: update Google Fonts link in index.html and these variables */
  --font-serif:  'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans:   'DM Sans', system-ui, -apple-system, sans-serif;

  /* ── TYPE SCALE ─────────────────────────────────────────────── */
  --text-xs:    0.75rem;    /* 12px */
  --text-sm:    0.875rem;   /* 14px */
  --text-base:  1rem;       /* 16px */
  --text-md:    1.125rem;   /* 18px */
  --text-lg:    1.25rem;    /* 20px */
  --text-xl:    1.5rem;     /* 24px */
  --text-2xl:   2rem;       /* 32px */
  --text-3xl:   2.5rem;     /* 40px */
  --text-4xl:   3rem;       /* 48px */
  --text-5xl:   3.75rem;    /* 60px */
  --text-6xl:   4.5rem;     /* 72px */

  /* ── SPACING ────────────────────────────────────────────────── */
  --space-xs:   0.5rem;     /* 8px  */
  --space-sm:   1rem;       /* 16px */
  --space-md:   1.5rem;     /* 24px */
  --space-lg:   2.5rem;     /* 40px */
  --space-xl:   4rem;       /* 64px */
  --space-2xl:  6rem;       /* 96px */
  --space-3xl:  8rem;       /* 128px */

  /* ── LAYOUT ─────────────────────────────────────────────────── */
  --container-max:  1200px;
  --container-pad:  clamp(1.5rem, 5vw, 3.5rem);
  /* REVISION: section padding increased slightly for more airiness */
  --section-pad:    clamp(5rem, 9vw, 8rem);

  /* ── BORDER RADIUS ──────────────────────────────────────────── */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-pill: 999px;

  /* ── SHADOWS ────────────────────────────────────────────────── */
  --shadow-sm:   0 1px 3px rgba(24, 59, 73, 0.07), 0 1px 2px rgba(24, 59, 73, 0.05);
  --shadow-md:   0 4px 20px rgba(24, 59, 73, 0.09), 0 2px 8px rgba(24, 59, 73, 0.05);
  --shadow-lg:   0 16px 48px rgba(24, 59, 73, 0.12), 0 4px 16px rgba(24, 59, 73, 0.06);
  --shadow-card: 0 8px 32px rgba(24, 59, 73, 0.08);

  /* ── TRANSITIONS ────────────────────────────────────────────── */
  --ease:        cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --duration-sm: 200ms;
  --duration-md: 350ms;
  --duration-lg: 600ms;

  /* ── HEADER HEIGHT ──────────────────────────────────────────── */
  /* REVISION: reduced from 160px → 80px to match 52px nav logo */
  --header-h: 80px;
}


/* ================================================================
   2. RESET & BASE
   ================================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-weight: 400;
  color: var(--navy);
  background-color: var(--white);
  line-height: 1.7;
  overflow-x: hidden;
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, select, textarea, button {
  font-family: inherit;
  font-size: inherit;
}

/* Accessibility focus ring */
:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}


/* ================================================================
   3. TYPOGRAPHY
   ================================================================ */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

p {
  line-height: 1.75;
}

em {
  font-style: italic;
  font-family: var(--font-serif);
}


/* ================================================================
   4. UTILITIES & LAYOUT
   ================================================================ */

/* Container */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

/* Section base */
.section {
  padding-block: var(--section-pad);
}

/* ── Section label (small uppercase eyebrow) ── */
.section-label {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: var(--space-md);
}

/* ── Section headline ──
   REVISION: max-width widened from 760px → 900px to prevent
   isolated single-word line breaks on wider screens */
.section-headline {
  font-family: var(--font-serif);
  font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl));
  font-weight: 500;
  color: var(--navy);
  line-height: 1.18;
  margin-bottom: var(--space-lg);
  max-width: 900px;
}

/* REVISION: larger headline variant used in Services and Partners sections */
.section-headline--large {
  font-size: clamp(var(--text-2xl), 4.5vw, var(--text-5xl));
  line-height: 1.12;
  letter-spacing: -0.02em;
}

/* ── Section intro paragraph ──
   REVISION: max-width widened from 680px → 820px for better line rhythm */
.section-intro {
  font-size: var(--text-md);
  color: var(--navy-80);
  max-width: 820px;
  margin-bottom: var(--space-xl);
  line-height: 1.85;
}

/* REVISION: extra-wide intro variant for sections with full-width text */
.section-intro--wide {
  max-width: 880px;
}

/* Utility: hidden fields (Netlify honeypot) */
.hidden-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
  height: 0;
  overflow: hidden;
}


/* ================================================================
   5. BUTTONS
   ================================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--radius-pill);
  padding: 0.9rem 2.25rem;
  transition: all var(--duration-md) var(--ease);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

/* Primary — navy fill */
.btn-primary {
  background-color: var(--navy);
  color: var(--white);
  border: 1.5px solid var(--navy);
}
.btn-primary:hover {
  background-color: transparent;
  color: var(--navy);
}

/* Hero — white fill */
.btn-hero {
  background-color: var(--white);
  color: var(--navy);
  border: 1.5px solid var(--white);
  padding: 1rem 2.5rem;
  margin-bottom: var(--space-md);
}
.btn-hero:hover {
  background-color: transparent;
  color: var(--white);
}

/* Card detail CTA */
.btn-card {
  background-color: transparent;
  color: var(--white);
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  font-size: var(--text-xs);
  padding: 0.75rem 1.5rem;
  margin-top: var(--space-md);
  align-self: flex-start;
}
.btn-card:hover {
  background-color: var(--white);
  color: var(--navy);
  border-color: var(--white);
}

/* Nav CTA */
.nav-cta {
  padding: 0.6rem 1.4rem;
  font-size: var(--text-xs);
}

/* Submit */
.btn-submit {
  min-width: 180px;
}


/* ================================================================
   6. HEADER & NAVIGATION
   ================================================================ */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background-color: transparent;
  transition: background-color var(--duration-md) var(--ease),
              box-shadow var(--duration-md) var(--ease),
              backdrop-filter var(--duration-md) var(--ease);
}

/* Scrolled state — JS adds .is-scrolled */
.site-header.is-scrolled {
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-shrink: 0;
}

/* Logo image — shown when images/logo.png is present.
   REVISION: reduced from 144px → 52px for a balanced top-nav proportion.
   Header height reduced to 80px to match. Footer logo is separate
   (.logo-img--footer) and deliberately kept at its larger size. */
.logo-img {
  height: 52px;
  width: auto;
  object-fit: contain;
}

/* Fallback text logo — shown if logo.png hasn't been added yet */
.logo-text-fallback {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--white);
  letter-spacing: 0.02em;
  transition: color var(--duration-md) var(--ease);
  display: none;
}

.site-header.is-scrolled .logo-text-fallback {
  color: var(--navy);
}

/* Show fallback if image errors */
.logo-img.img-error {
  display: none;
}
.logo-img.img-error ~ .logo-text-fallback {
  display: block;
}

/* Nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav-link {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--white);
  position: relative;
  padding-bottom: 2px;
  transition: color var(--duration-sm) var(--ease);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: currentColor;
  transition: width var(--duration-md) var(--ease);
}
.nav-link:hover::after { width: 100%; }

.site-header.is-scrolled .nav-link {
  color: var(--navy);
}

/* Mobile hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 4px;
  cursor: pointer;
}

.hamburger-line {
  display: block;
  width: 22px;
  height: 1.5px;
  background-color: var(--white);
  transition: transform var(--duration-md) var(--ease),
              opacity var(--duration-sm) var(--ease),
              background-color var(--duration-md) var(--ease);
  transform-origin: center;
}

.site-header.is-scrolled .hamburger-line {
  background-color: var(--navy);
}

.nav-toggle.is-open .hamburger-line:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.is-open .hamburger-line:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.is-open .hamburger-line:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }


/* ================================================================
   7. HERO SECTION
   ================================================================ */

.hero {
  position: relative;
  min-height: 100svh;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

/* ── HERO BACKGROUND IMAGE ──────────────────────────────────────
   Replace "images/hero-ocean-sky.jpg" with your final photography.
   background-position: adjust to best frame your photo.
   ────────────────────────────────────────────────────────────── */
.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('images/hero-ocean-sky.jpg');
  background-size: cover;
  background-position: center 60%;
  background-repeat: no-repeat;
  background-color: var(--navy); /* placeholder color until image loads */
  will-change: transform;
  transform: translateZ(0);
}

/* ── HERO OVERLAY ───────────────────────────────────────────────
   REVISION: overlay lightened significantly so background image
   can breathe more. Reduced from 0.72/0.45/0.30 → 0.48/0.28/0.12.
   If text becomes hard to read with your photo, increase the
   first opacity value slightly.
   ────────────────────────────────────────────────────────────── */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    145deg,
    rgba(24, 59, 73, 0.48) 0%,
    rgba(24, 59, 73, 0.28) 55%,
    rgba(24, 59, 73, 0.12) 100%
  );
  z-index: 1;
}

/* Hero content */
.hero-content {
  position: relative;
  z-index: 2;
  /* REVISION: more top padding for better vertical centering with header */
  padding-top: calc(var(--header-h) + var(--space-2xl));
  padding-bottom: var(--space-3xl);
}

/* REVISION: hero text block widened (was 760px) and given
   generous left breathing room on large screens */
.hero-text {
  max-width: 820px;
}

.hero-headline {
  font-family: var(--font-serif);
  font-size: clamp(var(--text-3xl), 5.5vw, var(--text-6xl));
  font-weight: 500;
  color: var(--white);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-lg);
}

.hero-headline em {
  font-style: italic;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.9);
}

/* REVISION: subheadline max-width widened to 720px to prevent
   the word "brand" at the end from orphaning on its own line.
   Also nudged font size slightly to improve overall line rhythm. */
.hero-sub {
  font-size: clamp(var(--text-md), 1.7vw, var(--text-lg));
  color: rgba(255, 255, 255, 0.92);
  max-width: 720px;
  line-height: 1.8;
  margin-bottom: var(--space-xl);
  font-weight: 300;
}

/* REVISION: Wrap around hero CTA button to center it independently
   while keeping the headline and subheadline left-aligned. */
.hero-cta-wrap {
  margin-bottom: var(--space-md);
  /* Center the button on all screen sizes */
  display: flex;
  justify-content: center;
  /* On desktop the hero text is left-aligned — align CTA to start of text block */
}

/* Override margin-bottom on btn-hero since .hero-cta-wrap provides it */
.hero-cta-wrap .btn-hero {
  margin-bottom: 0;
}

.hero-credibility {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.60);
  font-style: italic;
  letter-spacing: 0.01em;
  text-align: center; /* Align credibility line under centered CTA */
}


/* ================================================================
   8. SOLUTION SECTION (The Problem + The Solution)
   REVISION: Split into two clearly labeled parts with a
   two-column solution reveal layout + image placeholder.
   ================================================================ */

.solution {
  background-color: var(--white);
}

/* Pain points grid
   REVISION: Converted to a horizontal scroll strip on all screen sizes.
   flex-wrap:nowrap + overflow-x:auto creates a swipeable row. Fixed card
   widths mean a partial card always peeks in from the right edge, naturally
   signalling "there's more." scroll-snap gives each swipe a clean landing.
   Scrollbar is hidden for a premium, invisible-rail feel on all devices.
   Mobile gets narrower cards (272px) via the media query override below. */
.pain-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.pain-grid::-webkit-scrollbar {
  display: none;
}

.pain-card {
  /* REVISION: Fixed 300px width for the horizontal scroll row.
     On a ~1100px desktop container this shows ≈ 3.3 cards — enough
     to read comfortably while making the fourth card peek visibly. */
  flex: 0 0 300px;
  min-width: 0;
  scroll-snap-align: start;
  background-color: var(--light-sky);
  border: 1px solid rgba(119, 195, 236, 0.18);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-lg);
  transition: transform var(--duration-md) var(--ease),
              box-shadow var(--duration-md) var(--ease);
}

.pain-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.pain-icon {
  width: 34px;
  height: 34px;
  color: var(--sky);
  margin-bottom: var(--space-md);
}

.pain-icon svg {
  width: 100%;
  height: 100%;
}

/* REVISION: pain card titles slightly larger */
.pain-title {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: 500;
  color: var(--navy);
  margin-bottom: var(--space-sm);
  line-height: 1.25;
}

.pain-body {
  font-size: var(--text-base);
  color: var(--navy-80);
  line-height: 1.8;
}

/* ── Solution section: chaos → clarity graphics column ──
   REVISION: Graphics moved from the old horizontal problem-graphic-row
   into the solution section right column, stacked vertically.
   This keeps the visual journey (chaos → clarity) paired with the
   solution copy, making both halves of the story feel connected.
   ────────────────────────────────────────────────────────────── */
.solution-graphics-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

/* Individual graphic card
   REVISION: Reduced vertical padding (was space-lg / 40px top+bottom)
   to space-sm (16px) so less dead space surrounds each image. */
.solution-graphic {
  width: 100%;
  border-radius: var(--radius-xl);
  padding: var(--space-sm) var(--space-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  text-align: center;
}

/* Chaos card — warm terracotta tint */
.solution-graphic--chaos {
  background: linear-gradient(145deg, rgba(212, 150, 125, 0.10) 0%, rgba(212, 150, 125, 0.04) 100%);
  border: 1px solid rgba(212, 150, 125, 0.24);
}

/* Clarity card — sky tint */
.solution-graphic--clarity {
  background: linear-gradient(145deg, rgba(119, 195, 236, 0.12) 0%, rgba(119, 195, 236, 0.04) 100%);
  border: 1px solid rgba(119, 195, 236, 0.24);
}

/* Graphic image — fills the card, constrained height for balance
   REVISION: Increased max-height from 180px → 260px and switched to
   width:100% so the image expands to the full card width. object-fit:contain
   preserves the aspect ratio without cropping. The larger size gives the
   chaos/clarity graphics more visual presence in the solution column. */
.solution-graphic-img {
  max-width: 100%;
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  display: block;
  border-radius: var(--radius-md);
}

/* Caption below each graphic */
.solution-graphic-caption {
  font-family: var(--font-serif);
  font-size: var(--text-sm);
  font-style: italic;
  color: var(--navy-60);
  letter-spacing: 0.02em;
}

/* Downward arrow connector between graphics */
.solution-graphic-connector {
  flex-shrink: 0;
  width: 20px;
  color: var(--terracotta);
  opacity: 0.45;
}

.solution-graphic-connector svg {
  width: 100%;
  height: auto;
}

/* ── Solution reveal wrapper (contains divider + two-col layout) ── */
.solution-reveal {
  /* REVISION: top padding creates clear separation from pain grid */
  padding-top: var(--space-lg);
}

/* ── Divider between The Problem and The Solution ── */
.solution-divider {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-3xl);
}

.solution-divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--sky-30), transparent);
}

.solution-divider-mark {
  font-size: var(--text-sm);
  color: var(--sky);
  opacity: 0.6;
  letter-spacing: 0;
  flex-shrink: 0;
}

/* ── Two-column layout: text left, image right ── */
.solution-reveal-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(var(--space-xl), 6vw, var(--space-3xl));
  align-items: center;
  margin-bottom: var(--space-3xl);
}

/* Solution text column */
.solution-reveal-text {
  /* no extra constraint — let it fill the grid column */
}

/* REVISION: solution headline uses a larger, more impactful size */
.solution-headline {
  font-family: var(--font-serif);
  font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl));
  font-weight: 500;
  color: var(--navy);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-lg);
}

.solution-text {
  font-size: var(--text-md);
  color: var(--navy-80);
  margin-bottom: var(--space-xl);
  line-height: 1.85;
}

.outcome-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.outcome-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  font-size: var(--text-base);
  color: var(--navy);
  line-height: 1.6;
}

.outcome-check {
  color: var(--terracotta);
  font-size: var(--text-base);
  flex-shrink: 0;
  padding-top: 2px;
  opacity: 0.75;
}

/* ── Solution image placeholder (removed) ──
   REVISION: lifestyle photo placeholder removed. The right column
   now uses .solution-graphics-col with the chaos/clarity images.
   See the .solution-graphics-col block earlier in this section. ──

/* ── Closing lines ── */
.solution-close {
  text-align: center;
  padding-top: var(--space-xl);
  border-top: 1px solid var(--sky-15);
  margin-bottom: var(--space-xl);
}

.solution-close-line {
  font-size: var(--text-lg);
  color: var(--navy-60);
  line-height: 1.65;
}

.solution-close-emphasis {
  font-family: var(--font-serif);
  font-size: clamp(var(--text-xl), 2.5vw, var(--text-3xl));
  font-style: italic;
  color: var(--navy);
  margin-top: var(--space-sm);
}

/* REVISION: Work With Me CTA centered below the solution closing statement */
.solution-cta-wrap {
  display: flex;
  justify-content: center;
  padding-top: var(--space-md);
}


/* ================================================================
   9. SERVICES SECTION
   REVISION: Replaced 3D flip cards with a reliable click-to-expand
   accordion panel. Cards are always fully visible; details expand
   in-place with a smooth animation.
   ================================================================ */

.services {
  background-color: var(--light-sky);
}

/* ── Cards grid ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  /* REVISION: less bottom margin than before — comparison table has its own spacing */
  margin-bottom: var(--space-2xl);
  /* REVISION: align-items removed (defaults to stretch) so all three cards
     grow to the same height as the tallest card. .service-card uses
     display:flex so .card-header fills the extra space naturally. */
}

/* ── Individual card ──
   REVISION: Cards are now a simple block, no perspective/3D needed.
   All content lives in .card-header (always visible) and
   .card-detail (expands on click).
   REVISION: display:flex + flex-direction:column lets .card-header
   grow via flex:1, forcing all cards to the same height as the tallest
   card in the row even when one card has less text. ── */
.service-card {
  background-color: var(--white);
  border: 1px solid rgba(119, 195, 236, 0.18);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--duration-md) var(--ease),
              transform var(--duration-md) var(--ease);
  outline: none;
}

.service-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

/* Featured card — navy background */
.service-card--featured {
  background: linear-gradient(160deg, var(--navy) 0%, #1e4d61 100%);
  border-color: transparent;
}

/* ── Card header (always visible) ── */
/* REVISION: flex:1 makes the header grow to fill available card height,
   so shorter-content cards (Growth Advisor) match the tallest card. */
.card-header {
  padding: var(--space-xl) var(--space-lg);
  flex: 1;
}

/* Header top row: tier number + expand icon */
.card-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.card-tier-label {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--sky);
}

/* REVISION: expand icon — JS rotates to × when open */
.card-expand-icon {
  font-size: var(--text-xl);
  font-weight: 300;
  color: var(--sky);
  line-height: 1;
  transition: transform var(--duration-md) var(--ease),
              color var(--duration-sm);
  user-select: none;
}

/* Rotates to × when expanded */
.service-card.is-expanded .card-expand-icon {
  transform: rotate(45deg);
}

/* REVISION: card titles larger and more editorial */
.card-title {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-weight: 500;
  color: var(--navy);
  line-height: 1.2;
  margin-bottom: var(--space-md);
}

.service-card--featured .card-title {
  color: var(--white);
}

.card-best-for-label {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: var(--space-xs);
}

.service-card--featured .card-best-for-label {
  color: var(--sky);
}

.card-best-for {
  font-size: var(--text-sm);
  color: var(--navy-80);
  line-height: 1.7;
  margin-bottom: var(--space-md);
}

.service-card--featured .card-best-for {
  color: rgba(255, 255, 255, 0.78);
}

.card-description {
  font-size: var(--text-sm);
  color: var(--navy-60);
  line-height: 1.75;
  padding-top: var(--space-md);
  border-top: 1px solid var(--sky-15);
}

.service-card--featured .card-description {
  color: rgba(255, 255, 255, 0.60);
  border-color: rgba(255, 255, 255, 0.10);
}

/* ── Card detail panel ──
   Expands via max-height animation.
   JS adds/removes .is-open.
   aria-hidden toggled by JS.
   ────────────────────────────────────────────────────────────── */
.card-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s var(--ease-out);
}

.card-detail.is-open {
  max-height: 500px; /* large enough for all content */
}

.card-detail-inner {
  display: flex;
  flex-direction: column;
  padding: var(--space-lg);
  padding-top: 0;
  /* Top border visually separates from card-header */
  border-top: 1px solid var(--sky-15);
  background: linear-gradient(160deg, var(--navy) 0%, #1e4d61 100%);
}

/* Featured card detail matches parent bg */
.service-card--featured .card-detail-inner {
  border-color: rgba(255, 255, 255, 0.08);
}

/* Detail inner gets top padding so content isn't flush with border */
.card-detail.is-open .card-detail-inner {
  padding-top: var(--space-lg);
}

.card-what-label {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sky);
  margin-bottom: var(--space-sm);
}

.card-includes {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.card-includes li {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.85);
  padding-left: var(--space-md);
  position: relative;
  line-height: 1.6;
}

.card-includes li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--sky);
  font-size: var(--text-xs);
  top: 2px;
}


/* ── COMPARISON TABLE ──
   REVISION: Check marks much larger and more visible.
   Dash markers now use a centered dot — clearly distinct.
   Row padding improved for better legibility.
   ────────────────────────────────────────────────────────────── */
.comparison-wrap {
  margin-top: var(--space-sm);
}

.comparison-title {
  font-family: var(--font-serif);
  font-size: clamp(var(--text-xl), 2.5vw, var(--text-2xl));
  font-weight: 500;
  color: var(--navy);
  text-align: center;
  margin-bottom: var(--space-xl);
}

.comparison-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  -webkit-overflow-scrolling: touch;
}

.comparison-table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  background-color: var(--white);
}

.comparison-table thead {
  background-color: var(--navy);
}

.comparison-table thead th {
  color: var(--white);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  /* REVISION: more padding for breathing room */
  padding: var(--space-lg) var(--space-md);
  text-align: center;
}

.comparison-table thead th.feature-col {
  text-align: left;
  width: 42%;
  padding-left: var(--space-lg);
}

.comparison-table tbody tr {
  border-bottom: 1px solid var(--sky-08);
  transition: background-color var(--duration-sm);
}

.comparison-table tbody tr:last-child { border-bottom: none; }

.comparison-table tbody tr:nth-child(even) {
  background-color: rgba(233, 242, 247, 0.5);
}

.comparison-table tbody tr:hover {
  background-color: var(--sky-15);
}

.comparison-table td {
  /* REVISION: row height increased for legibility */
  padding: var(--space-sm) var(--space-md);
  text-align: center;
  vertical-align: middle;
}

.feature-name {
  text-align: left !important;
  padding-left: var(--space-lg) !important;
  font-size: var(--text-sm);
  color: var(--navy);
}

/* REVISION: Check marks significantly larger and bolder.
   ✦ at 1.5rem in terracotta copper is immediately readable at a glance. */
.check {
  color: var(--terracotta);
  font-size: 1.5rem;
  line-height: 1;
  display: inline-block;
  /* Slight drop-shadow to make ✦ pop off the table background */
  filter: drop-shadow(0 0 4px rgba(212, 150, 125, 0.35));
}

/* REVISION: Not-included markers are clearly muted and minimal —
   a small centered dot at reduced opacity creates obvious contrast
   with the sky-blue ✦ check mark. */
.dash {
  color: var(--navy-20);
  font-size: 0.55rem;
  line-height: 1;
  display: inline-block;
  /* Render as a solid circle for clean, unambiguous "not included" */
  width: 7px;
  height: 7px;
  background-color: var(--navy-20);
  border-radius: 50%;
  font-size: 0; /* hide the · character; circle is drawn via CSS */
  vertical-align: middle;
}

.comparison-note {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--navy-60);
  font-style: italic;
  margin-top: var(--space-lg);
  max-width: 680px;
  margin-inline: auto;
  line-height: 1.75;
}


/* ================================================================
   10. TRUSTED EXECUTION PARTNERS SECTION
   REVISION: Text layout rebalanced — removed the narrow left-push
   that was caused by constrained max-width on body copy. All text
   now flows naturally at the section width.
   ================================================================ */

.partners {
  background-color: var(--white);
}

/* ── 3-Step Visual Process ──
   REVISION: Replaced paragraph copy with a scannable horizontal
   3-step layout that quickly communicates the Carolina Skies model.
   ────────────────────────────────────────────────────────────── */
.partners-steps {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin-bottom: var(--space-2xl);
  /* Subtle card background to frame the process */
  background-color: var(--light-sky);
  border: 1px solid rgba(212, 150, 125, 0.18);
  border-radius: var(--radius-xl);
  padding: var(--space-xl) var(--space-lg);
}

.partners-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-inline: var(--space-md);
  position: relative;
}

/* Step icon — terracotta SVG above each step number */
.partners-step-icon {
  width: 36px;
  height: 36px;
  color: var(--terracotta);
  margin-bottom: var(--space-xs);
  opacity: 0.85;
}

.partners-step-icon svg {
  width: 100%;
  height: 100%;
}

.partners-step-number {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--terracotta);
  margin-bottom: var(--space-sm);
}

.partners-step-title {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--navy);
  line-height: 1.3;
  margin-bottom: var(--space-sm);
}

.partners-step-body {
  font-size: var(--text-sm);
  color: var(--navy-80);
  line-height: 1.75;
}

/* Arrow connector between steps */
.partners-step-connector {
  flex-shrink: 0;
  width: 40px;
  padding-top: var(--space-lg); /* Align arrow vertically with step titles */
  color: var(--terracotta);
  opacity: 0.45;
  align-self: flex-start;
  margin-top: calc(var(--space-sm) + var(--text-xs)); /* fine-tune vertical alignment */
}

.partners-step-connector svg {
  width: 100%;
  height: auto;
}

/* Partner categories grid */
.partners-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-block: var(--space-2xl);
}

/* REVISION: partner cards restyled to be visually distinct from the
   light-sky 3-step model above. White background + navy border + terracotta
   top accent bar clearly marks these as a different kind of content. */
.partner-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xl) var(--space-md);
  background-color: var(--white);
  border: 1px solid rgba(24, 59, 73, 0.10);
  border-top: 2.5px solid var(--terracotta);
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-md) var(--ease),
              box-shadow var(--duration-md) var(--ease),
              border-top-color var(--duration-sm) var(--ease);
}

.partner-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.partner-icon {
  width: 32px;
  height: 32px;
  color: var(--sky);
}

.partner-icon svg {
  width: 100%;
  height: 100%;
}

.partner-label {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy);
}

/* REVISION: flexibility note sits between the partner grid and the closing line */
.partners-flexibility {
  font-size: var(--text-sm);
  color: var(--navy-60);
  text-align: center;
  max-width: 640px;
  margin-inline: auto;
  line-height: 1.75;
  margin-bottom: var(--space-lg);
  font-style: italic;
}

.partners-close {
  font-family: var(--font-serif);
  font-size: clamp(var(--text-xl), 2.5vw, var(--text-2xl));
  font-style: italic;
  color: var(--navy);
  text-align: center;
  max-width: 720px;
  margin-inline: auto;
  line-height: 1.5;
}

/* ── Partners section: bridge heading between 3-step model and cards ──
   REVISION: Added to visually separate the "how it works" explanation
   from the "what's available" execution categories below it.
   ────────────────────────────────────────────────────────────── */
.partners-category-header {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
  margin-top: var(--space-sm);
}

.partners-category-rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 150, 125, 0.30), transparent);
}

.partners-category-header-text {
  text-align: center;
  flex-shrink: 0;
  max-width: 480px;
}

.partners-category-label {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: var(--space-xs);
}

.partners-category-intro {
  font-size: var(--text-sm);
  color: var(--navy-60);
  line-height: 1.7;
  font-style: italic;
}

/* REVISION: add-on disclaimer below the intro line */
.partners-category-note {
  font-size: var(--text-xs);
  color: var(--navy-60);
  line-height: 1.7;
  margin-top: var(--space-xs);
  opacity: 0.85;
}

/* ── Partner card click-to-reveal detail ──
   Cards are tappable/clickable to reveal a description.
   JS toggles .is-expanded; max-height transition animates open.
   ────────────────────────────────────────────────────────────── */
.partner-item {
  cursor: pointer;
}

.partner-item:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 2px;
}

.partner-detail {
  max-height: 0;
  overflow: hidden;
  width: 100%;
  transition: max-height 0.4s var(--ease-out);
}

.partner-item.is-expanded .partner-detail {
  max-height: 160px;
}

.partner-detail-text {
  font-size: var(--text-xs);
  color: var(--navy-80);
  line-height: 1.7;
  padding-top: var(--space-sm);
  margin-top: var(--space-xs);
  border-top: 1px solid rgba(119, 195, 236, 0.22);
  text-align: center;
  letter-spacing: 0.01em;
}

/* Visual feedback — expanded state */
.partner-item.is-expanded {
  background-color: var(--white);
  border-color: rgba(212, 150, 125, 0.30);
  box-shadow: var(--shadow-md);
}

/* Expand hint icon on partner label
   REVISION: enlarged from text-xs (12px) to text-xl (20px), displayed on its
   own centered line so it reads as a clear interactive affordance. */
.partner-label::after {
  content: '+';
  display: block;
  font-size: var(--text-xl);
  line-height: 1;
  margin-top: 0.5rem;
  color: var(--terracotta);
  opacity: 0.85;
  font-family: var(--font-sans);
  font-weight: 300;
  letter-spacing: 0;
  text-transform: none;
}

.partner-item.is-expanded .partner-label::after {
  content: '−';
}


/* ================================================================
   11. ABOUT SECTION
   ================================================================ */

.about {
  background-color: var(--light-sky);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(var(--space-xl), 6vw, var(--space-3xl));
  align-items: start;
}

.about-text {
  padding-top: var(--space-md);
}

.about-body {
  font-size: var(--text-base);
  color: var(--navy-80);
  margin-bottom: var(--space-md);
  line-height: 1.9;
  max-width: 520px;
}

.about-personal {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-style: italic;
  color: var(--navy);
  margin-bottom: var(--space-xl);
  max-width: 480px;
  line-height: 1.65;
}

/* About images layout */
.about-images {
  display: grid;
  grid-template-rows: auto auto;
  gap: var(--space-md);
}

.about-img-wrap {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-color: var(--sky-15);
  min-height: 280px;
}

.about-img-wrap--top {
  margin-right: var(--space-lg);
}

.about-img-wrap--bottom {
  margin-left: var(--space-lg);
  margin-top: calc(-1 * var(--space-xl));
}

.about-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 280px;
  display: block;
  transition: transform var(--duration-lg) var(--ease);
}

.about-img-wrap:hover .about-img {
  transform: scale(1.03);
}

/* Image placeholder — visible until real photos are added */
.img-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  background: linear-gradient(135deg, var(--light-sky), rgba(119, 195, 236, 0.22));
  border: 1.5px dashed rgba(119, 195, 236, 0.4);
  border-radius: var(--radius-lg);
  color: var(--navy-60);
  font-size: var(--text-xs);
  font-family: var(--font-sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
}

/* Hide placeholder once real image loads via JS */
.about-img.img-loaded + .img-placeholder {
  display: none;
}


/* ================================================================
   12. CONTACT SECTION
   ================================================================ */

.contact {
  background-color: var(--white);
}

.contact-inner {
  max-width: 760px;
  margin-inline: auto;
}

.contact-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.contact-header .section-headline {
  text-align: center;
  max-width: 580px;
  margin-inline: auto;
}

.contact-header .section-intro {
  text-align: center;
  margin-inline: auto;
  margin-bottom: 0;
}

/* Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.form-label {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--navy);
}

.required { color: var(--terracotta); }

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.9rem 1.1rem;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--navy);
  background-color: var(--light-sky);
  border: 1.5px solid rgba(119, 195, 236, 0.28);
  border-radius: var(--radius-md);
  transition: border-color var(--duration-sm) var(--ease),
              box-shadow var(--duration-sm) var(--ease),
              background-color var(--duration-sm) var(--ease);
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--navy-60);
  opacity: 0.55;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--sky);
  background-color: var(--white);
  box-shadow: 0 0 0 3px var(--sky-15);
}

.form-textarea {
  resize: vertical;
  min-height: 130px;
  line-height: 1.7;
}

.select-wrap {
  position: relative;
}

.form-select {
  cursor: pointer;
  padding-right: 2.5rem;
}

.select-arrow {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--navy-60);
  font-size: var(--text-sm);
  pointer-events: none;
}

.form-submit {
  display: flex;
  justify-content: center;
  padding-top: var(--space-sm);
}

/* Success message */
.form-success {
  display: none;
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
}

.form-success.is-visible {
  display: block;
}

.form-success-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.success-icon {
  font-size: var(--text-2xl);
  color: var(--sky);
  animation: gentle-pulse 2.4s ease-in-out infinite;
}

.form-success p {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-style: italic;
  color: var(--navy);
  max-width: 400px;
  line-height: 1.6;
}

@keyframes gentle-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(0.93); }
}


/* ================================================================
   13. FOOTER
   ================================================================ */

.site-footer {
  background-color: var(--navy);
  padding-block: var(--space-xl);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  text-align: center;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-xs);
}

/* ── Footer logo image ──
   REVISION: Removed filter: brightness(0) invert(1) which was converting
   the logo into a flat white circle. Logo now displays naturally on the
   navy background. Image is shown by default; hidden only on load error.
   REVISION 2: Increased from 48px → 160px (≈3.3× larger) so the logo
   reads clearly as the footer brand mark. Mobile reduced to 100px.
   If your logo has dark elements that are hard to see on navy, swap in
   a white-variant file at images/logo-white.png in the footer HTML. */
.logo-img--footer {
  height: 160px;
  display: block; /* visible by default — no JS required */
}

/* Hide footer image only if it fails to load (JS adds .img-error) */
.logo-img--footer.img-error {
  display: none;
}

/* ── Footer text fallback ──
   Hidden by default. Only shown if the logo image errors.
   Uses the same sibling-selector pattern as the header logo. */
.logo-text-fallback--footer {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--white);
  letter-spacing: 0.02em;
  display: none; /* hidden by default */
}

/* Show footer text fallback only when logo image errors */
.logo-img--footer.img-error ~ .logo-text-fallback--footer {
  display: block;
}

.footer-tagline {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.60);
  letter-spacing: 0.04em;
}

.footer-copy {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.30);
  letter-spacing: 0.06em;
  margin-top: var(--space-sm);
}


/* ================================================================
   14. ANIMATIONS & SCROLL EFFECTS
   ================================================================ */

/* Fade-up: initial invisible state */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--duration-lg) var(--ease-out),
              transform var(--duration-lg) var(--ease-out);
}

/* Visible state: JS adds .is-visible */
.fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered delays for pain cards */
.pain-grid .pain-card:nth-child(1) { transition-delay: 0ms; }
.pain-grid .pain-card:nth-child(2) { transition-delay: 80ms; }
.pain-grid .pain-card:nth-child(3) { transition-delay: 160ms; }
.pain-grid .pain-card:nth-child(4) { transition-delay: 240ms; }
.pain-grid .pain-card:nth-child(5) { transition-delay: 320ms; }

/* Staggered delays for partner items */
.partners-grid .partner-item:nth-child(1) { transition-delay: 0ms; }
.partners-grid .partner-item:nth-child(2) { transition-delay: 55ms; }
.partners-grid .partner-item:nth-child(3) { transition-delay: 110ms; }
.partners-grid .partner-item:nth-child(4) { transition-delay: 165ms; }
.partners-grid .partner-item:nth-child(5) { transition-delay: 220ms; }
.partners-grid .partner-item:nth-child(6) { transition-delay: 275ms; }
.partners-grid .partner-item:nth-child(7) { transition-delay: 330ms; }
.partners-grid .partner-item:nth-child(8) { transition-delay: 385ms; }

/* Cards grid and partners grid use the same fade-up class */
.cards-grid,
.partners-grid {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--duration-lg) var(--ease-out),
              transform var(--duration-lg) var(--ease-out);
}

.cards-grid.is-visible,
.partners-grid.is-visible {
  opacity: 1;
  transform: translateY(0);
}


/* ================================================================
   15. RESPONSIVE — Media Queries
   ================================================================ */

/* ── Elements that are mobile-only (hidden on desktop by default) ──
   Each of these is switched on inside a media query below. */

/* Mobile nav overlay — full-screen, lives outside <header> */
.mobile-nav-overlay { display: none; }

/* Mobile comparison cards — replace horizontal table on mobile */
.comparison-mobile { display: none; }

/* Mobile about image — single image below heading on mobile */
.about-mobile-img { display: none; }

/* ── TABLET (max 1024px) ──────────────────────────────────────── */
@media (max-width: 1024px) {

  /* Services cards: 2-column + centered third card */
  .cards-grid {
    grid-template-columns: 1fr 1fr;
  }

  .cards-grid .service-card:nth-child(3) {
    grid-column: 1 / -1;
    max-width: 520px;
    margin-inline: auto;
  }

  /* Partners grid: keep 4 across on tablet */
  .partners-grid {
    grid-template-columns: repeat(4, 1fr);
  }

}

/* ── TABLET (max 1024px) — partners steps wrap ──────────────── */
@media (max-width: 1024px) {
  /* Reduce padding on partners steps at tablet */
  .partners-steps {
    padding: var(--space-lg) var(--space-md);
  }

  .partners-step-connector {
    width: 28px;
    padding-top: var(--space-xl);
  }
}

/* ── SMALL DESKTOP / TABLET (max 900px) ──────────────────────── */
@media (max-width: 900px) {

  /* Chaos→Clarity graphic row: stack vertically */
  .problem-graphic-row {
    flex-direction: column;
    gap: var(--space-sm);
  }

  /* Hide the horizontal arrow on small screens */
  .problem-graphic-arrow {
    transform: rotate(90deg);
    width: 32px;
    margin-inline: auto;
  }

  /* Partners steps: stack vertically */
  .partners-steps {
    flex-direction: column;
    gap: var(--space-lg);
    padding: var(--space-xl) var(--space-lg);
  }

  .partners-step {
    padding-inline: 0;
  }

  /* Rotate connectors to point down */
  .partners-step-connector {
    width: 24px;
    transform: rotate(90deg);
    margin-inline: auto;
    padding-top: 0;
    margin-top: 0;
  }

  /* Solution two-col → single col on small screens */
  .solution-reveal-inner {
    grid-template-columns: 1fr;
  }

  /* REVISION: Graphic max-height increased from 140px → 200px on tablet/mobile.
     Proportionally matches the desktop increase (180→260) for consistent sizing. */
  .solution-graphic-img {
    max-height: 200px;
  }

  /* About grid → single col */
  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-images {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    gap: var(--space-md);
  }

  .about-img-wrap--top  { margin-right: 0; }
  .about-img-wrap--bottom { margin-left: 0; margin-top: 0; }

}

/* ── MOBILE (max 768px) ───────────────────────────────────────── */
@media (max-width: 768px) {

  :root {
    --section-pad: clamp(3.5rem, 9vw, 5.5rem);
  }

  /* Header logo scales down slightly on mobile */
  .logo-img {
    height: 42px;
  }

  /* ── Mobile hamburger toggle ── */
  .nav-toggle {
    display: flex;
    z-index: 10;
  }

  /* REVISION: Desktop .nav-links hidden on mobile.
     The full-screen overlay is handled by .mobile-nav-overlay (below),
     which lives OUTSIDE <header> to avoid backdrop-filter containing it. */
  .nav-links {
    display: none;
  }

  /* REVISION: When mobile nav is open, header adopts a navy background
     to blend seamlessly with the full-screen overlay behind it.
     JS adds .nav-is-open to .site-header when the menu opens. */
  .site-header.nav-is-open {
    background-color: var(--navy) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
  }
  /* Hamburger lines stay white on the navy header when nav is open */
  .site-header.nav-is-open .hamburger-line {
    background-color: var(--white) !important;
  }

  /* ── MOBILE NAV OVERLAY ──
     REVISION: Full-screen navigation overlay placed outside <header> so
     backdrop-filter on the header cannot clip this element to 80px.
     z-index: 998 keeps it just below the header (1000) so the hamburger
     button in the header is always accessible for closing.
     JS adds .is-open to slide it in from the right. */
  .mobile-nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background-color: var(--navy);
    z-index: 998;
    transform: translateX(100%);
    transition: transform var(--duration-md) var(--ease);
    overflow-y: auto;
  }

  .mobile-nav-overlay.is-open {
    transform: translateX(0);
  }

  /* Center nav items vertically in the full-screen overlay */
  .mobile-nav-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100svh;
    min-height: 100vh;
    padding: var(--space-3xl) var(--space-lg);
  }

  .mobile-nav-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xl);
    padding: 0;
  }

  /* Nav link: large serif italic — premium and readable */
  .mobile-nav-link {
    font-family: var(--font-serif);
    font-size: clamp(var(--text-xl), 7vw, var(--text-2xl));
    font-style: italic;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.90);
    text-align: center;
    padding: var(--space-xs) 0;
    letter-spacing: 0.01em;
    display: block;
    transition: color var(--duration-sm) var(--ease);
    min-height: 44px; /* accessible tap target */
    display: flex;
    align-items: center;
  }

  .mobile-nav-link:hover,
  .mobile-nav-link:focus-visible {
    color: var(--sky);
  }

  /* CTA button: distinct from nav links — sans-serif, pill shape */
  .mobile-nav-cta {
    font-family: var(--font-sans);
    font-style: normal;
    font-size: var(--text-sm);
    letter-spacing: 0.09em;
    text-transform: uppercase;
    font-weight: 500;
    color: var(--navy);
    background-color: var(--white);
    border: 1.5px solid var(--white);
    padding: 0.9rem 2.25rem;
    border-radius: var(--radius-pill);
    margin-top: var(--space-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--duration-md) var(--ease),
                color var(--duration-md) var(--ease);
    min-height: 44px;
  }

  .mobile-nav-cta:hover {
    background-color: transparent;
    color: var(--white);
  }

  /* ── Problem cards: narrower card width on mobile ──
     Horizontal scroll behavior is already set in the base .pain-grid rules
     above; this override just tightens the card width and adds a small
     inset so the first/last card has breathing room from the screen edge. */
  .pain-grid {
    padding-inline: var(--space-sm);
    padding-bottom: var(--space-xs);
  }

  .pain-card {
    /* 272px on mobile: shows ~1 full card + peek of next at 375px viewport */
    flex: 0 0 272px;
  }

  /* ── Service cards: single column ── */
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .cards-grid .service-card:nth-child(3) {
    grid-column: auto;
    max-width: 100%;
    margin-inline: 0;
  }

  /* ── Comparison table: hide on mobile, show stacked cards instead ──
     REVISION: The horizontal table requires sideways scrolling on mobile.
     Three stacked .comparison-mobile-card elements replace it.
     Desktop table is preserved and unaffected. */
  .comparison-table-wrap {
    display: none;
  }

  .comparison-mobile {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
  }

  .comparison-mobile-card {
    background-color: var(--white);
    border: 1px solid rgba(119, 195, 236, 0.22);
    border-top: 2.5px solid var(--terracotta);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
  }

  .comparison-mobile-card--featured {
    background: linear-gradient(160deg, var(--navy) 0%, #1e4d61 100%);
    border-color: transparent;
    border-top-color: var(--sky);
  }

  .comparison-mobile-tier {
    font-family: var(--font-serif);
    font-size: var(--text-xl);
    font-weight: 500;
    color: var(--navy);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--sky-15);
    line-height: 1.2;
  }

  .comparison-mobile-card--featured .comparison-mobile-tier {
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.12);
  }

  .comparison-mobile-includes {
    font-size: var(--text-xs);
    letter-spacing: 0.10em;
    text-transform: uppercase;
    font-weight: 500;
    color: var(--sky);
    margin-bottom: var(--space-sm);
    line-height: 1.5;
  }

  .comparison-mobile-features {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0;
  }

  .comparison-mobile-features li {
    font-size: var(--text-sm);
    color: var(--navy-80);
    padding-left: 1.4rem;
    position: relative;
    line-height: 1.65;
  }

  .comparison-mobile-features li::before {
    content: '✦';
    position: absolute;
    left: 0;
    color: var(--terracotta);
    font-size: 0.6rem;
    top: 5px;
    line-height: 1;
  }

  .comparison-mobile-card--featured .comparison-mobile-features li {
    color: rgba(255, 255, 255, 0.85);
  }

  .comparison-mobile-card--featured .comparison-mobile-features li::before {
    color: var(--sky);
  }

  /* ── Partners: 2-column ── */
  .partners-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* ── Expert Network category header: stack vertically on mobile ──
     REVISION: flex-shrink:0 on the text was preventing it from
     narrowing on small screens, causing the heading to overflow or
     get cut off. Stacking vertically and removing shrink:0 fixes this.
     Also reduces the section headline font size for mobile. */
  .partners-category-header {
    flex-direction: column;
    gap: var(--space-md);
    align-items: center;
  }

  .partners-category-header-text {
    flex-shrink: 1;
    max-width: 100%;
    padding-inline: var(--space-xs);
  }

  .partners-category-rule {
    width: 100%;
    flex: none;
  }

  /* Scale down the large partners section headline on mobile */
  .partners .section-headline--large {
    font-size: clamp(var(--text-xl), 7vw, var(--text-3xl));
  }

  /* ── About section: single mobile image ──
     REVISION: Desktop two-column image layout is hidden on mobile.
     A single .about-mobile-img element (inserted after the h2 in the
     HTML) is shown instead, placing the photo naturally below the heading. */
  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-images {
    display: none;
  }

  .about-mobile-img {
    display: block;
    margin-top: var(--space-lg);
    margin-bottom: var(--space-xl);
  }

  .about-mobile-img .about-img-wrap {
    margin-right: 0;
    margin-left: 0;
    margin-top: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-height: 260px;
    max-height: 380px;
  }

  .about-mobile-img .about-img {
    width: 100%;
    min-height: 260px;
    max-height: 380px;
    object-fit: cover;
    object-position: center top;
    display: block;
  }

  /* ── Footer logo: scale down on mobile ── */
  .logo-img--footer {
    height: 100px;
  }

  /* ── Contact form ── */
  .form-row {
    grid-template-columns: 1fr;
  }

}

/* ── SMALL MOBILE (max 480px) ─────────────────────────────────── */
@media (max-width: 480px) {

  :root {
    --container-pad: 1.25rem;
  }

  .hero-headline {
    font-size: clamp(var(--text-2xl), 9vw, var(--text-3xl));
  }

  .solution-headline {
    font-size: clamp(var(--text-2xl), 8vw, var(--text-3xl));
  }

  .partners-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }

  /* Tighten the mobile nav link size on very small screens */
  .mobile-nav-link {
    font-size: var(--text-xl);
  }

  /* About mobile image: slightly shorter on very small screens */
  .about-mobile-img .about-img-wrap,
  .about-mobile-img .about-img {
    max-height: 300px;
  }

}
