:root {
  --bg: #faf8f5;
  --panel: #ffffff;
  --ink: #18141d;
  --muted: #5f5869;
  --pink: #d42a66;
  --pink-dark: #b81f57;
  --pink-tint: #fde7ef;
  --line: #18141d;
  --soft-line: #e6e1ea;
  --radius: 10px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .06);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, .08);
  --tone: radial-gradient(rgba(24, 20, 29, .16) 1.2px, transparent 1.4px);
  --head: "Bricolage Grotesque", "Nunito", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--body);
}
img { max-width: 100%; height: auto; }
a { color: var(--pink-dark); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
main.wrap { padding-bottom: 64px; }

h1, h2, h3 { font-family: var(--head); font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 44px; margin: 0 0 12px; }
h2 { font-size: 28px; margin: 48px 0 12px; }
h3 { font-size: 22px; margin: 32px 0 8px; }

/* header */
.site-head { border-bottom: 3px solid var(--line); background: var(--panel); }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font: 700 22px/1 var(--head); color: var(--ink); text-decoration: none; }
.logo-mark {
  display: inline-grid; place-items: center; width: 36px; height: 36px;
  background: var(--pink); color: #fff; border: 2px solid var(--line); border-radius: 50%;
  font: 700 18px/1 system-ui, sans-serif;
}
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { padding: 8px 12px; border-radius: var(--radius); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 16px; }
.nav a:hover { background: var(--pink-tint); }
.nav a[aria-current="page"] { background: var(--ink); color: #fff; }

/* hero */
.hero { padding: 48px 0 24px; max-width: 760px; }
.hero-eyebrow {
  display: inline-block; margin: 0 0 12px; padding: 4px 12px;
  border: 2px solid var(--line); border-radius: 999px; background: var(--pink-tint);
  font-weight: 600; font-size: 14px;
}
.lede { font-size: 18px; color: var(--muted); margin: 0; max-width: 70ch; }

/* quiz frame: the manga panel */
.quiz-frame { position: relative; margin: 8px 0 16px; }
.quiz-frame::before {
  content: ""; position: absolute; right: -12px; top: -12px; width: 45%; height: 70%;
  background-image: var(--tone); background-size: 8px 8px; border-radius: var(--radius); z-index: 0;
}
.dt-panel {
  position: relative; z-index: 1;
  background: var(--panel); border: 3px solid var(--line); border-radius: var(--radius);
  padding: 32px; box-shadow: var(--shadow-2);
}
.dt-panel[hidden] { display: none; }
.dt-kicker { margin: 0 0 8px; font-weight: 600; color: var(--pink-dark); font-size: 16px; }
.dt-intro-text { font-size: 18px; margin: 0 0 24px; max-width: 60ch; }
.dt-note { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.dt-note:empty { display: none; }

.dt-btn, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 24px; border: 2px solid var(--line); border-radius: var(--radius);
  background: var(--pink); color: #fff; font: 600 17px/1.2 var(--body); text-decoration: none; cursor: pointer;
}
.dt-btn:hover, .btn:hover { background: var(--pink-dark); color: #fff; }
.dt-btn-ghost, .btn-ghost { background: var(--panel); color: var(--ink); }
.dt-btn-ghost:hover, .btn-ghost:hover { background: var(--pink-tint); color: var(--ink); }
.dt-link { background: none; border: 0; padding: 8px 0; font: 600 16px/1.2 var(--body); color: var(--pink-dark); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.dt-progress { height: 8px; border: 2px solid var(--line); border-radius: 999px; overflow: hidden; margin-bottom: 16px; background: var(--panel); }
.dt-progress span { display: block; height: 100%; width: 0; background: var(--pink); transition: width .25s ease; }
.dt-qhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 36px; }
.dt-qnum { margin: 0; font-size: 14px; font-weight: 600; color: var(--muted); }
.dt-question { font: 700 28px/1.25 var(--head); margin: 8px 0 24px; }

.dt-options { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dt-bubble {
  position: relative; text-align: left; min-height: 64px; padding: 16px 18px;
  background: var(--panel); color: var(--ink); border: 2px solid var(--line); border-radius: 22px;
  font: 600 17px/1.4 var(--body); cursor: pointer; transition: background .15s ease, transform .15s ease;
}
.dt-bubble::after {
  content: ""; position: absolute; left: 26px; bottom: -10px; width: 16px; height: 16px;
  background: inherit; border-right: 2px solid var(--line); border-bottom: 2px solid var(--line);
  transform: rotate(45deg); border-bottom-right-radius: 3px;
}
.dt-bubble:hover { background: var(--pink-tint); transform: translateY(-2px); }
.dt-bubble.is-picked { background: var(--ink); color: #fff; }

/* result card */
.dt-result { text-align: left; }
.dt-jp { margin: 0; font-size: 22px; color: var(--muted); }
.dt-rname { margin: 0; font: 700 48px/1.1 var(--head); color: var(--pink-dark); }
.dt-tag { margin: 4px 0 16px; font-weight: 600; font-size: 18px; }
.dt-rtext { margin: 0 0 16px; max-width: 65ch; }
.dt-tie { padding: 12px 16px; border-radius: var(--radius); background: var(--pink-tint); margin: 0 0 16px; }
.dt-bars-title { margin: 24px 0 8px; font-weight: 600; }
.dt-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-width: 560px; }
.dt-bars li { display: grid; grid-template-columns: 110px 1fr 48px; align-items: center; gap: 12px; font-size: 16px; }
.dt-bars li.dt-more { display: none; }
.dt-bars.is-open li.dt-more { display: grid; }
.dt-bars a { color: var(--ink); font-weight: 600; }
.dt-meter { height: 14px; border: 2px solid var(--line); border-radius: 999px; overflow: hidden; background-image: var(--tone); background-size: 6px 6px; }
.dt-meter span { display: block; height: 100%; background: var(--pink); }
.dt-bars b { text-align: right; }
.dt-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* prose */
.prose { max-width: 70ch; }
.prose p, .prose li { font-size: 17px; }
.prose ul, .prose ol { padding-left: 24px; }
.prose li { margin: 4px 0; }
.prose table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 16px; }
.prose th, .prose td { border: 2px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
.prose th { background: var(--pink-tint); }
.prose blockquote { margin: 16px 0; padding: 12px 16px; border-left: 4px solid var(--pink); background: var(--panel); }

/* faq */
.faq { max-width: 760px; margin-top: 48px; }
.faq-item { border: 2px solid var(--line); border-radius: var(--radius); background: var(--panel); margin: 12px 0; }
.faq-item summary { cursor: pointer; padding: 16px 18px; font-weight: 600; font-size: 17px; }
.faq-item p { margin: 0; padding: 0 18px 16px; }

/* inner pages */
.page { padding-top: 48px; }
.page-head { max-width: 760px; margin-bottom: 24px; }
.meta { color: var(--muted); font-size: 14px; margin: 0; }
.cta-row { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }

.type-index { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 32px; }
.type-index a {
  padding: 6px 12px; border: 2px solid var(--line); border-radius: 999px; background: var(--panel);
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px;
}
.type-index a:hover { background: var(--pink-tint); }
.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.type-card {
  background: var(--panel); border: 3px solid var(--line); border-radius: var(--radius);
  padding: 24px; scroll-margin-top: 24px;
}
.type-card:target { box-shadow: 0 0 0 4px var(--pink); }
.type-head { position: relative; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 2px dashed var(--soft-line); }
.type-head h2 { margin: 4px 0 0; font-size: 22px; }
.type-jp { color: var(--muted); font-size: 16px; }
.type-card p { margin: 0 0 12px; font-size: 16px; }
.type-ex { color: var(--muted); }

/* footer */
.site-foot { border-top: 3px solid var(--line); background: var(--panel); padding: 32px 0; }
.foot-row { display: grid; gap: 12px; }
.foot-brand, .foot-copy { margin: 0; font-size: 15px; color: var(--muted); }
.foot-nav { display: flex; flex-wrap: wrap; gap: 16px; }
.foot-nav a { color: var(--ink); font-weight: 600; font-size: 15px; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  h1 { font-size: 30px; }
  h2 { font-size: 24px; }
  .head-row { flex-direction: column; align-items: flex-start; gap: 8px; padding-top: 12px; padding-bottom: 12px; }
  .hero { padding: 24px 0 16px; }
  .quiz-frame::before { right: -6px; top: -6px; }
  .dt-panel { padding: 20px 16px; }
  .dt-question { font-size: 22px; }
  .dt-options { grid-template-columns: 1fr; gap: 16px; }
  .dt-rname { font-size: 36px; }
  .dt-bars li { grid-template-columns: 92px 1fr 44px; gap: 8px; }
  .dt-actions .dt-btn, .cta-row .btn { width: 100%; }
  .type-grid { grid-template-columns: 1fr; }
  .page { padding-top: 24px; }
}
