:root {
  color-scheme: dark;
  --bg: #0c1220;
  --bg-soft: #162038;
  --surface: rgba(255, 255, 255, 0.075);
  --surface-border: rgba(255, 255, 255, 0.14);
  --paper: rgba(247, 240, 231, 0.97);
  --paper-border: rgba(58, 43, 31, 0.12);
  --text: #f7f2eb;
  --text-soft: rgba(247, 242, 235, 0.72);
  --ink: #281d17;
  --ink-soft: #735f55;
  --accent: #d6aa63;
  --accent-strong: #f1ce8d;
  --accent-soft: rgba(214, 170, 99, 0.18);
  --rose: #d79090;
  --rose-soft: rgba(215, 144, 144, 0.18);
  --shadow: 0 28px 92px rgba(4, 9, 18, 0.36);
  --shadow-soft: 0 18px 54px rgba(4, 9, 18, 0.24);
  --max-width: 1160px;
  --radius-2xl: 38px;
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-pill: 999px;
  --fast: 180ms ease;
  --slow: 460ms cubic-bezier(0.2, 0.8, 0.2, 1);
  font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body[data-theme="blush"] {
  color-scheme: light;
  --bg: #fff1f3;
  --bg-soft: #ffe6eb;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-border: rgba(184, 108, 133, 0.18);
  --paper: rgba(255, 250, 251, 0.98);
  --paper-border: rgba(184, 108, 133, 0.16);
  --text: #53263d;
  --text-soft: rgba(83, 38, 61, 0.72);
  --ink: #41202f;
  --ink-soft: #82586d;
  --accent: #cf7b9d;
  --accent-strong: #b94b78;
  --accent-soft: rgba(207, 123, 157, 0.16);
  --rose: #f2a0b6;
  --rose-soft: rgba(242, 160, 182, 0.18);
  --shadow: 0 24px 74px rgba(178, 93, 125, 0.2);
  --shadow-soft: 0 14px 46px rgba(178, 93, 125, 0.12);
}

body[data-theme="daybreak"] {
  color-scheme: light;
  --bg: #f5ecdf;
  --bg-soft: #fff7ee;
  --surface: rgba(255, 255, 255, 0.74);
  --surface-border: rgba(150, 112, 61, 0.16);
  --paper: rgba(255, 251, 245, 0.99);
  --paper-border: rgba(150, 112, 61, 0.14);
  --text: #392818;
  --text-soft: rgba(57, 40, 24, 0.72);
  --ink: #302216;
  --ink-soft: #76604b;
  --accent: #b78742;
  --accent-strong: #8f6630;
  --accent-soft: rgba(183, 135, 66, 0.16);
  --rose: #c98672;
  --rose-soft: rgba(201, 134, 114, 0.16);
  --shadow: 0 24px 78px rgba(110, 80, 36, 0.17);
  --shadow-soft: 0 16px 42px rgba(110, 80, 36, 0.11);
}

body[data-theme="starlit"] {
  color-scheme: dark;
  --bg: #07111f;
  --bg-soft: #10203b;
  --surface: rgba(124, 163, 255, 0.11);
  --surface-border: rgba(169, 197, 255, 0.2);
  --paper: rgba(246, 248, 255, 0.97);
  --paper-border: rgba(78, 96, 138, 0.14);
  --text: #f5f8ff;
  --text-soft: rgba(245, 248, 255, 0.72);
  --ink: #19233b;
  --ink-soft: #5d6d92;
  --accent: #86a8ff;
  --accent-strong: #bfd0ff;
  --accent-soft: rgba(134, 168, 255, 0.18);
  --rose: #8dd8ff;
  --rose-soft: rgba(141, 216, 255, 0.16);
  --shadow: 0 28px 92px rgba(3, 10, 24, 0.42);
  --shadow-soft: 0 18px 54px rgba(3, 10, 24, 0.3);
}

body[data-theme="rosewood"] {
  color-scheme: dark;
  --bg: #1b0c12;
  --bg-soft: #331923;
  --surface: rgba(255, 226, 236, 0.08);
  --surface-border: rgba(255, 198, 216, 0.16);
  --paper: rgba(255, 247, 249, 0.97);
  --paper-border: rgba(116, 54, 78, 0.14);
  --text: #fff1f4;
  --text-soft: rgba(255, 241, 244, 0.72);
  --ink: #31141e;
  --ink-soft: #8a5668;
  --accent: #d86f96;
  --accent-strong: #f2b5c9;
  --accent-soft: rgba(216, 111, 150, 0.18);
  --rose: #ff9fc2;
  --rose-soft: rgba(255, 159, 194, 0.16);
  --shadow: 0 28px 88px rgba(20, 5, 11, 0.4);
  --shadow-soft: 0 18px 52px rgba(20, 5, 11, 0.28);
}

body[data-theme="meadow"] {
  color-scheme: light;
  --bg: #edf7ef;
  --bg-soft: #dfeee3;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-border: rgba(98, 142, 109, 0.18);
  --paper: rgba(253, 255, 250, 0.98);
  --paper-border: rgba(98, 142, 109, 0.14);
  --text: #1d3423;
  --text-soft: rgba(29, 52, 35, 0.72);
  --ink: #203225;
  --ink-soft: #5e7a64;
  --accent: #7ca56f;
  --accent-strong: #57794e;
  --accent-soft: rgba(124, 165, 111, 0.16);
  --rose: #d3a26f;
  --rose-soft: rgba(211, 162, 111, 0.14);
  --shadow: 0 24px 68px rgba(76, 112, 83, 0.16);
  --shadow-soft: 0 16px 42px rgba(76, 112, 83, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.08), transparent 26%),
    radial-gradient(circle at 85% 18%, var(--accent-soft), transparent 28%),
    radial-gradient(circle at 70% 80%, var(--rose-soft), transparent 22%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
  color: var(--text);
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.06), transparent 14%),
    radial-gradient(circle at 82% 24%, rgba(255, 255, 255, 0.035), transparent 16%),
    radial-gradient(circle at 68% 82%, rgba(255, 255, 255, 0.03), transparent 14%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 70px 70px;
  opacity: 0.18;
  mix-blend-mode: soft-light;
  pointer-events: none;
  z-index: 0;
}

body.panel-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
}

.ambient {
  position: fixed;
  border-radius: 50%;
  filter: blur(14px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.7;
}

.ambient-one {
  top: -7rem;
  left: -5rem;
  width: 23rem;
  height: 23rem;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18) 0%, transparent 72%);
}

.ambient-two {
  top: 18%;
  right: -8rem;
  width: 24rem;
  height: 24rem;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%);
}

.ambient-three {
  left: 40%;
  bottom: -8rem;
  width: 26rem;
  height: 26rem;
  background: radial-gradient(circle, var(--rose-soft) 0%, transparent 70%);
}

.heart-layer {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.bg-heart {
  position: absolute;
  color: color-mix(in srgb, var(--rose) 58%, white 42%);
  opacity: 0.12;
  filter: blur(0.6px);
  text-shadow: 0 12px 44px color-mix(in srgb, var(--accent) 55%, transparent);
  animation: heartbeat 3.1s ease-in-out infinite;
}

.heart-one {
  top: 8%;
  left: 9%;
  font-size: 4.5rem;
}

.heart-two {
  top: 16%;
  right: 11%;
  font-size: 6rem;
  animation-delay: 0.45s;
}

.heart-three {
  bottom: 24%;
  left: 18%;
  font-size: 5.3rem;
  animation-delay: 0.9s;
}

.heart-four {
  bottom: 10%;
  right: 15%;
  font-size: 4.2rem;
  animation-delay: 1.35s;
}

.heart-five {
  top: 50%;
  left: 47%;
  font-size: 3.6rem;
  animation-delay: 1.8s;
}

@keyframes heartbeat {
  0%,
  42%,
  100% {
    transform: scale(0.94);
    opacity: 0.08;
  }

  14% {
    transform: scale(1.14);
    opacity: 0.2;
  }

  22% {
    transform: scale(0.98);
    opacity: 0.12;
  }

  30% {
    transform: scale(1.08);
    opacity: 0.18;
  }
}

.float-layer {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.float-symbol {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--accent);
  opacity: 0;
  text-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  animation-name: drift;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes drift {
  0% {
    transform: translate3d(0, 30px, 0) rotate(0deg) scale(0.86);
    opacity: 0;
  }

  12% {
    opacity: 0.7;
  }

  100% {
    transform: translate3d(var(--dx), -120vh, 0) rotate(360deg) scale(1.02);
    opacity: 0;
  }
}

.shell,
.page,
.story-ui {
  position: relative;
  z-index: 2;
}

.shell {
  position: sticky;
  top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(var(--max-width), calc(100% - 2rem));
  margin: 1rem auto 0;
  padding: 0.9rem 1.05rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-soft);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-soft), rgba(255, 255, 255, 0.1));
  color: var(--accent-strong);
}

.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.nav a {
  transition: color var(--fast), transform var(--fast);
}

.nav a[aria-current="page"],
.nav a:hover {
  color: var(--accent-strong);
  transform: translateY(-1px);
}

.story-ui {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(44rem, calc(100% - 2rem));
  margin: 1rem auto 0;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-soft);
}

.story-meta {
  display: grid;
  justify-items: center;
  gap: 0.55rem;
  min-width: 10rem;
}

.story-counter {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.story-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
}

.story-dot {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: transform var(--fast), background var(--fast), border-color var(--fast);
}

.story-dot.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: transparent;
  transform: scale(1.12);
}

.story-nav[disabled] {
  opacity: 0.45;
  pointer-events: none;
}

.page {
  width: min(var(--max-width), calc(100% - 2rem));
  min-height: calc(100svh - 11rem);
  margin: 0 auto;
  padding: 1.6rem 0 6.8rem;
}

.story-page {
  display: none;
  min-height: calc(100svh - 14.5rem);
  overflow: auto;
  padding-bottom: 1rem;
}

.story-page.active {
  display: block;
  animation: story-fade 360ms var(--slow);
}

.scene.story-page.active {
  display: flex;
}

.cover.story-page.active {
  display: grid;
}

@keyframes story-fade {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.story-page::-webkit-scrollbar {
  width: 10px;
}

.story-page::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-pill);
}

.cover {
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 1.4rem;
  align-items: stretch;
}

.cover-copy,
.portrait-card,
.scene-frame-card,
.feature-frame,
.compliment-stage,
.letter-card,
.finale-card,
.noticing-card,
.memory-card,
.gallery-card {
  position: relative;
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow);
}

.cover-copy,
.portrait-card,
.scene-frame-card,
.feature-frame,
.compliment-stage,
.finale-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 60%);
  border: 1px solid var(--surface-border);
  backdrop-filter: blur(20px);
}

.cover-copy {
  overflow: hidden;
  padding: clamp(1.7rem, 4vw, 2.6rem);
}

.cover-copy::after {
  content: "";
  position: absolute;
  inset: auto -12% -22% auto;
  width: 18rem;
  height: 18rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 68%);
  pointer-events: none;
}

.eyebrow {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.opening-line {
  margin: 1rem 0 0;
  max-width: 34rem;
  font-size: clamp(1rem, 2vw, 1.16rem);
  line-height: 1.75;
  color: var(--text-soft);
}

.cover h1,
.section-heading h2,
.customize-head h2 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  line-height: 0.95;
  letter-spacing: -0.035em;
}

.cover h1 {
  margin-top: 1rem;
  max-width: 8.4ch;
  font-size: clamp(3.4rem, 8vw, 6.9rem);
}

.lede {
  margin: 1rem 0 0;
  max-width: 48ch;
  font-size: clamp(1rem, 2vw, 1.14rem);
  line-height: 1.85;
  color: var(--text-soft);
}

.cta-row,
.pill-row,
.section-actions,
.compliment-actions,
.finale-actions,
.theme-group,
.customize-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.cta-row {
  margin-top: 1.6rem;
}

.pill-row {
  margin-top: 1.3rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.15rem;
  padding: 0.84rem 1.2rem;
  border-radius: var(--radius-pill);
  font-weight: 800;
  letter-spacing: 0.01em;
  transition:
    transform var(--fast),
    box-shadow var(--fast),
    background var(--fast),
    color var(--fast),
    border-color var(--fast);
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fffaf5;
  box-shadow: 0 14px 30px rgba(214, 170, 99, 0.25);
}

.button-secondary,
.button-ghost,
.icon-button,
.theme-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--surface-border);
  color: var(--text);
  backdrop-filter: blur(14px);
}

.button-secondary:hover,
.button-ghost:hover,
.icon-button:hover,
.theme-chip:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.38rem 0.85rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--surface-border);
  color: var(--text);
  font-size: 0.87rem;
  font-weight: 600;
}

.portrait-card {
  padding: 1rem;
}

.portrait-frame {
  position: relative;
  min-height: 33rem;
  overflow: hidden;
  border-radius: calc(var(--radius-2xl) - 8px);
  border: 1px solid var(--paper-border);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.78), transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(244, 236, 226, 0.96));
}

#photoImage {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-placeholder {
  min-height: 33rem;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.55rem;
  padding: 1.6rem;
  color: var(--ink);
  text-align: center;
}

.monogram {
  display: grid;
  place-items: center;
  width: 8.6rem;
  height: 8.6rem;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(214, 170, 99, 0.26), rgba(215, 144, 144, 0.22));
  color: var(--ink);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(3.2rem, 8vw, 4.8rem);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.44);
}

.photo-title {
  margin: 0.4rem 0 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.8rem;
  font-weight: 700;
}

.photo-note,
.portrait-caption,
.section-copy,
.gallery-hint,
.helper-text {
  line-height: 1.75;
}

.photo-note {
  margin: 0;
  max-width: 28rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.portrait-caption {
  margin: 0.95rem 0 0.15rem;
  color: var(--text-soft);
  font-size: 0.94rem;
}

.scene {
  flex-direction: column;
  justify-content: center;
  gap: 1.2rem;
}

.scene-layout {
  display: grid;
  grid-template-columns: minmax(290px, 0.84fr) minmax(0, 1.16fr);
  gap: 1rem;
  align-items: stretch;
}

.scene-layout-reverse {
  grid-template-columns: minmax(0, 1.05fr) minmax(290px, 0.95fr);
}

.scene-layout-reverse > :first-child {
  order: 2;
}

.scene-layout-reverse > :last-child {
  order: 1;
}

.section-heading {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
  max-width: 50rem;
}

.section-heading h2 {
  font-size: clamp(2.25rem, 4.8vw, 3.75rem);
}

.section-copy,
.gallery-hint {
  margin: 0;
  max-width: 62ch;
  color: var(--text-soft);
}

.noticing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.noticing-card,
.memory-card,
.gallery-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  backdrop-filter: blur(18px);
}

.noticing-card {
  padding: 1.2rem;
}

.noticing-index,
.memory-index {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.noticing-title,
.memory-title,
.gallery-title {
  margin: 0.75rem 0 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.noticing-title {
  font-size: 1.65rem;
}

.noticing-body,
.memory-body,
.gallery-caption {
  margin: 0.55rem 0 0;
  color: var(--text-soft);
}

.memory-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.memory-card {
  padding: 1.35rem;
  min-height: 16rem;
}

.memory-card:nth-child(1) {
  grid-column: span 2;
  min-height: 18rem;
}

.memory-title {
  font-size: clamp(1.85rem, 3vw, 2.45rem);
}

.memory-body {
  max-width: 44ch;
  line-height: 1.72;
}

.scene-frame-card {
  padding: 1rem;
}

.scene-frame {
  position: relative;
  min-height: 28rem;
  overflow: hidden;
  border-radius: calc(var(--radius-2xl) - 8px);
  border: 1px solid var(--paper-border);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.78), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(244, 236, 226, 0.96));
}

.scene-frame-image,
.feature-frame-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.scene-frame-placeholder,
.feature-frame-placeholder {
  min-height: inherit;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.65rem;
  padding: 1.5rem;
  color: var(--ink);
  text-align: center;
}

.scene-frame-placeholder h3,
.feature-frame-placeholder h3 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.95rem, 3.4vw, 2.5rem);
  line-height: 1;
}

.scene-frame-placeholder p,
.feature-frame-placeholder p {
  margin: 0;
  max-width: 28rem;
  color: var(--ink-soft);
  line-height: 1.7;
}

.scene-frame-kicker,
.feature-frame-index {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.scene-frame-note {
  margin: 0.9rem 0 0;
  color: var(--text-soft);
  line-height: 1.7;
}

.feature-frame {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  overflow: hidden;
}

.feature-frame-media {
  min-height: 29rem;
  border-right: 1px solid var(--surface-border);
  overflow: hidden;
}

.feature-frame-copy {
  display: grid;
  align-content: center;
  gap: 0.7rem;
  padding: clamp(1.4rem, 4vw, 2rem);
}

.feature-frame-title {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.feature-frame-body {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.8;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.gallery-card {
  display: grid;
  min-height: 24rem;
}

.gallery-card:not(.placeholder) {
  grid-template-rows: 1fr auto;
}

.gallery-image-wrap {
  position: relative;
  overflow: hidden;
}

.gallery-image {
  width: 100%;
  height: 100%;
  min-height: 20rem;
  object-fit: cover;
  display: block;
  filter: saturate(0.94) contrast(1.04);
}

.gallery-copy {
  padding: 1rem 1rem 1.05rem;
}

.gallery-card.placeholder {
  padding: 1.1rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05)),
    linear-gradient(135deg, var(--accent-soft), rgba(255, 255, 255, 0.04));
  border-style: dashed;
}

.gallery-fallback {
  display: grid;
  place-items: center;
  min-height: 20rem;
  padding: 1rem;
  border-radius: calc(var(--radius-2xl) - 14px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent);
  text-align: center;
}

.gallery-title {
  font-size: 1.7rem;
}

.gallery-caption {
  line-height: 1.7;
}

.gallery-hint {
  margin-top: 1rem;
}

.compliment-stage {
  padding: clamp(1.5rem, 3vw, 2.2rem);
}

.compliment-badge {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--surface-border);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 700;
}

.compliment-card {
  position: relative;
  min-height: 7.2rem;
  margin-top: 1rem;
}

.compliment-text {
  position: absolute;
  inset: 0;
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  line-height: 1.12;
  opacity: 0;
  transform: translateY(20px);
  transition: transform 360ms var(--slow), opacity 360ms var(--slow);
}

.compliment-text.is-active,
.compliment-text.is-entering {
  opacity: 1;
  transform: translateY(0);
}

.compliment-text.is-leaving {
  opacity: 0;
  transform: translateY(-18px);
}

.compliment-actions {
  margin-top: 1.4rem;
}

.letter-card {
  padding: clamp(1.6rem, 3vw, 2.2rem);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.65), transparent 26%),
    var(--paper);
  color: var(--ink);
  border: 1px solid var(--paper-border);
}

.letter-intro {
  margin: 0 0 0.95rem;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.letter-lines,
.publish-steps {
  display: grid;
  gap: 0.95rem;
}

.poem-card {
  overflow: hidden;
}

.poem-card::after {
  content: "";
  position: absolute;
  inset: auto -10% -24% auto;
  width: 15rem;
  height: 15rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(214, 170, 99, 0.2), transparent 70%);
  pointer-events: none;
}

.poem-lines {
  gap: 1.05rem;
}

.poem-lines .line {
  position: relative;
  max-width: 42rem;
  padding-left: 1.1rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.34rem, 2.9vw, 1.78rem);
  line-height: 1.56;
  letter-spacing: -0.01em;
}

.poem-lines .line::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.05rem;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--rose));
  box-shadow: 0 0 0 8px rgba(214, 170, 99, 0.08);
}

.line {
  margin: 0;
  line-height: 1.9;
  font-size: clamp(1rem, 2vw, 1.08rem);
  color: var(--ink);
  opacity: 0;
  transform: translateY(16px);
  transition: transform 520ms var(--slow), opacity 520ms var(--slow);
}

.line.visible {
  opacity: 1;
  transform: translateY(0);
}

.publish-card code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.96em;
}

.signature {
  display: grid;
  gap: 0.65rem;
  margin-top: 1.6rem;
}

.signature-rule {
  width: 4.2rem;
  height: 3px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--accent), var(--rose));
}

.signature-text {
  font-weight: 800;
  color: var(--ink-soft);
}

.booth-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.booth-card {
  display: grid;
  overflow: hidden;
  min-height: 23rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.04), transparent 62%);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.booth-card:nth-child(1),
.booth-card:nth-child(4) {
  transform: rotate(-1deg);
}

.booth-card:nth-child(2),
.booth-card:nth-child(5) {
  transform: rotate(1deg);
}

.booth-card-media {
  position: relative;
  min-height: 17rem;
  overflow: hidden;
}

.booth-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.03);
}

.booth-stamp {
  position: absolute;
  left: 1rem;
  top: 1rem;
  padding: 0.38rem 0.72rem;
  border-radius: var(--radius-pill);
  background: rgba(28, 18, 14, 0.66);
  color: #fff7f0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.booth-copy {
  display: grid;
  gap: 0.4rem;
  padding: 1rem 1rem 1.15rem;
}

.booth-title {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.7rem;
  line-height: 1.02;
}

.booth-caption {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.7;
}

.booth-card.placeholder {
  align-content: center;
  justify-items: center;
  padding: 1.4rem;
  border-style: dashed;
  text-align: center;
}

.booth-card.placeholder .booth-title {
  font-size: 1.95rem;
}

.booth-card.placeholder .booth-caption {
  max-width: 25ch;
}

.booth-hint {
  margin: 0;
  text-align: center;
  color: var(--text-soft);
  line-height: 1.75;
}

.finale-card {
  padding: clamp(1.6rem, 3vw, 2.35rem);
  text-align: center;
}

.finale-lead {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.1;
}

.finale-actions {
  justify-content: center;
  margin-top: 1.35rem;
}

.finale-message {
  margin: 1.4rem auto 0;
  max-width: 36rem;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-soft);
  opacity: 0;
  transform: translateY(14px);
  transition: transform 420ms var(--slow), opacity 420ms var(--slow);
}

.finale-message.visible {
  opacity: 1;
  transform: translateY(0);
}

.section-actions {
  justify-content: center;
  margin-top: 1.2rem;
}

.customize-launcher {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 6;
  min-height: 3.15rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid var(--surface-border);
  color: var(--text);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.customize-panel {
  position: fixed;
  inset: 0;
  z-index: 7;
  display: grid;
  justify-items: end;
  pointer-events: none;
  opacity: 0;
  transition: opacity 260ms ease;
}

.customize-panel.open {
  pointer-events: auto;
  opacity: 1;
}

.customize-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 16, 0.58);
  backdrop-filter: blur(8px);
}

.customize-sheet {
  position: relative;
  width: min(31rem, calc(100% - 1rem));
  height: calc(100vh - 1rem);
  margin: 0.5rem;
  border-radius: 28px;
  padding: 1.3rem;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
  overflow: auto;
  transform: translateX(20px);
  transition: transform 320ms var(--slow);
}

.customize-panel.open .customize-sheet {
  transform: translateX(0);
}

.customize-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.customize-head h2 {
  margin-top: 0.22rem;
  font-size: 2.15rem;
  color: var(--ink);
}

.helper-text {
  margin: 0.9rem 0 1.15rem;
  color: var(--ink-soft);
}

.icon-button {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  color: var(--ink);
}

.field {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.95rem;
}

.field span {
  font-weight: 700;
  color: var(--ink);
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.88rem 0.95rem;
  border-radius: 18px;
  border: 1px solid var(--paper-border);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  resize: vertical;
}

.file-input {
  padding: 0.72rem 0.8rem;
  border-style: dashed !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 247, 249, 0.9))
    !important;
  cursor: pointer;
}

.file-input::file-selector-button {
  margin-right: 0.85rem;
  padding: 0.72rem 0.95rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fffaf5;
  font-weight: 800;
  cursor: pointer;
}

.field-note {
  display: block;
  margin-top: -0.05rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.65;
}

.field-note.is-active {
  color: var(--accent-strong);
  font-weight: 700;
}

.theme-group {
  margin-top: 1.1rem;
}

.theme-chip {
  min-height: 2.8rem;
  padding: 0.72rem 1rem;
  border-radius: var(--radius-pill);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
}

.theme-chip.active {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  border-color: transparent;
  color: #fffaf5;
}

.customize-actions {
  margin-top: 1.2rem;
}

#confettiLayer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 8;
  overflow: hidden;
}

.confetti-piece {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--w);
  height: var(--h);
  border-radius: var(--r);
  background: var(--c);
  opacity: 0;
  transform: translate3d(var(--x), var(--y), 0) rotate(0deg) scale(0.8);
  animation: confetti-burst var(--duration) var(--delay) cubic-bezier(0.18, 0.8, 0.2, 1) forwards;
}

@keyframes confetti-burst {
  0% {
    opacity: 0;
    transform: translate3d(var(--x), var(--y), 0) rotate(0deg) scale(0.8);
  }

  10% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform:
      translate3d(calc(var(--x) + var(--tx)), calc(var(--y) + var(--ty)), 0)
      rotate(var(--rot))
      scale(1.1);
  }
}

.reveal-item {
  opacity: 0;
  transform: translateY(24px);
  transition: transform 700ms var(--slow), opacity 700ms var(--slow);
}

.reveal-item.visible,
.noticing-card.visible,
.memory-card.visible,
.gallery-card.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1080px) {
  .cover.story-page.active {
    grid-template-columns: 1fr;
  }

  .portrait-frame,
  .photo-placeholder {
    min-height: 28rem;
  }

  .noticing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .scene-layout,
  .scene-layout-reverse,
  .feature-frame {
    grid-template-columns: 1fr;
  }

  .scene-layout-reverse > :first-child,
  .scene-layout-reverse > :last-child {
    order: initial;
  }

  .feature-frame-media {
    min-height: 24rem;
    border-right: 0;
    border-bottom: 1px solid var(--surface-border);
  }
}

@media (max-width: 820px) {
  .shell {
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .story-ui {
    flex-wrap: wrap;
    justify-content: center;
  }

  .memory-stack,
  .gallery-grid,
  .booth-grid {
    grid-template-columns: 1fr;
  }

  .memory-card:nth-child(1) {
    grid-column: auto;
    min-height: 16rem;
  }

  .compliment-card {
    min-height: 8.5rem;
  }

  .scene-frame,
  .feature-frame-media {
    min-height: 22rem;
  }
}

@media (max-width: 640px) {
  .page,
  .shell,
  .story-ui {
    width: min(var(--max-width), calc(100% - 1rem));
  }

  .story-page {
    min-height: calc(100svh - 16rem);
  }

  .cover-copy,
  .portrait-card,
  .compliment-stage,
  .letter-card,
  .finale-card,
  .booth-card {
    border-radius: 28px;
  }

  .cover h1 {
    font-size: clamp(2.9rem, 15vw, 4.5rem);
  }

  .noticing-grid {
    grid-template-columns: 1fr;
  }

  .story-nav {
    flex: 1 1 auto;
  }

  .customize-launcher {
    right: 0.75rem;
    left: 0.75rem;
    bottom: 0.75rem;
  }

  .customize-sheet {
    width: calc(100% - 1rem);
    height: calc(100vh - 0.75rem);
  }
}

@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;
    scroll-behavior: auto !important;
  }

  .float-layer,
  .ambient,
  .heart-layer {
    display: none;
  }
}
