/**
 * OpenTerms Design System
 * Shared stylesheet for openterms.com
 */

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  --ink: #0a0a0f;
  --paper: #f8f7f4;
  --accent: #ff4d1c;
  --accent-dim: #c93d12;
  --border: #e2e0db;
  --surface: #efeee9;
  --muted: #78767c;
  --sans: 'Archivo', system-ui, sans-serif;
  --serif: 'Newsreader', Georgia, serif;
  --mono: 'JetBrains Mono', monospace;
}

/* ── Font Load ─────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700;900&family=Newsreader:ital,wght@0,400;0,500;1,400&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── CSS Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img, svg { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; }
a { color: inherit; }

/* ── Base ───────────────────────────────────────────────────── */
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1080px;
  padding: 0 24px;
  margin: 0 auto;
}

/* ── Nav ───────────────────────────────────────────────────── */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.site-nav__logo {
  font-family: var(--sans);
  font-weight: 900;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--ink);
}
.site-nav__links {
  display: flex;
  gap: 32px;
  list-style: none;
}
.site-nav__links a {
  font-size: 0.875rem;
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s;
}
.site-nav__links a:hover { color: var(--ink); }

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
}
.site-footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.site-footer__brand {
  font-family: var(--sans);
  font-weight: 900;
  font-size: 0.875rem;
  color: var(--ink);
}
.site-footer__links {
  display: flex;
  gap: 24px;
  list-style: none;
}
.site-footer__links a {
  font-size: 0.8125rem;
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s;
}
.site-footer__links a:hover { color: var(--ink); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--accent);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--accent-dim); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: transparent;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.btn-secondary:hover { background: var(--surface); border-color: var(--ink); }

/* ── Code Block ────────────────────────────────────────────── */
.code-block {
  background: var(--surface);
  font-family: var(--mono);
  font-size: 0.875rem;
  padding: 20px 24px;
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow-x: auto;
  line-height: 1.7;
}

/* ── Numbered Section Device ───────────────────────────────── */
.section-numeral {
  font-family: var(--sans);
  font-weight: 900;
  font-size: 4rem;
  color: var(--border);
  line-height: 1;
  letter-spacing: -0.04em;
  display: block;
  margin-bottom: 16px;
}

/* ── Proof-Point Row ────────────────────────────────────────── */
.proof-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}
.proof-points li {
  padding: 4px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

/* ── Homepage: Hero (shared — used by index + check) ──────── */
.hero {
  padding: 96px 0 80px;
  border-bottom: 1px solid var(--border);
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.75rem, 5vw, 4rem);
  font-weight: 500;
  line-height: 1.15;
  max-width: 720px;
  margin-bottom: 40px;
}
.check-hero-subhead {
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.7;
  max-width: 640px;
  color: var(--muted);
  margin-bottom: 48px;
}
.check-hero-code {
  background: var(--ink);
  padding: 32px 36px;
  max-width: 600px;
  margin-bottom: 40px;
}
.check-hero-code .install-line {
  font-family: var(--mono);
  font-size: 0.875rem;
  color: #9e9a95;
  margin-bottom: 20px;
}
.check-hero-code pre {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: #d4d0c8;
  line-height: 1.8;
  margin: 0;
}
.check-hero-code .key { color: #f0c090; }
.check-hero-code .str { color: #a8d9a8; }
.check-hero-code .cmt { color: #6b6560; }
.check-hero-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}
.check-hero-proof {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 20px;
}
.check-hero-proof::before { content: '— '; }

/* ── Homepage: CTA (shared — used by index + check) ────────── */
.cta-section {
  padding-bottom: 96px;
}
.cta-section h2 {
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}
.cta-section p {
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.7;
  max-width: 560px;
  margin-bottom: 32px;
}
.cta-links {
  display: flex;
  gap: 16px;
}
.cta-primary {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 12px 24px;
  background: var(--ink);
  color: var(--paper);
  transition: background 0.15s;
  text-decoration: none;
}
.cta-primary:hover { background: var(--accent); }
.cta-secondary {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 12px 24px;
  border: 1px solid var(--border);
  color: var(--ink);
  transition: border-color 0.15s, background 0.15s;
  text-decoration: none;
}
.cta-secondary:hover { background: var(--surface); }

/* ── /check page-specific ──────────────────────────────────── */
.check-hero {
  padding: 80px 0;
  border-bottom: 1px solid var(--border);
}
.check-hero-eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.check-hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.75rem, 5vw, 4rem);
  font-weight: 500;
  line-height: 1.15;
  max-width: 720px;
  margin-bottom: 24px;
}

/* seven permissions */
.permissions-section {
  padding: 80px 0;
  border-bottom: 1px solid var(--border);
}
.permissions-section h2 {
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 40px;
}
.permissions-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 2px;
  background: var(--border);
  border: 1px solid var(--border);
}
.permission-item {
  background: var(--paper);
  padding: 24px 20px;
}
.permission-item code {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink);
  display: block;
  margin-bottom: 8px;
}
.permission-item p {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.5;
}

/* decision model */
.decision-section {
  padding: 80px 0;
  border-bottom: 1px solid var(--border);
}
.decision-section h2 {
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 40px;
}
.decision-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 40px;
}
.decision-table th {
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}
.decision-table td {
  font-size: 0.9375rem;
  padding: 20px 20px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.decision-table td:first-child {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink);
  font-weight: 500;
}
.decision-table td:nth-child(2) {
  color: var(--muted);
}
.decision-table tr:last-child td { border-bottom: none; }
.fail-closed-note {
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 640px;
  padding: 20px 24px;
  border-left: 3px solid var(--accent);
  background: var(--surface);
}

/* generate section */
.generate-section {
  padding: 80px 0;
  border-bottom: 1px solid var(--border);
}
.generate-section h2 {
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}
.generate-section > p {
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.7;
  max-width: 640px;
  margin-bottom: 32px;
}
.flywheel-line {
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 640px;
  margin-top: 32px;
}

/* check page: registry section */
.check-registry-section {
  padding: 80px 0;
  border-bottom: 1px solid var(--border);
}
.check-registry-section h2 {
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}
.check-registry-section > p {
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.7;
  max-width: 640px;
  margin-bottom: 40px;
}
.tiers-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  background: var(--border);
  border: 1px solid var(--border);
}
.tier {
  background: var(--paper);
  padding: 32px 28px;
}
.tier-count {
  font-family: var(--sans);
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--ink);
  margin-bottom: 8px;
}
.tier-label {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}
.tier h3 {
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--ink);
}
.tier p {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
}
.ota-note {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 24px;
  font-style: italic;
}

/* check page: sdks */
.sdks-section {
  padding: 80px 0;
  border-bottom: 1px solid var(--border);
}
.sdks-section h2 {
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 32px;
}
.sdks-section > p {
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.7;
  max-width: 640px;
  margin-bottom: 32px;
}
.sdk-install-cmd {
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--ink);
  color: var(--paper);
  padding: 14px 20px;
  display: inline-block;
  margin-bottom: 32px;
}
.sdks-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}
.sdk-chip {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 6px 14px;
  border: 1px solid var(--border);
  color: var(--ink);
}
.sdk-chip--coming {
  color: var(--muted);
}
.bulk-note {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .site-nav__links { display: none; }
  .site-footer__inner { flex-direction: column; gap: 24px; }
  .proof-points { gap: 6px; }
  .proof-points li { font-size: 0.6875rem; padding: 3px 10px; }
  .tiers-grid,
  .commitment-block,
  .layer-diagram,
  .alpha-banner {
    grid-template-columns: 1fr;
  }
  .cta-links { flex-wrap: wrap; }
}