@font-face {
  font-family: Vazirmatn;
  src: url('/assets/vazirmatn-arabic-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Vazirmatn;
  src: url('/assets/vazirmatn-arabic-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: Naskh;
  src: url('/assets/noto-naskh.woff2') format('woff2');
  font-display: swap;
}
:root {
  color-scheme: light;
  --paper: #f8eee7;
  --cream: #fff8f1;
  --ink: #341c2c;
  --muted: #715465;
  --berry: #791f42;
  --plum: #351329;
  --rose: #edc3c8;
  --line: #dec9cc;
  --display: Naskh, Georgia, serif;
  scrollbar-color: #9a5c75 var(--paper);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at top right, #f1dce0, transparent 48rem), var(--paper);
  color: var(--ink);
  font: 400 1rem/1.85 Vazirmatn, Tahoma, sans-serif;
}
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
h1, h2 { font-family: var(--display); font-weight: 400; line-height: 1.23; }
button, input { font: inherit; }
a { color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .72; }
:focus-visible { outline: 3px solid #9c4b69; outline-offset: 4px; }

.top, .shell { width: min(1150px, calc(100% - 64px)); margin-inline: auto; }
.top {
  min-height: 89px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 12px;
}
.wordmark { text-decoration: none; font-weight: 700; }
.wordmark span { display: inline-block; margin-inline-end: .45em; color: var(--berry); }
.top-note { color: var(--muted); font-size: .82rem; }
.gate, .celebration {
  display: grid;
  grid-template-columns: 47fr 53fr;
  grid-template-areas: "text photo";
  overflow: hidden;
  border-radius: 28px;
  box-shadow: 0 24px 62px #41162c1a;
}
.gate { min-height: 600px; background: var(--cream); }
.cover, .celebration-photo {
  grid-area: photo;
  background: #38162d url('/assets/envelope.webp') center 48% / cover no-repeat;
}
.gate-content, .celebration-text {
  grid-area: text;
  align-self: center;
  padding: 48px clamp(28px, 5.2vw, 76px);
}
.ornament {
  display: grid;
  place-items: center;
  color: var(--berry);
  border: 1px solid var(--line);
  font-size: 1.45rem;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  margin-block-end: 23px;
}
.eyebrow { color: var(--berry); font-size: .85rem; font-weight: 700; }
.gate h1 { margin-block: 8px 12px; font-size: clamp(2.75rem, 4.35vw, 3.65rem); text-wrap: balance; }
.intro { color: var(--muted); max-width: 37ch; }
#unlock-form { margin-block-start: 24px; }
#unlock-form label { display: block; margin-block-end: 6px; font-size: .88rem; font-weight: 700; }
input {
  width: 100%;
  min-height: 53px;
  padding: .55rem .95rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: #fffcf8;
}
input::placeholder { color: #806879; }
input[aria-invalid="true"] { border-color: var(--berry); }
.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1em;
  min-height: 50px;
  padding: .66rem 1.3rem;
  border: 1px solid transparent;
  border-radius: 11px;
  background: var(--berry);
  color: white;
  font-weight: 700;
  text-decoration: none;
  transition: background .2s, transform .2s;
}
.primary:hover { background: #5f1532; }
.primary:active, .card:active { transform: scale(.98); }
#unlock-form .primary { width: 100%; margin-block-start: 10px; }
.hint, .feedback { font-size: .79rem; }
.hint { margin-block-start: 10px; color: var(--muted); }
.hint span { color: var(--berry); margin-inline: .25rem; }
.feedback { min-height: 1.7em; color: var(--berry); font-weight: 700; }
.footer { padding: 23px 15px 28px; text-align: center; color: var(--muted); font-size: .81rem; }
.footer span { margin-inline-end: .3em; color: var(--berry); }

.celebration { min-height: 530px; background: var(--plum); color: var(--cream); }
.celebration-photo { background-position: center 49%; }
.celebration-text .eyebrow { color: var(--rose); }
.celebration h1 { margin-block: 14px; font-size: clamp(3rem, 6.6vw, 5.8rem); }
.celebration h1 em { color: var(--rose); font-style: normal; }
.celebration h1:focus { outline: none; }
.celebration-text p:not(.eyebrow) { color: #f5dce1; max-width: 40ch; }
.celebration .primary { margin-block-start: 21px; color: var(--plum); background: var(--rose); }
.celebration .primary:hover { background: #fae2e4; }
.surprises { padding-block: 65px 31px; text-align: center; scroll-margin-block-start: 12px; }
.surprises h2 { margin-block: 9px 28px; font-size: clamp(2.1rem, 5vw, 3.3rem); }
.surprises .eyebrow span { margin-inline: .28rem; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.card {
  display: grid;
  text-align: start;
  position: relative;
  padding: 21px;
  min-height: 168px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--cream);
  color: var(--muted);
  transition: border-color .2s, background .2s, transform .2s;
}
.card-notes { background: #f6e2e5; }
.card-wish { background: #f4e5dc; }
.card:hover { border-color: var(--berry); background: #fcf0e9; }
.card strong { display: block; color: var(--ink); font-size: 1.08rem; }
.card-icon {
  display: grid;
  place-items: center;
  color: var(--berry);
  font-family: system-ui, sans-serif;
  font-size: 1.42rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  margin-block-end: 7px;
}
.card-arrow { position: absolute; inset-block-start: 23px; inset-inline-end: 21px; color: var(--berry); }
.signature { margin-block: 44px 15px; color: var(--berry); }
.quiet {
  min-height: 44px;
  border: 0;
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.quiet:hover { background: #efdde0; color: var(--berry); }

dialog {
  width: min(535px, calc(100% - 28px));
  max-height: calc(100% - 28px);
  max-height: calc(100dvh - 28px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 23px;
  color: var(--ink);
  background: var(--cream);
  box-shadow: 0 24px 90px #240e22a1;
  overscroll-behavior: contain;
}
dialog::backdrop { background: #291224b5; }
body:has(dialog[open]) { overflow: hidden; }
.dialog-card { position: relative; padding: 46px clamp(23px, 6vw, 47px) 35px; }
.dialog-card h2 { margin-block: 6px 14px; font-size: clamp(2rem, 7vw, 3rem); }
.dialog-card p + p { margin-block-start: 13px; }
.close {
  position: absolute;
  inset-block-start: 10px;
  inset-inline-end: 10px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fffaf5;
  color: var(--berry);
  font: 1.55rem/1 system-ui, sans-serif;
}
.close:hover { background: #f2dde2; }
.signed { color: var(--berry); }
.note-paper, .wish-paper { text-align: center; background: radial-gradient(ellipse at top, #f9e1e4, transparent 70%); }
.dialog-icon { color: var(--berry); font: 3.4rem/1.15 system-ui, sans-serif; }
.note-text { min-height: 3.7em; font-size: 1.10rem; }
.note-count { color: var(--muted); font-size: .85rem; }
.dialog-card .primary { margin-block-start: 15px; }
#wish-message { min-height: 3.7em; }

.cake { position: relative; margin: 1px auto 15px; width: 158px; height: 122px; }
.cake span { position: absolute; display: block; inset-inline: 0; margin-inline: auto; }
.plate { bottom: 1px; width: 156px; height: 9px; border-radius: 50%; background: #d9a6b2; }
.tier { bottom: 7px; width: 120px; height: 44px; border-radius: 0 0 11px 11px; color: var(--berry); line-height: 50px; background: #eab0b9; border-block-end: 5px solid #cc8296; }
.frosting { bottom: 44px; z-index: 1; width: 123px; height: 12px; border-radius: 12px 12px 48% 48%; background: #fff0e0; }
.candle { bottom: 53px; width: 13px; height: 34px; border-radius: 4px 4px 0 0; background: repeating-linear-gradient(140deg, #a84364 0 4px, #f5d7da 4px 9px); }
.wick { bottom: 86px; width: 2px; height: 6px; background: var(--plum); }
.flame { bottom: 91px; width: 17px; height: 24px; border-radius: 55% 55% 53% 53%; background: radial-gradient(ellipse at bottom, #fff7be 15%, #ffc25d 58%, #c75b44); box-shadow: 0 0 20px #e9865999; transform-origin: bottom; animation: flicker 1.3s infinite alternate ease-in-out; }
.is-out .flame { visibility: hidden; }
@keyframes flicker { to { transform: rotate(8deg) scale(.88, 1.08); } }

.confetti { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.petal {
  position: absolute;
  top: -1em;
  left: var(--x);
  color: var(--petal);
  font: var(--size)/1 system-ui, sans-serif;
  animation: fall var(--time) var(--delay) ease-in both;
}
@keyframes fall {
  to { transform: translate(var(--drift), 105vh) rotate(var(--turn)); opacity: .55; }
}

@media (max-width: 760px) {
  .top, .shell { width: calc(100% - 32px); }
  .top { min-height: 63px; }
  .gate, .celebration { grid-template-columns: 1fr; grid-template-areas: "photo" "text"; min-height: 0; border-radius: 22px; }
  .cover, .celebration-photo { min-height: clamp(205px, 53vw, 355px); }
  .gate-content, .celebration-text { padding: 25px 23px 23px; }
  .ornament { display: none; }
  .gate h1 { margin-block: 5px 8px; }
  #unlock-form { margin-block-start: 16px; }
  .celebration h1 { margin-block: 7px 9px; }
  .surprises { padding-block: 44px 20px; }
  .cards { grid-template-columns: 1fr; gap: 9px; }
  .card { min-height: 92px; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 13px; align-content: center; padding: 12px 15px 12px 43px; }
  .card-icon { grid-row: span 2; align-self: center; margin: 0; }
  .card-arrow { inset-block-start: 30px; inset-inline-end: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  :root { scrollbar-color: auto; }
  .primary, .card, .close { border: 1px solid ButtonText; }
}
