/* REI — rei-ai.dev */

:root {
  --bg: #0c0a12;
  --bg-2: #110e19;
  --panel: #161222;
  --panel-2: #1c1729;
  --line: #2a2340;
  --line-2: #3a3157;
  --text: #ece9f5;
  --muted: #9a93ad;
  --dim: #6b6480;
  --accent: #a78bfa;
  --accent-strong: #8b5cf6;
  --pink: #f472b6;
  --ok: #4ade80;
  --warn: #fbbf24;
  --err: #f87171;
  --cyan: #67e8f9;
  --accent-rgb: 167 139 250;
  --accent-hover: #b9a2fb;
  --on-accent: #12091f;
  --well: #0e0b16;
  --code-text: #d9d4e7;
  --code-inline: #d8ccff;
  --logo-fill: #f5f3ff;
  --logo-line: #a78bfa;

  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, "JetBrains Mono", Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius: 12px;
  --max: 1160px;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 75% -10%, rgb(var(--accent-rgb) / .13), transparent 60%),
    radial-gradient(700px 400px at 0% 30%, rgba(244, 114, 182, .05), transparent 60%),
    radial-gradient(rgb(var(--accent-rgb) / .09) 1px, transparent 1px) 0 0 / 24px 24px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

code, pre, kbd { font-family: var(--mono); }
:not(pre) > code {
  font-size: .88em;
  padding: .12em .4em;
  border-radius: 6px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--code-inline);
}

img, svg { display: block; max-width: 100%; }

.wrap { width: min(var(--max), 100% - 40px); margin-inline: auto; }
.wrap > *, .hero .wrap > *, .demo-grid > *, .verify-grid > *, .privacy-grid > *, .split > *, .tabs > *, [class^="grid-"] > * { min-width: 0; }

.skip {
  position: absolute; left: -999px; top: 8px;
  background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: 8px; z-index: 100;
}
.skip:focus { left: 8px; }

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

/* ── nav ─────────────────────────────────────────── */

.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  background: rgba(12, 10, 18, .72);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 28px; height: 64px; }
.nav-logo { display: flex; align-items: center; gap: 10px; }
.nav-logo svg { height: 30px; width: auto; }
.nav-links { display: flex; gap: 22px; margin-left: auto; font-size: 14px; }
.nav-links a { color: var(--muted); font-family: var(--mono); }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-cta { display: flex; gap: 10px; align-items: center; }
.nav-toggle {
  display: none; margin-left: auto; background: none; border: 1px solid var(--line);
  color: var(--text); border-radius: 8px; width: 40px; height: 36px; cursor: pointer;
  font: 600 16px var(--mono);
}

/* ── buttons ─────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px;
  font: 600 14px var(--mono);
  border: 1px solid var(--line-2);
  color: var(--text); background: var(--panel);
  transition: transform .15s, border-color .15s, background .15s;
  cursor: pointer;
}
.btn:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); box-shadow: 4px 4px 0 -1px var(--bg), 4px 4px 0 0 var(--accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn svg { width: 16px; height: 16px; }
.btn-sm { padding: 7px 12px; font-size: 13px; }

/* ── hero ────────────────────────────────────────── */

.hero { padding: 48px 0 40px; }
.hero .wrap { display: grid; grid-template-columns: 1.25fr .75fr; gap: 48px; align-items: center; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font: 500 13px var(--mono); color: var(--accent);
  border: 1px solid var(--line-2); border-radius: 999px; padding: 5px 12px;
  background: rgb(var(--accent-rgb) / .06);
}
.eyebrow .dot { width: 7px; height: 7px; background: var(--ok); box-shadow: 0 0 10px var(--ok); }

.hero-logo { width: min(300px, 70%); height: auto; aspect-ratio: 198 / 128; margin: 22px 0 20px; }

h1 {
  font: 700 clamp(30px, 4.6vw, 52px)/1.08 var(--sans);
  letter-spacing: -.025em;
  margin: 0 0 18px;
}
h1 .hl { color: var(--accent); }

.lead { font-size: clamp(16px, 1.6vw, 19px); color: var(--muted); max-width: 600px; margin: 0 0 28px; }
.lead strong { color: var(--text); font-weight: 600; }

.hero-avatar { position: relative; justify-self: center; width: min(360px, 100%); }
.hero-avatar svg { width: 100%; height: auto; overflow: visible; }
.hero-avatar .bubble {
  position: absolute; top: 4%; right: -4%;
  font: 500 13px var(--mono); color: var(--text);
  background: var(--panel); border: 1px solid var(--line-2);
  padding: 8px 12px; border-radius: 10px 10px 10px 2px;
  white-space: nowrap;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
  animation: float 5s ease-in-out infinite;
}
.bubble .ok { color: var(--ok); }
@keyframes float { 50% { transform: translateY(-6px); } }

.rei-eyes { transition: transform .12s ease-out; }

/* install box */
.install { max-width: 620px; }
.install-tabs { display: flex; gap: 4px; margin-bottom: -1px; }
.install-tabs button {
  font: 500 13px var(--mono); color: var(--dim);
  background: none; border: 1px solid transparent; border-bottom: none;
  padding: 7px 14px; border-radius: 9px 9px 0 0; cursor: pointer;
}
.install-tabs button[aria-selected="true"] { color: var(--text); background: var(--panel); border-color: var(--line); }
.install-box {
  background: var(--panel); border: 1px solid var(--line); border-radius: 0 var(--radius) var(--radius) var(--radius);
  position: relative;
}
.install-box [role="tabpanel"], .install-box.solo { display: flex; align-items: flex-start; }
.install-box [role="tabpanel"][hidden] { display: none; }
.install-box pre { flex: 1; min-width: 0; margin: 0; padding: 16px 12px 16px 18px; overflow-x: auto; font-size: 14px; line-height: 1.7; }
.install-box .p { color: var(--accent); user-select: none; }
.install-box .c { color: var(--dim); }

.copy {
  flex: none; margin: 10px 10px 0 0;
  width: 34px; height: 34px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--panel-2); border: 1px solid var(--line);
  color: var(--muted); cursor: pointer; transition: color .15s, border-color .15s;
}
.copy:hover { color: var(--text); border-color: var(--accent); }
.copy svg { width: 16px; height: 16px; }
.copy.done { color: var(--ok); border-color: var(--ok); }

.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 18px; font: 13px var(--mono); color: var(--dim); }
.hero-meta span::before { content: "✓ "; color: var(--ok); }

/* ── sections ────────────────────────────────────── */

section { padding: 88px 0; }
.section-head { max-width: 720px; margin-bottom: 44px; }
.kicker { font: 600 13px var(--mono); color: var(--accent); letter-spacing: .04em; margin-bottom: 10px; }
.kicker::before { content: "// "; color: var(--dim); }
h2 { font: 700 clamp(26px, 3.4vw, 38px)/1.15 var(--sans); letter-spacing: -.02em; margin: 0 0 14px; }
h3 { font: 600 18px/1.3 var(--sans); margin: 0 0 8px; }
.section-head p { color: var(--muted); font-size: 17px; margin: 0; }

.divider { border: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--line-2), transparent); margin: 0; }

/* terminal */
.term {
  background: var(--well); border: 1px solid var(--line-2); border-radius: var(--radius);
  box-shadow: 10px 10px 0 -1px var(--bg), 10px 10px 0 0 rgb(var(--accent-rgb) / .35), 0 30px 80px rgba(0, 0, 0, .5);
  overflow: hidden;
}
.term-bar {
  display: flex; align-items: center; gap: 7px; padding: 11px 14px;
  border-bottom: 1px solid var(--line); background: var(--panel);
  font: 12px var(--mono); color: var(--dim);
}
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--line-2); }
.term-bar i:nth-child(1) { background: #f87171aa; }
.term-bar i:nth-child(2) { background: #fbbf24aa; }
.term-bar i:nth-child(3) { background: #4ade80aa; }
.term-bar span { margin-left: 10px; }
.term-body {
  margin: 0; padding: 18px 20px; min-height: 360px;
  font: 13.5px/1.65 var(--mono); color: var(--code-text);
  white-space: pre-wrap; word-break: break-word;
}
.term-body .prompt { color: var(--accent); font-weight: 600; }
.term-body .ok { color: var(--ok); }
.term-body .err { color: var(--err); }
.term-body .warn { color: var(--warn); }
.term-body .dim { color: var(--dim); }
.term-body .cy { color: var(--cyan); }
.term-body .caret { display: inline-block; width: .6em; background: var(--text); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

.demo { padding-top: 40px; }
.demo-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 48px; align-items: center; }
.demo-steps { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 14px; }
.demo-steps li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; color: var(--muted); }
.demo-steps b { color: var(--text); font-weight: 600; }
.demo-steps .n {
  width: 30px; height: 30px; display: grid; place-items: center;
  font: 700 13px var(--mono); color: var(--accent);
  border: 1px solid var(--line-2); border-radius: 8px;
}

/* pillars */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

.card {
  position: relative;
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px;
  transition: border-color .2s, transform .2s;
}
.card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.card p { color: var(--muted); margin: 0; font-size: 15px; }
.card .icon {
  width: 42px; height: 42px; display: grid; place-items: center;
  font-size: 20px; margin-bottom: 16px;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px;
  box-shadow: 3px 3px 0 -1px var(--bg), 3px 3px 0 0 var(--accent);
}
.card .tag { font: 12px var(--mono); color: var(--dim); margin-top: 14px; display: block; }

/* verify table */
.verify-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 48px; align-items: start; }
.quote {
  font: 600 20px/1.45 var(--sans); color: var(--text);
  border-left: 3px solid var(--accent); padding: 4px 0 4px 18px; margin: 28px 0;
}
.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font: 600 12px var(--mono); color: var(--dim); text-transform: uppercase; letter-spacing: .05em; background: var(--panel-2); }
tr:last-child td { border-bottom: none; }
td code { font-size: 12.5px !important; }
.proof { font: 600 12px var(--mono); padding: 3px 8px; border-radius: 6px; }
.proof.strong { color: var(--ok); background: rgba(74, 222, 128, .1); }
.proof.mid { color: var(--cyan); background: rgba(103, 232, 249, .1); }
.proof.weak { color: var(--warn); background: rgba(251, 191, 36, .1); }
.proof.none { color: var(--dim); background: rgba(107, 100, 128, .15); }

/* backends */
.backends { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.backend-col h3 { font: 600 14px var(--mono); color: var(--muted); display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.backend-col h3 .badge { font-size: 11px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: 500 13px var(--mono); padding: 7px 12px; border-radius: 8px;
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
}
.chip small { color: var(--dim); margin-left: 6px; }

.split {
  margin-top: 40px; display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center;
  padding: 28px; border: 1px solid var(--line-2); border-radius: 16px;
  background: linear-gradient(135deg, rgb(var(--accent-rgb) / .08), transparent 60%), var(--bg-2);
}
.split p { color: var(--muted); margin: 0 0 12px; }
.stat { font: 700 40px/1 var(--mono); color: var(--accent); }
.stat-label { font: 13px var(--mono); color: var(--dim); margin-top: 6px; }

.code {
  margin: 0; padding: 18px 20px; overflow-x: auto;
  background: var(--well); border: 1px solid var(--line); border-radius: var(--radius);
  font: 13.5px/1.7 var(--mono); color: var(--code-text);
}
.code .k { color: var(--accent); }
.code .s { color: var(--ok); }
.code .c { color: var(--dim); }
.code .v { color: var(--cyan); }
.code .y { color: var(--warn); }

/* modes */
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.mode { padding: 22px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); }
.mode header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.mode .name { font: 700 18px var(--mono); }
.mode .name::before { content: "/mode "; color: var(--dim); font-weight: 400; }
.mode .edits { font: 12px var(--mono); padding: 2px 8px; border-radius: 6px; }
.mode .edits.no { color: var(--dim); border: 1px solid var(--line-2); }
.mode .edits.yes { color: var(--ok); border: 1px solid rgba(74, 222, 128, .4); }
.mode p { color: var(--muted); margin: 0; font-size: 15px; }

/* extend tabs */
.tabs { display: grid; grid-template-columns: 260px 1fr; gap: 28px; }
.tablist { display: flex; flex-direction: column; gap: 6px; }
.tablist button {
  text-align: left; padding: 14px 16px; border-radius: 10px; cursor: pointer;
  background: none; border: 1px solid transparent; color: var(--muted);
  font: 15px var(--sans);
  transition: background .15s, border-color .15s, color .15s;
}
.tablist button b { display: block; font: 600 14px var(--mono); color: var(--text); margin-bottom: 2px; }
.tablist button:hover { background: var(--panel); }
.tablist button[aria-selected="true"] { background: var(--panel); border-color: var(--line-2); color: var(--text); }
.tablist button[aria-selected="true"] b { color: var(--accent); }
.tabpanel p { color: var(--muted); margin: 0 0 16px; }
.tabpanel[hidden] { display: none; }
.file-name { font: 12px var(--mono); color: var(--dim); margin-bottom: 8px; }
.file-name::before { content: "📄 "; }
.enforced { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.enforced li { color: var(--muted); padding-left: 24px; position: relative; font-size: 15px; }
.enforced li::before { content: "■"; position: absolute; left: 2px; color: var(--accent); font-size: 11px; top: 3px; }

/* sdd */
.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; counter-reset: s; }
.flow-step { position: relative; padding: 22px 20px; border: 1px solid var(--line); background: var(--panel); }
.flow-step:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.flow-step:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.flow-step + .flow-step { border-left: none; }
.flow-step code.cmd { font: 700 15px var(--mono); color: var(--accent); background: none; border: none; padding: 0; }
.flow-step p { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.flow-step:not(:last-child)::after {
  content: "→"; position: absolute; right: -11px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; display: grid; place-items: center; z-index: 1;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: 50%;
  font: 12px var(--mono); color: var(--accent);
}
.verdicts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; font: 600 13px var(--mono); }
.verdicts span { padding: 6px 12px; border-radius: 8px; border: 1px solid; }
.v-met { color: var(--ok); border-color: rgba(74, 222, 128, .4); }
.v-not { color: var(--err); border-color: rgba(248, 113, 113, .4); }
.v-unv { color: var(--warn); border-color: rgba(251, 191, 36, .4); }

/* privacy */
.privacy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.big-claim { font: 700 clamp(24px, 3vw, 34px)/1.2 var(--sans); letter-spacing: -.02em; margin: 0 0 16px; }
.big-claim span { color: var(--accent); }
.tree {
  margin: 0; padding: 20px; border-radius: var(--radius);
  background: var(--well); border: 1px solid var(--line);
  font: 13.5px/1.9 var(--mono); color: var(--code-text); overflow-x: auto;
}
.tree .d { color: var(--accent); }
.tree .c { color: var(--dim); }
.guards { display: grid; gap: 10px; margin-top: 22px; }
.guard { display: flex; gap: 12px; font-size: 15px; color: var(--muted); }
.guard b { color: var(--text); font-weight: 600; }
.guard .ic { flex: none; width: 22px; color: var(--ok); font-family: var(--mono); }
.guard .ic.no { color: var(--warn); }

/* anywhere */
.anywhere .card pre { margin: 14px 0 0; }

/* who */
.who { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.who .card h3 { font-size: 16px; }

/* cta */
.cta {
  text-align: center; padding: 100px 0 110px;
}
.cta-box {
  position: relative; padding: 56px 24px; border-radius: 20px;
  border: 1px solid var(--line-2);
  background: radial-gradient(600px 260px at 50% 0%, rgb(var(--accent-rgb) / .16), transparent 70%), var(--bg-2);
}
.cta-box .avatar-sm { width: 110px; margin: 0 auto 18px; }
.cta-box p { color: var(--muted); max-width: 560px; margin: 0 auto 26px; }
.cta-box .install { margin: 0 auto 22px; text-align: left; }
.cta-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* footer */
footer { border-top: 1px solid var(--line); padding: 36px 0 44px; color: var(--dim); font-size: 14px; }
footer .wrap { display: flex; gap: 24px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
footer svg { height: 20px; width: auto; opacity: .85; }
footer nav { display: flex; gap: 20px; flex-wrap: wrap; font-family: var(--mono); font-size: 13px; }
footer nav a { color: var(--muted); }

/* reveal */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ── responsive ─────────────────────────────────── */

@media (max-width: 980px) {
  .hero .wrap, .demo-grid, .verify-grid, .privacy-grid, .split { grid-template-columns: 1fr; }
  .hero-avatar { order: -1; width: 220px; }
  .hero-avatar .bubble { right: -12%; font-size: 12px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .backends, .modes, .who, .grid-3 { grid-template-columns: 1fr 1fr; }
  .tabs { grid-template-columns: 1fr; }
  .tablist { flex-direction: row; overflow-x: auto; }
  .tablist button { flex: none; }
  .tablist button span { display: none; }
  .flow { grid-template-columns: 1fr 1fr; gap: 12px; }
  .flow-step, .flow-step + .flow-step { border: 1px solid var(--line); border-radius: var(--radius) !important; }
  .flow-step::after { display: none; }
}

@media (max-width: 760px) {
  .nav-links, .nav-cta { display: none; }
  .nav-toggle { display: block; }
  .nav.open .nav-links {
    display: flex; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 16px 20px; gap: 14px;
  }
  section { padding: 64px 0; }
  .hero { padding-top: 40px; }
  .grid-4, .backends, .modes, .who, .grid-3, .grid-2, .flow { grid-template-columns: 1fr; }
  .term-body { min-height: 300px; font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* language toggle */
.lang {
  display: inline-flex; padding: 2px; gap: 2px;
  border: 1px solid var(--line-2); border-radius: 9px; background: var(--panel);
}
.lang button {
  font: 600 12px var(--mono); color: var(--dim);
  background: none; border: 0; border-radius: 7px; padding: 5px 9px; cursor: pointer;
  transition: color .15s, background .15s;
}
.lang button:hover { color: var(--text); }
.lang button[aria-pressed="true"] { color: var(--on-accent); background: var(--accent); }
.nav-links + .lang, .nav-cta + .lang { margin-left: 4px; }
@media (max-width: 760px) {
  .nav .lang { margin-left: auto; }
  .nav .lang + .nav-toggle { margin-left: 0; }
}

[data-logo] { fill: var(--logo-fill); color: var(--logo-line); }

/* ── phosphor toggle: Hercules CRT, the 80s ─────── */

.phos {
  display: inline-flex; padding: 2px; gap: 2px;
  border: 1px solid var(--line-2); border-radius: 9px; background: var(--panel);
}
.phos button {
  display: inline-flex; align-items: center; gap: 5px;
  font: 600 12px var(--mono); color: var(--dim);
  background: none; border: 0; border-radius: 7px; padding: 5px 8px; cursor: pointer;
  transition: color .15s, background .15s;
}
.phos button:hover { color: var(--text); }
.phos button[aria-pressed="true"] { color: var(--text); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.phos .pd { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.pd-v { background: #a78bfa; }
.pd-a { background: #ffb000; box-shadow: 0 0 6px #ffb000; }
.pd-g { background: #39ff5e; box-shadow: 0 0 6px #39ff5e; }
.nav .phos { margin-left: 4px; }
@media (max-width: 760px) {
  .nav .phos { margin-left: auto; }
  .nav .phos + .lang { margin-left: 0; }
}

/* one hue, three intensities — the way a Hercules card drew everything */
html[data-phos="amber"] {
  --bg: #0a0600; --bg-2: #0f0902; --panel: #150d03; --panel-2: #1c1205; --line: #2d1d06; --line-2: #4a300a;
  --text: #ffc85a; --muted: #c98a1c; --dim: #8f6213;
  --accent: #ffb000; --accent-strong: #ff9500; --accent-rgb: 255 176 0; --accent-hover: #ffc640;
  --pink: #ff9500; --cyan: #ffd27a; --warn: #ffd27a;
  --on-accent: #1a0f00; --well: #080500; --code-text: #ffc85a; --code-inline: #ffd27a;
  --logo-fill: #ffc640; --logo-line: #ff9500;
}
html[data-phos="green"] {
  --bg: #010802; --bg-2: #020c04; --panel: #031207; --panel-2: #05190a; --line: #0b2a12; --line-2: #12451e;
  --text: #8dffaa; --muted: #3fb560; --dim: #2a7d42;
  --accent: #39ff5e; --accent-strong: #1fd146; --accent-rgb: 57 255 94; --accent-hover: #7dff97;
  --pink: #1fd146; --cyan: #b6ffc8; --warn: #b6ffc8;
  --on-accent: #001a06; --well: #000602; --code-text: #8dffaa; --code-inline: #b6ffc8;
  --logo-fill: #7dff97; --logo-line: #1fd146;
}
html[data-phos] { --sans: var(--mono); }
html[data-phos] h1, html[data-phos] h2, html[data-phos] .big-claim { letter-spacing: -.01em; }
html[data-phos] body::before {
  background:
    radial-gradient(900px 500px at 75% -10%, rgb(var(--accent-rgb) / .10), transparent 60%),
    radial-gradient(rgb(var(--accent-rgb) / .07) 1px, transparent 1px) 0 0 / 24px 24px;
}

/* phosphor bloom */
html[data-phos] body { text-shadow: 0 0 2px rgb(var(--accent-rgb) / .35); }
html[data-phos] h1, html[data-phos] h2, html[data-phos] .kicker, html[data-phos] .stat,
html[data-phos] .prompt, html[data-phos] .hl, html[data-phos] .big-claim span {
  text-shadow: 0 0 6px rgb(var(--accent-rgb) / .55), 0 0 18px rgb(var(--accent-rgb) / .25);
}
html[data-phos] [data-logo], html[data-phos] .hero-avatar svg, html[data-phos] .avatar-sm, html[data-phos] #rei {
  filter: drop-shadow(0 0 6px rgb(var(--accent-rgb) / .55));
}

/* the avatar follows the phosphor */
html[data-phos] svg [stroke="#a78bfa"] { stroke: var(--accent); }
html[data-phos] svg [fill="#a78bfa"] { fill: var(--accent); }
html[data-phos] svg [fill="#f5f3ff"] { fill: var(--logo-fill); }
html[data-phos] svg [fill="#f472b6"] { fill: var(--accent-strong); }
html[data-phos] svg [stop-color="#a78bfa"] { stop-color: var(--accent); }
html[data-phos] svg [stop-color="#221c33"] { stop-color: var(--panel-2); }
html[data-phos] svg [stop-color="#141020"] { stop-color: var(--bg-2); }

/* scanlines, vignette and a slow flicker */
html[data-phos] body::after {
  content: "";
  position: fixed; inset: 0; z-index: 999; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .22) 0px, rgba(0, 0, 0, .22) 1px, transparent 2px, transparent 3px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, .55) 100%);
  opacity: .9;
}
@media (prefers-reduced-motion: no-preference) {
  html[data-phos] body::after { animation: phos-flicker 4s steps(60) infinite; }
}
@keyframes phos-flicker { 0%, 100% { opacity: .92; } 48% { opacity: .84; } 50% { opacity: .96; } 52% { opacity: .87; } }
.hero-avatar .bubble { z-index: 2; }
html[data-phos="amber"] .card .icon { filter: grayscale(1) sepia(1) saturate(3) brightness(1.1); }
html[data-phos="green"] .card .icon { filter: grayscale(1) sepia(1) hue-rotate(70deg) saturate(3); }
h1 .hl { white-space: nowrap; }
