/* Letterbot — Editorial Engineering, Warm Paper Premium
 * Single-file replacement of the previous "Miro" theme.
 * Class contract preserved across all pages, so no HTML changes are required.
 * Identity: warm paper canvas, hairlines instead of shadows, saffron-amber accent,
 * editorial italic serif moments, monospace labels, sharp small radii.
 */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&display=swap');

/* ============ Tokens ============ */
:root {
  /* Surface */
  --p-canvas: #FBFAF6;            /* warm paper */
  --p-surface: #F2F0E9;           /* cream */
  --p-surface-soft: #F7F5EF;
  --p-surface-2: #EAE6DC;
  --p-footer: #0E0E0C;            /* deep ink for footer */

  /* Ink */
  --p-ink: #0E0E0C;               /* warm near-black */
  --p-charcoal: #1F1E1A;
  --p-slate: #3D3B36;
  --p-muted: #5A5751;
  --p-dim: #8B8780;
  --p-faint: #B5B0A6;
  --p-on-dark: #F5F1E6;
  --p-on-dark-muted: #A8A399;

  /* Hairlines */
  --p-line: rgba(14, 14, 12, .09);
  --p-line-soft: rgba(14, 14, 12, .055);
  --p-line-strong: rgba(14, 14, 12, .18);
  --p-line-dark: rgba(245, 241, 230, .10);

  /* Accent (used sparingly) */
  --p-accent: #B45309;            /* warm saffron amber */
  --p-accent-soft: #FBEFD8;
  --p-accent-tint: rgba(180, 83, 9, .08);
  --p-accent-line: rgba(180, 83, 9, .28);
  --p-accent-deep: #78350F;
  --p-accent-bright: #D9A441;     /* for dark backgrounds */

  /* Signal (telegram mock + tables) */
  --p-sig-red: #B91C1C;
  --p-sig-red-bg: #FBEAEA;
  --p-sig-amber: #B45309;
  --p-sig-amber-bg: #FBEFD8;
  --p-sig-blue: #1D4ED8;
  --p-sig-blue-bg: #E6ECFB;
  --p-sig-green: #15803D;

  /* Radii — sharp, engineering */
  --p-r-xs: 3px;
  --p-r-sm: 5px;
  --p-r-md: 8px;
  --p-r-lg: 12px;
  --p-r-pill: 999px;

  /* Type */
  --p-font: 'Outfit', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --p-serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --p-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  color-scheme: light;
}

/* ============ Reset & Base ============ */
* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--p-canvas);
  color: var(--p-ink);
  font-family: var(--p-font);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body::before { display: none !important; } /* kill legacy noise overlay */

img { max-width: 100%; display: block; height: auto; }
ul, ol { list-style: none; margin: 0; padding: 0; }

a { color: var(--p-ink); text-decoration: none; }
a:hover { text-decoration: none; }

::selection { background: var(--p-ink); color: var(--p-canvas); }
::-moz-selection { background: var(--p-ink); color: var(--p-canvas); }

:focus-visible {
  outline: 2px solid var(--p-ink);
  outline-offset: 3px;
  border-radius: 3px;
}

code, kbd {
  font-family: var(--p-mono);
  font-size: .88em;
  background: var(--p-surface);
  border: 1px solid var(--p-line);
  border-radius: var(--p-r-xs);
  padding: 1px 6px;
  color: var(--p-charcoal);
  font-variant-ligatures: none;
}

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

/* ============ Layout ============ */
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 32px; }

.section { padding: 96px 0; }
.section-sm { padding: 64px 0; }
.section-compact { padding: 80px 0; }
.section-alt {
  background: var(--p-surface-soft);
  border-top: 1px solid var(--p-line);
  border-bottom: 1px solid var(--p-line);
}

h1, h2, h3 { scroll-margin-top: 88px; }

.section-kicker {
  font-family: var(--p-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--p-accent);
  margin: 0 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.section-kicker::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 1px;
  background: var(--p-accent);
}

.lead {
  font-size: 19px;
  line-height: 1.55;
  color: var(--p-slate);
  max-width: 760px;
  margin: 0 0 36px;
  text-wrap: pretty;
}

.cta-center { text-align: center; margin-top: 48px; }

/* Generic section headings */
.section h2,
.callout h2,
.donate-text h2 {
  font-family: var(--p-font);
  font-size: clamp(28px, 3.5vw, 44px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -.025em;
  margin: 0 0 16px;
  color: var(--p-ink);
  text-wrap: balance;
  max-width: 880px;
}

/* ============ Top Nav ============ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 250, 246, .82);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--p-line);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 0;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: 28px;
  white-space: nowrap;
  color: var(--p-ink);
  text-decoration: none;
}
.brand-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--p-ink);
  border-radius: var(--p-r-xs);
  background: var(--p-canvas);
  color: var(--p-ink);
  font-size: 14px;
  flex-shrink: 0;
}
.brand > span {
  font-family: var(--p-font);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -.01em;
  color: var(--p-ink);
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand-sub {
  display: block;
  font-family: var(--p-mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .04em;
  color: var(--p-dim);
  margin-top: 3px;
  text-transform: lowercase;
}
.nav-links {
  display: flex;
  gap: 2px;
  flex: 1;
  flex-wrap: wrap;
}
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--p-muted);
  padding: 8px 12px;
  border-radius: var(--p-r-sm);
  transition: color .15s, background-color .15s;
  text-decoration: none;
}
.nav-links a:hover {
  color: var(--p-ink);
  background: var(--p-surface);
}
.nav-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
  align-items: center;
}
.burger {
  display: none;
  background: transparent;
  border: 1px solid var(--p-line-strong);
  border-radius: var(--p-r-sm);
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  color: var(--p-ink);
  font-size: 18px;
  cursor: pointer;
  touch-action: manipulation;
}
.burger:hover { background: var(--p-surface); }

/* ============ Buttons ============ */
.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--p-font);
  font-weight: 500;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: var(--p-r-sm);
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn-primary {
  background: var(--p-ink);
  color: var(--p-canvas);
  border-color: var(--p-ink);
}
.btn-primary:hover {
  background: var(--p-charcoal);
  border-color: var(--p-charcoal);
  text-decoration: none;
}
.btn-primary:active { background: #000; }

.btn-ghost {
  background: transparent;
  color: var(--p-ink);
  border-color: var(--p-line-strong);
}
.btn-ghost:hover {
  background: var(--p-surface);
  border-color: var(--p-ink);
  text-decoration: none;
}
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 13px 26px; font-size: 15px; }

/* ============ Hero ============ */
.hero {
  padding: 96px 0 80px;
  background: var(--p-canvas);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--p-line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--p-line-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: center top;
  mask-image: radial-gradient(ellipse at 70% 30%, rgba(0, 0, 0, .9), rgba(0, 0, 0, 0) 70%);
  -webkit-mask-image: radial-gradient(ellipse at 70% 30%, rgba(0, 0, 0, .9), rgba(0, 0, 0, 0) 70%);
  opacity: .9;
  pointer-events: none;
}
.hero > * { position: relative; }
.hero-inner,
.hero-proof {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 64px;
  align-items: start;
}
.hero-kicker {
  font-family: var(--p-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--p-accent);
  margin: 0 0 28px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border: 1px solid var(--p-accent-line);
  background: var(--p-accent-tint);
  border-radius: var(--p-r-pill);
}
.hero-kicker::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--p-accent);
  flex-shrink: 0;
}
.hero h1 {
  font-family: var(--p-font);
  font-size: clamp(38px, 5.5vw, 68px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -.025em;
  margin: 0 0 24px;
  color: var(--p-ink);
  text-wrap: balance;
}
.hero h1 em {
  font-family: var(--p-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--p-accent-deep);
  letter-spacing: -.005em;
  font-size: 1.04em;
}
.hero h1 strong {
  background: var(--p-accent-soft);
  color: var(--p-accent-deep);
  font-weight: 500;
  padding: 0 6px;
  border-radius: 3px;
}
.hero-sub {
  font-size: 18px;
  line-height: 1.55;
  color: var(--p-slate);
  margin: 0 0 14px;
  max-width: 560px;
  text-wrap: pretty;
}
.hero-sub strong { color: var(--p-ink); font-weight: 600; }
.hero-btns {
  display: flex;
  gap: 12px;
  margin: 32px 0 24px;
  flex-wrap: wrap;
}
.hero-note {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 24px 0 8px;
}
.hero-note span {
  font-family: var(--p-mono);
  font-size: 11px;
  letter-spacing: .04em;
  padding: 5px 10px;
  border-radius: var(--p-r-xs);
  background: var(--p-canvas);
  border: 1px solid var(--p-line);
  color: var(--p-muted);
  text-transform: lowercase;
}

.install-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 32px;
  border: 1px solid var(--p-line);
  border-radius: var(--p-r-md);
  background: var(--p-canvas);
  overflow: hidden;
}
.install-pill {
  padding: 20px 22px;
  border-right: 1px solid var(--p-line);
  position: relative;
}
.install-pill:last-child { border-right: none; }
.install-pill strong {
  display: block;
  font-family: var(--p-font);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.01em;
  margin-bottom: 6px;
  color: var(--p-ink);
}
.install-pill small {
  display: block;
  color: var(--p-muted);
  font-size: 13px;
  line-height: 1.5;
}

.meta-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 28px;
}
.meta-links a {
  font-size: 13px;
  color: var(--p-muted);
  font-weight: 500;
  border-bottom: 1px solid var(--p-line-strong);
  padding-bottom: 2px;
  transition: color .15s, border-color .15s;
}
.meta-links a:hover {
  color: var(--p-ink);
  border-bottom-color: var(--p-ink);
  text-decoration: none;
}

/* ============ Phone mockup ============ */
.hero-demo {
  display: flex;
  justify-content: center;
  align-items: start;
}
.phone-mock {
  background: var(--p-canvas);
  border: 1px solid var(--p-line-strong);
  border-radius: 16px;
  padding: 18px;
  max-width: 380px;
  width: 100%;
  position: relative;
}
.phone-mock::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, .55), transparent 30%);
  pointer-events: none;
}
.phone-mock > * { position: relative; }
.phone-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--p-font);
  font-weight: 600;
  font-size: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--p-line);
  margin-bottom: 12px;
  color: var(--p-ink);
}
.phone-icon {
  width: 22px;
  height: 22px;
  border-radius: var(--p-r-xs);
  background: var(--p-ink);
  display: grid;
  place-items: center;
  font-size: 11px;
  color: var(--p-canvas);
  flex-shrink: 0;
}
.phone-status {
  font-family: var(--p-mono);
  font-size: 10px;
  color: var(--p-sig-green);
  margin-left: auto;
  font-weight: 500;
  letter-spacing: .04em;
}
.msg {
  background: var(--p-surface-soft);
  border: 1px solid var(--p-line);
  border-radius: var(--p-r-md);
  padding: 12px 14px;
  margin-bottom: 8px;
  position: relative;
  border-left-width: 3px;
}
.msg-urgent {
  border-color: rgba(185, 28, 28, .20);
  border-left-color: var(--p-sig-red);
  background: var(--p-sig-red-bg);
}
.msg-important {
  border-color: rgba(180, 83, 9, .22);
  border-left-color: var(--p-sig-amber);
  background: var(--p-sig-amber-bg);
}
.msg-digest {
  border-color: rgba(29, 78, 216, .18);
  border-left-color: var(--p-sig-blue);
  background: var(--p-sig-blue-bg);
}
.msg-badge {
  font-family: var(--p-mono);
  font-size: 10px;
  letter-spacing: .04em;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--p-charcoal);
  text-transform: lowercase;
}
.msg p {
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 2px;
  color: var(--p-ink);
}
.msg-action { color: var(--p-charcoal); font-weight: 500; }
.msg-action strong { color: var(--p-ink); }
.msg-file {
  font-family: var(--p-mono);
  font-size: 11px;
  color: var(--p-muted);
  margin-top: 4px;
}
.msg-btns {
  display: flex;
  gap: 5px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.btn-tag {
  font-size: 11px;
  font-weight: 500;
  padding: 4px 9px;
  border-radius: var(--p-r-pill);
  background: var(--p-canvas);
  border: 1px solid var(--p-line-strong);
  color: var(--p-muted);
}
.btn-tag.red {
  border-color: rgba(185, 28, 28, .30);
  color: var(--p-sig-red);
}
.btn-tag.yellow {
  border-color: rgba(180, 83, 9, .30);
  color: var(--p-sig-amber);
}
.msg-time {
  position: absolute;
  right: 14px;
  top: 14px;
  font-family: var(--p-mono);
  font-size: 10px;
  color: var(--p-dim);
}

/* ============ Stats Bar ============ */
.stats-bar {
  background: var(--p-canvas);
  border-top: 1px solid var(--p-line);
  border-bottom: 1px solid var(--p-line);
  padding: 44px 0;
}
.stats-inner {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
}
.stat {
  text-align: center;
  padding: 0 16px;
  border-right: 1px solid var(--p-line);
}
.stat:last-child { border-right: none; }
.stat-val {
  display: block;
  font-family: var(--p-font);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.02em;
  color: var(--p-ink);
  font-variant-numeric: tabular-nums;
}
.stat-label {
  display: block;
  font-family: var(--p-mono);
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--p-dim);
  margin-top: 8px;
  text-transform: uppercase;
}

/* ============ Definition ============ */
.section-definition .definition-lead {
  font-size: 20px;
  line-height: 1.55;
  color: var(--p-slate);
  max-width: 880px;
  margin: 0 0 40px;
}
.definition-lead dfn {
  font-style: normal;
  font-family: var(--p-serif);
  font-weight: 500;
  font-size: 1.06em;
  color: var(--p-ink);
  border-bottom: 1px solid var(--p-accent);
  padding-bottom: 1px;
}
.definition-facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 40px;
}
.fact-item {
  padding: 24px 26px;
  background: var(--p-canvas);
  border: 1px solid var(--p-line);
  border-left: 3px solid var(--p-accent);
  border-radius: var(--p-r-sm);
}
.fact-item strong {
  display: block;
  font-family: var(--p-font);
  font-size: 14px;
  font-weight: 600;
  color: var(--p-ink);
  margin-bottom: 8px;
  letter-spacing: -.01em;
}
.fact-item p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--p-muted);
  margin: 0;
}

/* ============ Proof grid (cockpit screenshots) ============ */
.proof-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
  margin-top: 40px;
}
.screenshot-card {
  background: var(--p-canvas);
  border: 1px solid var(--p-line);
  border-radius: var(--p-r-md);
  overflow: hidden;
  transition: border-color .2s;
}
.screenshot-card:hover { border-color: var(--p-line-strong); }
.screenshot-card img {
  width: 100%;
  height: auto;
  border-bottom: 1px solid var(--p-line);
}
.screenshot-copy { padding: 22px 24px; }
.screenshot-copy h3 {
  font-family: var(--p-font);
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--p-ink);
}
.screenshot-copy p {
  font-size: 14px;
  color: var(--p-muted);
  line-height: 1.6;
  margin: 0;
}

/* ============ Fit grid (good vs not best fit) ============ */
.fit-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 40px;
}
.fit-card {
  background: var(--p-canvas);
  border: 1px solid var(--p-line);
  border-radius: var(--p-r-md);
  padding: 32px;
}
.fit-card h3 {
  font-family: var(--p-font);
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 18px;
  color: var(--p-ink);
  display: flex;
  align-items: center;
  gap: 10px;
}
.fit-card h3::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--p-sig-green);
  flex-shrink: 0;
}
.fit-card.bad h3::before { background: var(--p-sig-red); }
.fit-card ul { margin: 12px 0 0; padding: 0; }
.fit-card li {
  position: relative;
  padding-left: 24px;
  color: var(--p-slate);
  font-size: 15px;
  line-height: 1.55;
  margin-bottom: 12px;
  list-style: none;
}
.fit-card li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 11px;
  width: 12px;
  height: 1px;
  background: var(--p-line-strong);
}
.fit-card li strong { color: var(--p-ink); font-weight: 600; }
.link-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px; }

/* ============ Callout (deterministic first) ============ */
.callout {
  background: var(--p-surface);
  border: 1px solid var(--p-line);
  border-left: 4px solid var(--p-accent);
  border-radius: var(--p-r-md);
  padding: 40px 44px;
}
.callout .section-kicker { margin-bottom: 12px; }
.callout p {
  font-size: 16px;
  line-height: 1.65;
  color: var(--p-slate);
  max-width: 720px;
  margin: 0 0 16px;
}
.list-check {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 28px;
  margin-top: 20px;
  padding: 0;
}
.list-check li {
  position: relative;
  padding-left: 28px;
  color: var(--p-slate);
  font-size: 15px;
  line-height: 1.55;
  list-style: none;
}
.list-check li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 14px;
  height: 7px;
  border-left: 1.5px solid var(--p-accent);
  border-bottom: 1.5px solid var(--p-accent);
  transform: rotate(-45deg);
}

/* ============ Cards: small grid (home — core capabilities) ============ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 40px;
  border: 1px solid var(--p-line);
  border-radius: var(--p-r-md);
  background: var(--p-canvas);
  overflow: hidden;
}
.card-sm {
  padding: 28px;
  background: var(--p-canvas);
  border-right: 1px solid var(--p-line);
  border-bottom: 1px solid var(--p-line);
  transition: background-color .15s;
}
.card-sm:nth-child(3n) { border-right: none; }
.card-sm:nth-last-child(-n+3) { border-bottom: none; }
.card-sm:hover { background: var(--p-surface-soft); }
.card-sm span {
  font-size: 22px;
  display: block;
  margin-bottom: 14px;
  line-height: 1;
  filter: saturate(.85);
}
.card-sm h4 {
  font-family: var(--p-font);
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--p-ink);
}
.card-sm p {
  font-size: 14px;
  color: var(--p-muted);
  line-height: 1.6;
  margin: 0;
}

/* ============ Cards: 3-up (some pages) ============ */
.cards-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
}
.card {
  background: var(--p-canvas);
  border: 1px solid var(--p-line);
  border-radius: var(--p-r-md);
  padding: 32px;
  transition: border-color .2s, background-color .2s;
}
.card:hover {
  border-color: var(--p-line-strong);
  background: var(--p-surface-soft);
}
.card-icon { font-size: 24px; display: block; margin-bottom: 12px; }
.card h3 {
  font-family: var(--p-font);
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 10px;
  color: var(--p-ink);
}
.card p {
  font-size: 15px;
  color: var(--p-muted);
  line-height: 1.6;
  margin: 0;
}

/* ============ Steps ============ */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 40px;
  border-top: 1px solid var(--p-line);
  border-bottom: 1px solid var(--p-line);
}
.step {
  padding: 36px 28px;
  border-right: 1px solid var(--p-line);
  text-align: left;
  position: relative;
}
.step:last-child { border-right: none; }
.step-num {
  display: inline-flex;
  width: 32px;
  height: 32px;
  border: 1px solid var(--p-ink);
  border-radius: 50%;
  font-family: var(--p-mono);
  font-weight: 500;
  font-size: 13px;
  color: var(--p-ink);
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  background: var(--p-canvas);
}
.step h3 {
  font-family: var(--p-font);
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--p-ink);
}
.step p {
  font-size: 14px;
  color: var(--p-muted);
  line-height: 1.6;
  margin: 0;
}

/* ============ Routing diagram ============ */
.routing-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  margin-top: 40px;
  flex-wrap: wrap;
}
.route-col { min-width: 200px; }
.route-col h4 {
  font-family: var(--p-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  color: var(--p-dim);
  margin: 0 0 12px;
  text-transform: uppercase;
}
.route-item {
  background: var(--p-canvas);
  border: 1px solid var(--p-line);
  border-radius: var(--p-r-sm);
  padding: 10px 14px;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--p-ink);
  font-family: var(--p-mono);
}
.route-more {
  color: var(--p-dim);
  font-style: italic;
  border-style: dashed;
}
.route-arrow {
  text-align: center;
  font-family: var(--p-mono);
  font-size: 18px;
  color: var(--p-accent);
  line-height: 1.8;
}
.route-arrow span {
  display: block;
  font-size: 11px;
  color: var(--p-dim);
  letter-spacing: .04em;
}

/* ============ FAQ ============ */
.faq-list {
  max-width: 920px;
  margin-top: 40px;
  border-top: 1px solid var(--p-line-strong);
}
.faq-item {
  border-bottom: 1px solid var(--p-line);
  background: transparent;
}
.faq-item summary {
  font-family: var(--p-font);
  font-weight: 500;
  font-size: 17px;
  padding: 22px 4px 22px 36px;
  cursor: pointer;
  list-style: none;
  color: var(--p-ink);
  position: relative;
  text-wrap: pretty;
  line-height: 1.45;
  transition: color .15s;
  touch-action: manipulation;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before {
  content: '+';
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--p-mono);
  font-size: 18px;
  font-weight: 400;
  color: var(--p-accent);
  width: 20px;
  text-align: left;
}
.faq-item[open] summary::before { content: '−'; }
.faq-item summary:hover { color: var(--p-accent-deep); }
.faq-item p {
  padding: 0 4px 26px 36px;
  font-size: 15px;
  color: var(--p-slate);
  line-height: 1.65;
  margin: 0;
  max-width: 760px;
}

/* ============ Donate strip ============ */
.donate-strip {
  background: var(--p-surface);
  border-top: 1px solid var(--p-line);
  border-bottom: 1px solid var(--p-line);
}
.donate-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: center;
}
.donate-lead {
  font-family: var(--p-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--p-accent);
  margin: 0 0 14px;
}
.donate-text h2 { margin: 0 0 16px; }
.donate-text p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--p-slate);
  margin: 0 0 22px;
  max-width: 600px;
}
.donate-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.donate-qr {
  padding: 16px;
  background: var(--p-canvas);
  border: 1px solid var(--p-line);
  border-radius: var(--p-r-sm);
}

/* ============ Proof links (open source) ============ */
.proof-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 32px;
  border: 1px solid var(--p-line);
  border-radius: var(--p-r-md);
  overflow: hidden;
  background: var(--p-canvas);
}
.proof-link {
  display: block;
  padding: 28px;
  border-right: 1px solid var(--p-line);
  background: var(--p-canvas);
  transition: background-color .15s;
  position: relative;
  text-decoration: none;
}
.proof-link:last-child { border-right: none; }
.proof-link:hover { background: var(--p-surface-soft); text-decoration: none; }
.proof-link::after {
  content: '↗';
  position: absolute;
  top: 24px;
  right: 24px;
  font-family: var(--p-mono);
  font-size: 16px;
  color: var(--p-dim);
  transition: color .15s, transform .15s;
}
.proof-link:hover::after {
  color: var(--p-accent);
  transform: translate(2px, -2px);
}
.proof-link strong {
  display: block;
  font-family: var(--p-font);
  font-weight: 600;
  font-size: 17px;
  color: var(--p-ink);
  margin-bottom: 6px;
}
.proof-link span {
  display: block;
  font-size: 14px;
  color: var(--p-muted);
  line-height: 1.55;
}

/* ============ Footer ============ */
.footer {
  background: var(--p-footer);
  color: var(--p-on-dark);
  padding: 72px 0 32px;
  border-top: 1px solid var(--p-line-strong);
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 48px;
}
.footer-brand p {
  font-size: 14px;
  color: var(--p-on-dark-muted);
  margin: 16px 0;
  line-height: 1.55;
  max-width: 320px;
}
.footer-social { display: flex; gap: 18px; }
.footer-social a {
  font-size: 13px;
  color: var(--p-on-dark-muted);
  border-bottom: 1px solid transparent;
  transition: color .15s, border-color .15s;
  text-decoration: none;
}
.footer-social a:hover {
  color: var(--p-on-dark);
  border-bottom-color: var(--p-accent-bright);
  text-decoration: none;
}
.footer-col h4 {
  font-family: var(--p-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  color: var(--p-accent-bright);
  margin: 0 0 18px;
  text-transform: uppercase;
}
.footer-col a {
  display: block;
  font-size: 14px;
  color: var(--p-on-dark-muted);
  margin-bottom: 10px;
  text-decoration: none;
  transition: color .15s;
}
.footer-col a:hover { color: var(--p-on-dark); text-decoration: none; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid rgba(245, 241, 230, .10);
  font-size: 13px;
  color: var(--p-on-dark-muted);
}
.footer-bottom a {
  color: var(--p-on-dark-muted);
  border-bottom: 1px solid rgba(245, 241, 230, .20);
}
.footer-bottom a:hover { color: var(--p-on-dark); }
.footer-meta {
  font-family: var(--p-mono);
  font-size: 12px;
  letter-spacing: .04em;
}
.footer .brand { color: var(--p-on-dark); }
.footer .brand > span { color: var(--p-on-dark); }
.footer .brand-icon {
  background: transparent;
  border-color: var(--p-on-dark);
  color: var(--p-on-dark);
}
.footer .brand-sub { color: var(--p-on-dark-muted); }

/* ============ Page hero (inner pages) ============ */
.page-hero {
  padding: 80px 0 56px;
  border-bottom: 1px solid var(--p-line);
  background: var(--p-canvas);
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--p-line-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, .45), transparent);
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, .45), transparent);
  pointer-events: none;
  opacity: .7;
}
.page-hero > * { position: relative; }
.page-hero h1 {
  font-family: var(--p-font);
  font-size: clamp(36px, 5vw, 54px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -.025em;
  margin: 0 0 16px;
  color: var(--p-ink);
  text-wrap: balance;
}
.page-hero p {
  font-size: 19px;
  color: var(--p-slate);
  max-width: 720px;
  line-height: 1.55;
  margin: 0;
  text-wrap: pretty;
}

/* ============ Page content ============ */
.page-content { padding: 64px 0 96px; }
.page-content > .wrap > p:first-of-type {
  font-size: 18px;
  line-height: 1.65;
  color: var(--p-slate);
  max-width: 760px;
  margin: 0 0 24px;
}
.page-content h2 {
  font-family: var(--p-font);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -.02em;
  margin: 56px 0 16px;
  padding-top: 32px;
  border-top: 1px solid var(--p-line);
  color: var(--p-ink);
  text-wrap: balance;
}
.page-content > .wrap > h2:first-of-type,
.page-content > .wrap > h2:first-child {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}
.page-content h3 {
  font-family: var(--p-font);
  font-size: 19px;
  font-weight: 600;
  margin: 32px 0 12px;
  color: var(--p-ink);
}
.page-content p {
  font-size: 16px;
  color: var(--p-slate);
  line-height: 1.7;
  margin: 0 0 14px;
  max-width: 760px;
}
.page-content ul {
  margin: 16px 0 24px;
  padding: 0;
}
.page-content li {
  position: relative;
  padding-left: 24px;
  font-size: 15px;
  color: var(--p-slate);
  line-height: 1.7;
  margin-bottom: 8px;
  list-style: none;
}
.page-content li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  width: 12px;
  height: 1px;
  background: var(--p-accent);
}
.page-content li strong { color: var(--p-ink); font-weight: 600; }

/* Tables */
.page-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
  background: var(--p-canvas);
  border: 1px solid var(--p-line);
  border-radius: var(--p-r-md);
  overflow: hidden;
  font-size: 14px;
}
.page-content th,
.page-content td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--p-line);
  font-variant-numeric: tabular-nums;
}
.page-content tr:last-child td { border-bottom: none; }
.page-content th {
  font-family: var(--p-mono);
  font-weight: 500;
  font-size: 11px;
  color: var(--p-dim);
  text-transform: uppercase;
  letter-spacing: .08em;
  background: var(--p-surface-soft);
  border-bottom: 1px solid var(--p-line-strong);
}
.page-content td { color: var(--p-slate); }
.page-content td strong { color: var(--p-ink); font-weight: 600; }
.page-content tbody tr:nth-child(even) td { background: var(--p-surface-soft); }

.check { color: var(--p-sig-green); font-weight: 500; }
.cross { color: var(--p-sig-red); font-weight: 500; }

/* Pre / code blocks */
pre {
  background: var(--p-surface);
  border: 1px solid var(--p-line);
  border-radius: var(--p-r-md);
  padding: 20px 24px;
  overflow-x: auto;
  margin: 24px 0;
  font-size: 13px;
  line-height: 1.7;
  -webkit-overflow-scrolling: touch;
}
pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--p-ink);
  font-size: 13px;
}

/* ============ KPI row (observability) ============ */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-top: 32px;
  border: 1px solid var(--p-line);
  border-radius: var(--p-r-md);
  background: var(--p-canvas);
  overflow: hidden;
}
.kpi {
  padding: 26px 24px;
  border-right: 1px solid var(--p-line);
}
.kpi:last-child { border-right: none; }
.kpi b {
  display: block;
  font-family: var(--p-font);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--p-ink);
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}
.kpi span {
  font-size: 13px;
  color: var(--p-muted);
  line-height: 1.5;
}

/* ============ Note box ============ */
.note-box {
  border-left: 3px solid var(--p-accent);
  background: var(--p-accent-tint);
  padding: 18px 22px;
  border-radius: 0 var(--p-r-sm) var(--p-r-sm) 0;
  margin: 24px 0;
  color: var(--p-charcoal);
  font-size: 15px;
  line-height: 1.6;
  max-width: 820px;
}

/* ============ Page gallery (observability) ============ */
.page-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin: 32px 0;
}
.page-gallery figure {
  background: var(--p-canvas);
  border: 1px solid var(--p-line);
  border-radius: var(--p-r-md);
  overflow: hidden;
  margin: 0;
}
.page-gallery img {
  width: 100%;
  height: auto;
  border-bottom: 1px solid var(--p-line);
}
.page-gallery figcaption {
  padding: 18px 22px;
  color: var(--p-muted);
  font-size: 14px;
  line-height: 1.6;
}
.page-gallery figcaption strong { color: var(--p-ink); font-weight: 600; }

/* ============ Support ============ */
.support-hero {
  text-align: center;
  padding: 80px 0 56px;
  background: var(--p-canvas);
  border-bottom: 1px solid var(--p-line);
}
.support-hero h1 {
  font-family: var(--p-font);
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 500;
  margin: 0 0 16px;
  color: var(--p-ink);
  letter-spacing: -.025em;
  text-wrap: balance;
}
.support-methods {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin: 40px 0;
}
.support-card {
  background: var(--p-canvas);
  border: 1px solid var(--p-line);
  border-radius: var(--p-r-md);
  padding: 36px;
  text-align: center;
  transition: border-color .2s, background-color .2s;
}
.support-card:hover {
  border-color: var(--p-line-strong);
  background: var(--p-surface-soft);
}
.support-card h3 {
  font-family: var(--p-font);
  font-size: 22px;
  margin: 16px 0 10px;
  font-weight: 600;
  color: var(--p-ink);
}
.support-card p {
  font-size: 14px;
  color: var(--p-muted);
  margin: 0 0 20px;
  line-height: 1.55;
}

/* ============ Intro block ============ */
.intro-block { max-width: 760px; margin-bottom: 40px; }
.intro-block h2 {
  font-family: var(--p-font);
  font-size: 30px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -.02em;
  margin: 0 0 16px;
  color: var(--p-ink);
}
.intro-block p {
  font-size: 16px;
  color: var(--p-slate);
  line-height: 1.7;
  margin: 0 0 12px;
}

/* ============ Inline content links ============ */
.page-content a:not(.btn-primary):not(.btn-ghost),
.definition-lead a,
.fact-item a,
.faq-item p a,
.note-box a,
.lead a,
.donate-text p a,
.screenshot-copy p a,
.intro-block a {
  color: var(--p-ink);
  border-bottom: 1px solid var(--p-accent);
  padding-bottom: 1px;
  transition: color .15s, border-color .15s;
}
.page-content a:not(.btn-primary):not(.btn-ghost):hover,
.definition-lead a:hover,
.fact-item a:hover,
.faq-item p a:hover,
.note-box a:hover,
.lead a:hover,
.donate-text p a:hover,
.intro-block a:hover {
  color: var(--p-accent-deep);
  border-bottom-color: var(--p-accent-deep);
  text-decoration: none;
}

/* ============ Theme toggle (kept dormant) ============ */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--p-surface);
  color: var(--p-ink);
  font-family: var(--p-font);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border: 1px solid var(--p-line-strong);
  border-radius: var(--p-r-pill);
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.theme-toggle:hover {
  background: var(--p-accent-tint);
  border-color: var(--p-accent);
}
.theme-toggle::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--p-accent);
  flex-shrink: 0;
}

/* ============ Responsive ============ */
@media (max-width: 1024px) {
  .hero-inner,
  .hero-proof {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .stats-inner { grid-template-columns: repeat(3, 1fr); }
  .stat:nth-child(3n) { border-right: none; }
  .stat:nth-child(n+4) {
    border-top: 1px solid var(--p-line);
    padding-top: 24px;
    margin-top: 12px;
  }
}
@media (max-width: 900px) {
  .definition-facts,
  .proof-grid,
  .fit-grid,
  .page-gallery,
  .support-methods { grid-template-columns: 1fr; }

  .cards-grid { grid-template-columns: 1fr; }
  .card-sm { border-right: none; }
  .card-sm:nth-last-child(-n+3) { border-bottom: 1px solid var(--p-line); }
  .card-sm:last-child { border-bottom: none; }

  .cards-3 { grid-template-columns: 1fr; }
  .install-strip { grid-template-columns: 1fr; }
  .install-pill { border-right: none; border-bottom: 1px solid var(--p-line); }
  .install-pill:last-child { border-bottom: none; }

  .proof-links { grid-template-columns: 1fr; }
  .proof-link { border-right: none; border-bottom: 1px solid var(--p-line); }
  .proof-link:last-child { border-bottom: none; }

  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .kpi:nth-child(2) { border-right: none; }
  .kpi:nth-child(1),
  .kpi:nth-child(2) { border-bottom: 1px solid var(--p-line); }

  .list-check { grid-template-columns: 1fr; }
  .donate-inner { grid-template-columns: 1fr; gap: 32px; }
  .donate-qr { justify-self: start; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 36px; }
  .steps { grid-template-columns: 1fr; }
  .step { border-right: none; border-bottom: 1px solid var(--p-line); }
  .step:last-child { border-bottom: none; }
  .callout { padding: 28px; }
}
@media (max-width: 720px) {
  .wrap { padding: 0 20px; }

  .nav-links,
  .nav-actions { display: none; }
  .burger { display: inline-flex; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--p-canvas);
    border-bottom: 1px solid var(--p-line);
    padding: 16px 20px;
    gap: 4px;
    overscroll-behavior: contain;
  }
  .nav-actions.open {
    display: flex;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--p-canvas);
    padding: 0 20px 16px;
    flex-direction: row;
  }

  .stats-inner { grid-template-columns: repeat(2, 1fr); gap: 24px; padding: 0; }
  .stat { border-right: none; padding: 8px 0; }
  .stat:nth-child(odd) { border-right: 1px solid var(--p-line); }
  .stat:nth-child(n+4) { border-top: none; padding-top: 8px; margin-top: 0; }
  .stat-val { font-size: 24px; }

  .footer-inner { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }

  .hero { padding: 56px 0; }
  .hero h1 { font-size: 38px; letter-spacing: -.02em; }

  .page-hero { padding: 56px 0 36px; }
  .page-hero h1 { font-size: 32px; }

  .section { padding: 64px 0; }
  .callout { padding: 24px; }
  .callout h2, .donate-text h2 { font-size: 26px; }

  .page-content { padding: 48px 0 72px; }
  .page-content h2 { font-size: 24px; margin-top: 44px; padding-top: 24px; }

  .meta-links { gap: 16px; }
  .hero-btns { gap: 10px; }
  .btn-lg { padding: 12px 22px; font-size: 14px; }

  .definition-lead { font-size: 18px; }
  .lead { font-size: 17px; }
}

/* ============ Print ============ */
@media print {
  body { background: white; color: black; }
  .nav, .footer, .burger, .donate-strip { display: none !important; }
  pre { white-space: pre-wrap; word-wrap: break-word; }
  a { color: black; text-decoration: underline; }
}
