/* DereQuiz , modern Japanese anime visual system
   Solid colors only (no gradients), sans-serif only, diagonal blocks + halftone dots. */

:root {
  --ink: #20242b;
  --ink-soft: #5f6672;
  --paper: #fffdf8;
  --paper-solid: #fffdf8;
  --line: #e3e0d8;
  --coral: #f2655f;
  --coral-deep: #d9483f;
  --coral-soft: #ffe3de;
  --teal: #12b4a4;
  --teal-deep: #0c8f83;
  --teal-soft: #d9f3ef;
  --sakura: #ffb3c6;
  --sakura-soft: #fff0f4;
  --gold: #f2b544;
  --shadow: 0 14px 34px rgba(32, 36, 43, .12);
  --radius: 14px;
  --sans: "Zen Maru Gothic", "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Yu Gothic UI", "Noto Sans JP", "Varela Round", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  /* halftone dot texture, solid color dots , no gradient() used */
  --dots-coral: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18'%3E%3Ccircle cx='3' cy='3' r='2.2' fill='%23ffffff' fill-opacity='.35'/%3E%3C/svg%3E");
  --dots-teal: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18'%3E%3Ccircle cx='3' cy='3' r='2.2' fill='%23ffffff' fill-opacity='.30'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  background-color: var(--paper);
  transition: background-color 700ms ease;
  /* `clip` (not `hidden`) avoids creating a scroll container, which would
     break position: sticky on the quiz dashboard. */
  overflow-x: clip;
}

body[data-mood="tsundere"] { background-color: #fff4ee; --accent: var(--coral); --accent-deep: var(--coral-deep); }
body[data-mood="yandere"]  { background-color: #ffeef0; --accent: #e0444f; --accent-deep: #b62f39; }
body[data-mood="kuudere"]  { background-color: #eef6fb; --accent: #3f7fa8; --accent-deep: #2c6286; }
body[data-mood="dandere"]  { background-color: #faf3ea; --accent: #c98a54; --accent-deep: #a06a39; }
body[data-mood="deredere"] { background-color: #fff8e6; --accent: #e0a72e; --accent-deep: #b3811c; }
body[data-mood="himedere"] { background-color: #f6eefb; --accent: #a867c4; --accent-deep: #7f4798; }
body[data-mood="bakadere"] { background-color: #fff3ea; --accent: #ee8a4f; --accent-deep: #c46733; }
body[data-mood="menhera"]  { background-color: #f1eefb; --accent: #8878c9; --accent-deep: #6357a2; }
body[data-mood="sakura"]   { --accent: var(--coral); --accent-deep: var(--coral-deep); }

a { color: inherit; text-decoration: none; }
button { font: inherit; }
img, svg { display: block; max-width: 100%; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Sakura petals (static CSS, no JS needed) ---------- */
.sakura-layer { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.petal {
  position: absolute; top: -8vh;
  width: var(--size); height: calc(var(--size) * .72);
  border-radius: 80% 15% 75% 25%;
  background: var(--sakura);
  opacity: var(--opacity);
  animation: petal-fall var(--duration) linear infinite;
  animation-delay: var(--delay);
  transform: rotate(var(--rotate));
}
@keyframes petal-fall {
  0%   { transform: translate3d(0, -10vh, 0) rotate(0deg); }
  35%  { transform: translate3d(26px, 35vh, 0) rotate(120deg); }
  70%  { transform: translate3d(-20px, 72vh, 0) rotate(240deg); }
  100% { transform: translate3d(14px, 112vh, 0) rotate(360deg); }
}
.sakura-branch-static {
  position: fixed; right: -70px; top: -8px; width: 240px; opacity: .85;
  transform-origin: 80% 10%;
  animation: branch-sway 8s ease-in-out infinite alternate;
}
@keyframes branch-sway {
  from { transform: rotate(-3deg) translateY(0); }
  to   { transform: rotate(2deg) translateY(7px); }
}
.egg-branch {
  position: fixed; right: -80px; top: 96px; width: 240px; height: 180px;
  z-index: 1; pointer-events: none; opacity: 0;
  transform: translateY(-18px) rotate(-8deg);
  transition: opacity 700ms ease, transform 700ms ease;
}
body[data-egg="1"] .egg-branch { opacity: .9; transform: translateY(0) rotate(-8deg); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 20px;
  padding: 12px clamp(18px, 4vw, 54px);
  background: #fffdf8;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; flex-direction: column; line-height: 1.15; margin-right: auto; }
.brand-lockup { display: flex; align-items: center; gap: 8px; }
.logo-flower { width: 30px; height: 30px; flex: 0 0 auto; }
.brand-mark { font-family: var(--sans); font-size: 1.42rem; font-weight: 900; letter-spacing: -.03em; }
.brand-mark span { color: var(--coral); }
.brand-sub { font-size: .62rem; color: var(--ink-soft); letter-spacing: .16em; text-transform: uppercase; }

.main-nav { display: flex; align-items: center; gap: clamp(12px, 2vw, 24px); font-size: .86rem; font-weight: 600; }
.main-nav a { position: relative; padding: 6px 0; color: var(--ink-soft); transition: color .2s ease; white-space: nowrap; }
.main-nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 3px;
  background: var(--coral); transition: right .25s ease;
}
.main-nav a:hover, .main-nav a.active { color: var(--ink); }
.main-nav a:hover::after, .main-nav a.active::after { right: 0; }

.header-cta {
  padding: 9px 18px; color: #fff; font-size: .84rem; font-weight: 700;
  background: var(--coral); white-space: nowrap;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.header-cta:hover { background: var(--coral-deep); }
.menu-toggle { display: none; border: 0; background: transparent; width: 34px; padding: 7px; cursor: pointer; }
.menu-toggle span { display: block; height: 3px; background: var(--ink); margin: 5px 0; border-radius: 2px; }

/* ---------- Layout ---------- */
.app-shell { position: relative; z-index: 2; max-width: 1200px; margin: 0 auto; padding: 0 24px 80px; min-height: calc(100vh - 170px); }
.section { margin-bottom: 76px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.eyebrow {
  display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .2em;
  color: var(--coral-deep); text-transform: uppercase; margin-bottom: 10px;
}
h1, h2, h3, h4 { font-family: var(--sans); line-height: 1.2; margin: 0 0 14px; letter-spacing: -.02em; }
h1 { font-size: clamp(2.5rem, 5.2vw, 4.4rem); font-weight: 800; }
h2 { font-size: clamp(1.9rem, 3.2vw, 2.7rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 800; }
p { margin: 0 0 12px; color: var(--ink-soft); }
.lead { font-size: 1.06rem; max-width: 620px; }
.muted { color: var(--ink-soft); font-size: .86rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; padding: 13px 24px; cursor: pointer; font-weight: 800;
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
  transition: transform .18s ease, background .18s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { color: #fff; background: var(--coral); }
.btn-primary:hover { background: var(--coral-deep); }
.btn-teal { color: #fff; background: var(--teal); }
.btn-teal:hover { background: var(--teal-deep); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--coral); }
.btn-sm { padding: 9px 16px; font-size: .84rem; }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 22px rgba(32, 36, 43, .06);
}

.tag {
  display: inline-block; padding: 5px 12px; border-radius: 4px; font-size: .7rem; font-weight: 800;
  letter-spacing: .06em; color: var(--coral-deep); background: var(--coral-soft);
}
.tag.teal { color: var(--teal-deep); background: var(--teal-soft); }

/* ---------- Hero: diagonal blocks ---------- */
.hero {
  display: grid; grid-template-columns: 1.02fr .98fr; align-items: center;
  gap: 30px; min-height: 560px; padding: 40px 0 30px; margin-bottom: 30px;
}
.hero-copy { position: relative; padding-left: 26px; }
.hero-copy::before {
  content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 6px; background: var(--coral);
}
.hero-title { margin-bottom: 18px; }
.hero-title span { color: var(--coral); }
.hero-title .underline {
  position: relative; display: inline-block; color: var(--teal-deep);
}
.hero-copy .lead { margin-bottom: 24px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.hero-meta { display: flex; gap: 28px; margin-top: 30px; font-size: .82rem; color: var(--ink-soft); }
.hero-meta strong { display: block; font-size: 1.45rem; font-weight: 800; color: var(--ink); line-height: 1.1; }

.hero-visual {
  position: relative; min-height: 500px; display: grid; place-items: center;
  background: var(--teal-soft);
  clip-path: polygon(12% 0, 100% 0, 100% 100%, 0 100%, 0 16%);
}
.hero-visual::before {
  content: ""; position: absolute; inset: 0; background-image: var(--dots-teal); background-size: 18px 18px; opacity: .8;
}
.hero-visual .slash {
  position: absolute; background: var(--teal);
  clip-path: polygon(18% 0, 100% 0, 82% 100%, 0 100%);
}
.hero-visual .slash.one { inset: 0 0 46% 0; opacity: .9; }
.hero-visual .slash.two { inset: 54% 0 0 22%; background: var(--coral); opacity: .82; }
.hero-visual .sun {
  position: absolute; width: 190px; height: 190px; border-radius: 50%; right: 6%; top: 10%;
  background: var(--gold); opacity: .9;
}
.hero-visual .char-slot {
  position: relative; z-index: 3; width: min(70%, 320px);
  transform: translate(18px, 14px);
}
.hero-visual .caption {
  position: absolute; z-index: 4; left: 26px; bottom: 20px; font-size: .78rem; font-weight: 700;
  color: #fff; background: var(--ink); padding: 5px 10px;
}

.vertical-note {
  position: absolute; right: 18px; top: 24px; z-index: 4;
  writing-mode: vertical-rl; font-family: var(--sans); font-size: .8rem; font-weight: 800;
  letter-spacing: .22em; color: var(--ink);
}
.static-hero .char-slot { width: min(70%, 320px); }
.static-slot { animation: slot-float 6s ease-in-out infinite alternate; }
@keyframes slot-float {
  from { transform: translateY(0) rotate(-1deg); }
  to   { transform: translateY(-8px) rotate(1deg); }
}

.type-mini {
  aspect-ratio: 3 / 4; display: grid; place-items: center; font-size: 1.5rem; font-weight: 800;
  letter-spacing: .14em; border-radius: var(--radius);
  background: var(--mini); color: var(--ink);
  position: relative; overflow: hidden;
}
.type-mini::after {
  content: ""; position: absolute; inset: 0; background-image: var(--dots-coral); background-size: 18px 18px; opacity: .5;
}
.type-mini span { position: relative; z-index: 2; }
.type-photo {
  aspect-ratio: 3 / 4; border-radius: var(--radius); overflow: hidden;
  border: 2px solid rgba(255,255,255,.85); background: var(--mini);
}
.type-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; display: block; }

/* ---------- Decorative diagonal band ---------- */
.diagonal-band {
  position: relative; margin: 30px -24px 64px; padding: 40px clamp(24px, 5vw, 70px);
  min-height: 260px; display: grid; align-items: center; overflow: hidden;
}
.diagonal-band.coral { background: var(--coral); color: #fff; }
.diagonal-band.teal  { background: var(--teal); color: #fff; }
.diagonal-band::before {
  content: ""; position: absolute; inset: 0; background-image: var(--dots-coral); background-size: 18px 18px; opacity: .55;
}
.diagonal-band::after {
  content: ""; position: absolute; right: -6%; top: -30%; width: 46%; height: 160%;
  background: rgba(255,255,255,.12);
  clip-path: polygon(40% 0, 100% 0, 60% 100%, 0 100%);
}
.band-inner { position: relative; z-index: 3; display: grid; grid-template-columns: 1fr .8fr; gap: 30px; align-items: center; }
.band-inner h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 12px; }
.band-inner p { color: rgba(255,255,255,.92); }
.band-figure { position: relative; justify-self: center; width: min(240px, 60%); }
.band-figure .char-slot { width: 100%; }
.band-jp {
  position: absolute; right: 8px; top: 0; writing-mode: vertical-rl; font-size: 1.5rem;
  font-weight: 800; letter-spacing: .18em; color: rgba(255,255,255,.85);
}

/* ---------- Character placeholder ---------- */
.char-slot {
  position: relative; width: min(78%, 340px); aspect-ratio: 3 / 4; display: grid; place-items: center;
  border-radius: 8px; overflow: hidden; background: var(--slot-b, #ffe9d2);
  border: 2px solid rgba(255,255,255,.85); box-shadow: var(--shadow);
}
/* ---------- Quiz art: always fully colored, pinned in place ----------
   The old line-art-to-color reveal depended on JavaScript that the static
   preview never runs, so the character stayed permanently grayscale while
   the growing question column pushed it down the page. Both are removed:
   the art is shown in full color from the start and the aside stays put. */
.char-slot svg { width: 84%; height: 84%; opacity: .95; }
.char-slot img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Mode cards ---------- */
.mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.mode-card { padding: 26px; position: relative; overflow: hidden; transition: transform .22s ease, box-shadow .22s ease; }
.mode-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.mode-card::before {
  content: ""; position: absolute; right: -20px; top: -20px; width: 90px; height: 90px;
  background: var(--coral-soft); clip-path: polygon(100% 0, 100% 100%, 0 0);
}
.mode-card .mode-num { font-size: 2.6rem; font-weight: 800; color: var(--coral); line-height: 1; }
.mode-card.teal .mode-num { color: var(--teal); }
.mode-card p { font-size: .9rem; min-height: 46px; }
.mode-card .btn { margin-top: 10px; }

/* ---------- Keyword chips (personality-type style) ---------- */
.keyword-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.keyword-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border: 1px solid var(--line); border-radius: 999px; font-size: .74rem; font-weight: 700;
  background: #fff; color: var(--ink-soft);
}
.keyword-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--coral); }
.keyword-chip.teal::before { background: var(--teal); }
.type-code {
  display: inline-block; padding: 3px 10px; border-radius: 4px; font-size: .74rem; font-weight: 800;
  letter-spacing: .12em; background: var(--ink); color: #fff;
}
.type-keywords {
  font-size: .75rem; color: var(--muted); margin-top: 4px; letter-spacing: .01em;
}

/* ---------- Type grid ---------- */
.type-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.type-card { padding: 14px; text-align: center; transition: transform .2s ease; }
.type-card:hover { transform: translateY(-5px); }
.type-card .char-slot { width: 100%; aspect-ratio: 4 / 5; }
.type-card h3 { margin: 12px 0 2px; font-size: 1rem; }
.type-card .ja { font-size: .72rem; font-weight: 700; color: var(--ink-soft); letter-spacing: .1em; }
.type-card .tagline { font-size: .8rem; color: var(--coral-deep); margin-top: 6px; }
.type-card.is-related .char-slot { background: #f4f1ee; border-style: dashed; border-color: #c9c2ba; }
.type-card.is-related .char-slot svg { opacity: .3; }

/* ---------- Quiz ---------- */
.quiz-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.progress-wrap { flex: 1; max-width: 420px; }
.progress-track { height: 10px; border-radius: 2px; background: #ece8e1; overflow: hidden; }
.progress-fill { height: 100%; width: 0; border-radius: 2px; background: var(--coral); transition: width 500ms ease; }
.progress-text { font-size: .78rem; font-weight: 700; color: var(--ink-soft); margin-top: 6px; }
.quiz-layout { display: grid; grid-template-columns: 1.12fr .88fr; gap: 24px; align-items: start; }
.question-card { padding: clamp(24px, 4vw, 40px); position: relative; overflow: hidden; }
.question-card::before {
  content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 6px; background: var(--coral);
}
.question-card h2 { font-size: clamp(1.55rem, 3vw, 2.2rem); margin-bottom: 8px; }
.dimension-pill { font-size: .72rem; font-weight: 800; letter-spacing: .08em; color: var(--teal-deep); }
.options { display: grid; gap: 12px; margin-top: 24px; }
.option {
  display: block; width: 100%; text-align: left; text-decoration: none;
  padding: 15px 18px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink); cursor: pointer; font-weight: 600;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.option:hover { transform: translateX(5px); border-color: var(--coral); background: var(--coral-soft); }
.option .key {
  display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 12px; flex: 0 0 auto;
  border-radius: 50%; background: var(--ink); color: #fff; font-size: .74rem; font-weight: 800;
}
.quiz-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 22px; }

/* ---------- Static quiz preview: pure-CSS interaction (no JS needed) ---------- */
.static-options { position: relative; }
.opt-radio { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.opt-radio:focus-visible + .option { outline: 3px solid var(--teal); outline-offset: 2px; }
.opt-radio:checked + .option {
  border-color: var(--coral); background: var(--coral-soft);
  box-shadow: inset 4px 0 0 var(--coral);
}
.opt-radio:checked + .option .key { background: var(--coral); }
.option-feedback { display: none; margin-top: 14px; padding: 14px 16px; border-radius: 8px; background: #fff; border: 1px solid var(--coral); font-size: .88rem; }
.option-feedback .fb { display: none; }
.option-feedback .fb-cta { display: none; margin-top: 12px; }
.opt-radio:checked ~ .option-feedback { display: block; }
#sq-a:checked ~ .option-feedback .fb-a,
#sq-b:checked ~ .option-feedback .fb-b,
#sq-c:checked ~ .option-feedback .fb-c,
#sq-d:checked ~ .option-feedback .fb-d { display: block; font-weight: 700; color: var(--coral-deep); }
.opt-radio:checked ~ .option-feedback .fb-cta { display: inline-block; }
.quiz-visual {
  position: sticky; top: 92px;
  min-height: 500px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px; padding: 24px 20px; overflow: hidden;
}
.quiz-visual::before {
  content: ""; position: absolute; inset: 0; background-image: var(--dots-teal); background-size: 18px 18px; opacity: .6;
}
.quiz-visual .quiz-art { position: relative; z-index: 2; display: grid; place-items: center; }
.quiz-visual .char-slot { z-index: 2; }
.quiz-notes {
  position: relative; z-index: 3; display: flex; flex-direction: column; gap: 8px;
  align-items: center; text-align: center; width: 100%; max-width: 340px;
}
.reveal-note {
  font-size: .74rem; font-weight: 700; color: #fff; background: var(--ink);
  border-radius: 3px; padding: 6px 11px;
}
.egg-hint { font-size: .76rem; font-weight: 600; color: var(--ink-soft); line-height: 1.6; }

/* ---------- Result ---------- */
.result-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 24px; }
.result-hero { padding: 32px; position: relative; overflow: hidden; }
.result-hero::before {
  content: ""; position: absolute; right: -30px; top: -30px; width: 140px; height: 140px;
  background: var(--coral-soft); clip-path: polygon(100% 0, 100% 100%, 0 0);
}
.result-type { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; color: var(--coral); margin: 10px 0 2px; line-height: 1.05; }
.result-ja { color: var(--ink-soft); font-weight: 700; letter-spacing: .12em; }
.result-quote { font-size: 1.15rem; font-weight: 700; color: var(--ink); margin: 18px 0; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.share-card { margin-top: 24px; padding: 20px; border-radius: 8px; background: var(--sakura-soft); border: 1px solid var(--line); }
.share-card .mini { font-size: .7rem; font-weight: 800; letter-spacing: .12em; color: var(--ink-soft); }
.radar-wrap { padding: 26px; }
.radar-wrap svg { width: 100%; max-width: 420px; display: block; margin: 0 auto; }
.radar-label { font-size: .74rem; font-weight: 700; fill: var(--ink-soft); }
.score-list { display: grid; gap: 8px; margin-top: 18px; }
.score-row { display: grid; grid-template-columns: 88px 1fr 34px; align-items: center; gap: 10px; font-size: .8rem; font-weight: 700; }
.score-bar { height: 8px; border-radius: 2px; background: #ece8e1; overflow: hidden; }
.score-bar > i { display: block; height: 100%; border-radius: 2px; background: var(--coral); }

/* ---------- Content pages ---------- */
.detail-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 28px; }
.detail-visual { position: sticky; top: 100px; align-self: start; padding: 18px; }
.detail-copy { padding: 28px; }
.bullet-list { padding-left: 20px; color: var(--ink-soft); }
.bullet-list li { margin-bottom: 8px; }
.faq-item { padding: 16px 0; border-bottom: 1px solid var(--line); }
.faq-item:last-child { border-bottom: 0; }
.faq-item strong { display: block; margin-bottom: 5px; font-weight: 800; }

/* ---------- Homepage FAQ accordion (collapsed by default) ---------- */
.faq-list { display: grid; gap: 12px; }
.faq-qa {
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  padding: 0 18px; overflow: hidden;
}
.faq-qa summary {
  list-style: none; cursor: pointer; padding: 16px 32px 16px 0; position: relative;
  font-weight: 800; font-size: .98rem; color: var(--ink);
}
.faq-qa summary::-webkit-details-marker { display: none; }
.faq-qa summary::after {
  content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%;
  background: var(--coral-soft); color: var(--coral-deep); font-size: 1.05rem; font-weight: 800;
  transition: transform .2s ease, background .2s ease;
}
.faq-qa[open] summary::after { content: "−"; background: var(--coral); color: #fff; }
.faq-qa[open] summary { border-bottom: 1px solid var(--line); }
.faq-qa p { margin: 0; padding: 16px 0 20px; font-size: .92rem; line-height: 1.8; color: var(--ink-soft); }
.faq-qa[open] { border-color: var(--coral); }
.info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.info-card { padding: 24px; }
.info-card h3 { margin-bottom: 8px; }
.quiz-page-title {
  font-size: 1rem; font-weight: 900; color: var(--coral-deep);
  letter-spacing: .01em; margin: 0;
}
.disclaimer {
  margin-top: 28px; padding: 15px 18px; border-radius: 6px; font-size: .82rem; color: var(--ink-soft);
  background: #fff; border-left: 5px solid var(--coral);
}

/* ---------- Scroll reveal: subtle per-screen lift ----------
   Progressive enhancement: content is visible by default. Only when JS adds
   .js-reveal to <html> do elements start hidden, then float in on scroll. */
html.js-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 760ms cubic-bezier(.22,.8,.28,1), transform 760ms cubic-bezier(.22,.8,.28,1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
html.js-reveal [data-reveal].is-in { opacity: 1; transform: none; }

/* Children rise in a gentle stagger as their parent screen enters. */
html.js-reveal [data-reveal] .mode-card,
html.js-reveal [data-reveal] .type-card,
html.js-reveal [data-reveal] .info-card,
html.js-reveal [data-reveal] .faq-item,
html.js-reveal [data-reveal] .faq-qa {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 600ms ease, transform 600ms cubic-bezier(.22,.8,.28,1);
}
html.js-reveal [data-reveal].is-in .mode-card,
html.js-reveal [data-reveal].is-in .type-card,
html.js-reveal [data-reveal].is-in .info-card,
html.js-reveal [data-reveal].is-in .faq-item,
html.js-reveal [data-reveal].is-in .faq-qa { opacity: 1; transform: none; }
html.js-reveal [data-reveal].is-in .mode-card:nth-child(2),
html.js-reveal [data-reveal].is-in .type-card:nth-child(2),
html.js-reveal [data-reveal].is-in .info-card:nth-child(2),
html.js-reveal [data-reveal].is-in .faq-qa:nth-child(2) { transition-delay: 90ms; }
html.js-reveal [data-reveal].is-in .mode-card:nth-child(3),
html.js-reveal [data-reveal].is-in .type-card:nth-child(3),
html.js-reveal [data-reveal].is-in .info-card:nth-child(3),
html.js-reveal [data-reveal].is-in .faq-qa:nth-child(3) { transition-delay: 180ms; }
html.js-reveal [data-reveal].is-in .mode-card:nth-child(n+4),
html.js-reveal [data-reveal].is-in .type-card:nth-child(n+4),
html.js-reveal [data-reveal].is-in .info-card:nth-child(n+4),
html.js-reveal [data-reveal].is-in .faq-qa:nth-child(n+4) { transition-delay: 260ms; }

@media (prefers-reduced-motion: reduce) {
  html.js-reveal [data-reveal],
  html.js-reveal [data-reveal] .mode-card,
  html.js-reveal [data-reveal] .type-card,
  html.js-reveal [data-reveal] .info-card,
  html.js-reveal [data-reveal] .faq-item,
  html.js-reveal [data-reveal] .faq-qa {
    opacity: 1 !important; transform: none !important; transition: none !important;
  }
}

/* ---------- Long-form article body ---------- */
.prose-card { padding: clamp(24px, 4vw, 46px); margin-top: 30px; }
.prose { max-width: 900px; }
.prose h2 {
  font-size: 1.5rem; font-weight: 800; color: var(--ink);
  margin: 38px 0 14px; padding-left: 14px; position: relative; line-height: 1.3;
}
.prose h2:first-child { margin-top: 0; }
.prose h2::before { content: ""; position: absolute; left: 0; top: 2px; bottom: 2px; width: 5px; background: var(--coral); }
.prose h3 { font-size: 1.08rem; font-weight: 800; color: var(--coral-deep); margin: 26px 0 10px; }
.prose p { font-size: .97rem; line-height: 1.85; color: #4a4f58; margin: 0 0 16px; }
.prose .long-list { margin: 0 0 18px; }
.prose .long-list li { margin-bottom: 9px; line-height: 1.7; }
.prose + .disclaimer, .prose-card > .disclaimer { margin-top: 34px; }
@media (max-width: 560px) {
  .prose h2 { font-size: 1.3rem; }
  .prose p { font-size: .94rem; }
}

/* ---------- Footer ---------- */
.site-footer { position: relative; z-index: 2; padding: 50px 24px 28px; background: var(--ink); color: #f4f1ea; }
.site-footer::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 8px; background: var(--teal);
}
.footer-inner { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 1.1fr 1.6fr .8fr; gap: 40px; }
.footer-brand strong { font-size: 1.4rem; font-weight: 800; }
.footer-brand p, .footer-note p { color: rgba(244,241,234,.66); font-size: .82rem; }
.footer-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.footer-links h4 { margin: 0 0 10px; font-size: .9rem; color: #fff; }
.footer-links a { display: block; font-size: .82rem; color: rgba(244,241,234,.68); padding: 3px 0; }
.footer-links a:hover { color: var(--sakura); }
.footer-note { text-align: right; }
.footer-email { color: #ffd7d3; font-weight: 800; letter-spacing: .01em; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .main-nav { display: none; position: absolute; top: 62px; left: 16px; right: 16px; flex-direction: column; align-items: flex-start; padding: 18px; border-radius: 10px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
  .main-nav.open { display: flex; }
  .menu-toggle { display: block; }
  .header-cta { margin-left: auto; }
  .hero { grid-template-columns: 1fr; }
  .hero-visual { min-height: 420px; }
  .band-inner { grid-template-columns: 1fr; }
  .mode-grid { grid-template-columns: 1fr; }
  .type-grid { grid-template-columns: repeat(2, 1fr); }
  .quiz-layout, .result-grid, .detail-grid { grid-template-columns: 1fr; }
  /* On narrow screens the two columns stack. The three quiz pages put their
     live dashboard first (handled in the generated dashboard CSS); the
     homepage's static single-question preview keeps its art card first as a
     compact banner so it never slides below the fold. */
  .quiz-layout { align-items: start; }
  .quiz-visual { position: static; order: -1; min-height: 0; flex-direction: row;
                 justify-content: flex-start; gap: 18px; padding: 16px; }
  .quiz-visual .quiz-art { flex: 0 0 96px; }
  .quiz-visual .quiz-art .char-slot { width: 96px; aspect-ratio: 3 / 4; }
  .quiz-visual .quiz-notes { align-items: flex-start; text-align: left; max-width: none; }
  .detail-visual { position: static; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-note { text-align: left; }
}
@media (max-width: 560px) {
  .app-shell { padding: 0 16px 60px; }
  .brand-sub { display: none; }
  .header-cta { display: none; }
  .type-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .info-grid { grid-template-columns: 1fr; }
  .hero-visual { min-height: 360px; }
  .quiz-top { flex-direction: column; align-items: stretch; }
  .progress-wrap { max-width: none; }
}

/* ---------- Quiz stepper ----------
   The one-question-at-a-time reveal, the selected answer highlight, the
   progress bar and the result cards are driven entirely by the generated
   <style id="quiz-dashboard-css"> block in <head> (source: gen_quiz_css.py).
   Radios are the first children of .quiz-page, so those :checked ~ rules
   reach the top bar and both columns below. Only shared base layout lives
   here: all show/hide rules stay in one generated file to avoid specificity
   fights between two stylesheets. */
.css-quiz { margin-top: 18px; }
.q-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.q-num { font-size: .68rem; font-weight: 800; letter-spacing: .12em; color: var(--teal-deep); }
.q-options { display: grid; gap: 10px; margin-top: 0; }

/* ---------- Injected reference tables, lists and art rows ---------- */
.table-wrap { overflow-x: auto; margin: 6px 0 26px; }
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th, .data-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.data-table th { background: var(--coral-soft); font-weight: 800; letter-spacing: .03em; color: var(--coral-deep); }
.data-table td { color: var(--ink-soft); }
.data-table tr:last-child td { border-bottom: 0; }
.data-table a { color: var(--teal-deep); font-weight: 700; text-decoration: underline; }
.data-list { margin: 4px 0 0; padding-left: 22px; }
.data-list li { margin: 8px 0; line-height: 1.7; color: var(--ink-soft); }
.data-list li::marker { color: var(--coral); }
.prose-card h3 { margin: 26px 0 10px; font-size: 1.12rem; }
.art-row { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 18px; }
.art-row .type-photo { width: 200px; flex: 0 0 200px; }
.css-quiz { position: relative; }
#page-faq .faq-list, #page-table .prose-card { margin-top: 0; }

/* ============================================================
   FULL-SCREEN RESULT PAGE
   ============================================================ */
.quiz-result-page { min-height: 100vh; display: flex; flex-direction: column; }

.result-hero-wrap {
  background: var(--result-bg, var(--paper));
  border-bottom: 1px solid var(--line);
  padding: 60px 0 48px;
}
.result-hero-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 48px;
  align-items: start;
}
.result-portrait {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
  aspect-ratio: 3/4;
}
.result-portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.result-eyebrow {
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--coral);
  display: block;
  margin-bottom: 8px;
}
.result-type-name {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  margin: 0 0 4px;
  line-height: 1.1;
}
h2.result-type-name { margin-top: 0; }
.quiz-page-h1 { font-size: 1.5rem; font-weight: 900; margin: 0 0 20px; }
.result-code {
  font-size: .55em;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--coral);
  vertical-align: middle;
  margin-left: 8px;
}
.result-archetype { font-size: 1.15rem; font-weight: 700; color: var(--ink-soft); margin: 4px 0 12px; }
.result-tagline { font-size: 1rem; font-style: italic; color: var(--ink-soft); margin: 0 0 14px; border-left: 3px solid var(--coral); padding-left: 14px; }
.result-def { font-size: .95rem; line-height: 1.7; color: var(--ink-soft); margin: 0 0 20px; }
.result-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 28px; }

/* ---------- Share buttons ---------- */
.result-share { margin-top: 8px; }
.share-label {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: block;
  margin-bottom: 10px;
}
.share-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  font-family: inherit;
}
.share-btn:hover { opacity: .85; transform: translateY(-1px); }
.share-twitter  { background: #000; color: #fff; }
.share-facebook { background: #1877f2; color: #fff; }
.share-reddit   { background: #ff4500; color: #fff; }
.share-copy     { background: var(--coral); color: #fff; }

/* ---------- JS-driven quiz stepper ---------- */
.quiz-step-wrap { max-width: 680px; margin: 32px auto 0; padding: 0 16px; }
.quiz-card { padding: 36px; }
.q-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 14px 18px;
  font-size: .95rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.q-option:hover { border-color: var(--coral); background: var(--coral-soft); }
.q-option.option-selected {
  border-color: var(--coral);
  background: var(--coral-soft);
  font-weight: 700;
}
.q-nav-row { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; }
.q-nav {
  background: none;
  border: none;
  font-family: inherit;
  font-size: .88rem;
  font-weight: 700;
  color: var(--coral-deep);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.q-hint { font-size: .82rem; color: var(--ink-xsoft); font-style: italic; }

/* ---------- Result footer ---------- */
.result-footer-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 40px 24px;
}

@media (max-width: 700px) {
  .result-hero-inner { grid-template-columns: 1fr; }
  .result-portrait { max-width: 240px; }
  .quiz-card { padding: 20px; }
}
