:root {
  --ink: #10162b;
  --ink-2: #1c2441;
  --paper: #f7f2e8;
  --card: #fffdf7;
  --gold: #e0a03a;
  --gold-2: #f5c96f;
  --coral: #e56555;
  --blue: #5769b5;
  --muted: #6f7180;
  --line: rgba(16, 22, 43, .13);
  --shadow: 0 24px 70px rgba(20, 22, 39, .14);
  --radius: 28px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); font: 16px/1.55 "DM Sans", sans-serif; }
button, input { font: inherit; }
button { color: inherit; }
.noise { position: fixed; inset: 0; pointer-events: none; opacity: .045; z-index: 30; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.shell { display: grid; grid-template-columns: 292px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 34px 26px 28px; display: flex; flex-direction: column; background: var(--ink); color: #fff; overflow: auto; }
.brand { display: inline-flex; align-items: center; gap: 12px; border: 0; background: none; padding: 0; color: inherit; cursor: pointer; text-align: left; font: 800 1.28rem/1 "Fraunces", serif; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px 14px 18px 18px; background: var(--gold); color: var(--ink); font-size: 1.2rem; box-shadow: inset 0 -4px rgba(16,22,43,.12); }
.side-kicker { margin: 44px 8px 12px; color: #9da3ba; font-size: .75rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.category-nav { display: grid; gap: 4px; }
.category-button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 13px; border: 0; border-radius: 14px; background: transparent; color: #d8dbea; cursor: pointer; text-align: left; font-weight: 600; transition: .2s ease; }
.category-button:hover, .category-button:focus-visible { background: rgba(255,255,255,.08); color: #fff; transform: translateX(3px); }
.category-button.active { background: var(--gold); color: var(--ink); }
.category-icon { width: 26px; font-size: 1.15rem; text-align: center; }
.side-footer { margin-top: auto; padding: 24px 8px 0; color: #b9bdce; font-size: .88rem; }
.text-button { border: 0; background: none; padding: 0; color: var(--gold-2); cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.mobile-header { display: none; }
.main { min-width: 0; padding: clamp(28px, 5vw, 76px); background: radial-gradient(circle at 90% 8%, rgba(224,160,58,.18), transparent 28%), radial-gradient(circle at 16% 92%, rgba(87,105,181,.13), transparent 30%), var(--paper); }
.stage { max-width: 1040px; margin: 0 auto; animation: enter .45s ease both; }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } }
.eyebrow { margin: 0 0 12px; color: var(--coral); font-size: .76rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
h1, h2, h3 { font-family: "Fraunces", serif; line-height: 1.05; }
h1 { max-width: 800px; margin: 0; font-size: clamp(2.8rem, 7vw, 6.7rem); letter-spacing: -.055em; }
h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.8rem); letter-spacing: -.035em; }
.intro-lead { max-width: 650px; margin: 22px 0 0; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.3rem); }
.welcome-film { width: min(100%, 820px); margin: 32px 0 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 28px; background: #a9c5d4; box-shadow: var(--shadow); }
.welcome-video { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.hero-quiz-button { width: min(100%, 820px); min-height: 58px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; border: 0; border-radius: 18px; background: linear-gradient(110deg, var(--gold), var(--gold-2)); color: var(--ink); cursor: pointer; font-weight: 900; box-shadow: 0 12px 28px rgba(224,160,58,.22); }
.hero-quiz-button:hover { transform: translateY(-2px); }
.category-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; margin-top: 42px; }
.category-card { position: relative; min-height: 190px; overflow: hidden; padding: 26px; border: 1px solid var(--line); border-radius: 24px; background: var(--card); box-shadow: 0 10px 30px rgba(20,22,39,.06); cursor: pointer; text-align: left; transition: .25s ease; }
.category-card:hover, .category-card:focus-visible { transform: translateY(-5px); box-shadow: var(--shadow); border-color: rgba(224,160,58,.8); }
.category-card .big-icon { display: block; margin-bottom: 30px; font-size: 2rem; }
.category-card h3 { margin: 0; font-size: 1.65rem; }
.category-card p { margin: 8px 0 0; color: var(--muted); }
.card-arrow { position: absolute; right: 22px; top: 22px; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: #fff; }
.quiz-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.quiz-count { flex: 0 0 auto; color: var(--muted); font-weight: 700; }
.progress-track { height: 8px; margin: 26px 0 44px; overflow: hidden; border-radius: 10px; background: rgba(16,22,43,.1); }
.progress-bar { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--coral), var(--gold)); transition: width .35s ease; }
.question-card { padding: clamp(24px, 5vw, 50px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.question-card h2 { max-width: 780px; font-size: clamp(1.8rem, 4vw, 3.25rem); }
.question-help { margin: 14px 0 30px; color: var(--muted); }
.answers { display: grid; gap: 12px; }
.answer { padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px; background: #fff; cursor: pointer; text-align: left; font-weight: 600; transition: .18s ease; }
.answer:hover, .answer:focus-visible { border-color: var(--blue); background: #f2f3fb; transform: translateX(4px); }
.back-button, .secondary-button, .primary-button { display: inline-flex; justify-content: center; align-items: center; gap: 9px; min-height: 50px; padding: 0 20px; border-radius: 999px; cursor: pointer; font-weight: 800; }
.back-button, .secondary-button { border: 1px solid var(--line); background: rgba(255,255,255,.7); }
.primary-button { border: 0; background: var(--ink); color: #fff; box-shadow: 0 10px 20px rgba(16,22,43,.18); }
.primary-button:hover { background: var(--coral); }
.result-stage { padding: clamp(18px, 3vw, 34px); border-radius: 34px; background: radial-gradient(circle at 88% 8%, color-mix(in srgb, var(--result-accent) 24%, transparent), transparent 34%), linear-gradient(145deg, color-mix(in srgb, var(--result-soft) 78%, white), rgba(255,255,255,.3)); }
.result-hero { display: grid; grid-template-columns: minmax(300px,.9fr) minmax(320px,1.1fr); gap: clamp(30px,5vw,70px); align-items: center; }
.result-image-wrap { position: relative; aspect-ratio: 4/5; overflow: hidden; border-radius: 28px; background: var(--ink-2); box-shadow: var(--shadow); }
.result-image { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-fallback { position: absolute; inset: 0; display: none; place-items: center; padding: 30px; color: #fff; text-align: center; background: linear-gradient(145deg,var(--ink),var(--blue)); }
.result-badge { display: inline-flex; gap: 8px; padding: 8px 12px; border-radius: 999px; background: var(--result-soft); color: var(--result-deep); font-weight: 800; }
.result-copy h1 { margin-top: 14px; font-size: clamp(3rem, 7vw, 6.5rem); }
.result-color-strokes { display: inline-block; position: relative; width: .92em; height: .62em; margin: 0 .18em -.02em 0; transform: rotate(-5deg); }
.result-color-strokes i { position: absolute; left: 0; width: 100%; height: .15em; background: linear-gradient(90deg, transparent 0, var(--result-accent) 5%, var(--result-accent) 88%, transparent 100%); clip-path: polygon(0 42%, 7% 14%, 23% 25%, 42% 4%, 63% 19%, 83% 7%, 100% 40%, 93% 78%, 71% 68%, 48% 96%, 26% 75%, 8% 91%); filter: drop-shadow(0 .025em .02em color-mix(in srgb, var(--result-deep) 25%, transparent)); }
.result-color-strokes i:nth-child(1) { top: .05em; width: 88%; opacity: .68; }
.result-color-strokes i:nth-child(2) { top: .23em; left: .06em; }
.result-color-strokes i:nth-child(3) { top: .41em; width: 76%; left: .13em; opacity: .82; }
.result-copy h1 { color: var(--result-deep); text-decoration-color: var(--result-accent); }
.result-description { margin: 20px 0 0; color: var(--muted); font-size: 1.15rem; }
.trait-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 0; padding: 0; list-style: none; }
.trait-list li { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-weight: 700; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.keep-section { margin-top: 72px; padding: clamp(24px,5vw,50px); border-radius: 30px; background: var(--result-deep); color: #fff; }
.keep-section .eyebrow { color: var(--gold-2); }
.keep-intro { max-width: 680px; color: #c8ccdb; font-size: 1.08rem; }
.choice-label { display: block; margin: 28px 0 12px; color: #c8ccdb; font-size: .82rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.segmented { display: inline-flex; padding: 4px; border-radius: 999px; background: rgba(255,255,255,.1); }
.segment { min-width: 110px; padding: 10px 18px; border: 0; border-radius: 999px; background: transparent; color: #fff; cursor: pointer; font-weight: 700; }
.segment.active { background: var(--gold); color: var(--ink); }
.template-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.template-grid.six-up { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.template-card { position: relative; overflow: hidden; padding: 0; border: 2px solid transparent; border-radius: 20px; background: #272e4a; cursor: pointer; color: #fff; text-align: left; }
.template-card.active { border-color: var(--result-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--result-accent) 28%, transparent); }
.template-card img { width: 100%; aspect-ratio: 4/5; object-fit: cover; display: block; background: #313955; }
.template-card span { display: block; padding: 12px 14px; font-weight: 800; text-transform: capitalize; }
.personalize-panel { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: end; margin-top: 28px; padding-top: 28px; border-top: 1px solid rgba(255,255,255,.14); }
.upload-zone { display: flex; align-items: center; gap: 15px; min-height: 84px; padding: 14px; border: 1px dashed rgba(255,255,255,.35); border-radius: 18px; cursor: pointer; }
.upload-zone:hover { border-color: var(--gold-2); }
.upload-preview { width: 56px; height: 56px; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: rgba(255,255,255,.1); font-size: 1.5rem; }
.upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.upload-zone small { display: block; color: #bfc4d6; }
.buy-button { min-width: 210px; background: var(--gold); color: var(--ink); }
.fine-print { margin: 12px 0 0; color: #aeb4c9; font-size: .82rem; }
.modal { width: min(560px, calc(100% - 32px)); padding: 36px; border: 0; border-radius: 26px; background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(8,12,28,.72); backdrop-filter: blur(6px); }
.modal h2 { margin-bottom: 18px; }
.modal-close { position: absolute; top: 14px; right: 16px; width: 38px; height: 38px; border: 0; border-radius: 50%; background: #ece9e2; cursor: pointer; font-size: 1.5rem; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 50; max-width: 360px; padding: 14px 18px; border-radius: 14px; background: var(--ink); color: #fff; box-shadow: var(--shadow); animation: enter .25s ease; }
@media (max-width: 880px) {
  .shell { display: block; }
  .mobile-header { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; background: var(--ink); color: #fff; }
  .about-button { border: 0; background: none; color: var(--gold-2); cursor: pointer; }
  .sidebar { position: sticky; top: 70px; z-index: 18; width: 100%; height: auto; padding: 10px 14px; overflow-x: auto; }
  .desktop-brand, .side-kicker, .side-footer { display: none; }
  .category-nav { display: flex; width: max-content; gap: 7px; }
  .category-button { width: auto; white-space: nowrap; padding: 9px 12px; background: rgba(255,255,255,.06); }
  .category-button:hover { transform: none; }
  .main { padding: 34px 18px 70px; }
  .result-hero { grid-template-columns: 1fr; }
  .result-image-wrap { max-width: 520px; width: 100%; margin: 0 auto; }
}

/* Calibrated for compact desktop viewports and Windows display scaling. */
@media (min-width: 881px) {
  .home-mode .stage { justify-content: flex-start; }
  .hero-media-row {
    width: auto;
    max-width: 100%;
    grid-template-columns: minmax(0, min(740px, calc((100dvh - 320px) * 1.7778))) 230px;
    justify-content: start;
  }
  .home-mode .hero-primary .hero-quiz-button { min-height: 54px; }

  .result-mode .keep-section {
    display: grid;
    grid-template-rows: auto auto auto minmax(115px, 1fr) auto auto auto;
    align-content: stretch;
  }
  .result-mode .template-scroll { min-height: 0; height: auto; }
  .result-mode .personalize-panel { margin-top: 8px; }
  .result-mode .fine-print { margin: 3px 0 0; line-height: 1.3; }
  .result-mode .result-gallery-callout { margin-top: 6px; min-height: 48px; }
}

@media (min-width: 881px) and (max-height: 760px) {
  .main { padding-top: 20px; padding-bottom: 20px; }
  .stage > .eyebrow { margin-bottom: 7px; }
  .stage > h1 { font-size: clamp(2.7rem, 4.4vw, 4.45rem); }
  .intro-lead { margin-top: 5px; }
  .hero-media-row { margin-top: 8px; margin-bottom: 8px; }
  .hero-media-row {
    grid-template-columns: minmax(0, min(700px, calc((100dvh - 285px) * 1.7778))) 220px;
  }
  .home-mode .hero-primary .hero-quiz-button { min-height: 50px; }
  .hero-gallery-card { padding: 17px 17px; }
  .hero-gallery-card strong { margin-top: 8px; font-size: 1.18rem; }
  .hero-gallery-card small { margin-top: 8px; font-size: .79rem; }
  .hero-gallery-card i { margin-top: 12px; }

  .result-mode .keep-section { padding: 15px 18px; }
  .result-mode .keep-section h2 { font-size: 1.72rem; }
  .result-mode .keep-intro { font-size: .82rem; }
  .result-mode .template-scroll { min-height: 100px; }
  .result-mode .upload-zone { min-height: 56px; }
  .result-mode .result-gallery-callout { min-height: 44px; }
}

/* Functional whitespace: keep the primary CTA with the film. */
.hero-primary { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.hero-primary .welcome-film {
  width: 100%;
  height: auto;
  max-width: none;
  margin: 0;
  aspect-ratio: 16 / 9;
  flex: none;
}
.hero-primary .welcome-video {
  display: block;
  width: 100%;
  height: 100%;
  max-height: none !important;
  aspect-ratio: 16 / 9;
  object-fit: fill;
}
.home-mode .hero-primary .hero-quiz-button {
  width: 100%;
  max-width: none;
  min-height: 66px;
  flex: none;
}
.hero-media-row { align-items: stretch; }
.hero-gallery-card { height: 100%; }

/* Results: templates scroll; purchasing controls and discovery remain fixed. */
body:has(.result-mode) .gallery-dock { display: none; }
.result-mode .keep-section { overflow: hidden; }
.template-scroll {
  flex: 1 1 auto;
  min-height: 205px;
  overflow-y: auto;
  padding-right: 7px;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) rgba(255,255,255,.1);
}
.template-scroll::-webkit-scrollbar { width: 8px; }
.template-scroll::-webkit-scrollbar-track { background: rgba(255,255,255,.08); border-radius: 8px; }
.template-scroll::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 8px; }
.template-scroll .choice-label {
  position: sticky;
  top: 0;
  z-index: 3;
  margin-top: 0;
  padding: 6px 0 8px;
  background: var(--result-deep);
}
.result-mode .template-grid.six-up { padding-bottom: 8px; }
.result-mode .personalize-panel { flex: 0 0 auto; }
.result-mode .fine-print { flex: 0 0 auto; }
.result-gallery-callout {
  width: 100%;
  min-height: 54px;
  flex: 0 0 auto;
  margin-top: 7px;
  padding: 9px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border: 1px solid rgba(245,201,111,.34);
  border-radius: 15px;
  background: linear-gradient(100deg, rgba(224,160,58,.14), rgba(255,255,255,.07));
  color: #fff;
  cursor: pointer;
  text-align: left;
}
.result-gallery-callout span { color: #d9deed; font: 600 .82rem/1.35 "Segoe Print", "Comic Sans MS", cursive; }
.result-gallery-callout strong { flex: 0 0 auto; color: var(--gold-2); font-size: .84rem; }
.result-gallery-callout:hover { border-color: var(--gold-2); background: rgba(224,160,58,.2); }

@media (max-height: 820px) and (min-width: 881px) {
  .home-mode .hero-primary .hero-quiz-button { min-height: 56px; }
  .template-scroll { min-height: 155px; }
  .result-gallery-callout { min-height: 46px; }
  .result-gallery-callout span { font-size: .74rem; }
}

@media (max-width: 880px) {
  .hero-primary { width: 100%; }
  .hero-gallery-card { height: auto; }
  .result-mode .keep-section { overflow: visible; }
  .template-scroll { overflow: visible; padding-right: 0; }
  .template-scroll .choice-label { position: static; }
  .result-gallery-callout { align-items: flex-start; flex-direction: column; gap: 4px; }
}

/* Hero composition: true 16:9 film plus a dedicated vertical Gallery card. */
body:has(.home-mode) .gallery-dock { display: none; }
.hero-media-row {
  width: min(100%, 1040px);
  margin: 14px 0 12px;
  display: grid;
  grid-template-columns: minmax(0, 800px) 220px;
  gap: 18px;
  align-items: stretch;
}
.hero-media-row .welcome-film {
  width: 100%;
  max-width: none;
  height: auto;
  margin: 0;
  aspect-ratio: 16 / 9;
  flex: none;
  border-radius: 26px;
  background: transparent;
}
.hero-media-row .welcome-video {
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: fill;
  background: transparent;
}
.hero-gallery-card {
  min-width: 0;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  border: 1px solid rgba(16,22,43,.12);
  border-radius: 26px;
  background: linear-gradient(155deg, #f8d788 0%, #e8a334 58%, #d7832e 100%);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  box-shadow: 0 18px 42px rgba(159,99,22,.2);
  transition: transform .2s ease, box-shadow .2s ease;
}
.hero-gallery-card:hover, .hero-gallery-card:focus-visible { transform: translateY(-3px); box-shadow: 0 24px 52px rgba(159,99,22,.28); }
.hero-gallery-card span { font-size: .75rem; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
.hero-gallery-card strong { margin-top: 12px; font: 700 1.45rem/1.35 "Segoe Print", "Comic Sans MS", cursive; }
.hero-gallery-card small { margin-top: 14px; font-size: .9rem; line-height: 1.5; }
.hero-gallery-card i { margin-top: 24px; font-style: normal; font-weight: 900; }
.home-mode .hero-quiz-button { width: min(100%, 1040px); max-width: none; }

@media (max-height: 820px) and (min-width: 881px) {
  .hero-media-row { width: min(100%, 960px); grid-template-columns: minmax(0, 720px) 222px; }
  .home-mode .hero-quiz-button { width: min(100%, 960px); }
  .hero-gallery-card { padding: 20px 18px; }
  .hero-gallery-card strong { font-size: 1.25rem; }
  .hero-gallery-card small { margin-top: 9px; font-size: .82rem; }
  .hero-gallery-card i { margin-top: 14px; }
}

@media (max-width: 1080px) and (min-width: 881px) {
  .hero-media-row { grid-template-columns: minmax(0, 1fr) 190px; }
  .hero-gallery-card { padding: 19px 16px; }
}

@media (max-width: 880px) {
  .hero-media-row { width: 100%; grid-template-columns: 1fr; }
  .hero-gallery-card { min-height: 180px; }
  .home-mode .hero-quiz-button { width: 100%; }
}

/* Interaction and gallery refinements after live review. */
.welcome-film {
  width: min(920px, calc((100dvh - 345px) * 1.7778));
  max-width: calc(100% - 120px);
  height: auto;
  aspect-ratio: 16 / 9;
  flex: none;
  background: transparent;
}
.welcome-video { object-fit: cover; background: transparent; }
.hero-quiz-button { width: min(920px, calc((100dvh - 345px) * 1.7778)); max-width: calc(100% - 120px); }

.answer { position: relative; overflow: hidden; }
.answer.selected {
  color: #fff;
  border-color: var(--gold);
  background: linear-gradient(120deg, #253c72, #6077c6 52%, #d99a32);
  box-shadow: 0 0 0 3px rgba(224,160,58,.28), 0 0 28px rgba(245,201,111,.7);
  animation: answerGlow .42s ease both;
}
.answer.selected::after {
  content: "";
  position: absolute;
  inset: -60% auto -60% -25%;
  width: 22%;
  background: rgba(255,255,255,.68);
  transform: rotate(18deg);
  animation: choiceShine .55s ease forwards;
}
.answer:disabled { cursor: default; }
.answer:not(.selected):disabled { opacity: .58; }
.question-card.page-flip-out { transform-origin: left center; animation: pageFlipOut .26s ease-in both; }
@keyframes answerGlow { from { transform: scale(.985); } to { transform: scale(1); } }
@keyframes choiceShine { to { left: 120%; } }
@keyframes pageFlipOut { to { opacity: 0; transform: perspective(1000px) rotateY(-12deg) translateX(-22px); } }

.result-mode .result-stage { height: 100%; }
.result-mode .keep-section {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) rgba(255,255,255,.1);
}
.result-mode .keep-section::-webkit-scrollbar { width: 9px; }
.result-mode .keep-section::-webkit-scrollbar-track { background: rgba(255,255,255,.08); border-radius: 9px; }
.result-mode .keep-section::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 9px; }
.result-mode .template-grid.six-up {
  flex: none;
  min-height: 0;
  grid-template-rows: none;
  grid-auto-rows: auto;
  gap: 14px;
}
.result-mode .template-card { display: block; overflow: hidden; }
.result-mode .template-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: #202b4c;
}
.result-mode .template-card span { height: auto; min-height: 38px; padding: 8px 11px; font-size: .82rem; }
.choice-label b { color: var(--gold-2); font: inherit; }

@media (max-height: 820px) and (min-width: 881px) {
  .welcome-film, .hero-quiz-button { width: min(780px, calc((100dvh - 320px) * 1.7778)); }
}

@media (max-width: 880px) {
  .welcome-film, .hero-quiz-button { width: 100%; max-width: 100%; }
  .result-mode .result-stage { height: auto; }
  .result-mode .keep-section { overflow: visible; }
}
@media (max-width: 620px) {
  .mobile-header .brand { font-size: 1rem; }
  .brand-mark { width: 36px; height: 36px; }
  .category-grid { grid-template-columns: 1fr; }
  .category-card { min-height: 160px; }
  .quiz-top { display: block; }
  .quiz-count { margin-top: 10px; }
  .template-grid, .template-grid.six-up { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .template-card span { padding: 9px; font-size: .82rem; }
  .personalize-panel { grid-template-columns: 1fr; }
  .buy-button { width: 100%; }
}

/* Refinements from the first full-screen review. */
.welcome-film {
  width: min(100%, 920px);
  aspect-ratio: 16 / 9;
  flex: 0 1 auto;
  margin: 14px 0 12px;
}
.welcome-video {
  width: 100%;
  height: 100%;
  max-height: none;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #0f2942;
}
.hero-quiz-button { width: min(100%, 920px); }

.gallery-dock {
  top: clamp(250px, 30.8vh, 340px);
  width: 148px;
  min-height: 286px;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 9px;
  border-radius: 28px 0 0 28px;
  writing-mode: horizontal-tb;
  transform: none;
  text-align: left;
}
.gallery-dock span { font-size: .76rem; letter-spacing: .05em; text-transform: uppercase; }
.gallery-dock strong { margin: 0; font: 700 1.12rem/1.3 "Segoe Print", "Comic Sans MS", cursive; }
.gallery-dock small { font-size: .74rem; line-height: 1.35; opacity: .78; }

.result-stage { align-items: stretch; }
.result-hero, .keep-section { align-self: stretch; }
.result-image-wrap {
  width: min(100%, 344px);
  max-height: 43vh;
  flex: 0 1 auto;
  aspect-ratio: 4 / 5;
  align-self: center;
}
.result-image { object-fit: contain; background: var(--ink-2); }
.result-copy h1 { font-size: clamp(2.2rem, 4vw, 4.35rem); }
.keep-section { padding: clamp(14px, 1.65vw, 22px); }
.keep-section .eyebrow { margin-bottom: 5px; }
.keep-section h2 { font-size: clamp(1.45rem, 2.1vw, 2.15rem); }
.keep-intro { margin-top: 5px; line-height: 1.4; }
.choice-label { margin: 8px 0 6px; }
.template-grid.six-up {
  flex: 1 1 auto;
  min-height: 390px;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.template-card { display: grid; grid-template-rows: minmax(0, 1fr) 32px; }
.template-card img {
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
  object-fit: contain;
  background: #202b4c;
}
.template-card span { height: 32px; padding: 6px 9px; }
.personalize-panel { margin-top: 9px; padding-top: 9px; }
.fine-print { margin-top: 4px; }

.art-preview-modal {
  width: min(520px, calc(100% - 32px));
  height: min(88vh, 820px);
  padding: 16px;
  overflow: hidden;
  border: 0;
  border-radius: 26px;
  background: #101b36;
  color: #fff;
  box-shadow: var(--shadow);
}
.art-preview-modal::backdrop { background: rgba(7,13,29,.84); backdrop-filter: blur(7px); }
.art-preview-modal img { width: 100%; height: calc(100% - 46px); display: block; object-fit: contain; border-radius: 16px; }
.art-preview-modal p { margin: 10px 44px 0 4px; font: 700 1rem/1.2 "Segoe Print", "Comic Sans MS", cursive; text-transform: capitalize; }
.art-preview-modal .modal-close { z-index: 2; background: #fff; }

@media (max-height: 820px) and (min-width: 881px) {
  .stage > h1 { font-size: clamp(2.5rem, 4.8vw, 4.8rem); }
  .welcome-film { width: min(100%, 820px); }
  .hero-quiz-button { width: min(100%, 820px); }
  .result-image-wrap { max-height: 39vh; }
  .template-grid.six-up { min-height: 330px; }
}

@media (max-width: 880px) {
  .gallery-dock { top: auto; width: auto; min-height: 0; padding: 11px 17px; display: block; text-align: center; }
  .gallery-dock small { display: none; }
  .result-image-wrap { width: min(100%, 520px); max-height: none; }
  .template-grid.six-up { min-height: 0; }
  .template-card { display: block; }
  .template-card img { height: auto; aspect-ratio: 4 / 5; }
}

/* Viewport edition: the primary experience stays inside one desktop screen. */
:root {
  --ink: #17264a;
  --ink-2: #24365f;
}
html, body { height: 100%; overflow: hidden; }
.shell { grid-template-columns: 256px minmax(0, 1fr); height: 100dvh; min-height: 0; }
.sidebar { height: 100dvh; padding: 26px 20px 22px; background: linear-gradient(165deg, #1c315d 0%, #17264a 58%, #20365f 100%); }
.side-kicker { margin-top: 30px; }
.category-button { padding-block: 9px; }
.main { height: 100dvh; padding: clamp(18px, 2.4vw, 38px); overflow: hidden; }
.stage { width: 100%; height: 100%; max-width: 1180px; }
.stage:not(.result-stage) { display: flex; flex-direction: column; }
.stage > h1 { font-size: clamp(2.6rem, 5.2vw, 5.6rem); }
.intro-lead { margin-top: 10px; }
.welcome-film { width: min(100%, 860px); margin: 14px 0 12px; min-height: 0; flex: 1 1 auto; }
.welcome-video { height: 100%; max-height: 54vh; aspect-ratio: 16/9; }
.hero-quiz-button { width: min(100%, 860px); flex: 0 0 56px; }

.quiz-top h2 { font-size: clamp(1.65rem, 3vw, 3rem); }
.progress-track { margin: 14px 0 18px; }
.question-card { min-height: 0; flex: 1 1 auto; display: flex; flex-direction: column; padding: clamp(20px, 3vw, 34px); }
.question-card h2 { font-size: clamp(1.55rem, 3vw, 2.75rem); }
.question-help { margin: 8px 0 16px; }
.answers { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.answer { min-height: 76px; padding: 13px 16px; }
.answer.selected { border-color: var(--blue); background: #e9ecfa; box-shadow: inset 0 0 0 2px var(--blue); transform: none; }
.quiz-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 16px; }
.next-button { min-width: 150px; }
.next-button:disabled { opacity: .42; cursor: not-allowed; }

.result-stage { display: grid; grid-template-columns: minmax(280px, .72fr) minmax(480px, 1.28fr); gap: clamp(18px, 2vw, 30px); padding: clamp(14px, 1.7vw, 24px); overflow: hidden; }
.result-hero { min-height: 0; display: flex; flex-direction: column; gap: 14px; align-items: stretch; }
.result-image-wrap { flex: 1 1 auto; min-height: 220px; max-height: 42vh; aspect-ratio: auto; }
.result-copy { min-height: 0; }
.result-copy h1 { margin-top: 8px; font-size: clamp(2.3rem, 4.5vw, 4.9rem); }
.result-description { display: -webkit-box; margin-top: 8px; overflow: hidden; font-size: .98rem; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.trait-list { gap: 5px; margin-top: 10px; }
.trait-list li { padding: 5px 9px; font-size: .82rem; }
.result-actions { gap: 7px; margin-top: 12px; }
.result-actions .primary-button, .result-actions .secondary-button { min-height: 40px; padding: 0 13px; font-size: .82rem; }
.keep-section { min-height: 0; height: 100%; margin: 0; padding: clamp(16px, 2vw, 26px); display: flex; flex-direction: column; overflow: hidden; }
.keep-section h2 { font-size: clamp(1.55rem, 2.5vw, 2.65rem); }
.keep-intro { margin: 7px 0 0; font-size: .9rem; }
.choice-label { margin: 12px 0 8px; }
.template-grid.six-up { flex: 1 1 auto; min-height: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 8px; }
.template-card { min-height: 0; border-radius: 14px; }
.template-card img { height: calc(100% - 31px); min-height: 0; aspect-ratio: auto; }
.template-card span { height: 31px; padding: 6px 9px; font-size: .72rem; white-space: nowrap; }
.personalize-panel { grid-template-columns: 1fr auto; gap: 10px; margin-top: 11px; padding-top: 11px; }
.upload-zone { min-height: 60px; padding: 8px 10px; font-size: .85rem; }
.upload-preview { width: 42px; height: 42px; }
.buy-button { min-width: 175px; min-height: 46px; }
.fine-print { margin-top: 6px; font-size: .7rem; }

.gallery-dock { position: fixed; right: 0; top: 50%; z-index: 24; width: 62px; min-height: 245px; padding: 16px 10px; border: 0; border-radius: 22px 0 0 22px; background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--ink); box-shadow: -10px 14px 34px rgba(16,22,43,.2); cursor: pointer; writing-mode: vertical-rl; transform: translateY(-50%) rotate(180deg); }
.gallery-dock span { font-size: .7rem; font-weight: 700; opacity: .72; }
.gallery-dock strong { margin-top: 9px; font-size: .9rem; }
.gallery-modal { width: min(1180px, calc(100% - 48px)); height: min(820px, calc(100dvh - 48px)); padding: 0; overflow: hidden; border: 0; border-radius: 28px; background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }
.gallery-modal::backdrop { background: rgba(9,18,40,.78); backdrop-filter: blur(7px); }
.gallery-header { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 24px 30px 18px; }
.gallery-header h2 { font-size: clamp(1.8rem, 3vw, 3rem); }
.gallery-header .modal-close { position: static; flex: 0 0 auto; }
.gallery-categories { display: flex; gap: 7px; padding: 0 30px 16px; overflow-x: auto; }
.gallery-category { flex: 0 0 auto; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; font-weight: 700; }
.gallery-category.active { border-color: var(--gold); background: var(--gold); }
.gallery-grid { height: calc(100% - 142px); padding: 0 30px 28px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; overflow-y: auto; }
.gallery-card { min-width: 0; padding: 0 0 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: var(--card); cursor: pointer; text-align: left; box-shadow: 0 8px 22px rgba(20,22,39,.07); }
.gallery-art { position: relative; display: block; aspect-ratio: 4/5; overflow: hidden; background: var(--ink-2); }
.gallery-art img { width: 100%; height: 100%; display: block; object-fit: cover; }
.gallery-art .image-fallback { padding: 12px; font-size: .75rem; }
.gallery-card strong, .gallery-card small { display: block; margin: 9px 12px 0; }
.gallery-card small { margin-top: 2px; color: var(--muted); }

@media (max-width: 1100px) and (min-width: 881px) {
  .shell { grid-template-columns: 226px minmax(0, 1fr); }
  .result-stage { grid-template-columns: minmax(250px, .62fr) minmax(430px, 1.38fr); }
  .sidebar { padding-inline: 14px; }
  .gallery-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 880px) {
  html, body { overflow: auto; }
  .shell { height: auto; min-height: 100dvh; }
  .sidebar { height: auto; background: #1c315d; }
  .main { height: auto; min-height: calc(100dvh - 132px); overflow: visible; }
  .stage { height: auto; min-height: calc(100dvh - 200px); }
  .result-stage { display: block; overflow: visible; }
  .result-image-wrap { max-height: none; aspect-ratio: 4/5; }
  .keep-section { height: auto; margin-top: 18px; overflow: visible; }
  .template-grid.six-up { grid-template-rows: none; }
  .template-card img { height: auto; aspect-ratio: 4/5; }
  .gallery-dock { top: auto; right: 14px; bottom: 14px; width: auto; min-height: 0; padding: 11px 17px; border-radius: 999px; writing-mode: horizontal-tb; transform: none; }
  .gallery-dock span { display: none; }
  .gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .answers { grid-template-columns: 1fr; }
  .answer { min-height: 62px; }
  .gallery-modal { width: calc(100% - 18px); height: calc(100dvh - 18px); }
  .gallery-header { padding: 20px 18px 14px; }
  .gallery-categories { padding: 0 18px 12px; }
  .gallery-grid { height: calc(100% - 135px); padding: 0 18px 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}

/* Final viewport calibration: reserve space for the complete hero CTA. */
@media (min-width: 881px) {
  .home-mode .stage > .eyebrow { margin-bottom: 6px; }
  .home-mode .stage > h1 {
    font-size: clamp(2.65rem, 3.75vw, 4rem);
    line-height: .98;
  }
  .home-mode .intro-lead {
    margin-top: 8px;
    font-size: clamp(1rem, 1.45vw, 1.3rem);
    line-height: 1.25;
  }
  .home-mode .hero-media-row {
    width: auto;
    max-width: 100%;
    margin: 10px 0 0;
    grid-template-columns: minmax(0, min(680px, calc(43dvh * 1.7778))) 230px;
    gap: 18px;
  }
  .home-mode .hero-primary { gap: 8px; }
  .home-mode .hero-primary .hero-quiz-button {
    height: 52px;
    min-height: 52px;
    padding-block: 0;
  }

  .result-discovery-actions {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: stretch;
  }
  .result-discovery-actions .result-gallery-callout {
    min-width: 0;
    min-height: 48px;
    margin: 0;
  }
  .result-route-secondary {
    min-width: 150px;
    padding: 8px 13px;
    border: 1px solid rgba(245,201,111,.34);
    border-radius: 15px;
    background: rgba(255,255,255,.075);
    color: var(--gold-2);
    cursor: pointer;
    font-size: .78rem;
    font-weight: 850;
    line-height: 1.25;
  }
  .result-route-secondary:hover,
  .result-route-secondary:focus-visible {
    border-color: var(--gold-2);
    background: rgba(224,160,58,.17);
  }
}

@media (min-width: 881px) and (max-height: 760px) {
  .home-mode .stage > h1 { font-size: clamp(2.35rem, 3.45vw, 3.45rem); }
  .home-mode .intro-lead { margin-top: 5px; font-size: 1rem; }
  .home-mode .hero-media-row {
    margin-top: 7px;
    grid-template-columns: minmax(0, min(620px, calc(40dvh * 1.7778))) 214px;
    gap: 14px;
  }
  .home-mode .hero-primary .hero-quiz-button { height: 48px; min-height: 48px; }
  .home-mode .hero-gallery-card { padding: 14px 15px; }
  .home-mode .hero-gallery-card strong { margin-top: 6px; font-size: 1.08rem; }
  .home-mode .hero-gallery-card small { margin-top: 6px; font-size: .75rem; line-height: 1.35; }
  .home-mode .hero-gallery-card i { margin-top: 9px; }

  .result-discovery-actions .result-gallery-callout { min-height: 44px; padding-block: 7px; }
  .result-route-secondary { min-width: 136px; padding: 7px 10px; font-size: .72rem; }
}

@media (max-width: 880px) {
  .result-discovery-actions { display: grid; gap: 8px; }
  .result-route-secondary {
    min-height: 46px;
    padding: 10px 14px;
    border: 1px solid rgba(245,201,111,.34);
    border-radius: 15px;
    background: rgba(255,255,255,.075);
    color: var(--gold-2);
    cursor: pointer;
    font-weight: 800;
  }
}
