:root {
  --cream: #f8f1e8;
  --ivory: #fffdf9;
  --burgundy: #701d35;
  --deep: #481326;
  --rose: #c98c99;
  --gold: #d6b98c;
  --brown: #6b514a;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; }
body {
  margin: 0;
  overflow-x: hidden;
  background: var(--cream);
  color: var(--deep);
  font-family: "Noto Naskh Arabic", serif;
}
body.modal-open { overflow: hidden; }
.noise {
  position: fixed; inset: 0; z-index: 20; pointer-events: none; opacity: .035;
  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='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}
.hearts, .flowers { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.floating-heart {
  position: absolute; bottom: -60px; color: var(--heart-color, var(--burgundy));
  font-family: "Apple Color Emoji", "Segoe UI Emoji", Georgia, serif; line-height: 1; animation: heartFloat var(--duration) linear var(--delay) infinite;
  filter: blur(var(--blur)); opacity: var(--opacity);
  text-shadow: 0 5px 16px rgba(112,29,53,.10);
  will-change: transform;
  -webkit-text-stroke: 1px rgba(255,255,255,.08);
}
@keyframes heartFloat {
  0% { transform: translate3d(0, 4vh, 0) rotate(-8deg) scale(.72); }
  28% { transform: translate3d(var(--drift-a), -28vh, 0) rotate(9deg) scale(.92); }
  58% { transform: translate3d(var(--drift-b), -62vh, 0) rotate(-6deg) scale(1.05); }
  82% { transform: translate3d(var(--drift-c), -88vh, 0) rotate(13deg) scale(.96); }
  100% { transform: translate3d(calc(var(--drift-a) * -.35), -118vh, 0) rotate(-4deg) scale(.82); }
}
.music-toggle {
  position: fixed; z-index: 30; left: 22px; bottom: 22px; width: 48px; height: 48px;
  display: grid; place-items: center; border: 1px solid rgba(112,29,53,.12); border-radius: 50%;
  background: rgba(255,253,249,.82); color: var(--burgundy); backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(72,19,38,.12); cursor: pointer; transition: .35s var(--ease);
}
.music-toggle:hover { transform: translateY(-3px) scale(1.03); background: var(--ivory); }
.music-bars { height: 16px; display:flex; align-items:flex-end; gap:3px; direction:ltr; }
.music-bars i { display:block; width:2px; height:7px; border-radius:2px; background:var(--burgundy); }
.music-toggle.playing .music-bars i { animation: musicBar .75s ease-in-out infinite alternate; }
.music-toggle.playing .music-bars i:nth-child(2){animation-delay:.18s}.music-toggle.playing .music-bars i:nth-child(3){animation-delay:.35s}
@keyframes musicBar { from{height:4px} to{height:16px} }
.music-panel {
  position: fixed; z-index:31; left:82px; bottom:22px; width:min(360px,calc(100vw - 108px));
  padding:14px 14px 8px; border:1px solid rgba(112,29,53,.10); border-radius:18px;
  background:rgba(255,253,249,.92); backdrop-filter:blur(18px);
  box-shadow:0 18px 50px rgba(72,19,38,.16); opacity:0; visibility:hidden;
  transform:translateY(12px) scale(.96); transition:.45s var(--ease);
}
.music-panel.open { opacity:1;visibility:visible;transform:none }
.music-panel p { margin:2px 34px 8px 0;color:var(--burgundy);font:600 15px "Noto Naskh Arabic",serif }
.music-panel iframe { display:block;border-radius:12px }
.music-close { position:absolute;top:8px;left:8px;width:30px;height:30px;border:0;border-radius:50%;background:transparent;color:var(--brown);font-size:20px;cursor:pointer }
main { position: relative; z-index: 2; }
.screen {
  position: fixed; inset: 0; display: none; overflow-y: auto;
  background: var(--cream); z-index: 2;
}
.screen.active { display: flex; }

.envelope-screen {
  align-items: center; justify-content: center; flex-direction: column;
  background:
    radial-gradient(circle at 50% 42%, rgba(255,253,249,.95) 0 12%, transparent 38%),
    linear-gradient(145deg, #f3e8dc 0%, var(--cream) 52%, #eee0d2 100%);
  perspective: 1400px;
}
.opening-copy { position: absolute; top: 9%; text-align: center; opacity: 0; animation: fadeUp .9s .3s var(--ease) forwards; }
.opening-copy p { margin: 0; font-family: "Aref Ruqaa", serif; font-size: clamp(30px, 5vw, 54px); color: var(--burgundy); }
.opening-copy span { color: var(--brown); font-size: 14px; letter-spacing: 2px; }
.envelope {
  position: relative; width: min(520px, 78vw); height: min(330px, 50vw); border: 0; padding: 0;
  background: transparent; cursor: pointer; filter: drop-shadow(0 26px 28px rgba(72,19,38,.18));
  transform-style: preserve-3d; transition: transform .7s var(--ease), filter .7s var(--ease);
}
.envelope:hover { transform: translateY(-8px) rotateX(2deg); filter: drop-shadow(0 34px 34px rgba(72,19,38,.22)); }
.envelope-back, .envelope-front, .envelope-flap { position: absolute; inset: 0; border-radius: 8px; }
.envelope-back { background: #eadbc9; border: 1px solid rgba(107,81,74,.12); }
.letter-peek {
  position: absolute; z-index: 2; width: 82%; height: 76%; left: 9%; bottom: 8%;
  background: var(--ivory); border-radius: 4px; box-shadow: 0 8px 20px rgba(72,19,38,.12);
  transform-origin: bottom; transition: transform 1.1s 1s var(--ease), bottom 1.1s 1s var(--ease);
}
.envelope-flap {
  z-index: 5; height: 62%; bottom: auto;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  background: linear-gradient(145deg, #f4eadb, #e7d4bd);
  transform-origin: top center; transition: transform 1s var(--ease), z-index 0s .45s;
  border: 1px solid rgba(107,81,74,.08);
}
.envelope-front {
  z-index: 4; background: linear-gradient(135deg, #eedfc9 0 49.7%, transparent 50%) left / 50.2% 100% no-repeat,
    linear-gradient(225deg, #f4e7d5 0 49.7%, transparent 50%) right / 50.2% 100% no-repeat;
  clip-path: polygon(0 100%, 0 22%, 50% 73%, 100% 22%, 100% 100%);
  filter: drop-shadow(0 -1px 1px rgba(107,81,74,.08));
}
.envelope-front:after {
  content: "ZAMZAM"; position: absolute; left: 0; right: 0; bottom: 22%;
  text-align: center; direction: ltr; color: rgba(72,19,38,.48);
  font: 500 11px "Cormorant Garamond", serif; letter-spacing: 7px;
}
.seal {
  position: absolute; z-index: 7; width: 82px; height: 82px; left: calc(50% - 41px); top: 49%;
  display: grid; place-items: center; border-radius: 50%; color: #e5c9bd;
  background: radial-gradient(circle at 38% 32%, #8c3049 0, #701d35 58%, #4b1428 100%);
  box-shadow: inset 0 0 0 5px rgba(73,16,36,.18), inset 0 0 0 7px rgba(214,185,140,.16), 0 8px 16px rgba(72,19,38,.25);
  transition: transform .8s var(--ease), opacity .55s .25s;
}
.seal:before { content: ""; position: absolute; inset: 8px; border: 1px solid rgba(229,201,189,.38); border-radius: 50%; }
.seal span { font-family: "Aref Ruqaa", serif; font-size: 36px; }
.envelope.opening { pointer-events: none; }
.envelope.opening .seal { transform: scale(.2) rotate(25deg); opacity: 0; }
.envelope.opening .envelope-flap { transform: rotateX(180deg); z-index: 1; }
.envelope.opening .letter-peek { bottom: 38%; transform: translateY(-55%) scale(1.05); }
.open-hint { position: absolute; bottom: 7%; color: var(--brown); font-size: 14px; opacity: 0; animation: fadeUp .9s 1s var(--ease) forwards; }
.open-hint span { color: var(--burgundy); display: inline-block; animation: nudge 1.6s ease-in-out infinite; }

.password-screen { align-items: center; justify-content: center; background: linear-gradient(135deg, #efe2d4, var(--cream) 50%, #f1dfd4); }
.password-letter {
  position: relative; width: min(650px, 88vw); min-height: 500px; padding: 70px 10% 55px;
  text-align: center; background: var(--ivory); border-radius: 3px;
  box-shadow: 0 30px 80px rgba(72,19,38,.16), inset 0 0 60px rgba(214,185,140,.08);
  opacity: 0; transform: translateY(50px) scale(.94);
}
.password-screen.active .password-letter { animation: letterReveal 1.1s .15s var(--ease) forwards; }
.password-letter:before { content:""; position:absolute; inset: 16px; border:1px solid rgba(201,140,153,.22); pointer-events:none; }
.letter-ornament { color: var(--rose); font-size: 42px; height: 42px; }
.password-eyebrow { margin: 16px 0 8px; color: var(--gold); font-size: 12px; letter-spacing: 4px; }
.password-letter h1 { font-family: "Aref Ruqaa", serif; font-size: clamp(27px, 5vw, 42px); font-weight: 400; margin: 0 0 36px; }
.password-letter form { width: min(390px, 100%); margin: auto; }
.password-letter label { display: block; margin-bottom: 10px; color: var(--brown); font-size: 14px; }
.password-wrap { position: relative; }
.password-wrap input {
  width: 100%; height: 58px; border: 1px solid rgba(112,29,53,.25); border-radius: 8px;
  background: rgba(248,241,232,.55); color: var(--deep); text-align: center; font: 18px "Cormorant Garamond", serif;
  letter-spacing: 8px; direction: ltr; outline: none; transition: .35s var(--ease);
}
.password-wrap input:focus { border-color: var(--burgundy); box-shadow: 0 0 0 4px rgba(112,29,53,.07); }
.input-heart { position: absolute; right: 18px; top: 18px; color: var(--rose); opacity: 0; transform: scale(.4); transition: .25s var(--ease); }
.password-wrap.typing .input-heart { opacity: 1; transform: scale(1); }
.password-error { height: 22px; margin: 6px 0 2px; color: var(--burgundy); font-size: 13px; }
.password-letter.shake { animation: shake .45s ease; }
.primary-button {
  min-height: 52px; padding: 0 26px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--burgundy); color: var(--ivory); font: 600 16px "Noto Naskh Arabic", serif;
  box-shadow: 0 12px 24px rgba(112,29,53,.16); transition: .35s var(--ease);
}
.primary-button:hover { background: var(--deep); transform: translateY(-3px); box-shadow: 0 16px 30px rgba(112,29,53,.24); }
.primary-button:active { transform: translateY(0) scale(.97); }
.primary-button span { display: inline-block; margin-right: 10px; }

.bloom-screen { align-items: center; justify-content: center; background: var(--cream); }
.garden { position: absolute; inset: 0; overflow: hidden; }
.sun { position:absolute; width: min(38vw,420px); aspect-ratio:1; border-radius:50%; left:50%; top:38%; transform:translate(-50%,-50%) scale(0); background:rgba(255,253,249,.9); box-shadow:0 0 100px 40px rgba(214,185,140,.18); }
.bloom-screen.active .sun { animation:sunReveal 2s var(--ease) forwards; }
.garden-copy { position: absolute; inset: 0; display:grid; place-items:center; z-index:3; }
.garden-copy p { font-family:"Aref Ruqaa",serif; font-size:clamp(32px,6vw,64px); color:var(--burgundy); opacity:0; transform:translateY(20px); }
.bloom-screen.active .garden-copy p { animation:fadeUp 1.2s 1.6s var(--ease) forwards; }
.garden-line { position:absolute; width:0; height:1px; background:linear-gradient(90deg,transparent,var(--gold),transparent); bottom:18%; }
.bloom-screen.active .garden-line { animation:lineGrow 1.5s 2s var(--ease) forwards; }
.bloom-flower { position:absolute; bottom:-70px; left:var(--x); width:var(--size); height:calc(var(--size)*1.8); transform-origin:bottom; opacity:0; }
.bloom-screen.active .bloom-flower { animation:flowerRise 2.4s var(--delay) var(--ease) forwards; }
.stem { position:absolute; bottom:0; left:50%; width:3px; height:70%; background:#7f8c67; border-radius:99px; transform-origin:bottom; }
.flower-head { position:absolute; top:0; left:50%; width:var(--size); height:var(--size); transform:translateX(-50%); }
.petal { position:absolute; width:48%; height:48%; left:26%; top:5%; border-radius:80% 20% 80% 20%; background:var(--petal); transform-origin:50% 100%; }
.petal:nth-child(1){transform:rotate(0deg) translateY(-18%)}.petal:nth-child(2){transform:rotate(72deg) translateY(-18%)}
.petal:nth-child(3){transform:rotate(144deg) translateY(-18%)}.petal:nth-child(4){transform:rotate(216deg) translateY(-18%)}
.petal:nth-child(5){transform:rotate(288deg) translateY(-18%)}
.flower-head:after{content:"";position:absolute;width:28%;height:28%;left:36%;top:36%;border-radius:50%;background:#d6b98c}
.falling-petal { position:absolute; top:-30px; left:var(--x); width:12px; height:18px; border-radius:80% 20% 80% 20%; background:var(--petal); animation:petalFall var(--duration) var(--delay) linear infinite; opacity:.7; }

.chapter-screen { background:var(--cream); }
.chapter { position:absolute; inset:0; display:none; overflow-y:auto; }
.chapter.active { display:flex; animation:chapterIn .9s var(--ease) both; }
.chapter.exit { animation:chapterOut .55s var(--ease) both; }
.progress { position:fixed; z-index:12; top:28px; left:50%; transform:translateX(-50%); width:min(280px,55vw); display:flex; align-items:center; gap:12px; direction:ltr; color:var(--brown); font:12px "Cormorant Garamond",serif; }
.progress-track { flex:1; height:1px; background:rgba(112,29,53,.14); }
.progress-track span { display:block; width:20%; height:100%; background:var(--burgundy); transition:width .8s var(--ease); }


.chapter-letter { align-items:center; justify-content:center; padding:100px 20px 60px; background:linear-gradient(135deg,#efe2d4,var(--cream),#f2e3d8); }
.letter-page { position:relative; width:min(760px,90vw); min-height:min(620px,72vh); padding:62px clamp(28px,7vw,82px); border-radius:3px; background:var(--ivory); box-shadow:0 28px 70px rgba(72,19,38,.12); }
.letter-page:before { content:"";position:absolute;inset:14px;border:1px solid rgba(201,140,153,.19); }
.letter-date { color:var(--gold); text-align:left; direction:ltr; font:italic 13px "Cormorant Garamond",serif; letter-spacing:2px; }
.typed-letter { min-height:330px; margin-top:28px; font-size:clamp(20px,3.2vw,29px); line-height:2.05; color:#59333b; white-space:pre-line; }
.typing-cursor { display:inline-block; width:1.5px; height:28px; margin-right:4px; vertical-align:-5px; background:var(--burgundy); animation:cursor 1s steps(1) infinite; }
.letter-next { display:block; margin:28px auto 0; }

.story-chapter { align-items:center; justify-content:center; text-align:center; padding:100px 20px 50px; }
.story-content { width:min(900px,92vw); }
.chapter-kicker { color:var(--rose); letter-spacing:5px; font-size:12px; }
.story-content h1,.chapter-header h1,.final-copy h1 { font-family:"Aref Ruqaa",serif; font-weight:400; }
.story-content h1 { margin:12px 0 4px; font-size:clamp(38px,7vw,70px); }
.story-subtitle { color:var(--brown); font-size:clamp(16px,2.2vw,22px); }
.date-mark { direction:ltr; display:flex; justify-content:center; align-items:center; gap:12px; margin:30px 0 24px; color:var(--burgundy); font:600 clamp(24px,5vw,44px) "Cormorant Garamond",serif; }
.date-mark i { color:var(--gold); font-size:.7em; }
.counter { display:grid; grid-template-columns:repeat(4,1fr); max-width:690px; margin:0 auto 32px; direction:ltr; }
.counter div { position:relative; display:flex; flex-direction:column; align-items:center; }
.counter div:not(:last-child):after { content:"";position:absolute;right:0;top:10%;height:80%;width:1px;background:rgba(112,29,53,.12); }
.counter strong { font:500 clamp(38px,7vw,68px) "Cormorant Garamond",serif; color:var(--burgundy); line-height:1; }
.counter span { margin-top:8px; font-size:13px; color:var(--brown); }

.gallery-chapter,.video-chapter { display:none; flex-direction:column; align-items:center; padding:90px max(20px,5vw) 70px; }
.gallery-chapter.active,.video-chapter.active { display:flex; }
.chapter-header { text-align:center; margin-bottom:28px; }
.chapter-header p { color:var(--rose); letter-spacing:4px; margin:0 0 4px; }
.chapter-header h1 { margin:0; font-size:clamp(38px,6vw,58px); }
.photo-gallery { width:min(1100px,100%); columns:3 280px; column-gap:18px; }
.photo-card { position:relative; width:100%; margin:0 0 18px; break-inside:avoid; overflow:hidden; border:0; padding:0; border-radius:14px; background:#ddd; cursor:pointer; box-shadow:0 16px 35px rgba(72,19,38,.11); }
.photo-card:nth-child(1),.photo-card:nth-child(4),.photo-card:nth-child(7){height:360px}.photo-card:nth-child(2),.photo-card:nth-child(5),.photo-card:nth-child(8){height:280px}.photo-card:nth-child(3),.photo-card:nth-child(6){height:420px}
.photo-card img { width:100%; height:100%; display:block; object-fit:cover; transition:transform .8s var(--ease),filter .8s var(--ease); }
.photo-card:hover img { transform:scale(1.055); filter:saturate(.9) contrast(1.04); }
.photo-card:after { content:""; position:absolute; inset:0; border:1px solid rgba(255,255,255,.35); border-radius:14px; }
.gallery-chapter>.primary-button,.video-chapter>.primary-button { margin-top:30px; }

.video-gallery { width:min(1100px,100%); display:grid; grid-template-columns:repeat(4,1fr); gap:16px; }
.video-card { position:relative; aspect-ratio:9/12; overflow:hidden; border:0; border-radius:14px; padding:0; cursor:pointer; background:#5b2533; box-shadow:0 16px 35px rgba(72,19,38,.12); }
.video-card video { width:100%;height:100%;object-fit:cover;opacity:.82;pointer-events:none; }
.video-card:after { content:"";position:absolute;inset:0;background:linear-gradient(180deg,transparent 45%,rgba(72,19,38,.58)); }
.play-button { position:absolute; z-index:2; width:58px;height:58px;left:50%;top:50%;transform:translate(-50%,-50%);border:1px solid rgba(255,255,255,.7);border-radius:50%;background:rgba(112,29,53,.75);color:white;display:grid;place-items:center;transition:.35s var(--ease); }
.play-button span { font-size:18px; margin-left:-3px; }
.video-card:hover .play-button { transform:translate(-50%,-50%) scale(1.1); background:var(--burgundy); }
.video-number { position:absolute;z-index:2;right:14px;bottom:10px;color:white;font:13px "Cormorant Garamond",serif;direction:ltr; }

.final-chapter { align-items:center; justify-content:center; text-align:center; background:radial-gradient(circle at 50% 45%,rgba(255,253,249,.95),var(--cream) 58%,#eee0d2); }
.final-copy { position:relative; z-index:3; }
.final-kicker { color:var(--gold); letter-spacing:7px; font-size:12px; }
.final-copy h1 { margin:18px 0 8px; font-size:clamp(42px,8vw,82px); }
.final-copy p { margin:10px 0 18px; font-family:"Aref Ruqaa",serif; font-size:clamp(24px,4vw,38px); color:var(--burgundy); }
.beating-heart { display:inline-block; animation:beat 1.2s ease-in-out infinite; }
.signature { direction:rtl; color:var(--brown); font:italic 24px "Cormorant Garamond",serif; }
.final-flower { position:absolute;width:180px;height:260px;opacity:.7 }
.flower-one{right:-30px;bottom:-40px}.flower-two{left:-40px;top:-30px;transform:rotate(155deg)}

.modal { position:fixed;z-index:50;inset:0;display:none;align-items:center;justify-content:center;background:rgba(72,19,38,.94);backdrop-filter:blur(12px);opacity:0; }
.modal.open { display:flex;animation:modalIn .45s var(--ease) forwards; }
.modal-close { position:absolute;z-index:3;top:24px;left:24px;width:48px;height:48px;border:1px solid rgba(255,255,255,.35);border-radius:50%;background:transparent;color:white;font-size:28px;cursor:pointer; }
.photo-modal img { max-width:84vw;max-height:82vh;object-fit:contain;border-radius:10px;box-shadow:0 30px 70px rgba(0,0,0,.28); }
.modal-nav { position:absolute;z-index:3;top:50%;width:50px;height:50px;border:1px solid rgba(255,255,255,.25);border-radius:50%;background:rgba(72,19,38,.4);color:white;font-size:20px;cursor:pointer; }
.modal-prev{right:24px}.modal-next{left:24px}
.video-modal video { width:min(92vw,900px);max-height:84vh;border-radius:12px;background:#000; }

@keyframes fadeUp{to{opacity:1;transform:translateY(0)}}@keyframes nudge{50%{transform:translateY(5px)}}@keyframes letterReveal{to{opacity:1;transform:translateY(0) scale(1)}}@keyframes shake{25%{transform:translateX(-8px)}50%{transform:translateX(8px)}75%{transform:translateX(-4px)}}@keyframes sunReveal{to{transform:translate(-50%,-50%) scale(1)}}@keyframes lineGrow{to{width:40%}}@keyframes flowerRise{0%{opacity:0;transform:translateY(100px) scale(.2) rotate(-8deg)}100%{opacity:1;transform:translateY(0) scale(1) rotate(0)}}@keyframes petalFall{to{transform:translate3d(var(--drift),110vh,0) rotate(540deg)}}@keyframes chapterIn{from{opacity:0;transform:translateY(28px) scale(.985)}to{opacity:1;transform:none}}@keyframes chapterOut{to{opacity:0;transform:translateY(-20px) scale(.985)}}@keyframes cursor{50%{opacity:0}}@keyframes beat{50%{transform:scale(1.22)}}@keyframes modalIn{to{opacity:1}}

@media (max-width: 760px) {
  .music-toggle{left:14px;bottom:14px;width:44px;height:44px}
  .music-panel{left:68px;bottom:14px;width:calc(100vw - 82px)}
  .opening-copy{top:12%}.envelope{width:82vw;height:52vw}.seal{width:64px;height:64px;left:calc(50% - 32px)}.seal span{font-size:29px}
  .password-letter{width:90vw;min-height:470px;padding:48px 8% 40px}
  .letter-page{width:92vw;min-height:70vh;padding:48px 24px}.typed-letter{min-height:290px;line-height:1.9}
  .counter{max-width:94vw}.counter strong{font-size:38px}.counter span{font-size:11px}
  .photo-gallery{columns:2 140px;column-gap:10px}.photo-card{margin-bottom:10px;border-radius:10px}.photo-card:nth-child(n){height:220px}.photo-card:nth-child(3n){height:300px}
  .video-gallery{grid-template-columns:repeat(2,1fr);gap:10px}.video-card{border-radius:10px}.play-button{width:48px;height:48px}
  .progress{top:18px}.modal-nav{top:auto;bottom:24px}.modal-prev{right:calc(50% + 34px)}.modal-next{left:calc(50% + 34px)}
  .photo-modal img{max-width:92vw}.final-flower{width:120px}
}
@media (prefers-reduced-motion: reduce) {
  *,*:before,*:after{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}
}

/* Premium refinement: keep motion soft, hierarchy clear, and spacing editorial. */
:root {
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 18%, rgba(201,140,153,.08), transparent 19rem),
    radial-gradient(circle at 88% 82%, rgba(214,185,140,.08), transparent 22rem);
}

button, input { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible {
  outline: 2px solid rgba(112,29,53,.55);
  outline-offset: 4px;
}

.envelope-screen {
  background:
    radial-gradient(circle at 50% 43%, rgba(255,253,249,.98) 0 16%, transparent 42%),
    linear-gradient(145deg, #efe3d6 0%, #faf4ec 48%, #eee1d3 100%);
}
.opening-copy {
  top: clamp(38px, 8vh, 82px);
  letter-spacing: .02em;
}
.opening-copy p {
  font-size: clamp(34px, 5.2vw, 58px);
  line-height: 1.05;
}
.opening-copy span {
  display: block;
  margin-top: 10px;
  font-size: 12px;
  letter-spacing: .24em;
  text-transform: uppercase;
  opacity: .72;
}
.envelope {
  width: min(500px, 76vw);
  height: min(320px, 49vw);
}
.envelope.opening { animation: none; }
.seal {
  box-shadow:
    inset 0 0 0 5px rgba(73,16,36,.18),
    inset 0 0 0 7px rgba(214,185,140,.14),
    0 12px 24px rgba(72,19,38,.22),
    0 2px 4px rgba(72,19,38,.12);
}
.open-hint {
  bottom: clamp(24px, 6vh, 58px);
  font-size: 13px;
  letter-spacing: .04em;
}

.password-letter {
  width: min(620px, 86vw);
  min-height: 0;
  padding: clamp(48px, 8vh, 68px) clamp(28px, 8vw, 82px) clamp(42px, 7vh, 58px);
  border: 1px solid rgba(201,140,153,.16);
  border-radius: 8px;
  box-shadow: 0 32px 90px rgba(72,19,38,.12), inset 0 0 70px rgba(214,185,140,.07);
}
.password-letter:before { inset: 12px; border-radius: 4px; }
.password-eyebrow { letter-spacing: .32em; }
.password-letter h1 { line-height: 1.35; margin-bottom: clamp(24px, 4vh, 38px); }
.password-letter form { gap: 0; }
.password-wrap input {
  height: 56px;
  border-radius: 999px;
  background: rgba(255,253,249,.84);
  letter-spacing: .12em;
  box-shadow: inset 0 1px 4px rgba(72,19,38,.025);
}
.input-heart { top: 17px; }
.password-letter .primary-button { width: 100%; max-width: 260px; margin-top: 2px; }

.chapter-screen { background: #f8f1e8; }
.chapter-arriving {
  animation: chapterArrival 1s var(--ease-out) both;
}
@keyframes chapterArrival {
  from { opacity: 0; transform: translateY(18px) scale(.992); filter: blur(5px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}
.progress {
  top: clamp(18px, 3vh, 30px);
  width: min(300px, 58vw);
  padding: 8px 12px;
  border: 1px solid rgba(112,29,53,.07);
  border-radius: 999px;
  background: rgba(255,253,249,.58);
  backdrop-filter: blur(12px);
}

.chapter-letter {
  background:
    radial-gradient(circle at 50% 35%, rgba(255,253,249,.9), transparent 32rem),
    linear-gradient(145deg, #efe3d6, #faf4ec 55%, #eee1d3);
}
.letter-page {
  max-height: calc(100vh - 150px);
  min-height: min(600px, calc(100vh - 150px));
  width: min(760px, 88vw);
  overflow-y: auto;
  border: 1px solid rgba(201,140,153,.12);
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(72,19,38,.10);
  scrollbar-width: thin;
  scrollbar-color: rgba(112,29,53,.18) transparent;
}
.letter-date { font-size: 12px; opacity: .72; }
.typed-letter {
  max-width: 620px;
  min-height: 300px;
  margin: 18px auto 0;
  font-size: clamp(19px, 2.35vw, 27px);
  line-height: 1.9;
  text-wrap: pretty;
}
.letter-next { margin-top: 24px; }

.story-chapter {
  background:
    radial-gradient(circle at 50% 46%, rgba(255,253,249,.96), transparent 30rem),
    var(--cream);
}
.story-content { max-height: calc(100vh - 110px); }
.story-content h1 { line-height: 1.18; }
.story-subtitle { line-height: 1.7; }
.date-mark { margin: clamp(18px, 3vh, 30px) 0 clamp(18px, 3vh, 24px); }
.counter { max-width: 640px; }
.counter strong { text-wrap: balance; }

.gallery-chapter, .video-chapter {
  background:
    radial-gradient(circle at 50% 0%, rgba(255,253,249,.88), transparent 38rem),
    var(--cream);
}
.chapter-header { margin-bottom: 22px; }
.chapter-header h1 { line-height: 1.15; }
.photo-card, .video-card {
  border-radius: 12px;
  box-shadow: 0 18px 38px rgba(72,19,38,.10);
  opacity: 0;
  transform: translateY(20px) scale(.985);
}
.photo-card.revealed, .video-card.revealed {
  animation: galleryReveal .8s var(--ease-out) var(--reveal-delay) forwards;
}
@keyframes galleryReveal {
  to { opacity: 1; transform: none; }
}
.photo-card { will-change: transform; }
.photo-card img { transition: transform 1s var(--ease-out), filter .7s var(--ease-out); }
.video-card { transition: transform .55s var(--ease-out), box-shadow .55s var(--ease-out); }
.video-card:hover { transform: translateY(-5px); box-shadow: 0 24px 44px rgba(72,19,38,.16); }

.final-chapter {
  background:
    radial-gradient(circle at 50% 44%, rgba(255,253,249,.98), transparent 32rem),
    linear-gradient(145deg, #eee1d3, #faf4ec 58%, #efe3d6);
}
.final-copy h1 { line-height: 1.12; }
.final-copy p { line-height: 1.5; }
.final-flower { filter: blur(.2px); opacity: .38; }

.modal {
  background: rgba(72,19,38,.91);
  backdrop-filter: blur(16px) saturate(.75);
}
.modal-close, .modal-nav {
  transition: .35s var(--ease-out);
}
.modal-close:hover, .modal-nav:hover {
  background: rgba(255,253,249,.12);
  transform: scale(1.06);
}
.photo-modal img { border-radius: 8px; }
.video-modal video { border-radius: 8px; }

@media (min-width: 761px) and (max-height: 760px) {
  .opening-copy { top: 28px; }
  .opening-copy p { font-size: 38px; }
  .opening-copy span { margin-top: 5px; }
  .open-hint { bottom: 20px; }
  .letter-page { max-height: calc(100vh - 120px); min-height: calc(100vh - 120px); padding-top: 42px; padding-bottom: 42px; }
  .progress { top: 14px; }
  .story-content h1 { font-size: clamp(34px, 5.6vw, 58px); }
  .counter strong { font-size: clamp(34px, 5.5vw, 56px); }
}

@media (max-width: 760px) {
  .noise { opacity: .028; }
  .opening-copy { top: clamp(34px, 8vh, 64px); }
  .opening-copy p { font-size: 38px; }
  .opening-copy span { font-size: 10px; }
  .envelope {
    width: 86vw;
    height: 54vw;
    max-height: 280px;
  }
  .seal { width: 68px; height: 68px; left: calc(50% - 34px); top: 47%; }
  .open-hint { bottom: 24px; }

  .password-screen { padding: 18px; }
  .password-letter {
    width: 100%;
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    padding: 46px 22px 34px;
  }
  .password-letter h1 { font-size: 28px; }
  .password-letter form { width: 100%; max-width: 340px; }
  .password-wrap input { height: 52px; }
  .password-letter .primary-button { max-width: none; }

  .progress {
    top: 12px;
    width: 210px;
  }
  .chapter-letter { padding: 68px 12px 24px; }
  .letter-page {
    width: 100%;
    max-height: calc(100vh - 92px);
    min-height: calc(100vh - 92px);
    padding: 38px 22px 30px;
  }
  .letter-page:before { inset: 8px; }
  .typed-letter {
    min-height: 280px;
    margin-top: 12px;
    font-size: clamp(18px, 5.2vw, 22px);
    line-height: 1.82;
  }
  .letter-next { margin: 18px auto 0; }

  .story-chapter { padding: 78px 16px 34px; }
  .story-content { max-height: none; }
  .story-content h1 { font-size: clamp(34px, 10vw, 48px); }
  .story-subtitle { max-width: 330px; margin-inline: auto; }
  .date-mark { gap: 7px; }
  .counter { gap: 0; margin-bottom: 24px; }
  .counter strong { font-size: clamp(34px, 10vw, 44px); }

  .gallery-chapter, .video-chapter {
    padding: 74px 14px 34px;
  }
  .chapter-header { margin-bottom: 18px; }
  .chapter-header h1 { font-size: 38px; }
  .photo-gallery { columns: 2 130px; column-gap: 8px; }
  .photo-card { margin-bottom: 8px; }
  .video-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .video-card { aspect-ratio: 3 / 4; }
  .gallery-chapter>.primary-button, .video-chapter>.primary-button { margin-top: 20px; }

  .final-copy { width: calc(100% - 32px); }
  .final-copy h1 { font-size: clamp(38px, 12vw, 54px); }
  .final-copy p { font-size: 26px; }
  .final-kicker { letter-spacing: .42em; }
  .music-panel { width: calc(100vw - 82px); left: 68px; }
}

@media (max-width: 360px), (max-height: 650px) and (max-width: 760px) {
  .opening-copy { top: 22px; }
  .opening-copy p { font-size: 32px; }
  .opening-copy span { display: none; }
  .envelope { width: 82vw; height: 51vw; }
  .open-hint { bottom: 14px; font-size: 11px; }
  .password-letter { padding: 34px 18px 26px; }
  .letter-ornament { height: 30px; font-size: 32px; }
  .password-letter h1 { font-size: 24px; margin-bottom: 18px; }
  .password-error { height: 18px; }
  .letter-page { padding: 32px 18px 24px; }
  .typed-letter { font-size: 17px; line-height: 1.72; }
  .counter strong { font-size: 34px; }
  .counter span { font-size: 10px; }
  .progress { width: 180px; }
}
