/* ========================================================================
   Base — Reset / Typography / Layout
   ======================================================================== */

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

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-inter);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  color: var(--color-graphite-text);
  background: var(--color-canvas-white);
  font-feature-settings: "ss01" 1, "cv11" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
}

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

ul,
ol {
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--color-arcade-blue);
  outline-offset: 4px;
}

/* --- Typography -------------------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--font-weight-medium);
  color: var(--color-graphite-text);
  letter-spacing: -0.02em;
}

.text-display {
  font-size: clamp(32px, 4.2vw, 60px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 540;
}

.text-heading-lg {
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: var(--font-weight-medium);
  text-wrap: balance;
}

.text-heading {
  font-size: clamp(22px, 2.6vw, 32px);
  line-height: 1.4;
  letter-spacing: -0.015em;
  font-weight: var(--font-weight-medium);
  text-wrap: balance;
}

.text-heading-sm {
  font-size: var(--text-heading-sm);
  line-height: var(--leading-heading-sm);
  letter-spacing: -0.015em;
  font-weight: var(--font-weight-medium);
}

.text-subheading {
  font-size: var(--text-subheading);
  line-height: var(--leading-subheading);
  font-weight: var(--font-weight-regular);
}

.text-body {
  font-size: var(--text-body);
  line-height: var(--leading-body);
}

.text-body-sm {
  font-size: var(--text-body-sm);
  line-height: var(--leading-body-sm);
}

.text-caption {
  font-size: var(--text-caption);
  line-height: var(--leading-caption);
}

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

.text-steel {
  color: var(--color-steel-accent);
}

.text-on-dark {
  color: var(--color-canvas-white);
}

.text-tabular {
  font-feature-settings: "tnum" 1, "ss01" 1;
  font-variant-numeric: tabular-nums;
}

/* --- Section label (chapter number) ------------------------------------ */
.section-label {
  display: inline-block;
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.02em;
  color: var(--color-steel-accent);
  font-feature-settings: "tnum" 1;
  font-variant-numeric: tabular-nums;
}

/* --- Inline link ------------------------------------------------------- */
.inline-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-graphite-text);
  border-bottom: 1px solid var(--color-graphite-text);
  padding-bottom: 2px;
  transition: color 200ms ease, border-color 200ms ease;
}

.inline-link:hover {
  color: var(--color-navy-deep);
  border-color: var(--color-navy-deep);
}

.inline-link .arrow {
  transition: transform 200ms ease;
}

.inline-link:hover .arrow {
  transform: translateX(3px);
}

.inline-link--on-dark {
  color: var(--color-canvas-white);
  border-bottom-color: rgba(255, 255, 255, 0.6);
}

.inline-link--on-dark:hover {
  color: var(--color-navy-light);
  border-bottom-color: var(--color-navy-light);
}

/* --- Layout primitives ------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--page-max-width);
  margin-inline: auto;
  padding-inline: var(--spacing-24);
}

@media (min-width: 768px) {
  .container {
    padding-inline: var(--spacing-40);
  }
}

.section {
  padding-block: 80px;
  border-top: 1px solid var(--color-outline-ash);
}

.section--first {
  border-top: 0;
}

.section--no-rule {
  border-top: 0;
}

@media (min-width: 1024px) {
  .section {
    padding-block: 120px;
  }
}

.section-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-16);
  margin-bottom: var(--spacing-48);
  align-items: end;
}

@media (min-width: 1024px) {
  .section-head {
    grid-template-columns: 200px 1fr;
    gap: var(--spacing-64);
    margin-bottom: 80px;
  }
}

.section-head__lead {
  font-size: var(--text-subheading);
  line-height: 1.5;
  color: var(--color-slate-text);
  max-width: 56ch;
  margin-top: var(--spacing-16);
}

.stack-8 > * + * { margin-top: var(--spacing-8); }
.stack-16 > * + * { margin-top: var(--spacing-16); }
.stack-24 > * + * { margin-top: var(--spacing-24); }
.stack-32 > * + * { margin-top: var(--spacing-32); }
.stack-48 > * + * { margin-top: var(--spacing-48); }

.lead {
  font-size: var(--text-subheading);
  line-height: 1.5;
  color: var(--color-slate-text);
  max-width: 56ch;
}

/* --- Animation helpers ------------------------------------------------ */
.reveal-line {
  display: inline-block;
  white-space: nowrap;
  vertical-align: top;
}

.reveal-char {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
}

[data-hero-title] {
  opacity: 0;
}

[data-hero-fade] {
  will-change: transform, opacity;
}

@media (prefers-reduced-motion: reduce) {
  [data-hero-title],
  [data-hero-fade],
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* --- Utility ----------------------------------------------------------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
