@font-face {
  font-family: Gift Plex;
  src: url("assets/plex-arabic.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Gift Plex;
  src: url("assets/plex-arabic-semibold.woff2") format("woff2");
  font-weight: 600 700;
  font-display: swap;
}

:root {
  --paper: #fcf5ed;
  --ink: #2d1920;
  --wine: #571d35;
  --rose: #a85f73;
  --gold: #a67d3f;
  --night: #1e0e18;
  --pale-gold: #f3d29b;
  --light-ink: #fff4e7;
  --serif: 'Damascus', 'Geeza Pro', 'Traditional Arabic', 'Gift Plex', serif;
  --sans: 'Gift Plex', 'Segoe UI', Tahoma, sans-serif;
  --hero-art: url("assets/hero.webp");
  --mobile-art: url("assets/hero-mobile.webp");
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); line-height: 1.7; }
button, input { font: inherit; }
a { color: inherit; }
button { cursor: pointer; }
img, svg { max-inline-size: 100%; }
[hidden] { display: none !important; }
[id] { scroll-margin-top: 5.25rem; }
:focus-visible { outline: 2px solid #a45b30; outline-offset: 5px; }
.cinematic :focus-visible { outline-color: #ffe0a7; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; top: 1rem; right: 1rem; z-index: 30; background: var(--paper); color: var(--wine); padding: .65rem 1rem; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: 3.2rem;
  padding: .65rem 1.6rem;
  gap: .55rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--wine);
  color: #fff8ef;
  font: 600 1rem/1.4 var(--sans);
  text-decoration: none;
  transition: transform .24s ease, background-color .24s ease, box-shadow .24s ease;
}
.button:hover { transform: translateY(-2px); box-shadow: 0 7px 18px #2910252a; }
.button-gold {
  color: #3c2226;
  background: linear-gradient(115deg, #ffe5b6, #e2ba78 95%);
  border-color: #ffdea2;
  box-shadow: 0 5px 25px #e5b97626;
}
.button-gold:hover { box-shadow: 0 8px 30px #e5b97650; }

.cinematic { position: relative; isolation: isolate; overflow: clip; background: var(--night); color: var(--light-ink); }
.cinematic-art, .petals { position: absolute; z-index: -1; inset: 0; pointer-events: none; }
.cinematic-art {
  inset: -7px;
  background: linear-gradient(90deg, #190d1600 21%, #1c0e16a3 55%, #210d1999 100%), var(--hero-art) left 58% / cover no-repeat;
  transform: translate(var(--parallax-x, 0), var(--parallax-y, 0));
  transition: transform .85s cubic-bezier(.2,.8,.2,1);
}
.cinematic-art::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 23% 65%, #e9ac6d1c, transparent 54%);
  animation: night-glow 12s ease-in-out infinite alternate;
}
@keyframes night-glow { 0% { opacity: .3; } 100% { opacity: 1; } }

.petals { z-index: 0; overflow: hidden; }
.petals i {
  position: absolute;
  left: var(--x);
  top: -9%;
  opacity: 0;
  animation: petal-float var(--speed) var(--delay) linear infinite;
}
.out-of-view .petals i, .out-of-view .cinematic-art::after { animation-play-state: paused; }
.gold-dust {
  width: 3px;
  height: 3px;
  border-radius: 100%;
  background: #ffdf9f;
  box-shadow: 0 0 9px 2px #edb76188;
  --peak: .72;
}
.rose-petal {
  width: 9px;
  height: 14px;
  border-radius: 75% 45% 67% 48%;
  background: linear-gradient(145deg, #e9a8b4, #8e3859);
  --peak: .56;
}
@keyframes petal-float {
  0% { transform: translate(0, 0) rotate(0); opacity: 0; }
  18%, 78% { opacity: var(--peak); }
  100% { transform: translate(var(--drift), var(--fall, 115svh)) rotate(268deg); opacity: 0; }
}

.intro {
  display: grid;
  align-items: center;
  min-height: 100svh;
  padding: clamp(3.5rem,8vh,6rem) clamp(2rem, 9vw, 10rem);
}
.intro .cinematic-art { background-position: left 63%; }
.intro-frame {
  position: absolute;
  inset: clamp(.8rem, 2.8vw, 2.6rem);
  border: 1px solid #edc89462;
  pointer-events: none;
}
.intro-frame::before, .intro-frame::after {
  content: '✧';
  color: var(--pale-gold);
  position: absolute;
  font-size: 1.45rem;
  line-height: 1;
  padding: .1rem .5rem;
  background: #24131c;
}
.intro-frame::before { top: 0; right: 1.2rem; transform: translateY(-50%); }
.intro-frame::after { bottom: 0; left: 1.2rem; transform: translateY(50%); }
.intro-copy { z-index: 1; position: relative; width: min(52%, 34rem); text-align: center; justify-self: start; }
.intro-envelope {
  position: relative;
  margin: 0 auto 1.7rem;
  width: 136px;
  height: 84px;
  border: 1px solid #eac18f;
  border-radius: 5px;
  background: linear-gradient(144deg, #98526b, #5a2b42 50%, #66334a);
  box-shadow: 0 13px 30px #110910b5, 0 0 33px #e9b36e25;
  perspective: 360px;
  animation: intro-envelope .75s both;
}
.intro-envelope::before, .intro-envelope::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.intro-envelope::before { background: linear-gradient(24deg, transparent 49.35%, #efbe8d 50%, transparent 51%), linear-gradient(-24deg, transparent 49.35%, #efbe8d 50%, transparent 51%); clip-path: polygon(0 27%, 50% 62%, 100% 27%, 100% 100%, 0 100%); }
.intro-envelope::after { background: linear-gradient(165deg,#f5cfa1,#ac6d69); clip-path: polygon(0 0,100% 0,50% 64%); transform-origin: top; transition: transform .55s cubic-bezier(.2,.8,.22,1); }
.intro-envelope span {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  inset: 39% calc(50% - 14px) auto;
  border: 1px solid #e9af9f;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  background: radial-gradient(circle at 35% 26%, #ad586d,#702641);
  color: #fff0d2;
  font-size: 1rem;
  box-shadow: 0 3px 10px #1e0e1870;
  transition: opacity .22s ease, transform .3s ease;
}
.intro-envelope i {
  position: absolute;
  z-index: 1;
  inset: 10px 9px 4px;
  border-radius: 3px;
  border: 1px solid #ffe7b5;
  background: repeating-linear-gradient(0deg, #f0c994 0 1px,#ffebc2 1px 12px);
  opacity: 0;
  transition: transform .52s .18s, opacity .35s .18s;
}
.is-opening .intro-envelope::after { transform: rotateX(167deg); }
.is-opening .intro-envelope span { opacity: 0; transform: scale(.75); }
.is-opening .intro-envelope i { transform: translateY(-48px); opacity: 1; }
.is-opening .intro-copy { animation: opening-copy .84s ease-in both; }
.is-opening .cinematic-art { animation: opening-art .84s ease-in both; }
@keyframes opening-copy { 68% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
@keyframes opening-art { 78% { filter: brightness(1.03); } 100% { filter: brightness(1.85); } }
@keyframes intro-envelope { from { opacity: 0; transform: translateY(8px) rotate(-4deg); } to { opacity: 1; transform: translateY(0) rotate(-4deg); } }
@keyframes line-in { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
.intro .dedication, .intro .intro-line { color: #f6d7c6; margin: .2rem auto; }
.intro .dedication { font-size: 1rem; animation: line-in .64s .2s both; }
.intro .intro-line { font-size: clamp(.94rem, 1.65vw, 1.09rem); animation: line-in .76s .6s both; }
.intro h1 { margin: .2rem 0 .95rem; font: 600 clamp(2.35rem, 5.35vw, 5.5rem)/1.27 var(--serif); color: #fff0df; animation: line-in .85s .97s both; }
.intro #enter-gift { animation: line-in .72s 1.32s both; }
.intro #enter-gift:focus-visible { animation: none; }
.intro-date { margin: .9rem 0 .15rem; color: #edc896; font-size: .92rem; animation: line-in .75s 1.48s both; }
#intro-sound { display: inline-block; border: 0; min-height: 44px; background: none; color: #f0cfbc; padding: .2rem .7rem; font-size: .89rem; text-decoration: underline; text-underline-offset: .2em; animation: line-in .75s 1.55s both; }
#intro-sound:focus-visible { animation: none; }
.noscript { margin: 0; text-align: center; }

.site-header {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .8rem;
  min-block-size: 68px;
  padding: .45rem max(1rem, 4vw);
  z-index: 10;
  background: #fff7eef8;
  border-bottom: 1px solid #ead6c6;
  color: #51243a;
  backdrop-filter: blur(9px);
}
.brand { display: inline-flex; align-items: center; gap: .54rem; flex: none; font-weight: 600; white-space: nowrap; text-decoration: none; }
.brand span { display: grid; place-items: center; width: 2rem; height: 2rem; color: #fff0d4; background: #632942; border: 1px solid #8c4b5e; border-radius: 50%; font-size: 1.04rem; line-height: 1; }
#site-nav { display: flex; align-items: center; gap: clamp(.6rem, 2vw, 1.85rem); }
#site-nav a { white-space: nowrap; padding: .65rem .16rem; color: #5a3642; font-size: .92rem; text-decoration: none; }
#site-nav a:hover { color: #802d4b; text-decoration: underline; text-underline-offset: .3em; }
#mobile-menu { display: none; }
.sound-control { display: flex; align-items: center; gap: .45rem; flex: none; }
#sound-toggle {
  display: flex;
  align-items: center;
  gap: .4rem;
  min-height: 44px;
  border: 1px solid #d5b7a8;
  border-radius: 100px;
  background: #fffaf4;
  color: #632942;
  padding: .25rem .72rem;
  font-size: .88rem;
}
#sound-toggle[aria-pressed=true] { background: #632942; color: #fff2e2; border-color: #632942; }
#sound-toggle > span:first-child { font-size: 1.15rem; }
.volume-control {
  display: flex;
  min-height: 44px;
  align-items: center;
}
#sound-volume { width: clamp(3rem, 6vw, 5.25rem); margin: 0; min-height: 25px; accent-color: #632942; }

.hero {
  --fall: 44rem;
  min-block-size: min(740px, calc(100svh - 68px));
  display: grid;
  align-items: center;
  padding: clamp(4rem, 8vw, 7rem) clamp(2rem, 9vw, 10rem);
}
.hero .cinematic-art { background-image: linear-gradient(90deg, #1c0e1600 17%, #22111a64 44%, #210d19bb 100%), var(--hero-art); }
.hero-copy { width: min(58%, 44rem); text-align: start; position: relative; z-index: 1; }
.hero-crown { color: var(--pale-gold); width: clamp(44px, 7vw, 68px); margin-block-end: .15rem; }
.hero-date { color: var(--pale-gold); font-size: clamp(.92rem, 2vw, 1.08rem); margin: .15rem 0 .85rem; }
.hero h1 { margin: 0; color: #fff2e6; font: 600 clamp(2.6rem, 7vw, 7rem)/1.21 var(--serif); text-wrap: balance; }
.hero h1 span { display: block; }
.hero-message { color: #f3d0ca; margin: .85rem 0 1.55rem; font-size: clamp(1.16rem, 2.7vw, 1.65rem); }
.hero-border { position: absolute; inset: 1.12rem; border: 1px solid #f3ca9654; pointer-events: none; }
.hero-copy { animation: line-in .7s both; }
body[data-flash] .hero .cinematic-art::after { animation: night-glow .9s ease-in-out alternate 2; }

.countdown {
  text-align: center;
  padding: clamp(3.8rem, 8vw, 6.6rem) 1.2rem;
  background: radial-gradient(ellipse at center 5%, #f5e1d3 0, transparent 57%), var(--paper);
  border-bottom: 1px solid #e8d5c9;
}
.countdown-decoration { display: flex; align-items: center; justify-content: center; gap: .6rem; color: #936537; }
.countdown-decoration span { width: 3.4rem; height: 1px; background: linear-gradient(90deg,transparent,#a77b49,transparent); }
.countdown-kicker { color: #764731; font-size: .94rem; margin: .25rem 0 .3rem; }
.countdown h2 {
  font: 600 clamp(1.85rem, 4vw, 3.45rem)/1.45 var(--serif);
  color: var(--wine);
  margin: 0 auto;
  max-inline-size: 46rem;
  text-wrap: balance;
}
.countdown-description { color: #624151; }
#countdown-description:empty { display: none; }
.countdown-grid { display: grid; grid-template-columns: repeat(4, 1fr); max-width: 34rem; margin: 1.65rem auto 0; gap: .7rem; }
.countdown-grid > div {
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: 6.45rem;
  padding: .45rem .1rem;
  border-radius: .8rem;
  border: 1px solid #e3c7b4;
  background: #fff9f1;
  box-shadow: 0 8px 24px #75385a0c;
}
.countdown-grid span { font-size: clamp(1.6rem, 5vw, 2.65rem); font-weight: 600; color: var(--wine); font-variant-numeric: tabular-nums; line-height: 1.25; }
.countdown-grid small { color: #74504f; font-size: .9rem; }
.countdown[data-phase=birthday] { background: radial-gradient(ellipse at top,#f5d5c4, var(--paper) 72%); }
#celebration { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 25; pointer-events: none; }

@media (max-width: 880px) {
  #site-nav { display: none; }
  #mobile-menu { display: block; position: relative; }
  #mobile-menu summary {
    display: grid;
    place-items: center;
    min-height: 44px;
    cursor: pointer;
    padding: 0 .54rem;
    font-size: .9rem;
    list-style: none;
  }
  #mobile-menu summary::-webkit-details-marker { display: none; }
  #mobile-menu[open] summary { text-decoration: underline; text-underline-offset: .25em; }
  #mobile-nav {
    display: grid;
    position: absolute;
    inset-block-start: calc(100% + .45rem);
    inset-inline-start: 50%;
    translate: 50% 0;
    min-width: 10rem;
    padding: .35rem;
    border-radius: .85rem;
    background: #fff7ed;
    border: 1px solid #e4ccba;
    box-shadow: 0 7px 22px #43193224;
  }
  #mobile-nav a { min-height: 44px; padding: .53rem .65rem; border-radius: .5rem; text-decoration: none; white-space: nowrap; }
  #mobile-nav a:hover { background: #f6e5db; }
  .intro { padding-inline: clamp(2rem, 6vw, 5rem); }
}
@media (max-width: 680px) {
  [id] { scroll-margin-top: 4.2rem; }
  .site-header { min-block-size: 58px; gap: .28rem; padding-inline: .75rem; }
  .brand { gap: .32rem; font-size: .9rem; }
  .brand span { width: 1.65rem; height: 1.65rem; }
  #sound-toggle { justify-content: center; min-width: 44px; padding-inline: .54rem; }
  #sound-toggle[aria-pressed=true] .sound-label { display: none; }
  .intro, .hero {
    padding: clamp(17rem, 46svh, 24rem) 1.85rem 3.1rem;
    justify-items: center;
    align-items: end;
  }
  .intro { min-height: 100svh; padding-top: clamp(14.75rem, 40svh, 22.5rem); padding-bottom: max(2.45rem, env(safe-area-inset-bottom)); }
  .hero { min-height: min(720px, calc(100svh - 58px)); padding-block-start: clamp(14rem, 37svh, 20rem); }
  .intro .cinematic-art, .hero .cinematic-art {
    inset: 0;
    background: linear-gradient(180deg, #1e0e1805 13%, #1e0e180d 29%, #1e0e18e8 52%, #1e0e18 77%), var(--mobile-art) center top / 100% auto no-repeat;
  }
  .intro-copy, .hero-copy { width: 100%; text-align: center; }
  .intro-envelope { width: 105px; height: 65px; margin-block-end: .9rem; }
  .intro-envelope span { width: 23px; height: 23px; inset-inline: calc(50% - 11.5px); font-size: .8rem; }
  .intro .intro-line { max-width: 29ch; }
  .intro h1 { margin-top: .35rem; }
  .hero-crown { margin-inline: auto; }
  .hero h1 { font-size: clamp(2.55rem, 8.6vw, 4rem); }
  .hero-border { inset: .67rem; }
  .countdown-grid { gap: .4rem; }
  .countdown-grid > div { min-height: 5.3rem; }
}
@media (max-width: 365px) {
  .sound-label { display: none; }
  .sound-control { gap: .24rem; }
  .intro, .hero { padding-inline: 1.25rem; }
  .intro h1 { font-size: 2.15rem; }
  .hero h1 { font-size: 2.3rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cinematic *, .cinematic *::before, .cinematic *::after, .cinematic-art::after { animation: none !important; transition: none !important; }
  .petals i { display: none; }
  .button { transition: none; }
}
