:root {
  /* warm / earthy core palette */
  --bg: oklch(0.972 0.012 78);
  --surface: oklch(0.995 0.006 86);
  --surface-2: oklch(0.952 0.014 74);
  --ink: oklch(0.28 0.022 58);
  --ink-soft: oklch(0.48 0.022 58);
  --ink-faint: oklch(0.62 0.018 60);
  --line: oklch(0.9 0.016 72);
  --line-strong: oklch(0.84 0.02 70);

  /* accent (clay) */
  --accent: oklch(0.6 0.135 42);
  --accent-press: oklch(0.52 0.135 42);
  --accent-soft: oklch(0.93 0.05 50);
  --accent-ink: oklch(0.42 0.13 42);
  --accent-2: oklch(0.6 0.075 150);
  --accent-3: oklch(0.74 0.1 82);

  /* major badge tones (soft bg + saturated ink) */
  --tone-a-bg: oklch(0.93 0.05 45);   --tone-a-fg: oklch(0.48 0.13 42);
  --tone-b-bg: oklch(0.93 0.045 150); --tone-b-fg: oklch(0.46 0.09 152);
  --tone-c-bg: oklch(0.94 0.055 85);  --tone-c-fg: oklch(0.5 0.1 75);
  --tone-d-bg: oklch(0.93 0.035 240); --tone-d-fg: oklch(0.48 0.08 248);
  --tone-e-bg: oklch(0.93 0.045 350); --tone-e-fg: oklch(0.5 0.11 5);
  --tone-f-bg: oklch(0.93 0.045 195); --tone-f-fg: oklch(0.47 0.08 200);

  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 26px;

  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Plus Jakarta Sans", system-ui, sans-serif;

  --shadow-sm: 0 1px 2px oklch(0.4 0.03 60 / 0.06), 0 2px 6px oklch(0.4 0.03 60 / 0.05);
  --shadow-md: 0 4px 14px oklch(0.4 0.03 60 / 0.08), 0 12px 30px oklch(0.4 0.03 60 / 0.07);
  --shadow-lg: 0 10px 24px oklch(0.4 0.03 60 / 0.1), 0 30px 60px oklch(0.4 0.03 60 / 0.1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
}
/* display:contents lets our injected screens act as direct flex children of app-root */
#root { display: contents; }
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }

.app-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* subtle warm texture via layered radial tints */
.app-bg {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 50% at 85% -5%, var(--accent-soft) 0%, transparent 60%),
    radial-gradient(50% 45% at -5% 105%, oklch(0.94 0.04 150) 0%, transparent 55%),
    var(--bg);
  opacity: 0.85;
}

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(18px, 5vw, 56px);
  max-width: 1120px; width: 100%; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px;
  background: var(--accent); position: relative; flex: none;
  box-shadow: var(--shadow-sm);
}
.brand-mark::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface);
}
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: -0.02em; }
.tag-pill {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent-ink); background: var(--accent-soft);
  padding: 5px 10px; border-radius: 999px;
}

/* ---------- shared layout ---------- */
.stage {
  flex: 1; width: 100%; max-width: 1120px; margin: 0 auto;
  padding: 8px clamp(18px, 5vw, 56px) 64px;
}
.narrow { max-width: 680px; margin: 0 auto; }

/* quiz fit-to-viewport (step mode never scrolls) */
.app-root.quiz-fit { height: 100dvh; overflow: hidden; }
.stage.quiz-narrow {
  max-width: 680px; flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  padding-top: 6px; padding-bottom: 20px;
}
.q-fill { flex: 1; min-height: 0; overflow-y: auto; display: flex; }
.q-fill > .q-card { margin: auto; width: 100%; }

.eyebrow {
  font-size: 12.5px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent-ink);
}
/* refined intro chip (welcome) */
.eyebrow-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink-soft); box-shadow: var(--shadow-sm);
  padding: 7px 14px 7px 11px; border-radius: 999px;
  font-size: 13px; font-weight: 700; letter-spacing: -0.005em;
}
.eyebrow-chip .ec-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.eyebrow-chip strong { color: var(--ink); font-weight: 800; }
h1.display {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(34px, 6vw, 60px); line-height: 1.02; letter-spacing: -0.025em;
  margin: 14px 0 0; text-wrap: balance;
}
.lede { font-size: clamp(17px, 2.4vw, 20px); color: var(--ink-soft); margin-top: 18px; max-width: 30em; text-wrap: pretty; }

/* ---------- buttons ---------- */
.btn {
  border: none; border-radius: 999px; font-weight: 700; font-size: 16px;
  padding: 15px 28px; transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
  display: inline-flex; align-items: center; gap: 10px;
}
.btn-primary { background: var(--accent); color: oklch(0.99 0.01 80); box-shadow: 0 6px 0 var(--accent-press); }
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:active { transform: translateY(3px); box-shadow: 0 3px 0 var(--accent-press); }
.btn-ghost { background: transparent; color: var(--ink-soft); padding: 12px 18px; }
.btn-ghost:hover { color: var(--ink); }
.btn-soft { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.btn-soft:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn[disabled] { opacity: 0.45; pointer-events: none; box-shadow: none; }

.meta-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; color: var(--ink-faint); font-size: 14px; font-weight: 600; margin-top: 26px; }
.meta-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--line-strong); }

/* ---------- welcome ---------- */
.welcome-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center; padding-top: clamp(20px, 5vh, 56px); }
@media (max-width: 880px) { .welcome-grid { grid-template-columns: 1fr; gap: 36px; } }

.cta-row { display: flex; align-items: center; gap: 8px; margin-top: 34px; flex-wrap: wrap; }

.preview-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 26px; position: relative;
  transform: rotate(1.4deg);
}
.preview-card .pc-q { font-family: var(--font-display); font-weight: 600; font-size: 20px; line-height: 1.2; letter-spacing: -0.01em; }
.pc-scale { display: flex; flex-direction: column; gap: 9px; margin-top: 18px; }
.pc-opt { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 14.5px; font-weight: 600; color: var(--ink-soft); display: flex; align-items: center; gap: 11px; }
.pc-opt.sel { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.pc-radio { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none; }
.pc-opt.sel .pc-radio { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px var(--surface); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 64px; }
@media (max-width: 720px) { .steps { grid-template-columns: 1fr; } }
.step-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); }
.step-num { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--accent-ink); width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); display: grid; place-items: center; }
.step-card h3 { font-family: var(--font-display); font-size: 18px; margin: 14px 0 6px; letter-spacing: -0.01em; }
.step-card p { margin: 0; color: var(--ink-soft); font-size: 14.5px; }

/* ---------- quiz ---------- */
.quiz-head { position: sticky; top: 0; z-index: 5; background: color-mix(in oklch, var(--bg) 86%, transparent); backdrop-filter: blur(8px); padding: 14px 0 16px; }
.quiz-head-inner { display: flex; align-items: center; gap: 16px; }
.progress-track { flex: 1; height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent-3), var(--accent)); border-radius: 999px; transition: width .4s cubic-bezier(.2,.8,.2,1); }
.progress-label { font-size: 13.5px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.iconbtn { border: 1px solid var(--line); background: var(--surface); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-soft); font-size: 18px; flex: none; box-shadow: var(--shadow-sm); }
.iconbtn:hover { color: var(--ink); transform: translateY(-1px); }
.iconbtn[disabled] { opacity: .35; pointer-events: none; }

.q-card { text-align: center; padding: 8px 0; }
.q-count { font-size: 13px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-ink); }
.q-text { font-family: var(--font-display); font-weight: 600; font-size: clamp(24px, 4.4vw, 38px); line-height: 1.12; letter-spacing: -0.02em; margin: 16px auto 0; max-width: 16em; text-wrap: balance; }

/* agree button scale */
.agree-scale { display: flex; flex-direction: column; gap: 10px; max-width: 460px; margin: 30px auto 0; }
.agree-opt {
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; font-size: 16px; font-weight: 700; color: var(--ink);
  display: flex; align-items: center; gap: 14px; text-align: left;
  transition: transform .12s ease, border-color .15s, background .15s, box-shadow .2s;
}
.agree-opt:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.agree-opt .dot { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--line-strong); flex: none; transition: all .15s; }
.agree-opt.sel { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.agree-opt.sel .dot { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 4px var(--accent-soft); }
.agree-opt .emoji { margin-left: auto; font-size: 15px; font-weight: 800; color: var(--ink-faint); }
.agree-opt.sel .emoji { color: var(--accent-ink); }

/* ---------- results ---------- */
.res-eyebrow { text-align: center; margin-top: 8px; }
.hero-major {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: clamp(26px, 4vw, 44px); margin-top: 22px;
  display: grid; grid-template-columns: auto 1fr auto; gap: clamp(20px, 4vw, 40px); align-items: center;
}
@media (max-width: 720px) { .hero-major { grid-template-columns: 1fr; text-align: center; justify-items: center; gap: 18px; } }
.badge {
  width: 84px; height: 84px; border-radius: 24px; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 34px; flex: none;
}
.badge.sm { width: 52px; height: 52px; border-radius: 15px; font-size: 21px; }
.tone-a { background: var(--tone-a-bg); color: var(--tone-a-fg); }
.tone-b { background: var(--tone-b-bg); color: var(--tone-b-fg); }
.tone-c { background: var(--tone-c-bg); color: var(--tone-c-fg); }
.tone-d { background: var(--tone-d-bg); color: var(--tone-d-fg); }
.tone-e { background: var(--tone-e-bg); color: var(--tone-e-fg); }
.tone-f { background: var(--tone-f-bg); color: var(--tone-f-fg); }

.hm-name { font-family: var(--font-display); font-weight: 700; font-size: clamp(26px, 4vw, 40px); letter-spacing: -0.02em; line-height: 1.04; }
.hm-tag { color: var(--ink-soft); margin-top: 8px; font-size: 16px; max-width: 34em; }
.hm-why { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.trait-chip { font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--line); }
.match-ring { display: grid; place-items: center; }
.ring { position: relative; width: 116px; height: 116px; }
.ring svg { transform: rotate(-90deg); }
.ring .pct { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.ring .pct .num { font-family: var(--font-display); font-weight: 700; font-size: 30px; letter-spacing: -0.02em; white-space: nowrap; color: var(--ink); }
.ring .pct small { font-size: 12px; font-weight: 700; color: var(--ink-faint); margin-top: 5px; letter-spacing: 0.02em; }

.section-title { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -0.01em; margin: 40px 0 16px; display: flex; align-items: center; gap: 10px; }
.section-title .st-line { flex: 1; height: 1px; background: var(--line); }

.runners { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.runner {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-sm); text-align: left; display: flex; gap: 14px; align-items: center;
  transition: transform .14s ease, box-shadow .2s, border-color .15s; width: 100%;
}
.runner:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.runner.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow-md); }
.runner .r-name { font-family: var(--font-display); font-weight: 700; font-size: 16px; line-height: 1.15; letter-spacing: -0.01em; }
.runner .r-pct { font-size: 13px; font-weight: 700; color: var(--ink-faint); margin-top: 3px; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.info-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.career-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.career-row:last-child { border-bottom: none; }
.career-row .c-title { font-weight: 700; font-size: 15px; }
.career-row .c-pay { font-family: var(--font-display); font-weight: 700; color: var(--accent-ink); font-size: 15px; white-space: nowrap; }

.res-link { display: flex; align-items: center; gap: 13px; padding: 13px 0; border-bottom: 1px dashed var(--line); text-decoration: none; }
.res-link:last-child { border-bottom: none; }
.res-link:hover .rl-name { color: var(--accent-ink); }
.rl-ico { width: 38px; height: 38px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; flex: none; font-weight: 800; font-family: var(--font-display); }
.rl-name { font-weight: 700; font-size: 15px; }
.rl-org { font-size: 13px; color: var(--ink-faint); }
.rl-arrow { margin-left: auto; color: var(--ink-faint); transition: transform .15s; }
.res-link:hover .rl-arrow { transform: translate(2px, -2px); color: var(--accent-ink); }

.person { display: flex; align-items: center; gap: 13px; padding: 11px 0; }
.person .p-av { width: 42px; height: 42px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; color: var(--ink-soft); flex: none; }
.person .p-name { font-weight: 700; font-size: 15px; }
.person .p-note { font-size: 13px; color: var(--ink-faint); }

.res-actions { display: flex; gap: 10px; justify-content: center; margin-top: 48px; flex-wrap: wrap; }

.detail-head { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.detail-head .dh-name { font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: -0.01em; }
.detail-head .dh-sub { font-size: 13.5px; color: var(--ink-faint); }

.detail-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 760px) { .detail-cols { grid-template-columns: 1fr; } }

/* animation helpers */
@keyframes pop-in { 0% { opacity: 0; transform: translateY(14px) scale(.985); } 100% { opacity: 1; transform: none; } }
.anim .pop { animation: pop-in .42s cubic-bezier(.2,.8,.2,1) both; }
.anim .pop-2 { animation: pop-in .42s cubic-bezier(.2,.8,.2,1) .08s both; }
.anim .pop-3 { animation: pop-in .42s cubic-bezier(.2,.8,.2,1) .16s both; }
@keyframes fade-swap { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
.anim .swap { animation: fade-swap .3s ease both; }

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
