/* ---------- fonts (self-hosted, OFL) ---------- */
@font-face { font-family: "Lora"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/lora-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Lora"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/lora-latin-ext-400-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1E00-1E9F,U+A720-A7FF; }
@font-face { font-family: "Lora"; font-style: italic; font-weight: 400; font-display: swap;
  src: url(fonts/lora-latin-400-italic.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Lora"; font-style: italic; font-weight: 400; font-display: swap;
  src: url(fonts/lora-latin-ext-400-italic.woff2) format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1E00-1E9F,U+A720-A7FF; }
@font-face { font-family: "Lora"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(fonts/lora-latin-600-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Lora"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(fonts/lora-latin-ext-600-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1E00-1E9F,U+A720-A7FF; }
@font-face { font-family: "Naskh"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/noto-naskh-arabic-arabic-400-normal.woff2) format("woff2");
  unicode-range: U+0600-06FF,U+0750-077F,U+0870-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FEFC; }
@font-face { font-family: "Naskh"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(fonts/noto-naskh-arabic-arabic-600-normal.woff2) format("woff2");
  unicode-range: U+0600-06FF,U+0750-077F,U+0870-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FEFC; }
@font-face { font-family: "Vibes"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/great-vibes-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Vibes"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/great-vibes-latin-ext-400-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1E00-1E9F,U+A720-A7FF; }

/* ---------- tokens ---------- */
:root {
  --velvet: #4a1022;
  --velvet-deep: #2c0813;
  --wine: #6d1424;
  --wax: #8e1b2e;
  --blush: #f2c9c4;
  --paper: #fbf2e6;
  --paper-edge: #ead9c3;
  --gold: #d4af6a;
  --ink: #3b1f28;
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --script: "Vibes", "Snell Roundhand", "Apple Chancery", cursive;
  --ar-body: "Naskh", "Geeza Pro", "Segoe UI", Tahoma, sans-serif;
  --ar-script: "Naskh", "Geeza Pro", "Segoe UI", Tahoma, sans-serif;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: inherit; }
html, body { margin: 0; }
[hidden] { display: none !important; }
body {
  background:
    radial-gradient(90% 60% at 50% 0%, #6a1730 0%, transparent 70%),
    radial-gradient(70% 50% at 50% 100%, #3a0b19 0%, transparent 80%),
    var(--velvet);
  background-attachment: fixed;
  color: var(--blush);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}
html[lang="ar"] body { font-family: var(--ar-body); font-size: 1.15rem; line-height: 1.9; }
html.sealed body { overflow: hidden; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 5px; border-radius: 8px; }
.polaroid:focus-visible,
:where(.letter, .reason-note, .ow, .coupon, .ticket, .tour-card) :focus-visible { outline-color: var(--wax); }

.script { font-family: var(--script); font-weight: 400; letter-spacing: 0; }
html[lang="ar"] .script { font-family: var(--ar-script); font-weight: 600; }

/* ---------- language switch ---------- */
.top {
  position: fixed; inset-inline: 0; top: env(safe-area-inset-top, 0px); z-index: 30;
  display: flex; justify-content: center; padding: .75rem 1rem 0; pointer-events: none;
}
.langs {
  display: flex; gap: .15rem; pointer-events: auto;
  background: rgba(44, 8, 19, .55); border: 1px solid rgba(212, 175, 106, .25);
  border-radius: 999px; padding: .2rem;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.langs button {
  background: none; border: 0; border-radius: 999px; min-height: 44px;
  padding: .2rem .9rem; font-size: 1.05rem; color: rgba(242, 201, 196, .8);
}
.langs button[lang="ar"] { font-family: var(--ar-body); }
.langs button[aria-pressed="true"] { background: var(--paper); color: var(--wax); }
@media (max-width: 380px) { .langs button { padding: .2rem .55rem; font-size: .95rem; } }

/* ---------- scene 1: envelope ---------- */
.cover { display: none; }
.sealed .cover {
  position: fixed; inset: 0; z-index: 20;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 1.75rem; padding: 4.5rem 1.25rem 2rem;
  overflow-y: auto; overscroll-behavior: contain;
  background:
    radial-gradient(60% 45% at 50% 48%, rgba(255, 190, 150, .16), transparent 70%),
    radial-gradient(90% 60% at 50% 0%, #6a1730 0%, transparent 70%),
    var(--velvet);
  transition: opacity 1s ease, visibility 0s linear 1s;
}
.cover.leaving { opacity: 0; visibility: hidden; }
.sealed .cover > * { flex-shrink: 0; }
.cover-to {
  margin: auto 0 0; font-family: var(--script); color: var(--gold);
  font-size: clamp(2.6rem, 11vw, 4rem); line-height: 1;
}
html[lang="ar"] .cover-to { font-family: var(--ar-script); font-size: clamp(2.2rem, 9vw, 3.2rem); line-height: 1.4; }
.cover-hint { margin: 0 0 auto; font-style: italic; color: rgba(242, 201, 196, .75); font-size: 1.1rem; text-align: center; }
html[lang="ar"] .cover-hint { font-style: normal; }

.envelope {
  position: relative; width: min(84vw, 440px); aspect-ratio: 3 / 2;
  perspective: 1200px;
  filter: drop-shadow(0 30px 40px rgba(20, 2, 8, .55));
}
.env-back { position: absolute; inset: 0; z-index: 0; background: #efdcc6; border-radius: 6px; }
.env-card {
  position: absolute; left: 7%; right: 7%; top: 6%; height: 88%;
  background: var(--paper); border-radius: 3px;
  display: flex; align-items: flex-start; justify-content: center; padding-top: 12%;
  box-shadow: 0 0 0 1px var(--paper-edge) inset;
  z-index: 1;
  transition: transform 1.1s cubic-bezier(.2, .8, .2, 1);
}
.env-card { flex-direction: column; align-items: center; gap: .1rem; }
.env-year { font-style: italic; color: #78582c; font-size: 1rem; }
.env-age { font-style: normal; color: var(--wax); font-size: clamp(1.05rem, 4.5vw, 1.35rem); letter-spacing: .04em; }
.letter-year [data-age], .env-age { unicode-bidi: isolate; }
.env-card span { font-family: var(--script); color: var(--wax); font-size: clamp(1.3rem, 6vw, 1.9rem); white-space: nowrap; }
html[lang="ar"] .env-card span { font-family: var(--ar-script); }
.env-front { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; border-radius: 0 0 6px 6px; }
.env-flap {
  position: absolute; left: 0; right: 0; top: 0; height: 62%;
  background: linear-gradient(180deg, #f3e3cf, #ead5bc);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: 50% 0; z-index: 3;
  transition: transform .8s cubic-bezier(.5, 0, .3, 1), z-index 0s linear .4s;
}
.seal {
  position: absolute; z-index: 4; left: 50%; top: 62%;
  width: 84px; height: 84px; margin: -42px 0 0 -42px; padding: 0;
  background: none; border: 0; border-radius: 50%;
  transition: transform .5s cubic-bezier(.5, -0.4, .6, 1.4), opacity .4s ease .1s;
  animation: breathe 2.8s ease-in-out infinite;
}
.seal svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 4px 5px rgba(40, 0, 10, .45)); }
.seal:hover { animation-play-state: paused; transform: scale(1.06); }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }

.opening .seal { animation: none; transform: scale(1.25) rotate(-12deg); opacity: 0; pointer-events: none; }
.opening .env-flap { transform: rotateX(180deg); z-index: 0; }
.opening .env-card { transform: translateY(-62%); transition-delay: .7s; }

/* ---------- main scenes ---------- */
main { position: relative; z-index: 1; }

.letter {
  position: relative;
  width: min(92vw, 40rem);
  margin: 6rem auto 0;
  padding: clamp(2.5rem, 7vw, 4rem) clamp(1.5rem, 6vw, 3.75rem) clamp(2.5rem, 6vw, 3.5rem);
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(255, 255, 255, .55), transparent 60%),
    var(--paper);
  color: var(--ink);
  border-radius: 3px;
  box-shadow: 0 40px 70px -30px rgba(20, 2, 8, .7), 0 0 0 1px var(--paper-edge) inset;
}
.letter::before {
  content: ""; position: absolute; inset: 12px; pointer-events: none;
  border: 1px solid rgba(212, 175, 106, .55); border-radius: 2px;
}
.letter:focus { outline: none; }
.letter h1 {
  margin: 0; text-align: center; color: var(--wax);
  font-size: clamp(2.6rem, 10vw, 4.4rem); line-height: 1.15;
}
html[lang="ar"] .letter h1 { line-height: 1.6; font-size: clamp(2.4rem, 9vw, 3.6rem); }
.ornament { display: flex; justify-content: center; color: var(--gold); margin: .9rem 0 1.8rem; }
.ornament svg { width: 120px; height: 16px; }
.letter p { margin: 0 0 1.1rem; font-size: clamp(1.08rem, 3.4vw, 1.25rem); }
html[lang="ar"] .letter p { font-size: clamp(1.15rem, 3.4vw, 1.3rem); }
.letter .salute { font-style: italic; font-size: clamp(1.4rem, 4.4vw, 1.7rem); color: var(--wine); }
html[lang="ar"] .letter .salute { font-style: normal; }
.letter .sign { margin: 2.2rem 0 0; text-align: end; }
.letter .sign span { font-family: var(--script); color: var(--wax); font-size: clamp(1.9rem, 6vw, 2.5rem); line-height: 1.2; }
html[lang="ar"] .letter .sign span { font-family: var(--ar-script); font-size: clamp(1.6rem, 5vw, 2rem); }

.wish { text-align: center; padding: 7rem 1.25rem 2rem; max-width: 34rem; margin: 0 auto; }
.wish h2, .finale h2 { margin: 0; color: var(--paper); font-size: clamp(2.6rem, 10vw, 3.8rem); line-height: 1.2; }
html[lang="ar"] .wish h2, html[lang="ar"] .finale h2 { line-height: 1.7; }
.wish-text { margin: .6rem auto 0; font-style: italic; max-width: 26rem; }
html[lang="ar"] .wish-text { font-style: normal; }
.candle { display: block; margin: 2rem auto .25rem; padding: .5rem; background: none; border: 0; border-radius: 20px; }
.candle svg { display: block; width: 140px; height: 260px; }
.candle[aria-disabled="true"] { cursor: default; }
.flame { transform-origin: 70px 72px; animation: flicker 1.8s ease-in-out infinite alternate; }
.flame-core { transform-origin: 70px 72px; animation: flicker 1.3s ease-in-out infinite alternate-reverse; }
@keyframes flicker {
  0% { transform: scale(1, 1) skewX(-2deg); }
  40% { transform: scale(.95, 1.06) skewX(2deg); }
  100% { transform: scale(1.03, .95) skewX(-1deg); }
}
.lit { transition: opacity .6s ease; }
.out .lit { opacity: 0; }
.out .smoke { animation: smoke 2.6s ease-out forwards; }
@keyframes smoke { 0% { opacity: 0; transform: translateY(6px); } 25% { opacity: .8; } 100% { opacity: 0; transform: translateY(-18px); } }
.wish-status { min-height: 2.2em; margin: .5rem 0 0; color: var(--gold); font-size: 1.35rem; font-style: italic; }
html[lang="ar"] .wish-status { font-style: normal; }

.finale {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 4rem 1.25rem; overflow: hidden;
}
.stars { position: absolute; inset: 0; width: 100%; height: 100%; }
.finale-text { position: relative; z-index: 1; padding-top: 38vh; }
.finale h2 { font-size: clamp(3rem, 13vw, 5.2rem); text-shadow: 0 0 30px rgba(255, 180, 160, .35); }
.finale p { margin: .25rem 0 0; font-style: italic; color: var(--blush); }
html[lang="ar"] .finale p { font-style: normal; }
.again {
  margin-top: 2rem; min-height: 44px; padding: .45rem 1.3rem;
  background: none; border: 1px solid rgba(212, 175, 106, .55); border-radius: 999px;
  color: var(--gold); font-size: 1.05rem;
}
.again:hover { background: rgba(212, 175, 106, .12); }

.petals { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 25; }

/* ---------- year labels ---------- */
.letter .letter-year { margin: -1.2rem 0 1.6rem; text-align: center; font-style: italic; color: #78582c; font-size: 1.15rem; letter-spacing: .08em; }

/* ---------- memories: polaroid wall ---------- */
.memories { padding: 7rem 1rem 1rem; max-width: 58rem; margin: 0 auto; text-align: center; }
.memories h2 { margin: 0; color: var(--paper); font-size: clamp(2.6rem, 10vw, 3.8rem); line-height: 1.2; }
html[lang="ar"] .memories h2 { line-height: 1.7; }
.mem-year { margin: .2rem 0 2.5rem; font-style: italic; color: var(--gold); font-size: 1.3rem; letter-spacing: .1em; }
.wall { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: clamp(.9rem, 3vw, 2.2rem); text-align: start; }
@media (min-width: 820px) { .wall { columns: 3; } }
@media (max-width: 360px) { .wall { columns: 1; max-width: 20rem; margin-inline: auto; } }
.wall li { break-inside: avoid; margin: 0 0 clamp(1.2rem, 4vw, 2.4rem); padding-top: 10px; }
.polaroid {
  position: relative; display: block; width: 100%; padding: 8px 8px 0; margin: 0;
  background: #fffaf2; border: 0; border-radius: 2px; text-align: center;
  box-shadow: 0 18px 30px -16px rgba(20, 2, 8, .8), 0 2px 4px rgba(20, 2, 8, .25);
  transform: rotate(var(--tilt, 0deg));
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s ease;
}
.wall li:nth-child(4n+1) .polaroid { --tilt: -2.2deg; }
.wall li:nth-child(4n+2) .polaroid { --tilt: 1.6deg; }
.wall li:nth-child(4n+3) .polaroid { --tilt: -1deg; }
.wall li:nth-child(4n+4) .polaroid { --tilt: 2.4deg; }
.polaroid:hover, .polaroid:focus-visible { transform: rotate(0deg) scale(1.025); box-shadow: 0 26px 40px -18px rgba(20, 2, 8, .9); }
.polaroid::before {
  content: ""; position: absolute; top: -10px; left: 50%; width: 74px; height: 22px; margin-left: -37px;
  background: rgba(242, 201, 196, .55); transform: rotate(-3deg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}
.wall li:nth-child(even) .polaroid::before { transform: rotate(4deg); left: 62%; }
.polaroid img { display: block; width: 100%; height: auto; background: #e9dccb; }
.polaroid .cap { display: block; min-height: 2.4rem; padding: .35rem .3rem .45rem; font-family: var(--script); font-size: 1.35rem; line-height: 1.2; color: var(--wax); overflow-wrap: anywhere; }
html[lang="ar"] .polaroid .cap { font-family: var(--ar-script); font-size: 1.1rem; }
.polaroid .play {
  position: absolute; left: 50%; top: calc(50% - 1.2rem); width: 64px; height: 64px; margin: -32px 0 0 -32px;
  border-radius: 50%; background: rgba(251, 242, 230, .88); color: var(--wax);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(20, 2, 8, .35);
}
.polaroid .play svg { width: 26px; height: 26px; margin-inline-start: 4px; }
.wall-error { column-span: all; text-align: center; color: var(--blush); font-style: italic; }

/* ---------- viewer ---------- */
.viewer {
  width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(30, 5, 13, .94); color: var(--paper);
}
.viewer::backdrop { background: rgba(30, 5, 13, .7); }
.viewer[open] { position: fixed; inset: 0; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; overscroll-behavior: contain; }
.v-figure { margin: auto 0; display: flex; flex-direction: column; align-items: center; gap: .8rem; padding: 3.5rem .5rem 1.5rem; max-width: 100%; }
.v-media { min-width: 0; max-width: 100%; }
.v-media img, .v-media video {
  display: block; max-width: min(92vw, 1100px); max-height: calc(100vh - 9rem); max-height: calc(100dvh - 9rem);
  width: auto; height: auto; border: 6px solid #fffaf2; border-radius: 2px; background: #000;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .5);
}
.viewer figcaption { font-style: italic; color: var(--blush); text-align: center; padding: 0 1rem; }
html[lang="ar"] .viewer figcaption { font-style: normal; }
.v-count { color: var(--gold); font-style: normal; margin-inline-start: .5rem; font-size: .95rem; }
.v-close, .v-nav {
  position: fixed; z-index: 2; display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(212, 175, 106, .5);
  background: rgba(44, 8, 19, .6); color: var(--paper);
}
.v-close:hover, .v-nav:hover { background: rgba(212, 175, 106, .2); }
.v-close svg, .v-nav svg { flex: none; width: 24px; height: 24px; }
.v-close { top: calc(env(safe-area-inset-top, 0px) + .9rem); inset-inline-end: .9rem; }
.v-nav { top: 50%; margin-top: -24px; }
.v-prev { inset-inline-start: .6rem; }
.v-next { inset-inline-end: .6rem; }
html[dir="rtl"] .v-nav svg { transform: scaleX(-1); }
@media (max-width: 640px) {
  .v-nav { top: auto; bottom: calc(env(safe-area-inset-bottom, 0px) + 1rem); margin-top: 0; }
  .v-figure { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 5rem); }
}

/* ---------- gift draw ---------- */
.gift { text-align: center; padding: 6rem 1rem 2rem; max-width: 46rem; margin: 0 auto; }
.gift h2 { margin: 0; color: var(--paper); font-size: clamp(2.6rem, 10vw, 3.8rem); line-height: 1.2; }
html[lang="ar"] .gift h2 { line-height: 1.7; }
.gift-text { margin: .6rem auto 2.2rem; font-style: italic; max-width: 26rem; }
html[lang="ar"] .gift-text { font-style: normal; }
.boxes { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(.6rem, 3vw, 1.6rem); }
.box {
  --box: #f2c9c4; --lid: #f7d9d4; --ribbon: #d4af6a;
  display: block; padding: .4rem; background: none; border: 0; border-radius: 14px;
  transition: transform .3s ease, opacity .6s ease, filter .6s ease;
}
.boxes li:nth-child(4n+2) .box { --box: #fbf2e6; --lid: #fffaf2; --ribbon: #8e1b2e; }
.boxes li:nth-child(4n+3) .box { --box: #8e1b2e; --lid: #a62a3e; --ribbon: #d4af6a; }
.boxes li:nth-child(4n+4) .box { --box: #d4af6a; --lid: #e2c486; --ribbon: #fbf2e6; }
.box svg { display: block; width: clamp(84px, 24vw, 120px); height: auto; overflow: visible; }
.box .lid { transition: transform .8s cubic-bezier(.3, 1.4, .5, 1); transform-origin: 60px 56px; }
.box .glow { opacity: 0; transition: opacity .8s ease .2s; }
.boxes:not(.chosen) .box:hover { transform: translateY(-6px) rotate(-2deg); }
.boxes:not(.chosen) .box { animation: wobble 4s ease-in-out infinite; }
.boxes:not(.chosen) li:nth-child(2) .box { animation-delay: .7s; }
.boxes:not(.chosen) li:nth-child(3) .box { animation-delay: 1.4s; }
.boxes:not(.chosen) li:nth-child(4) .box { animation-delay: 2.1s; }
@keyframes wobble { 0%, 86%, 100% { transform: rotate(0); } 89% { transform: rotate(-4deg); } 93% { transform: rotate(4deg); } 96% { transform: rotate(-2deg); } }
.box.open .lid { transform: translate(14px, -46px) rotate(18deg); }
.box.open .glow { opacity: 1; }
.chosen .box:not(.open) { opacity: .28; filter: saturate(.4); }
.chosen .box { cursor: default; }
.gift-result { margin-top: 2rem; animation: giftIn .9s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes giftIn { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
.gift-label { margin: 0; font-style: italic; color: var(--blush); }
html[lang="ar"] .gift-label { font-style: normal; }
.gift-name {
  display: inline-block; margin: .6rem 0 0; padding: 1.1rem 2rem 1.2rem;
  background: var(--paper); color: var(--wax); border-radius: 3px;
  font-family: var(--script); font-size: clamp(2rem, 8vw, 3rem); line-height: 1.25;
  box-shadow: 0 24px 40px -22px rgba(20, 2, 8, .9), 0 0 0 1px var(--paper-edge) inset;
  max-width: 100%;
}
html[lang="ar"] .gift-name { font-family: var(--ar-script); font-size: clamp(1.7rem, 7vw, 2.4rem); line-height: 1.8; }
.gift-result .again { margin-top: 1.6rem; }
.gift-note { min-height: 1.6em; margin: .6rem 0 0; color: var(--gold); font-size: 1rem; }

/* ---------- years archive ---------- */
.years { margin-top: 3rem; }
.years h3 { margin: 0 0 .8rem; font-weight: 400; font-style: italic; font-size: 1.1rem; color: var(--blush); }
html[lang="ar"] .years h3 { font-style: normal; }
.years ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.years a {
  display: inline-flex; min-height: 44px; align-items: center; padding: .2rem 1.1rem;
  border-radius: 999px; border: 1px solid rgba(212, 175, 106, .4); color: var(--paper); text-decoration: none; font-size: 1.15rem;
}
.years a[aria-current="true"] { background: var(--paper); color: var(--wax); border-color: var(--paper); }

/* ---------- shared section heading ---------- */
.reasons, .openwhen, .coupons { text-align: center; padding: 6rem 1rem 1rem; max-width: 46rem; margin: 0 auto; }
.reasons h2, .openwhen h2, .coupons h2 { margin: 0; color: var(--paper); font-size: clamp(2.6rem, 10vw, 3.8rem); line-height: 1.2; }
html[lang="ar"] .reasons h2, html[lang="ar"] .openwhen h2, html[lang="ar"] .coupons h2 { line-height: 1.7; }
.section-text { margin: .6rem auto 2rem; font-style: italic; max-width: 28rem; }
html[lang="ar"] .section-text { font-style: normal; }

/* ---------- reasons: hearts ---------- */
.hearts { list-style: none; margin: 0 auto; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: .55rem; max-width: 34rem; }
.heart {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 100%; aspect-ratio: 1; min-height: 48px; padding: 0; background: none; border: 0; border-radius: 12px;
  color: var(--blush); transition: transform .25s cubic-bezier(.3, 1.6, .5, 1);
}
.heart svg { position: absolute; inset: 6%; width: 88%; height: 88%; fill: transparent; stroke: rgba(242, 201, 196, .7); stroke-width: 1.4; transition: fill .4s ease, stroke .4s ease; }
.heart span { position: relative; font-size: .95rem; line-height: 1; margin-top: -3px; font-variant-numeric: tabular-nums; }
.heart:hover { transform: scale(1.12); }
.heart.read svg { fill: #c23a4f; stroke: #c23a4f; }
.heart.read span { color: var(--paper); }
.heart.current { transform: scale(1.18); }
.heart.current svg { fill: var(--gold); stroke: var(--gold); }
.heart.current span { color: var(--wax); }
.hearts:not(:has(.read)) li:nth-child(5n+1) .heart svg { animation: beat 2.4s ease-in-out infinite; }
@keyframes beat { 0%, 70%, 100% { transform: scale(1); } 80% { transform: scale(1.12); } 90% { transform: scale(.98); } }
.reason-note {
  position: relative; margin: 0 auto 1.6rem; max-width: 30rem; padding: 1.3rem 1.6rem 1.4rem;
  background: var(--paper); color: var(--ink); border-radius: 3px;
  box-shadow: 0 24px 40px -22px rgba(20, 2, 8, .9), 0 0 0 1px var(--paper-edge) inset;
}
.reason-note.pop { animation: giftIn .6s cubic-bezier(.2, .8, .2, 1) both; }
.reason-num { margin: 0; color: #78582c; font-size: .95rem; letter-spacing: .08em; }
.reason-text { margin: .3rem 0 0; color: var(--wax); font-size: clamp(1.25rem, 4.6vw, 1.55rem); line-height: 1.5; }
.reasons-progress { margin: 1.2rem 0 0; color: var(--gold); font-size: 1rem; min-height: 1.6em; }

/* ---------- open-when envelopes ---------- */
.ow-list { display: grid; gap: .9rem; text-align: start; }
.ow { background: var(--paper); color: var(--ink); border-radius: 4px; box-shadow: 0 18px 30px -18px rgba(20, 2, 8, .9), 0 0 0 1px var(--paper-edge) inset; overflow: hidden; }
.ow summary {
  list-style: none; display: flex; align-items: center; gap: .9rem; min-height: 64px;
  padding: .8rem 1.1rem; cursor: pointer; color: var(--wax); font-size: clamp(1.05rem, 3.8vw, 1.2rem); line-height: 1.4;
  background: linear-gradient(180deg, #f6e8d6, #efdcc6);
}
.ow summary::-webkit-details-marker { display: none; }
.ow summary:focus-visible { outline-offset: -4px; }
.ow-seal {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #c23a4f, #8e1b2e 60%, #5e0f1d);
  box-shadow: 0 2px 4px rgba(40, 0, 10, .4); position: relative;
}
.ow-seal::after { content: "\2665"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(255, 210, 215, .75); font-size: .9rem; }
.ow[open] .ow-seal { opacity: .45; transform: rotate(-14deg) scale(.9); transition: transform .4s ease, opacity .4s ease; }
.ow-text { margin: 0; padding: 1.1rem 1.3rem 1.3rem; font-size: clamp(1.08rem, 3.6vw, 1.22rem); line-height: 1.75; animation: giftIn .5s ease both; }

/* ---------- love coupons ---------- */
.coupon-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 1rem; }
.coupon {
  position: relative; display: flex; flex-direction: column; align-items: center;
  padding: 1.3rem 1.2rem 1.2rem; background: var(--paper); color: var(--ink); border-radius: 6px;
  box-shadow: 0 18px 30px -18px rgba(20, 2, 8, .9);
  outline: 1.5px dashed rgba(142, 27, 46, .45); outline-offset: -8px; overflow: hidden;
}
.coupon::before, .coupon::after { content: ""; position: absolute; top: 50%; width: 22px; height: 22px; margin-top: -11px; border-radius: 50%; background: var(--velvet); }
.coupon::before { left: -11px; } .coupon::after { right: -11px; }
.coupon-title { margin: 0; color: var(--wax); font-family: var(--script); font-weight: 400; font-size: clamp(1.7rem, 6vw, 2.1rem); line-height: 1.25; }
html[lang="ar"] .coupon-title { font-family: var(--ar-script); font-weight: 600; font-size: clamp(1.3rem, 5vw, 1.55rem); line-height: 1.7; }
.coupon-text { margin: .4rem 0 0; font-size: 1.02rem; line-height: 1.6; flex: 1; }
.coupon .again { margin-top: 1rem; color: var(--wax); border-color: rgba(142, 27, 46, .45); }
.coupon .again:hover { background: rgba(142, 27, 46, .08); }
.coupon-stamp {
  position: absolute; top: 42%; left: 50%; transform: translate(-50%, -50%) rotate(-14deg) scale(1.6); opacity: 0;
  padding: .2rem .9rem; border: 3px double #8e1b2e; border-radius: 6px; color: #8e1b2e;
  font-size: 1.25rem; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; pointer-events: none;
  transition: transform .45s cubic-bezier(.3, 1.6, .5, 1), opacity .3s ease;
}
html[lang="ar"] .coupon-stamp { letter-spacing: 0; text-transform: none; }
.coupon.used .coupon-stamp { opacity: .85; transform: translate(-50%, -50%) rotate(-14deg) scale(1); }
.coupon.used .coupon-title, .coupon.used .coupon-text { opacity: .8; }
.coupon .again:disabled { cursor: default; opacity: .5; }

/* ---------- days together ---------- */
.together { margin-top: 1.4rem !important; color: var(--gold) !important; font-style: normal !important; font-size: 1.15rem; letter-spacing: .03em; }

/* ---------- the crown film ---------- */
.film { text-align: center; padding: 6rem 1rem 0; max-width: 60rem; margin: 0 auto; }
.film h2 { margin: 0 0 1.8rem; color: var(--paper); font-size: clamp(2.6rem, 10vw, 3.8rem); line-height: 1.2; }
html[lang="ar"] .film h2 { line-height: 1.7; }
.film-frame {
  position: relative; margin: 0 auto; padding: clamp(6px, 1.4vw, 12px);
  background: linear-gradient(135deg, #e7cc93, #b88f4a 45%, #f1dcaa 70%, #a37b38);
  border-radius: 6px;
  box-shadow: 0 40px 70px -30px rgba(20, 2, 8, .85), 0 0 60px -10px rgba(255, 180, 160, .25);
}
.film-frame img, .film-frame video { display: block; width: 100%; height: auto; border-radius: 3px; background: #2c0813; }
.film-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; margin: .75rem 0 .35rem; padding: .45rem 1.3rem;
  border: 1px solid rgba(212, 175, 106, .55); border-radius: 999px;
  background: var(--velvet-deep); color: var(--paper); font-size: 1.05rem;
}
.film-toggle:hover { background: var(--velvet); }
.film-toggle:focus-visible { outline-color: var(--gold); }

/* ---------- several gifts ---------- */
.boxes .box.open { animation: none; cursor: default; }
.gift-more { margin: 1.4rem 0 0; color: var(--gold); font-size: 1.15rem; animation: giftIn .7s ease both; }
.gift-item + .gift-item { margin-top: 2.4rem; }
.gift-new { animation: giftIn .9s cubic-bezier(.2, .8, .2, 1) both; }
/* ---------- boarding pass ---------- */
.ticket {
  display: flex; flex-direction: column; gap: 1.1rem; margin: 1.6rem auto 0; max-width: 34rem; text-align: start;
  color: var(--ink); animation: giftIn .9s cubic-bezier(.2, .8, .2, 1) .35s both;
}
.tk-pass { display: flex; filter: drop-shadow(0 20px 26px rgba(20, 2, 8, .55)); }
.ticket[hidden] { display: none; }
.tk-main, .tk-stub { background: var(--paper); position: relative; }
.tk-main { flex: 1; min-width: 0; border-radius: 10px 0 0 10px; overflow: hidden; }
.tk-stub {
  flex: none; width: 5.2rem; border-radius: 0 10px 10px 0;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: .9rem 0;
  border-inline-start: 2px dashed rgba(142, 27, 46, .35);
  background: radial-gradient(circle at 50% 30%, rgba(255, 190, 120, .35), transparent 60%), var(--paper);
}
html[dir="rtl"] .tk-main { border-radius: 0 10px 10px 0; }
html[dir="rtl"] .tk-stub { border-radius: 10px 0 0 10px; }
.tk-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .4rem .6rem; padding: .7rem 1.1rem; background: var(--wax); color: var(--paper); }
.tk-airline { font-family: var(--script); font-size: 1.55rem; line-height: 1.1; color: #f6dca8; }
.tk-kind { font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; opacity: .85; }
html[lang="ar"] .tk-kind { letter-spacing: 0; text-transform: none; font-size: .95rem; }
.tk-route { display: flex; align-items: center; justify-content: space-between; gap: .4rem; padding: 1rem 1.1rem .4rem; }
.tk-end { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.tk-end:last-child { text-align: end; }
.tk-code { font-size: clamp(1.9rem, 8vw, 2.5rem); font-weight: 600; letter-spacing: .04em; line-height: 1; color: var(--wax); font-family: var(--serif); }
.tk-city { font-size: .95rem; color: #78582c; overflow-wrap: anywhere; }
.tk-plane { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--gold); position: relative; min-width: 3rem; }
.tk-plane::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px dotted rgba(212, 175, 106, .7); }
.tk-plane svg { position: relative; width: 26px; height: 26px; background: var(--paper); padding: 0 4px; box-sizing: content-box; }
html[dir="rtl"] .tk-plane svg { transform: scaleX(-1); }
.tk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(6rem, 1fr)); gap: .55rem .9rem; padding: .6rem 1.1rem 1.1rem; }
.tk-field { display: flex; flex-direction: column; min-width: 0; }
.tk-label { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: #78582c; }
html[lang="ar"] .tk-label { letter-spacing: 0; font-size: .85rem; }
.tk-value { font-size: 1.02rem; line-height: 1.35; color: var(--ink); overflow-wrap: anywhere; }
.tk-lantern svg { display: block; width: 40px; height: 52px; animation: float 4s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.tk-bars {
  width: 2.6rem; height: 4.2rem;
  background: repeating-linear-gradient(0deg, #3b1f28 0 2px, transparent 2px 4px, #3b1f28 4px 5px, transparent 5px 8px, #3b1f28 8px 11px, transparent 11px 13px);
  opacity: .75; border-radius: 1px;
}
.tk-wide { grid-column: 1 / -1; }
.tk-name .tk-value { font-size: 1.2rem; font-weight: 600; letter-spacing: .06em; color: var(--wax); font-family: var(--serif); }
.tk-stub .tk-seat { align-items: center; text-align: center; }
.tk-seat .tk-value { font-size: 1.5rem; font-weight: 600; color: var(--wax); font-family: var(--serif); }
.tk-lantern svg { width: 34px; height: 44px; }
.tour { margin-top: .6rem; text-align: center; }
.tour-title { margin: 0 0 1rem; color: var(--paper); font-weight: 400; font-size: clamp(2rem, 8vw, 2.8rem); line-height: 1.3; }
html[lang="ar"] .tour-title { font-weight: 600; line-height: 1.7; }
.tour-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; text-align: start; }
.tour-card { background: var(--paper); color: var(--ink); border-radius: 10px; overflow: hidden; box-shadow: 0 18px 30px -18px rgba(20, 2, 8, .9); }
.tour-art svg { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }
.tour-art img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: #2c0813; }
.tour-credit { margin: -.5rem 1rem .8rem; font-size: .72rem; line-height: 1.3; color: #78582c; direction: ltr; text-align: end; overflow-wrap: anywhere; }
.tour-name { margin: .8rem 1rem .2rem; color: var(--wax); font-size: 1.12rem; line-height: 1.35; }
.tour-text { margin: 0 1rem 1rem; font-size: .98rem; line-height: 1.6; }
.art-rise { animation: rise 9s ease-in-out infinite alternate; }
.art-bob { animation: bob 3.4s ease-in-out infinite alternate; }
@keyframes rise { from { transform: translateY(4px); } to { transform: translateY(-6px); } }
@keyframes bob { from { transform: translateY(0); } to { transform: translateY(2px); } }
@media (max-width: 380px) { .tk-stub { width: 4.4rem; } .tk-head, .tk-route, .tk-grid { padding-inline: .8rem; } }

/* ---------- big countdown ---------- */
.countdown { margin: 2.2rem auto 0; max-width: 30rem; }
.countdown[hidden] { display: none; }
.cd-title { margin: 0 0 .9rem !important; color: var(--gold) !important; font-style: normal !important; font-size: clamp(1.15rem, 4.4vw, 1.4rem); }
.cd-units { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(.4rem, 2vw, .8rem); direction: ltr; }
html[dir="rtl"] .cd-units { direction: rtl; }
.cd-units[hidden] { display: none; }
.cd-unit {
  display: flex; flex-direction: column; align-items: center; padding: .7rem .2rem .6rem;
  background: rgba(251, 242, 230, .08); border: 1px solid rgba(212, 175, 106, .45); border-radius: 14px;
  box-shadow: 0 0 24px -8px rgba(255, 190, 150, .35) inset;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.cd-num { font-family: var(--serif); font-size: clamp(2rem, 10vw, 3.2rem); line-height: 1; color: var(--paper); font-variant-numeric: tabular-nums; text-shadow: 0 0 18px rgba(255, 190, 150, .45); }
.cd-lbl { margin-top: .35rem; font-size: clamp(.75rem, 3vw, .95rem); color: var(--blush); }

/* no-JS: show the letter directly */
html:not(.js) .wish, html:not(.js) .again, html:not(.js) .memories { display: none; }
html:not(.js) .langs { display: none; }

@media (prefers-reduced-motion: reduce) {
  .seal, .flame, .flame-core, .out .smoke, .boxes:not(.chosen) .box, .gift-result, .heart svg, .reason-note.pop, .ow-text, .ticket, .tk-lantern svg, .art-rise, .art-bob, .gift-more, .gift-new { animation: none !important; }
  .heart, .coupon-stamp { transition: none; }
  .ow[open] .ow-seal { transition: none; }
  .box, .box .lid, .box .glow { transition: none; }
  .env-flap, .env-card, .seal, .lit, .sealed .cover, .polaroid { transition: none; }
}
