/* ═══════════════════════════════════════════════════
   BRAND ELEVATION — Premium Visual System
   ═══════════════════════════════════════════════════ */

:root {
  --brand-bg: #060a18;
  --brand-bg-alt: #0b1128;
  --brand-ink: #f1f5f9;
  --brand-ink-soft: #cbd5e1;
  --brand-accent: #ff6b7f;
  --brand-accent-strong: #f43f5e;
  --brand-accent-glow: rgba(244, 63, 94, 0.15);
  --brand-glass: rgba(15, 23, 42, 0.55);
  --brand-glass-border: rgba(255, 255, 255, 0.08);
  --brand-glass-strong: rgba(10, 15, 30, 0.72);
  --brand-radius-card: 20px;
  --brand-radius-pill: 9999px;
  --brand-space-section: clamp(5rem, 8vw, 8rem);
  --brand-space-inner: clamp(1.25rem, 3vw, 2.25rem);

  /* Strict typographic scale (1.25 ratio) */
  --type-step--2: clamp(0.72rem, 0.68rem + 0.16vw, 0.8rem);
  --type-step--1: clamp(0.84rem, 0.8rem + 0.18vw, 0.94rem);
  --type-step-0: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --type-step-1: clamp(1.15rem, 1.05rem + 0.5vw, 1.4rem);
  --type-step-2: clamp(1.35rem, 1.15rem + 0.85vw, 1.875rem);
  --type-step-3: clamp(1.75rem, 1.35rem + 1.6vw, 2.8rem);
  --type-step-4: clamp(2.25rem, 1.6rem + 2.8vw, 4.5rem);

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── Global Reset & Base ── */

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif !important;
  background: var(--brand-bg);
  background-image:
    radial-gradient(ellipse 120% 60% at 15% -5%, rgba(30, 64, 175, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 80% 50% at 85% 5%, rgba(126, 34, 206, 0.08) 0%, transparent 55%),
    radial-gradient(ellipse 100% 80% at 50% 100%, rgba(6, 10, 24, 1) 0%, transparent 70%);
  color: var(--brand-ink);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(244, 63, 94, 0.25);
  color: #fff;
}

/* ── Typography: Lexend Deca for headings, Poppins for body ── */

#root h1,
#root h2,
#root h3,
#root h4 {
  font-family: "Lexend Deca", "Poppins", system-ui, sans-serif !important;
  letter-spacing: -0.03em !important;
  font-weight: 800 !important;
  text-wrap: balance;
}

#root h1 {
  font-size: var(--type-step-4) !important;
  line-height: 1.05 !important;
}

#root h2 {
  font-size: var(--type-step-3) !important;
  line-height: 1.1 !important;
}

#root h3 {
  font-size: var(--type-step-2) !important;
  line-height: 1.2 !important;
}

#root h4 {
  font-size: var(--type-step-1) !important;
  line-height: 1.3 !important;
}

#root p,
#root li,
#root label,
#root input,
#root select,
#root textarea {
  letter-spacing: 0.005em;
}

#root p {
  font-size: var(--type-step-0);
  line-height: 1.75;
}

#root .text-xs {
  font-size: var(--type-step--2) !important;
  line-height: 1.5 !important;
}

#root .text-sm {
  font-size: var(--type-step--1) !important;
  line-height: 1.6 !important;
}

#root .text-base {
  font-size: var(--type-step-0) !important;
  line-height: 1.7 !important;
}

#root .text-lg {
  font-size: var(--type-step-1) !important;
  line-height: 1.6 !important;
}

#root .text-xl {
  font-size: clamp(1.35rem, 1.15rem + 0.85vw, 1.9rem) !important;
  line-height: 1.55 !important;
}

#root .text-2xl {
  font-size: var(--type-step-2) !important;
  line-height: 1.3 !important;
}

#root .text-3xl {
  font-size: clamp(1.9rem, 1.4rem + 1.8vw, 3rem) !important;
  line-height: 1.15 !important;
}

#root .text-4xl {
  font-size: var(--type-step-3) !important;
  line-height: 1.1 !important;
}

#root .text-5xl,
#root .text-6xl,
#root .text-7xl {
  line-height: 1.04 !important;
}

/* ── Section Spacing & Layered Background ── */

#root > div > section {
  padding-top: var(--brand-space-section) !important;
  padding-bottom: var(--brand-space-section) !important;
  position: relative;
}

#root > div > section:not(#order)::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 900px 300px at 50% 0%, rgba(255, 255, 255, 0.04), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.015) 0%, transparent 20%, transparent 80%, rgba(0, 0, 0, 0.06) 100%);
  opacity: 0.7;
}


/* ── Section 3 (24% Problem): subtle floating hero-style ambient elements ── */

#root > div > section:is(:nth-of-type(3), :nth-of-type(4), :nth-of-type(5), :nth-of-type(6)) {
  overflow: hidden;
  isolation: isolate;
}

#root > div > section:is(:nth-of-type(3), :nth-of-type(4), :nth-of-type(5), :nth-of-type(6))::before {
  content: "";
  position: absolute;
  inset: -8% -4%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.72;
  background:
    radial-gradient(circle at 18% 26%, rgba(56, 189, 248, 0.75) 0%, rgba(56, 189, 248, 0.28) 4.2%, transparent 9%),
    radial-gradient(circle at 81% 30%, rgba(168, 85, 247, 0.72) 0%, rgba(168, 85, 247, 0.25) 4%, transparent 8.8%),
    radial-gradient(circle at 72% 68%, rgba(250, 204, 21, 0.64) 0%, rgba(250, 204, 21, 0.2) 3.8%, transparent 8.4%),
    radial-gradient(circle at 26% 70%, rgba(16, 185, 129, 0.62) 0%, rgba(16, 185, 129, 0.2) 3.6%, transparent 8.1%),
    radial-gradient(circle at 13% 18%, rgba(255, 255, 255, 0.85) 0 1.5px, transparent 3.2px),
    radial-gradient(circle at 64% 14%, rgba(255, 255, 255, 0.78) 0 1.4px, transparent 3px),
    radial-gradient(circle at 88% 62%, rgba(255, 255, 255, 0.8) 0 1.4px, transparent 3px),
    linear-gradient(90deg, transparent 0 12%, rgba(56, 189, 248, 0.28) 16% 23%, transparent 29% 68%, rgba(168, 85, 247, 0.24) 74% 82%, transparent 88% 100%);
  filter: none;
  mix-blend-mode: normal;
  animation: section24Float 16s ease-in-out infinite alternate;
}

#root > div > section:is(:nth-of-type(3), :nth-of-type(4), :nth-of-type(5), :nth-of-type(6))::after {
  background:
    linear-gradient(90deg, transparent 18%, rgba(125, 211, 252, 0.08) 22%, transparent 30%, transparent 66%, rgba(196, 181, 253, 0.08) 72%, transparent 80%),
    radial-gradient(ellipse 900px 300px at 50% 0%, rgba(255, 255, 255, 0.04), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.015) 0%, transparent 20%, transparent 80%, rgba(0, 0, 0, 0.06) 100%);
}

@keyframes section24Float {
  0% {
    transform: translate3d(0, 0, 0);
    background-position: 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0 0, 0 0, 0 0, 0% 0%;
  }

  100% {
    transform: translate3d(0, -8px, 0);
    background-position: 3% -4%, -2% 5%, 2% -3%, -3% 4%, 2% -3%, -2% 2%, 1% -2%, 5% 0%;
  }
}




/* ── Subtle 3D Ambient Depth (selected sections) ── */

#root > div > section:is(:nth-of-type(2), :nth-of-type(4), :nth-of-type(7), :nth-of-type(10), :nth-of-type(13)) {
  overflow: hidden;
  isolation: isolate;
}

#root > div > section:is(:nth-of-type(2), :nth-of-type(4), :nth-of-type(7), :nth-of-type(10), :nth-of-type(13))::before {
  content: "";
  position: absolute;
  inset: -16% -7%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.64;
  transform: perspective(1300px) rotateX(14deg) rotate(-4deg) scale(1.05);
  transform-origin: center top;
  background:
    radial-gradient(ellipse 32% 25% at 18% 38%, rgba(56, 189, 248, 0.36) 0%, rgba(56, 189, 248, 0.08) 66%, transparent 78%),
    radial-gradient(ellipse 28% 21% at 82% 34%, rgba(168, 85, 247, 0.34) 0%, rgba(168, 85, 247, 0.08) 65%, transparent 78%),
    radial-gradient(circle at 16% 16%, rgba(255, 255, 255, 0.2) 0 1px, transparent 2px),
    radial-gradient(circle at 72% 18%, rgba(255, 255, 255, 0.16) 0 1px, transparent 2px),
    radial-gradient(circle at 88% 62%, rgba(255, 255, 255, 0.18) 0 1px, transparent 2px),
    repeating-linear-gradient(
      90deg,
      rgba(56, 189, 248, 0.16) 0 10%,
      transparent 8% 22%,
      rgba(59, 130, 246, 0.12) 24% 34%,
      transparent 30% 52%,
      rgba(168, 85, 247, 0.14) 54% 64%,
      transparent 60% 100%
    ),
    linear-gradient(130deg, rgba(2, 132, 199, 0.2) 0%, rgba(30, 64, 175, 0.24) 45%, rgba(30, 41, 59, 0.22) 100%);
  filter: none;
  mix-blend-mode: normal;
  animation: ambientDepthShift 22s ease-in-out infinite alternate;
}

@keyframes ambientDepthShift {
  0% {
    background-position: 0% 0%, 100% 0%, 0 0, 0 0, 0 0, 0% 0%, 50% 0%;
    transform: perspective(1300px) rotateX(14deg) rotate(-4deg) scale(1.05);
  }

  100% {
    background-position: 8% 12%, 92% 8%, 4% 6%, -2% 4%, 6% -2%, 10% 0%, 45% 8%;
    transform: perspective(1300px) rotateX(14deg) rotate(-2deg) scale(1.06);
  }
}

#root > div > section#order::after {
  display: none;
}

#root > div > section > div {
  position: relative;
  z-index: 1;
  padding-left: var(--brand-space-inner) !important;
  padding-right: var(--brand-space-inner) !important;
}

/* ── Container Widths ── */

#root .max-w-4xl,
#root .max-w-5xl,
#root .max-w-6xl {
  width: min(1140px, 92vw) !important;
}

#root .max-w-7xl {
  max-width: 82rem;
  width: min(1312px, 96vw) !important;
  margin-left: auto;
  margin-right: auto;
}

#root .max-w-3xl {
  width: min(920px, 92vw) !important;
}

/* ── Grid System ── */

#root .grid {
  gap: clamp(0.875rem, 1.6vw, 1.75rem) !important;
}

/* ── Glassmorphism Cards ── */

#root .rounded-2xl,
#root .rounded-3xl,
#root .rounded-xl {
  border-radius: var(--brand-radius-card) !important;
}

#root .rounded-full {
  border-radius: var(--brand-radius-pill) !important;
}

#root .bg-white\/5,
#root .bg-white\/10,
#root .bg-white\/15,
#root .bg-white\/20,
#root .bg-gray-900\/30,
#root .bg-gray-950,
#root .bg-black {
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  backdrop-filter: blur(16px) saturate(1.1);
  border-color: var(--brand-glass-border) !important;
}

/* ── Text Colors — Dark Sections ── */

#root > div > section:nth-of-type(-n + 9) .text-gray-300,
#root > div > section:nth-of-type(-n + 9) .text-gray-400 {
  color: #c8d6f0 !important;
}

#root > div > section:nth-of-type(-n + 9) .text-gray-500,
#root > div > section:nth-of-type(-n + 9) .text-gray-600 {
  color: #a3b5d6 !important;
}

#root > div > section:nth-of-type(-n + 9) .text-amber-100\/80,
#root > div > section:nth-of-type(-n + 9) .text-amber-100\/90,
#root > div > section:nth-of-type(-n + 9) .text-amber-100 {
  color: #fff5e0 !important;
}

/* ── Text Colors — Light/Green Sections ── */

#root > div > section:nth-of-type(n + 10) .text-gray-500,
#root > div > section:nth-of-type(n + 10) .text-gray-600 {
  color: #1e3a5f !important;
}

#root > div > section:nth-of-type(n + 10) .text-emerald-800,
#root > div > section:nth-of-type(n + 10) .text-emerald-900 {
  color: #064e3b !important;
}

/* ── CTA Buttons: Hover & Shadow System ── */

#root a[href="#order"],
#root a[href="#truth"],
#root a[href="#order-form"],
#root button[type="submit"],
#root nav a,
#root nav button {
  transition: transform 280ms var(--ease-out-expo), box-shadow 280ms var(--ease-smooth),
    background-color 240ms ease, border-color 240ms ease, opacity 200ms ease !important;
}

#root a[href="#order"]:hover,
#root a[href="#truth"]:hover,
#root a[href="#order-form"]:hover,
#root button[type="submit"]:hover,
#root nav a:hover,
#root nav button:hover {
  transform: translateY(-3px) scale(1.015);
}

#root a[href="#order"]:active,
#root a[href="#truth"]:active,
#root a[href="#order-form"]:active,
#root button[type="submit"]:active {
  transform: translateY(-1px) scale(0.99);
  transition-duration: 80ms !important;
}

#root button[type="submit"],
#root a[href="#order"] {
  box-shadow: 0 14px 32px rgba(127, 29, 29, 0.35), 0 4px 8px rgba(0, 0, 0, 0.15);
}

#root button[type="submit"]:hover,
#root a[href="#order"]:hover {
  box-shadow: 0 20px 44px rgba(127, 29, 29, 0.45), 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* ── Micro CTA Shimmer ── */

#root .micro-cta {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

#root .micro-cta::before {
  content: "";
  position: absolute;
  inset: -120% -38%;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.28) 50%, transparent 62%);
  transform: translateX(-130%) rotate(6deg);
  transition: transform 550ms var(--ease-out-expo);
  pointer-events: none;
}

#root .micro-cta:hover::before {
  transform: translateX(130%) rotate(6deg);
}

/* ── Form Elements ── */

#root input,
#root select,
#root textarea {
  font-size: clamp(0.95rem, 0.92rem + 0.2vw, 1.1rem) !important;
  line-height: 1.5;
  border-radius: 14px !important;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

#root input:focus,
#root select:focus,
#root textarea:focus {
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.15) !important;
}

#root label {
  font-size: clamp(0.9rem, 0.86rem + 0.2vw, 1.02rem) !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em;
}

/* ── Micro-Card: 3D Tilt + Glow ── */

#root .micro-card {
  position: relative;
  transform: translateY(0) rotateX(var(--tilt-y, 0deg)) rotateY(var(--tilt-x, 0deg));
  transform-style: preserve-3d;
  will-change: transform, box-shadow;
  transition: transform 350ms var(--ease-out-expo), box-shadow 300ms var(--ease-smooth),
    border-color 300ms ease;
}

#root .micro-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(
    320px 160px at var(--glow-x, 50%) var(--glow-y, 50%),
    rgba(147, 197, 253, 0.12),
    transparent 72%
  );
  opacity: 0;
  transition: opacity 280ms ease;
}

#root .micro-card:hover {
  transform: translateY(-5px) rotateX(var(--tilt-y, 0deg)) rotateY(var(--tilt-x, 0deg));
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.25), 0 8px 16px rgba(0, 0, 0, 0.1);
  border-color: rgba(148, 163, 184, 0.25) !important;
}

#root .micro-card:hover::before {
  opacity: 1;
}

/* ── Image Treatment (dark sections only, not order/form areas) ── */

#root > div > section:not(#order) img {
  border-radius: var(--brand-radius-card);
  transition: transform 600ms var(--ease-out-expo), box-shadow 400ms ease;
}

#root > div > section:not(#order) img:hover {
  transform: scale(1.03);
}

#root > div > section#order img {
  border-radius: var(--brand-radius-card);
}

/* ── Section Divider (subtle top-edge glow) ── */

#root > div > section + section {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

/* ── AOS ── */

[data-aos] {
  will-change: transform, opacity;
}

/* ── Parallax Opacity ── */

.parallax-enabled section.parallax-section::before {
  opacity: 0.06;
}

.parallax-enabled section.parallax-section::after {
  opacity: 0.10;
}

/* ── Scrollbar Styling ── */

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--brand-bg);
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.35);
}

/* ── Call Button: Wiggle + Glimmer ── */

.call-btn-wiggle {
  animation: callWiggle 2.8s ease-in-out infinite;
}

.call-btn-wiggle::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -75%;
  width: 50%;
  height: 200%;
  background: linear-gradient(
    105deg,
    transparent 38%,
    rgba(255, 255, 255, 0.45) 48%,
    rgba(255, 255, 255, 0.55) 50%,
    rgba(255, 255, 255, 0.45) 52%,
    transparent 62%
  );
  animation: callGlimmer 3.6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes callWiggle {
  0%, 100% { transform: rotate(0deg) scale(1); }
  8%       { transform: rotate(-6deg) scale(1.08); }
  16%      { transform: rotate(6deg) scale(1.08); }
  24%      { transform: rotate(-4deg) scale(1.05); }
  32%      { transform: rotate(4deg) scale(1.05); }
  40%      { transform: rotate(-1deg) scale(1.02); }
  48%      { transform: rotate(0deg) scale(1); }
}

@keyframes callGlimmer {
  0%, 100% { left: -75%; opacity: 0; }
  15%      { opacity: 0; }
  40%      { opacity: 1; }
  60%      { left: 125%; opacity: 1; }
  75%      { opacity: 0; }
}

.call-btn-wiggle:hover {
  animation: none;
  transform: scale(1.08);
  box-shadow: 0 0 24px rgba(22, 163, 74, 0.55), 0 6px 16px rgba(0, 0, 0, 0.25) !important;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

/* ── Back to Top Button ── */

#backToTop {
  position: fixed !important;
  bottom: 1rem !important;
  right: 1rem !important;
  left: auto !important;
  top: auto !important;
  z-index: 99999 !important;
  width: 64px;
  height: 64px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  background: linear-gradient(135deg, #fb7185, #be123c);
  color: #fff;
  cursor: pointer;
  box-shadow:
    0 0 26px rgba(225, 29, 72, 0.65),
    0 10px 28px rgba(225, 29, 72, 0.5),
    0 2px 8px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.8);
  transition: opacity 350ms ease, visibility 350ms ease, transform 350ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 250ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

#backToTop::before {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  border-top: 3.5px solid #fff;
  border-right: 3.5px solid #fff;
  transform: rotate(-45deg);
  margin-top: 4px;
}

#backToTop.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  animation: bttPulse 2.5s ease-in-out infinite;
}

#backToTop:hover {
  animation: none;
  transform: translateY(-4px) scale(1.12);
  box-shadow:
    0 0 30px rgba(225, 29, 72, 0.6),
    0 12px 32px rgba(225, 29, 72, 0.5),
    0 4px 10px rgba(0, 0, 0, 0.3);
}

#backToTop:active {
  transform: translateY(-1px) scale(0.95);
  transition-duration: 80ms;
}

@keyframes bttPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(225, 29, 72, 0.5), 0 8px 24px rgba(225, 29, 72, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3); }
  50% { box-shadow: 0 0 32px rgba(225, 29, 72, 0.7), 0 10px 30px rgba(225, 29, 72, 0.55), 0 3px 10px rgba(0, 0, 0, 0.35); }
}

/* ══════════════════════════════════════
   RESPONSIVE — Tablet (≤900px)
   ══════════════════════════════════════ */

@media (max-width: 900px) {
  :root {
    --brand-space-section: clamp(3rem, 6vw, 5rem);
    --brand-space-inner: clamp(0.875rem, 3.5vw, 1.25rem);
  }

  #root .grid {
    gap: 0.875rem !important;
  }

  #root > div > section > div {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  #root .max-w-7xl {
    width: 96vw !important;
  }

  /* Nav: tighten spacing */
  #root nav .max-w-6xl {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  /* Tables: reduce padding for tablet */
  #root table th,
  #root table td {
    padding: 0.75rem 0.85rem !important;
    font-size: 0.92rem !important;
  }

  #root table th {
    font-size: 0.78rem !important;
  }

  /* Hero stats grid: stay 3 cols but tighter */
  #root .grid.grid-cols-3 {
    gap: 0.5rem !important;
  }

  /* Pipeline 5-col grid: go to 3 cols */
  #root .grid.grid-cols-5 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* ══════════════════════════════════════
   RESPONSIVE — Mobile (≤640px)
   ══════════════════════════════════════ */



/* Keep any alternative back-to-top implementation pinned visibly in the same corner */
button[aria-label="Back to top"] {
  right: 1rem !important;
  left: auto !important;
  bottom: 1rem !important;
  z-index: 99999 !important;
}
@media (max-width: 640px) {
  :root {
    --brand-space-section: clamp(2.5rem, 6vw, 4rem);
  }

  button[aria-label="Back to top"] {
    right: 0.75rem !important;
    bottom: 0.75rem !important;
  }

  #backToTop {
    bottom: 0.75rem !important;
    right: 0.75rem !important;
    left: auto !important;
    width: 58px;
    height: 58px;
  }

  #root > div > section:is(:nth-of-type(2), :nth-of-type(4), :nth-of-type(7), :nth-of-type(10), :nth-of-type(13))::before {
    opacity: 0.46;
    inset: -10% -5%;
    transform: perspective(950px) rotateX(9deg) rotate(-2deg) scale(1.03);
    animation-duration: 24s;
  }

  #root > div > section:is(:nth-of-type(3), :nth-of-type(4), :nth-of-type(5), :nth-of-type(6))::before {
    opacity: 0.44;
    inset: -5% -3%;
    animation-duration: 18s;
  }


  /* All containers: full-width with minimal padding */
  #root .max-w-4xl,
  #root .max-w-5xl,
  #root .max-w-6xl,
  #root .max-w-7xl {
    width: 100% !important;
    max-width: 100% !important;
  }

  #root > div > section > div {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  /* Nav: stack-friendly */
  .call-btn-wiggle {
    font-size: 0.72rem !important;
    padding: 0.4rem 0.65rem !important;
  }

  .call-btn-wiggle span:first-child {
    font-size: 0.9rem !important;
  }

  /* Hero stats: stack to 1 col on very small, 3 cols otherwise */
  #root .grid.grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 0.4rem !important;
  }

  #root .grid.grid-cols-3 > div {
    padding: 8px 4px !important;
  }

  /* Pipeline 5-col: go to 2 cols + wrap */
  #root .grid.grid-cols-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.5rem !important;
  }

  /* Tables: scroll horizontally, reduce cell padding */
  #root .overflow-x-auto {
    -webkit-overflow-scrolling: touch;
  }

  #root table th,
  #root table td {
    padding: 0.6rem 0.65rem !important;
    font-size: 0.82rem !important;
  }

  #root table th {
    font-size: 0.72rem !important;
  }

  /* Form: full width inputs */
  #root .grid.grid-cols-2 {
    grid-template-columns: 1fr !important;
  }

  /* Images: constrain height */
  #root section img {
    max-height: 240px;
  }

  /* JotForm iframe responsive */
  #root iframe[id*="JotForm"] {
    min-height: 600px !important;
    height: auto !important;
  }

  /* Typography scale down slightly */
  #root h1 {
    font-size: clamp(1.8rem, 1.4rem + 2vw, 3rem) !important;
  }

  #root h2 {
    font-size: clamp(1.5rem, 1.2rem + 1.6vw, 2.4rem) !important;
  }

  #root .text-xl,
  #root .text-2xl {
    font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.4rem) !important;
  }

  /* Buttons: full-width on mobile */
  #root .flex.flex-col.sm\:flex-row {
    flex-direction: column !important;
  }

  #root .flex.flex-col.sm\:flex-row > a,
  #root .flex.flex-col.sm\:flex-row > button {
    width: 100%;
    text-align: center;
  }

  /* Glass panel: tighter padding */
  #root > div > section:first-of-type > .relative.z-10 {
    padding: 20px 14px !important;
    margin: 10px !important;
    border-radius: 16px !important;
  }
}

/* ══════════════════════════════════════
   RESPONSIVE — Small phones (≤400px)
   ══════════════════════════════════════ */

@media (max-width: 400px) {
  :root {
    --brand-space-section: 2rem;
  }

  #root > div > section > div {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }

  #root h1 {
    font-size: clamp(1.5rem, 1.2rem + 1.8vw, 2.2rem) !important;
  }

  #root h2 {
    font-size: clamp(1.3rem, 1.1rem + 1.2vw, 1.9rem) !important;
  }

  /* Tables: even tighter */
  #root table th,
  #root table td {
    padding: 0.5rem 0.45rem !important;
    font-size: 0.75rem !important;
  }

  /* Pipeline: single column */
  #root .grid.grid-cols-5 {
    grid-template-columns: 1fr !important;
  }

  /* Stats: reduce size */
  #root .grid.grid-cols-3 > div > div:first-child {
    font-size: 1.5rem !important;
  }

  /* Nav call button: icon only */
  .call-btn-wiggle {
    padding: 0.35rem 0.5rem !important;
    font-size: 0 !important;
  }

  .call-btn-wiggle span:first-child {
    font-size: 1.1rem !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #root .micro-card,
  #root .micro-card::before,
  #root a,
  #root button {
    transition: none !important;
    transform: none !important;
  }
}


/* ── Scroll Performance Optimizations ── */

#root > div > section::before,
#root > div > section::after {
  backface-visibility: hidden;
}

body.is-scrolling #root > div > section:is(:nth-of-type(3), :nth-of-type(4), :nth-of-type(5), :nth-of-type(6))::before,
body.is-scrolling #root > div > section:is(:nth-of-type(2), :nth-of-type(4), :nth-of-type(7), :nth-of-type(10), :nth-of-type(13))::before {
  animation-play-state: paused !important;
}

@media (max-width: 1024px) {
  #root > div > section:is(:nth-of-type(3), :nth-of-type(4), :nth-of-type(5), :nth-of-type(6))::before,
  #root > div > section:is(:nth-of-type(2), :nth-of-type(4), :nth-of-type(7), :nth-of-type(10), :nth-of-type(13))::before {
    animation-duration: 30s !important;
    opacity: 0.3 !important;
  }
}
