/* ==========================================================================
   BASE: element defaults, typography, layout primitives
   ========================================================================== */

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--body);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h1, .h1 { font-size: var(--fs-h1); letter-spacing: -0.035em; line-height: 1.04; }
h2, .h2 { font-size: var(--fs-h2); letter-spacing: -0.03em; }
h3, .h3 { font-size: var(--fs-h3); }
h4, .h4 { font-size: var(--fs-h4); }
h5 { font-size: 1.05rem; }

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

.lead {
  font-size: var(--fs-lg);
  line-height: 1.6;
  color: var(--muted);
  max-width: 62ch;
}

a {
  color: var(--indigo-600);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--dur-1) ease;
}

a:hover {
  color: var(--violet-600);
}

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

::selection {
  background: var(--magenta-500);
  color: var(--white);
}

:focus-visible {
  outline: 3px solid var(--indigo-500);
  outline-offset: 3px;
  border-radius: 6px;
}

.on-dark :focus-visible,
.site-header :focus-visible {
  outline-color: var(--lavender-300);
}

/* Skip link for keyboard users */
.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 3000;
  padding: 10px 16px;
  background: var(--white);
  color: var(--ink);
  border-radius: var(--radius-sm);
  font-weight: 700;
  box-shadow: var(--shadow-md);
  transition: top var(--dur-2) var(--ease-out);
}

.skip-link:focus {
  top: 12px;
}

/* ---- Layout ------------------------------------------------------------ */

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  padding-inline: var(--gutter);
  margin-inline: auto;
}

.site-main {
  display: block;
  min-height: 60vh;
}

.section {
  padding-block: var(--section-y);
  position: relative;
}

.section--tight {
  padding-block: calc(var(--section-y) * 0.6);
}

.section--alt {
  background: var(--surface-2);
}

.section--tint {
  background: var(--grad-brand-soft);
}

.section--night,
.on-dark {
  background: var(--grad-night);
  color: var(--on-dark-muted);
}

.section--night h1,
.section--night h2,
.section--night h3,
.section--night h4,
.on-dark h1,
.on-dark h2,
.on-dark h3,
.on-dark h4 {
  color: var(--white);
}

.section--night .lead,
.on-dark .lead {
  color: var(--on-dark-muted);
}

.section--night a:not(.btn-hl),
.on-dark a:not(.btn-hl) {
  color: var(--lavender-300);
}

.grid {
  display: grid;
  gap: clamp(16px, 2vw, 28px);
}

.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }

.split {
  display: grid;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

@media (min-width: 992px) {
  .split { grid-template-columns: 1fr 1fr; }
  .split--wide-left { grid-template-columns: 1.15fr 0.85fr; }
  .split--wide-right { grid-template-columns: 0.85fr 1.15fr; }
  .split--top { align-items: start; }
}

.stack > * + * { margin-top: 1rem; }

/* ---- Small text pieces -------------------------------------------------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--indigo-600);
  margin-bottom: 14px;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad-brand);
}

.on-dark .eyebrow,
.section--night .eyebrow,
.page-hero--dark .eyebrow {
  color: var(--lavender-300);
}

.grad-text {
  background: var(--grad-text-light);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.on-dark .grad-text,
.section--night .grad-text,
.page-hero--dark .grad-text {
  background-image: var(--grad-text);
}

.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

.visually-hidden,
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---- Section heading ---------------------------------------------------- */

.section-head {
  max-width: 760px;
  margin-bottom: clamp(32px, 4vw, 56px);
}

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

.section-head--center .lead {
  margin-inline: auto;
}

.section-head--center .eyebrow::after {
  content: "";
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad-brand);
}

.section-head h2 {
  margin-bottom: 0.4em;
}

.section-head .lead {
  margin-bottom: 0;
}

/* ---- Prose (blog posts, legal pages) ----------------------------------- */

.prose {
  max-width: 70ch;
  font-size: var(--fs-md);
}

.prose h2 { font-size: var(--fs-h3); margin-top: 1.8em; }
.prose h3 { font-size: var(--fs-h4); margin-top: 1.5em; }
.prose ul { padding-left: 1.2em; margin: 0 0 1.2em; }
.prose li { margin-bottom: 0.4em; }
.prose li::marker { color: var(--violet-500); }
