/* ==========================================================================
   Reset / Base / Typography / Utilities
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
ul[class], ol[class] { margin: 0; padding: 0; list-style: none; }

h1, h2, h3, h4, h5, h6 {
  color: var(--color-ink);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.01em;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-dark); }

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

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

button { cursor: pointer; border: none; background: none; }

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: var(--color-primary-light); color: var(--color-ink); }

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

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

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

.section { padding-block: var(--section-py); }
.section--soft { background: var(--color-bg-soft); }
.section--deep { background: var(--color-bg-deep); color: #fff; }
.section--deep h1,
.section--deep h2,
.section--deep h3,
.section--deep h4 { color: #fff; }
.section--deep p { color: rgba(255, 255, 255, .78); }
.section--tight { padding-block: var(--sp-16); }
.section--flush-top { padding-top: 0; }

.grid { display: grid; gap: var(--sp-6); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1023px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
  .grid--2,
  .grid--3,
  .grid--4 { grid-template-columns: 1fr; }
}

.stack { display: flex; flex-direction: column; gap: var(--sp-4); }
.row { display: flex; align-items: center; gap: var(--sp-3); }
.row--wrap { flex-wrap: wrap; }
.row--between { justify-content: space-between; }

/* ---------- Section header ---------- */

.section-head { max-width: 720px; margin-bottom: var(--sp-12); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head__eyebrow {
  display: inline-block;
  margin-bottom: var(--sp-3);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--color-primary-light);
  color: var(--color-primary-ink);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .04em;
}
.section-head__title { margin-bottom: var(--sp-4); }
.section-head__desc { color: var(--color-text-sub); font-size: 17px; }
.section-head--center .section-head__desc { margin-inline: auto; }

@media (max-width: 767px) {
  .section-head { margin-bottom: var(--sp-8); }
  .section-head__desc { font-size: 15px; }
}

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

.text-center { text-align: center; }
.text-sub { color: var(--color-text-sub); }
.text-mute { color: var(--color-text-mute); }
.text-small { font-size: var(--fs-sm); }
.text-xs { font-size: var(--fs-xs); }
.weight-600 { font-weight: 600; }
.mt-2 { margin-top: var(--sp-2); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); }
.mt-12 { margin-top: var(--sp-12); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-8 { margin-bottom: var(--sp-8); }
.num { font-variant-numeric: tabular-nums; font-family: var(--font-mono); }

.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 {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 200;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  transition: top var(--dur-fast);
}
.skip-link:focus { top: 16px; color: #fff; }

.up { color: var(--color-success); }
.down { color: var(--color-danger); }

.disclaimer-note {
  margin-top: var(--sp-6);
  padding: var(--sp-4) var(--sp-6);
  border-left: 3px solid var(--color-border-strong);
  background: var(--color-bg-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--color-text-sub);
  font-size: var(--fs-xs);
  line-height: 1.7;
}
.section--deep .disclaimer-note {
  background: rgba(255, 255, 255, .06);
  border-left-color: rgba(255, 255, 255, .3);
  color: rgba(255, 255, 255, .72);
}

/* ---------- Reveal animation ---------- */

.js-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
  will-change: opacity, transform;
}
.js-reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .js-reveal { opacity: 1; transform: none; }
}
