:root {
  color-scheme: dark;
  --ink: #10100e;
  --panel: #171613;
  --line: #403623;
  --gold: #e5bf79;
  --gold-soft: #c1a675;
  --cream: #f7efdf;
  --muted: #c2b9a9;
  --gold-line: #80653e;
  --warm-panel: #36291a;
  --warm-edge: #272015;
  --button-ink: #231806;
  --gold-light: #f7d495;
  --disabled: #777064;
  --shadow: #0008;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Instrument Sans", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ink); color: var(--cream); font: 16px/1.6 var(--sans); }
a { color: var(--gold); text-underline-offset: 4px; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: default; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 4px; }
img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.02; font-weight: 700; }
h2 { font-size: clamp(2.35rem, 4.4vw, 3.75rem); margin-bottom: 12px; }
h3 { font-size: 1.7rem; margin-bottom: 8px; }
p { color: var(--muted); }
.wrap { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.skip-link { position: fixed; top: 10px; left: 10px; translate: 0 -200%; z-index: 10; background: var(--ink); padding: 8px 12px; }
.skip-link:focus { translate: 0; }
.masthead { border-bottom: 1px solid var(--line); }
.masthead-inner { display: flex; align-items: center; justify-content: space-between; min-height: 70px; gap: 16px; }
.wordmark { color: var(--cream); font: 700 1.35rem/1.15 var(--serif); text-decoration: none; display: inline-flex; align-items: center; gap: 12px; }
.seal { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--gold-line); color: var(--gold); border-radius: 50%; flex: none; font: 17px/1 var(--sans); }
.masthead nav { display: flex; align-items: center; gap: 25px; font-size: .875rem; }
.masthead nav a { color: var(--muted); text-decoration: none; white-space: nowrap; }
.masthead nav .nav-cta { color: var(--gold); }
.masthead nav a:hover { text-decoration: underline; }

.hero { position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 48px; align-items: start; padding-block: 52px 70px; }
.hero::before { content: ""; position: absolute; inset: 0 -20px; z-index: -1; pointer-events: none; background: radial-gradient(ellipse 43% 64% at 70% 42%, var(--warm-panel), transparent); }
.hero-copy { grid-column: 1; grid-row: 1; }
.hero h1 { font-size: clamp(3.45rem, 7vw, 6rem); letter-spacing: -.055em; line-height: .91; margin: 0 0 20px; }
.hero h1 em { color: var(--gold); font-weight: 600; }

.hero-copy p { max-width: 32rem; margin-bottom: 24px; font-size: 1.05rem; }
.hero-art { grid-column: 2; grid-row: 1 / 3; position: relative; align-self: center; display: grid; place-items: center; padding-block: 10px; }
.hero-art img { width: min(77%, 340px); aspect-ratio: 2/3; object-fit: cover; border: 1px solid var(--gold-line); border-radius: 13px; rotate: 5deg; box-shadow: 0 26px 70px var(--shadow); }
.hero-orbit { width: min(111%, 510px); aspect-ratio: 1; border: 1px solid color-mix(in srgb, var(--gold-line) 53%, transparent); border-radius: 50%; position: absolute; z-index: -1; box-shadow: 0 0 0 10px color-mix(in srgb, var(--gold-line) 13%, transparent), inset 0 0 42px color-mix(in srgb, var(--gold-line) 13%, transparent); }
.quiz { grid-column: 1; grid-row: 2; border: 1px solid var(--gold-line); background: linear-gradient(150deg,var(--warm-edge),var(--panel) 58%); border-radius: 12px; scroll-margin-top: 16px; box-shadow: 0 14px 45px var(--shadow); overflow: hidden; }
.modes { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.modes button { background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 13px 8px 11px; font-weight: 700; line-height: 1.2; }
.modes button + button { border-left: 1px solid var(--line); }
.modes button[aria-pressed="true"] { border-bottom-color: var(--gold); background: var(--warm-edge); color: var(--gold); }
.modes button:focus-visible { outline-offset: -4px; }
.modes small { font-size: .73rem; font-weight: 500; display: inline-block; margin-left: 5px; }
.quiz-inner { padding: 19px 22px 20px; }
.progress { display: flex; flex-direction: column; gap: 6px; margin-bottom: 13px; color: var(--gold-soft); font-size: .75rem; font-weight: 600; }
progress { appearance: none; width: 100%; height: 4px; border: 0; border-radius: 5px; background: var(--line); color: var(--gold); }
progress::-webkit-progress-bar { border-radius: 5px; background: var(--line); }
progress::-webkit-progress-value { border-radius: 5px; background: var(--gold); }
progress::-moz-progress-bar { border-radius: 5px; background: var(--gold); }
fieldset { min-width: 0; border: 0; margin: 0; padding: 0; }
legend { padding: 0; margin: 0 0 12px; width: 100%; color: var(--cream); font: 700 clamp(1.4rem, 2.7vw, 1.8rem)/1.08 var(--serif); }
.choices { display: grid; gap: 6px; }
.choices label { display: block; position: relative; cursor: pointer; }
.choices input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.choices span { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 6px; color: var(--cream); font-size: .89rem; line-height: 1.35; }
.choices span::before { content: ""; width: 13px; height: 13px; border: 1px solid var(--gold-soft); border-radius: 50%; flex: none; }
.choices label:hover span { border-color: var(--gold-soft); }

.choices input:checked + span { border-color: var(--gold-soft); background: var(--warm-panel); }
.choices input:checked + span::before { background: var(--gold); box-shadow: inset 0 0 0 2px var(--warm-panel); }
.quiz-controls { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-top: 14px; }
.primary-button, .secondary-button { display: inline-flex; justify-content: center; align-items: center; gap: 10px; font: 700 .87rem/1.25 var(--sans); text-decoration: none; border: 1px solid var(--gold); border-radius: 6px; padding: 11px 15px; min-height: 42px; }
.primary-button { color: var(--button-ink); background: var(--gold); }
.primary-button:hover:not(:disabled) { background: var(--gold-light); }
.primary-button:disabled { background: var(--warm-panel); border-color: var(--gold-line); color: var(--gold-soft); }
.secondary-button { background: transparent; color: var(--gold); border-color: var(--gold-line); }
.secondary-button:hover { background: var(--warm-panel); }
.text-button { color: var(--gold); border: 0; background: transparent; padding: 7px 2px; font-size: .875rem; }
.text-button:disabled { color: var(--disabled); }

.gallery { padding-block: 46px 58px; border-block: 1px solid var(--line); scroll-margin-top: 24px; }
.section-intro { margin-bottom: 22px; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 12px; }
.cards a { color: var(--cream); display: block; text-decoration: none; font: 700 clamp(.95rem, 1.9vw, 1.45rem)/1.15 var(--serif); text-align: center; }
.cards img { border-radius: 7px; border: 1px solid var(--gold-line); width: 100%; aspect-ratio: 2/3; object-fit: cover; transition: translate .18s ease, border-color .18s ease; }
.cards a:hover img { translate: 0 -4px; border-color: var(--gold); }
.cards span { display: block; padding-top: 10px; }
.guide { padding-block: 64px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.8fr); gap: 66px; align-items: start; }
.guide h2 { max-width: 9em; }
.guide-content > section + section { margin-top: 32px; }
.guide h3 { color: var(--gold); }
.guide p { margin-bottom: 12px; }
.guide details { border-top: 1px solid var(--line); padding: 12px 0; }
.guide details:last-child { border-bottom: 1px solid var(--line); }
.guide summary { cursor: pointer; color: var(--cream); font-weight: 600; }
.guide details p { margin: 10px 0 0; }
.site-footer { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding-block: 26px; border-top: 1px solid var(--line); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 16px; font-size: .875rem; }

.result { scroll-margin-top: 24px; margin-bottom: 60px; }
.shared-result { margin-top: 48px; min-height: 55vh; }

.result-lead { display: grid; grid-template-columns: minmax(0, 290px) minmax(0, 1fr); gap: clamp(24px,6vw,75px); align-items: center; padding: clamp(22px,5vw,55px); border: 1px solid var(--gold-line); border-radius: 12px; background: radial-gradient(ellipse at 6% 0%,var(--warm-panel),var(--panel) 72%); }
.result-card { width: 100%; aspect-ratio: 2/3; object-fit: cover; border-radius: 9px; border: 1px solid var(--gold-line); box-shadow: 0 14px 40px var(--shadow); }
.result-copy h1, .result-copy h2 { font-size: clamp(3.45rem,8vw,6.5rem); margin-block: 5px 10px; color: var(--gold); }
.result-copy .virtue-line { color: var(--cream); font: italic 600 1.65rem/1.1 var(--serif); margin-bottom: 12px; }
.result-copy .primary-button { margin-top: 5px; }
.result-copy p { max-width: 40rem; }
.result-label { font-size: .8rem; font-weight: 700; color: var(--gold-soft); margin: 0; }
.tie-note { margin-bottom: 14px; }
.tie-choices { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tie-choices [aria-pressed="true"] { color: var(--ink); background: var(--gold); }
.result-details { padding-block: 40px 22px; }
.score-grid { display: grid; grid-template-columns: minmax(260px,1fr) minmax(0,1fr); align-items: center; gap: clamp(20px,5vw,60px); }
.radar { width: 100%; max-width: 490px; margin: 0 auto; overflow: visible; }
.radar text { fill: var(--muted); font: 12px var(--sans); }
.scores { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.score-line { display: grid; grid-template-columns: minmax(6.3rem, 1fr) 2fr minmax(2.9rem,auto); align-items: center; gap: 9px; font-size: .9rem; }
.score-line b { font-variant-numeric: tabular-nums; text-align: right; }
.sharing { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 26px; }
.share-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.share-feedback { margin-top: 12px; }
.share-feedback:empty { display: none; }
.result-footer { margin-top: 20px; display: flex; gap: 15px; flex-wrap: wrap; align-items: center; }

@media (min-width: 1060px) { .hero { min-height: 670px; } }
@media (max-width: 820px) {
  .wrap { width: calc(100% - 42px); }
  .hero { column-gap: 20px; padding-block: 38px 50px; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
  .hero-art img { width: 93%; }
  .cards { grid-template-columns: repeat(4,minmax(0,1fr)); row-gap: 18px; }
  .guide { grid-template-columns: 1fr; gap: 16px; }
  .guide h2 { max-width: none; }
}
@media (max-width: 600px) {
  .wrap { width: calc(100% - 32px); }
  .masthead-inner { min-height: 56px; }
  .wordmark { gap: 7px; font-size: 1.13rem; }
  .seal { width: 23px; height: 23px; font-size: 12px; }
  .masthead nav a:first-child { display: none; }
  .masthead nav { font-size: .79rem; }
  .hero { padding-block: 26px 34px; grid-template-columns: minmax(0,1fr) 84px; column-gap: 9px; overflow: clip; }
  .hero h1 { font-size: clamp(2.7rem, 10vw, 4.4rem); margin-bottom: 10px; }

  .hero-copy p { font-size: .9rem; line-height: 1.42; margin-bottom: 15px; }
  .hero-art { grid-row: 1; align-self: start; padding-block: 2px 0; }
  .hero-art img { width: 88%; border-radius: 6px; }
  .hero-orbit { width: 106%; }
  .quiz { grid-column: 1 / -1; }
  .quiz-inner { padding: 12px 12px 13px; }
  .modes button { font-size: .83rem; padding: 11px 3px 8px; }
  .modes small { margin-left: 2px; font-size: .68rem; }
  .choices span { min-height: 40px; font-size: .85rem; }
  .gallery, .guide { padding-block: 34px; }
  .cards { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px 9px; }
  .result-lead { grid-template-columns: minmax(0,1fr); padding: 20px; }
  .result-copy { grid-row: 1; }
  .result-card { max-width: 240px; justify-self: center; }
  .result-copy h1, .result-copy h2 { font-size: clamp(2.7rem,12vw,4.5rem); }
  .score-grid { grid-template-columns: minmax(0,1fr); }
  .site-footer { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
