:root {
  --bg: #f5f0f3;
  --bg-soft: #ece4e9;
  --text: #322830;
  --muted: #60505a;
  --card: rgba(255, 255, 255, 0.58);
  --brand: #bf2f3a;
  --brand-strong: #9e202b;
  --shadow: 0 14px 32px rgba(72, 45, 58, 0.11);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  font-family: "Outfit", "Segoe UI", sans-serif;
  color: var(--text);
  overflow-x: hidden;
  background:
    radial-gradient(720px 320px at 10% -8%, #f0e6eb, transparent 72%),
    radial-gradient(660px 300px at 95% 0%, #eee6e9, transparent 70%),
    linear-gradient(180deg, #f6f1f4 0%, #efe8ec 48%, #ece5e9 100%);
}

body::before {
  content: none;
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  background: none;
}

.page-wrap {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  padding-top: 0.5rem;
}

.topbar {
  min-height: 70px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  padding: 0.6rem 1rem;
  background: transparent;
  box-shadow: none;
}

.brand {
  text-decoration: none;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.7rem, 4.6vw, 2.7rem);
  color: #7d2330;
  text-align: center;
}

main.page-wrap {
  margin-top: 0.9rem;
  padding: 0 0 1.2rem;
}

.surface {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 1.3rem;
}

.surface + .surface {
  margin-top: 0.9rem;
}

.hero {
  text-align: center;
  transform: translateY(10px);
  opacity: 0;
}

body.home-ready .hero {
  transform: translateY(0);
  opacity: 1;
  transition: 420ms ease;
}

.hero h1 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.8rem, 5vw, 3.1rem);
  color: #5e2b37;
}

.quest-wrap {
  display: grid;
  justify-items: center;
}

.heart-btn {
  --heart-step: 0;
  --rx: 0deg;
  --ry: 0deg;
  --tz: 0px;
  width: 196px;
  height: 172px;
  border: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 170ms ease, filter 170ms ease;
  box-shadow: none;
  filter: none;
}

.heart-btn:hover {
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) translateZ(var(--tz)) scale(1.03);
  filter: none;
}

.heart-btn svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.heart-btn path {
  fill: #d12531;
  filter: drop-shadow(0 0 calc(9px + (var(--heart-step) * 1.2px)) rgba(185, 34, 46, 0.34));
  transform: scale(0.96);
  transform-origin: 50% 56%;
}

.heart-btn:focus-visible {
  outline: 3px solid #b53542;
  outline-offset: 2px;
}

h1, h2, h3 {
  font-family: "Playfair Display", Georgia, serif;
}

p {
  color: var(--muted);
  line-height: 1.6;
}

#phraseText {
  margin: 0;
  text-align: center;
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  color: #5f4250;
}

.btn {
  border: 0;
  background: linear-gradient(180deg, #be4f67, #9f3f54);
  color: #fff;
  border-radius: 12px;
  padding: 0.64rem 1rem;
  font: inherit;
  cursor: pointer;
}

.inline-link {
  color: var(--brand-strong);
  text-decoration: none;
  font-weight: 600;
}

.site-footer {
  margin: 0.85rem auto 1.2rem;
  padding: 0.9rem 1rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  flex-wrap: wrap;
}

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

.float-item {
  position: absolute;
  font-size: clamp(1.25rem, 2.7vw, 2rem);
  animation: drift linear infinite;
}

@keyframes drift {
  0% { transform: translateY(14vh) rotate(0deg); }
  100% { transform: translateY(-120vh) rotate(180deg); }
}

.story-flow { display: grid; gap: 1.2rem; }

.memory-hero {
  display: grid;
  justify-items: center;
  gap: 0.8rem;
}

.memory-photo {
  margin: 0;
  overflow: hidden;
  border-radius: 20px;
}

.memory-photo img {
  width: 100%;
  display: block;
  cursor: zoom-in;
  transition: transform 300ms ease;
}

.memory-photo:hover img { transform: scale(1.03); }

.memory-note h2,
.memory-note h3 {
  margin: 0 0 0.35rem;
  color: #712548;
}

.memory-note p {
  margin: 0;
}

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

.memory-item {
  border: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.18);
  padding: 0.65rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: 0.75rem;
  box-shadow: none;
}

.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }

.heart-frame {
  width: min(430px, 85vw);
  border-radius: 32px;
}

.heart-frame img { max-height: 76vh; object-fit: contain; }

.tilt-a, .tilt-c, .tilt-e, .tilt-g, .tilt-i, .tilt-k { transform: rotate(-0.7deg); }
.tilt-b, .tilt-d, .tilt-f, .tilt-h, .tilt-j { transform: rotate(0.7deg); }

.frame-soft { border-radius: 20px 10px; }
.frame-round { border-radius: 28px; }
.frame-arc { border-radius: 38px 10px; }
.frame-blob { border-radius: 44% 56% 40% 60% / 62% 34% 66% 38%; }
.frame-diamond { border-radius: 12px 26px; }

.video-card video {
  width: 100%;
  border-radius: inherit;
}

.easter-letter {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: #963e67;
  box-shadow: 0 8px 20px rgba(132, 54, 87, 0.22);
  cursor: pointer;
  z-index: 70;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(61, 21, 40, 0.35);
  backdrop-filter: blur(4px);
  z-index: 120;
}

.modal.open { display: flex; }

.modal-card,
.image-modal-card {
  width: min(760px, 94vw);
  max-height: 88vh;
  overflow: auto;
  border: 0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 22px 44px rgba(74, 25, 48, 0.26);
  padding: 1rem;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.close-btn {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: #fff5f8;
  color: #7f2d52;
  cursor: pointer;
}

.image-modal-card {
  position: relative;
  width: min(94vw, 1180px);
}

.image-modal-card img {
  width: 100%;
  max-height: calc(88vh - 98px);
  object-fit: contain;
  display: block;
}

.image-modal-card p {
  text-align: center;
}

.image-close {
  position: absolute;
  right: 0.6rem;
  top: 0.6rem;
}

.spark {
  position: fixed;
  pointer-events: none;
  font-size: 1.7rem;
  z-index: 90;
  animation: sparkFly 1800ms cubic-bezier(.19,.8,.27,1) forwards;
}

@keyframes sparkFly {
  0% { transform: translate(0, 0) scale(0.75); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1.32); opacity: 0; }
}

.site-lock {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(242, 236, 240, 0.92);
  backdrop-filter: blur(6px);
}

.site-lock-card {
  width: min(420px, 94vw);
  border: 0;
  border-radius: 20px;
  background: #f7f2f5;
  box-shadow: 0 20px 44px rgba(102, 40, 66, 0.24);
  padding: 1.2rem;
}

.site-lock-card h2 {
  margin: 0 0 0.45rem;
  color: #7b2b50;
  text-align: left;
}

.site-lock-card p {
  margin: 0 0 0.85rem;
  text-align: left;
  color: #6b4b58;
}

.site-lock-form {
  display: grid;
  gap: 0.65rem;
}

.site-lock-input {
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: #ece4e9;
  color: #2b1b22;
  padding: 0.7rem 0.8rem;
  font: inherit;
}

.site-lock-input:focus {
  outline: 3px solid #c7b6be;
}

.site-lock-error {
  min-height: 1.1rem;
  margin: 0;
  color: #c43867;
  font-size: 0.92rem;
}

@media (max-width: 900px) {
  .memory-item {
    grid-template-columns: 1fr;
    grid-column: span 12;
    transform: none;
  }
}

@media (max-width: 700px) {
  .brand { font-size: 1.7rem; }
  .surface { padding: 1rem; }
  .heart-btn { width: 166px; height: 146px; }
  .site-footer { justify-content: center; }
}

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