/* ═══════════════════════════════════════════════════════════════
   TOM BUDD — DESIGN SYSTEM v5 · EUDAIMONIC
   The future of AI is warm. Alive. Not a void.
   ═══════════════════════════════════════════════════════════════ */

/* Fonts loaded via <link> in HTML for faster non-blocking load */

/* Screen reader only — visually hidden but accessible */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Skip to main content link */
.skip-link {
  position: absolute; top: -100%; left: 50%; transform: translateX(-50%);
  background: var(--ethos); color: #fff; padding: 12px 24px;
  border-radius: 0 0 8px 8px; font-weight: 600; font-size: 0.85rem;
  z-index: 10000; text-decoration: none; transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* Global keyboard focus indicator — critical for WCAG 2.1 AA */
:focus-visible {
  outline: 2px solid var(--ethos, #0891b2);
  outline-offset: 3px;
  border-radius: 4px;
}
/* Remove default outline only when NOT keyboard-navigating */
:focus:not(:focus-visible) { outline: none; }

/* Minimum touch targets — WCAG 2.5.8 */
a, button, [role="button"], input[type="checkbox"], input[type="radio"] {
  min-height: 44px;
  min-width: 44px;
}
/* Exception for inline text links */
p a, li a, span a, .dash-card__body a, .footer a {
  min-height: unset;
  min-width: unset;
}

:root {
  /* ─── Warm Palette ─── */
  --bg-warm: #FDFCF9;
  --bg-sand: #F7F4EE;
  --bg-stone: #EDEAE3;
  --bg-clay: #E2DED6;
  --bg-card: #FFFFFF;
  --bg-card-alt: #FAF9F6;
  --bg-deep: #1B1B2F;

  /* ─── Borders ─── */
  --border-warm: rgba(0,0,0,0.06);
  --border-subtle: rgba(0,0,0,0.06);
  --border-hover: rgba(0,0,0,0.12);
  --border-active: rgba(0,0,0,0.2);

  /* ─── Three Essences (more saturated on light) ─── */
  --ethos: #0891b2;
  --ethos-light: #E0F7FA;
  --ethos-glow: rgba(8,145,178,0.15);
  --techne: #7c3aed;
  --techne-light: #EDE9FE;
  --techne-glow: rgba(124,58,237,0.12);
  --logos: #ea580c;
  --logos-light: #FFF3E0;
  --logos-glow: rgba(234,88,12,0.12);

  /* ─── Text (warm charcoal hierarchy) ─── */
  --text-primary: #1a1a2e;
  --text-secondary: #3d3d56;
  --text-muted: #6b6b80;
  --text-dim: #6e6e85;
  --text-ghost: #c4c4d4;

  /* ─── Typography ─── */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* ─── Spacing ─── */
  --space-xs: 4px; --space-sm: 8px; --space-md: 16px;
  --space-lg: 24px; --space-xl: 40px; --space-2xl: 64px;
  --space-3xl: 100px; --space-4xl: 140px;

  /* ─── Radius ─── */
  --radius-sm: 8px; --radius-md: 12px;
  --radius-lg: 16px; --radius-xl: 24px;
  --radius-2xl: 32px;

  /* ─── Shadows (warm, not cold) ─── */
  --shadow-sm: 0 1px 3px rgba(26,26,46,0.04), 0 1px 2px rgba(26,26,46,0.03);
  --shadow-md: 0 4px 16px rgba(26,26,46,0.06), 0 1px 4px rgba(26,26,46,0.04);
  --shadow-lg: 0 12px 40px rgba(26,26,46,0.08), 0 4px 12px rgba(26,26,46,0.04);
  --shadow-xl: 0 24px 64px rgba(26,26,46,0.1), 0 8px 24px rgba(26,26,46,0.05);
}

/* ═══ RESET ═══ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg-warm);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ═══ GENERATIVE CANVAS ═══ */
#gen-canvas {
  position: fixed; top: 0; left: 0; width: 100%; height: 100vh; height: 100dvh;
  z-index: 0; pointer-events: none; opacity: 0.5;
}

/* ═══ NAV ═══ */
.nav {
  padding: 18px 40px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
  background: rgba(253,252,249,0.85);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-warm);
}
.nav__brand { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; }
.nav__brand span { color: var(--ethos); }
.nav__brand a { text-decoration: none; color: inherit; }
.nav__links { display: flex; gap: 28px; font-size: 0.85rem; }
.nav__links a {
  color: var(--text-dim); text-decoration: none; transition: all 0.2s;
  position: relative; padding: 10px 4px; font-weight: 500;
  min-height: 44px; display: inline-flex; align-items: center;
}
.nav__links a:hover { color: var(--text-primary); }
.nav__links a.active { color: var(--ethos); }
.nav__links a.active::after {
  content: ''; position: absolute; bottom: -2px; left: 0; right: 0;
  height: 2px; background: var(--ethos); border-radius: 1px;
}
.nav__cta {
  background: var(--text-primary); color: white; font-size: 0.85rem; font-weight: 600;
  padding: 10px 22px; border-radius: var(--radius-sm);
  text-decoration: none; transition: all 0.25s;
}
.nav__cta:hover { background: #2d2d4a; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.nav__mobile-toggle {
  display: none; background: none; border: none;
  color: var(--text-secondary); cursor: pointer; padding: 8px;
}
.nav__cta-mobile { display: none; }

/* Nav Dropdowns */
.nav__dropdown { position: relative; }
.nav__dropdown-toggle {
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 0.85rem; font-weight: 500;
  color: var(--text-muted); padding: 0; position: relative;
  display: inline-flex; align-items: center; gap: 2px;
  transition: color 0.2s;
}
.nav__dropdown-toggle:hover { color: var(--text-primary); }
.nav__dropdown--active > .nav__dropdown-toggle { color: var(--ethos); }
.nav__dropdown-toggle svg { transition: transform 0.2s; }
.nav__dropdown--open > .nav__dropdown-toggle svg { transform: rotate(180deg); }
.nav__dropdown-menu {
  position: absolute; top: calc(100% + 12px); left: 50%; transform: translateX(-50%);
  background: var(--bg-card); border: 1px solid var(--border-warm);
  border-radius: var(--radius-md); padding: 8px 0;
  box-shadow: var(--shadow-lg); min-width: 200px;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.15s, visibility 0.15s, transform 0.15s;
  transform: translateX(-50%) translateY(4px);
  z-index: 100;
}
.nav__dropdown--open > .nav__dropdown-menu {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.nav__dropdown-menu a {
  display: block; padding: 10px 20px; font-size: 0.84rem;
  color: var(--text-muted); text-decoration: none;
  transition: all 0.15s; white-space: nowrap;
}
.nav__dropdown-menu a:hover {
  color: var(--text-primary); background: rgba(124,58,237,0.04);
}
.nav__dropdown-menu a.active {
  color: var(--ethos); font-weight: 600;
}
.nav__dropdown-menu a.active::after { display: none; }

/* ═══ PAGE HEADER ═══ */
.page-header {
  padding: var(--space-4xl) var(--space-xl) var(--space-3xl);
  position: relative; z-index: 1;
}
.page-header__inner { max-width: 820px; margin: 0 auto; }
.page-header__eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ethos); margin-bottom: 24px;
}
.page-header__eyebrow::after {
  content: ''; width: 40px; height: 1px;
  background: var(--ethos); opacity: 0.4;
}
.page-header__eyebrow--techne { color: var(--techne); }
.page-header__eyebrow--techne::after { background: var(--techne); }
.page-header__eyebrow--logos { color: var(--logos); }
.page-header__eyebrow--logos::after { background: var(--logos); }
.page-header__title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 5.5vw, 4.2rem);
  font-weight: 700; letter-spacing: -0.03em;
  line-height: 1.1; margin-bottom: 24px;
}
.page-header__title .gradient {
  background: linear-gradient(135deg, var(--ethos), var(--techne));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.page-header__body {
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  line-height: 1.8; color: var(--text-muted); max-width: 640px;
}
.page-header__body strong { color: var(--text-secondary); font-weight: 600; }

/* ═══ SECTION ═══ */
.section { padding: var(--space-4xl) var(--space-xl); position: relative; z-index: 1; }
.section--sand { background: var(--bg-sand); }
.section--stone { background: var(--bg-stone); }
.section--deep { background: var(--bg-deep); color: #f8f8fc; }
.section--deep .text-muted { color: #94a3b8; }
.section__inner { max-width: 1120px; margin: 0 auto; }
.section__header { text-align: center; margin-bottom: var(--space-2xl); }
.section__eyebrow {
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  margin-bottom: 14px; display: block;
}
.section__eyebrow--ethos { color: var(--ethos); }
.section__eyebrow--techne { color: var(--techne); }
.section__eyebrow--logos { color: var(--logos); }
.section__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  font-weight: 700; letter-spacing: -0.02em;
  line-height: 1.15; margin-bottom: 14px;
}
.section__sub { color: var(--text-muted); font-size: 1rem; line-height: 1.7; max-width: 560px; margin: 0 auto; }

/* ═══ CARDS ═══ */
.card {
  background: var(--bg-card); border: 1px solid var(--border-warm);
  border-radius: var(--radius-xl); padding: 36px 32px;
  transition: all 0.35s ease; box-shadow: var(--shadow-sm);
}
.card:hover {
  border-color: var(--border-hover); transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
}
.card--sm { padding: 24px; border-radius: var(--radius-lg); }
.card--interactive { cursor: pointer; }
.card--flat { box-shadow: none; background: var(--bg-card-alt); }

.card--ethos { border-left: 3px solid var(--ethos); }
.card--techne { border-left: 3px solid var(--techne); }
.card--logos { border-left: 3px solid var(--logos); }

.card__marker { width: 10px; height: 10px; border-radius: 50%; margin-bottom: 20px; }
.card__marker--ethos { background: var(--ethos); box-shadow: 0 0 12px var(--ethos-glow); }
.card__marker--techne { background: var(--techne); box-shadow: 0 0 12px var(--techne-glow); }
.card__marker--logos { background: var(--logos); box-shadow: 0 0 12px var(--logos-glow); }

.card__eyebrow {
  font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 14px;
}
.card__title {
  font-family: var(--font-display);
  font-size: 1.15rem; font-weight: 700;
  line-height: 1.3; margin-bottom: 12px;
}
.card__body { color: var(--text-muted); font-size: 0.92rem; line-height: 1.75; }
.card__link {
  margin-top: 16px; font-size: 0.82rem; font-weight: 600;
  color: var(--ethos); display: inline-flex; align-items: center; gap: 6px;
  opacity: 0; transition: all 0.3s;
}
.card:hover .card__link { opacity: 1; }

/* ═══ GRID ═══ */
.grid { display: grid; gap: 24px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

/* ═══ BUTTONS ═══ */
.btn-primary {
  background: var(--text-primary); color: white;
  font-weight: 600; font-size: 0.95rem;
  padding: 14px 28px; border-radius: var(--radius-md);
  text-decoration: none; border: none; cursor: pointer;
  transition: all 0.3s; display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body); box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: #2d2d4a; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-primary--ethos { background: var(--ethos); }
.btn-primary--ethos:hover { background: #0e7490; }

.btn-ghost {
  background: transparent; color: var(--text-secondary);
  font-weight: 500; font-size: 0.95rem;
  padding: 14px 28px; border-radius: var(--radius-md);
  border: 1px solid var(--border-warm); transition: all 0.3s;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body); text-decoration: none;
}
.btn-ghost:hover { border-color: var(--text-primary); color: var(--text-primary); }
.btn-sm { padding: 10px 20px; font-size: 0.85rem; }

/* ═══ UNA CARD (sovereign voice) ═══ */
.una-card {
  background: var(--bg-deep); color: #f0f0f8;
  border-radius: var(--radius-2xl); padding: 44px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-xl);
}
.una-card::before {
  content: '';
  position: absolute; top: 0; left: 44px; right: 44px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--techne), transparent);
  opacity: 0.5;
}
.una-card__header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 24px;
}
.una-card__indicator {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--techne);
  box-shadow: 0 0 12px rgba(124,58,237,0.5);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.una-card__label {
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--techne);
}
.una-card__text {
  font-family: var(--font-mono); font-size: 0.85rem;
  line-height: 1.9; color: #94a3b8;
}
.una-card__text p + p { margin-top: 14px; }
.una-card__text .dim { color: #64748b; }
.una-card__timestamp {
  font-family: var(--font-mono); font-size: 0.68rem;
  color: #475569; margin-top: 24px;
}

/* ═══ DASHBOARD WIDGETS ═══ */
.dash-widget {
  background: var(--bg-card); border: 1px solid var(--border-warm);
  border-radius: var(--radius-xl); padding: 28px;
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.dash-widget__label {
  font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 8px;
}
.dash-widget__value {
  font-family: var(--font-display); font-size: 2.2rem;
  font-weight: 700; letter-spacing: -0.03em; line-height: 1;
}
.dash-widget__sub {
  font-size: 0.78rem; color: var(--text-dim); margin-top: 6px;
}
.dash-widget__bar {
  height: 4px; border-radius: 2px; background: var(--bg-stone);
  margin-top: 16px; overflow: hidden;
}
.dash-widget__fill {
  height: 100%; border-radius: 2px;
  transition: width 1.5s ease;
}

/* ═══ STATUS INDICATORS ═══ */
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 0.82rem; }
.status__dot { width: 8px; height: 8px; border-radius: 50%; }
.status--live .status__dot { background: #22c55e; box-shadow: 0 0 8px rgba(34,197,94,0.4); animation: pulse 2s ease-in-out infinite; }
.status--idle .status__dot { background: var(--logos); }
.status--offline .status__dot { background: var(--text-dim); }
.status__label { font-weight: 500; }

/* ═══ TESTIMONIALS ═══ */
.t-card {
  background: var(--bg-card); border: 1px solid var(--border-warm);
  border-radius: var(--radius-xl); padding: 36px 32px;
  transition: all 0.35s; box-shadow: var(--shadow-sm);
}
.t-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-xl); }
.t-card__quote {
  font-family: var(--font-display); font-size: 3.5rem;
  line-height: 0.8; color: var(--ethos); opacity: 0.3; margin-bottom: 16px;
}
.t-card__text {
  color: var(--text-secondary); font-size: 0.95rem;
  line-height: 1.8; margin-bottom: 28px; font-style: italic;
}
.t-card__text strong { color: var(--text-primary); font-style: normal; font-weight: 600; }
.t-card__author {
  display: flex; align-items: center; gap: 14px;
  padding-top: 20px; border-top: 1px solid var(--border-warm);
}
.t-card__avatar {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: white; font-size: 0.82rem;
}
.t-card__name { font-weight: 600; font-size: 0.92rem; }
.t-card__role { font-size: 0.78rem; color: var(--text-dim); margin-top: 3px; }

/* ═══ FORM ═══ */
.input {
  background: var(--bg-card); border: 1px solid var(--border-warm);
  border-radius: var(--radius-md); padding: 14px 18px;
  color: var(--text-primary); font-size: 0.9rem;
  font-family: var(--font-body); outline: none;
  transition: border-color 0.2s; width: 100%;
}
.input::placeholder { color: var(--text-ghost); }
.input:focus { border-color: var(--ethos); box-shadow: 0 0 0 3px var(--ethos-glow); }

/* ═══ FOOTER ═══ */
.footer { padding: 40px; text-align: center; border-top: 1px solid var(--border-warm); }
.footer__text { font-size: 0.78rem; color: var(--text-dim); }
.footer__text a { color: var(--text-secondary); }
.footer__text a:hover { color: var(--ethos); }

/* ═══ PROSE ═══ */
.prose { max-width: 720px; }
.prose h2 { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; margin: 48px 0 20px; }
.prose p { color: var(--text-secondary); font-size: 1rem; line-height: 1.85; margin-bottom: 20px; }
.prose strong { color: var(--text-primary); font-weight: 600; }
.prose a { color: var(--ethos); text-decoration: underline; text-underline-offset: 3px; }

/* ═══ LIVE PULSE ═══ */
.live-pulse {
  position: fixed; bottom: 20px; right: 20px;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: rgba(255,255,255,0.9); border: 1px solid var(--border-warm);
  border-radius: 20px; z-index: 99;
  font-family: var(--font-mono); font-size: 0.68rem;
  color: var(--text-dim); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-md);
}
.live-pulse__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,0.4);
  animation: pulse 2s ease-in-out infinite;
}

/* ═══ SCROLL ANIMATIONS ═══ */
.reveal {
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Staggered children — cards animate in sequence */
.reveal-stagger > * {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0s; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 0.1s; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 0.2s; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 0.3s; }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 0.4s; }
.reveal-stagger.visible > *:nth-child(6) { transition-delay: 0.5s; }
.reveal-stagger.visible > * { opacity: 1; transform: translateY(0); }

/* ═══ REDUCED MOTION ═══ */
@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;
  }
  .reveal { opacity: 1; transform: none; }
  .reveal-stagger > * { opacity: 1; transform: none; }
  #gen-canvas { display: none; }
}

/* ═══ SAFE AREA (notch/Dynamic Island) ═══ */
@supports (padding: env(safe-area-inset-top)) {
  .nav { padding-top: max(18px, env(safe-area-inset-top)); padding-left: max(40px, env(safe-area-inset-left)); padding-right: max(40px, env(safe-area-inset-right)); }
  .footer { padding-bottom: max(24px, env(safe-area-inset-bottom)); }
  .live-pulse { bottom: max(1.5rem, calc(env(safe-area-inset-bottom) + 0.5rem)); }
  .a11y-fab { bottom: max(1.5rem, calc(env(safe-area-inset-bottom) + 0.5rem)); left: max(1.5rem, env(safe-area-inset-left)); }
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 1024px) { .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) {
  .nav { position: sticky; top: 0; z-index: 1000; }
  .nav__mobile-toggle { display: block; z-index: 1001; position: relative; }
  .nav__cta { display: none; }

  /* Mobile nav — full opaque overlay */
  .nav__links {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    display: flex; flex-direction: column;
    background: var(--bg-warm);
    padding: 0; z-index: 999;
    opacity: 0; pointer-events: none;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
  }
  .nav--open .nav__links {
    opacity: 1; pointer-events: auto; visibility: visible;
  }

  /* Nav header area inside overlay — mirrors the sticky bar */
  .nav__links::before {
    content: '';
    display: block; height: 72px; flex-shrink: 0;
  }

  /* Link styles inside the overlay */
  .nav__links a {
    padding: 20px 32px; width: 100%;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 1.15rem; font-weight: 600;
    font-family: var(--font-display);
    letter-spacing: -0.01em;
    color: var(--text-primary);
    opacity: 0; transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, color 0.2s ease;
  }
  .nav--open .nav__links a {
    opacity: 1; transform: translateY(0);
  }
  .nav--open .nav__links a:nth-child(1) { transition-delay: 0.05s; }
  .nav--open .nav__links a:nth-child(2) { transition-delay: 0.08s; }
  .nav--open .nav__links a:nth-child(3) { transition-delay: 0.11s; }
  .nav--open .nav__links a:nth-child(4) { transition-delay: 0.14s; }
  .nav--open .nav__links a:nth-child(5) { transition-delay: 0.17s; }
  .nav--open .nav__links a:nth-child(6) { transition-delay: 0.2s; }
  .nav--open .nav__links a:nth-child(7) { transition-delay: 0.23s; }
  .nav--open .nav__links a:nth-child(8) { transition-delay: 0.26s; }
  .nav--open .nav__links a:nth-child(9) { transition-delay: 0.29s; }
  .nav--open .nav__links a:nth-child(10) { transition-delay: 0.32s; }
  .nav__links a:last-child { border-bottom: none; }
  .nav__links a:active { color: var(--ethos); }
  .nav__links a.active { color: var(--ethos); }

  /* Mobile dropdown overrides */
  .nav__dropdown { width: 100%; }
  .nav__dropdown-toggle {
    padding: 20px 32px; width: 100%;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 1.15rem; font-weight: 600;
    font-family: var(--font-display);
    letter-spacing: -0.01em;
    color: var(--text-primary);
    text-align: left; justify-content: space-between;
    opacity: 0; transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
  }
  .nav--open .nav__dropdown-toggle { opacity: 1; transform: translateY(0); }
  .nav__dropdown--active > .nav__dropdown-toggle { color: var(--ethos); }
  .nav__dropdown-menu {
    position: static; transform: none;
    background: transparent; border: none;
    box-shadow: none; padding: 0;
    max-height: 0; overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.2s;
    opacity: 0; visibility: visible; pointer-events: auto;
  }
  .nav__dropdown--open > .nav__dropdown-menu {
    max-height: 400px; opacity: 1;
    transform: none;
  }
  .nav__dropdown-menu a {
    padding: 14px 32px 14px 52px;
    font-size: 1rem; font-weight: 500;
    border-bottom: 1px solid var(--border-subtle);
  }
  .nav__dropdown-menu a:last-child { border-bottom: 1px solid var(--border-subtle); }

  /* CTA button inside mobile menu */
  .nav__links .nav__cta-mobile {
    display: block !important; margin: 32px 32px 24px; text-align: center;
    background: var(--ethos); color: white;
    padding: 16px 24px; border-radius: var(--radius-lg);
    font-weight: 600; font-size: 1rem; text-decoration: none;
    border-bottom: none; font-family: var(--font-body);
    box-shadow: 0 4px 12px rgba(8,145,178,0.3);
  }

  .grid--3 { grid-template-columns: 1fr; max-width: 500px; margin-left: auto; margin-right: auto; }
  .grid--2 { grid-template-columns: 1fr; }

  /* Horizontal swipe carousel for testimonials on mobile */
  .swipe-carousel {
    display: flex !important; grid-template-columns: unset !important;
    overflow-x: auto; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 16px; padding: 0 16px 16px;
    scrollbar-width: none; max-width: 100vw;
    margin-left: calc(var(--space-lg) * -1); margin-right: calc(var(--space-lg) * -1);
    width: calc(100% + var(--space-lg) * 2);
  }
  .swipe-carousel::-webkit-scrollbar { display: none; }
  .swipe-carousel > * {
    flex: 0 0 85%; scroll-snap-align: center;
    min-width: 280px;
  }
  /* Scroll progress dots */
  .swipe-dots {
    display: flex; justify-content: center; gap: 8px;
    margin-top: 16px;
  }
  .swipe-dots__dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--border-warm); transition: all 0.3s;
  }
  .swipe-dots__dot--active { background: var(--ethos); transform: scale(1.3); }
  .page-header { padding: var(--space-3xl) var(--space-lg) var(--space-2xl); }
  .page-header__title { font-size: clamp(1.8rem, 5vw, 2.8rem); }
  .page-header__body { font-size: 0.95rem; }
  .section { padding: var(--space-3xl) var(--space-lg); }
  .section__title { font-size: clamp(1.5rem, 4vw, 2.2rem); }

  /* Bottom quick-nav bar */
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0;
    z-index: 9998; background: rgba(253,252,249,0.95);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-warm);
    padding: 8px 0; padding-bottom: max(8px, env(safe-area-inset-bottom));
    justify-content: space-around; align-items: center;
  }
  .bottom-nav__item {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    text-decoration: none; color: var(--text-dim);
    font-size: 0.62rem; font-weight: 500; letter-spacing: 0.03em;
    padding: 4px 12px; min-height: 44px; justify-content: center;
    transition: color 0.2s;
  }
  .bottom-nav__item--active { color: var(--ethos); }
  .bottom-nav__item svg { width: 22px; height: 22px; }
  .bottom-nav__item:active { transform: scale(0.92); }

  /* Adjust footer and live-pulse for bottom nav */
  .footer { padding-bottom: 80px; }
  .live-pulse { bottom: calc(70px + max(0px, env(safe-area-inset-bottom))); }
  .a11y-fab { bottom: calc(70px + max(0px, env(safe-area-inset-bottom))); }
}

@media (max-width: 600px) {
  .nav { padding: 14px 20px; }
  .grid--4 { grid-template-columns: 1fr; }
  .page-header { padding: var(--space-2xl) var(--space-md) var(--space-xl); }
  .section { padding: var(--space-2xl) var(--space-md); }
  .footer__inner { flex-direction: column; text-align: center; gap: 24px; }
  .swipe-carousel {
    margin-left: calc(var(--space-md) * -1); margin-right: calc(var(--space-md) * -1);
    width: calc(100% + var(--space-md) * 2);
  }

  /* Hide live-pulse on small phones to reduce viewport clutter */
  .live-pulse { display: none; }
}
