:root {
  color-scheme: dark;
  --bg: #09070f;
  --panel: rgba(21, 16, 34, .82);
  --panel-strong: #171020;
  --line: rgba(188, 148, 255, .18);
  --line-gold: rgba(232, 184, 102, .28);
  --ink: #f5f0ff;
  --muted: #aaa0b8;
  --violet: #b993ff;
  --violet-2: #7d51d9;
  --gold: #e8b866;
  --green: #75d6aa;
  --red: #ff8f9f;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --serif: Iowan Old Style, Baskerville, Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -10%, rgba(125, 81, 217, .25), transparent 38rem),
    radial-gradient(circle at 80% 30%, rgba(232, 184, 102, .07), transparent 30rem),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.55;
}

a { color: inherit; }
.wrap { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
.narrow { width: min(760px, calc(100% - 40px)); margin: 0 auto; }
.nav {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; gap: 12px; align-items: center; text-decoration: none; }
.brand-mark {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-gold);
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: 0 0 30px rgba(185, 147, 255, .15);
}
.brand-mark::before {
  content: '';
  width: 16px;
  height: 10px;
  border: 1px solid var(--gold);
  border-radius: 50% / 70%;
  box-shadow: inset 0 0 8px rgba(185, 147, 255, .65);
}
.brand-copy strong { display: block; font-family: var(--serif); letter-spacing: .02em; font-size: 18px; }
.brand-copy small { display: block; color: var(--muted); font: 10px var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.navlinks { display: flex; align-items: center; gap: 20px; color: var(--muted); font: 12px var(--mono); }
.navlinks a { text-decoration: none; }
.navlinks a:hover { color: var(--ink); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid var(--line-gold);
  border-radius: 999px;
  color: var(--gold);
  background: rgba(232, 184, 102, .06);
  font: 10px var(--mono);
  letter-spacing: .13em;
  text-transform: uppercase;
}
.badge::before { content: ''; width: 6px; height: 6px; background: currentColor; border-radius: 50%; box-shadow: 0 0 12px currentColor; }
.hero { padding: 112px 0 92px; text-align: center; }
.hero h1 { max-width: 900px; margin: 24px auto 22px; font: 56px/1.04 var(--serif); letter-spacing: -.025em; }
.hero h1 em { color: var(--violet); font-style: normal; }
.lede { max-width: 690px; margin: 0 auto; color: var(--muted); font-size: 18px; }
.truthline { margin-top: 27px; color: var(--gold); font: 12px var(--mono); letter-spacing: .08em; }
.actions { display: flex; justify-content: center; gap: 12px; margin-top: 32px; flex-wrap: wrap; }
.actions-start { justify-content: flex-start; }
.centered-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.button, button {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 17px;
  background: rgba(185, 147, 255, .12);
  color: var(--ink);
  font: 12px var(--mono);
  text-decoration: none;
  cursor: pointer;
}
.button.primary, button.primary { color: #160e21; background: var(--violet); border-color: var(--violet); font-weight: 700; }
.button:hover, button:hover { border-color: var(--violet); }

.section { padding: 70px 0; border-top: 1px solid var(--line); }
.eyebrow { color: var(--violet); font: 10px var(--mono); letter-spacing: .16em; text-transform: uppercase; }
.section h2 { margin: 10px 0 14px; font: 36px/1.13 var(--serif); }
.section-lede { color: var(--muted); max-width: 650px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(5, 1fr); margin-top: 34px; }
.card {
  position: relative;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(32, 23, 49, .82), rgba(13, 10, 20, .9));
}
.card .num { color: var(--gold); font: 10px var(--mono); }
.card h3 { margin: 24px 0 8px; font: 21px var(--serif); }
.card p { margin: 0; color: var(--muted); font-size: 13px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.panel { padding: 28px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.panel h2, .panel h3 { margin-top: 0; font-family: var(--serif); }
.panel p, .panel li { color: var(--muted); }
.list { list-style: none; padding: 0; margin: 18px 0 0; }
.list li { border-top: 1px solid var(--line); padding: 12px 0 12px 24px; position: relative; }
.list li::before { content: '◇'; color: var(--gold); position: absolute; left: 0; }
.notice { padding: 16px 18px; border-left: 2px solid var(--gold); background: rgba(232, 184, 102, .06); color: var(--muted); }
.notice strong { color: var(--ink); }

.footer { padding: 34px 0 50px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.footer .wrap { display: flex; justify-content: space-between; gap: 20px; }
.footer a { color: var(--gold); }

.pagehead { padding: 68px 0 40px; }
.pagehead h1 { margin: 16px 0 12px; font: 44px/1.08 var(--serif); }
.pagehead p { color: var(--muted); max-width: 700px; }
.stack { display: grid; gap: 18px; padding-bottom: 70px; }
.archive-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 20px; }
.archive-link { padding: 16px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; background: rgba(185, 147, 255, .05); }
.archive-link span { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.archive-link:hover { border-color: var(--violet); }
.mono { font-family: var(--mono); }
code { font-family: var(--mono); color: var(--gold); overflow-wrap: anywhere; }
.prose h2 { margin: 34px 0 10px; font: 28px var(--serif); }
.prose h3 { margin: 26px 0 8px; font: 21px var(--serif); }
.prose p, .prose li { color: var(--muted); }
.prose strong { color: var(--ink); }
.prose table { width: 100%; border-collapse: collapse; margin: 18px 0; }
.prose th, .prose td { padding: 12px; text-align: left; border-bottom: 1px solid var(--line); }

.account-shell { min-height: calc(100vh - 76px); display: grid; place-items: center; padding: 48px 0; }
.account-card { width: min(460px, calc(100% - 40px)); }
.field { margin: 20px 0 12px; }
label { display: block; color: var(--muted); font: 11px var(--mono); margin-bottom: 7px; }
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 14px;
  background: rgba(4, 3, 8, .72);
  color: var(--ink);
  font: 15px inherit;
}
.message { min-height: 22px; margin-top: 12px; color: var(--gold); font-size: 13px; }
.hidden { display: none !important; }

.apphead { padding: 50px 0 25px; }
.apphead h1 { font: 42px var(--serif); margin: 10px 0; }
.status-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 24px 0; }
.status-card { padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.status-card small { color: var(--muted); font: 10px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.status-card strong { display: block; margin-top: 8px; font: 20px var(--serif); }
.status-card strong.safe { color: var(--green); }
.empty-state { padding: 46px; border: 1px dashed var(--line-gold); border-radius: 16px; text-align: center; background: rgba(232, 184, 102, .03); }
.empty-state h2 { font: 30px var(--serif); margin: 0 0 10px; }
.empty-state p { color: var(--muted); max-width: 590px; margin: 0 auto; }
.top-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.ritual-shell { padding: 42px 0 72px; }
.ritual-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); gap: 18px; align-items: start; }
.workbench { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); gap: 18px; align-items: start; }
.ritual-panel { padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.ritual-panel h2, .ritual-panel h3 { margin: 0 0 8px; font-family: var(--serif); }
.ritual-panel > p { margin: 0 0 18px; color: var(--muted); }
.ritual-list { display: grid; gap: 10px; }
.ritual-item { border: 1px solid var(--line); padding: 15px; border-radius: 12px; background: rgba(4, 3, 8, .28); }
.ritual-item strong { font-family: var(--serif); font-size: 19px; }
.ritual-item p, .ritual-item small { display: block; margin: 4px 0 0; color: var(--muted); }
.ritual-item .actions { justify-content: flex-start; margin-top: 13px; }
.ritual-form { display: grid; gap: 12px; }
.ritual-form .two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ritual-form .three-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.compact-form { margin-top: 14px; padding-top: 4px; }
textarea, select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 12px 13px;
  background: rgba(4, 3, 8, .72); color: var(--ink); font: inherit;
}
textarea { min-height: 84px; resize: vertical; }
.checkline { display: flex; gap: 9px; align-items: flex-start; color: var(--muted); font-size: 13px; }
.checkline input { width: auto; margin-top: 3px; }
.evidence { font: 11px var(--mono); overflow-wrap: anywhere; color: var(--gold); }
.event-chain { border-left: 1px solid var(--line-gold); margin: 15px 0 0 5px; padding-left: 15px; display: grid; gap: 12px; }
.event-chain article { position: relative; }
.event-chain article::before { content: ''; position: absolute; left: -20px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 9px rgba(232,184,102,.6); }
.kicker { color: var(--gold); font: 10px var(--mono); letter-spacing: .11em; text-transform: uppercase; }
.progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 20px 0; }
.progress.five { grid-template-columns: repeat(5, 1fr); }
.progress div { padding: 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: 12px; }
.progress div.done { color: var(--green); border-color: rgba(117,214,170,.35); }
.toast { position: fixed; z-index: 10; right: 18px; bottom: 18px; max-width: min(420px, calc(100% - 36px)); padding: 13px 16px; border: 1px solid var(--line-gold); border-radius: 10px; background: #1a1224; color: var(--ink); box-shadow: 0 12px 36px rgba(0,0,0,.4); }
details summary { cursor: pointer; color: var(--gold); font: 12px var(--mono); }
.evidence-checks { padding: 4px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(4,3,8,.28); }
.mini-table { display: grid; gap: 6px; margin: 14px 0; }
.mini-table > div { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.outcome { color: var(--muted); font: 10px var(--mono); letter-spacing: .05em; text-transform: uppercase; }
.outcome.followed, .outcome.ready, .outcome.committed { color: var(--green); }
.outcome.broken, .outcome.conflict, .outcome.invalid { color: var(--red); }
.outcome.unresolved { color: var(--gold); }
.score-card { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; align-items: center; padding: 16px; margin: 14px 0; border: 1px solid var(--line-gold); border-radius: 12px; background: rgba(232,184,102,.05); }
.score-card strong { grid-row: 1 / 3; color: var(--gold); font: 34px var(--serif); }
.score-card span { color: var(--ink); font-size: 13px; }
.score-card small { color: var(--muted); }
.finding-list { display: grid; gap: 8px; }
.finding { padding: 11px 13px; border: 1px solid var(--line); border-left-width: 3px; border-radius: 9px; background: rgba(4,3,8,.3); }
.finding.followed { border-left-color: var(--green); }
.finding.broken { border-left-color: var(--red); }
.finding.unresolved { border-left-color: var(--gold); }
.finding.excluded { border-left-color: var(--muted); }
.finding > div { display: flex; gap: 9px; align-items: center; }
.finding p { margin: 6px 0; color: var(--muted); font-size: 12px; }
.finding details code { display: block; margin-top: 8px; white-space: normal; }
.incident { padding: 10px; border-left: 2px solid var(--red); background: rgba(255,143,159,.06); color: var(--muted); }
button:disabled { opacity: .45; cursor: not-allowed; }

@media (max-width: 860px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .grid .card:last-child { grid-column: 1 / -1; }
  .two, .status-grid { grid-template-columns: 1fr; }
  .ritual-grid, .workbench { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .wrap, .narrow { width: min(100% - 28px, 1120px); }
  .nav { height: 66px; }
  .brand-copy small { display: none; }
  .navlinks a:first-child { display: none; }
  .hero { padding: 76px 0 64px; }
  .hero h1 { font-size: 42px; }
  .lede { font-size: 16px; }
  .grid, .archive-links { grid-template-columns: 1fr; }
  .grid .card:last-child { grid-column: auto; }
  .section { padding: 54px 0; }
  .section h2, .pagehead h1 { font-size: 34px; }
  .footer .wrap { display: block; }
  .footer .wrap > * + * { margin-top: 10px; }
  .empty-state { padding: 32px 20px; }
  .ritual-shell { padding-top: 26px; }
  .ritual-panel { padding: 19px; }
  .ritual-form .two-fields { grid-template-columns: 1fr; }
  .ritual-form .three-fields { grid-template-columns: 1fr; }
  .progress, .progress.five { grid-template-columns: 1fr; }
  .score-card { grid-template-columns: 1fr; }
  .score-card strong { grid-row: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
