:root {
  color-scheme: light;
  --ink: #0d1226;
  --muted: #5d6270;
  --gold: #f4a73f;
  --gold-dark: #a86108;
  --gold-pale: #fff5e5;
  --paper: #ffffff;
  --soft: #f6f6f3;
  --line: #dfdfda;
  --shadow: 0 20px 60px rgba(13, 18, 38, .09);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}
button { font: inherit; }
button:focus-visible { outline: 3px solid rgba(244, 167, 63, .55); outline-offset: 3px; }
[hidden] { display: none !important; }

.page-shell { min-height: 100vh; display: flex; flex-direction: column; }
.brandbar {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  min-height: 96px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.wordmark { font-family: Georgia, "Times New Roman", serif; letter-spacing: .34em; font-size: .98rem; }
.episode { justify-self: end; font-size: .75rem; font-weight: 800; letter-spacing: .13em; color: var(--gold-dark); }
.brand-mark { position: relative; width: 54px; height: 28px; justify-self: start; }
.brand-mark span { position: absolute; inset: 2px 11px; border: 1px solid rgba(13,18,38,.2); border-radius: 50%; }
.brand-mark span:nth-child(1) { transform: translateX(-8px); }
.brand-mark span:nth-child(3) { transform: translateX(8px); }

main { flex: 1; }
.quiz-layout {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(300px, .85fr) minmax(420px, 1.15fr);
  min-height: calc(100vh - 188px);
}
.intro-panel { padding: clamp(54px, 7vw, 92px) clamp(34px, 6vw, 82px) 54px 0; border-right: 1px solid var(--line); }
.question-panel { padding: clamp(44px, 6vw, 78px) 0 52px clamp(34px, 6vw, 82px); display: flex; flex-direction: column; }
.eyebrow { margin: 0 0 18px; color: var(--gold-dark); font-size: .77rem; font-weight: 850; letter-spacing: .12em; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(2.35rem, 5vw, 4.45rem); line-height: .99; letter-spacing: -.055em; margin-bottom: 28px; max-width: 820px; }
.intro-panel h1 { font-size: clamp(2.3rem, 4vw, 3.65rem); }
.lede { font-size: 1.16rem; color: var(--muted); max-width: 34rem; }
.scale-note { margin-top: 38px; padding: 18px 20px; background: var(--gold-pale); border-left: 4px solid var(--gold); display: grid; gap: 4px; }
.scale-note span { color: var(--muted); }
.key-hint { margin-top: 24px; color: var(--muted); font-size: .84rem; }
.key-hint span { font-weight: 750; color: var(--ink); }

.progress-row { display: flex; justify-content: space-between; font-size: .86rem; font-weight: 750; }
.progress-track { height: 7px; border-radius: 99px; background: var(--soft); margin: 10px 0 38px; overflow: hidden; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--gold); border-radius: inherit; transition: width .22s ease; }
.question-card { flex: 1; }
.question-kicker { font-size: .88rem; color: var(--muted); margin-bottom: 15px; }
.question-card h2 { font-size: clamp(1.65rem, 3vw, 2.35rem); line-height: 1.18; letter-spacing: -.03em; margin-bottom: 30px; }
.answer-options { display: grid; gap: 10px; }
.answer-button {
  width: 100%; min-height: 58px; padding: 14px 17px; border: 1px solid var(--line); border-radius: 13px;
  background: var(--paper); color: var(--ink); cursor: pointer; display: grid; grid-template-columns: 34px 1fr auto;
  align-items: center; gap: 12px; text-align: left; transition: border-color .15s, transform .15s, background .15s;
}
.answer-button:hover { border-color: var(--gold); transform: translateY(-1px); }
.answer-button[aria-checked="true"] { border-color: var(--gold); background: var(--gold-pale); box-shadow: inset 0 0 0 1px var(--gold); }
.answer-number { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--soft); font-weight: 850; }
.answer-button[aria-checked="true"] .answer-number { background: var(--gold); }
.answer-label { font-weight: 720; }
.answer-help { color: var(--muted); font-size: .8rem; }
.quiz-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; }
.primary-button, .secondary-button, .text-button { min-height: 48px; border-radius: 11px; padding: 10px 18px; cursor: pointer; font-weight: 800; }
.primary-button { border: 1px solid var(--ink); background: var(--ink); color: white; }
.primary-button:disabled { opacity: .35; cursor: not-allowed; }
.secondary-button { border: 1px solid var(--ink); background: white; color: var(--ink); }
.text-button { border: 0; background: transparent; color: var(--ink); }
.text-button:disabled { opacity: .3; cursor: not-allowed; }
.danger { color: #8d2c20; }

.results-view { width: min(1090px, calc(100% - 60px)); margin: 0 auto; padding: 58px 0 84px; }
.results-first { margin-top: 0; }
.results-first .recommendations-heading { max-width: 900px; margin: 0 30px 34px; }
.results-first .recommendations-heading h1 { max-width: none; font-size: clamp(2.6rem, 4.6vw, 3.3rem); line-height: 1.08; letter-spacing: -.04em; margin-bottom: 18px; }
.results-first .recommendations-heading > p:last-child { max-width: 820px; font-size: 1.15rem; line-height: 1.5; }
.profile-section { margin-top: 68px; padding-top: 54px; border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-heading h2 { font-size: 1.8rem; margin-bottom: 0; }
.section-heading p { margin-bottom: 0; color: var(--muted); }
.profile-list { display: grid; gap: 10px; }
.profile-card { padding: 15px 18px; border: 1px solid var(--line); border-radius: 14px; display: grid; grid-template-columns: minmax(210px, 1.1fr) minmax(180px, 2fr) auto; gap: 18px; align-items: center; }
.profile-title { font-weight: 820; }
.profile-meta { display: block; color: var(--muted); font-size: .82rem; margin-top: 2px; }
.meter { height: 10px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--gold); border-radius: inherit; }
.profile-score { min-width: 64px; text-align: right; font-size: 1.18rem; font-weight: 850; }
.profile-score small { display: block; font-size: .74rem; color: var(--muted); font-weight: 650; }
.profile-card.insufficient { opacity: .68; }
.recommendations { margin-top: 62px; }
.recommendations-heading { max-width: 760px; margin-bottom: 24px; }
.recommendations-heading h2 { font-size: clamp(2rem, 4vw, 3.15rem); line-height: 1.05; letter-spacing: -.04em; margin-bottom: 13px; }
.recommendations-heading > p:last-child { color: var(--muted); margin-bottom: 0; font-size: 1.02rem; }
.recommendation-list { display: grid; gap: 16px; }
.recommendation-card {
  position: relative;
  padding: 82px 20px 32px 30px;
  min-height: 352px;
  border: 1px solid var(--card-border);
  border-radius: 22px;
  background: var(--card-bg);
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) 232px;
  column-gap: 30px;
  overflow: hidden;
}
.recommendation-card--rank-1 { --card-bg:#fff9f3; --card-border:#f4a73f; --badge:#ffd6a1; --rank-number:#ffc47a; --score:#ffe1ba; --callout:#fff0df; }
.recommendation-card--rank-2 { --card-bg:#fffbf7; --card-border:#edb35e; --badge:#ffe1ba; --rank-number:#ffd6a1; --score:#ffe8cd; --callout:#fff4e8; }
.recommendation-card--rank-3 { --card-bg:#fffdfb; --card-border:#e7c99d; --badge:#ffecd3; --rank-number:#ffe1ba; --score:#fff0df; --callout:#fff8f1; }
.recommendation-rank { position:absolute; top:23px; left:29px; display:flex; align-items:center; margin:0; min-height:47px; border-radius:99px; background:var(--badge); color:var(--ink); letter-spacing:.1em; font-size:.84rem; }
.recommendation-rank span { align-self:stretch; min-width:66px; display:grid; place-items:center; border-radius:99px; background:var(--rank-number); font-size:1.25rem; letter-spacing:-.025em; font-weight:850; }
.recommendation-rank strong { padding:12px 20px 12px 14px; }
.visual-area { padding:39px 0 0; display:flex; align-items:flex-start; justify-content:center; }
.editorial-mark { position:relative; flex:0 0 126px; width:126px; height:158px; overflow:hidden; mix-blend-mode:multiply; }
.editorial-mark img { width:100%; height:100%; object-fit:contain; }
.editorial-mark--progress img { position:absolute; width:1145px; max-width:none; height:1374px; left:-86px; top:-348px; filter:grayscale(1) contrast(1.5); }
.main-content { min-width:0; }
.title-row { display:flex; justify-content:flex-start; align-items:center; flex-wrap:wrap; gap:10px 20px; }
.recommendation-card h3 { margin:0; font-size:1.85rem; line-height:1.12; letter-spacing:-.035em; }
.recommendation-score { padding:6px 16px; margin:0; min-width:0; text-align:center; border-radius:99px; background:var(--score); font-size:1.25rem; line-height:1.2; font-weight:850; letter-spacing:-.025em; }
.strength-label { color:var(--muted); font-size:.82rem; font-weight:720; }
.recommendation-why { margin:10px 0 0; color:var(--muted); font-size:1.14rem; line-height:1.5; max-width:610px; }
.try-block { margin-top:24px; padding:0; border:0; }
.try-block h4 { margin:0 0 6px; font-size:.86rem; letter-spacing:.11em; }
.try-block ul { margin:0; list-style:none; padding:0; display:grid; gap:4px; font-size:1.1rem; line-height:1.45; color:var(--ink); }
.try-block li { position:relative; padding-left:27px; }
.try-block li::before { content:""; position:absolute; left:2px; top:.53em; width:11px; height:11px; border-radius:50%; background:var(--gold); }
.supporting-callout { align-self:center; min-height:176px; margin:10px 0 0; padding:27px; border:0; border-radius:36px; background:var(--callout); }
.callout-rule { display:block; height:3px; margin-bottom:13px; width:27px; background:var(--gold); }
.supporting-callout p { margin:0; color:var(--ink); font-size:1.08rem; line-height:1.45; }
.empty-recommendations { padding: 24px; border-radius: 16px; background: var(--soft); color: var(--muted); }
.pdf-cta { margin-top: 58px; padding: 30px; border-radius: var(--radius); background: var(--ink); color: white; display: grid; grid-template-columns: 1fr auto; gap: 18px 34px; align-items: center; }
.pdf-cta .eyebrow { color: var(--gold); margin-bottom: 9px; }
.pdf-cta h2 { margin-bottom: 8px; font-size: clamp(1.65rem, 3vw, 2.25rem); }
.pdf-cta p { color: #dfe1e8; max-width: 600px; margin-bottom: 0; }
.pdf-cta .save-status { grid-column: 1 / -1; min-height: 0; color: #dfe1e8; }
.results-actions { display: flex; align-items: center; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.save-pdf-button { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.save-pdf-button:hover { background: #eda039; }
.save-status { flex: 1 0 100%; margin: 0; min-height: 1.35em; color: var(--muted); font-size: .84rem; }

footer { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 22px 0 30px; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; display: flex; justify-content: space-between; gap: 20px; }
footer p { margin: 0; }

@media (max-width: 820px) {
  .brandbar { min-height: 78px; grid-template-columns: 1fr auto; }
  .brand-mark { display: none; }
  .wordmark { justify-self: start; }
  .quiz-layout { display: block; min-height: 0; }
  .intro-panel { border-right: 0; border-bottom: 1px solid var(--line); padding: 38px 0 28px; }
  .intro-panel h1 { font-size: clamp(2.2rem, 11vw, 3.5rem); }
  .scale-note, .key-hint { display: none; }
  .question-panel { padding: 34px 0 48px; min-height: 670px; }
  .profile-card { grid-template-columns: 1fr auto; }
  .profile-card .meter { grid-column: 1 / -1; grid-row: 2; }
  .results-view { width:calc(100% - 28px); padding:48px 0 64px; }
  .results-first .recommendations-heading { margin:0 0 28px; }
  .results-first .recommendations-heading h1 { font-size:clamp(2.3rem,9vw,3.3rem); }
  .results-first .recommendations-heading > p:last-child { font-size:1.04rem; }
  .recommendation-card { grid-template-columns:1fr; padding:92px 26px 26px; gap:25px; }
  .recommendation-rank { left:25px; top:23px; font-size:.75rem; max-width:calc(100% - 50px); }
  .recommendation-rank strong { padding-right:16px; }
  .visual-area { padding:0; justify-content:flex-start; }
  .editorial-mark { transform:scale(.68); transform-origin:top left; margin-right:-40px; margin-bottom:-50px; }
  .title-row { gap:10px 15px; }
  .recommendation-card h3 { font-size:1.8rem; }
  .recommendation-score { font-size:1.2rem; }
  .strength-label { flex-basis:100%; }
  .recommendation-why { font-size:1.02rem; margin-top:13px; }
  .try-block ul { font-size:1rem; gap:7px; }
  .supporting-callout { margin:0; min-height:0; padding:24px 26px; border-radius:28px; }
  .supporting-callout p { font-size:1rem; }
  .section-heading { align-items: start; flex-direction: column; gap: 4px; }
  .pdf-cta { grid-template-columns: 1fr; }
  .pdf-cta .save-pdf-button { width: 100%; }
  .results-actions { align-items: stretch; }
  .results-actions button { flex: 1 1 100%; }
  .save-pdf-button { margin-right: 0; }
  footer { display: grid; gap: 6px; }
}

@media (max-width: 480px) {
  .brandbar, .quiz-layout, .results-view, footer { width: min(100% - 28px, 1120px); }
  .episode { font-size: .66rem; }
  .answer-button { grid-template-columns: 32px 1fr; }
  .answer-help { display: none; }
  .question-card h2 { font-size: 1.55rem; }
  .pdf-cta { padding: 25px 22px; }
}

@media (min-width:821px) and (max-width:1020px) {
  .recommendation-card { grid-template-columns:130px minmax(0,1fr) 190px; column-gap:23px; }
  .recommendation-card h3 { font-size:1.65rem; }
  .strength-label { flex-basis:100%; }
  .supporting-callout { padding:23px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
