/* ==========================================================================
   分院帽 · 哈利波特分院测试
   Design language: Cow Brand Aka — red #e60012, white, soft rounded cards
   ========================================================================== */

@font-face {
  font-family: 'Rokkitt';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('../fonts/rokkitt-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Zen Kaku Gothic New';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/zenkaku-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Zen Kaku Gothic New';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/zenkaku-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Zen Kaku Gothic New';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/zenkaku-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

:root {
  --red: #e60012;
  --red-hover: #cc0010;
  --red-active: #b3000f;
  --red-disabled: #f08080;
  --red-soft: #fff1f1;
  --red-wash: #fff8f7;
  --ink: #1e1e1e;
  --ink-soft: #45413f;
  --muted: #6f6a67;
  --muted-light: #736c67;
  --line: #e8e3e0;
  --line-strong: #d8d1cc;
  --surface: #f7f4f2;
  --surface-2: #efeae7;
  --white: #ffffff;
  --house-gryffindor: #8e0e00;
  --house-hufflepuff: #a75e00;
  --house-ravenclaw: #1c388e;
  --house-slytherin: #11652a;
  --radius-sm: 4px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 999px;
  --shadow-sm: 0 2px 8px rgba(30, 30, 30, 0.04);
  --shadow-hover: 0 16px 36px rgba(30, 30, 30, 0.1);
  --font-sans: 'Zen Kaku Gothic New', 'Noto Sans SC', 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Source Han Sans CN', sans-serif;
  --font-serif: 'Rokkitt', 'Times New Roman', Georgia, serif;
  --container: 1180px;
  --header-h: 76px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
}
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.menu-open {
  overflow: hidden;
}
img {
  display: block;
  max-width: 100%;
  height: auto;
}
svg {
  display: block;
}
a {
  color: var(--red);
  text-decoration: none;
  transition: color 0.25s var(--ease), opacity 0.25s var(--ease);
}
a:hover {
  color: var(--red-hover);
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
figure,
blockquote {
  margin: 0;
}
h1,
h2,
h3,
h4 {
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.01em;
}
ul,
ol {
  padding: 0;
}
[hidden] {
  display: none !important;
}
::selection {
  background: var(--red);
  color: #fff;
}
:focus-visible {
  outline: 3px solid rgba(230, 0, 18, 0.45);
  outline-offset: 3px;
}
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 9999;
  padding: 10px 18px;
  border-radius: 0 0 12px 12px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
}
.skip-link:focus {
  top: 0;
  color: #fff;
}
.text-red {
  color: var(--red);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--red);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
}
.eyebrow svg {
  width: 14px;
  height: 14px;
}
.eyebrow--light {
  color: rgba(255, 255, 255, 0.78);
}
.section {
  padding: 80px 0;
}
.section--tight {
  padding: 56px 0;
}
.section--surface {
  background: var(--surface);
}
.section--wash {
  background:
    radial-gradient(circle at 88% 0%, rgba(230, 0, 18, 0.06), transparent 34%),
    var(--white);
}
.section-head {
  max-width: 760px;
  margin-bottom: 40px;
}
.section-head--center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.section-head h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  line-height: 1.24;
  text-wrap: balance;
}
.section-head p {
  margin-top: 16px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}
.section-head--center .eyebrow {
  justify-content: center;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  background: none;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease),
    border-color 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.btn svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  transition: transform 0.3s var(--ease);
}
.btn:hover svg {
  transform: translateX(3px);
}
.btn--primary {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.btn--primary:hover {
  background: var(--red-hover);
  border-color: var(--red-hover);
  color: #fff;
  transform: translateY(-1px);
}
.btn--primary:active {
  background: var(--red-active);
  border-color: var(--red-active);
  transform: translateY(0);
}
.btn--primary:disabled {
  background: var(--red-disabled);
  border-color: var(--red-disabled);
  color: #fff;
  cursor: not-allowed;
  transform: none;
}
.btn--secondary {
  background: #fff;
  border-color: var(--red);
  color: var(--red);
}
.btn--secondary:hover {
  background: var(--red);
  color: #fff;
  transform: translateY(-1px);
}
.btn--secondary:active {
  background: var(--red-active);
  border-color: var(--red-active);
}
.btn--light {
  background: #fff;
  border-color: #fff;
  color: var(--red);
}
.btn--light:hover {
  background: #fff;
  color: var(--red-active);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}
.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-soft);
  font-weight: 500;
}
.btn--ghost:hover {
  background: var(--surface-2);
  color: var(--red);
}
.btn--ghost-light {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.55);
  color: #fff;
}
.btn--ghost-light:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #fff;
  color: #fff;
}
.btn--sm {
  min-height: 40px;
  padding: 8px 18px;
  font-size: 14px;
}
.btn--lg {
  min-height: 54px;
  padding: 15px 30px;
  font-size: 16px;
}
.btn--block {
  width: 100%;
}
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}
.link-arrow svg {
  width: 17px;
  height: 17px;
  transition: transform 0.3s var(--ease);
}
.link-arrow:hover svg {
  transform: translateX(4px);
}

/* ---------- Brand & header ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  flex: 0 0 auto;
}
.brand:hover {
  color: var(--ink);
}
.brand__mark {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  color: var(--red);
}
.brand__mark svg {
  width: 100%;
  height: 100%;
}
.brand__mark--light {
  width: 42px;
  height: 42px;
  padding: 5px;
  border-radius: 50%;
  background: #fff;
  color: var(--red);
}
.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand__text strong {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.brand--light {
  color: #fff;
}
.brand--light:hover {
  color: #fff;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 999;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(232, 227, 224, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: box-shadow 0.3s var(--ease), background-color 0.3s var(--ease);
}
.site-header.is-scrolled {
  box-shadow: 0 6px 22px rgba(30, 30, 30, 0.07);
  background: rgba(255, 255, 255, 0.98);
}
.site-header__inner {
  display: flex;
  min-height: var(--header-h);
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}
.site-nav > a:not(.btn) {
  padding: 9px 13px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}
.site-nav > a:not(.btn):hover {
  background: var(--surface);
  color: var(--red);
}
.site-nav > a.is-active {
  background: var(--red-soft);
  color: var(--red);
  font-weight: 700;
}
.site-nav__cta {
  display: none;
  margin-left: 10px;
}
.site-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-cta {
  min-height: 42px;
}
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}
.nav-toggle svg {
  width: 22px;
  height: 22px;
}
.nav-toggle__close {
  display: none;
}
.nav-toggle[aria-expanded='true'] .nav-toggle__open {
  display: none;
}
.nav-toggle[aria-expanded='true'] .nav-toggle__close {
  display: block;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 92% 8%, rgba(230, 0, 18, 0.09), transparent 30%),
    radial-gradient(circle at 0% 88%, rgba(230, 0, 18, 0.045), transparent 34%),
    #fff;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(230, 0, 18, 0.1) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(90deg, transparent 35%, rgba(0, 0, 0, 0.55) 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 35%, rgba(0, 0, 0, 0.55) 100%);
  pointer-events: none;
}
.hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
  align-items: center;
  gap: 56px;
  padding-block: 68px 76px;
}
.hero__copy {
  max-width: 620px;
}
.hero h1 {
  font-size: clamp(2.5rem, 4.8vw, 3.7rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.hero__lead {
  max-width: 570px;
  margin-top: 22px;
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1.82;
}
.hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.5;
}
.chip svg {
  width: 14px;
  height: 14px;
  color: var(--red);
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}
.hero__note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 12.5px;
}
.hero__note svg {
  width: 15px;
  height: 15px;
  color: var(--red);
  flex: 0 0 auto;
}
.hero__art {
  position: relative;
  aspect-ratio: 1 / 1.04;
  min-height: 420px;
  border-radius: 28px;
  overflow: hidden;
  background: #220b0a;
  box-shadow: 0 24px 60px rgba(68, 12, 9, 0.22);
  isolation: isolate;
}
.hero__art-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: -2;
}
.hero__art::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(20, 6, 5, 0.14) 0%, rgba(20, 6, 5, 0.34) 52%, rgba(20, 6, 5, 0.84) 100%),
    linear-gradient(112deg, rgba(230, 0, 18, 0.5) 0%, rgba(230, 0, 18, 0.03) 56%);
}
.hero__art-crest {
  position: absolute;
  top: 47%;
  left: 50%;
  width: 58%;
  max-width: 300px;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.42));
  animation: crest-float 8s ease-in-out infinite;
}
.hero__badge {
  position: absolute;
  top: 22px;
  left: 22px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
}
.hero__badge span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(230, 0, 18, 0.13);
}
.hero__houses {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 12px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: rgba(20, 10, 9, 0.42);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.hero__house {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 10.5px;
  line-height: 1.3;
  text-align: center;
}
.hero__house img {
  width: 38px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.35));
}
.hero__house:hover {
  color: #fff;
}
.hero__scribble {
  position: absolute;
  right: 18px;
  top: 18px;
  display: flex;
  align-items: center;
  gap: 5px;
  color: rgba(255, 255, 255, 0.78);
  font-family: var(--font-serif);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.hero__scribble svg {
  width: 14px;
  height: 14px;
}
@keyframes crest-float {
  0%,
  100% {
    transform: translate(-50%, -50%);
  }
  50% {
    transform: translate(-50%, calc(-50% - 8px));
  }
}

/* ---------- Stats strip ---------- */
.stats-strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.stats-strip__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.stat {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 24px 20px;
  border-left: 1px solid var(--line);
}
.stat:first-child {
  border-left: 0;
  padding-left: 0;
}
.stat strong {
  color: var(--red);
  font-family: var(--font-serif);
  font-size: 34px;
  font-weight: 600;
  line-height: 1;
}
.stat span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* ---------- Houses ---------- */
.house-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}
.house-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--ink);
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease),
    border-color 0.3s var(--ease);
}
.house-card:hover {
  color: var(--ink);
  border-color: transparent;
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}
.house-card__top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 126px;
  padding: 10px 12px 8px;
  border-radius: 12px;
  background: var(--house-soft, var(--surface));
}
.house-card--gryffindor .house-card__top {
  --house-soft: #fbeeed;
}
.house-card--hufflepuff .house-card__top {
  --house-soft: #fff4dc;
}
.house-card--ravenclaw .house-card__top {
  --house-soft: #eef2fb;
}
.house-card--slytherin .house-card__top {
  --house-soft: #eaf5ed;
}
.house-card__crest {
  width: 88px;
  height: 100px;
  object-fit: contain;
  margin: 0 auto;
  transition: transform 0.45s var(--ease);
}
.house-card:hover .house-card__crest {
  transform: translateY(-4px) rotate(-2deg);
}
.house-card__badge {
  position: absolute;
  top: 10px;
  right: 10px;
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: var(--radius-full);
  background: #fff;
  color: var(--house-accent, var(--red));
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.house-card__title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 18px;
}
.house-card__title strong {
  font-size: 23px;
  line-height: 1.2;
}
.house-card__title em {
  color: var(--muted-light);
  font-family: var(--font-serif);
  font-size: 13px;
  font-style: normal;
  letter-spacing: 0.06em;
}
.house-card__traits {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}
.house-card__traits span {
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.5;
}
.house-card__text {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.72;
  flex: 1;
}
.house-card__link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 18px;
  color: var(--red);
  font-size: 13.5px;
  font-weight: 700;
}
.house-card__link svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s var(--ease);
}
.house-card:hover .house-card__link svg {
  transform: translateX(4px);
}

/* ---------- Sample questions ---------- */
.sample-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.sample-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
}
.sample-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.sample-card__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 26px;
  padding: 0 8px;
  border-radius: var(--radius-full);
  background: var(--red);
  color: #fff;
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.sample-card__label {
  color: var(--muted-light);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.sample-card h3 {
  margin-top: 14px;
  font-size: 17px;
  line-height: 1.55;
}
.sample-card ul {
  margin-top: 14px;
  list-style: none;
}
.sample-card li {
  display: flex;
  gap: 9px;
  padding: 9px 0;
  border-top: 1px dashed var(--line);
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.6;
}
.sample-card li:first-child {
  border-top: 0;
}
.sample-card li span {
  flex: 0 0 auto;
  color: var(--red);
  font-family: var(--font-serif);
  font-weight: 600;
}
.sample-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.sample-note svg {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: var(--red);
  flex: 0 0 auto;
}

/* ---------- Steps ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  counter-reset: step;
}
.step-card {
  position: relative;
  padding: 28px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
}
.step-card__num {
  display: block;
  color: var(--red);
  font-family: var(--font-serif);
  font-size: 40px;
  font-weight: 600;
  line-height: 1;
  opacity: 0.9;
}
.step-card__icon {
  position: absolute;
  top: 24px;
  right: 24px;
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
}
.step-card__icon svg {
  width: 19px;
  height: 19px;
}
.step-card h3 {
  margin-top: 18px;
  font-size: 19px;
}
.step-card p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.75;
}

/* ---------- Result preview ---------- */
.result-preview {
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.06fr);
  align-items: center;
  gap: 56px;
}
.demo-result {
  position: relative;
  overflow: hidden;
  padding: 34px;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, #1f1c18 0%, #5c0b07 58%, #8e0e00 100%);
  color: #fff;
  box-shadow: 0 24px 54px rgba(80, 14, 10, 0.24);
}
.demo-result::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.55) 0.8px, transparent 0.8px);
  background-size: 34px 34px;
  opacity: 0.1;
  pointer-events: none;
}
.demo-result__badge {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius-full);
  color: rgba(255, 255, 255, 0.82);
  font-size: 11px;
  letter-spacing: 0.08em;
}
.demo-result__badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffb3ad;
}
.demo-result__body {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 22px;
}
.demo-result__crest {
  width: 118px;
  height: 132px;
  object-fit: contain;
  flex: 0 0 auto;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35));
}
.demo-result__name {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  letter-spacing: 0.08em;
}
.demo-result h3 {
  margin-top: 4px;
  font-size: 27px;
  line-height: 1.25;
}
.demo-result__desc {
  position: relative;
  z-index: 1;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.86);
  font-size: 14.5px;
  line-height: 1.8;
}
.demo-result__bars {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 18px;
  margin-top: 20px;
}
.demo-bar {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
}
.demo-bar__row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}
.demo-bar__row b {
  color: #fff;
  font-family: var(--font-serif);
  font-size: 13px;
}
.demo-bar__track {
  display: block;
  height: 5px;
  overflow: hidden;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.2);
}
.demo-bar__fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #fff;
}
.result-preview__text h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
}
.result-preview__text > p {
  margin-top: 16px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.85;
}
.result-features {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}
.result-feature {
  display: flex;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.result-feature svg {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  color: var(--red);
  flex: 0 0 auto;
}
.result-feature strong {
  display: block;
  font-size: 15px;
}
.result-feature p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}

/* ---------- Two-up explainer ---------- */
.explainer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.explainer {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
}
.explainer__icon {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--red-soft);
  color: var(--red);
}
.explainer__icon svg {
  width: 22px;
  height: 22px;
}
.explainer h3 {
  margin-top: 18px;
  font-size: 20px;
}
.explainer p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.8;
}
.explainer ul {
  margin-top: 12px;
  padding-left: 0;
  list-style: none;
  color: var(--ink-soft);
  font-size: 14px;
}
.explainer li {
  position: relative;
  padding-left: 18px;
  margin-top: 7px;
  line-height: 1.7;
}
.explainer li::before {
  content: '';
  position: absolute;
  top: 0.66em;
  left: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
}

/* ---------- FAQ ---------- */
.faq-list {
  border-top: 1px solid var(--line);
}
.faq-item {
  border-bottom: 1px solid var(--line);
}
.faq-item summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 0;
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item__q {
  flex: 0 0 auto;
  color: var(--red);
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
}
.faq-item__title {
  flex: 1;
  color: var(--ink);
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.55;
}
.faq-item__icon {
  display: inline-flex;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--red);
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}
.faq-item__icon svg {
  width: 16px;
  height: 16px;
}
.faq-item__icon svg:last-child {
  display: none;
}
.faq-item[open] .faq-item__icon {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.faq-item[open] .faq-item__icon svg:first-child {
  display: none;
}
.faq-item[open] .faq-item__icon svg:last-child {
  display: block;
}
.faq-item__a {
  max-width: 820px;
  padding: 0 44px 22px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.85;
}
.faq-item__a p + p {
  margin-top: 10px;
}
.faq-item__a a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- CTA band ---------- */
.cta-band {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 90% 20%, rgba(255, 255, 255, 0.12), transparent 30%),
    linear-gradient(115deg, #c40010 0%, #e60012 55%, #b3000f 100%);
  color: #fff;
}
.cta-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.7) 0.8px, transparent 0.8px);
  background-size: 30px 30px;
  opacity: 0.1;
}
.cta-band__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding-block: 58px;
}
.cta-band__crest {
  position: absolute;
  top: 50%;
  right: 270px;
  width: 190px;
  height: auto;
  opacity: 0.11;
  transform: translateY(-50%) rotate(-8deg);
  pointer-events: none;
}
.cta-band__copy {
  max-width: 640px;
}
.cta-band h2 {
  max-width: 22em;
  color: #fff;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  text-wrap: balance;
}
.cta-band p {
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 15.5px;
  line-height: 1.8;
}
.cta-band__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 0 0 auto;
}

/* ---------- Page hero ---------- */
.page-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 92% 0%, rgba(230, 0, 18, 0.08), transparent 30%),
    #fff;
}
.page-hero__inner {
  padding: 26px 0 54px;
}
.page-hero__text {
  max-width: 820px;
}
.page-hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.18;
  letter-spacing: -0.02em;
}
.page-hero__lead {
  max-width: 720px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 17.5px;
  line-height: 1.82;
}
.breadcrumbs {
  padding-top: 22px;
}
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
}
.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-light);
  font-size: 12.5px;
  line-height: 1.5;
}
.breadcrumbs li + li::before {
  content: '/';
  color: var(--line-strong);
}
.breadcrumbs a {
  color: var(--muted);
}
.breadcrumbs a:hover {
  color: var(--red);
}
.breadcrumbs li[aria-current='page'] {
  color: var(--ink-soft);
}

/* House hero variants */
.house-hero {
  border-bottom: 0;
  color: #fff;
}
.house-hero .breadcrumbs a,
.house-hero .breadcrumbs li,
.house-hero .breadcrumbs li[aria-current='page'] {
  color: rgba(255, 255, 255, 0.7);
}
.house-hero .breadcrumbs a:hover {
  color: #fff;
}
.house-hero .breadcrumbs li + li::before {
  color: rgba(255, 255, 255, 0.4);
}
.house-hero .eyebrow {
  color: rgba(255, 255, 255, 0.78);
}
.house-hero .page-hero__lead {
  color: rgba(255, 255, 255, 0.86);
}
.house-hero__name {
  display: inline;
}
.house-hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  align-items: center;
  gap: 40px;
  padding: 24px 0 58px;
}
.house-hero__crest {
  width: 100%;
  max-width: 250px;
  margin: 0 auto;
  filter: drop-shadow(0 20px 36px rgba(0, 0, 0, 0.35));
}
.house-hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}
.house-hero__tags span {
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius-full);
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  line-height: 1.5;
}
.house-hero--gryffindor {
  background:
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.12), transparent 34%),
    linear-gradient(115deg, #2a0807 0%, #6b0b05 52%, #a50f00 100%);
}
.house-hero--hufflepuff {
  background:
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.16), transparent 34%),
    linear-gradient(115deg, #4a2b00 0%, #8a4c00 52%, #bd7a00 100%);
}
.house-hero--ravenclaw {
  background:
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.12), transparent 34%),
    linear-gradient(115deg, #0e1738 0%, #1c388e 52%, #0b5f9d 100%);
}
.house-hero--slytherin {
  background:
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1), transparent 34%),
    linear-gradient(115deg, #06180e 0%, #0f5424 52%, #1a7236 100%);
}

/* ---------- Article layout ---------- */
.article-section {
  padding: 56px 0 80px;
}
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  align-items: start;
  gap: 56px;
}
.article-layout--wide {
  grid-template-columns: minmax(0, 1fr) 300px;
}
.prose {
  min-width: 0;
  max-width: 800px;
  color: var(--ink-soft);
  font-size: 16.5px;
  line-height: 1.88;
}
.prose > *:first-child {
  margin-top: 0;
}
.prose h2 {
  margin-top: 46px;
  padding-top: 4px;
  color: var(--ink);
  font-size: clamp(1.45rem, 2.4vw, 1.8rem);
  line-height: 1.35;
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.prose h2::before {
  content: '';
  display: block;
  width: 30px;
  height: 3px;
  margin-bottom: 14px;
  border-radius: 3px;
  background: var(--red);
}
.prose h3 {
  margin-top: 30px;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.45;
}
.prose p {
  margin-top: 16px;
}
.prose ul,
.prose ol {
  margin-top: 14px;
  padding-left: 1.35em;
}
.prose li {
  margin-top: 7px;
  padding-left: 2px;
}
.prose li::marker {
  color: var(--red);
}
.prose a {
  text-decoration: underline;
  text-decoration-color: rgba(230, 0, 18, 0.35);
  text-underline-offset: 3px;
}
.prose a:hover {
  text-decoration-color: var(--red);
}
.prose strong {
  color: var(--ink);
  font-weight: 700;
}
.prose blockquote {
  margin-top: 24px;
  padding: 18px 22px;
  border-left: 4px solid var(--red);
  border-radius: 0 10px 10px 0;
  background: var(--surface);
  color: var(--ink);
  font-size: 15.5px;
  line-height: 1.8;
}
.prose blockquote p {
  margin-top: 0;
}
.prose .lead {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.8;
}
.prose .note {
  margin-top: 24px;
  padding: 17px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--red-wash);
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.8;
}
.prose .note strong {
  color: var(--red);
}
.prose hr {
  margin: 36px 0;
  border: 0;
  border-top: 1px solid var(--line);
}
.prose figure {
  margin-top: 26px;
}
.prose figcaption {
  margin-top: 8px;
  color: var(--muted-light);
  font-size: 12.5px;
  text-align: center;
}
.prose table {
  width: 100%;
  margin-top: 20px;
  border-collapse: collapse;
  font-size: 14.5px;
  line-height: 1.65;
}
.prose th,
.prose td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.prose th {
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}
.prose tr:last-child td {
  border-bottom: 0;
}
.prose code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface-2);
  font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.9em;
}
.table-wrap {
  margin-top: 20px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.table-wrap table {
  margin-top: 0;
  min-width: 640px;
}
.table-wrap th:first-child,
.table-wrap td:first-child {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 1;
}
.table-wrap th:first-child {
  background: var(--surface);
}
.quick-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
  padding: 0;
  list-style: none;
}
.quick-facts li {
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  margin: 0;
}
.quick-facts span {
  display: block;
  color: var(--muted-light);
  font-size: 11px;
  letter-spacing: 0.04em;
}
.quick-facts strong {
  display: block;
  margin-top: 3px;
  font-size: 14.5px;
  font-weight: 600;
}
.house-facts {
  background: var(--surface);
  border: 0;
}
.house-facts li {
  background: #fff;
}
.article-side {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  display: grid;
  gap: 16px;
}
.side-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
}
.side-card h2,
.side-card h3 {
  font-size: 14px;
  color: var(--muted-light);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.toc {
  padding: 0;
  list-style: none;
  margin-top: 12px;
}
.toc li {
  border-top: 1px solid var(--line);
}
.toc li:first-child {
  border-top: 0;
}
.toc a {
  display: block;
  padding: 9px 0;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.5;
  transition: color 0.2s var(--ease), padding-left 0.2s var(--ease);
}
.toc a:hover,
.toc a.is-active {
  padding-left: 6px;
  color: var(--red);
}
.side-cta {
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.18), transparent 40%),
    linear-gradient(140deg, #b3000f, #e60012);
  border: 0;
  color: #fff;
}
.side-cta h2,
.side-cta h3 {
  color: rgba(255, 255, 255, 0.8);
}
.side-cta p {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  line-height: 1.7;
}
.side-cta .btn {
  margin-top: 16px;
}
.side-links {
  list-style: none;
  margin-top: 10px;
}
.side-links li {
  border-top: 1px solid var(--line);
}
.side-links li:first-child {
  border-top: 0;
}
.side-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 0;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.5;
}
.side-links a:hover {
  color: var(--red);
}
.side-links svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  color: var(--muted-light);
}
.article-cta {
  margin-top: 40px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.article-cta h2 {
  margin: 0;
  padding: 0;
  font-size: 19px;
  border: 0;
}
.article-cta h2::before {
  display: none;
}
.article-cta p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13.5px;
}
.article-cta .btn {
  flex: 0 0 auto;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.related-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.related-card:hover {
  color: var(--ink);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}
.related-card small {
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.related-card strong {
  margin-top: 7px;
  font-size: 16px;
  line-height: 1.45;
}
.related-card span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

/* ---------- Quiz ---------- */
.quiz-page-hero {
  padding-bottom: 34px;
}
.quiz-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: start;
  gap: 28px;
}
.quiz-shell {
  min-width: 0;
}
.quiz-intro {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.quiz-intro p {
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.65;
}
.quiz-intro strong {
  color: var(--red);
}
.quiz-intro svg {
  width: 16px;
  height: 16px;
}
.quiz-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: 0 10px 34px rgba(30, 30, 30, 0.04);
}
.quiz-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 24px 0;
}
.quiz-toolbar__status {
  color: var(--muted);
  font-size: 13.5px;
}
.quiz-toolbar__status strong {
  color: var(--red);
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
}
.quiz-toolbar__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.auto-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  user-select: none;
}
.auto-toggle:hover {
  background: var(--surface);
}
.auto-toggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.auto-toggle__track {
  position: relative;
  width: 32px;
  height: 18px;
  border-radius: 999px;
  background: var(--line-strong);
  transition: background-color 0.25s var(--ease);
  flex: 0 0 auto;
}
.auto-toggle__track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.25s var(--ease);
}
.auto-toggle input:checked + .auto-toggle__track {
  background: var(--red);
}
.auto-toggle input:checked + .auto-toggle__track::after {
  transform: translateX(14px);
}
.auto-toggle input:focus-visible + .auto-toggle__track {
  outline: 3px solid rgba(230, 0, 18, 0.4);
  outline-offset: 2px;
}
.quiz-progress {
  padding: 14px 24px 0;
}
.quiz-progress__track {
  position: relative;
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--surface-2);
}
.quiz-progress__fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #b3000f, var(--red));
  transition: width 0.35s var(--ease);
}
.quiz-stage {
  padding: 26px 24px 8px;
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.q-block {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.q-block + .q-block {
  margin-top: 0;
}
.q-block__legend {
  display: block;
  width: 100%;
  padding: 0;
}
.q-block__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.q-block__num {
  color: var(--red);
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.q-block__count {
  color: var(--muted-light);
  font-size: 11px;
}
.q-block__text {
  display: block;
  color: var(--ink);
  font-size: clamp(1.18rem, 2.2vw, 1.4rem);
  font-weight: 700;
  line-height: 1.55;
  letter-spacing: -0.005em;
}
.q-options {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}
.q-options--wide {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.q-option {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.q-option:hover {
  border-color: rgba(230, 0, 18, 0.5);
  background: var(--red-wash);
}
.q-option:active {
  transform: scale(0.995);
}
.q-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.q-option__key {
  display: inline-flex;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.q-option__text {
  flex: 1;
  font-size: 15px;
  line-height: 1.7;
}
.q-option__mark {
  display: none;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
}
.q-option__mark svg {
  width: 11px;
  height: 11px;
}
.q-option.is-selected,
.q-option:has(input:checked) {
  border-color: var(--red);
  background: var(--red-soft);
  box-shadow: inset 0 0 0 1px var(--red);
  color: var(--ink);
}
.q-option.is-selected .q-option__key,
.q-option:has(input:checked) .q-option__key {
  background: var(--red);
  color: #fff;
}
.q-option.is-selected .q-option__mark,
.q-option:has(input:checked) .q-option__mark {
  display: inline-flex;
}
.q-option:has(input:focus-visible) {
  outline: 3px solid rgba(230, 0, 18, 0.4);
  outline-offset: 2px;
}
.q-option__hint {
  display: none;
}
.quiz-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 24px 10px;
  border-top: 1px solid var(--line);
  margin-top: 22px;
}
.quiz-nav__spacer {
  flex: 1;
}
.quiz-nav__status {
  color: var(--muted);
  font-family: var(--font-serif);
  font-size: 14px;
  letter-spacing: 0.04em;
}
.quiz-nav__status b {
  color: var(--ink);
  font-size: 17px;
  font-weight: 600;
}
.quiz-nav .btn {
  min-width: 108px;
}
.quiz-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 24px 20px;
  color: var(--muted-light);
  font-size: 12px;
}
.quiz-foot strong {
  color: var(--red);
}
.quiz-alert {
  display: flex;
  gap: 10px;
  margin: 0 24px 18px;
  padding: 13px 16px;
  border: 1px solid rgba(230, 0, 18, 0.25);
  border-radius: 10px;
  background: var(--red-soft);
  color: #8a0a12;
  font-size: 13.5px;
  line-height: 1.65;
}
.quiz-alert svg {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  flex: 0 0 auto;
}
.quiz-submit-mobile {
  display: none;
}
.quiz-side {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  display: grid;
  gap: 16px;
}
.answer-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
}
.answer-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.answer-card__head h2 {
  font-size: 14px;
  letter-spacing: 0.03em;
}
.answer-card__head span {
  color: var(--muted-light);
  font-family: var(--font-serif);
  font-size: 12px;
}
.answer-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 14px;
}
.answer-dot {
  display: inline-flex;
  height: 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease),
    border-color 0.2s var(--ease);
}
.answer-dot:hover {
  border-color: var(--red);
  color: var(--red);
}
.answer-dot.is-answered {
  background: var(--red-soft);
  border-color: rgba(230, 0, 18, 0.28);
  color: var(--red);
}
.answer-dot.is-current {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.answer-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted-light);
  font-size: 11px;
}
.answer-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.answer-legend i {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: #fff;
}
.answer-legend .is-answered {
  background: var(--red-soft);
  border-color: rgba(230, 0, 18, 0.28);
}
.answer-legend .is-current {
  background: var(--red);
  border-color: var(--red);
}
.quiz-tips {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.quiz-tips h2 {
  font-size: 14px;
  letter-spacing: 0.03em;
}
.quiz-tips ul {
  margin-top: 10px;
  padding: 0;
  list-style: none;
}
.quiz-tips li {
  position: relative;
  padding-left: 16px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}
.quiz-tips li::before {
  content: '';
  position: absolute;
  top: 0.62em;
  left: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--red);
}
.quiz-tips a {
  font-weight: 600;
}
.answer-card-toggle {
  display: none;
}
.quiz-noscript {
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.7;
}
html:not(.js) .quiz-toolbar,
html:not(.js) .quiz-progress,
html:not(.js) .quiz-nav,
html:not(.js) .quiz-foot,
html:not(.js) .quiz-side,
html:not(.js) .quiz-intro {
  display: none;
}
html:not(.js) .q-block {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
html:not(.js) .q-block:last-child {
  border-bottom: 0;
}
html.js .q-block {
  display: none;
}
html.js .q-block.is-active {
  display: block;
  animation: q-in 0.28s var(--ease);
}
@keyframes q-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Name dialog ---------- */
dialog.name-dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.24);
}
dialog.name-dialog::backdrop {
  background: rgba(24, 12, 10, 0.52);
  backdrop-filter: blur(3px);
}
.name-dialog__inner {
  padding: 30px;
}
.name-dialog__icon {
  display: inline-flex;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
}
.name-dialog__icon svg {
  width: 24px;
  height: 24px;
}
.name-dialog h2 {
  margin-top: 16px;
  font-size: 22px;
}
.name-dialog p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}
.name-dialog label {
  display: block;
  margin-top: 20px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
}
.name-dialog input {
  width: 100%;
  height: 48px;
  margin-top: 7px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  font-size: 16px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.name-dialog input:focus {
  border-color: var(--red);
  outline: 0;
  box-shadow: 0 0 0 4px rgba(230, 0, 18, 0.14);
}
.name-dialog__actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}
.name-dialog__actions .btn {
  flex: 1;
}
.name-dialog__privacy {
  display: flex;
  gap: 6px;
  margin-top: 14px !important;
  color: var(--muted-light) !important;
  font-size: 11.5px !important;
}
.name-dialog__privacy svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--red);
}

/* ---------- Result ---------- */
.result-section {
  padding: 36px 0 80px;
  scroll-margin-top: calc(var(--header-h) + 10px);
}
.result-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}
.result-header h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}
.result-header p {
  color: var(--muted);
  font-size: 13px;
}
.result-card {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 34px;
  padding: 40px;
  border-radius: var(--radius-lg);
  color: #fff;
  box-shadow: 0 24px 54px rgba(50, 15, 12, 0.22);
  isolation: isolate;
}
.result-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, 0.7) 0.9px, transparent 0.9px);
  background-size: 32px 32px;
  opacity: 0.1;
}
.result-card::after {
  content: '';
  position: absolute;
  z-index: -1;
  right: -80px;
  bottom: -110px;
  width: 340px;
  height: 340px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  box-shadow: 0 0 0 40px rgba(255, 255, 255, 0.04), 0 0 0 80px rgba(255, 255, 255, 0.025);
  pointer-events: none;
}
.result-card--gryffindor {
  background: linear-gradient(145deg, #1f1c18 0%, #5a0b07 58%, #8e0e00 100%);
}
.result-card--hufflepuff {
  background: linear-gradient(120deg, #f2c94c 0%, #e8a536 52%, #c87a00 100%);
  color: #332216;
}
.result-card--ravenclaw {
  background: linear-gradient(150deg, #1b1b4a 0%, #363795 50%, #005c97 100%);
}
.result-card--slytherin {
  background: linear-gradient(140deg, #141517 0%, #0d4420 55%, #1a7236 100%);
}
.result-card__crest {
  width: 190px;
  height: 210px;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 16px 28px rgba(0, 0, 0, 0.36));
  animation: result-crest-in 0.7s var(--ease) both;
}
@keyframes result-crest-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.result-card__body {
  min-width: 0;
  flex: 1;
}
.result-card__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid currentColor;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  opacity: 0.68;
}
.result-card__name {
  margin-top: 14px;
  font-size: 13px;
  letter-spacing: 0.06em;
  opacity: 0.72;
  overflow-wrap: anywhere;
}
.result-card__name strong {
  font-weight: 600;
  opacity: 1;
}
.result-card h2 {
  margin-top: 4px;
  color: inherit;
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.result-card__desc {
  max-width: 680px;
  margin-top: 16px;
  font-size: 16px;
  line-height: 1.85;
  opacity: 0.92;
}
.result-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid currentColor;
  font-size: 12px;
  opacity: 0.62;
}
.result-card--hufflepuff .result-card__desc,
.result-card--hufflepuff .result-card__meta {
  opacity: 0.82;
}
.result-breakdown {
  margin-top: 22px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
}
.result-breakdown__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 18px;
}
.result-breakdown__head h2 {
  font-size: 20px;
}
.result-breakdown__head p {
  color: var(--muted);
  font-size: 13px;
}
.house-bars {
  display: grid;
  gap: 14px;
  margin-top: 22px;
  padding: 0;
  list-style: none;
}
.house-bar {
  display: grid;
  grid-template-columns: 138px minmax(0, 1fr) 58px;
  align-items: center;
  gap: 14px;
}
.house-bar__name {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
}
.house-bar__name img {
  width: 20px;
  height: 23px;
  object-fit: contain;
}
.house-bar__track {
  display: block;
  height: 10px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--surface-2);
}
.house-bar__fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--house-accent, var(--red));
  transition: width 0.9s var(--ease);
}
.house-bar__value {
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  text-align: right;
}
.house-bars--compact {
  gap: 10px;
  margin-top: 16px;
}
.house-bars--compact .house-bar {
  grid-template-columns: 108px minmax(0, 1fr) 48px;
  gap: 10px;
}
.house-bars--compact .house-bar__name {
  font-size: 12px;
}
.house-bars--compact .house-bar__value {
  font-size: 14px;
}
.result-note {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
}
.result-quote {
  margin-top: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.8;
}
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}
.result-actions .btn {
  min-width: 0;
}
.result-actions__note {
  margin-top: 12px;
  color: var(--muted-light);
  font-size: 12px;
}
.result-secondary {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.result-secondary h2 {
  font-size: 22px;
}
.result-secondary p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.8;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 1000;
  max-width: calc(100vw - 32px);
  padding: 11px 18px;
  border-radius: var(--radius-full);
  background: rgba(30, 30, 30, 0.94);
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 8px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease),
    visibility 0.25s var(--ease);
}
.toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* ---------- Footer ---------- */
.site-footer {
  background: #191818;
  color: #c8c3bf;
  padding: 60px 0 22px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 0.85fr 0.85fr 1fr;
  gap: 40px;
}
.footer-brand p {
  max-width: 360px;
  margin-top: 18px;
  color: #a8a29e;
  font-size: 13.5px;
  line-height: 1.8;
}
.footer-brand .footer-note {
  margin-top: 10px;
  color: #918b87;
  font-size: 12px;
}
.footer-col h2 {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.footer-col a {
  display: block;
  margin-top: 9px;
  color: #a8a29e;
  font-size: 13.5px;
  line-height: 1.6;
}
.footer-col a:hover {
  color: #ff8079;
}
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 46px;
  padding-top: 20px;
  border-top: 1px solid #2e2c2b;
  color: #918b87;
  font-size: 11.5px;
  line-height: 1.6;
}

/* ---------- Animations ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .hero__grid {
    gap: 36px;
  }
  .house-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .house-card__top {
    min-height: 150px;
  }
  .house-card__crest {
    width: 110px;
    height: 124px;
  }
  .result-preview {
    gap: 36px;
  }
  .quiz-layout {
    grid-template-columns: minmax(0, 1fr) 270px;
    gap: 22px;
  }
  .answer-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

@media (max-width: 960px) {
  :root {
    --header-h: 68px;
  }
  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    z-index: 998;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px 20px 20px;
    border-bottom: 1px solid var(--line);
    background: #fff;
    box-shadow: 0 16px 30px rgba(30, 30, 30, 0.1);
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
  }
  .site-nav.is-open {
    display: flex;
  }
  .site-nav > a:not(.btn) {
    padding: 13px 12px;
    border-radius: 10px;
    font-size: 16px;
  }
  .site-nav__cta {
    display: inline-flex;
    margin: 10px 0 0;
  }
  .nav-toggle {
    display: inline-flex;
  }
  .header-cta {
    display: none;
  }
  .hero__grid {
    grid-template-columns: 1fr;
    gap: 34px;
    padding-block: 46px 56px;
  }
  .hero__copy {
    max-width: 680px;
  }
  .hero__art {
    max-width: 560px;
    width: 100%;
    min-height: 0;
    aspect-ratio: 16 / 12;
  }
  .hero__art-crest {
    width: 44%;
    max-width: 240px;
  }
  .hero__house img {
    width: 34px;
    height: 38px;
  }
  .stats-strip__grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat:nth-child(3) {
    border-left: 0;
    padding-left: 0;
  }
  .stat {
    padding: 20px;
    border-top: 1px solid var(--line);
  }
  .stat:nth-child(1),
  .stat:nth-child(2) {
    border-top: 0;
  }
  .sample-grid {
    grid-template-columns: 1fr;
  }
  .sample-card h3 {
    min-height: 0;
  }
  .result-preview {
    grid-template-columns: 1fr;
  }
  .result-preview__text {
    order: -1;
  }
  .article-layout,
  .article-layout--wide {
    grid-template-columns: 1fr;
    gap: 34px;
  }
  .article-side {
    position: static;
    order: -1;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
  .article-side .side-card:first-child {
    grid-column: 1 / -1;
  }
  .toc {
    display: flex;
    flex-wrap: wrap;
    gap: 0 18px;
  }
  .toc li {
    border-top: 0;
  }
  .quiz-layout {
    grid-template-columns: 1fr;
  }
  .quiz-side {
    position: static;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
  .answer-card-toggle {
    display: inline-flex;
  }
  .quiz-side .answer-card {
    display: none;
  }
  .quiz-side.is-open .answer-card {
    display: block;
    grid-column: 1 / -1;
  }
  .result-card {
    padding: 32px;
    gap: 26px;
  }
  .result-card__crest {
    width: 150px;
    height: 168px;
  }
  .house-hero__inner {
    grid-template-columns: 1fr 190px;
  }
  .house-hero__crest {
    max-width: 180px;
  }
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .container {
    padding: 0 20px;
  }
  .section {
    padding: 56px 0;
  }
  .section--tight {
    padding-block: 44px;
  }
  .section-head {
    margin-bottom: 28px;
  }
  .section-head p {
    font-size: 15.5px;
  }
  .hero h1 {
    font-size: clamp(2.1rem, 9vw, 2.9rem);
  }
  .hero__lead {
    font-size: 16.5px;
    margin-top: 18px;
  }
  .hero__disc {
    display: none;
  }
  .hero__actions .btn {
    flex: 1 1 auto;
  }
  .hero__actions {
    gap: 8px;
  }
  .hero__art {
    aspect-ratio: 1 / 1.02;
    border-radius: 22px;
  }
  .hero__art-crest {
    width: 52%;
  }
  .hero__badge {
    top: 14px;
    left: 14px;
    padding: 6px 11px;
    font-size: 11px;
  }
  .hero__houses {
    left: 10px;
    right: 10px;
    bottom: 10px;
    padding: 8px 6px;
  }
  .hero__house {
    font-size: 9.5px;
  }
  .hero__house img {
    width: 28px;
    height: 32px;
  }
  .hero__scribble {
    display: none;
  }
  .stats-strip__grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat {
    padding: 16px 14px;
  }
  .stat:first-child,
  .stat:nth-child(3) {
    padding-left: 0;
  }
  .stat strong {
    font-size: 26px;
  }
  .stat span {
    font-size: 11.5px;
  }
  .house-grid {
    grid-template-columns: 1fr;
  }
  .house-card {
    padding: 18px;
  }
  .house-card__top {
    min-height: 138px;
  }
  .house-card__crest {
    width: 100px;
    height: 116px;
  }
  .steps {
    grid-template-columns: 1fr;
  }
  .step-card {
    padding: 22px;
  }
  .demo-result {
    padding: 24px;
  }
  .demo-result__body {
    gap: 16px;
  }
  .demo-result__crest {
    width: 86px;
    height: 98px;
  }
  .demo-result h3 {
    font-size: 22px;
  }
  .demo-result__bars {
    grid-template-columns: 1fr;
  }
  .explainer-grid {
    grid-template-columns: 1fr;
  }
  .explainer {
    padding: 24px;
  }
  .cta-band__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 22px;
    padding-block: 44px;
  }
  .cta-band__crest {
    right: -30px;
    width: 160px;
    opacity: 0.09;
  }
  .cta-band__actions {
    width: 100%;
  }
  .cta-band__actions .btn {
    flex: 1 1 auto;
  }
  .page-hero__inner {
    padding: 18px 0 40px;
  }
  .page-hero__lead {
    font-size: 16px;
  }
  .article-section {
    padding: 40px 0 60px;
  }
  .prose {
    font-size: 16px;
    line-height: 1.85;
  }
  .prose h2 {
    margin-top: 38px;
  }
  .quick-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .article-side {
    grid-template-columns: 1fr;
  }
  .article-side .side-card:first-child {
    grid-column: auto;
  }
  .toc {
    display: block;
  }
  .toc li {
    border-top: 1px solid var(--line);
  }
  .article-cta {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .related-grid {
    grid-template-columns: 1fr;
  }
  .house-hero__inner {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-bottom: 44px;
  }
  .house-hero__crest {
    grid-row: 1;
    width: 130px;
    margin: 0;
  }
  .house-hero__tags {
    margin-top: 16px;
  }
  .quiz-toolbar {
    padding: 16px 16px 0;
  }
  .quiz-progress {
    padding: 12px 16px 0;
  }
  .quiz-stage {
    padding: 22px 16px 6px;
  }
  .quiz-nav {
    padding: 18px 16px 10px;
    flex-wrap: wrap;
  }
  .quiz-nav .btn {
    min-width: 0;
    flex: 1;
  }
  .quiz-nav__status {
    order: -1;
    width: 100%;
    text-align: center;
  }
  .quiz-foot {
    padding: 6px 16px 18px;
  }
  .quiz-alert {
    margin: 0 16px 16px;
  }
  .q-option {
    padding: 12px 13px;
  }
  .q-option__text {
    font-size: 14.5px;
  }
  .q-options--wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .quiz-side {
    grid-template-columns: 1fr;
  }
  .answer-grid {
    grid-template-columns: repeat(7, 1fr);
  }
  .result-section {
    padding: 24px 0 60px;
  }
  .result-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    padding: 26px 22px;
  }
  .result-card__crest {
    width: 112px;
    height: 126px;
  }
  .result-card h2 {
    font-size: 25px;
  }
  .result-card__desc {
    font-size: 14.5px;
  }
  .result-breakdown {
    padding: 22px 18px;
  }
  .house-bar {
    grid-template-columns: 106px minmax(0, 1fr) 50px;
    gap: 9px;
  }
  .house-bar__name {
    font-size: 12px;
    gap: 5px;
  }
  .house-bar__name img {
    width: 17px;
    height: 20px;
  }
  .house-bar__value {
    font-size: 15px;
  }
  .result-actions .btn {
    flex: 1 1 calc(50% - 5px);
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
  .faq-item__title {
    font-size: 15.5px;
  }
  .faq-item__a {
    padding: 0 0 20px 32px;
    font-size: 14.5px;
  }
  .name-dialog__inner {
    padding: 24px;
  }
}

@media (max-width: 480px) {
  .brand__mark {
    width: 36px;
    height: 36px;
  }
  .brand__text strong {
    font-size: 18px;
  }
  .hero__chips {
    gap: 6px;
  }
  .chip {
    font-size: 11.5px;
    padding: 5px 10px;
  }
  .stat {
    display: block;
  }
  .stat strong {
    display: block;
    margin-bottom: 2px;
  }
  .demo-result__body {
    flex-direction: column;
    align-items: flex-start;
  }
  .house-bar {
    grid-template-columns: 92px minmax(0, 1fr) 44px;
  }
  .house-bar__name {
    font-size: 11.5px;
  }
  .house-bars--compact .house-bar {
    grid-template-columns: 92px minmax(0, 1fr) 44px;
  }
  .answer-grid {
    grid-template-columns: repeat(6, 1fr);
  }
  .quiz-nav .btn--prev {
    flex: 0 0 auto;
    padding-left: 14px;
    padding-right: 14px;
  }
  .quiz-nav .btn--next {
    flex: 1;
  }
  .quiz-nav .btn--submit {
    flex: 1 1 100%;
    order: 3;
  }
}

/* ---------- 404 ---------- */
.error-page {
  display: flex;
  min-height: 62vh;
  align-items: center;
  padding: 64px 0 88px;
  background:
    radial-gradient(circle at 50% 0%, rgba(230, 0, 18, 0.08), transparent 38%),
    #fff;
  text-align: center;
}
.error-page__inner {
  max-width: 720px;
  margin: 0 auto;
}
.error-page__crest {
  width: 132px;
  height: auto;
  margin: 0 auto 24px;
  filter: drop-shadow(0 14px 24px rgba(30, 30, 30, 0.16));
}
.error-page h1 {
  font-size: clamp(2rem, 4.6vw, 3.1rem);
  line-height: 1.2;
}
.error-page__lead {
  max-width: 560px;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 16.5px;
  line-height: 1.8;
}
.error-page__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
}
.error-page__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  color: var(--muted-light);
  font-size: 13px;
}
.error-page__links a {
  color: var(--muted);
}
.error-page__links a:hover {
  color: var(--red);
}
@media (max-width: 560px) {
  .error-page__actions .btn {
    flex: 1 1 100%;
  }
}

/* Guard inline icon sizing in result eyebrow */
.result-card__eyebrow svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

/* Mobile reading pages: keep the article first; the in-article CTA and
   related links already cover navigation. */
@media (max-width: 960px) {
  .article-side {
    display: none;
  }
  .house-hero h1 {
    max-width: 18em;
    font-size: 1.8rem;
    text-wrap: balance;
  }
  .house-hero__name {
    display: block;
  }
}

/* Long names and unbroken strings should never widen the layout. */
.q-block__text,
.q-option__text,
.result-breakdown__head p {
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .answer-dot {
    height: 38px;
  }
}

.answer-card {
  scroll-margin-top: calc(var(--header-h) + 16px);
}

.btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

@media (max-width: 360px) {
  .brand {
    gap: 8px;
  }
  .brand__mark {
    width: 32px;
    height: 32px;
  }
  .brand__text strong {
    font-size: 16px;
    letter-spacing: 0.02em;
  }
}

/* Mobile quiz: keep the submit button on its own row. */
@media (max-width: 720px) {
  .quiz-nav .btn--submit {
    flex: 1 1 100%;
    order: 3;
  }
}
