/* ==========================================================================
   Garage Hero — Web Design System
   Tokens mirror the app: src/constants/colors.ts, typography.ts, spacing.ts
   Rules: no emojis, one icon system (stroke SVG sprite), tokens only,
   dark mode always works, one accent colour, restraint.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
  /* Brand — official palette (colors.ts) */
  --brand-sky: #4fc3f7;
  --brand-blue: #1d9bf0;
  --brand-royal: #0f3d91;
  --brand-navy: #0a1a33;
  --brand-navy-deep: #061021;

  /* Semantic — light (default) */
  --primary: #1d9bf0;
  --primary-hover: #0f7fce;
  --primary-soft: #e0f2fe;
  --accent: #4fc3f7;

  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --text: #0a1a33;
  --text-2: #475569;
  --text-3: #94a3b8;
  --text-inverse: #ffffff;

  --success: #22c55e;
  --success-soft: #dcfce7;
  --warning: #f59e0b;
  --error: #ef4444;

  /* Always-dark panels (hero, footer) keep fixed values in both themes */
  --panel: #0a1a33;
  --panel-2: #0f3d91;
  --on-panel: #ffffff;
  --on-panel-2: rgba(255, 255, 255, 0.72);
  --on-panel-3: rgba(255, 255, 255, 0.48);
  --panel-border: rgba(255, 255, 255, 0.14);
  --panel-surface: rgba(255, 255, 255, 0.06);

  /* Spacing (spacing.ts) + web-only large steps */
  --s-xs: 4px;
  --s-sm: 8px;
  --s-md: 16px;
  --s-lg: 24px;
  --s-xl: 32px;
  --s-2xl: 48px;
  --s-3xl: 72px;
  --s-4xl: 112px;

  /* Radius (spacing.ts) */
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-full: 9999px;

  /* Shadow (spacing.ts — soft, diffuse, brand navy) */
  --sh-sm: 0 2px 8px rgba(10, 26, 51, 0.06);
  --sh-md: 0 6px 16px rgba(10, 26, 51, 0.08);
  --sh-lg: 0 12px 28px rgba(10, 26, 51, 0.12);

  /* Type — Poppins, matching fonts.ts */
  --font: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;

  --fs-hero: clamp(36px, 5.2vw, 60px);
  --fs-display: clamp(26px, 3.2vw, 40px);
  --fs-title: clamp(21px, 2.2vw, 28px);
  --fs-headline: 18px;
  --fs-body: 16px;
  --fs-caption: 14px;
  --fs-micro: 12px;

  --lh-tight: 1.06;
  --lh-snug: 1.25;
  --lh-body: 1.65;

  --maxw: 1200px;
  --maxw-prose: 760px;
  --nav-h: 80px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  color-scheme: light;
}

/* Dark theme — system preference */
@media (prefers-color-scheme: dark) {
  :root {
    --primary: #4fc3f7;
    --primary-hover: #7ad2fa;
    --primary-soft: #0c2438;
    --accent: #4fc3f7;

    --bg: #081426;
    --bg-alt: #0b1b30;
    --surface: #0e2240;
    --surface-2: #153058;
    --border: #1e3a5f;
    --border-strong: #2b4d7a;

    --text: #f8fafc;
    --text-2: #a8bacf;
    --text-3: #64748b;

    --success-soft: #06301a;

    --panel: #061021;
    --panel-2: #0d2f6e;

    --sh-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --sh-md: 0 6px 16px rgba(0, 0, 0, 0.45);
    --sh-lg: 0 12px 28px rgba(0, 0, 0, 0.55);

    color-scheme: dark;
  }
}

/* Dark theme — explicit toggle (must beat the media query in both directions) */
:root[data-theme="dark"] {
  --primary: #4fc3f7;
  --primary-hover: #7ad2fa;
  --primary-soft: #0c2438;
  --accent: #4fc3f7;

  --bg: #081426;
  --bg-alt: #0b1b30;
  --surface: #0e2240;
  --surface-2: #153058;
  --border: #1e3a5f;
  --border-strong: #2b4d7a;

  --text: #f8fafc;
  --text-2: #a8bacf;
  --text-3: #64748b;

  --success-soft: #06301a;

  --panel: #061021;
  --panel-2: #0d2f6e;

  --sh-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --sh-md: 0 6px 16px rgba(0, 0, 0, 0.45);
  --sh-lg: 0 12px 28px rgba(0, 0, 0, 0.55);

  color-scheme: dark;
}

:root[data-theme="light"] {
  --primary: #1d9bf0;
  --primary-hover: #0f7fce;
  --primary-soft: #e0f2fe;
  --accent: #4fc3f7;

  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --text: #0a1a33;
  --text-2: #475569;
  --text-3: #94a3b8;

  --success-soft: #dcfce7;

  --panel: #0a1a33;
  --panel-2: #0f3d91;

  --sh-sm: 0 2px 8px rgba(10, 26, 51, 0.06);
  --sh-md: 0 6px 16px rgba(10, 26, 51, 0.08);
  --sh-lg: 0 12px 28px rgba(10, 26, 51, 0.12);

  color-scheme: light;
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + var(--s-md));
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.18s var(--ease);
}
a:hover {
  color: var(--primary-hover);
}

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

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

::selection {
  background: var(--brand-sky);
  color: var(--brand-navy);
}

.skip-link {
  position: absolute;
  left: var(--s-md);
  top: calc(-1 * var(--s-4xl));
  z-index: 200;
  background: var(--primary);
  color: #fff;
  padding: var(--s-sm) var(--s-md);
  border-radius: var(--r-sm);
  font-weight: 600;
  font-size: var(--fs-caption);
  transition: top 0.2s var(--ease);
}
.skip-link:focus {
  top: var(--s-md);
  color: #fff;
}

/* --------------------------------------------------------------------------
   3. Typography
   -------------------------------------------------------------------------- */

h1,
h2,
h3,
h4 {
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: var(--lh-snug);
  text-wrap: balance;
}

.t-hero {
  font-size: var(--fs-hero);
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: -0.035em;
}
.t-display {
  font-size: var(--fs-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.03em;
}
.t-title {
  font-size: var(--fs-title);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.t-headline {
  font-size: var(--fs-headline);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
}
.t-body {
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: var(--lh-body);
  color: var(--text-2);
}
.t-lead {
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.55;
  color: var(--text-2);
  font-weight: 400;
}
.t-caption {
  font-size: var(--fs-caption);
  line-height: 1.55;
  color: var(--text-2);
}
.t-micro {
  font-size: var(--fs-micro);
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-3);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-sm);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: var(--s-md);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--primary);
  flex: none;
}
.on-panel .eyebrow {
  color: var(--brand-sky);
}
.on-panel .eyebrow::before {
  background: var(--brand-sky);
}

.measure {
  max-width: 62ch;
}
.center {
  text-align: center;
}
.center .measure,
.measure.center {
  margin-inline: auto;
}

/* --------------------------------------------------------------------------
   4. Layout
   -------------------------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--s-lg);
}

.section {
  padding-block: clamp(var(--s-3xl), 8vw, var(--s-4xl));
}
.section--tight {
  padding-block: clamp(var(--s-2xl), 6vw, var(--s-3xl));
}
.section--alt {
  background: var(--bg-alt);
}
.section--panel {
  background: var(--panel);
  color: var(--on-panel);
}

.section-head {
  max-width: 640px;
  margin-bottom: var(--s-2xl);
}
.section-head.center {
  margin-inline: auto;
}
.section-head p {
  margin-top: var(--s-md);
}

.grid {
  display: grid;
  gap: var(--s-lg);
}
.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}
.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}
.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(var(--s-xl), 5vw, var(--s-3xl));
  align-items: center;
}

.stack-sm > * + * {
  margin-top: var(--s-sm);
}
.stack-md > * + * {
  margin-top: var(--s-md);
}
.stack-lg > * + * {
  margin-top: var(--s-lg);
}

/* Panels invert text colour for everything inside */
.on-panel,
.on-panel h1,
.on-panel h2,
.on-panel h3,
.on-panel h4 {
  color: var(--on-panel);
}
.on-panel .t-body,
.on-panel .t-lead,
.on-panel .t-caption {
  color: var(--on-panel-2);
}
.on-panel .t-micro {
  color: var(--on-panel-3);
}

/* --------------------------------------------------------------------------
   5. Icons — one system: stroke SVG sprite, Ionicons-outline style
   -------------------------------------------------------------------------- */

.ico {
  width: 24px;
  height: 24px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ico-sm {
  width: 18px;
  height: 18px;
  stroke-width: 1.9;
}
.ico-lg {
  width: 28px;
  height: 28px;
  stroke-width: 1.6;
}

.ico-tile {
  width: 52px;
  height: 52px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  flex: none;
}
.on-panel .ico-tile {
  background: var(--panel-surface);
  border: 1px solid var(--panel-border);
  color: var(--brand-sky);
}

/* --------------------------------------------------------------------------
   6. Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-sm);
  padding: 14px 26px;
  border-radius: var(--r-full);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease),
    color 0.18s var(--ease), transform 0.18s var(--ease),
    box-shadow 0.18s var(--ease);
}
.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--sh-sm);
}
.btn-primary:hover {
  background: var(--primary-hover);
  color: #fff;
  box-shadow: var(--sh-md);
}
:root[data-theme="dark"] .btn-primary,
:root[data-theme="dark"] .btn-primary:hover {
  color: var(--brand-navy);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-primary,
  :root:not([data-theme="light"]) .btn-primary:hover {
    color: var(--brand-navy);
  }
}

.btn-dark {
  background: var(--brand-navy);
  color: #fff;
}
.btn-dark:hover {
  background: var(--brand-royal);
  color: #fff;
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* On dark panels */
.on-panel .btn-secondary,
.btn-on-panel {
  background: var(--panel-surface);
  border-color: var(--panel-border);
  color: #fff;
}
.on-panel .btn-secondary:hover,
.btn-on-panel:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}
.on-panel .btn-primary {
  background: #fff;
  color: var(--brand-navy);
}
.on-panel .btn-primary:hover {
  background: var(--brand-sky);
  color: var(--brand-navy);
}

.btn-lg {
  padding: 17px 34px;
  font-size: 16px;
}
.btn-block {
  width: 100%;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-md);
  align-items: center;
}
.btn-row.center {
  justify-content: center;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-sm);
  font-weight: 600;
  font-size: 15px;
  color: var(--primary);
}
.link-arrow .ico {
  transition: transform 0.18s var(--ease);
}
.link-arrow:hover .ico {
  transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   7. Navigation
   -------------------------------------------------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
.nav.is-stuck {
  box-shadow: var(--sh-sm);
}
.nav .wrap {
  display: flex;
  align-items: center;
  gap: var(--s-xl);
  width: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: none;
}

/* The brand lockup ships once, in colour, on transparency. The white variant
   for dark surfaces is derived from that same file — brightness(0) drops the
   ink to black, invert(1) lifts it to white, and alpha is untouched — so the
   two variants can never drift out of registration. */
.brand-logo {
  display: block;
  height: 46px;
  width: auto;
}
.brand-logo--lg {
  height: 54px;
}

.on-panel .brand-logo,
.footer .brand-logo,
.doc-header .brand-logo {
  filter: brightness(0) invert(1);
}

/* In dark mode the nav and drawer sit on a dark surface too. */
:root[data-theme="dark"] .nav .brand-logo,
:root[data-theme="dark"] .drawer .brand-logo {
  filter: brightness(0) invert(1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .nav .brand-logo,
  :root:not([data-theme="light"]) .drawer .brand-logo {
    filter: brightness(0) invert(1);
  }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--s-xs);
  list-style: none;
  margin-right: auto;
}
.nav-links a {
  display: block;
  padding: 9px 14px;
  border-radius: var(--r-sm);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-2);
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}
.nav-links a:hover {
  background: var(--surface-2);
  color: var(--text);
}
.nav-links a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--s-sm);
  flex: none;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--r-full);
  display: grid;
  place-items: center;
  color: var(--text-2);
  border: 1px solid transparent;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}
.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-toggle {
  display: none;
}

/* Mobile drawer */
.drawer {
  position: fixed;
  inset: var(--nav-h) 0 0;
  z-index: 99;
  background: var(--bg);
  padding: var(--s-lg);
  overflow-y: auto;
  transform: translateY(-8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease),
    visibility 0.2s;
}
.drawer[data-open="true"] {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.drawer ul {
  list-style: none;
}
.drawer a:not(.btn) {
  display: block;
  padding: var(--s-md) 0;
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.drawer .btn-row {
  margin-top: var(--s-lg);
  flex-direction: column;
  align-items: stretch;
}

/* --------------------------------------------------------------------------
   8. Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  background: var(--panel);
  color: var(--on-panel);
  overflow: hidden;
  padding-block: clamp(var(--s-3xl), 8vw, 120px);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
      1000px 620px at 78% -12%,
      rgba(79, 195, 247, 0.3),
      transparent 62%
    ),
    radial-gradient(
      760px 520px at 6% 108%,
      rgba(15, 61, 145, 0.65),
      transparent 60%
    );
  pointer-events: none;
}
.hero .wrap {
  position: relative;
  z-index: 1;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(var(--s-xl), 5vw, var(--s-3xl));
  align-items: center;
}

.hero h1 {
  color: #fff;
  margin-bottom: var(--s-lg);
}
.hero h1 em {
  font-style: normal;
  color: var(--brand-sky);
}
.hero-sub {
  font-size: clamp(17px, 1.7vw, 20px);
  line-height: 1.55;
  color: var(--on-panel-2);
  max-width: 52ch;
  margin-bottom: var(--s-xl);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-sm);
  margin-top: var(--s-xl);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 500;
  background: var(--panel-surface);
  border: 1px solid var(--panel-border);
  color: rgba(255, 255, 255, 0.9);
}
.chip .ico {
  color: var(--brand-sky);
}

/* Live-region status chip */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-sm);
  padding: 6px 14px 6px 10px;
  border-radius: var(--r-full);
  background: var(--panel-surface);
  border: 1px solid var(--panel-border);
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.86);
  margin-bottom: var(--s-lg);
}
.pulse {
  width: 8px;
  height: 8px;
  border-radius: var(--r-full);
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  animation: pulse 2.4s var(--ease) infinite;
  flex: none;
}
@keyframes pulse {
  70% {
    box-shadow: 0 0 0 9px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

/* --------------------------------------------------------------------------
   9. Quote estimator card
   -------------------------------------------------------------------------- */

.quote-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--s-xl);
  box-shadow: var(--sh-lg);
  color: var(--text);
}
.quote-card h2 {
  font-size: 21px;
  margin-bottom: var(--s-xs);
}
.quote-card .t-caption {
  margin-bottom: var(--s-lg);
}

.field-group + .field-group {
  margin-top: var(--s-lg);
}
.field-label {
  display: block;
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: var(--s-sm);
}

.seg {
  display: grid;
  gap: var(--s-sm);
}
.seg-3 {
  grid-template-columns: repeat(3, 1fr);
}
.seg-4 {
  grid-template-columns: repeat(4, 1fr);
}

.seg-opt {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 8px;
  min-height: 76px;
  text-align: center;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease),
    color 0.16s var(--ease);
}
.seg-opt:hover {
  border-color: var(--border-strong);
  color: var(--text);
}
.seg-opt[aria-checked="true"] {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--text);
  font-weight: 600;
}
.seg-opt .ico {
  color: var(--text-3);
}
.seg-opt[aria-checked="true"] .ico {
  color: var(--primary);
}
.seg-cars {
  display: flex;
  gap: 2px;
  height: 22px;
  align-items: center;
  color: var(--text-3);
}
.seg-opt[aria-checked="true"] .seg-cars {
  color: var(--primary);
}
.seg-cars .ico {
  width: 17px;
  height: 17px;
  color: inherit;
}

.estimate {
  margin-top: var(--s-lg);
  padding: var(--s-lg);
  border-radius: var(--r-lg);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  text-align: center;
}
.estimate .field-label {
  margin-bottom: 6px;
}
.estimate-value {
  font-size: clamp(28px, 3.4vw, 36px);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.estimate-note {
  margin-top: var(--s-sm);
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   10. Cards
   -------------------------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-xl);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease),
    transform 0.18s var(--ease);
}
.card h3 {
  font-size: var(--fs-headline);
  margin-bottom: var(--s-sm);
}
.card .ico-tile {
  margin-bottom: var(--s-lg);
}
a.card:hover,
.card--hover:hover {
  border-color: var(--border-strong);
  box-shadow: var(--sh-md);
  transform: translateY(-2px);
}
a.card {
  color: var(--text);
}

.card--flat {
  background: var(--bg-alt);
  border-color: transparent;
}
.on-panel .card {
  background: var(--panel-surface);
  border-color: var(--panel-border);
}

/* Numbered step */
.step {
  position: relative;
  padding-top: var(--s-lg);
  border-top: 2px solid var(--border);
}
.on-panel .step {
  border-top-color: var(--panel-border);
}
.step-num {
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--primary);
  margin-bottom: var(--s-md);
  display: block;
}
.on-panel .step-num {
  color: var(--brand-sky);
}
.step h3 {
  font-size: var(--fs-title);
  margin-bottom: var(--s-sm);
}

/* Stats band */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-lg);
}
.stat-value {
  font-size: clamp(30px, 3.6vw, 42px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--text);
}
.on-panel .stat-value {
  color: #fff;
}
.stat-label {
  margin-top: 6px;
  font-size: var(--fs-caption);
  color: var(--text-2);
}
.on-panel .stat-label {
  color: var(--on-panel-2);
}

/* Price table cards */
.price-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-lg);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.price-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--sh-sm);
}
.price-card--featured {
  border-color: var(--primary);
  box-shadow: var(--sh-md);
}
.price-tag {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 4px 10px;
  border-radius: var(--r-full);
  margin-bottom: var(--s-md);
}
.price-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.price-card h3 {
  font-size: var(--fs-headline);
  margin-bottom: var(--s-xs);
}
.price-card ul {
  list-style: none;
  margin-top: var(--s-md);
  padding-top: var(--s-md);
  border-top: 1px solid var(--border);
}
.price-card li {
  display: flex;
  gap: 10px;
  font-size: var(--fs-caption);
  color: var(--text-2);
  padding-block: 5px;
}
.price-card li .ico {
  color: var(--success);
  margin-top: 3px;
}

/* --------------------------------------------------------------------------
   11. Phone mockup (hero / feature visual)
   -------------------------------------------------------------------------- */

.phone {
  width: min(300px, 78vw);
  margin-inline: auto;
  border-radius: 42px;
  padding: 11px;
  background: linear-gradient(160deg, #2a3a55, #0c1526);
  box-shadow: 0 32px 70px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.phone-screen {
  border-radius: 32px;
  background: #f8fafc;
  overflow: hidden;
  position: relative;
  aspect-ratio: 9 / 18.5;
  display: flex;
  flex-direction: column;
}
.phone-notch {
  position: absolute;
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
  width: 84px;
  height: 22px;
  border-radius: var(--r-full);
  background: #0c1526;
  z-index: 3;
}
.phone-top {
  background: linear-gradient(140deg, var(--brand-royal), var(--brand-blue));
  padding: 42px 18px 20px;
  color: #fff;
}
.phone-top .lbl {
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.7;
  font-weight: 600;
}
.phone-top .val {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 3px;
}
.phone-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
}
.ph-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 11px 12px;
  box-shadow: 0 1px 4px rgba(10, 26, 51, 0.05);
}
.ph-row {
  display: flex;
  align-items: center;
  gap: 9px;
}
.ph-avatar {
  width: 30px;
  height: 30px;
  border-radius: var(--r-full);
  background: linear-gradient(145deg, var(--brand-blue), var(--brand-royal));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  flex: none;
}
.ph-name {
  font-size: 12px;
  font-weight: 600;
  color: #0a1a33;
  line-height: 1.3;
}
.ph-meta {
  font-size: 10px;
  color: #94a3b8;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 3px;
}
.ph-meta .ico {
  width: 11px;
  height: 11px;
  color: var(--warning);
  fill: var(--warning);
  stroke: none;
}
.ph-price {
  margin-left: auto;
  font-size: 13px;
  font-weight: 700;
  color: #0a1a33;
}
.ph-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--r-full);
  background: #dcfce7;
  color: #15803d;
}
.ph-badge .ico {
  width: 10px;
  height: 10px;
}
.ph-track {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
}
.ph-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-full);
  background: #e2e8f0;
  flex: none;
}
.ph-dot.done {
  background: var(--brand-blue);
}
.ph-line {
  height: 2px;
  flex: 1;
  background: #e2e8f0;
  border-radius: 2px;
}
.ph-line.done {
  background: var(--brand-blue);
}
.ph-label {
  font-size: 10px;
  color: #64748b;
  margin-top: 6px;
}
.ph-cta {
  margin-top: auto;
  background: var(--brand-blue);
  color: #fff;
  border-radius: var(--r-full);
  text-align: center;
  padding: 11px;
  font-size: 12px;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   12. Accordion (FAQ)
   -------------------------------------------------------------------------- */

.accordion {
  border-top: 1px solid var(--border);
}
.acc-item {
  border-bottom: 1px solid var(--border);
}
.acc-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-lg);
  padding: var(--s-lg) 0;
  text-align: left;
  font-size: var(--fs-headline);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.4;
}
.acc-btn .ico {
  color: var(--text-3);
  transition: transform 0.22s var(--ease), color 0.22s var(--ease);
}
.acc-btn[aria-expanded="true"] .ico {
  transform: rotate(180deg);
  color: var(--primary);
}
.acc-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.26s var(--ease);
}
.acc-panel[data-open="true"] {
  grid-template-rows: 1fr;
}
.acc-panel > div {
  overflow: hidden;
}
.acc-panel p {
  color: var(--text-2);
  padding-bottom: var(--s-lg);
  max-width: 68ch;
}
.acc-panel p + p {
  padding-top: var(--s-sm);
}

/* --------------------------------------------------------------------------
   13. Legal / document pages
   -------------------------------------------------------------------------- */

.doc-header {
  background: var(--panel);
  color: var(--on-panel);
  padding-block: clamp(var(--s-2xl), 6vw, var(--s-3xl));
  position: relative;
  overflow: hidden;
}
.doc-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    760px 420px at 88% -30%,
    rgba(79, 195, 247, 0.24),
    transparent 62%
  );
  pointer-events: none;
}
.doc-header .wrap {
  position: relative;
  z-index: 1;
}
.doc-header h1 {
  color: #fff;
  font-weight: 600;
  font-size: clamp(30px, 4.4vw, 42px);
  letter-spacing: -0.03em;
}
.doc-meta {
  margin-top: var(--s-md);
  font-size: var(--fs-caption);
  color: var(--on-panel-2);
}

.doc-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: clamp(var(--s-xl), 4vw, var(--s-3xl));
  align-items: start;
}

.toc {
  position: sticky;
  top: calc(var(--nav-h) + var(--s-lg));
  font-size: var(--fs-caption);
}
.toc .field-label {
  margin-bottom: var(--s-md);
}
.toc ol {
  list-style: none;
  counter-reset: toc;
  border-left: 2px solid var(--border);
}
.toc li {
  counter-increment: toc;
}
.toc a {
  display: block;
  padding: 7px 0 7px var(--s-md);
  margin-left: -2px;
  border-left: 2px solid transparent;
  color: var(--text-2);
  line-height: 1.45;
  font-weight: 500;
}
.toc a::before {
  content: counter(toc) ". ";
  color: var(--text-3);
}
.toc a:hover {
  color: var(--primary);
  border-left-color: var(--primary);
}

.doc {
  max-width: var(--maxw-prose);
  counter-reset: sec;
}
.doc > section {
  counter-increment: sec;
  padding-top: var(--s-xl);
}
.doc > section + section {
  margin-top: var(--s-xl);
  border-top: 1px solid var(--border);
}
.doc h2 {
  font-size: var(--fs-title);
  margin-bottom: var(--s-md);
  scroll-margin-top: calc(var(--nav-h) + var(--s-lg));
}
.doc h2::before {
  content: counter(sec) ". ";
  color: var(--primary);
  font-weight: 700;
}
.doc h3 {
  font-size: var(--fs-headline);
  margin-top: var(--s-lg);
  margin-bottom: var(--s-sm);
}
.doc p,
.doc li {
  color: var(--text-2);
  line-height: var(--lh-body);
}
.doc p + p,
.doc ul + p,
.doc ol + p,
.doc p + ul,
.doc p + ol,
.doc table + p {
  margin-top: var(--s-md);
}
.doc ul,
.doc ol {
  padding-left: var(--s-lg);
}
.doc li + li {
  margin-top: var(--s-sm);
}
.doc li::marker {
  color: var(--text-3);
}
.doc strong {
  color: var(--text);
  font-weight: 600;
}
.doc a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.callout {
  display: flex;
  gap: var(--s-md);
  padding: var(--s-lg);
  border-radius: var(--r-md);
  background: var(--primary-soft);
  border: 1px solid var(--border);
  margin-top: var(--s-lg);
}
.callout .ico {
  color: var(--primary);
  margin-top: 2px;
}
.callout p {
  font-size: var(--fs-caption);
  margin: 0;
}
.callout--warn {
  background: var(--surface-2);
}
.callout--warn .ico {
  color: var(--warning);
}

.table-scroll {
  overflow-x: auto;
  margin-top: var(--s-lg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  -webkit-overflow-scrolling: touch;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-caption);
  min-width: 520px;
}
th,
td {
  text-align: left;
  padding: 13px var(--s-md);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.5;
}
th {
  background: var(--bg-alt);
  color: var(--text);
  font-weight: 600;
  font-size: var(--fs-micro);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}
td {
  color: var(--text-2);
}
tr:last-child td {
  border-bottom: none;
}

/* --------------------------------------------------------------------------
   14. CTA band + footer
   -------------------------------------------------------------------------- */

.cta-band {
  background: linear-gradient(135deg, var(--brand-navy), var(--brand-royal));
  color: #fff;
  border-radius: var(--r-xl);
  padding: clamp(var(--s-xl), 5vw, var(--s-3xl));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--s-xl);
  align-items: center;
}
.cta-band h2 {
  color: #fff;
  font-weight: 600;
  font-size: var(--fs-display);
  letter-spacing: -0.03em;
}
.cta-band p {
  color: rgba(255, 255, 255, 0.72);
  margin-top: var(--s-md);
  max-width: 52ch;
}

.footer {
  background: var(--panel);
  color: var(--on-panel);
  padding-block: var(--s-3xl) var(--s-xl);
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
  gap: var(--s-2xl) var(--s-xl);
  padding-bottom: var(--s-2xl);
  border-bottom: 1px solid var(--panel-border);
}
.footer h3 {
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--on-panel-3);
  margin-bottom: var(--s-md);
}
.footer ul {
  list-style: none;
}
.footer li + li {
  margin-top: 11px;
}
.footer a {
  font-size: var(--fs-caption);
  color: var(--on-panel-2);
  font-weight: 400;
}
.footer a:hover {
  color: #fff;
}
.footer-about p {
  font-size: var(--fs-caption);
  color: var(--on-panel-2);
  max-width: 34ch;
  margin-top: var(--s-md);
}
.footer-bottom {
  padding-top: var(--s-lg);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-md);
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--on-panel-3);
}
.footer-bottom nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-lg);
}

/* App Store badge */
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px 10px 15px;
  border-radius: var(--r-md);
  border: 1px solid var(--panel-border);
  background: var(--panel-surface);
  color: #fff;
}
.store-badge:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.store-badge .ico {
  width: 25px;
  height: 25px;
  stroke: none;
  fill: currentColor;
}
.store-badge span {
  display: block;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.66;
  line-height: 1.3;
}
.store-badge strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

/* --------------------------------------------------------------------------
   15. Support page helpers
   -------------------------------------------------------------------------- */

.contact-card {
  display: flex;
  gap: var(--s-md);
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-lg);
}
.contact-card h3 {
  font-size: var(--fs-headline);
  margin-bottom: 4px;
}
.contact-card p {
  font-size: var(--fs-caption);
  color: var(--text-2);
}
.contact-card .value {
  display: inline-block;
  margin-top: var(--s-sm);
  font-weight: 600;
  font-size: 15px;
  color: var(--primary);
}

.steps-ol {
  counter-reset: st;
  list-style: none;
}
.steps-ol li {
  counter-increment: st;
  position: relative;
  padding-left: 46px;
  min-height: 32px;
}
.steps-ol li + li {
  margin-top: var(--s-md);
}
.steps-ol li::before {
  content: counter(st);
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  border-radius: var(--r-full);
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   16. Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1000px) {
  .doc-layout {
    grid-template-columns: 1fr;
  }
  .toc {
    position: static;
    padding-bottom: var(--s-lg);
    border-bottom: 1px solid var(--border);
  }
  .toc ol {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    border-left: none;
    gap: 0 var(--s-md);
  }
  .toc a {
    padding-left: 0;
    border-left: none;
  }
  .toc a:hover {
    border-left-color: transparent;
  }
  .grid-4,
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  :root {
    --nav-h: 68px;
  }
  .brand-logo,
  .brand-logo--lg {
    height: 36px;
  }
  .nav-links {
    display: none;
  }
  .nav-toggle {
    display: grid;
  }
  .nav .wrap {
    gap: var(--s-md);
    justify-content: space-between;
  }
  .nav-actions .btn {
    display: none;
  }
  .hero-grid,
  .split,
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
  /* Headline leads on narrow screens; the estimator follows it. */
  .hero-visual {
    margin-top: var(--s-lg);
  }
  .cta-band {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .wrap {
    padding-inline: var(--s-md);
  }
  .quote-card {
    padding: var(--s-lg);
  }
  .seg-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .seg-3 {
    grid-template-columns: 1fr;
  }
  .seg-opt {
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
    min-height: 0;
    padding: 12px var(--s-md);
  }
  .grid-4,
  .stats,
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .stats {
    gap: var(--s-lg);
  }
  .btn-row .btn {
    width: 100%;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .nav,
  .drawer,
  .footer,
  .toc,
  .cta-band,
  .skip-link {
    display: none !important;
  }
  .doc-header {
    background: none;
    color: #000;
  }
  .doc-header h1,
  .doc-meta {
    color: #000;
  }
  .doc-layout {
    grid-template-columns: 1fr;
  }
  body {
    background: #fff;
    color: #000;
  }
}
