:root {
  --paper: #fff5fa;
  --panel: #fffcf7;
  --ink: #321535;
  --muted: #70486a;
  --berry: #a92259;
  --lilac: #f1e4f8;
  --line: #d9bad4;
  --radius: 12px;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-family: Nunito, system-ui, sans-serif;
  color: var(--ink);
  line-height: 1.6;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); }
h1, h2, p, figure, blockquote, dl, dd, ol { margin: 0; }
h1, h2 { font-family: var(--display); font-weight: 800; line-height: 1.06; }
h2 { font-size: 36px; letter-spacing: -.015em; }
p { max-width: 68ch; }
a { color: var(--berry); text-underline-offset: .24em; }
a:hover { text-decoration-thickness: 2px; }
button, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--berry); outline-offset: 4px; }
:target { scroll-margin-top: 24px; }
.container { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.visually-hidden, .skip-link:not(:focus) {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.skip-link:focus { position: absolute; z-index: 3; top: 8px; left: 8px; padding: 8px 12px; background: var(--panel); }
.site-header, .site-footer { background: var(--panel); }
.site-header { border-bottom: 2px solid var(--ink); }
.site-footer { border-top: 2px solid var(--ink); }
.header-inner, .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-family: var(--display); font-weight: 800; font-size: 26px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand svg { width: 32px; height: 32px; }
.main-nav, .footer-inner nav { display: flex; align-items: center; gap: 24px; }
.main-nav a, .footer-inner nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); font-size: 14px; font-weight: 800; text-decoration: none; white-space: nowrap; }
.main-nav a:first-child { color: var(--berry); }
.main-nav a:hover, .footer-inner nav a:hover { text-decoration: underline; }


.hero {
  display: grid; grid-template-columns: minmax(0, 1.56fr) minmax(0, 1fr);
  grid-template-areas: "title art" "quiz art"; gap: 24px 32px; align-items: start;
  padding: 40px 0 0;
}
.hero-title { grid-area: title; }
.hero h1 { font-size: clamp(54px, 6.6vw, 88px); letter-spacing: -.025em; }
.hero h1 span { display: block; color: var(--berry); font-size: clamp(30px, 4.2vw, 52px); letter-spacing: -.01em; }
.hero-title > p { color: var(--muted); margin-top: 16px; max-width: 52ch; font-size: 17px; font-weight: 700; }
.hero-title > .hero-byline { margin-top: 8px; font-size: .875rem; font-weight: 600; }
[data-gf-tool] { grid-area: quiz; min-width: 0; }
.hero-art {
  grid-area: art; position: relative; isolation: isolate; align-self: stretch;
  min-height: 480px; margin: 8px 6px 6px 0; overflow: hidden;
  background: var(--lilac); border: 2px solid var(--ink); border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--ink);
}
.hero-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 42%; }
.hero-art figcaption {
  display: flex; align-items: center; gap: 8px; position: absolute;
  bottom: 16px; right: 16px; margin-left: 16px; padding: 4px 12px 4px 8px; background: var(--panel);
  border: 1px solid var(--ink); border-radius: 8px; font-size: 14px; font-weight: 800;
  box-shadow: 2px 2px 0 var(--ink);
}
.hero-art figcaption svg { width: 25px; height: 25px; flex: none; }
.quiz-panel {
  background: var(--panel); border: 2px solid var(--ink); border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--line);
}
.quiz-question-panel, .quiz-result { padding: 20px; }
.quiz-progress { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 16px; margin-bottom: 16px; }
.quiz-counter { font-weight: 800; font-size: 14px; white-space: nowrap; }
progress { width: 100%; height: 8px; appearance: none; border: 0; border-radius: 8px; overflow: hidden; background: var(--lilac); color: var(--berry); }
progress::-webkit-progress-bar { background: var(--lilac); }
progress::-webkit-progress-value { background: var(--berry); border-radius: 8px; }
progress::-moz-progress-bar { background: var(--berry); border-radius: 8px; }
.quiz-panel fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.scene-title { color: var(--berry); font-weight: 800; font-size: 15px; }
.scene-question, [data-result-type] { max-width: none; font-family: var(--display); font-weight: 800; letter-spacing: -.015em; }
.scene-question { font-size: clamp(25px, 2.5vw, 34px); line-height: 1.15; margin-top: 4px; }
.scene-question:focus, [data-result-type]:focus { outline: none; }


.quiz-modes {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
  padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--paper);
  border-radius: 10px 10px 0 0;
}
.quiz-modes button {
  display: grid; gap: 2px; min-height: 52px; padding: 6px 8px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px; color: var(--ink); line-height: 1.2;
}
.quiz-modes strong { font-weight: 800; }
.quiz-modes span { color: var(--muted); font-size: 13px; }
.quiz-modes button:hover, .quiz-modes button[aria-pressed="true"] { border-color: var(--berry); background: var(--lilac); }
.quiz-modes button[aria-pressed="true"] { box-shadow: inset 0 -2px 0 var(--berry); }
.scale-choices { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.scale-choice {
  display: grid; place-items: center; position: relative; min-width: 0; min-height: 52px;
  padding: 4px 5px; text-align: center; background: #fff; border: 1px solid var(--line);
  border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 800; line-height: 1.22;
}
.scale-choice:hover { border-color: var(--berry); background: var(--paper); }
.scale-choice:has(:checked) { border-color: var(--berry); background: var(--lilac); box-shadow: inset 0 0 0 1px var(--berry); }
.scale-choice:has(:focus-visible) { outline: 3px solid var(--berry); outline-offset: 2px; }
.scale-choice input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; margin: 0; }
.quiz-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.quiz-actions p { font-size: 14px; text-align: center; color: var(--muted); }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--ink); border-radius: 8px; min-height: 44px; padding: 8px 16px;
  font-weight: 800; line-height: 1.3; text-decoration: none;
}
.button.primary { color: #fff; background: var(--berry); border-color: var(--berry); }
.button.primary:not(:disabled):hover { background: #871646; border-color: #871646; }
.button.secondary { background: var(--panel); color: var(--ink); }
.button.secondary:not(:disabled):hover { background: var(--lilac); }
.button:disabled { background: var(--lilac); border-color: var(--line); color: var(--muted); }
.quiz-result [data-result-type] { font-size: clamp(40px, 5vw, 66px); line-height: 1.06; overflow-wrap: anywhere; }
.result-tagline { font-size: 18px; font-weight: 800; margin: 2px 0 8px; }
.quiz-result blockquote { margin-top: 16px; padding: 8px 12px; border-left: 3px solid var(--berry); background: var(--paper); font-style: italic; }
.result-matches { margin-top: 16px; }
.example-result dl div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-top: 1px solid var(--line); }
.example-result dt { font-weight: 800; }
.quiz-mode-note { margin: 0; padding: 0 20px; color: var(--muted); font-size: .875rem; }
.quiz-mode-note[data-invalid-result] { padding: 12px 20px; }
.result-mode-note { margin-top: 8px; color: var(--muted); font-size: .875rem; }
.result-score-heading { margin-top: 16px; }
.quiz-scores { width: 100%; border-collapse: collapse; margin-top: 8px; }
.quiz-scores th, .quiz-scores td { padding: 5px 4px; text-align: left; border-bottom: 1px solid var(--line); }
.quiz-scores thead { background: var(--lilac); }
.quiz-scores td { font-variant-numeric: tabular-nums; white-space: nowrap; }
.quiz-scores th:not(:first-child), .quiz-scores td { text-align: right; }
.tie-note, .copy-note { color: var(--muted); font-size: 14px; }
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.copy-note:not(:empty), .manual-copy, .no-js { display: block; margin-top: 8px; }
.manual-copy textarea { display: block; width: 100%; padding: 8px; margin-top: 4px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 8px; }


.read-section { margin: 56px 0; }
.read-section h2 { margin-bottom: 12px; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding-left: 24px; }
.how-grid li { padding: 8px 12px 8px 4px; border-top: 1px solid var(--line); }
.how-grid li::marker { font-weight: 800; color: var(--berry); }
.how-grid strong, .how-grid span { display: block; }
.how-grid span, .lede, .example-section > div:first-child p { color: var(--muted); }
.example-section {
  display: grid; grid-template-columns: 1.12fr .88fr; align-items: start; gap: 32px;
  padding: 32px; background: var(--lilac); border-radius: var(--radius);
}
.example-section > div:first-child p + p { margin-top: 12px; }
.example-result { padding: 16px 24px; background: var(--panel); border: 1px solid var(--ink); border-radius: var(--radius); }
.example-result .example-type { font: 800 36px/1.1 var(--display); color: var(--berry); }
.example-result p + p { margin-top: 4px; }
.example-result dl { margin-top: 12px; }
.portrait-grid {
  list-style: none; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px; margin-top: 20px; align-items: stretch;
}
.portrait-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.portrait-card:target { border-color: var(--berry); outline: 3px solid var(--berry); outline-offset: 3px; }
.portrait-card img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.portrait-caption { padding: 12px; }
.portrait-caption h3 { font: 800 28px/1.1 var(--display); color: var(--berry); margin: 0; overflow-wrap: anywhere; }
.portrait-caption p { margin-top: 6px; line-height: 1.45; font-size: 14px; color: var(--muted); }
.portrait-caption .portrait-tagline { color: var(--ink); font-weight: 800; }
.mode-guide { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.mode-guide > div { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; background: var(--panel); }
.mode-guide dt { font-weight: 800; }
.mode-guide dt span { color: var(--berry); margin-left: 6px; white-space: nowrap; }
.mode-guide dd { font-size: 15px; color: var(--muted); }
.example-result h3 { font-weight: 800; font-size: 15px; margin: 0 0 4px; }
.result-profile { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; }
.result-profile img { display: block; width: clamp(76px, 15vw, 132px); height: auto; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 8px; }
.result-profile-link { display: inline-block; margin-top: 8px; font-weight: 800; }

.return-link { margin-top: 16px; font-weight: 800; }
.faq-section details { border-top: 1px solid var(--line); }
.faq-section details:last-child { border-bottom: 1px solid var(--line); }
.faq-section summary { padding: 12px 0; min-height: 44px; cursor: pointer; font-weight: 800; }
.faq-section summary::marker { color: var(--berry); }
.faq-section details p { padding: 0 16px 16px; color: var(--muted); }
.legal { margin-block: 48px 64px; max-width: 760px; }
.legal h1 { font-size: 48px; margin-bottom: 16px; }
.legal h2 { font-size: 28px; margin-top: 24px; }
.legal p, .legal .button { margin-top: 12px; }


@media (max-width: 960px) {
  .portrait-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .scale-choices { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .scale-choice { grid-column: span 2; }
  .scale-choice:nth-child(n+4) { grid-column: span 3; }
  .hero { grid-template-columns: minmax(0, 1fr) 32%; column-gap: 20px; }
  .quiz-actions p { display: none; }
}
@media (max-width: 640px) {
  .container { width: calc(100% - 32px); }
  .header-inner, .footer-inner { gap: 4px 10px; min-height: 56px; flex-wrap: wrap; }
  .brand { font-size: 21px; }
  .brand svg { width: 26px; height: 26px; }
  .main-nav, .footer-inner nav { gap: 8px; }
  .main-nav a, .footer-inner nav a { font-size: 13px; }
  .hero { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "quiz" "art"; gap: 16px; padding-top: 24px; }
  .hero h1 { font-size: 48px; }
  .hero h1 span { font-size: 30px; }
  .hero-title > p { font-size: 16px; margin-top: 8px; }
  .hero-art { min-height: 280px; margin-top: 4px; }
  .hero-art img { object-position: center 38%; }
  .hero-art figcaption { bottom: 10px; right: 10px; }
  .quiz-question-panel, .quiz-result { padding: 16px; }
  .quiz-modes { padding: 10px 12px; }
  .scale-choice { min-height: 46px; }
  .portrait-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .portrait-caption { padding: 10px; }
  .portrait-caption h3 { font-size: 24px; }
  .quiz-actions { justify-content: flex-start; }
  .quiz-actions .primary { flex: 1; }
  .read-section { margin-block: 40px; }
  h2 { font-size: 30px; }
  .how-grid { grid-template-columns: 1fr; gap: 4px; }
  .example-section, .mode-guide { grid-template-columns: 1fr; }
  .example-section { gap: 16px; padding: 16px; }
  .footer-inner { padding-block: 8px; }
  .legal h1 { font-size: 36px; }
}
@media (max-width: 380px) {
  .main-nav { gap: 8px; }
  .main-nav a { font-size: 12px; }
  .brand { font-size: 21px; }
}


/* Dere type guides */
.dere-guide { max-width: 1000px; padding-block: clamp(32px, 6vw, 72px); }
.dere-guide-intro h1 { font-size: clamp(42px, 7vw, 76px); }
.dere-guide-intro .lede { max-width: 62ch; margin-top: 12px; }
.dere-guide-with-art { display: grid; grid-template-columns: minmax(0, 1fr) minmax(140px, 240px); align-items: center; gap: 24px; }
.dere-guide-with-art img, .dere-profile img { width: 100%; height: auto; border: 1px solid var(--ink); border-radius: var(--radius); }
.dere-guide-action { margin-top: 20px; }
.dere-guide-action .button { display: inline-flex; align-items: center; text-decoration: none; }
.dere-chart-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.dere-chart { width: 100%; border-collapse: collapse; text-align: left; }
.dere-chart th, .dere-chart td { padding: 10px 14px; vertical-align: top; overflow-wrap: anywhere; }
.dere-chart thead { background: var(--lilac); }
.dere-chart tbody tr { border-top: 1px solid var(--line); }
.dere-profiles { display: grid; gap: 18px; }
.dere-profile { display: grid; grid-template-columns: clamp(80px, 20vw, 168px) minmax(0, 1fr); gap: clamp(12px, 3vw, 26px); align-items: start; padding: clamp(14px, 3vw, 26px); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); scroll-margin-top: 20px; }
.dere-profile:target { border-color: var(--berry); outline: 2px solid var(--berry); }
.dere-profile p { margin: 8px 0; }
.dere-profile ul, .dere-guide-body ol { padding-left: 1.4em; }
.dere-profile li + li, .dere-guide-body li + li { margin-top: 6px; }
.dere-guide-body { max-width: 72ch; }
.dere-guide-body h2 { margin: 30px 0 10px; }
.dere-guide-body p { margin-block: 10px; }
@media (max-width: 580px) {
  .dere-guide-with-art, .dere-profile { grid-template-columns: minmax(0, 1fr); }
  .dere-guide-with-art img, .dere-profile img { max-width: 124px; }
  .dere-chart th, .dere-chart td { padding: 8px 6px; font-size: 13px; }
}
