/* Shared UX backbone for every quiz, grounded in Bri's Substack publication. */
:root {
  --paper: #faf5ff;
  --surface: #ebe6f0;
  --surface-strong: #d8d4dd;
  --detail: #e1dde6;
  --ink: #4a375d;
  --muted: #756f7a;
  --accent: #c026d3;
  --accent-dark: #ac22bd;
  --accent-soft: rgba(192, 38, 211, 0.1);
  --white: #ffffff;
  --radius: 8px;
  --max: 728px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 18px/1.55 "SF Pro Display", -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1 { font-size: clamp(1.85rem, 5vw, 2rem); line-height: 1.12; letter-spacing: -0.035em; margin: 0.2em 0 0.35em; }
h2 { font-size: 1.45rem; line-height: 1.25; letter-spacing: -0.02em; margin: 0.7em 0 0.55em; }
h3 { font-size: 1.08rem; line-height: 1.35; margin: 1.5em 0 0.45em; }
p { margin: 0.5em 0; }
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 0.18em; }

/* Publication bar mirrors the visual rhythm of brichapman.com. */
.publication-bar {
  min-height: 72px;
  border-bottom: 1px solid var(--detail);
  background: rgba(250, 245, 255, 0.94);
}
.publication-bar__inner {
  width: 100%;
  min-height: 72px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: minmax(40px, 1fr) auto minmax(40px, 1fr);
  align-items: center;
}
.publication-mark { width: 40px; height: 40px; display: block; }
.publication-mark img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; display: block; }
.publication-name { font-size: 1.28rem; font-weight: 700; text-decoration: none; letter-spacing: -0.02em; }
.subscribe-link {
  justify-self: end;
  padding: 9px 17px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
}
.subscribe-link:hover { background: var(--accent-dark); }

.app { max-width: var(--max); margin: 0 auto; padding: 38px 24px 88px; }

.brand { margin: 0; }
.tagline { color: var(--muted); margin: 0.15em 0 1.75em; }
.subtitle { color: var(--muted); font-size: 1.12rem; line-height: 1.45; }
.lede { font-size: 1.08rem; max-width: 64ch; }
.meta { color: var(--muted); font-size: 0.9rem; }
.loading { text-align: center; color: var(--muted); }

/* One fixed pencil character follows each quiz through every screen. */
.quiz-character {
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.quiz-character img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.quiz-character--gallery { width: 112px; height: 112px; margin: -4px 0 8px; }
.quiz-character--intro { width: min(330px, 72vw); height: min(330px, 72vw); margin: -12px auto 8px; }
.quiz-character--section { width: 164px; height: 164px; margin: -20px 0 -6px auto; }
.quiz-character--gate { width: 210px; height: 210px; margin: -14px auto 4px; }
.quiz-character--result { width: 240px; height: 240px; margin: -16px auto 8px; }

/* Landing grid */
.grid { display: grid; gap: 12px; margin-top: 28px; }
.card {
  display: block; background: transparent; border: 1px solid var(--detail);
  border-radius: var(--radius); padding: 20px; text-decoration: none; color: var(--ink);
  transition: border-color 0.12s ease, background-color 0.12s ease;
}
.card:hover { border-color: rgba(192, 38, 211, 0.45); background: var(--accent-soft); }
.card h3 { margin: 0.3em 0 0.2em; }
.card p { color: var(--muted); margin: 0; }

/* Buttons */
button { font: inherit; cursor: pointer; }
.primary {
  background: var(--accent); color: var(--white); border: 1px solid var(--accent); border-radius: 6px;
  padding: 12px 22px; font-weight: 600; font-size: 0.95rem; margin-top: 14px;
  display: inline-block; text-decoration: none;
}
.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.primary[disabled] { opacity: 0.4; cursor: not-allowed; }
.ghost {
  background: transparent; border: 1px solid var(--surface-strong); border-radius: 999px;
  padding: 10px 19px; color: var(--ink); margin-top: 14px;
}
.ghost:hover { border-color: var(--accent); background: var(--accent-soft); }
.ghost-link { text-decoration: none; }

/* Progress */
.progress { height: 4px; background: var(--surface-strong); border-radius: 999px; overflow: hidden; margin-bottom: 12px; }
.bar { height: 100%; background: var(--accent); transition: width 0.3s ease; }
.step { color: var(--muted); font-size: 0.85rem; margin: 0; }

/* Questions */
.question { margin: 28px 0; }
.prompt { font-weight: 600; line-height: 1.4; }
.options { display: grid; gap: 10px; }
.options--multiple-choice { grid-template-columns: 1fr; }
.option {
  text-align: left; background: transparent; border: 1px solid var(--surface-strong);
  border-radius: var(--radius); padding: 13px 16px; color: var(--ink); transition: border-color 0.1s, background-color 0.1s;
}
.option:hover { border-color: rgba(192, 38, 211, 0.55); background: rgba(255, 255, 255, 0.28); }
.option.selected { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }

.options--this-or-that {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
}
.option--this-or-that { min-height: 76px; text-align: center; font-size: 1rem; }
.this-or-that__divider {
  align-self: center; color: var(--muted); font-family: Georgia, "Times New Roman", serif;
  font-style: italic; font-size: 0.9rem;
}

.scale-wrap { margin-top: 4px; }
.scale-endpoints {
  display: flex; justify-content: space-between; gap: 12px; margin-bottom: 7px;
  color: var(--muted); font-size: 0.78rem;
}
.options--scale { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.option--scale {
  min-height: 58px; padding: 10px 7px; border-radius: 0; text-align: center;
  font-size: 0.82rem; line-height: 1.25;
}
.option--scale + .option--scale { border-left: 0; }
.option--scale:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.option--scale:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.option--scale.selected + .option--scale { border-left: 1px solid var(--accent); }

.nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }
.nav .primary { margin-left: auto; }

/* Email gate */
.gate .email {
  width: 100%; padding: 13px 15px; font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--white); border: 1px solid var(--surface-strong);
  border-radius: var(--radius); margin: 14px 0 10px;
}
.consent { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: 0.92rem; }
.fineprint { color: var(--accent); font-size: 0.9rem; min-height: 1.2em; }

/* Result */
.result-kicker { color: var(--muted); font-size: 0.84rem; margin: 0; }
.result-title { color: var(--ink); }
.result-summary { font-size: 1.15rem; }
.result-detail p { margin: 0.7em 0; }
.bullets { padding-left: 1.2em; }
.bullets li { margin: 0.35em 0; }

/* Profile bars */
.profile { margin: 30px 0; padding: 20px; background: var(--surface); border: 1px solid var(--detail); border-radius: var(--radius); }
.profile-row { display: grid; grid-template-columns: 130px 1fr 44px; align-items: center; gap: 10px; margin: 8px 0; }
.profile-label { font-size: 0.85rem; }
.profile-bar { background: var(--surface-strong); border-radius: 999px; height: 8px; overflow: hidden; }
.profile-fill { background: var(--accent); height: 100%; }
.profile-pct { font-size: 0.8rem; color: var(--muted); text-align: right; }

/* Prize */
.prize { background: var(--accent-soft); border-left: 4px solid var(--accent); padding: 20px; margin-bottom: 24px; }
.prize .code { font-family: ui-monospace, Menlo, monospace; font-size: 1.1rem; font-weight: 700; }

/* Share + CTA */
.share, .cta { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--detail); }
.share-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); gap: 10px; margin: 10px 0; }
.share-btn { background: transparent; border: 1px solid var(--surface-strong); border-radius: 999px; padding: 9px 16px; text-decoration: none; font-size: 0.9rem; }
.share-btn:hover { border-color: var(--accent); background: var(--accent-soft); }

:focus-visible { outline: 3px solid rgba(192, 38, 211, 0.32); outline-offset: 3px; }

@media (min-width: 560px) {
  .grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 520px) {
  body { font-size: 17px; }
  .publication-bar__inner { padding: 0 16px; }
  .publication-name { font-size: 1.08rem; }
  .subscribe-link { padding: 8px 12px; font-size: 0.82rem; }
  .app { padding: 28px 20px 72px; }
  .profile { padding: 16px; }
  .profile-row { grid-template-columns: 100px 1fr 38px; gap: 8px; }
  .options--this-or-that { grid-template-columns: 1fr; gap: 8px; }
  .this-or-that__divider { justify-self: center; }
  .option--scale { padding: 9px 4px; font-size: 0.73rem; }
  .quiz-character--gallery { width: 96px; height: 96px; }
  .quiz-character--section { width: 132px; height: 132px; margin-top: -14px; }
  .quiz-character--gate { width: 180px; height: 180px; }
  .quiz-character--result { width: 200px; height: 200px; }
}

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