/* Private Finance — onboarding wizard chrome
   Neutral surface so it doesn't prejudice the A/B design pick.
   Same type family + restraint as the product directions; quieter accent.
*/

:root {
  --paper:        #FBF9F4;
  --paper-2:      #FFFFFF;
  --paper-3:      #F4F1EA;
  --paper-warm:   #EFEBE1;

  --ink:          #16161A;
  --ink-2:        #2A2A2E;
  --ink-3:        #5A5A60;
  --ink-4:        #8E8E94;
  --ink-5:        #B8B7B0;

  --rule:         #E4E1D8;
  --rule-2:       #EFECE3;
  --rule-strong:  #D2CEC2;
  --hover:        rgba(22, 22, 26, 0.035);

  /* neutral accent — slate, not moss, not gold */
  --accent:       #2C3742;
  --accent-ink:   #1B232C;
  --accent-tint:  rgba(44, 55, 66, 0.08);
  --accent-soft:  rgba(44, 55, 66, 0.04);

  /* state colours — only when carrying meaning */
  --pos:          #4A7C59;
  --neg:          #8B3A3A;
  --warn:         #B8956A;

  --shadow-card:  0 1px 2px rgba(0, 0, 0, 0.025), 0 0 0 1px var(--rule);
  --shadow-cta:   0 1px 3px rgba(44, 55, 66, 0.18);

  --radius:       2px;
  --max-text:     680px;
  --max-stage:    920px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter Tight", system-ui, -apple-system, sans-serif;
  font-feature-settings: "ss01", "cv11", "tnum";
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
}

::selection { background: var(--accent-tint); color: var(--ink); }

a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-tint); }
a:hover { border-bottom-color: var(--accent); }

.mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-feature-settings: "tnum";
}
.serif {
  font-family: "Newsreader", "Source Serif Pro", Georgia, serif;
  font-feature-settings: "ss01";
}

/* ─── chrome ─────────────────────────────────────────── */

.chrome {
  position: sticky; top: 0; z-index: 20;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.chrome-inner {
  max-width: var(--max-stage);
  margin: 0 auto;
  padding: 18px 32px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
}
.chrome .brand {
  display: inline-flex; align-items: baseline; gap: 12px;
  font-family: "Newsreader", serif;
  font-size: 17px; font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.chrome .brand::before {
  content: ""; width: 7px; height: 7px;
  background: var(--accent); border-radius: 50%;
  transform: translateY(-2px);
  display: inline-block;
}
.chrome .brand em {
  font-family: "JetBrains Mono", monospace;
  font-style: normal; font-size: 10px;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-4);
}
.chrome .meta {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px; color: var(--ink-4);
  letter-spacing: 0.1em; text-transform: uppercase;
  display: inline-flex; gap: 18px; align-items: center;
}
.chrome .meta .saved {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--ink-3);
}
.chrome .meta .saved::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--pos);
}
.chrome .meta .saved.unsaved::before { background: var(--warn); }
.chrome .meta .saved.error::before { background: var(--neg); }

/* ─── progress ───────────────────────────────────────── */

.progress {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.progress-inner {
  max-width: var(--max-stage);
  margin: 0 auto;
  padding: 14px 32px 18px;
  display: flex; align-items: center; gap: 4px;
  overflow-x: auto;
}
.progress-step {
  flex: 1 1 0;
  min-width: 70px;
  display: flex; flex-direction: column; gap: 6px;
  cursor: pointer;
  border: 0; background: transparent; padding: 0;
  text-align: left;
  font-family: inherit;
  color: var(--ink-4);
  transition: color 200ms ease-out;
}
.progress-step:hover:not(:disabled) { color: var(--ink-3); }
.progress-step:disabled { cursor: default; }
.progress-step .bar {
  height: 3px; background: var(--rule);
  border-radius: 1px;
  transition: background 200ms ease-out;
}
.progress-step.done .bar { background: var(--accent); }
.progress-step.current .bar { background: var(--accent); }
.progress-step.current { color: var(--ink); }
.progress-step .label {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.progress-step .num {
  color: var(--ink-5); margin-right: 6px;
}
.progress-step.done .num,
.progress-step.current .num { color: var(--accent); }

/* ─── stage container ────────────────────────────────── */

main.stage {
  max-width: var(--max-stage);
  margin: 0 auto;
  padding: 64px 32px 96px;
}

.stage-eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-4);
  margin-bottom: 24px;
  display: flex; align-items: center; gap: 12px;
}
.stage-eyebrow .rule {
  width: 28px; height: 1px;
  background: var(--rule-strong);
}

.stage-headline {
  font-family: "Newsreader", serif;
  font-weight: 400;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.05;
  letter-spacing: -0.018em;
  margin: 0 0 24px;
  color: var(--ink);
  text-wrap: balance;
  max-width: var(--max-text);
}
.stage-headline em { font-style: italic; color: var(--ink-2); }

.stage-lede {
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-3);
  max-width: var(--max-text);
  margin: 0 0 48px;
  text-wrap: pretty;
}

.stage-footnote {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-4);
  max-width: var(--max-text);
  margin-top: 36px;
  line-height: 1.6;
}

/* ─── question blocks ────────────────────────────────── */

.q {
  border-top: 1px solid var(--rule);
  padding: 36px 0;
  max-width: var(--max-text);
}
.q:first-of-type { border-top: 0; padding-top: 0; }

.q-label {
  font-family: "Newsreader", serif;
  font-size: 22px;
  line-height: 1.3;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 10px;
  text-wrap: pretty;
}
.q-help {
  font-size: 14px; color: var(--ink-3);
  margin: 0 0 22px;
  line-height: 1.55;
  text-wrap: pretty;
}
.q-recommendation {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; letter-spacing: 0.04em;
  color: var(--ink-3);
  margin: 14px 0 0;
  padding: 8px 0 0;
  border-top: 1px dashed var(--rule);
}
.q-recommendation::before {
  content: "Lukman's read · ";
  color: var(--ink-4);
}

/* ─── option lists ───────────────────────────────────── */

.opts { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }

.opt {
  display: block;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-2);
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color 150ms ease-out, background 150ms ease-out;
}
.opt:hover { border-color: var(--rule-strong); background: var(--paper-3); }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.opt:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.opt-row {
  display: flex; align-items: flex-start; gap: 14px;
}
.opt-marker {
  flex: 0 0 auto;
  width: 18px; height: 18px;
  border: 1.5px solid var(--ink-4);
  border-radius: 50%;
  margin-top: 2px;
  display: grid; place-items: center;
  transition: border-color 150ms;
}
.opt[data-kind="checkbox"] .opt-marker { border-radius: var(--radius); }
.opt:has(input:checked) .opt-marker {
  border-color: var(--accent);
}
.opt:has(input:checked) .opt-marker::after {
  content: "";
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
}
.opt[data-kind="checkbox"]:has(input:checked) .opt-marker::after {
  border-radius: 1px;
}
.opt-text { flex: 1 1 auto; min-width: 0; }
.opt-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
}
.opt-sub {
  font-size: 13px; color: var(--ink-3);
  margin-top: 4px;
  line-height: 1.5;
  text-wrap: pretty;
}
.opt-text-input {
  display: block;
  margin-top: 12px;
  width: 100%;
  border: 0; border-bottom: 1px solid var(--rule-strong);
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  padding: 6px 0;
}
.opt-text-input:focus {
  outline: none;
  border-bottom-color: var(--accent);
}
.opt-text-input::placeholder { color: var(--ink-4); }

textarea.free {
  width: 100%;
  min-height: 96px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-2);
  padding: 14px 16px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  resize: vertical;
  transition: border-color 150ms;
}
textarea.free:focus {
  outline: none;
  border-color: var(--accent);
}
textarea.free::placeholder { color: var(--ink-4); }

.q-followup {
  margin-top: 18px;
}
.q-followup-label {
  display: block;
  font-size: 13px; color: var(--ink-3);
  margin-bottom: 8px;
}

/* ─── design pick stage ──────────────────────────────── */

.dp {
  max-width: var(--max-stage);
}
.dp-toggle {
  display: inline-flex;
  background: var(--paper-3);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 24px;
  gap: 4px;
}
.dp-toggle button {
  border: 0; background: transparent;
  font-family: inherit; font-size: 13px; font-weight: 500;
  color: var(--ink-3);
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 150ms, color 150ms;
}
.dp-toggle button:hover { color: var(--ink); }
.dp-toggle button.active {
  background: var(--paper-2);
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--rule);
}

.dp-desc {
  font-family: "Newsreader", serif;
  font-size: 17px;
  font-style: italic;
  color: var(--ink-3);
  max-width: var(--max-text);
  margin-bottom: 28px;
  line-height: 1.55;
  text-wrap: pretty;
}

.dp-screens {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0;
}
.dp-tab {
  border: 0; background: transparent;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 150ms, border-color 150ms;
}
.dp-tab:hover { color: var(--ink-2); }
.dp-tab.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}
.dp-tab .num { color: var(--ink-5); margin-right: 6px; }
.dp-tab.active .num { color: var(--accent); }

.dp-frame-wrap {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-3);
  overflow: hidden;
  margin-bottom: 16px;
  transition: background 150ms;
}
.dp-frame-wrap[data-viewport="mobile"] {
  padding: 18px;
  display: grid; place-items: center;
  background: var(--paper-warm);
}
.dp-frame {
  display: block;
  width: 100%;
  height: 720px;
  border: 0;
  background: var(--paper-2);
}
.dp-frame-wrap[data-viewport="mobile"] .dp-frame {
  width: min(100%, 460px);
  height: 920px;
  background: transparent;
}

.dp-react {
  display: flex; flex-wrap: wrap;
  align-items: center; gap: 14px;
  padding: 14px 0 24px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 28px;
}
.dp-react .react-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-right: 4px;
}
.dp-react-btn {
  border: 1px solid var(--rule-strong);
  background: var(--paper-2);
  border-radius: var(--radius);
  padding: 8px 14px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 8px;
  transition: border-color 150ms, background 150ms;
}
.dp-react-btn:hover { border-color: var(--ink-4); }
.dp-react-btn.active[data-react="up"] {
  border-color: var(--pos);
  color: var(--pos);
  background: rgba(74, 124, 89, 0.06);
}
.dp-react-btn.active[data-react="down"] {
  border-color: var(--neg);
  color: var(--neg);
  background: rgba(139, 58, 58, 0.06);
}
.dp-react input[type=text] {
  flex: 1 1 240px;
  min-width: 0;
  border: 0; border-bottom: 1px solid var(--rule-strong);
  background: transparent;
  font-family: inherit; font-size: 13px;
  color: var(--ink);
  padding: 6px 0;
}
.dp-react input[type=text]:focus {
  outline: none;
  border-bottom-color: var(--accent);
}
.dp-react input[type=text]::placeholder { color: var(--ink-4); }

/* ─── nav (continue / back) ──────────────────────────── */

.nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  gap: 16px;
}
.nav .left { display: flex; align-items: center; gap: 16px; }
.nav .right { display: flex; align-items: center; gap: 16px; }
.btn {
  font-family: inherit; font-size: 14px; font-weight: 500;
  padding: 12px 22px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 150ms, border-color 150ms, color 150ms;
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid transparent;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary {
  background: var(--accent);
  color: var(--paper);
  box-shadow: var(--shadow-cta);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-ink);
}
.btn-ghost {
  background: transparent;
  color: var(--ink-3);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) {
  color: var(--ink);
  background: var(--hover);
}
.btn-ghost.back::before { content: "←"; opacity: 0.6; }
.btn-primary.next::after { content: "→"; opacity: 0.85; }

.nav-hint {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px; letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
}

/* ─── intro / outro stages ───────────────────────────── */

.intro-meta,
.outro-meta {
  display: flex; flex-wrap: wrap; gap: 36px;
  margin: 32px 0 24px;
  padding: 24px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.intro-meta .item,
.outro-meta .item { display: flex; flex-direction: column; gap: 4px; }
.intro-meta .item .k,
.outro-meta .item .k {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.intro-meta .item .v,
.outro-meta .item .v {
  font-family: "Newsreader", serif;
  font-size: 18px; color: var(--ink-2);
  font-weight: 500;
}

/* outro summary */
.outro-summary {
  margin-top: 36px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-2);
  overflow: hidden;
}
.outro-summary summary {
  padding: 16px 20px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  cursor: pointer;
  list-style: none;
}
.outro-summary summary::-webkit-details-marker { display: none; }
.outro-summary summary::after {
  content: " ▾";
  color: var(--ink-4);
}
.outro-summary[open] summary::after { content: " ▴"; }
.outro-summary-body {
  padding: 0 20px 20px;
  border-top: 1px solid var(--rule);
}
.outro-summary-body dl {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(150px, max-content) 1fr;
  gap: 12px 24px;
  padding-top: 18px;
}
.outro-summary-body dt {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px; letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
  align-self: start;
}
.outro-summary-body dd {
  margin: 0; color: var(--ink-2);
  font-size: 14px; line-height: 1.5;
}
.outro-summary-body dd em {
  font-style: italic; color: var(--ink-3);
}

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

@media (max-width: 720px) {
  .chrome-inner { padding: 14px 18px; }
  .chrome .meta { font-size: 9.5px; gap: 10px; }
  .progress-inner { padding: 12px 18px 14px; gap: 2px; }
  .progress-step { min-width: 56px; }
  .progress-step .label { font-size: 9px; letter-spacing: 0.08em; }
  main.stage { padding: 40px 18px 64px; }
  .stage-headline { font-size: clamp(28px, 8vw, 38px); }
  .stage-lede { font-size: 16px; margin-bottom: 36px; }
  .q-label { font-size: 19px; }
  .dp-frame { height: 540px; }
  .dp-frame-wrap[data-viewport="mobile"] .dp-frame { height: 800px; }
  .dp-tab { padding: 10px 10px; font-size: 10px; }
  .nav { flex-wrap: wrap; }
  .nav .left, .nav .right { flex: 1; }
  .btn { padding: 10px 18px; font-size: 13.5px; }
}

@media (max-width: 480px) {
  .progress-step .label .num { display: none; }
  .dp-frame { height: 480px; }
  .dp-frame-wrap[data-viewport="mobile"] .dp-frame { height: 720px; }
  .intro-meta, .outro-meta { gap: 24px; }
}

/* hide stages not active */
.stage-panel { display: none; }
.stage-panel.active { display: block; animation: fade 240ms ease-out; }

@keyframes fade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* utility */
.hidden { display: none !important; }
