/* ============================================================
   BASE — reset, typography, buttons, primitives
   Depends on: tokens.css
   ============================================================ */

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  margin: 0 0 var(--s-3);
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-weight: 700;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: 1rem; }

p { margin: 0 0 var(--s-4); color: var(--ink-soft); }

code, pre { font-family: var(--mono); }

/* ---------- Container ---------- */
.container {
  width: min(var(--container), 100% - 2rem);
  margin-inline: auto;
}

/* ---------- Eyebrow ---------- */
.eyebrow {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: var(--s-3);
}

.accent { color: var(--teal); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 10px 18px;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition:
    transform var(--dur) var(--ease),
    background var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
  white-space: nowrap;
  text-align: center;
  cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
.btn i { font-size: 0.85em; }

.btn--primary {
  background: var(--teal);
  color: #fff;
}
.btn--primary:hover {
  background: var(--teal-deep);
  box-shadow: var(--shadow-md);
}

.btn--secondary {
  background: var(--surface);
  color: var(--teal-deep);
  border-color: var(--border);
}
.btn--secondary:hover {
  border-color: var(--cyan);
  color: var(--teal);
}

.btn--ghost {
  background: transparent;
  color: var(--teal-deep);
  border-color: var(--border);
}
.btn--ghost:hover { border-color: var(--cyan); }

.btn--sm { padding: 6px 12px; font-size: var(--fs-sm); }
.btn--lg { padding: 14px 24px; font-size: 1rem; }
.btn--block { width: 100%; }

.btn--glow {
  position: relative;
  box-shadow: 0 8px 24px -8px rgba(0, 128, 128, 0.4);
}
.btn--glow:hover {
  box-shadow: 0 12px 32px -8px rgba(0, 128, 128, 0.55);
}

/* ---------- Section primitives ---------- */
.section { padding: var(--s-9) 0; }
.section--tint { background: var(--surface-alt); }
.section--tight { padding: var(--s-7) 0; }

.section__head {
  max-width: 640px;
  margin: 0 auto var(--s-7);
  text-align: center;
}
.section__head--left {
  margin-inline: 0;
  text-align: left;
  max-width: 720px;
}
.section__title { margin-bottom: var(--s-3); }
.section__lede {
  color: var(--muted);
  font-size: 1.05rem;
  margin-bottom: 0;
}

/* ---------- Chips ---------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  justify-content: center;
}
.chip {
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink-soft);
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.chip:hover { border-color: var(--cyan); color: var(--teal); }

/* ---------- States: loading / empty / error ---------- */
.state {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--s-7);
  color: var(--muted);
}
.state i {
  font-size: 2rem;
  display: block;
  margin-bottom: var(--s-3);
  color: var(--border);
}
.state h3 { color: var(--ink); margin-bottom: var(--s-2); }
.state p { margin-bottom: var(--s-4); }

.spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto var(--s-3);
  border: 3px solid var(--border);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 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;
}
.text-center { text-align: center; }
.mt-6 { margin-top: var(--s-6); }
.mt-7 { margin-top: var(--s-7); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}