:root {
  --ground: #e8ecf1; --surface: #f6f8fb; --raised: #fff; --line: #cdd6e0; --line-soft: #dbe2ea;
  --ink: #11161d; --ink-2: #3c4653; --muted: #6b7684; --faint: #98a3b1;
  --amber: #b45c07; --amber-ink: #7a3d03; --amber-wash: #f5e6cf; --blue: #205e86; --blue-wash: #dbe8f1;
  --good: #2f7d55; --warn: #b06a10; --crit: #b03a30;
  --good-wash: #d9ebe0; --warn-wash: #f3e6cf; --crit-wash: #f2dcd9;
  --shadow: 0 1px 2px rgba(17,22,29,.06), 0 8px 30px rgba(17,22,29,.08);
  --shadow-lg: 0 2px 6px rgba(17,22,29,.08), 0 24px 60px rgba(17,22,29,.14);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --r: 14px; --r-sm: 9px; --maxw: 860px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground:#0b0f15; --surface:#121924; --raised:#18212e; --line:#2a3646; --line-soft:#212c3a;
    --ink:#e4ebf3; --ink-2:#b7c2cf; --muted:#8593a3; --faint:#5f6d7d;
    --amber:#f4b45a; --amber-ink:#f8cd8a; --amber-wash:#2a2013; --blue:#6fb2d6; --blue-wash:#16242f;
    --good:#5bbd8a; --warn:#e0a24e; --crit:#e07a6f;
    --good-wash:#14251c; --warn-wash:#2a2114; --crit-wash:#2a1816;
    --shadow:0 1px 2px rgba(0,0,0,.4),0 10px 34px rgba(0,0,0,.45);
    --shadow-lg:0 2px 8px rgba(0,0,0,.5),0 28px 70px rgba(0,0,0,.6);
  }
}
:root[data-theme="light"] {
  --ground:#e8ecf1; --surface:#f6f8fb; --raised:#fff; --line:#cdd6e0; --line-soft:#dbe2ea;
  --ink:#11161d; --ink-2:#3c4653; --muted:#6b7684; --faint:#98a3b1;
  --amber:#b45c07; --amber-ink:#7a3d03; --amber-wash:#f5e6cf; --blue:#205e86; --blue-wash:#dbe8f1;
  --good:#2f7d55; --warn:#b06a10; --crit:#b03a30; --good-wash:#d9ebe0; --warn-wash:#f3e6cf; --crit-wash:#f2dcd9;
  --shadow:0 1px 2px rgba(17,22,29,.06),0 8px 30px rgba(17,22,29,.08);
  --shadow-lg:0 2px 6px rgba(17,22,29,.08),0 24px 60px rgba(17,22,29,.14);
}
:root[data-theme="dark"] {
  --ground:#0b0f15; --surface:#121924; --raised:#18212e; --line:#2a3646; --line-soft:#212c3a;
  --ink:#e4ebf3; --ink-2:#b7c2cf; --muted:#8593a3; --faint:#5f6d7d;
  --amber:#f4b45a; --amber-ink:#f8cd8a; --amber-wash:#2a2013; --blue:#6fb2d6; --blue-wash:#16242f;
  --good:#5bbd8a; --warn:#e0a24e; --crit:#e07a6f; --good-wash:#14251c; --warn-wash:#2a2114; --crit-wash:#2a1816;
  --shadow:0 1px 2px rgba(0,0,0,.4),0 10px 34px rgba(0,0,0,.45);
  --shadow-lg:0 2px 8px rgba(0,0,0,.5),0 28px 70px rgba(0,0,0,.6);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--ground); }
.page {
  min-height: 100vh;
  background:
    linear-gradient(var(--line-soft) 1px, transparent 1px) 0 0 / 100% 34px,
    var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding: 0 20px 80px;
}
.wrap { max-width: var(--maxw); margin: 0 auto; }

.eyebrow { font-family: var(--mono); font-size: 11.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin: 0; }
h1,h2,h3 { text-wrap: balance; margin: 0; letter-spacing: -.02em; }
h1 { font-size: clamp(2rem, 5.2vw, 3.1rem); font-weight: 800; line-height: 1.03; }
h2 { font-size: clamp(1.35rem, 3vw, 1.8rem); font-weight: 750; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0; }
.lede { font-size: clamp(1.02rem, 1.6vw, 1.16rem); color: var(--ink-2); max-width: 58ch; }
.small { font-size: 13px; color: var(--muted); }
.data { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.amber { color: var(--amber); }
a { color: var(--amber); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 4px; }

/* top / foot */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 26px 0 18px; border-bottom: 1px solid var(--line); }
.brandmark { font-family: var(--mono); font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 9px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px var(--amber-wash); }
.icon-btn { font: inherit; cursor: pointer; background: var(--surface); border: 1px solid var(--line); color: var(--ink); border-radius: 8px; width: 36px; height: 34px; }
.icon-btn:hover { border-color: var(--amber); }
.sitefoot { margin-top: 54px; border-top: 1px solid var(--line); padding-top: 20px; display: flex; flex-wrap: wrap; gap: 6px 20px; justify-content: space-between; }
.linklike { background: none; border: none; color: var(--amber); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }
.sitefoot a.book-link { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--amber); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.sitefoot a.book-link:hover { color: var(--amber); }

/* step progress */
.steps { display: flex; gap: 8px; margin: 26px 0 8px; }
.steps i { height: 4px; flex: 1; border-radius: 3px; background: var(--line-soft); }
.steps i.on { background: var(--amber); }
.steps i.done { background: var(--amber); opacity: .55; }

/* generic card / buttons */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 30px; margin-top: 18px; }
.btn { font-family: var(--sans); font-weight: 650; font-size: 15px; border: none; border-radius: 10px; padding: 13px 22px; cursor: pointer; background: var(--amber); color: #1a1206; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover:not(:disabled) { border-color: var(--amber); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spread { justify-content: space-between; }
.mt { margin-top: 22px; } .mt-s { margin-top: 12px; }

/* hero */
.hero { padding: 40px 0 6px; }
.hero h1 { margin: 12px 0 14px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.tag { font-family: var(--mono); font-size: 11.5px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); background: var(--surface); }
.stat-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 26px; }
.stat { border: 1px solid var(--line-soft); border-radius: var(--r-sm); padding: 13px 16px; background: var(--raised); }
.stat .n { font-family: var(--mono); font-size: 1.5rem; font-weight: 700; color: var(--amber); }
.stat .l { font-size: 12.5px; color: var(--muted); }

/* profiles */
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
@media (max-width: 640px){ .grid-3 { grid-template-columns: 1fr 1fr; } }
.choice { text-align: left; cursor: pointer; background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 18px; font: inherit; color: inherit; transition: border-color .15s, transform .15s; }
.choice:hover { border-color: var(--amber); transform: translateY(-2px); }
.choice.sel { border-color: var(--amber); background: var(--amber-wash); }
.choice .ico { font-size: 22px; }
.choice h3 { margin: 8px 0 4px; }
.choice p { font-size: 12.5px; color: var(--muted); }

/* axis selectors */
.axis { margin-top: 22px; }
.axis > .eyebrow { margin-bottom: 10px; }
.opts3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
@media (max-width: 620px){ .opts3 { grid-template-columns: 1fr; } }
.opt3 { text-align: left; cursor: pointer; background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 13px 15px; font: inherit; color: inherit; transition: border-color .12s, background .12s; }
.opt3:hover { border-color: var(--amber); }
.opt3.sel { border-color: var(--amber); background: var(--amber-wash); }
.opt3 .t { font-weight: 650; }
.opt3 .s { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* recommendation readout */
.reco { margin-top: 22px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--raised); padding: 18px; }
.mode-chip { display: inline-block; font-family: var(--mono); font-weight: 700; font-size: 13px; padding: 4px 10px; border-radius: 6px; }
.mode-chip.A { background: var(--blue-wash); color: var(--blue); }
.mode-chip.B { background: var(--good-wash); color: var(--good); }
.mode-chip.C { background: var(--warn-wash); color: var(--warn); }
.reco .desc { color: var(--ink-2); font-size: 14px; margin-top: 10px; }
.reco .veto-note { margin-top: 10px; font-size: 12.5px; color: var(--crit); font-family: var(--mono); }

/* questionnaire */
.q-block { color: var(--amber); }
.q-item h2 { margin: 8px 0 22px; font-size: clamp(1.25rem,2.6vw,1.6rem); font-weight: 700; max-width: 34ch; }
.q-opts { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
@media (max-width: 620px){ .q-opts { grid-template-columns: 1fr; } }
.opt { text-align: left; cursor: pointer; background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 15px 16px; font: inherit; color: inherit; transition: border-color .12s, background .12s; }
.opt:hover { border-color: var(--amber); }
.opt.sel { border-color: var(--amber); background: var(--amber-wash); }
.opt .v { font-family: var(--mono); font-size: 12px; color: var(--amber); }
.opt .t { font-weight: 600; margin-top: 3px; }
.q-count { font-size: 13px; color: var(--muted); }

/* result */
.result-lay { display: grid; grid-template-columns: 380px 1fr; gap: 28px; align-items: start; }
@media (max-width: 820px){ .result-lay { grid-template-columns: 1fr; } }

.card {
  position: relative; border-radius: 18px; padding: 26px; color: #f4ede0;
  background: radial-gradient(120% 90% at 100% 0%, rgba(244,180,90,.18), transparent 55%), linear-gradient(160deg, #182231 0%, #0d1420 70%);
  border: 1px solid #2a3648; box-shadow: var(--shadow-lg); overflow: hidden;
}
.card::before { content:""; position:absolute; inset:0; background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px); background-size: 26px 26px; pointer-events: none; }
.card > * { position: relative; }
.card .kicker { font-family: var(--mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: #8fa3b8; }
.card .mode-big { font-family: var(--mono); font-size: 13px; letter-spacing: .16em; color: #f4b45a; margin-top: 16px; }
.card .arch { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.06; margin: 4px 0 4px; color: #fff; }
.card .arch-sub { color: #b9c6d4; font-size: 13.5px; }
.gauge { display: flex; align-items: center; gap: 18px; margin: 22px 0 18px; padding: 16px 0; border-top: 1px solid rgba(255,255,255,.09); border-bottom: 1px solid rgba(255,255,255,.09); }
.dial { --p: 0; width: 84px; height: 84px; flex: none; border-radius: 50%; background: conic-gradient(#f4b45a calc(var(--p)*1%), rgba(255,255,255,.12) 0); display: grid; place-items: center; transition: background 1s ease; }
.dial .inner { width: 64px; height: 64px; border-radius: 50%; background: #0d1420; display: grid; place-items: center; }
.dial .num { font-family: var(--mono); font-weight: 700; font-size: 1.1rem; color: #fff; }
.dial .num small { color: #8fa3b8; font-size: .7rem; }
.gauge-txt .g-l { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #8fa3b8; }
.gauge-txt .g-v { font-weight: 700; font-size: 14.5px; margin-top: 3px; }
.gauge-txt .g-v.ok { color: #6fcf97; } .gauge-txt .g-v.no { color: #e0a24e; }
.card .cultivate .g-l { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #8fa3b8; }
.virtues { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 9px; }
.virtue { font-family: var(--mono); font-size: 12px; padding: 5px 11px; border-radius: 999px; background: rgba(244,180,90,.14); border: 1px solid rgba(244,180,90,.35); color: #f4c883; }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 22px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.09); }
.card-foot .bk { font-size: 11.5px; color: #8fa3b8; max-width: 22ch; line-height: 1.35; }
.card-foot .hash { font-family: var(--mono); font-size: 12px; color: #f4b45a; }

.share-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 22px; }
.share { font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; border: 1px solid var(--line); background: var(--raised); color: var(--ink); border-radius: 9px; padding: 10px 15px; display: inline-flex; align-items: center; gap: 8px; }
.share:hover { border-color: var(--amber); }
.share.primary { background: var(--amber); color: #1a1206; border-color: var(--amber); }
.todo { display: grid; gap: 10px; }
.todo-item { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line-soft); border-radius: var(--r-sm); padding: 13px 15px; background: var(--raised); }
.todo-item .idx { font-family: var(--mono); font-size: 12px; color: var(--amber); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; flex: none; }
.todo-item .t { font-weight: 650; font-size: 14px; }
.todo-item .d { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.todo-item .ch { font-family: var(--mono); font-size: 11px; color: var(--amber); margin-top: 5px; font-weight: 600; }
.todo-item .vir { font-family: var(--mono); font-size: 11px; color: var(--blue); margin-top: 3px; }
.veto-banner { border: 1px solid var(--crit); background: var(--crit-wash); color: var(--crit); border-radius: var(--r-sm); padding: 13px 16px; font-size: 13.5px; margin-bottom: 16px; }

/* consent */
.consent { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--raised); padding: 16px; margin-top: 18px; }
.consent input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--amber); flex: none; }
.consent label { font-size: 13.5px; color: var(--ink-2); }

.prose { max-width: 62ch; }
.prose p { margin-top: 12px; color: var(--ink-2); }
.prose h2 { margin-top: 4px; }

@media (prefers-reduced-motion: reduce){ * { transition: none !important; } }
