/* Walima of Shaamil & Hasna — ivory paper, olive greenery, soft gold */
:root {
  --paper: #F6F1E7;
  --card: rgba(255, 253, 248, .55);
  --ink: #3F3A31;
  --muted: #7A7264;
  --olive: #626C4C;
  --olive-d: #4E573C;
  --sage: #8E9C7E;
  --gold: #B39660;
  --gold-l: #D9C9A3;
  --gold-d: #8C7240;
  --serif: "Cormorant Garamond", Georgia, serif;
  --caps: "Cormorant SC", "Cormorant Garamond", Georgia, serif;
  --script: "Pinyon Script", cursive;
  --arabic: "Amiri", serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { overflow-x: clip; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--serif); font-size: 19px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
body.gate-locked { overflow: hidden; height: 100svh; }
img { max-width: 100%; }
a { color: inherit; }
p { margin: 0; }
h2 { margin: 6px 0 26px; font-family: var(--serif); font-weight: 300; font-size: clamp(27px, 7.4vw, 40px); letter-spacing: .1em; text-wrap: balance; text-transform: uppercase; line-height: 1.15; }

/* the cotton-paper page everything sits on */
.paper-bg { position: fixed; inset: 0; z-index: -1; background: url(media/paper.jpg) center / cover; opacity: .85; }

/* ================= OPENING: THE ENVELOPE ================= */
#gate { position: fixed; inset: 0; z-index: 60; overflow: hidden; perspective: 1800px; }
#gate.is-hidden { display: none; }
.env-inside { position: absolute; inset: 0; background: #EFE8D8; transition: opacity .7s ease; }
.env-inside::after { content: ""; position: absolute; inset: 0; background: url(media/paper.jpg) center / cover; opacity: .55; }
.fw { position: absolute; inset: 0; filter: drop-shadow(0 0 5px rgba(90,70,40,.2)); transition: transform .95s cubic-bezier(.6,0,.25,1); }
.flap { position: absolute; inset: 0; background-position: center; background-size: 100% 100%, cover; }
.flap-l { clip-path: polygon(0 0, 50.6% 50%, 0 100%); background-image: linear-gradient(90deg, rgba(255,255,255,.1) 10%, rgba(150,120,70,.16) 100%), url(media/paper.jpg); }
.flap-r { clip-path: polygon(100% 0, 49.4% 50%, 100% 100%); background-image: linear-gradient(270deg, rgba(255,255,255,.1) 10%, rgba(150,120,70,.16) 100%), url(media/paper.jpg); }
.flap-b { clip-path: polygon(0 100%, 50% 50%, 100% 100%); background-image: linear-gradient(0deg, rgba(255,255,255,.3) 20%, rgba(150,120,70,.1) 100%), url(media/paper.jpg); }
.flap-t-wrap { position: absolute; inset: 0; transform-origin: 50% 0; filter: drop-shadow(0 5px 7px rgba(90,70,40,.26)); transition: transform 1s cubic-bezier(.5,0,.25,1) .15s, opacity .4s ease .75s; }
.flap-t { clip-path: polygon(0 0, 100% 0, 50% 50%); background-image: linear-gradient(180deg, rgba(255,255,255,.35), rgba(150,120,70,.08)), url(media/paper.jpg); }
.seal { position: absolute; left: 50%; top: 50%; z-index: 3; width: clamp(118px, 34vmin, 172px); aspect-ratio: 400 / 416; padding: 0; border: 0; background: none; cursor: pointer;
  transform: translate(-50%, -50%); filter: drop-shadow(0 6px 10px rgba(80,60,30,.28)); transition: transform .6s ease, opacity .5s ease; -webkit-tap-highlight-color: transparent; }
.seal img { display: block; width: 100%; height: 100%; animation: breathe 3s ease-in-out infinite; }
@keyframes breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.035); } }
.seal:focus-visible { outline: 1px solid var(--gold); outline-offset: 8px; border-radius: 50%; }
.g-bism { position: absolute; left: 0; right: 0; top: 13%; z-index: 3; text-align: center; font-family: var(--arabic); font-size: 26px; color: var(--gold-d); opacity: .85; transition: opacity .5s; }
.env-to { position: absolute; left: 0; right: 0; top: 70%; display: flex; flex-direction: column; align-items: center; text-align: center; line-height: 1.1; }
.to-lbl { font-family: var(--caps); font-size: 13px; letter-spacing: .32em; color: var(--muted); }
.to-name { margin-top: 6px; padding: 0 18px; font-family: var(--script); font-size: clamp(30px, 8.5vw, 42px); color: var(--olive-d); }
.g-hint { position: absolute; left: 0; right: 0; bottom: calc(5% + env(safe-area-inset-bottom)); z-index: 3; text-align: center; font-family: var(--caps); font-size: 13px; letter-spacing: .34em; color: var(--ink); animation: hint 2.6s ease-in-out infinite; }
@keyframes hint { 0%,100% { opacity: .55; } 50% { opacity: 1; } }

/* the opening: seal lifts, top flap folds up, then the envelope parts */
#gate.is-open .seal { transform: translate(-50%, -50%) scale(1.12); opacity: 0; pointer-events: none; }
#gate.is-open .seal img { animation: none; }
#gate.is-open .g-bism, #gate.is-open .g-hint { opacity: 0; animation: none; }
#gate.is-open .flap-t-wrap { transform: rotateX(180deg); }
#gate.is-out .flap-t-wrap { opacity: 0; }
#gate.is-out .fw-l { transform: translateX(-104%); }
#gate.is-out .fw-r { transform: translateX(104%); }
#gate.is-out .fw-b { transform: translateY(104%); }
#gate.is-out .env-inside { opacity: 0; }

/* ================= MUSIC ================= */
.music { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 40; width: 46px; height: 46px; border-radius: 50%; border: 0; padding: 12px;
  background: rgba(98,108,76,.9); color: #F6F1E7; box-shadow: 0 6px 16px rgba(60,50,30,.18); cursor: pointer; transition: opacity .6s, transform .3s; }
.music svg { width: 100%; height: 100%; display: block; }
.music.is-off { opacity: .75; }
body.gate-locked .music { opacity: 0; pointer-events: none; }

/* ================= THE WELCOME ================= */
.hero { position: relative; height: 100svh; min-height: 600px; overflow: hidden; }
.garland { position: absolute; top: 0; left: 50%; width: max(660px, 104vw); max-width: none; height: auto; transform: translate(-50%, -100%); transform-origin: 50% 0; will-change: transform; transition: transform 1.8s cubic-bezier(.2,.7,.2,1); }
body.arrived .garland { transform: translate(-50%, 0); }
body.settled .garland { transition: none; animation: sway 9s ease-in-out infinite; }
@keyframes sway { 0%,100% { rotate: 0deg; } 50% { rotate: .5deg; } }

.chandelier { position: absolute; left: 50%; top: 0; width: clamp(120px, 15svh, 170px); height: calc(8svh + clamp(120px, 15svh, 170px) * 1.293); transform: translate(-50%, -110%); transform-origin: 50% 0; transition: transform 2s cubic-bezier(.2,.7,.2,1) .25s; }
.chandelier .chain { position: absolute; left: 50%; top: 0; height: 8.5svh; width: 1px; background: linear-gradient(var(--gold-l), var(--gold)); }
.chandelier img { position: absolute; left: 0; bottom: 0; width: 100%; height: auto; }
body.arrived .chandelier { transform: translate(-50%, 0); }
body.settled .chandelier { transition: none; animation: swing 6s ease-in-out infinite; }
@keyframes swing { 0%,100% { rotate: -1.2deg; } 50% { rotate: 1.2deg; } }

.h-text { position: absolute; left: 6%; right: 6%; top: calc(8svh + clamp(120px, 15svh, 170px) * 1.293 + 2svh); text-align: center; will-change: transform, opacity; }
.h-text > * { opacity: 0; transform: translateY(16px); transition: opacity 1.2s ease, transform 1.2s ease; }
body.arrived .h-text > * { opacity: 1; transform: none; }
body.arrived .h-text > :nth-child(1) { transition-delay: .7s; }
body.arrived .h-text > :nth-child(2) { transition-delay: 1s; }
body.arrived .h-text > :nth-child(3) { transition-delay: 1.3s; }
body.arrived .h-text > :nth-child(4) { transition-delay: 1.7s; }
.h-bism { font-family: var(--arabic); font-size: clamp(19px, 2.8svh, 24px); color: var(--gold-d); line-height: 1.6; }
.h-eye { margin-top: 4px; font-family: var(--caps); font-size: clamp(12px, 1.8svh, 15px); letter-spacing: .2em; color: var(--muted); line-height: 1.7; }
.h-names { margin: 1.4svh 0 1.2svh; font-weight: 300; font-size: clamp(38px, 6.2svh, 64px); line-height: 1.02; letter-spacing: .16em; text-transform: uppercase; color: var(--ink); }
.h-names span { display: block; padding-left: .16em; }
.h-names em { display: block; margin: .02em 0 .08em; font-family: var(--script); font-style: normal; text-transform: none; letter-spacing: 0; font-size: .95em; line-height: .9; color: var(--gold-d); }
.h-date { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: nowrap; font-family: var(--caps); font-size: clamp(12px, 1.8svh, 15px); letter-spacing: .22em; color: var(--ink); white-space: nowrap; }
.h-date i { width: 4px; height: 4px; border-radius: 50%; background: var(--gold); flex: none; }

.table-art { position: absolute; left: 50%; bottom: -1svh; width: min(150vw, 82svh); max-width: none; height: auto; transform: translate(-50%, 70%); opacity: 0; transition: transform 2s cubic-bezier(.2,.7,.2,1) .5s, opacity 1.4s ease .5s; will-change: transform; }
body.arrived .table-art { transform: translate(-50%, 0); opacity: 1; }
body.settled .table-art { transition: none; }
.scroll-cue { position: absolute; left: 50%; bottom: 10px; width: 1px; height: 0; opacity: 0; }

/* ================= SECTIONS ================= */
main { position: relative; }
.sec { padding: 72px 22px; text-align: center; }
.sec > div { max-width: 520px; margin: 0 auto; }
.lbl { font-family: var(--caps); font-size: 13px; letter-spacing: .3em; color: var(--gold-d); }
.sm { font-size: 18px; color: var(--muted); line-height: 1.6; }
[data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity 1.2s ease, transform 1.2s cubic-bezier(.2,.7,.2,1); }
[data-reveal].in-view { opacity: 1; transform: none; }

/* the invitation card */
.card { position: relative; padding: 46px 24px 44px; background: var(--card); border: 1px solid var(--gold-l); box-shadow: inset 0 0 0 6px rgba(246,241,231,.9), inset 0 0 0 7px rgba(179,150,96,.35), 0 20px 50px rgba(90,70,40,.08); }
.card > * + * { margin-top: 10px; }
.calli { font-family: var(--arabic); font-size: 28px; color: var(--gold-d); line-height: 1.7; }
.hosts { margin-top: 22px !important; font-size: 23px; font-weight: 500; letter-spacing: .04em; }
.guest { margin: 14px auto 16px !important; max-width: 92%; padding: 0 8px 6px; border-bottom: 1px dotted var(--gold); font-family: var(--script); font-size: clamp(30px, 9vw, 40px); line-height: 1.25; color: var(--olive-d); overflow-wrap: anywhere; }
.person { margin-top: 14px !important; font-weight: 300; font-size: clamp(25px, 7vw, 31px); letter-spacing: .15em; text-transform: uppercase; line-height: 1.2; }
.with { font-style: italic; color: var(--gold-d); font-size: 20px; }
.rule { display: flex; align-items: center; gap: 10px; margin: 22px auto 14px !important; max-width: 220px; }
.rule i { flex: 1; height: 1px; background: var(--gold-l); }
.rule svg { width: 40px; height: 16px; fill: none; stroke: var(--gold); stroke-width: 1.2; }
.datebar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; margin-top: 8px !important; }
.datebar span { padding: 6px 0; border-top: 1px solid var(--gold-l); border-bottom: 1px solid var(--gold-l); font-family: var(--caps); font-size: 14px; letter-spacing: .24em; }
.datebar b { font-weight: 300; font-size: 58px; line-height: 1; }
.year { font-family: var(--caps); font-size: 15px; letter-spacing: .5em; padding-left: .5em; }

/* verse */
.verse { margin: 18px 0 16px; font-family: var(--arabic); font-size: clamp(23px, 6.4vw, 28px); line-height: 2; color: var(--olive-d); }
.verse-en { font-style: italic; font-size: 20px; color: var(--muted); }

/* thin framed box (countdown, table) */
.box { position: relative; padding: 40px 18px 38px; border: 1px solid var(--gold-l); background: var(--card); }
.box::before { content: ""; position: absolute; inset: 6px; border: 1px solid rgba(179,150,96,.28); pointer-events: none; }
.box h2 { margin-bottom: 22px; }
.cd { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.cd strong { display: block; font-weight: 300; font-size: clamp(34px, 10vw, 46px); line-height: 1.1; font-variant-numeric: tabular-nums; }
.cd span { font-family: var(--caps); font-size: 11.5px; letter-spacing: .22em; color: var(--muted); }
.box-sprig { position: absolute; right: -54px; bottom: -42px; width: 230px; max-width: none; transform: rotate(180deg) scaleX(-1); opacity: .9; pointer-events: none; -webkit-mask: linear-gradient(90deg, transparent, #000 30%); mask: linear-gradient(90deg, transparent, #000 30%); }
#countdown { overflow: hidden; padding-bottom: 96px; }

/* the evening: an olive arch */
.arch { position: relative; padding: 86px 28px 46px; color: #F6F1E7; background: linear-gradient(180deg, #6B7553, #59633F); border-radius: 400px 400px 14px 14px; box-shadow: 0 24px 50px rgba(78,87,60,.22); }
.arch::before { content: ""; position: absolute; inset: 9px; border: 1px solid rgba(246,241,231,.38); border-radius: 400px 400px 8px 8px; pointer-events: none; }
.arch .lbl { color: var(--gold-l); }
.a-day { margin-top: 18px; font-family: var(--caps); font-size: 15px; letter-spacing: .34em; }
.a-date { font-weight: 300; font-size: clamp(30px, 8.6vw, 38px); letter-spacing: .06em; line-height: 1.2; }
.a-rule { width: 60px; height: 1px; margin: 24px auto; background: var(--gold-l); }
.a-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.a-list b { display: block; font-family: var(--caps); font-weight: 400; font-size: 13px; letter-spacing: .28em; color: var(--gold-l); }
.a-list span { font-size: 19px; }

/* venue */
.map { margin: 0 auto 22px; aspect-ratio: 4 / 3.3; border-radius: 14px; overflow: hidden; border: 1px solid var(--gold-l); box-shadow: 0 14px 30px rgba(90,70,40,.1); background: #EAE4D6; }
.map iframe { width: 100%; height: 100%; border: 0; display: block; }
.v-name { font-weight: 400; font-size: 26px; letter-spacing: .14em; text-transform: uppercase; }
.v-addr { margin-top: 4px; color: var(--muted); font-size: 18px; }
.btns { display: grid; gap: 10px; max-width: 320px; margin: 24px auto 0; }
.btns .cal { display: grid; gap: 10px; }
.btns .btn, .btns .cal > * { width: 100%; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 24px; border: 1px solid var(--olive); border-radius: 2px; background: transparent; color: var(--olive-d);
  font-family: var(--caps); font-size: 14px; letter-spacing: .24em; text-decoration: none; cursor: pointer; transition: background .3s, color .3s; }
.btn:hover { background: rgba(98,108,76,.08); }
.btn svg { width: 15px; height: 15px; }
.btn-solid { background: var(--olive); color: #F6F1E7; border-color: var(--olive); }
.btn-solid:hover { background: var(--olive-d); }
.btn-block { width: 100%; margin-top: 8px; }

/* reply */
.dear { margin: -8px 0 26px; font-family: var(--script); font-size: 34px; color: var(--olive-d); }
form { text-align: left; }
.field { margin-bottom: 22px; }
.field label, .flbl { display: block; margin-bottom: 8px; font-family: var(--caps); font-size: 13px; letter-spacing: .22em; color: var(--muted); }
.field label em { font-family: var(--serif); letter-spacing: .02em; font-size: 15px; }
.field input[type=text], .field textarea { width: 100%; padding: 8px 2px; border: 0; border-bottom: 1px solid var(--gold-l); border-radius: 0; background: transparent; font: inherit; font-size: 21px; color: var(--ink); outline: none; }
.field textarea { border: 1px solid var(--gold-l); padding: 10px 12px; resize: vertical; background: rgba(255,253,248,.4); }
.field input:focus, .field textarea:focus { border-color: var(--olive); }
.known { font-family: var(--script); font-size: 32px; color: var(--olive-d); }
.attend { display: grid; gap: 10px; margin: 4px 0 26px; }
.attend input, .seg input { position: absolute; opacity: 0; pointer-events: none; }
.attend label { display: block; padding: 16px 18px; border: 1px solid var(--gold-l); background: rgba(255,253,248,.4); cursor: pointer; transition: background .3s, border-color .3s, color .3s; }
.attend label b { display: block; font-weight: 500; font-size: 20px; }
.attend label small { font-style: italic; font-size: 16px; color: var(--muted); }
.attend input:checked + label { background: var(--olive); border-color: var(--olive); color: #F6F1E7; }
.attend input:checked + label small { color: var(--gold-l); }
.attend input:focus-visible + label { outline: 1px solid var(--olive); outline-offset: 3px; }
.if-yes { transition: opacity .4s; }
.if-yes.is-off { opacity: .35; pointer-events: none; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stepper { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--gold-l); padding: 4px; background: rgba(255,253,248,.4); }
.st { width: 40px; height: 40px; border: 0; background: none; font-size: 22px; color: var(--olive-d); cursor: pointer; }
.stepper input { width: 40px; border: 0; background: none; text-align: center; font: inherit; font-size: 22px; color: var(--ink); -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--gold-l); }
.seg label { padding: 12px 4px; text-align: center; font-family: var(--caps); font-size: 14px; letter-spacing: .16em; cursor: pointer; transition: background .3s, color .3s; }
.seg label + input + label { border-left: 1px solid var(--gold-l); }
.seg input:checked + label { background: var(--olive); color: #F6F1E7; }
.thanks { display: none; padding: 12px 0; }
.thanks.is-visible { display: block; }
.ty-ar { font-family: var(--arabic); font-size: 30px; color: var(--gold-d); }
.thanks h3 { margin: 8px 0; font-weight: 400; font-size: 26px; }
.thanks p:last-child { color: var(--muted); }
.ask { margin-top: 30px; font-size: 17px; color: var(--muted); }
.ask a { color: var(--olive-d); }

/* table + photos */
.sec-small { padding-top: 20px; }
.seat-no { font-weight: 300; font-size: 54px; line-height: 1.1; }
.seat-find { display: flex; gap: 8px; margin-top: 14px; }
.seat-find[hidden] { display: none; }
.seat-result { display: none; }
#guestUpload { display: none; }
#album .btn { margin-top: 22px; }
.upload-preview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 16px; }
.upload-preview img { width: 100%; aspect-ratio: 1; object-fit: cover; }

/* footer */
.foot { position: relative; padding: 40px 22px 0; text-align: center; overflow: hidden; }
.foot > div { max-width: 520px; margin: 0 auto; }
.f-dua { font-family: var(--arabic); font-size: clamp(20px, 5.6vw, 26px); line-height: 1.9; color: var(--gold-d); text-wrap: balance; }
.f-en { margin-top: 6px; font-style: italic; color: var(--muted); }
.f-names { margin-top: 26px; font-weight: 300; font-size: clamp(24px, 7vw, 36px); letter-spacing: .12em; white-space: nowrap; text-transform: uppercase; }
.f-names em { font-size: 1.1em; font-family: var(--script); font-style: normal; text-transform: none; letter-spacing: 0; color: var(--gold); }
.f-date { margin-top: 4px; font-family: var(--caps); letter-spacing: .4em; font-size: 14px; color: var(--muted); }
.made { margin-top: 26px; font-size: 14px; color: var(--muted); }
.made a { color: var(--olive-d); }
.foot-garland { display: block; width: max(660px, 104vw); max-width: none; margin: 18px 0 0 50%; transform: translateX(-50%) scaleY(-1); }

/* ================= LARGER SCREENS ================= */
@media (min-width: 720px) {
  .sec { padding: 96px 24px; }
  .card { padding: 58px 48px 54px; }
  .arch { padding: 110px 48px 56px; }
}
@media (min-aspect-ratio: 4/3) {
  /* wide screens: only the lower ends of the greenery show, the names sit on one line */
  .garland { width: 100vw; top: calc(36svh - 35.2vw); }
  .h-text { left: 50%; right: auto; width: 760px; margin-left: -380px; top: 39svh; }
  .h-names span, .h-names em { display: inline; }
  .h-names em { margin: 0 .25em; font-size: .9em; vertical-align: -.05em; }
  .table-art { width: min(92vw, 74svh); }
}

/* ---------- the printed card's extra lines (Hasna & Shaamil) ---------- */
.parents { font-size: 17px; color: var(--muted); font-style: italic; }
.month { margin-top: 4px !important; font-family: var(--caps); font-size: 17px; letter-spacing: .5em; padding-left: .5em; }
.datebar b sup { font-size: .32em; vertical-align: super; margin-left: 2px; }
.venue-c { margin-top: 6px !important; font-family: var(--caps); font-size: clamp(19px, 5.4vw, 23px); letter-spacing: .1em; color: var(--olive-d); line-height: 1.35; }
.calli-sm { margin-top: 22px !important; font-size: clamp(16px, 4.6vw, 22px); white-space: nowrap; }
.blessing { font-style: italic; font-size: 16px; }
.card-foot { display: flex; justify-content: space-between; gap: 16px; margin-top: 26px !important; padding-top: 16px; border-top: 1px solid var(--gold-l); text-align: left; }
.card-foot p { font-family: var(--caps); font-size: 13px; letter-spacing: .1em; line-height: 1.7; color: var(--muted); }
.card-foot .rsvp-c { text-align: right; }
.card-foot a { color: var(--olive-d); text-decoration: none; }
.one .stepper { max-width: 220px; }
@media (max-width: 380px) { .card-foot { flex-direction: column; text-align: center; } .card-foot .rsvp-c { text-align: center; } }