/* ==========================================================================
   Base — reset, typography scale, layout primitives, accessibility
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem; /* clears the sticky header on anchor jumps */
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: var(--fw-normal);
  line-height: var(--lh-normal);
  color: var(--text-primary);
  background-color: var(--sky-950);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

/* ---------- Headings ------------------------------------------------------ */

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--sp-4);
  font-family: var(--font-display);
  font-weight: var(--fw-semi);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  color: var(--glow-100);
  font-variation-settings: 'SOFT' 0, 'WONK' 0;
}

h1 { font-size: clamp(2.25rem, 5.5vw, var(--fs-5xl)); }
h2 { font-size: clamp(1.75rem, 3.6vw, var(--fs-3xl)); }
h3 { font-size: clamp(1.25rem, 2.2vw, var(--fs-xl)); letter-spacing: -0.012em; }
h4 { font-size: var(--fs-lg); font-family: var(--font-body); letter-spacing: 0; }

/* ---------- Body copy ----------------------------------------------------- */

p {
  margin: 0 0 var(--sp-5);
  color: var(--text-secondary);
}
p:last-child { margin-bottom: 0; }

a {
  color: var(--glow-300);
  text-decoration: none;
  transition: color var(--t-fast);
}
a:hover { color: var(--glow-200); }

strong { color: var(--text-primary); font-weight: var(--fw-semi); }
em { font-style: italic; }

/* ---------- Lists --------------------------------------------------------- */

ul, ol {
  margin: 0 0 var(--sp-5);
  padding-left: 1.25rem;
  color: var(--text-secondary);
}
li { margin-bottom: var(--sp-2); }
li::marker { color: var(--glow-500); }

/* Unstyled list utility, used by feature/check lists */
.list-clean {
  list-style: none;
  padding-left: 0;
  margin: 0;
}
.list-clean li { margin-bottom: var(--sp-3); }

/* ---------- Focus visibility (WCAG 2.4.7) -------------------------------- */

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

/* ---------- Selection ----------------------------------------------------- */

::selection {
  background: var(--glow-300);
  color: var(--text-on-glow);
}

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

.container {
  width: 100%;
  max-width: var(--container-wide);
  margin-inline: auto;
  padding-inline: var(--sp-5);
}
@media (min-width: 768px)  { .container { padding-inline: var(--sp-8); } }
@media (min-width: 1280px) { .container { padding-inline: var(--sp-10); } }

.container--text {
  max-width: var(--container-text);
}
.container--narrow {
  max-width: var(--container-narrow);
}
.container--max {
  max-width: var(--container-max);
}

.section {
  padding-block: var(--sp-16);
  position: relative;
}
@media (min-width: 768px) { .section { padding-block: var(--sp-20); } }
@media (min-width: 1024px){ .section { padding-block: var(--sp-24); } }

.section--tight { padding-block: var(--sp-12); }
@media (min-width: 768px) { .section--tight { padding-block: var(--sp-16); } }

/* Alternating surface so long pages have rhythm */
.section--raised {
  background: var(--sky-900);
  border-block: 1px solid rgba(255, 255, 255, 0.05);
}
.section--panel {
  background: linear-gradient(180deg, var(--sky-900) 0%, var(--sky-950) 100%);
}

/* ---------- Screen-reader only (WCAG) ------------------------------------ */

.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 — keyboard users land here first */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--sp-4);
  z-index: 999;
  padding: var(--sp-3) var(--sp-5);
  background: var(--glow-300);
  color: var(--text-on-glow);
  font-weight: var(--fw-semi);
  border-radius: var(--r-md);
  transition: top var(--t-fast);
}
.skip-link:focus { top: var(--sp-4); }

/* ---------- Shared text utilities ---------------------------------------- */

.eyebrow {
  display: block;
  margin-bottom: var(--sp-4);
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semi);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--glow-500);
}

.lead {
  font-size: var(--fs-lg);
  line-height: var(--lh-relaxed);
  color: var(--text-secondary);
}
@media (min-width: 768px) { .lead { font-size: var(--fs-xl); } }

.prose p { font-size: var(--fs-md); line-height: var(--lh-relaxed); }
.prose h2 {
  margin-top: var(--sp-16);
  margin-bottom: var(--sp-5);
  padding-top: var(--sp-2);
}
.prose h3 {
  margin-top: var(--sp-10);
  margin-bottom: var(--sp-4);
  font-family: var(--font-body);
  font-weight: var(--fw-semi);
}
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose > ul, .prose > ol { font-size: var(--fs-md); line-height: var(--lh-relaxed); }
.prose > ul { margin-bottom: var(--sp-6); }

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

/* ---------- Global noise/grain overlay for depth ------------------------- */
.grain::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
  z-index: 1;
}
