/* ============================================================
   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); }

kbd {
  font-family: var(--mono);
  font-size: 0.78em;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: var(--r-sm);
  padding: 2px 6px;
  color: var(--teal-deep);
  white-space: nowrap;
}

/* ---------- 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;
}

/* ---------- Page head ---------- */
.page-head {
  padding: var(--s-9) 0 var(--s-6);
  border-bottom: 1px solid var(--border-soft);
  background: linear-gradient(180deg, var(--bg) 0%, var(--surface-alt) 100%);
}
.page-head__title {
  font-size: var(--fs-display);
  margin-bottom: var(--s-4);
}
.page-head__lede {
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 60ch;
  margin: 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); }

/* ---------- Status pills / dots ---------- */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--r-sm);
}
.status--dev   { background: var(--warn-bg); color: var(--warn); }
.status--beta  { background: var(--warn-bg); color: var(--warn); }
.status--live  { background: var(--success-bg); color: var(--success); }
.status--soon  { background: var(--surface-alt); color: var(--muted); }

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.dot--live { background: var(--success); }
.dot--beta, .dot--dev { background: var(--warn); }
.dot--soon { background: var(--muted); }

.pulse-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 0 0 rgba(198, 138, 0, 0.6);
  animation: pulseRingWarn 2s infinite;
}
@keyframes pulseRingWarn {
  0%   { box-shadow: 0 0 0 0 rgba(198, 138, 0, 0.6); }
  70%  { box-shadow: 0 0 0 10px rgba(198, 138, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(198, 138, 0, 0); }
}

/* ---------- Callout (info / warning) ---------- */
.callout {
  display: flex;
  gap: var(--s-5);
  align-items: flex-start;
  padding: var(--s-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--lime);
  border-radius: var(--r-lg);
  max-width: 880px;
  margin-inline: auto;
}
.callout--warn { border-left-color: var(--warn); background: #FFFDF6; }
.callout__mark {
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--teal);
  line-height: 1;
  flex-shrink: 0;
}
.callout--warn .callout__mark { color: var(--warn); }
.callout__body h3 { margin-bottom: var(--s-2); }
.callout__body p { margin: 0; color: var(--ink-soft); }

/* ---------- FAQ ---------- */
.faq {
  max-width: 720px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.faq__item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-4) var(--s-5);
  transition: border-color 0.2s var(--ease);
}
.faq__item[open] {
  border-color: var(--cyan);
  box-shadow: 0 8px 24px -12px rgba(0, 80, 80, 0.15);
}
.faq__item summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
  padding: var(--s-2) 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-3);
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: '\f067';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  color: var(--teal);
  transition: transform 0.3s var(--ease);
  font-size: 0.8rem;
}
.faq__item[open] summary::after { transform: rotate(45deg); }
.faq__item p {
  margin: var(--s-3) 0 0;
  color: var(--ink-soft);
  font-size: var(--fs-sm);
  line-height: 1.6;
}
.faq__item a {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- CTA band ---------- */
.cta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-5);
  padding: var(--s-7);
  background: linear-gradient(135deg, #EAFBFB 0%, #F1FBEF 50%, #E8F5FF 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}
.cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 10% 20%, rgba(50, 205, 50, 0.12), transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(0, 206, 209, 0.12), transparent 40%);
  pointer-events: none;
}
.cta > * { position: relative; z-index: 1; }
.cta__copy h2 { margin-bottom: var(--s-2); }
.cta__copy p { margin: 0; color: var(--ink-soft); }

.center-cta { text-align: center; margin-top: var(--s-6); }

/* ---------- States ---------- */
.state { text-align: center; padding: var(--s-7); color: var(--muted); }
.state h3 { color: var(--ink); margin-bottom: var(--s-2); }

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

@media (max-width: 720px) {
  .page-head { padding: var(--s-7) 0 var(--s-5); }
  .callout { flex-direction: column; gap: var(--s-3); }
  .cta { padding: var(--s-6); }
}

/* ---------- 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;
  }
}

/* ---------- Disabled download state (placeholder build) ---------- */
.dl-download.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: auto;   /* keep clickable so we can block + explain */
  filter: grayscale(0.35);
  box-shadow: none !important;
}
.dl-download[aria-disabled="true"] { text-decoration: none; }
