/* 2l;dr public surface — cosmic-neon design language (tldr-7tx / W1.7).
 *
 * Variables + base layout shared across homepage + /decks index. /protocol/
 * is self-contained (carries its own styles from tldr-mau).
 *
 * CSP note: inline <script> in index.html requires either 'unsafe-inline' or
 * a nonce/hash. v1 ships with 'unsafe-inline' on script-src; hardening is
 * tldr-xoi (CSP-hardening follow-up). Style-src does NOT use 'unsafe-inline'
 * — all styles in this external file.
 */

:root {
  --bg-deep-space: #05061A;
  --bg-panel: #0A0B2E;
  --bg-panel-edge: #151844;
  --text-primary: #E8ECFF;
  --text-secondary: #8890C4;
  --status-muted: #4A4E7A;
  --accent-cyan: #38E8FF;
  --accent-electric-blue: #4D7CFF;
  --accent-neon-magenta: #FF3DB8;
  --accent-violet: #9B5CFF;
  --accent-stardust: #B8C6FF;
  --accent-gold: #F5C842;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }

body {
  font-family: 'Outfit', system-ui, sans-serif;
  color: var(--text-primary);
  background:
    radial-gradient(ellipse 70% 50% at 50% 20%, rgba(155, 92, 255, 0.12), transparent 60%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(56, 232, 255, 0.07), transparent 60%),
    radial-gradient(ellipse 40% 30% at 0% 0%, rgba(255, 61, 184, 0.06), transparent 60%),
    linear-gradient(160deg, var(--bg-deep-space) 0%, var(--bg-panel) 55%, var(--bg-panel-edge) 100%);
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.005em;
  position: relative;
  overflow-x: hidden;
  background-attachment: fixed;
}

body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, rgba(184, 198, 255, 0.4) 50%, transparent 100%),
    radial-gradient(1px 1px at 70% 50%, rgba(184, 198, 255, 0.3) 50%, transparent 100%),
    radial-gradient(1px 1px at 35% 75%, rgba(56, 232, 255, 0.3) 50%, transparent 100%),
    radial-gradient(2px 2px at 85% 18%, rgba(155, 92, 255, 0.35) 50%, transparent 100%),
    radial-gradient(1.5px 1.5px at 55% 85%, rgba(255, 61, 184, 0.25) 50%, transparent 100%);
  background-size: 800px 600px;
  pointer-events: none;
  opacity: 0.5;
  z-index: 0;
}

/* ── Header ─────────────────────────────────────────────── */

.site-header {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px max(24px, 4vw);
  border-bottom: 1px solid rgba(155, 92, 255, 0.08);
}

.brand { display: inline-flex; }
.wordmark { height: 36px; width: auto; }

.site-nav {
  display: flex;
  gap: 28px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}
.site-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}
.site-nav a:hover { color: var(--accent-cyan); }

/* ── Stage / main ────────────────────────────────────────── */

.stage {
  position: relative;
  z-index: 1;
  padding: 64px max(24px, 4vw) 96px;
  max-width: 1120px;
  margin: 0 auto;
}

/* ── Hero ───────────────────────────────────────────────── */

.hero { max-width: 760px; }

.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 24px;
  opacity: 0.85;
}

.headline {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(2.4rem, 6.5vw, 4.5rem);
  line-height: 1.04;
  letter-spacing: -0.015em;
  margin-bottom: 40px;
}
.headline span { display: block; }
.headline .accent {
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-violet) 50%, var(--accent-neon-magenta) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.mode-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: rgba(21, 24, 68, 0.5);
  border: 1px solid rgba(155, 92, 255, 0.15);
  border-radius: 999px;
  margin-bottom: 32px;
}
.mode-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: transparent;
  border: 0;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.mode-btn:hover { color: var(--accent-cyan); }
.mode-btn.is-active {
  color: var(--bg-deep-space);
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-violet));
}

.copy {
  font-size: clamp(1.05rem, 1.7vw, 1.18rem);
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: 40px;
}
.copy p + p { margin-top: 18px; }
.copy code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9em;
  padding: 2px 6px;
  background: rgba(56, 232, 255, 0.08);
  border-radius: 4px;
  color: var(--accent-cyan);
}
.copy em { color: var(--accent-stardust); font-style: italic; }
.copy strong { color: var(--accent-cyan); font-weight: 600; }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 8px;
}
.cta {
  display: inline-flex;
  align-items: center;
  padding: 14px 28px;
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 999px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.cta--primary {
  color: var(--bg-deep-space);
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-violet));
  box-shadow: 0 6px 24px rgba(155, 92, 255, 0.25);
}
.cta--primary:hover { transform: translateY(-1px); box-shadow: 0 10px 32px rgba(155, 92, 255, 0.4); }
.cta--ghost {
  color: var(--text-primary);
  background: rgba(21, 24, 68, 0.5);
  border: 1px solid rgba(155, 92, 255, 0.25);
}
.cta--ghost:hover {
  border-color: var(--accent-cyan);
  background: rgba(56, 232, 255, 0.05);
}

/* ── Pillars ────────────────────────────────────────────── */

.pillars { margin-top: 96px; }
.section-title {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.01em;
  margin-bottom: 32px;
  color: var(--text-primary);
}
.pillar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.pillar {
  padding: 28px 26px;
  background: rgba(21, 24, 68, 0.4);
  border: 1px solid rgba(155, 92, 255, 0.12);
  border-radius: 14px;
  transition: border-color 0.2s, transform 0.2s;
}
.pillar:hover {
  border-color: rgba(56, 232, 255, 0.3);
  transform: translateY(-2px);
}
.pillar-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--accent-cyan);
  margin-bottom: 12px;
  letter-spacing: 0.1em;
}
.pillar h3 {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 600;
  font-size: 1.4rem;
  margin-bottom: 10px;
  color: var(--text-primary);
}
.pillar p {
  color: var(--text-secondary);
  line-height: 1.5;
  font-size: 0.96rem;
}

/* ── Decks index ─────────────────────────────────────────── */

.decks-page { padding-top: 32px; }
.decks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 36px;
}
.deck-card {
  display: block;
  padding: 22px 22px 18px;
  background: rgba(21, 24, 68, 0.4);
  border: 1px solid rgba(155, 92, 255, 0.12);
  border-radius: 14px;
  text-decoration: none;
  color: var(--text-primary);
  transition: border-color 0.2s, transform 0.2s;
}
.deck-card:hover {
  border-color: rgba(56, 232, 255, 0.3);
  transform: translateY(-2px);
}
.deck-card h2 {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 600;
  font-size: 1.3rem;
  margin-bottom: 10px;
}
.deck-card .meta {
  display: flex;
  gap: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}
.deck-card .meta .status {
  color: var(--accent-cyan);
  text-transform: uppercase;
}

.decks-state {
  margin-top: 36px;
  padding: 32px 28px;
  background: rgba(21, 24, 68, 0.3);
  border: 1px dashed rgba(155, 92, 255, 0.18);
  border-radius: 14px;
  text-align: center;
}
.decks-state p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.55;
}
.decks-state .retry {
  display: inline-block;
  margin-top: 16px;
  padding: 8px 18px;
  background: rgba(56, 232, 255, 0.08);
  border: 1px solid rgba(56, 232, 255, 0.3);
  border-radius: 999px;
  color: var(--accent-cyan);
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}

/* ── Footer ─────────────────────────────────────────────── */

.site-footer {
  position: relative;
  z-index: 5;
  padding: 32px max(24px, 4vw) 48px;
  border-top: 1px solid rgba(155, 92, 255, 0.08);
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  align-items: center;
  justify-content: space-between;
  max-width: 1120px;
  margin: 0 auto;
}
.footer-brand,
.footer-nav {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-secondary);
}
.footer-brand a { color: var(--accent-cyan); text-decoration: none; }
.footer-nav { display: flex; gap: 22px; }
.footer-nav a { color: var(--text-secondary); text-decoration: none; }
.footer-nav a:hover { color: var(--accent-cyan); }

/* ── Mobile ─────────────────────────────────────────────── */

@media (max-width: 640px) {
  .site-header { padding: 18px 20px; }
  .site-nav { gap: 18px; }
  .stage { padding: 40px 20px 64px; }
  .pillars { margin-top: 64px; }
  .footer-row { flex-direction: column; align-items: flex-start; }
}
