/* ==========================================================================
   Reset + base typography
   ========================================================================== */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + var(--space-6));
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  font-feature-settings: "cv02", "cv03", "cv04", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

/* The browser's own `[hidden] { display: none }` is a user-agent rule, so ANY
   author rule that sets `display` beats it — `.btn { display: inline-flex }`
   silently un-hides every `hidden` button. Restore the attribute's meaning for
   the whole document; the multi-step payment dialogs depend on it. */
[hidden] { display: none !important; }

input, button, textarea, select { font: inherit; color: inherit; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text);
  text-wrap: balance;
}

h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, var(--text-5xl)); }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, var(--text-3xl)); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-md); }
h6 { font-size: var(--text-sm); text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--text-muted); }

p { text-wrap: pretty; }

a {
  color: var(--text-brand);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}
a:hover { color: var(--brand-700); }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-xs);
}

hr { border: none; border-top: 1px solid var(--border); margin: var(--space-8) 0; }

code, pre, kbd, samp { font-family: var(--font-mono); font-size: 0.92em; }

::selection { background: var(--brand-200); color: var(--brand-900); }

/* --- Utilities ----------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-6);
}
.container--wide { max-width: var(--container-wide); }

.stack > * + * { margin-top: var(--flow, var(--space-4)); }

.muted { color: var(--text-muted); }
.secondary { color: var(--text-secondary); }
.mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.tabular { font-variant-numeric: tabular-nums; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-brand);
}

.lede {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
  max-width: 60ch;
}

.visually-hidden {
  position: absolute !important;
  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(--space-4);
  top: -100px;
  z-index: var(--z-skip-link);
  padding: var(--space-3) var(--space-5);
  background: var(--brand-600);
  color: #fff;
  border-radius: var(--radius-sm);
  transition: top var(--duration) var(--ease-out);
}
.skip-link:focus { top: var(--space-4); color: #fff; }

/* --- Grid helpers -------------------------------------------------------- */

.grid { display: grid; gap: var(--space-6); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }

.row { display: flex; align-items: center; gap: var(--space-3); }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.row--end { justify-content: flex-end; }
.spacer { flex: 1 1 auto; }

/* --- Sections ------------------------------------------------------------ */

.section { padding-block: clamp(var(--space-12), 6vw, var(--space-24)); }
.section--tight { padding-block: clamp(var(--space-10), 4vw, var(--space-16)); }
.section--sunken { background: var(--bg-sunken); }
.section--raised { background: var(--bg-raised); }

.section-head {
  max-width: 62ch;
  margin-bottom: var(--space-10);
}
.section-head--center { margin-inline: auto; text-align: center; }
.section-head h2 { margin-block: var(--space-3); }

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

@media print {
  .site-header, .site-footer, .portal-sidebar, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
}
