
* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }
html { overflow-x: hidden; }

body {
  font-family: "Georgia", "Times New Roman", serif;
  color: #3a1a1a;
  -webkit-tap-highlight-color: transparent;
  background: #f8f0dc;
}

img { -webkit-user-drag: none; user-select: none; }

button { font-family: inherit; }

#gift-landing {
  position: relative;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  background: radial-gradient(circle at center, #f8f0dc 0%, #faecc8 50%, #f7e5c0 100%);
}

#gift-landing.hidden { display: none; }

.gift-fade-veil {
  position: absolute;
  inset: 0;
  background-color: #faf0e6;
  opacity: 1;
  transition: opacity 900ms ease-out;
  pointer-events: none;
  z-index: 0;
}
#gift-landing.state-fall .gift-fade-veil,
#gift-landing.state-bloom .gift-fade-veil {
  opacity: 0;
}

.gift-stage {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.gift-click-wrap {
  display: flex;
  height: 100%;
  width: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  transition: opacity 0.4s ease;
}
#gift-landing.state-bloom .gift-click-wrap,
#gift-landing.state-fall .gift-click-wrap {
  opacity: 0;
  pointer-events: none;
}

.gift-box-btn {
  cursor: pointer;
  border: 0;
  background: transparent;
  padding: 0;
  outline: none;
  animation: gift-bob 3s ease-in-out infinite;
}
.gift-box-btn img {
  width: min(60vw, 320px);
  height: auto;
  filter: drop-shadow(0 10px 20px rgba(128, 0, 0, 0.25));
  transition: transform 0.3s ease;
  display: block;
}
.gift-box-btn:hover img { transform: scale(1.05); }
.gift-box-btn:active img { transform: scale(0.95); }

.gift-caption {
  font-family: "Caveat", cursive;
  font-size: clamp(2rem, 5vw, 3.25rem);
  color: #800000;
  margin: 0;
}
.gift-hint {
  font-family: "Caveat", cursive;
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: #a0522d;
  margin: 0;
  opacity: 0.75;
}

.bloom-field {
  position: absolute;
  inset: 0;
  pointer-events: none;
  contain: layout paint style;
  isolation: isolate;
  transform: translateZ(0);
  z-index: 1;
}

.bloom-flower {
  position: absolute;
  left: 0;
  top: 0;
  object-fit: contain;
  will-change: transform, opacity;
  backface-visibility: hidden;
  transform: translate3d(var(--fx), var(--fy), 0);
}
.bloom-flower.in {
  animation: flower-in 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2) both,
    flower-drift var(--dur) ease-in-out var(--delay) infinite;
}
.bloom-flower.falling {
  animation: flower-fall var(--fdur) cubic-bezier(0.55, 0, 0.85, 0.3) var(--fdelay) both;
}

@keyframes gift-bob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-8px) rotate(1deg); }
}
@keyframes flower-drift {
  0%, 100% { transform: translate3d(var(--fx), var(--fy), 0) rotate(0deg); }
  50% { transform: translate3d(var(--fx), var(--fy), 0) rotate(360deg); }
}
@keyframes flower-in {
  from { transform: translate3d(var(--fx), var(--fy), 0) scale(0.2); opacity: 0; }
  to { transform: translate3d(var(--fx), var(--fy), 0) scale(1); opacity: 1; }
}
@keyframes flower-fall {
  0% { transform: translate3d(var(--fx), var(--fy), 0) rotate(0deg); opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translate3d(var(--fx), var(--ffall), 0) rotate(var(--frot)); opacity: 0.9; }
}

#page2 {
  display: none;
  position: relative;
  width: 100%;
  background: radial-gradient(circle at center, #f8f0dc 0%, #faecc8 50%, #f7e5c0 100%);
  background-attachment: fixed;
  color: #3a1a1a;
}
#page2.shown { display: block; }

#page3 {
  display: none;
  position: relative;
  width: 100%;
  min-height: 100dvh;
  background: radial-gradient(circle at center, #f8f0dc 0%, #faecc8 50%, #f7e5c0 100%);
  background-attachment: fixed;
  color: #3a1a1a;
}
#page3.shown {
  display: block;
  animation: page3-in 0.5s ease both;
}
@keyframes page3-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.page3-back {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: 16px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(42, 90, 58, 0.18);
  border-radius: 999px;
  padding: 8px 16px 8px 12px;
  cursor: pointer;
  color: #2a5a3a;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 0.95rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 14px rgba(42, 90, 58, 0.12);
}
.page3-back svg { width: 16px; height: 16px; }
.page3-back:active { transform: scale(0.95); }

.page2-tint {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 240, 246, 0.15), rgba(128, 0, 0, 0.15));
  z-index: 20;
  pointer-events: none;
}

.page2-content {
  position: relative;
  z-index: 3;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes centre-enter {
  0% { transform: scale(0.6); opacity: 0; filter: blur(6px); }
  100% { transform: scale(1); opacity: 1; filter: blur(0); }
}

.rose-deco {
  position: absolute;
  top: 0px;
  left: calc(min(200px, 48vw) * -0.15); 
  z-index: 50;
  opacity: 0;
}
.rose-deco.spring {
  animation: rose-spring 1.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.rose-deco img {
  width: min(200px, 48vw);
  height: auto;
  display: block;
  border-radius: 8px;
  animation: rose-sway 7s ease-in-out infinite 1.5s;
  filter: drop-shadow(8px 10px 14px rgba(50, 10, 5, 0.45)) drop-shadow(4px 5px 8px rgba(70, 15, 8, 0.35))
    drop-shadow(2px 3px 4px rgba(0, 0, 0, 0.25)) drop-shadow(0 0 3px rgba(255, 190, 170, 0.25));
}

@keyframes rose-spring {
  0% { transform: scale(0.15); opacity: 0; }
  35% { opacity: 1; }
  52% { transform: scale(1.08); } 
  68% { transform: scale(0.97); }
  82% { transform: scale(1.02); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes rose-sway {
  0%, 100% { transform: rotate(0deg); }
  30% { transform: rotate(2deg); }
  70% { transform: rotate(-2deg); }
}

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: 8vh 1rem 0;
}
.hero h1 {
  font-family: "Dancing Script", cursive;
  font-size: clamp(3rem, 9vw, 6.5rem);
  font-weight: 700;
  color: #800000;
  margin: 0;
  line-height: 1.15;
  text-shadow: 0 2px 16px rgba(255, 255, 255, 0.5), 0 0 40px rgba(128, 0, 0, 0.08);
  animation: fade-up 1.2s ease-out both;
}
.hero .sub {
  font-family: "Caveat", cursive;
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 500;
  color: #6b1f3a;
  margin-top: 0.6rem;
  margin-bottom: 2rem;
  animation: fade-up 1.4s 0.3s ease-out both;
}
.hero .centre-wrap {
  animation: centre-enter 1.2s 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  margin-bottom: 0.8rem;
}
.hero .centre-wrap img {
  width: min(380px, 70vw);
  height: auto;
  display: block;
  filter: drop-shadow(0 8px 20px rgba(128, 0, 0, 0.12)) drop-shadow(0 2px 6px rgba(255, 140, 110, 0.1));
}
.hero .flourish {
  display: flex;
  gap: 1.2rem;
  justify-content: center;
  animation: fade-up 1s 1.2s ease-out both;
  opacity: 0.35;
}
.hero .flourish span { font-family: serif; }
.hero .flourish .sm { font-size: 0.7rem; color: #800000; }
.hero .flourish .heart { font-size: 1rem; color: #a03040; }

.smile-section {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.5rem 25vh;
  position: relative;
  z-index: 2;
}
.smile-card {
  position: relative;
  max-width: 540px;
  width: 100%;
  background: linear-gradient(145deg, #fffdf8 0%, #fef9f0 50%, #fdf5e8 100%);
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1.5rem, 4vw, 3rem);
  border-radius: 16px;
  box-shadow: 0 18px 45px rgba(120, 40, 20, 0.12), 0 5px 15px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  font-family: "Caveat", cursive;
  font-size: clamp(1.5rem, 3.8vw, 2.2rem);
  font-weight: 600;
  line-height: 1.7;
  opacity: 0;
  transform: translateY(20px) scale(0.97);
  transition: opacity 0.8s ease, transform 0.8s ease;
  background-image: repeating-linear-gradient(transparent, transparent 30px, rgba(180, 130, 80, 0.04) 31px);
}
.smile-card.in {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.smile-card .deco { position: absolute; opacity: 0.6; }
.smile-card .deco.d1 { top: -14px; left: 26px; font-size: 1.3rem; color: #e8737a; transform: rotate(-15deg); }
.smile-card .deco.d2 { top: 10px; right: 22px; font-size: 0.9rem; color: #7cb87c; opacity: 0.5; transform: rotate(20deg); }
.smile-card .deco.d3 { bottom: -12px; right: 32px; font-size: 1.1rem; color: #d4626a; opacity: 0.6; transform: rotate(12deg); }
.smile-card .deco.d4 { bottom: 14px; left: 20px; font-size: 0.7rem; color: #c4956a; opacity: 0.4; }
.smile-card p { margin: 0; text-align: center; color: #3a1a1a; }
.smile-card .hl-smile { background: linear-gradient(180deg, transparent 50%, rgba(248, 140, 165, 0.5) 50%); padding: 0 4px; border-radius: 3px; color: #c43850; }
.smile-card .hl-peace { background: linear-gradient(180deg, transparent 50%, rgba(120, 195, 135, 0.5) 50%); padding: 0 4px; border-radius: 3px; color: #2a7540; }
.smile-card .hl-love { background: linear-gradient(180deg, transparent 50%, rgba(235, 120, 110, 0.5) 50%); padding: 0 4px; border-radius: 3px; color: #b02828; }
.smile-card .hl-home { background: linear-gradient(180deg, transparent 50%, rgba(225, 185, 95, 0.5) 50%); padding: 0 4px; border-radius: 3px; color: #8a6018; }

.lock-gate-zone {
  position: relative;
  height: 165vh;
  z-index: 3; 
}

.lock-gate-buffer {
  display: none; 
}

.lock-gate-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  
  box-shadow: none; 
}

.lock-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  outline: none;
  animation: lockBob 3s ease-in-out infinite;
}
.lock-btn img {
  width: min(130px, 28vw);
  height: auto;
  display: block;
  filter: drop-shadow(0 10px 26px rgba(42, 90, 58, 0.35)) drop-shadow(0 0 20px rgba(255, 255, 255, 0.4));
  transition: transform 0.2s ease;
}
.lock-btn:active img { transform: scale(0.93); }
@keyframes lockBob {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50% { transform: translateY(-10px) rotate(1.5deg); }
}
.lock-hint {
  font-family: "Caveat", cursive;
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  color: #6b4a2a;
  margin: 1rem 0 0;
  opacity: 0.7;
}
.lock-unlocked-msg {
  font-family: "Dancing Script", cursive;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  color: #2a5a3a;
  animation: fade-up 0.8s ease-out both;
}

.passkey-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.9rem, 2.8vh, 1.6rem);
  padding: 1.5rem;
  overflow: hidden;
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}
.passkey-overlay.shown {
  display: flex;
  animation: pkIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.pk-orb {
  position: absolute;
  width: clamp(300px, 80vw, 600px);
  height: clamp(300px, 80vw, 600px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(128, 0, 0, 0.05) 0%, transparent 70%);
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: pkOrb 4s ease-in-out infinite;
}
.passkey-overlay.success .pk-orb {
  background: radial-gradient(circle, rgba(42, 90, 58, 0.1) 0%, transparent 70%);
}

.pk-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.pk-particle {
  position: absolute;
  border-radius: 50%;
  background: rgba(107, 31, 58, 0.4);
  animation: pkFl linear infinite;
}
.passkey-overlay.success .pk-particle { background: rgba(42, 90, 58, 0.5); }

.pk-close {
  position: absolute;
  top: 18px;
  right: 20px;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(42, 90, 58, 0.15);
  border-radius: 50%;
  width: clamp(38px, 10vw, 46px);
  height: clamp(38px, 10vw, 46px);
  font-size: clamp(0.85rem, 2.5vw, 1.05rem);
  color: #6b4a2a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
  z-index: 10;
}

.pk-lock-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pk-ring1 {
  position: absolute;
  width: clamp(105px, 28vw, 140px);
  height: clamp(105px, 28vw, 140px);
  border-radius: 50%;
  border: 1.5px solid rgba(42, 90, 58, 0.22);
  box-shadow: 0 0 30px rgba(42, 90, 58, 0.08), inset 0 0 18px rgba(42, 90, 58, 0.05);
  animation: pkRing 3s ease-in-out infinite;
}
.passkey-overlay.success .pk-ring1 {
  border: 2px solid rgba(42, 90, 58, 0.45);
  box-shadow: 0 0 35px rgba(42, 90, 58, 0.22), inset 0 0 25px rgba(42, 90, 58, 0.1);
  animation: pkGlow 1s ease-in-out infinite;
}
.pk-ring2 {
  position: absolute;
  width: clamp(125px, 33vw, 165px);
  height: clamp(125px, 33vw, 165px);
  border-radius: 50%;
  border: 1px solid rgba(42, 90, 58, 0.1);
  animation: pkRing2 5s ease-in-out infinite;
}
.pk-lock-wrap img {
  width: 100px;
  height: auto;
  opacity: 0.9;
  filter: drop-shadow(0 4px 14px rgba(42, 90, 58, 0.25));
  transition: all 0.45s ease;
  position: relative;
  z-index: 2;
}
.passkey-overlay.success .pk-lock-wrap img {
  opacity: 1;
  filter: drop-shadow(0 0 18px rgba(42, 90, 58, 0.5)) brightness(1.05);
}

.pk-title {
  font-family: "Dancing Script", cursive;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  font-weight: 700;
  margin: 0;
  color: #800000;
  text-shadow: 0 2px 14px rgba(255, 255, 255, 0.6);
  position: relative;
  z-index: 2;
}
.passkey-overlay.success .pk-title {
  color: #2a5a3a;
}

.pk-dots {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0.5rem 0;
  position: relative;
  z-index: 2;
}
.pk-dots.shake { animation: pkShake 0.55s ease-in-out; }
.pk-line {
  width: clamp(18px, 5vw, 28px);
  height: 1.5px;
  background: rgba(42, 90, 58, 0.12);
  transition: background 0.3s ease;
}
.pk-line.on { background: linear-gradient(90deg, rgba(42, 90, 58, 0.55), rgba(42, 90, 58, 0.2)); }

.pk-dot {
  width: clamp(15px, 4vw, 20px);
  height: clamp(15px, 4vw, 20px);
  border-radius: 50%;
  border: 2px solid rgba(42, 90, 58, 0.35);
  background: transparent;
  transition: all 0.25s ease;
}
.pk-dot.filled {
  background: #2a5a3a;
  box-shadow: 0 0 12px rgba(42, 90, 58, 0.45);
  animation: pkDot 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.pk-dots.error .pk-dot { border-color: rgba(176, 40, 40, 0.6); }
.pk-dots.error .pk-dot.filled {
  background: #b02828;
  box-shadow: 0 0 12px rgba(176, 40, 40, 0.4);
}
.passkey-overlay.success .pk-dot.filled {
  background: #2a5a3a;
  box-shadow: 0 0 14px rgba(42, 90, 58, 0.5);
  border-color: #2a5a3a;
}

.pk-error-msg {
  font-family: "Caveat", cursive;
  font-size: clamp(0.9rem, 2.2vw, 1.05rem);
  color: #b02828;
  margin: -0.3rem 0 0;
  position: relative;
  z-index: 2;
  height: 1.2em;
  opacity: 0;
}
.pk-error-msg.show {
  animation: pkErrIn 0.3s ease-out both;
}

.pk-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(10px, 2.8vw, 16px);
  width: min(280px, 72vw);
  position: relative;
  z-index: 2;
}
.pk-key {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1.5px solid rgba(42, 90, 58, 0.18);
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  font-size: clamp(1.4rem, 4.5vw, 1.85rem);
  color: #2a5a3a;
  box-shadow: 0 2px 8px rgba(42, 90, 58, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: all 0.18s ease;
  outline: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.pk-key:active { transform: scale(0.92); background: rgba(255, 255, 255, 0.65); }
.pk-key.pk-del {
  font-size: clamp(0.75rem, 2.2vw, 0.92rem);
  font-family: "Caveat", cursive;
  font-weight: 600;
  color: #8a6018;
  border: 1px solid rgba(138, 96, 24, 0.2);
}
.pk-key.pk-empty { visibility: hidden; cursor: default; }
.passkey-overlay.success .pk-key {
  border-color: rgba(42, 90, 58, 0.35);
  background: rgba(42, 90, 58, 0.1);
  color: #2a5a3a;
}

@keyframes pkIn { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: scale(1); } }
@keyframes pkShake { 0%, 100% { transform: translateX(0); } 10%, 50%, 90% { transform: translateX(-9px); } 30%, 70% { transform: translateX(9px); } }
@keyframes pkDot { 0% { transform: scale(1); } 50% { transform: scale(1.55); } 100% { transform: scale(1); } }
@keyframes pkFl { 0%, 100% { transform: translateY(0) translateX(0); } 25% { transform: translateY(-15px) translateX(8px); } 50% { transform: translateY(-6px) translateX(-6px); } 75% { transform: translateY(-20px) translateX(4px); } }
@keyframes pkRing { 0%, 100% { transform: scale(1); opacity: 0.5; } 50% { transform: scale(1.06); opacity: 1; } }
@keyframes pkRing2 { 0%, 100% { transform: scale(1); opacity: 0.3; } 50% { transform: scale(1.04); opacity: 0.6; } }
@keyframes pkGlow { 0%, 100% { transform: scale(1); opacity: 0.75; } 50% { transform: scale(1.1); opacity: 1; } }
@keyframes pkOrb { 0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; } 50% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; } }
@keyframes pkErrIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 700;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #faf2e0 0%, #f5e8cc 50%, #f0dfc0 100%);
}

.loading-overlay.shown {
  display: flex;
  animation: zIn 0.35s ease-out both;
}

.loading-overlay.fade-out {
  opacity: 0;
  transition: opacity 0.45s ease;
}

.wreath-wrap {
  width: min(52vw, 210px);
  height: min(52vw, 210px);
  position: relative;
}

.wreath {
  position: absolute;
  inset: 0;
  animation: orbit 10s linear infinite;
}

.wreath-item {
  position: absolute;
  top: 50%;
  left: 50%;

  width: 45%;
  height: 45%;

  margin-left: -22.5%;
  margin-top: -22.5%;

  transform:
    rotate(calc(var(--i) * 45deg))
    translateY(-70%)
    rotate(calc(var(--i) * -45deg));
}

.wreath-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  animation: counter-orbit 10s linear infinite;
  filter: drop-shadow(0 4px 10px rgba(42, 90, 58, 0.18));
}

@keyframes orbit {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes counter-orbit {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(-360deg);
  }
}

.loading-text {
  margin-top: 30px;
  text-transform: uppercase;
  letter-spacing: 0.38em;
  font-size: 0.8rem;
  font-style: italic;
  font-weight: 500;
  font-family: "Georgia", serif;
  color: #b8a898;
  animation: pulse 1.7s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }
@keyframes zIn { from { opacity: 0; } to { opacity: 1; } }

.photo-grid-section {
  padding: 1.5rem 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-up 0.8s ease-out both;
}
.photo-grid {
  columns: 2;
  column-gap: 18px;
  width: 100%;
  max-width: 560px;
}
@media (min-width: 640px) {
  .photo-grid { columns: 3; column-gap: 22px; max-width: 800px; }
}
@media (min-width: 1024px) {
  .photo-grid { columns: 4; column-gap: 28px; max-width: 1200px; }
}
.photo-card {
  break-inside: avoid;
  margin-bottom: 26px;
  background: #fff;
  padding: 10px 10px 30px;
  box-shadow: 0 12px 28px rgba(80, 40, 20, 0.22);
  opacity: 0;
  transform: rotate(var(--rot)) translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  width: 100%;
}
.photo-card.size-lg { width: 100%; }
.photo-card.size-md { width: 87%; }
.photo-card.size-sm { width: 74%; }
.photo-card:nth-child(odd) { margin-left: 0; margin-right: auto; }
.photo-card:nth-child(even) { margin-left: auto; margin-right: 0; }
.photo-card.in {
  opacity: 1;
  transform: rotate(var(--rot)) translateY(0);
}
.photo-card:hover { transform: rotate(0deg) scale(1.04); z-index: 5; position: relative; }
.photo-card img {
  width: 100%;
  height: auto;
  display: block;
  background: #f3e6ea;
}

.letter-section {
  padding: 0.5rem 1rem 1.5rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  animation: fade-up 0.8s 0.1s ease-out both;
}
.letter-card {
  max-width: 720px;
  width: 100%;
  background: linear-gradient(#fffaf3, #fdf1e1), repeating-linear-gradient(transparent, transparent 36px, rgba(128, 0, 0, 0.07) 37px);
  background-blend-mode: multiply;
  padding: clamp(1.5rem, 4vw, 3rem);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  font-family: "Caveat", cursive;
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  font-weight: 500;
  color: #3a1a1a;
  line-height: 1.75;
}
.letter-card .word {
  opacity: 0;
  transition: opacity 0.3s ease;
  display: inline-block;
  margin-right: 0.32em;
}
.letter-card .word.in { opacity: 1; }

.heart-divider {
  padding: 1rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.heart-divider span {
  font-family: "Dancing Script", cursive;
  font-size: clamp(2rem, 4vw, 3rem);
  color: #800000;
  opacity: 0.4;
}

.footer-section {
  padding: 6vh 1rem 8vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.footer-section h2 {
  font-family: "Dancing Script", cursive;
  font-size: clamp(3rem, 9vw, 6.5rem);
  font-weight: 700;
  color: #800000;
  margin: 0;
  line-height: 1.15;
  text-shadow: 0 2px 16px rgba(255, 255, 255, 0.5), 0 0 40px rgba(128, 0, 0, 0.08);
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1.2s ease, transform 1.2s ease;
}
.footer-section h2.in { opacity: 1; transform: translateY(0); }
.footer-section p {
  font-family: "Caveat", cursive;
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 500;
  color: #6b1f3a;
  margin-top: 0.6rem;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1.4s ease, transform 1.4s ease;
}
.footer-section p.in { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .bloom-flower, .gift-box-btn, .lock-btn, .wreath, .wreath-item img, .loading-text {
    animation-duration: 0.001ms !important;
  }
}
