/* ============================================================
   DPP Landing Page — Design System
   ============================================================ */

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  /* Primary accent — a refined indigo */
  --accent-h: 235;
  --accent: hsl(var(--accent-h), 82%, 58%);
  --accent-light: hsl(var(--accent-h), 82%, 68%);
  --accent-dark: hsl(var(--accent-h), 82%, 44%);
  --accent-subtle: hsl(var(--accent-h), 60%, 14%);
  --accent-border: hsl(var(--accent-h), 50%, 28%);

  /* Neutrals */
  --bg: hsl(220, 16%, 7%);
  --bg-1: hsl(220, 14%, 10%);
  --bg-2: hsl(220, 12%, 13%);
  --bg-3: hsl(220, 10%, 17%);
  --border: hsl(220, 10%, 20%);
  --border-subtle: hsl(220, 8%, 15%);
  --text-primary: hsl(220, 20%, 94%);
  --text-secondary: hsl(220, 12%, 60%);
  --text-muted: hsl(220, 10%, 42%);

  /* Semantic colours */
  --green: hsl(152, 65%, 42%);
  --green-bg: hsl(152, 40%, 12%);
  --amber: hsl(38, 90%, 54%);
  --amber-bg: hsl(38, 60%, 10%);
  --escalation: hsl(28, 85%, 52%);
  --escalation-bg: hsl(28, 50%, 10%);

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;

  /* Spacing */
  --section-py: clamp(80px, 10vw, 140px);
  --container-max: 1120px;
  --container-px: clamp(20px, 5vw, 48px);

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  /* Shadows */
  --shadow-card: 0 1px 3px rgba(0,0,0,.4), 0 4px 24px rgba(0,0,0,.2);
  --shadow-glow: 0 0 80px rgba(99, 102, 241, 0.15);
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }

/* ── Typography ──────────────────────────────────────────── */
h1 { font-size: clamp(2rem, 8vw, 4.2rem); font-weight: 700; line-height: 1.12; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
h3 { font-size: 1.05rem; font-weight: 600; line-height: 1.4; }
p { color: var(--text-secondary); }
code, .mono { font-family: var(--font-mono); font-size: 0.82em; }
.mono-sm { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); }

/* ── Container ───────────────────────────────────────────── */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-px);
}

/* ── Reveal animation ────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ── Gradient text ───────────────────────────────────────── */
.gradient-text {
  background: linear-gradient(135deg, var(--accent-light) 0%, hsl(270, 80%, 70%) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 0 0 0 transparent;
}
.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.95rem;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.btn-secondary:hover {
  border-color: var(--accent-border);
  background: var(--accent-subtle);
  transform: translateY(-2px);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  transition: color 0.2s;
}
.btn-ghost:hover { color: var(--text-secondary); }

.btn-nav {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.btn-nav:hover { background: var(--bg-3); border-color: var(--accent-border); }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.badge-alpha {
  background: var(--amber-bg);
  color: var(--amber);
  border: 1px solid hsla(38, 90%, 54%, 0.2);
}
.badge-os {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid hsla(152, 65%, 42%, 0.2);
}
.status-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
  letter-spacing: 0.05em;
}
.status-alpha { background: var(--amber-bg); color: var(--amber); }
.status-ref { background: var(--accent-subtle); color: var(--accent-light); }

/* ── Navigation ──────────────────────────────────────────── */
#site-header {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 100;
  background: hsla(220, 16%, 7%, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  height: 64px;

  /* Scroll-driven shrink */
  animation: header-shrink linear both;
  animation-timeline: scroll(block root);
  animation-range: 0px 120px;
}

@keyframes header-shrink {
  to { height: 52px; }
}

/* Fallback handled in JS */
@supports not ((animation-timeline: scroll()) and (animation-range: 0% 100%)) {
  #site-header { height: 64px; }
}

.nav-inner {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-px);
  height: 100%;
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}
.logo-icon {
  font-size: 1.2rem;
  color: var(--accent);
  line-height: 1;
}
.logo-text { color: var(--text-primary); }
.logo-badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  background: var(--accent-subtle);
  color: var(--accent-light);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-weight: 500;
}

.nav-links {
  display: flex;
  gap: 2px;
  flex: 1;
}
.nav-links a {
  padding: 6px 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: color 0.18s, background 0.18s;
}
.nav-links a:hover { color: var(--text-primary); background: var(--bg-2); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 32px;
  height: 32px;
  padding: 7px;
  margin-left: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-2);
  transition: background 0.2s, border-color 0.2s;
}
.nav-toggle:hover { background: var(--bg-3); border-color: var(--accent-border); }
.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(5.5px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-5.5px) rotate(-45deg);
}

@media (max-width: 800px) {
  #site-header:has(.nav-links.is-open) {
    height: auto;
    min-height: 64px;
    animation: none;
  }
  .nav-inner {
    gap: 10px;
    flex-wrap: wrap;
    align-content: center;
    height: auto;
    min-height: 64px;
    padding-block: 10px;
  }
  .nav-toggle { display: inline-flex; }
  .btn-nav {
    padding: 8px 12px;
    font-size: 0.8rem;
  }
  .btn-nav svg { width: 16px; height: 16px; }
  .nav-links {
    display: none;
    order: 4;
    flex: 1 1 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px 0 4px;
    border-top: 1px solid var(--border-subtle);
    margin-top: 4px;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a {
    padding: 12px 14px;
    font-size: 0.92rem;
    color: var(--text-secondary);
  }
  .nav-links a[aria-current="page"] {
    color: var(--text-primary);
    background: var(--bg-2);
  }
  body.nav-open { overflow: hidden; }
}
@media (max-width: 420px) {
  .btn-nav-label { display: none; }
  .btn-nav { padding: 8px 10px; }
}

/* ── Hero ────────────────────────────────────────────────── */
.section-hero {
  position: relative;
  padding-top: calc(64px + clamp(40px, 8vw, 140px));
  padding-bottom: clamp(52px, 10vw, 140px);
  overflow: hidden;
}

.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 0%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 0%, transparent 80%);
}

.hero-glow {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 600px;
  background: radial-gradient(ellipse at 50% 30%, hsla(235, 82%, 58%, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  text-align: center;
  /* Ensure content never bleeds into gutter on tiny screens */
  padding-inline: 24px;
}

.hero-eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.hero-title {
  margin-bottom: 20px;
}

.hero-tagline {
  font-size: clamp(1rem, 4vw, 1.3rem);
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 20px;
  padding-inline: 8px;
}

.hero-body {
  max-width: 680px;
  margin-inline: auto;
  margin-bottom: 36px;
  font-size: clamp(0.88rem, 2.5vw, 0.97rem);
  line-height: 1.75;
  color: var(--text-secondary);
  padding-inline: 4px;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 44px;
}

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 16px;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  padding-top: 24px;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.trust-item svg { color: var(--accent); flex-shrink: 0; }
.trust-sep { opacity: 0.35; }

/* ── Section commons ─────────────────────────────────────── */
.section-principles,
.section-who,
.section-flow,
.section-use-cases,
.section-auth,
.section-tools,
.section-build {
  padding-block: var(--section-py);
}

.section-who, .section-tools { background: var(--bg-1); }
.section-flow, .section-build { background: var(--bg); }
.section-auth { background: var(--bg-1); }
.section-use-cases { background: var(--bg); }

.section-header {
  text-align: center;
  margin-bottom: clamp(40px, 6vw, 72px);
}
.section-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.section-subtitle {
  max-width: 560px;
  margin-inline: auto;
  margin-top: 12px;
  font-size: 1rem;
  color: var(--text-muted);
}

/* ── Principles ──────────────────────────────────────────── */
.principles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 768px) { .principles-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .principles-grid { grid-template-columns: 1fr; } }

.principle-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.principle-card:hover {
  border-color: var(--accent-border);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}
.principle-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--accent-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-light);
  margin-bottom: 16px;
}
.principle-card h3 { margin-bottom: 8px; color: var(--text-primary); }
.principle-card p { font-size: 0.88rem; line-height: 1.65; }

/* ── Who It's For ────────────────────────────────────────── */
.who-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 768px) { .who-grid { grid-template-columns: 1fr; } }

.who-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.25s, transform 0.25s;
}
.who-card:hover { border-color: var(--accent-border); transform: translateY(-4px); }

.who-icon {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.user-icon { background: hsla(235, 82%, 58%, 0.12); color: var(--accent-light); }
.agent-icon { background: hsla(270, 70%, 58%, 0.12); color: hsl(270, 70%, 70%); }
.merchant-icon { background: var(--green-bg); color: var(--green); }

.who-card h3 { font-size: 1.15rem; color: var(--text-primary); }
.who-card p { font-size: 0.88rem; line-height: 1.7; }

.who-list {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.who-list li {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding-left: 16px;
  position: relative;
}
.who-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.75rem;
}

/* ── Money Flow ──────────────────────────────────────────── */
.flow-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin-bottom: 40px;
}

.flow-node {
  width: 100%;
  max-width: 560px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.25s;
  position: relative;
}
.flow-node:hover { border-color: var(--accent-border); }
.flow-node strong { font-size: 0.95rem; color: var(--text-primary); }
.flow-node-sub { font-size: 0.78rem; color: var(--text-muted); }

.flow-node-icon {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  opacity: 0.5;
}

.flow-node--user { border-left: 3px solid var(--green); }
.flow-node--agent { border-left: 3px solid var(--accent); }
.flow-node--wallet { border-left: 3px solid hsl(270, 70%, 60%); }
.flow-node--merchant { border-left: 3px solid var(--amber); }
.flow-node--psp { border-left: 3px solid hsl(200, 70%, 55%); }
.flow-node--escalation { border-left: 3px solid var(--escalation); }

.flow-node--user { background: hsla(152, 40%, 8%, 0.6); }
.flow-node--agent { background: hsla(235, 50%, 10%, 0.6); }
.flow-node--wallet { background: hsla(270, 40%, 10%, 0.6); }
.flow-node--merchant { background: hsla(38, 50%, 8%, 0.6); }
.flow-node--psp { background: hsla(200, 40%, 8%, 0.6); }
.flow-node--escalation { background: hsla(28, 40%, 8%, 0.6); }

.flow-node-callout {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  font-size: 0.73rem;
  color: var(--accent-light);
  background: var(--accent-subtle);
  border-radius: 4px;
  padding: 3px 8px;
  width: fit-content;
  font-weight: 600;
}

.flow-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--accent);
  opacity: 0.5;
  padding: 4px 0;
}
.flow-arrow-line {
  display: block;
  width: 1.5px;
  height: 20px;
  background: currentColor;
}
.flow-arrow--escalation { color: var(--escalation); }

.flow-callout {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin-bottom: 36px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}
.flow-callout svg { color: var(--accent-light); flex-shrink: 0; margin-top: 2px; }
.flow-callout strong { color: var(--text-primary); }
.callout-link {
  display: inline-block;
  margin-top: 4px;
  color: var(--accent-light);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  transition: opacity 0.2s;
}
.callout-link:hover { opacity: 0.75; }

.ascii-arch {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  margin-top: 4px;
}
.ascii-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.ascii-arch pre {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre;
  overflow-x: auto;
}

/* ── Use Cases ───────────────────────────────────────────── */
.use-cases-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
@media (max-width: 680px) { .use-cases-grid { grid-template-columns: 1fr; } }

.use-case-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.use-case-card:hover {
  border-color: var(--accent-border);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}

.uc-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.uc-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--accent-subtle);
  color: var(--accent-light);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.uc-stack { color: var(--text-muted); }

.use-case-card h3 { color: var(--text-primary); font-size: 1rem; }
.use-case-card p { font-size: 0.875rem; line-height: 1.7; }
.use-case-card code { background: var(--bg-3); padding: 1px 5px; border-radius: 4px; }

.uc-actors {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.actor {
  font-size: 0.73rem;
  padding: 3px 10px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-muted);
}

.uc-link {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--accent-light);
  margin-top: auto;
  transition: opacity 0.2s;
}
.uc-link:hover { opacity: 0.7; }

/* ── Auth Timeline ───────────────────────────────────────── */
.auth-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  max-width: 760px;
  margin-inline: auto;
}
.auth-timeline::before {
  content: '';
  position: absolute;
  left: 23px;
  top: 0;
  bottom: 0;
  width: 1.5px;
  background: var(--border);
}

.timeline-step {
  display: flex;
  gap: 24px;
  padding-bottom: 36px;
  position: relative;
}
.timeline-step:last-child { padding-bottom: 0; }

.timeline-marker {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  background: var(--bg-2);
  border: 2px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  transition: border-color 0.25s;
}
.timeline-step:hover .timeline-marker {
  border-color: var(--accent);
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-light);
}

.timeline-content {
  flex: 1;
  padding-top: 8px;
  padding-bottom: 8px;
}

.timeline-actor {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}

.timeline-action {
  color: var(--text-primary);
  margin-bottom: 6px;
  font-size: 0.98rem;
}

.timeline-content p {
  font-size: 0.875rem;
  line-height: 1.7;
  margin-bottom: 8px;
}
.timeline-content code {
  background: var(--bg-3);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--accent-light);
}
.timeline-content strong { color: var(--text-primary); }

.timeline-ref {
  font-size: 0.76rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  transition: color 0.2s;
}
.timeline-ref:hover { color: var(--accent-light); }

/* ── Tools section ───────────────────────────────────────── */
.tools-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 36px;
}

.tools-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.tools-table thead {
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}
.tools-table th {
  padding: 14px 20px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.tools-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  vertical-align: top;
}
.tools-table tr:last-child td { border-bottom: none; }
.tools-table tr:hover td { background: var(--bg-2); }
.tools-table code {
  background: var(--accent-subtle);
  color: var(--accent-light);
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 0.83em;
  white-space: nowrap;
}

.charge-no {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--green-bg);
  color: var(--green);
}
.charge-yes {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--amber-bg);
  color: var(--amber);
}

/* ── Code snippet ────────────────────────────────────────── */
.code-snippet {
  background: hsl(220, 18%, 9%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.snippet-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}

.snippet-dots {
  display: flex;
  gap: 6px;
}
.snippet-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
}
.snippet-dots span:nth-child(1) { background: hsl(0, 70%, 55%); }
.snippet-dots span:nth-child(2) { background: hsl(38, 90%, 55%); }
.snippet-dots span:nth-child(3) { background: hsl(130, 60%, 50%); }

.snippet-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.snippet-code {
  padding: 28px;
  font-family: var(--font-mono);
  font-size: 0.83rem;
  line-height: 1.75;
  overflow-x: auto;
  color: var(--text-secondary);
}
.code-comment { color: var(--text-muted); }
.code-fn { color: var(--accent-light); }
.code-str { color: var(--green); }
.code-num { color: var(--amber); }

/* ── Build section ───────────────────────────────────────── */
.build-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}
@media (max-width: 640px) { .build-grid { grid-template-columns: 1fr; } }

.build-category {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  transition: border-color 0.25s;
}
.build-category:hover { border-color: var(--accent-border); }

.build-cat-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--text-primary);
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}
.build-cat-title svg { color: var(--accent); flex-shrink: 0; }

.build-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.build-links li {
  display: flex;
  align-items: center;
  gap: 8px;
}
.build-links a {
  font-size: 0.86rem;
  color: var(--text-secondary);
  transition: color 0.2s;
}
.build-links a:hover { color: var(--accent-light); }
.build-links .mono-sm { color: var(--accent-light); }

/* ── Honesty block ───────────────────────────────────────── */
.honesty-block {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 28px;
}

.honesty-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--amber);
  margin-bottom: 12px;
}
.honesty-header svg { color: var(--amber); }

.honesty-intro {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.honesty-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.honesty-list li {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-left: 18px;
  position: relative;
  line-height: 1.65;
}
.honesty-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--text-muted);
  opacity: 0.5;
}
.honesty-list strong { color: var(--text-secondary); }
.honesty-list code {
  font-family: var(--font-mono);
  font-size: 0.8em;
  color: var(--accent-light);
  background: var(--accent-subtle);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  background: var(--bg-1);
  border-top: 1px solid var(--border-subtle);
  padding-top: 64px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 48px;
  padding-bottom: 48px;
}
@media (max-width: 680px) {
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-brand .logo-icon { font-size: 1.4rem; color: var(--accent); }
.footer-brand .logo-text { font-size: 1.1rem; font-weight: 700; }
.footer-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 220px;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 480px) {
  .footer-links { grid-template-columns: 1fr 1fr; }
}

.footer-col h4 {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-col a {
  font-size: 0.84rem;
  color: var(--text-muted);
  transition: color 0.2s;
}
.footer-col a:hover { color: var(--text-secondary); }

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-block: 18px;
}
.footer-bottom p {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}
.footer-bottom a {
  color: var(--accent-light);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  transition: opacity 0.2s;
}
.footer-bottom a:hover { opacity: 0.7; }

/* ── Scroll-driven entry animations ─────────────────────── */
@supports ((animation-timeline: view()) and (animation-range: entry)) {
  .reveal {
    opacity: 0;
    transform: translateY(28px);
    animation: reveal-entry linear forwards;
    animation-timeline: view();
    animation-range: entry 0% entry 35%;
  }
  .reveal.visible {
    /* let animation handle it */
  }
  @keyframes reveal-entry {
    to { opacity: 1; transform: translateY(0); }
  }
}

/* ── Responsive tweaks ───────────────────────────────────── */
@media (max-width: 768px) {
  :root {
    --section-py: clamp(52px, 14vw, 96px);
    --container-px: clamp(16px, 4.5vw, 28px);
  }

  .section-header { margin-bottom: clamp(28px, 8vw, 48px); }
  .section-subtitle { font-size: 0.94rem; }

  .principle-card,
  .who-card,
  .use-case-card,
  .build-category {
    padding: 22px 18px;
  }

  .who-card { padding: 28px 20px; }

  .flow-node {
    padding: 16px 18px;
    max-width: none;
  }
  .flow-node-icon {
    position: static;
    transform: none;
    align-self: flex-start;
    margin-top: 10px;
    opacity: 0.7;
  }

  .flow-callout {
    flex-direction: column;
    padding: 16px 18px;
    gap: 10px;
  }

  .ascii-arch {
    padding: 16px 18px;
  }
  .ascii-arch pre {
    font-size: 0.72rem;
    line-height: 1.55;
  }

  .auth-timeline::before { left: 19px; }
  .timeline-step {
    gap: 16px;
    padding-bottom: 28px;
  }
  .timeline-marker {
    width: 40px;
    height: 40px;
  }
  .timeline-content { padding-top: 4px; }

  .snippet-code {
    padding: 18px 16px;
    font-size: 0.76rem;
    line-height: 1.65;
  }

  .tools-table-wrap {
    overflow-x: visible;
    border: none;
    background: transparent;
  }
  .tools-table thead { display: none; }
  .tools-table tbody { display: flex; flex-direction: column; gap: 12px; }
  .tools-table tr {
    display: block;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
  }
  .tools-table td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.86rem;
  }
  .tools-table td:last-child { border-bottom: none; }
  .tools-table td::before {
    content: attr(data-label);
    flex-shrink: 0;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding-top: 2px;
  }
  .tools-table td:first-child {
    display: block;
    padding: 14px 16px 10px;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
  }
  .tools-table td:first-child::before { display: none; }
  .tools-table td:first-child code { font-size: 0.9rem; }
  .tools-table tr:hover td { background: inherit; }
  .tools-table td:first-child:hover { background: var(--bg-2); }

  .footer-links {
    grid-template-columns: 1fr 1fr;
    gap: 24px 16px;
  }
}

/* ── Mobile hero & compact UI ──────────────────────────── */
@media (max-width: 600px) {
  h1 { font-size: clamp(1.85rem, 9vw, 2.75rem); }
  h2 { font-size: clamp(1.45rem, 6vw, 2rem); }

  .hero-title {
    text-wrap: balance;
    margin-bottom: 16px;
  }

  .hero-ctas {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .btn-primary,
  .btn-secondary {
    justify-content: center;
    width: 100%;
  }
  .btn-ghost { align-self: center; }

  .trust-strip {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    text-align: center;
    justify-items: center;
  }
  .trust-sep { display: none; }
  .trust-item { white-space: normal; justify-content: center; }
}

@media (max-width: 400px) {
  h1 { letter-spacing: -0.01em; }
  .hero-eyebrow { gap: 6px; }
  .badge { font-size: 0.65rem; padding: 3px 8px; }
  .logo-badge { display: none; }
  .principles-grid { gap: 14px; }
  .uc-header { flex-direction: column; align-items: flex-start; }
}

/* Focus styles for accessibility */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
