:root {
  --cream:   #F6F6E9;
  --beige:   #EFE4DB;
  --tan:     #DCC2A3;
  --olive:   #9C9678;
  --ink:     #3E3226;
  --line:    #6B5842;
  --clay:    #B4703E;
  --clay-dark:#8A5330;
  --gold:    #F2B93B;
  --dark:    #2B2620;
  --white:   #FFFDF8;

  /* type */
  --font-script: 'Caveat', cursive;
  --font-serif:  'DM Serif Display', serif;
  --font-body:   'Poppins', system-ui, sans-serif;
  --font-mono:   'Space Mono', monospace;

  /* spacing / layout */
  --gutter: 20px;
  --radius-sm: 6px;
  --radius-md: 14px;
  --shadow-soft: 0 10px 24px -12px rgba(62, 50, 38, 0.35);
  --shadow-tape: 0 2px 4px rgba(62,50,38,0.15);

  /* motion */
  --ease: cubic-bezier(.22,.68,.34,1);
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: hidden;
}
html { scroll-behavior: smooth; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p, ul, fieldset { margin: 0; padding: 0; }
fieldset { border: none; }
ul { list-style: none; }


html.is-locked body {
  overflow-x: hidden;
}
html.is-locked .section:not(.hero) {
  display: none;
}
html.is-locked .music-toggle {
  display: none;
}
html.is-locked .story-bar {
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--ease);
}
html:not(.is-locked) .story-bar {
  opacity: 1;
  transition: opacity .3s var(--ease) .4s;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- Layout Primitives ---------- */
.section {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 84px var(--gutter) 56px;
}
.section__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
}
.section__decor {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.decor { position: absolute; user-select: none; }
.decor--tape { filter: drop-shadow(var(--shadow-tape)); }

.kicker {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--clay-dark);
  margin-bottom: 6px;
}

.section__title {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 6vw, 2.2rem);
  color: var(--ink);
  margin-bottom: 20px;
  line-height: 1.15;
}

.section__lead { font-size: 0.9rem; color: var(--line); margin-bottom: 18px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 999px;
  border: 2px solid transparent;
  padding: 13px 26px;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.96); }
.btn--primary {
  background: var(--clay);
  color: var(--white);
  box-shadow: var(--shadow-soft);
}
.btn--primary:hover { background: var(--clay-dark); }
.btn--wide { width: 100%; }


.story-bar {
  position: fixed;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 50;
  display: flex;
  gap: 5px;
}
.story-seg {
  flex: 1;
  height: 4px;
  background: rgba(62,50,38,0.18);
  border: none;
  border-radius: 3px;
  padding: 0;
  position: relative;
  overflow: hidden;
}
.story-seg span {
  position: absolute;
  inset: 0;
  width: 0%;
  background: var(--clay);
  border-radius: 3px;
  transition: width .2s linear;
}
.story-seg.is-active span { width: 100%; }
.story-seg.is-done span { width: 100%; background: var(--olive); }

/* ---------- Music Toggle ---------- */
.music-toggle {
  position: fixed;
  bottom: 20px;
  right: 16px;
  z-index: 50;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  background: var(--ink);
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-soft);
  transition: transform .2s var(--ease);
}
.music-toggle:active { transform: scale(0.92); }
.music-toggle__bars { display: none; gap: 2px; align-items: flex-end; height: 14px; }
.music-toggle__bars i {
  display: block;
  width: 3px;
  background: var(--cream);
  border-radius: 2px;
  animation: barBounce 0.9s ease-in-out infinite;
}
.music-toggle__bars i:nth-child(1){ height: 6px; animation-delay: 0s; }
.music-toggle__bars i:nth-child(2){ height: 14px; animation-delay: .15s; }
.music-toggle__bars i:nth-child(3){ height: 9px; animation-delay: .3s; }
.music-toggle.is-playing .music-toggle__icon { display: none; }
.music-toggle.is-playing .music-toggle__bars { display: flex; }
@keyframes barBounce {
  0%, 100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1); }
}

/* ---------- Reveal-on-scroll ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  transition-delay: calc(var(--d, 0) * 90ms);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Polaroid component ---------- */
.polaroid {
  position: relative;
  background: var(--white);
  padding: 10px 10px 34px;
  border-radius: 3px;
  box-shadow: var(--shadow-soft);
  width: 100%;
  max-width: 250px;
  margin: 0 auto;
}
.polaroid img { border-radius: 2px; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.polaroid__caption {
  font-family: var(--font-script);
  font-size: 1.2rem;
  color: var(--line);
  text-align: center;
  margin-top: 8px;
}
.polaroid__tape {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  width: 70px;
  height: 26px;
  background: rgba(232, 217, 196, 0.85);
  box-shadow: var(--shadow-tape);
}
.polaroid--hero { transform: rotate(-2deg); }
.polaroid--about { transform: rotate(3deg); max-width: 220px; }

/* ---------- HERO ---------- */
.hero { background: var(--cream); align-items: center; text-align: center; padding-top: 70px; }
.hero__inner { display: flex; flex-direction: column; align-items: center; gap: 14px; }

.eyebrow-stamp {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--clay-dark);
  border: 1.5px dashed var(--clay);
  border-radius: 999px;
  padding: 6px 16px;
  text-transform: uppercase;
}

.hero__title { margin-top: 6px; display: flex; flex-direction: column; }
.hero__title-small {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--line);
}
.hero__title-name {
  font-family: var(--font-script);
  font-weight: 700;
  font-size: clamp(3.2rem, 18vw, 5rem);
  color: var(--clay);
  line-height: 1;
  margin-top: 2px;
}
.hero__subtitle {
  font-size: 0.92rem;
  color: var(--line);
  max-width: 320px;
}

.countdown { display: none; }

.scroll-cue {
  margin-top: 10px;
  color: var(--clay);
  animation: bob 2.2s ease-in-out infinite;
  display: inline-flex;
  background: none;
  border: none;
  padding: 6px;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}


.message { background: var(--beige); }
.note-paper {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 26px 22px;
  box-shadow: var(--shadow-soft);
  position: relative;
}
.note-paper::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 70px;
  height: 24px;
  background: rgba(232, 217, 196, 0.85);
  box-shadow: var(--shadow-tape);
}
.note-paper p {
  font-size: 0.98rem;
  color: var(--line);
  margin-bottom: 14px;
}
.note-paper p:last-child { margin-bottom: 0; }
.note-paper__sign {
  font-family: var(--font-script);
  font-size: 1.3rem;
  color: var(--clay);
  text-align: right;
  margin-top: 4px !important;
}



/* ---------- GALLERY ---------- */
.gallery { background: var(--cream); }
.gallery__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px 14px;
}
.gallery__item {
  background: var(--white);
  border: none;
  padding: 8px 8px 22px;
  border-radius: 3px;
  box-shadow: var(--shadow-soft);
  transform: rotate(var(--rot, 0deg));
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.gallery__item:hover, .gallery__item:focus-visible { transform: rotate(0deg) scale(1.04); }
.gallery__item img { aspect-ratio: 1 / 1; object-fit: cover; border-radius: 2px; }


.reasons { background: var(--beige); }

.reason-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 12px;
}
.reason-card {
  background: transparent;
  border: none;
  padding: 0;
  perspective: 1000px;
  aspect-ratio: 4 / 5;
  animation: popIn .45s var(--ease) both;
}
.reason-card__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform .6s var(--ease);
  transform-style: preserve-3d;
}
.reason-card.is-flipped .reason-card__inner { transform: rotateY(180deg); }

.reason-card__face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 14px;
}
.reason-card__front {
  background: var(--white);
  transform: rotate(var(--rot, -2deg));
}
.reason-card__front .reason-card__num {
  font-family: var(--font-script);
  font-size: 2.4rem;
  color: var(--clay);
}
.reason-card__front .reason-card__hint {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--olive);
}
.reason-card__back {
  background: var(--clay);
  color: var(--white);
  transform: rotateY(180deg) rotate(var(--rot, -2deg));
}
.reason-card__back p {
  font-family: var(--font-script);
  font-size: 1.15rem;
  line-height: 1.3;
}
@keyframes popIn {
  from { opacity: 0; transform: scale(.9); }
  to { opacity: 1; transform: scale(1); }
}

/* ---------- CLOSING ---------- */
.closing { background: var(--tan); text-align: center; }
.closing__inner { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.closing__title {
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 7vw, 2.4rem);
  color: var(--ink);
}
.closing__text { font-size: 0.92rem; color: var(--line); max-width: 320px; }
.closing__sign { font-family: var(--font-script); font-size: 1.8rem; color: var(--clay); margin-top: 4px; }

.back-to-top {
  margin-top: 18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: transparent;
  color: var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.back-to-top:hover { background: var(--line); color: var(--tan); }

.closing__credit {
  margin-top: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--line);
  opacity: 0.75;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  transition: opacity .2s var(--ease), background .2s var(--ease);
}
a.closing__credit:hover { opacity: 1; background: rgba(107, 88, 66, 0.08); }

/* ---------- LIGHTBOX ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(43, 38, 32, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s var(--ease);
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox__figure { max-width: 320px; width: 100%; text-align: center; }
.lightbox__figure img { border-radius: var(--radius-sm); box-shadow: var(--shadow-soft); }
.lightbox__figure figcaption {
  font-family: var(--font-script);
  font-size: 1.4rem;
  color: var(--white);
  margin-top: 14px;
}
.lightbox__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.12);
  color: var(--white);
  font-size: 1.6rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}



@media (max-height: 820px) {
  .hero { padding-top: 46px; padding-bottom: 24px; }
  .hero__inner { gap: 9px; }
  .polaroid--hero { max-width: 190px; }
  .hero__title-name { font-size: clamp(2.5rem, 15vw, 3.8rem); }
}

@media (max-height: 700px) {
  .hero { padding-top: 34px; padding-bottom: 18px; }
  .hero__inner { gap: 7px; }
  .polaroid--hero { max-width: 165px; }
  .eyebrow-stamp { padding: 5px 14px; font-size: 0.66rem; }
  .hero__title-name { font-size: clamp(2.2rem, 13vw, 3.2rem); }
  .hero__subtitle { font-size: 0.85rem; }
  .scroll-cue { margin-top: 2px; }
}

@media (max-height: 600px) {
  .hero { padding-top: 24px; padding-bottom: 12px; }
  .hero__inner { gap: 5px; }
  .polaroid--hero { max-width: 130px; }
  .polaroid { padding: 6px 6px 22px; }
  .eyebrow-stamp { padding: 3px 10px; font-size: 0.58rem; }
  .hero__title-name { font-size: clamp(1.9rem, 11vw, 2.6rem); }
  .hero__title-small { font-size: 0.82rem; }
  .hero__subtitle { font-size: 0.78rem; }
  .btn--primary { padding: 10px 22px; font-size: 0.85rem; }
  .scroll-cue { display: none; }
}

@media (min-width: 600px) {
  :root { --gutter: 32px; }
  .section__inner { max-width: 560px; }
  .note-paper { padding: 34px 40px; }
  .gallery__grid { grid-template-columns: repeat(3, 1fr); gap: 22px; }
  .reason-grid { grid-template-columns: repeat(3, 1fr); }
}



@media (min-width: 1024px) {
  .section__inner { max-width: 900px; }

  .hero__inner { max-width: 900px; }
  .hero { text-align: left; }
  .hero__inner {
    display: grid;
    grid-template-columns: 320px 1fr;
    align-items: center;
    gap: 60px;
    text-align: left;
  }
  .polaroid--hero { grid-row: 1 / span 6; }
  .eyebrow-stamp, .hero__title, .hero__subtitle, .btn--primary, .scroll-cue {
    grid-column: 2;
  }
  .scroll-cue { justify-self: start; }

  .note-paper { max-width: 620px; margin: 0 auto; padding: 40px 52px; }
  .note-paper p { font-size: 1.05rem; }

  .gallery__grid {
    grid-template-columns: repeat(3, 190px);
    justify-content: center;
    gap: 26px;
  }

  .reason-grid {
    grid-template-columns: repeat(3, 170px);
    justify-content: center;
    gap: 22px;
  }

  .section__title, .section__lead, .kicker { text-align: center; }
}


