:root {
  --bg:       #0d0f14;
  --surface:  #151820;
  --border:   #252935;
  --accent:   #6c63ff;
  --accent2:  #a78bfa;
  --warn:     #f59e0b;
  --text:     #e2e8f0;
  --muted:    #94a3b8;
  --code-bg:  #1e2230;
  --green:    #34d399;
  --red:      #f87171;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

/* ── Nav ── */
nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem; height: 56px;
  background: rgba(13,15,20,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-logo { font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; gap: 1.5rem; list-style: none; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 0.9rem; transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--accent2); }
.nav-gh {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.35rem 1rem; border-radius: 6px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); text-decoration: none; font-size: 0.85rem;
  transition: border-color .2s;
}
.nav-gh:hover { border-color: var(--accent); }

/* ── Hero ── */
.hero {
  max-width: 860px; margin: 0 auto;
  padding: 7rem 2rem 5rem;
  text-align: center;
}
.badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.25rem 0.75rem; border-radius: 999px;
  background: rgba(108,99,255,0.12); border: 1px solid rgba(108,99,255,0.3);
  color: var(--accent2); font-size: 0.8rem; font-weight: 500;
  margin-bottom: 1.5rem;
}
h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 800; letter-spacing: -0.03em; line-height: 1.1;
  margin-bottom: 1.25rem;
}
h1 em { font-style: normal; color: var(--accent); }
.hero-sub {
  font-size: 1.15rem; color: var(--muted); max-width: 560px; margin: 0 auto 2.5rem;
}
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.btn {
  padding: 0.65rem 1.6rem; border-radius: 8px; font-size: 0.95rem; font-weight: 600;
  text-decoration: none; transition: opacity .2s, transform .15s;
}
.btn:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }

/* ── Flow diagram ── */
.flow {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 0; margin: 4rem auto 0; max-width: 700px;
}
.flow-item {
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 1rem 1.4rem; min-width: 130px;
  text-align: center;
}
.flow-icon { font-size: 1.6rem; }
.flow-label { font-size: 0.78rem; color: var(--muted); font-weight: 500; }
.flow-arrow { font-size: 1.2rem; color: var(--border); padding: 0 0.3rem; }

/* ── Warning banner preview ── */
.banner-preview {
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--warn); border-radius: 6px;
  padding: 0.5rem 1rem; margin: 3rem auto 0; max-width: 640px;
  color: #1c1000; font-size: 0.87rem; font-weight: 500;
}

/* ── Sections ── */
section { padding: 5rem 2rem; }
.container { max-width: 900px; margin: 0 auto; }
h2 {
  font-size: 1.9rem; font-weight: 700; letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}
.section-sub { color: var(--muted); margin-bottom: 2.5rem; font-size: 1rem; }

/* ── Page header (for sub-pages) ── */
.page-header {
  max-width: 860px; margin: 0 auto;
  padding: 5rem 2rem 3rem;
}
.page-header h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }

/* ── Problem / Solution cards ── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 640px) { .two-col { grid-template-columns: 1fr; } }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.5rem;
}
.card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.6rem; }
.card p { color: var(--muted); font-size: 0.9rem; }
.card.bad  { border-color: rgba(248,113,113,0.25); }
.card.good { border-color: rgba(52,211,153,0.25); }
.card.bad h3  { color: var(--red); }
.card.good h3 { color: var(--green); }

/* ── Features grid ── */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 1.5rem; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; }
.feature-icon { font-size: 1.8rem; margin-bottom: 0.8rem; }
.feature h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.4rem; }
.feature p { color: var(--muted); font-size: 0.85rem; }

/* ── Code block ── */
pre {
  background: var(--code-bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 1.25rem 1.5rem;
  overflow-x: auto; font-size: 0.83rem; line-height: 1.6;
  color: #c9d1d9;
}
code { font-family: 'Fira Code', 'Cascadia Code', monospace; }
.hlg { color: #a3f7bf; }   /* green */
.hlp { color: #c9a7eb; }   /* purple */
.hly { color: #ffd580; }   /* yellow */
.hlb { color: #82aaff; }   /* blue */
.hlm { color: var(--muted); }  /* muted */

/* ── Session diagram ── */
.session-diagram {
  border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; margin-top: 2rem;
}
.sd-row {
  display: flex; align-items: stretch;
  border-bottom: 1px solid var(--border);
}
.sd-row:last-child { border-bottom: none; }
.sd-label {
  width: 110px; flex-shrink: 0;
  padding: 0.8rem 1rem; font-size: 0.75rem; font-weight: 600;
  color: var(--muted); background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; align-items: center;
}
.sd-content {
  flex: 1; padding: 0.8rem 1.2rem; font-size: 0.83rem; color: var(--text);
  display: flex; align-items: center; gap: 0.5rem;
}
.pill {
  display: inline-block; padding: 0.15rem 0.55rem; border-radius: 4px;
  font-size: 0.73rem; font-weight: 600; white-space: nowrap;
}
.pill-blue { background: rgba(130,170,255,0.12); color: #82aaff; }
.pill-green { background: rgba(52,211,153,0.12); color: var(--green); }
.pill-purple { background: rgba(108,99,255,0.12); color: var(--accent2); }

/* ── Info cards (two-up grid for SSE/WS) ── */
.info-grid-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem;
}
@media (max-width: 640px) { .info-grid-2 { grid-template-columns: 1fr; } }
.info-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 1.25rem;
}
.info-card-title { color: var(--accent2); font-weight: 600; margin-bottom: 0.5rem; }
.info-card p { font-size: 0.85rem; color: var(--muted); margin-top: 0.5rem; }

/* ── Screenshots ── */
.screenshots-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 2rem;
}
@media (max-width: 720px) { .screenshots-grid { grid-template-columns: 1fr; } }
.screenshot-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.35);
}
.screenshot-card img { width: 100%; display: block; border-bottom: 1px solid var(--border); }
.screenshot-caption { padding: 0.7rem 1rem; font-size: 0.82rem; color: var(--muted); }
.screenshot-caption strong { color: var(--text); }

/* ── Security section ── */
.risk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 1rem; margin-top: 1.5rem; }
.risk-card {
  background: var(--surface); border: 1px solid rgba(248,113,113,0.2);
  border-radius: 10px; padding: 1.2rem;
}
.risk-card h4 { font-size: 0.85rem; color: var(--red); margin-bottom: 0.4rem; }
.risk-card p { font-size: 0.82rem; color: var(--muted); }

/* ── Components table ── */
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin-top: 1.5rem; }
th { text-align: left; padding: 0.6rem 0.8rem; color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--border); }
td { padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: none; }
.comp-type { font-family: monospace; color: var(--accent2); font-size: 0.82rem; }

/* ── Footer ── */
footer {
  text-align: center; padding: 3rem 2rem;
  border-top: 1px solid var(--border);
  color: var(--muted); font-size: 0.85rem;
}
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--text); }
