:root, [data-theme="dark"] {
  --bg:         #0b0d11;
  --bg-s:       #11141a;
  --bg-s2:      #161a21;
  --bg-e:       #1a1f27;
  --bg-e2:      #1f2530;
  --b-dim:      rgba(255,255,255,0.06);
  --b-mut:      rgba(255,255,255,0.10);
  --b-act:      rgba(255,255,255,0.20);
  --text:       #e8eaf0;
  --sub:        #b0b4c0;
  --muted:      #6a707e;
  --accent:     #8b78ff;
  --accent-dim: rgba(139,120,255,0.10);
  --accent-b:   rgba(139,120,255,0.28);
  --accent-h:   #a08fff;
  --green:      #26a69a;
  --green-dim:  rgba(43,217,124,0.10);
  --green-b:    rgba(43,217,124,0.28);
  --red:        #ef5350;
  --red-dim:    rgba(255,85,114,0.10);
  --red-b:      rgba(255,85,114,0.28);
  --orange:     #ff9a00;
  --nav-bg:     rgba(11,13,17,0.88);
  --dot-color:  rgba(255,255,255,0.035);
  --glow-1:     rgba(43,217,124,0.07);
  --glow-2:     rgba(255,85,114,0.04);
  --shadow:     0 4px 24px rgba(0,0,0,0.5);
  --font: 'Inter', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', monospace;
  --grad: linear-gradient(90deg, var(--green), var(--red));
}

[data-theme="light"] {
  --bg:         #f5f6f8;
  --bg-s:       #ffffff;
  --bg-s2:      #eef0f4;
  --bg-e:       #e8eaee;
  --bg-e2:      #e0e3e8;
  --b-dim:      rgba(0,0,0,0.07);
  --b-mut:      rgba(0,0,0,0.12);
  --b-act:      rgba(0,0,0,0.22);
  --text:       #0f1117;
  --sub:        #3a3f4a;
  --muted:      #6b7280;
  --accent:     #6f5cff;
  --accent-dim: rgba(111,92,255,0.08);
  --accent-b:   rgba(111,92,255,0.25);
  --accent-h:   #8b78ff;
  --green:      #26a69a;
  --green-dim:  rgba(22,163,74,0.08);
  --green-b:    rgba(22,163,74,0.25);
  --red:        #ef5350;
  --red-dim:    rgba(220,38,67,0.08);
  --red-b:      rgba(220,38,67,0.25);
  --orange:     #d97706;
  --nav-bg:     rgba(245,246,248,0.92);
  --dot-color:  rgba(0,0,0,0.04);
  --glow-1:     rgba(43,217,124,0.05);
  --glow-2:     rgba(255,85,114,0.03);
  --shadow:     0 4px 16px rgba(0,0,0,0.10);
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -2;
  background-image: radial-gradient(circle, var(--dot-color) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}
body::after {
  content: '';
  position: fixed; inset: 0 0 auto 0; height: 40vh; z-index: -1;
  background: radial-gradient(ellipse at 20% 0%, var(--glow-1), transparent 50%),
              radial-gradient(ellipse at 80% 10%, var(--glow-2), transparent 50%);
  pointer-events: none;
}

::selection { background: var(--accent); color: #fff; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--b-mut); }

/* ── NAV ─────────────────────────────────────────────────────── */
.sp-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 58px;
  display: flex; align-items: center;
  padding: 0 40px; gap: 20px;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--b-dim);
}

/* Wordmark CSS provided by _partials/wordmark_styles.html.twig — single
   source of truth across base, landing, login and static layouts. */

.sp-sep {
  width: 1px; height: 14px; background: var(--b-dim); flex-shrink: 0;
}
.sp-back {
  font-family: var(--mono); font-size: 0.66rem; color: var(--muted);
  text-decoration: none; display: flex; align-items: center; gap: 6px;
  transition: color 0.12s; letter-spacing: 0.06em; text-transform: uppercase;
}
.sp-back:hover { color: var(--text); }
.sp-page {
  font-family: var(--mono); font-size: 0.62rem; color: var(--muted);
  letter-spacing: 0.10em; text-transform: uppercase;
}

.sp-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.sp-theme-toggle {
  display: flex; align-items: center; gap: 1px;
  background: var(--bg-e); border: 1px solid var(--b-mut);
  border-radius: 2px; padding: 2px;
}
.sp-theme-toggle button {
  width: 26px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: 1px;
  color: var(--muted); cursor: pointer; font-size: 10px;
  transition: color 0.12s, background 0.12s;
}
.sp-theme-toggle button:hover { color: var(--text); }
.sp-theme-toggle button.on { color: var(--accent); background: var(--accent-dim); }

/* ── CONTENT WRAP ────────────────────────────────────────────── */
.sp-wrap {
  max-width: 800px; margin: 0 auto;
  padding: 96px 40px 120px;
}

/* ── PAGE ELEMENTS ───────────────────────────────────────────── */
.sp-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 0.6rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 18px;
}
.sp-eyebrow::before { content: ''; width: 20px; height: 2px; background: var(--grad); }
.sp-eyebrow b { background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; font-weight: 700; }
.sp-eyebrow span { color: var(--muted); }

.sp-h1 {
  font-family: var(--font);
  font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800;
  letter-spacing: -0.04em; line-height: 1.08;
  margin-bottom: 14px;
}
.sp-h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

.sp-lead {
  font-size: 0.92rem; color: var(--sub); line-height: 1.75;
  max-width: 580px; margin-bottom: 48px;
  border-bottom: 1px solid var(--b-dim); padding-bottom: 36px;
}
.sp-lead b { color: var(--text); font-weight: 600; }

.sp-meta {
  font-family: var(--mono); font-size: 0.64rem; color: var(--muted);
  display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 40px;
}
.sp-meta b { color: var(--sub); }

/* ── BODY SECTIONS ───────────────────────────────────────────── */
.sp-body { display: flex; flex-direction: column; gap: 40px; }

.sp-section h2 {
  font-family: var(--font);
  font-size: 1.05rem; font-weight: 700;
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px;
  color: var(--text);
}
.sp-section h2 .n {
  font-family: var(--mono); font-size: 0.58rem; font-weight: 700;
  color: var(--accent); letter-spacing: 0.10em;
  background: var(--accent-dim); border: 1px solid var(--accent-b);
  padding: 2px 7px; border-radius: 2px;
}
.sp-section p { font-size: 0.86rem; color: var(--sub); line-height: 1.8; margin-bottom: 10px; }
.sp-section p:last-child { margin-bottom: 0; }
.sp-section p b { color: var(--text); font-weight: 600; }
.sp-section code {
  font-family: var(--mono); font-size: 0.78rem;
  background: var(--bg-e); border: 1px solid var(--b-dim);
  padding: 1px 5px; border-radius: 2px; color: var(--accent);
}
.sp-section a { color: var(--accent); text-decoration: none; transition: color 0.12s; }
.sp-section a:hover { color: var(--accent-h); }

.sp-section ul { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.sp-section ul li {
  font-size: 0.86rem; color: var(--sub); line-height: 1.65;
  display: flex; align-items: flex-start; gap: 10px;
}
.sp-section ul li::before {
  content: '→'; color: var(--green); font-family: var(--mono);
  font-size: 0.64rem; margin-top: 4px; flex-shrink: 0;
}
.sp-section ul li b { color: var(--text); font-weight: 600; }

.sp-divider { border: 0; border-top: 1px solid var(--b-dim); }

/* ── FOOTER ──────────────────────────────────────────────────── */
.sp-foot {
  margin-top: 80px; padding-top: 28px;
  border-top: 1px solid var(--b-dim);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 14px;
  font-family: var(--mono); font-size: 0.62rem; color: var(--muted);
}
.sp-foot-links { display: flex; gap: 20px; flex-wrap: wrap; }
.sp-foot a { color: var(--muted); text-decoration: none; transition: color 0.12s; }
.sp-foot a:hover { color: var(--text); }

/* ── Tablet / large phone (≤680px) ─────────────────────────────── */
@media (max-width: 680px) {
  .sp-nav  { padding: 0 16px; gap: 10px; height: 52px; }
  .sp-wrap { padding: 76px 18px 72px; }
  .sp-page { display: none; }
  .sp-back span { display: none; }
  /* Hero spacing — compress so the lead doesn't push body content
     off-screen before any of it shows. */
  .sp-h1   { letter-spacing: -0.02em; font-size: clamp(1.6rem, 7vw, 2.2rem); margin-bottom: 12px; }
  .sp-lead { font-size: 0.86rem; line-height: 1.65; margin-bottom: 28px; padding-bottom: 22px; }
  .sp-meta { flex-direction: column; gap: 6px; margin-bottom: 28px; }
  /* Body — tighter rhythm, looser line-height than 1.8 reads better on
     narrow lines because gaps were creating uncomfortable whitespace. */
  .sp-body { gap: 28px; }
  .sp-section h2 { font-size: 1rem; margin-bottom: 10px; }
  .sp-section p,
  .sp-section ul li { font-size: 0.82rem; line-height: 1.65; }
  /* Footer — gap shrinks so links wrap on one or two compact rows
     instead of stretching into a tall stack. */
  .sp-foot { flex-direction: column; align-items: flex-start; gap: 12px; margin-top: 56px; padding-top: 22px; }
  .sp-foot-links { gap: 14px; }
}

/* ── Small phone (≤480px) ──────────────────────────────────────── */
@media (max-width: 480px) {
  .sp-nav { padding: 0 12px; gap: 8px; }
  /* Drop the back link and divider — wordmark is already a Home link,
     and the duplicate Home arrow steals scarce nav real estate. */
  .sp-sep, .sp-back { display: none; }
  .sp-wrap { padding: 68px 14px 56px; }
  /* The wordmark partial doesn't expose a runtime size switch, so we
     scale it down directly via the inner spans. */
  .sp-nav .wordmark .wm-back,
  .sp-nav .wordmark .wm-green,
  .sp-nav .wordmark .wm-red { font-size: 0.8rem !important; }
  .sp-nav .wordmark .wm-candle-svg svg { width: 11px; height: 16px; }
  /* Theme toggle — shrink buttons so they don't push the wordmark off. */
  .sp-theme-toggle button { width: 22px; height: 20px; font-size: 9px; }
  .sp-h1 { font-size: clamp(1.4rem, 8vw, 1.9rem); }
  .sp-eyebrow { font-size: 0.55rem; margin-bottom: 14px; }
  .sp-section h2 .n { font-size: 0.54rem; padding: 1px 6px; }
}
