@import url("tokens.css");

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

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

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(3, 4, 24, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -0.4px; }
.brand img { width: 28px; height: 28px; display: block; }
.brand .accent { color: var(--brand-magenta); }

.header-right { display: flex; align-items: center; gap: 18px; }

.social-icons { display: flex; align-items: center; gap: 10px; }
.social-icons a {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-2);
  color: var(--ink-muted);
  transition: 0.2s ease;
}
.social-icons a svg { width: 18px; height: 18px; fill: currentColor; }
.social-icons a[data-live="true"]:hover { color: var(--ink); border-color: var(--brand-magenta); background: var(--accent-soft); }
.social-icons a[data-live="false"] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ---------- CA bar ---------- */
.ca-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.ca-bar .wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  flex-wrap: wrap;
}
.ca-label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-dim);
  white-space: nowrap;
}
.ca-value {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink-muted);
  overflow-wrap: anywhere;
  flex: 1 1 auto;
  min-width: 0;
}
.ca-copy {
  font-family: var(--mono);
  font-size: 12px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--ink-muted);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  min-height: 44px;
  cursor: not-allowed;
  transition: 0.2s ease;
}
.ca-copy[data-armed="true"] { color: var(--ink); cursor: pointer; }
.ca-copy[data-armed="true"]:hover { border-color: var(--brand-magenta); color: var(--brand-magenta-soft); }
.ca-copy[data-copied="true"] { border-color: var(--ok); color: var(--ok); }

/* ---------- hero ---------- */
.hero { padding: 72px 0 56px; }
.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-dim);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  margin-bottom: 28px;
}
.hero h1 {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -1.8px;
  margin: 0 0 20px;
  max-width: 640px;
}
.hero h1 .grad {
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-magenta));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lede {
  font-size: 17px;
  color: var(--ink-muted);
  max-width: 520px;
  margin: 0 0 32px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  min-width: 44px;
  padding: 0 22px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 15px;
  border: 1px solid transparent;
  transition: 0.2s ease;
}
.btn-primary { background: linear-gradient(90deg, var(--brand-blue), var(--brand-magenta)); color: var(--on-brand); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { border-color: var(--brand-magenta); color: var(--brand-magenta-soft); }

/* ---------- stat tiles ---------- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 44px;
}
.stat-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.stat-tile .k { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-dim); margin-bottom: 8px; }
.stat-tile .v { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.stat-tile .v[data-inert="true"] { color: var(--ink-dim); font-weight: 700; font-size: 16px; }

/* ---------- sections ---------- */
section { padding: 64px 0 0; }
section:last-of-type { padding-bottom: 80px; }
h2 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1.12px;
  margin: 0 0 36px;
}
.section-lede { color: var(--ink-muted); max-width: 560px; margin: -20px 0 36px; }

/* ---------- steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.step-card .num {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--brand-magenta-soft);
  margin-bottom: 14px;
}
.step-card h3 { font-size: 17px; font-weight: 700; margin: 0 0 8px; }
.step-card p { color: var(--ink-muted); font-size: 14px; margin: 0; }

/* ---------- tabs ---------- */
.tabs-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.tablist { display: flex; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab {
  font-family: var(--mono);
  font-size: 13px;
  padding: 16px 20px;
  color: var(--ink-dim);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  background: none;
  border-top: none; border-left: none; border-right: none;
  min-height: 44px;
  transition: 0.2s ease;
}
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--brand-magenta); }
.tab:hover { color: var(--ink); }
.tab-panels { padding: 28px 24px 32px; }
.tab-panel { display: none; }
.tab-panel[data-active="true"] { display: block; animation: fade-in 0.45s cubic-bezier(0.4,0,0.2,1); }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.gate-demo { display: grid; gap: 10px; margin-top: 16px; }
.gate-demo input {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--canvas);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  color: var(--ink);
  padding: 10px 12px;
  min-height: 44px;
}
.gate-result {
  font-family: var(--mono);
  font-size: 13px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  color: var(--ink-dim);
}
.gate-result[data-state="pass"] { color: var(--ok); border-color: var(--ok); }
.gate-result[data-state="fail"] { color: var(--bad); border-color: var(--bad); }

/* ---------- registry table ---------- */
.registry-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.registry-table th, .registry-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.registry-table th { color: var(--ink-dim); font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-2);
}
.status-pill[data-status="stated"] { color: var(--ok); border-color: var(--ok); }
.status-pill[data-status="absent"] { color: var(--ink-dim); }
.status-pill[data-status="unconfirmed"] { color: var(--bad); border-color: var(--bad); }

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--line);
  margin-top: 80px;
  padding: 32px 0 40px;
  color: var(--ink-dim);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
footer .social-icons a { width: 44px; height: 44px; }
footer .social-icons a svg { width: 16px; height: 16px; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .stat-row, .steps { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; letter-spacing: -1.2px; }
}
@media (max-width: 480px) {
  .site-header .wrap { height: 60px; }
  .hero { padding: 48px 0 40px; }
  .hero h1 { font-size: 27px; }
  .ca-bar .wrap { padding: 10px 16px; }
  .wrap { padding: 0 16px; }
}
