/* ==========================================================================
   Base — reset, typography, layout utilities, accessibility defaults
   ========================================================================== */

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

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
  /* Defensive mobile optimization */
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
}
/* Global icon fallback to prevent unbounded SVG scaling */
svg.icon { width: 1.2rem; height: 1.2rem; display: inline-block; vertical-align: middle; flex-shrink: 0; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { padding: 0; margin: 0; list-style: none; }
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 var(--sp-3);
  color: var(--ink);
}
h1 { font-size: var(--fs-hero); letter-spacing: -0.03em; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
p { margin: 0 0 var(--sp-3); color: var(--slate); }
p.lead { font-size: var(--fs-lead); color: var(--ink); }

/* Focus states — always visible, never suppressed */
:focus-visible {
  outline: 2.5px solid var(--route);
  outline-offset: 3px;
  border-radius: 4px;
}

.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-link {
  position: absolute;
  left: var(--sp-3);
  top: -60px;
  background: var(--ink);
  color: var(--white);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-sm);
  z-index: 1000;
  transition: top var(--dur-fast) var(--ease-out);
}
.skip-link:focus { top: var(--sp-3); }

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

.section {
  padding-block: var(--sp-8);
}
.section--tight { padding-block: var(--sp-6); }
.section--sand { background: var(--sand); }
.section--dark { background: var(--ink); color: var(--canvas); }
.section--dark p { color: var(--slate-soft); }
.section--dark h2, .section--dark h3 { color: var(--canvas); }
.section--route { background: var(--route); color: var(--white); }
.section--route p { color: rgba(255, 255, 255, 0.85); }
.section--route h2, .section--route h3 { color: var(--white); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-support);
  font-weight: 700;
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--route);
  margin-bottom: var(--sp-3);
}
.eyebrow::before {
  content: '';
  width: 22px; height: 2px;
  background: var(--route);
  border-radius: 2px;
}

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glass);
}
.glass--dark {
  background: var(--glass-bg-dark);
  border-color: rgba(255,255,255,0.12);
}

.text-center { text-align: center; }
.mx-auto { margin-inline: auto; }

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

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .section { padding-block: var(--sp-7); }
}

@media (max-width: 992px) {
  html, body {
    overflow-x: hidden;
    width: 100vw;
  }
}

@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  h1 { line-height: 1.12; }
  .section { padding-block: var(--sp-6); }
}
