/* ==========================================================================
   Base: reset, typography, page background, layout utilities
   ========================================================================== */

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

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

body,
h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }

:where(ul[role="list"], ol[role="list"]) { list-style: none; padding: 0; }

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

input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
textarea { resize: vertical; }

/* ---- Body ---- */
body {
  min-height: 100vh;
  background: var(--c-canvas);
  color: var(--c-ink);
  font: 400 16px/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
  overflow-x: clip;
}

/* Room for the fixed mobile action bar (hidden ≥ 960px). */
body { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
@media (min-width: 960px) { body { padding-bottom: 0; } }

/* Lock scroll while a modal (menu sheet / drawer) is open. */
html:has(dialog[open]) { overflow: hidden; }

/* ---- Page background ---- */
.page {
  position: relative;
  min-height: 100vh;
  overflow: clip;
  isolation: isolate;
  background: var(--g-page-m);
}

.page::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: var(--grid-size);
}

@media (min-width: 1280px) {
  .page { background: var(--g-page); }
}

/* Blurred glow blobs (decorative, CSS only). Each page positions its own with modifiers. */
.glow {
  position: absolute;
  z-index: -1;
  width: 360px;
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(40px);
  background: radial-gradient(circle, var(--glow-color, var(--glow-sky)), transparent 65%);
}
.glow--sky { --glow-color: var(--glow-sky); }
.glow--sky-soft { --glow-color: var(--glow-sky-soft); }
.glow--amber { --glow-color: var(--glow-amber); }
.glow--orange { --glow-color: var(--glow-orange); }

@media (min-width: 960px) {
  .glow { width: 620px; filter: blur(65px); }
}

/* ---- Typography ---- */
h1, h2, h3, h4 {
  font-family: var(--f-head);
  font-weight: 800;
  color: var(--c-ink);
}

/* The design balances only the H1 and a few hero-style H2s */
.text-balance { text-wrap: balance; }
@media (min-width: 960px) { h1 { text-wrap: balance; } }
p { text-wrap: pretty; }

.h1 {
  font: 800 36px/1.08 var(--f-head);
  letter-spacing: -0.025em;
}
.h2 {
  font: 800 30px/1.12 var(--f-head);
  letter-spacing: -0.02em;
}
.h3 {
  font: 700 19px/1.25 var(--f-head);
}

@media (min-width: 960px) {
  .h1 { font-size: 52px; line-height: 1.05; letter-spacing: -0.03em; }
  .h2 { font-size: 40px; line-height: 1.1; letter-spacing: -0.025em; }
  .h3 { font-size: 21px; }
}
@media (min-width: 1280px) {
  .h1 { font-size: 64px; line-height: 1.04; }
  .h2 { font-size: 46px; }
  .h3 { font-size: 22px; }
}

.eyebrow {
  display: inline-block;
  font: 600 12px/1 var(--f-body);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-solar-text);
}
@media (min-width: 960px) { .eyebrow { font-size: 13px; } }

.lead {
  font: 400 16px/1.55 var(--f-body);
  color: var(--c-ink-muted);
}
@media (min-width: 960px) { .lead { font-size: 19px; line-height: 1.6; } }

.text-solar {
  background: var(--g-solar-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.text-muted { color: var(--c-ink-muted); }

/* ---- Links ---- */
a {
  color: var(--c-sky);
  text-decoration: none;
  transition: color var(--t-fast);
}
a:hover { color: var(--c-sky-hover); }

/* ---- Focus ---- */
:focus { outline: none; }
:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 3px;
  box-shadow: var(--focus-ring);
}

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

.section { padding-top: var(--section-pt); }

/* Placeholder height for pages whose content isn't built yet. */
.main-stub { min-height: 70vh; }

/* ---- Utilities ---- */
.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: 16px;
  top: -100px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: var(--r-pill);
  background: var(--g-solar);
  color: var(--c-on-solar);
  font: 700 15px/1 var(--f-head);
}
.skip-link:focus-visible { top: 16px; color: var(--c-on-solar); }

[hidden] { display: none !important; }

/* Shown from 960px up only */
.desktop-only { display: none; }
@media (min-width: 960px) { .desktop-only { display: revert; } }

/* Shown below 960px only (the design's mobile copy) */
@media (min-width: 960px) { .mobile-only { display: none; } }

/* ---- Motion ---- */
@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;
    scroll-behavior: auto !important;
  }
}
