/* Hamza & Tahia — one invitation, three celebrations.
   A draped stage that re-dresses itself for each event: blush & sage for the Holud,
   burgundy velvet and crystal for the Reception, ivory sheers and fairy lights for the Walima. */
:root {
  --paper: #f3ece0;
  --ink: #6b5432;
  --script: #8a6636;
  --accent: #a4844f;
  --rose: #c06b82;
  --leaf: #8f9a6a;
  --script-font: 'Great Vibes', 'Pinyon Script', cursive;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --caps: 'Marcellus', 'Cormorant Garamond', serif;
  --arabic: 'Aref Ruqaa', 'Amiri', serif;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--paper); scroll-snap-type: y mandatory; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--serif); font-size: 18px; line-height: 1.5; overflow-x: hidden; -webkit-font-smoothing: antialiased; font-variant-numeric: lining-nums; }
body.locked { overflow: hidden; height: 100svh; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
p { margin: 0; }

/* section palettes (taken from the three printed cards) */
.t-intro     { --ink: #6b5432; --script: #8a6636; --accent: #a4844f; --glow: 243,236,224; }
.t-holud     { --ink: #5f6342; --script: #b07035; --accent: #b0566e; --rose: #cf7f93; --leaf: #97a274; --glow: 245,238,226; }
.t-reception { --ink: #7a3a2a; --script: #741722; --accent: #8e6a3c; --glow: 240,228,210; }
.t-walima    { --ink: #5d5a3c; --script: #5a5832; --accent: #a68a52; --glow: 240,234,220; }

.caps { font-family: var(--caps); font-size: 12px; letter-spacing: .26em; text-transform: uppercase; color: var(--ink); line-height: 1.9; }
.caps.small { font-size: 11px; }
.caps.wide { letter-spacing: .2em; }

/* ---------- gate ---------- */
.gate { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 16svh 28px max(8svh, 30px); text-align: center; transition: opacity 1.3s cubic-bezier(.33,0,.2,1), transform 1.6s cubic-bezier(.16,1,.3,1), visibility 0s 1.3s; }
.gate.gone { opacity: 0; visibility: hidden; transform: scale(1.04); }
.seal { width: 92px; height: 92px; border-radius: 50%; display: flex; align-items: center; justify-content: center; gap: 2px; margin-bottom: 10px; position: relative;
  background: radial-gradient(circle at 35% 30%, #f6e3b0, #d4ad62 45%, #a57b36 80%, #8a6426);
  box-shadow: 0 10px 24px rgba(110,80,30,.28), inset 0 0 0 5px rgba(255,240,200,.25), inset 0 0 0 7px rgba(120,85,30,.35), inset 0 -6px 12px rgba(90,60,20,.35); }
.seal span { font-family: var(--script-font); font-size: 40px; line-height: 1; color: #fff7e2; text-shadow: 0 1px 0 rgba(110,75,25,.6); }
.seal i { font-family: var(--serif); font-style: italic; font-size: 18px; color: #fff3d4; margin-top: 8px; }
.gate .caps { color: #7b6036; }
.gate-names { margin: 0; font-family: var(--script-font); font-weight: 400; font-size: clamp(54px, min(15vw, 9.3svh), 92px); line-height: 1.05; color: #7d5a2c; }
.gate-names span { font-family: var(--serif); font-style: italic; font-size: .55em; color: #b0566e; padding: 0 .1em; }
.gate-date { font-family: var(--caps); font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: #7b6036; }
.cta { margin-top: 22px; min-height: 54px; padding: 0 34px; border: 1px solid #a4844f; background: rgba(250,245,235,.6); color: #6b4d22; cursor: pointer;
  font: 400 12px var(--caps); letter-spacing: .3em; text-transform: uppercase; position: relative; overflow: hidden; box-shadow: 0 0 0 4px rgba(250,245,235,.5), 0 0 0 5px rgba(164,132,79,.45); }
.cta::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,250,235,.85) 50%, transparent 70%); transform: translateX(-100%); animation: glint 3.4s ease-in-out infinite; }
@keyframes glint { 60%, 100% { transform: translateX(100%); } }
.cta:active { transform: scale(.97); }
.cta:focus-visible, .links a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.hint { font-size: 14px; font-style: italic; color: #8b7754; }

/* ---------- stops ---------- */
main { position: relative; z-index: 2; padding-inline: max(20px, env(safe-area-inset-left)) max(20px, env(safe-area-inset-right)); }
.stop { scroll-snap-align: start; scroll-snap-stop: always; min-height: 100svh; display: flex; align-items: center; justify-content: center; padding: 15svh 0 5svh; }
.card { position: relative; width: 100%; max-width: 360px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px;
  opacity: 0; transform: translateY(18px) scale(.985); transition: opacity 1.1s cubic-bezier(.33,0,.2,1), transform 1.6s cubic-bezier(.16,1,.3,1); will-change: transform, opacity; }
.in .card { opacity: 1; transform: none; }
.in .card > * { animation: up 1.5s cubic-bezier(.16,1,.3,1) both; }
.in .card > *:nth-child(2) { animation-delay: .08s; } .in .card > *:nth-child(3) { animation-delay: .16s; } .in .card > *:nth-child(4) { animation-delay: .24s; }
.in .card > *:nth-child(5) { animation-delay: .32s; } .in .card > *:nth-child(6) { animation-delay: .4s; } .in .card > *:nth-child(7) { animation-delay: .48s; }
.in .card > *:nth-child(8) { animation-delay: .56s; } .in .card > *:nth-child(n+9) { animation-delay: .64s; }
@keyframes up { from { opacity: 0; transform: translateY(10px); } }

.arabic { font-family: var(--arabic); font-size: 26px; line-height: 1.6; color: var(--script); }
.arabic.dua { font-size: 20px; max-width: 300px; }
.names { margin: 0; font-family: var(--script-font); font-weight: 400; font-size: clamp(46px, min(13vw, 8.06svh), 64px); line-height: 1.15; color: var(--script); white-space: nowrap; }
.names span { font-family: var(--script-font); font-size: .78em; color: var(--accent); padding: 0 .16em; }
.t-holud .names span { color: var(--accent); }
.names.big { font-size: clamp(66px, min(20vw, 12.4svh), 96px); line-height: .98; display: flex; flex-direction: column; align-items: center; margin: 4px 0; }
.names.big span { font-size: .5em; line-height: 1; padding: 2px 0; }
.names.closing { font-size: clamp(40px, min(12vw, 7.44svh), 54px); }
.lede { font-size: 18px; line-height: 1.45; color: var(--ink); }
.lede.it { font-style: italic; }
.orn { width: 48px; height: 14px; color: var(--accent); overflow: visible; }
.orn, .bloom { display: block; }
.orn { width: 200px; background: linear-gradient(90deg, transparent, currentColor 20%, currentColor 32%, transparent 33%, transparent 67%, currentColor 68%, currentColor 80%, transparent) center / 100% 1px no-repeat; opacity: .9; }
.bloom { width: 200px; height: 20px; background: linear-gradient(90deg, transparent, var(--accent) 15%, var(--accent) 32%, transparent 33%, transparent 67%, var(--accent) 68%, var(--accent) 85%, transparent) center / 100% 1px no-repeat; }

.cue { margin-top: 8px; font-family: var(--caps); font-size: 10px; letter-spacing: .3em; text-transform: uppercase; color: var(--accent); animation: bob 2.4s ease-in-out infinite; }
.cue::after { content: ''; display: block; width: 1px; height: 26px; margin: 8px auto 0; background: linear-gradient(var(--accent), transparent); }
@keyframes bob { 50% { transform: translateY(4px); } }

/* the date block, as on the printed cards */
.date { display: grid; justify-items: center; gap: 2px; }
.dow, .yr { font-family: var(--caps); font-size: 15px; letter-spacing: .3em; text-transform: uppercase; color: var(--accent); }
.yr { font-size: 13px; }
.t-holud .dow, .t-holud .yr { color: var(--accent); }
.t-reception .dow, .t-reception .yr, .t-walima .dow, .t-walima .yr { color: var(--ink); }
.dline { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; width: min(320px, min(82vw, 50.84svh)); }
.dline span { font-family: var(--caps); font-size: 13px; letter-spacing: .2em; text-transform: uppercase; padding: 8px 0; border-top: 1px solid currentColor; border-bottom: 1px solid currentColor; border-color: rgba(164,132,79,.55); color: var(--ink); }
.t-holud .dline span { color: var(--accent); }
.dline b { font-family: var(--serif); font-weight: 500; font-size: 56px; line-height: 1; color: var(--ink); padding: 0 4px; }
.t-reception .dline b { color: #6e2c1c; }
.t-walima .dline b { font-weight: 400; border-left: 1px solid rgba(166,138,82,.6); border-right: 1px solid rgba(166,138,82,.6); padding: 0 14px; }

.venue { font-family: var(--caps); font-size: 18px; letter-spacing: .12em; text-transform: uppercase; line-height: 1.35; color: var(--ink); }
.venue.soft { font-family: var(--serif); font-size: 24px; letter-spacing: .02em; text-transform: none; font-weight: 500; }
.addr { font-size: 17px; line-height: 1.35; color: var(--ink); }
.addr.caps { font-size: 13px; }
.attire { display: grid; gap: 1px; margin-top: 4px; }
.attire .caps { color: var(--accent); font-size: 13px; }
.attire p:not(.caps) { font-style: italic; font-size: 16px; line-height: 1.35; color: var(--accent); }
.links { display: flex; gap: 22px; justify-content: center; margin-top: 6px; }
.links a { font-family: var(--caps); font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--ink); text-decoration: none; padding: 10px 0 6px; border-bottom: 1px solid var(--accent); min-height: 44px; display: inline-flex; align-items: flex-end; }
.links a:active { opacity: .6; }

.count { display: grid; grid-template-columns: repeat(4, 1fr); width: min(330px, min(86vw, 53.32svh)); margin: 6px 0 4px; border-top: 1px solid rgba(164,132,79,.5); border-bottom: 1px solid rgba(164,132,79,.5); }
.count div { padding: 12px 0 8px; display: grid; } .count div + div { border-left: 1px solid rgba(164,132,79,.35); }
.count b { font-family: var(--serif); font-weight: 500; font-size: clamp(32px, min(9vw, 5.58svh), 42px); line-height: 1; color: var(--ink); }
.count span { font-family: var(--caps); font-size: 9px; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); margin-top: 4px; }
.translation { font-size: 15px; font-style: italic; color: var(--accent); line-height: 1.45; }
.end { padding-bottom: calc(12svh + env(safe-area-inset-bottom)); }

.music { position: fixed; right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); z-index: 50; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(164,132,79,.7); background: rgba(246,240,229,.82); display: flex; align-items: flex-end; justify-content: center; gap: 3px; padding-bottom: 13px; cursor: pointer; backdrop-filter: blur(6px); }
.music i { width: 2px; height: 15px; background: #8a6636; animation: bar .9s ease-in-out infinite alternate; transform-origin: bottom; }
.music i:nth-child(2) { animation-delay: .3s; } .music i:nth-child(3) { animation-delay: .6s; }
.music.off i { animation: none; transform: scaleY(.3); }
@keyframes bar { from { transform: scaleY(.3); } to { transform: scaleY(1); } }

@media (min-width: 700px) { .card { max-width: 440px; } .stop { padding-top: 12svh; } }
@media (max-height: 700px) { .card { gap: 7px; } .names { font-size: 42px; } .dline b { font-size: 46px; } .stop { padding-top: 12svh; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01s !important; animation-iteration-count: 1 !important; transition-duration: .01s !important; } }
.no3d #scene { display: none; }
.music[hidden] { display: none; }
.card > * { max-width: 100%; }
.settle .in .card > *, .settle .cue { animation: none !important; }

/* soft white glow hugging the letters themselves (no boxes) */
:root { --halo: 0 0 2px rgba(255,253,248,.95), 0 0 6px rgba(255,251,242,.95), 0 0 12px rgba(255,249,238,.85), 0 0 22px rgba(255,247,234,.6); }
.card, .gate { text-shadow: var(--halo); }
.names, .gate-names, .dline b, .count b { text-shadow: 0 0 3px rgba(255,253,248,.95), 0 0 9px rgba(255,251,242,.9), 0 0 18px rgba(255,249,238,.75), 0 0 32px rgba(255,247,234,.5); }
.card svg, .dline span, .count, .links a, .cue::after { filter: drop-shadow(0 0 3px rgba(255,251,242,.95)) drop-shadow(0 0 8px rgba(255,249,238,.7)); }

/* phones fill the screen; on wider screens the card stays a tall phone-shaped column on an ivory page */
:root { --col: min(100vw, 62svh); }
body { max-width: var(--col); margin: 0 auto; }
#scene, .gate { left: 0; right: 0; margin: 0 auto; width: var(--col); }
.music { right: max(14px, env(safe-area-inset-right), calc((100vw - var(--col)) / 2 + 14px)); }
@media (min-aspect-ratio: 2/3) { #scene { box-shadow: 0 0 60px rgba(90,65,30,.12); } }

/* link-preview capture (#og): spread the opening screen across a wide frame */
.og { --col: 100vw; }

/* the parents' names under each of the couple's names */
.names .parents { display: block; margin: 4px 0 6px; font: italic 500 clamp(15px, min(4.2vw, 2.6svh), 18px) / 1.3 var(--serif); letter-spacing: .01em; color: var(--ink); white-space: normal; }
.names.big { font-size: clamp(56px, min(16vw, 9.9svh), 84px); }
