:root {
  --ink: #f7f3ea;
  --muted: #b9c0cb;
  --night: #101722;
  --night-soft: #182230;
  --red: #e4554d;
  --gold: #d8b36a;
  --paper: #f4eedf;
  --paper-ink: #18202b;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 12%, rgba(228, 85, 77, 0.2), transparent 30rem),
    radial-gradient(circle at 88% 80%, rgba(216, 179, 106, 0.13), transparent 32rem),
    var(--night);
  font-family: "DM Sans", sans-serif;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
}

button { font: inherit; }

.story {
  width: min(1180px, 100%);
  min-height: 100svh;
  margin: 0 auto;
  padding: 30px clamp(20px, 4vw, 58px) 105px;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(30px, 6vh, 72px);
}

.eyebrow, .chapter-number, .result-kicker {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  font-weight: 700;
}

.eyebrow { color: var(--gold); }

.progress { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.78rem; }
.progress-track { width: 96px; height: 2px; background: rgba(255,255,255,.14); }
.progress-track span { display: block; width: 16.66%; height: 100%; background: var(--gold); transition: width .45s ease; }

.chapter {
  flex: 1;
  display: grid;
  align-items: center;
  animation: chapter-in .65s cubic-bezier(.2,.8,.2,1) both;
}

.chapter[hidden] { display: none; }

@keyframes chapter-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.memory-layout, .future-layout {
  display: grid;
  grid-template-columns: minmax(260px, .82fr) minmax(310px, 1fr);
  gap: clamp(42px, 8vw, 110px);
  align-items: center;
}

.memory-layout.reverse .photo-card { order: 2; }

.photo-card {
  position: relative;
  width: min(100%, 420px);
  margin: 0 auto;
  padding: 14px 14px 50px;
  color: var(--paper-ink);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.tilt-left { transform: rotate(-2.2deg); }
.tilt-right { transform: rotate(2deg); }

.photo-card::before {
  content: "";
  position: absolute;
  width: 90px;
  height: 26px;
  top: -13px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  background: rgba(216, 179, 106, .72);
  box-shadow: 0 2px 8px rgba(0,0,0,.13);
}

.photo-card img, .photo-placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: #d9d1c3;
}

.photo-placeholder {
  position: absolute;
  inset: 14px 14px 50px;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  color: #6b6258;
  background: linear-gradient(145deg, #ddd3c2, #bfb4a4);
}

.photo-placeholder strong { font: 600 4rem/1 "Playfair Display", serif; color: rgba(24,32,43,.28); }
.photo-placeholder span { max-width: 190px; font-size: .9rem; }
.photo-card img:not([src=""]) { position: relative; z-index: 1; }
.photo-card figcaption { position: absolute; left: 20px; bottom: 15px; font: italic 600 1.05rem "Playfair Display", serif; }

.chapter-copy { max-width: 580px; }
.chapter-number { color: var(--red); }
h1, h2 { margin: 16px 0 22px; font-family: "Playfair Display", serif; font-weight: 600; line-height: 1.06; letter-spacing: -.025em; }
h1, .chapter-copy h2 { font-size: clamp(2.45rem, 5.5vw, 5rem); }
.chapter-copy p { margin: 0 0 16px; color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.13rem); line-height: 1.75; }
.chapter-copy .highlight { color: var(--ink); font-weight: 600; border-left: 2px solid var(--gold); padding-left: 18px; }

.future-layout { grid-template-columns: minmax(280px, .82fr) minmax(330px, 1fr); }
.future-visual {
  width: min(100%, 410px);
  aspect-ratio: 4 / 5;
  margin: 0 auto;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(216,179,106,.38);
  background: radial-gradient(circle, rgba(228,85,77,.25), transparent 55%), var(--night-soft);
  box-shadow: var(--shadow);
}
.question-mark { font: italic 600 clamp(8rem, 20vw, 14rem)/1 "Playfair Display", serif; color: var(--gold); animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.035); opacity: .78; } }
.future-visual img { width: 100%; height: 100%; object-fit: cover; }
.result-fallback { text-align: center; padding: 30px; }
.result-fallback span { display: block; font-size: clamp(5rem, 15vw, 9rem); }
.result-fallback strong { display: block; margin-top: 22px; color: var(--gold); font: italic 600 1.5rem "Playfair Display", serif; }
.quiz-panel h2 { font-size: clamp(2.2rem, 5vw, 4.2rem); }
.quiz-panel p { color: var(--muted); line-height: 1.7; font-size: 1.05rem; }

.primary-button, .secondary-button, .answer-button, .nav-button {
  border: 0;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, color .2s ease, opacity .2s ease;
}
.primary-button { margin-top: 18px; padding: 15px 22px; color: #15191f; background: var(--gold); font-weight: 700; }
.primary-button:hover, .answer-button:hover { transform: translateY(-2px); }
.question-label { color: var(--gold); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; }
.quiz-question { font: 600 clamp(1.7rem, 4vw, 2.6rem)/1.16 "Playfair Display", serif; margin: 12px 0 24px; }
.answers { display: grid; gap: 10px; }
.answer-button { width: 100%; padding: 14px 16px; text-align: left; color: var(--ink); background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); }
.answer-button:hover, .answer-button:focus-visible { background: rgba(216,179,106,.16); border-color: var(--gold); outline: none; }
.quiz-meter { height: 3px; margin-top: 24px; background: rgba(255,255,255,.1); }
.quiz-meter span { display: block; height: 100%; width: 20%; background: var(--red); transition: width .35s ease; }
.result-kicker { color: var(--gold); }
.quiz-result h2 { margin-bottom: 14px; }
.secondary-button { padding: 0; color: var(--gold); background: none; text-decoration: underline; text-underline-offset: 5px; }

.finale { place-items: center; }
.final-card { max-width: 800px; padding: clamp(30px, 6vw, 64px); border: 1px solid rgba(216,179,106,.35); background: rgba(24,34,48,.78); box-shadow: var(--shadow); text-align: center; }
.final-card h2 { font-size: clamp(2.5rem, 6vw, 5.2rem); }
.final-card h2 em { color: var(--gold); }
.final-card p { max-width: 660px; margin: 0 auto 18px; color: var(--muted); font-size: 1.05rem; line-height: 1.75; }
.final-card .final-line { color: var(--ink); font-weight: 700; }
.signature { margin-top: 34px; font: italic 600 1.25rem "Playfair Display", serif; }
.signature span { color: var(--red); }

.story-navigation {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 5;
  width: min(620px, calc(100% - 28px));
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 15px;
  padding: 9px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(16,23,34,.86);
  backdrop-filter: blur(18px);
}
.nav-button { min-height: 45px; color: var(--ink); background: transparent; font-weight: 700; }
.nav-back { width: 46px; font-size: 1.25rem; }
.nav-next { padding: 0 17px; background: var(--red); }
.nav-next span { margin-left: 9px; }
.nav-button:disabled { opacity: .25; cursor: default; }
.dots { display: flex; justify-content: center; gap: 7px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.22); transition: width .25s, background .25s; }
.dot.active { width: 22px; border-radius: 8px; background: var(--gold); }

@media (max-width: 760px) {
  .story { padding-top: 20px; }
  .topbar { margin-bottom: 28px; }
  .eyebrow { max-width: 150px; }
  .memory-layout, .future-layout { grid-template-columns: 1fr; gap: 32px; }
  .memory-layout.reverse .photo-card { order: 0; }
  .photo-card { width: min(75vw, 320px); padding: 10px 10px 40px; }
  .photo-placeholder { inset: 10px 10px 40px; }
  .photo-card figcaption { bottom: 10px; }
  .chapter-copy { text-align: center; }
  .chapter-copy .highlight { text-align: left; }
  h1, .chapter-copy h2 { font-size: clamp(2.1rem, 10vw, 3.3rem); }
  .chapter-copy p { line-height: 1.58; }
  .future-visual { width: min(65vw, 270px); }
  .quiz-panel { text-align: center; }
  .answer-button { text-align: center; }
  .final-card { padding: 28px 20px; }
  .final-card p { line-height: 1.58; }
}

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


/* Warm, personal redesign */
:root {
  --ink: #382b30;
  --muted: #75666c;
  --night: #f8f2ed;
  --night-soft: #efe2dc;
  --red: #a7475b;
  --gold: #b88755;
  --paper: #fffdf9;
  --paper-ink: #382b30;
  --blush: #e9c8c9;
  --shadow: 0 24px 65px rgba(91, 59, 67, 0.16);
}

body {
  background:
    radial-gradient(circle at 8% 5%, rgba(233, 200, 201, .55), transparent 28rem),
    radial-gradient(circle at 92% 86%, rgba(221, 194, 159, .36), transparent 30rem),
    linear-gradient(145deg, #fbf7f2 0%, #f5ebe6 52%, #faf6f0 100%);
}

body::before {
  opacity: .055;
  mix-blend-mode: multiply;
}

body::after {
  content: "♡";
  position: fixed;
  right: clamp(18px, 5vw, 70px);
  top: 15vh;
  color: rgba(167, 71, 91, .12);
  font: 400 clamp(6rem, 15vw, 13rem)/1 "Playfair Display", serif;
  pointer-events: none;
}

.topbar {
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(56, 43, 48, .09);
}

.eyebrow { color: var(--red); }
.progress { color: var(--muted); }
.progress-track { background: rgba(56, 43, 48, .12); }
.progress-track span { background: linear-gradient(90deg, var(--red), var(--gold)); }

.photo-card {
  border: 1px solid rgba(56, 43, 48, .07);
  border-radius: 3px;
  box-shadow: var(--shadow);
}

.photo-card::before {
  background: rgba(218, 188, 153, .78);
}

.photo-placeholder {
  color: #75656a;
  background:
    linear-gradient(rgba(255,255,255,.18), rgba(255,255,255,.18)),
    linear-gradient(145deg, #eadbd3, #dcc6c2);
}

.photo-card figcaption { color: var(--paper-ink); }
.chapter-number { color: var(--red); }
.chapter-copy p,
.quiz-panel p,
.final-card p { color: var(--muted); }

.chapter-copy .highlight {
  color: var(--ink);
  border-left-color: var(--red);
  background: rgba(255, 255, 255, .42);
  padding: 13px 16px;
  border-radius: 0 12px 12px 0;
}

.future-visual {
  border: 1px solid rgba(167, 71, 91, .18);
  border-radius: 26px;
  background:
    radial-gradient(circle at 50% 35%, rgba(233, 200, 201, .72), transparent 55%),
    rgba(255, 253, 249, .78);
  box-shadow: var(--shadow);
}

.question-mark { color: var(--red); opacity: .82; }
.result-fallback strong,
.result-kicker,
.question-label { color: var(--red); }

.primary-button {
  color: #fffaf6;
  background: linear-gradient(135deg, var(--red), #8c354a);
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(167, 71, 91, .2);
}

.answer-button {
  color: var(--ink);
  background: rgba(255, 255, 255, .62);
  border-color: rgba(56, 43, 48, .1);
  border-radius: 14px;
}

.answer-button:hover,
.answer-button:focus-visible {
  color: #6e2638;
  background: #fffaf8;
  border-color: rgba(167, 71, 91, .55);
}

.quiz-meter { background: rgba(56, 43, 48, .1); }
.quiz-meter span { background: linear-gradient(90deg, var(--red), var(--gold)); }
.secondary-button { color: var(--red); }

.final-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(167, 71, 91, .14);
  border-radius: 28px;
  background: rgba(255, 253, 249, .76);
  box-shadow: var(--shadow);
}

.final-card::before {
  content: "“";
  position: absolute;
  left: 22px;
  top: -28px;
  color: rgba(167, 71, 91, .09);
  font: 600 12rem/1 "Playfair Display", serif;
}

.final-card h2 em { color: var(--red); }
.final-card .final-line { color: var(--ink); }
.signature { color: var(--ink); }
.signature span { color: var(--red); }

.story-navigation {
  border: 1px solid rgba(56, 43, 48, .1);
  border-radius: 999px;
  background: rgba(255, 251, 247, .82);
  box-shadow: 0 12px 36px rgba(91, 59, 67, .13);
}

.nav-button { color: var(--ink); }
.nav-next {
  color: #fffaf6;
  background: linear-gradient(135deg, var(--red), #8c354a);
  border-radius: 999px;
}
.dot { background: rgba(56, 43, 48, .18); }
.dot.active { background: var(--gold); }

/* Final objective page */
.objective-chapter { place-items: center; }

.objective-card {
  width: min(100%, 760px);
  padding: clamp(26px, 5vw, 52px);
  border: 1px solid rgba(167, 71, 91, .13);
  border-radius: 30px;
  background: rgba(255, 253, 249, .78);
  box-shadow: var(--shadow);
  text-align: center;
}

.objective-card h2 {
  margin: 10px 0 28px;
  color: var(--ink);
  font-size: clamp(2.8rem, 7vw, 5.7rem);
}

.objective-frame {
  position: relative;
  width: min(100%, 510px);
  aspect-ratio: 4 / 3;
  margin: 0 auto;
  overflow: hidden;
  padding: 10px;
  border: 1px solid rgba(167, 71, 91, .18);
  border-radius: 22px;
  background: #fffaf6;
  box-shadow: 0 18px 46px rgba(91, 59, 67, .13);
}

.objective-frame img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  object-fit: cover;
}

.objective-placeholder {
  position: absolute;
  inset: 10px;
  display: grid;
  place-content: center;
  gap: 8px;
  border: 1px dashed rgba(167, 71, 91, .34);
  border-radius: 14px;
  color: var(--muted);
  background:
    radial-gradient(circle at 50% 20%, rgba(233, 200, 201, .5), transparent 50%),
    #f8eee9;
}

.objective-placeholder .objective-icon {
  color: var(--red);
  font-size: 2rem;
}

.objective-placeholder strong {
  color: var(--ink);
  font: italic 600 1.35rem "Playfair Display", serif;
}

.objective-placeholder small { line-height: 1.5; }

.personal-signature {
  width: min(100%, 510px);
  margin: 24px auto 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  color: var(--ink);
  font: italic 600 clamp(1.1rem, 3vw, 1.35rem) "Playfair Display", serif;
  transform: rotate(-2deg);
}

.kiss {
  margin-top: 2px;
  margin-right: 13px;
  font-size: 1.8rem;
  filter: saturate(.78);
}

@media (max-width: 760px) {
  body::after { display: none; }
  .story-navigation { border-radius: 22px; }
  .objective-card { border-radius: 22px; }
  .objective-frame { border-radius: 18px; }
}
