/* Every size is in "s" units: 1s = 1% of the width of the phone-shaped frame
   (set by JS from the real frame size). So the layout looks identical on every
   phone and laptop — it simply scales. Long lines auto-shrink (see fitText in main.js). */
:root {
  --gold1: #f3d58c; --gold2: #c99a3e; --gold3: #fff0c4;
  --ink: #fff8ec; --soft: rgba(255, 244, 226, .86);
  --serif: "Cormorant Garamond", Georgia, serif;
  --script: "Pinyon Script", cursive;
  --caps: "Cinzel", serif;
  --dev: "Tiro Devanagari Hindi", serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --s: 3.9px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: radial-gradient(ellipse at 50% 40%, #1d1230 0%, #05060f 70%) fixed #05060f; color: var(--ink); overflow: hidden; }
body { font-family: var(--serif); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body.hi { font-family: var(--dev); }
button, a { font: inherit; color: inherit; }
button { cursor: pointer; }
p, h1, h2 { overflow-wrap: break-word; }

/* phone-shaped frame; on wide screens it sits in the middle with a soft glow */
#app {
  position: relative; height: 100%; width: 100%;
  max-width: calc(100vh * 9 / 16); margin: 0 auto; overflow: hidden;
  background: #070a1f; box-shadow: 0 0 120px rgba(255, 190, 120, .12);
  font-size: calc(var(--s) * 4.4);
}
@supports (height: 100dvh) { #app { max-width: calc(100dvh * 9 / 16); } html, body { height: 100dvh; } }
#stage, #fx { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
video.clip { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0;
  transition: opacity 1.4s ease, transform 9s ease-out; transform: scale(1); pointer-events: none; }
video.clip.on { opacity: 1; }
video.clip.hold { transform: scale(1.06); }
#fx { pointer-events: none; }

.gold {
  background: linear-gradient(100deg, #b98a2e 0%, #f6dc95 28%, #c4933a 52%, #fff0c0 70%, #b98a2e 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 6s linear infinite;
}
@keyframes shine { to { background-position: -200% 0; } }
.fit { white-space: nowrap; display: block; max-width: 100%; }

/* ---------------- title ---------------- */
#title {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: calc(var(--s) * 16) calc(var(--s) * 12) calc(var(--s) * 10);
  transition: opacity 1.2s ease; opacity: 0; pointer-events: none;
}
#title.show { opacity: 1; pointer-events: auto; }
#title .arch {
  position: absolute; left: 6%; right: 6%; top: calc(var(--s) * 6 + var(--safe-t)); bottom: calc(var(--s) * 5);
  border: 1.5px solid rgba(230, 190, 110, .55); border-radius: calc(var(--s) * 44) calc(var(--s) * 44) calc(var(--s) * 5) calc(var(--s) * 5);
  box-shadow: inset 0 0 0 calc(var(--s) * 2) rgba(0,0,0,0), inset 0 0 0 calc(var(--s) * 2.2) rgba(230, 190, 110, .2);
  pointer-events: none;
}
#title > *:not(.arch) { position: relative; width: 100%; }
.bism { font-family: "Amiri", serif; font-size: calc(var(--s) * 6); margin: 0 0 calc(var(--s) * 2); display: none; }
.bism.on { display: block; }
.kicker { font-family: var(--caps); letter-spacing: .3em; font-size: calc(var(--s) * 3.4); color: var(--gold1); margin: 0 0 calc(var(--s) * 3); text-transform: uppercase; }
body.hi .kicker { font-family: var(--dev); letter-spacing: .04em; font-size: calc(var(--s) * 4.6); }
.hosts { font-size: calc(var(--s) * 4.3); font-weight: 600; margin: 0 0 calc(var(--s) * 2); color: var(--soft);
  opacity: 0; transition: opacity 1s ease; }
.hosts.show { opacity: 1; }
.names { margin: 0; font-weight: 400; line-height: 1; display: flex; flex-direction: column; align-items: center; }
.names > .nm { font-family: var(--script); font-size: calc(var(--s) * 15); padding: calc(var(--s) * .6) calc(var(--s) * 2) calc(var(--s) * 2.6); }
body.hi .names > .nm { font-family: "Amita", serif; font-size: calc(var(--s) * 12); padding: calc(var(--s) * 1.5) calc(var(--s) * 2); }
.weds { display: flex; align-items: center; justify-content: center; gap: calc(var(--s) * 3); margin: calc(var(--s) * -1.5) 0 calc(var(--s) * -.5); }
.weds b { font-family: var(--script); font-weight: 400; font-size: calc(var(--s) * 9); color: var(--gold1); }
body.hi .weds b { font-family: "Amita", serif; font-size: calc(var(--s) * 7); }
.weds i { width: calc(var(--s) * 14); height: 1px; background: linear-gradient(90deg, transparent, var(--gold2), transparent); }
.dates { font-family: var(--caps); letter-spacing: .12em; font-size: calc(var(--s) * 4.2); color: var(--gold3); margin: calc(var(--s) * 4) 0 0; }
body.hi .dates { font-family: var(--dev); letter-spacing: 0; font-size: calc(var(--s) * 4.8); }
.guest { margin: calc(var(--s) * 4) auto 0; font-size: calc(var(--s) * 4.2); font-weight: 600; padding: calc(var(--s) * 2) calc(var(--s) * 4.5);
  border-radius: 99px; border: 1px solid rgba(240, 200, 120, .55); background: rgba(255, 220, 160, .07); width: auto !important; max-width: 100%; }
.guest:empty { display: none; }
#langPick { margin-top: calc(var(--s) * 7); transition: opacity .6s; }
#langPick p { margin: 0 0 calc(var(--s) * 3); font-size: calc(var(--s) * 4.4); color: var(--soft); }
#langPick .hint { margin: calc(var(--s) * 3) 0 0; font-size: calc(var(--s) * 3.6); opacity: .8; }
.langs { display: flex; gap: calc(var(--s) * 2.5); justify-content: center; }
.langs button {
  flex: 1 1 0; max-width: calc(var(--s) * 27); padding: calc(var(--s) * 3.4) calc(var(--s) * 1); font-size: calc(var(--s) * 4.8); font-weight: 700;
  border-radius: calc(var(--s) * 3.5); white-space: nowrap;
  border: 1px solid rgba(243, 213, 140, .75); background: linear-gradient(180deg, rgba(255, 226, 170, .2), rgba(255, 200, 120, .06));
  box-shadow: 0 0 calc(var(--s) * 6) rgba(255, 200, 120, .18); color: #fff3da; animation: pulse 2.4s ease-in-out infinite;
}
.langs button:nth-child(2) { font-family: var(--dev); animation-delay: .3s; }
.langs button:nth-child(3) { animation-delay: .6s; }
.langs button:active { transform: scale(.96); }
@keyframes pulse { 50% { box-shadow: 0 0 calc(var(--s) * 9) rgba(255, 200, 120, .42); } }
body.started #langPick { opacity: 0; pointer-events: none; }

/* ---------------- top bar ---------------- */
#top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 4; display: flex; gap: calc(var(--s) * 2); align-items: center;
  padding: calc(var(--safe-t) + var(--s) * 3) calc(var(--s) * 3) 0; opacity: 0; pointer-events: none; transition: opacity .8s;
}
body.started #top { opacity: 1; pointer-events: auto; }
.seg { display: flex; flex: 0 0 auto; background: rgba(10, 8, 20, .5); border: 1px solid rgba(255, 220, 160, .35); border-radius: 99px; padding: calc(var(--s) * .8); backdrop-filter: blur(6px); }
.seg button { border: 0; background: none; padding: calc(var(--s) * 1.8) calc(var(--s) * 2.8); font-size: calc(var(--s) * 3.6); font-weight: 700; border-radius: 99px; color: var(--soft); white-space: nowrap; }
.seg button.on { background: linear-gradient(180deg, #f3d58c, #c99a3e); color: #2a1a08; }
.pill { display: inline-flex; align-items: center; gap: calc(var(--s) * 1.5); padding: calc(var(--s) * 2) calc(var(--s) * 3.5); border-radius: 99px; text-decoration: none;
  font-size: calc(var(--s) * 3.7); font-weight: 700; white-space: nowrap;
  background: rgba(20, 12, 24, .58); border: 1px solid rgba(255, 220, 160, .5); backdrop-filter: blur(6px); }
.pill.ghost { margin-left: auto; font-size: calc(var(--s) * 3.4); padding: calc(var(--s) * 1.9) calc(var(--s) * 3); }
.round { flex: 0 0 auto; width: calc(var(--s) * 10); height: calc(var(--s) * 10); border-radius: 50%; border: 1px solid rgba(255, 220, 160, .45);
  background: rgba(10, 8, 20, .5); font-size: calc(var(--s) * 4.4); padding: 0; }

/* ---------------- event title card ---------------- */
#evt {
  position: absolute; left: 0; right: 0; top: calc(var(--safe-t) + var(--s) * 15); text-align: center; padding: calc(var(--s) * 2) calc(var(--s) * 7) calc(var(--s) * 6);
  background: radial-gradient(ellipse at 50% 35%, rgba(8, 6, 18, .66), rgba(8, 6, 18, 0) 72%);
  opacity: 0; transform: translateY(calc(var(--s) * -2)); transition: opacity 1s ease, transform 1s ease, background 1s; pointer-events: none;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .75);
}
#evt.show { opacity: 1; transform: none; pointer-events: auto; }
#evt h2 { margin: 0; font-family: var(--script); font-weight: 400; font-size: calc(var(--s) * 17); line-height: 1.1; }
body.hi #evt h2 { font-family: "Amita", serif; font-size: calc(var(--s) * 12.5); }
#evt p { margin: calc(var(--s) * .6) 0; }
#eDate { font-family: var(--caps); letter-spacing: .06em; font-size: calc(var(--s) * 4.6); color: var(--gold3); }
body.hi #eDate { font-family: var(--dev); letter-spacing: 0; }
#eTime { font-size: calc(var(--s) * 5.4); font-weight: 700; }
#eVenue { font-size: calc(var(--s) * 6); font-weight: 700; color: #ffe7b8; }
#evt p:empty { display: none; }
#evt p, #evt h2 { transition: all .9s ease; max-height: 3em; overflow: hidden; }
#evt.compact { background: none; }
#evt.compact p { max-height: 0; opacity: 0; margin: 0; }
#evt.compact h2 { font-size: calc(var(--s) * 12); }
body.hi #evt.compact h2 { font-size: calc(var(--s) * 9); }
#evt .row { display: flex; gap: calc(var(--s) * 2.5); justify-content: center; margin-top: calc(var(--s) * 2.5); }

/* ---------------- subtitles + controls ---------------- */
#bottom {
  position: absolute; left: 0; right: 0; bottom: 0; padding: calc(var(--s) * 16) calc(var(--s) * 6) calc(var(--safe-b) + var(--s) * 3.5);
  background: linear-gradient(0deg, rgba(5, 4, 12, .85) 0%, rgba(5, 4, 12, .6) 55%, rgba(5, 4, 12, 0) 100%);
  opacity: 0; pointer-events: none; transition: opacity .8s;
}
body.started #bottom { opacity: 1; pointer-events: auto; }
#subs {
  height: calc(var(--s) * 23); margin: 0 0 calc(var(--s) * 3); display: flex; align-items: flex-end; justify-content: center;
  text-align: center; font-size: calc(var(--s) * 5.6); line-height: 1.32; font-weight: 600;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .9); transition: opacity .35s;
}
body.hi #subs { font-size: calc(var(--s) * 5.4); line-height: 1.5; font-weight: 400; }
#subs.fade { opacity: 0; }
#ctrl { display: flex; align-items: center; justify-content: space-between; gap: calc(var(--s) * 3); }
#ctrl button { width: calc(var(--s) * 14); height: calc(var(--s) * 11.5); border-radius: 99px; border: 1px solid rgba(255, 220, 160, .45);
  background: rgba(20, 12, 24, .55); font-size: calc(var(--s) * 7); line-height: 1; padding: 0; }
#ctrl button:disabled { opacity: .3; }
#dots { display: flex; gap: calc(var(--s) * 1.8); align-items: center; }
#dots i { width: calc(var(--s) * 2); height: calc(var(--s) * 2); border-radius: 50%; background: rgba(255, 240, 210, .3); transition: all .4s; }
#dots i.on { background: var(--gold1); width: calc(var(--s) * 5.5); border-radius: 99px; }
#dots i.done { background: rgba(243, 213, 140, .65); }

/* ---------------- cards ---------------- */
#cards {
  position: absolute; inset: 0; z-index: 3; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: radial-gradient(ellipse at 50% 0%, rgba(40, 20, 40, .55), rgba(5, 5, 14, .88) 60%);
  backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity 1s;
}
#cards.show { opacity: 1; pointer-events: auto; }
#cards .wrap { padding: calc(var(--safe-t) + var(--s) * 17) 0 calc(var(--safe-b) + var(--s) * 7); text-align: center; }
#cards h2 { margin: 0 calc(var(--s) * 4); font-family: var(--script); font-weight: 400; font-size: calc(var(--s) * 12); line-height: 1.2; color: var(--gold1); }
body.hi #cards h2 { font-family: "Amita", serif; font-size: calc(var(--s) * 9); }
.hint { color: var(--soft); font-size: calc(var(--s) * 3.8); margin: calc(var(--s) * 1) calc(var(--s) * 5) calc(var(--s) * 3); }
.hint.small { font-size: calc(var(--s) * 3.3); opacity: .85; }
#rail { display: flex; gap: calc(var(--s) * 3.5); overflow-x: auto; scroll-snap-type: x mandatory; padding: calc(var(--s) * 1.5) 14% calc(var(--s) * 2.5); scrollbar-width: none; }
#rail::-webkit-scrollbar { display: none; }
#rail figure { margin: 0; flex: 0 0 72%; scroll-snap-align: center; position: relative; }
#rail img, #rail .ph { width: 100%; aspect-ratio: 9 / 16; border-radius: calc(var(--s) * 3.5); display: block;
  box-shadow: 0 calc(var(--s) * 4) calc(var(--s) * 12) rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 220, 160, .25); background: #f3ece0; }
#rail .ph { display: grid; place-items: center; color: #6b5a4a; font-size: calc(var(--s) * 3.8); }
#rail figcaption { margin-top: calc(var(--s) * 2); font-weight: 700; font-size: calc(var(--s) * 4.4); color: var(--gold3); }
#cdots { display: flex; gap: calc(var(--s) * 1.8); justify-content: center; margin: calc(var(--s) * 1) 0 calc(var(--s) * 3); }
#cdots i { width: calc(var(--s) * 2); height: calc(var(--s) * 2); border-radius: 50%; background: rgba(255, 240, 210, .3); }
#cdots i.on { background: var(--gold1); }
.row { display: flex; gap: calc(var(--s) * 2.5); justify-content: center; padding: 0 calc(var(--s) * 4); }
.wrapb { flex-wrap: wrap; margin: calc(var(--s) * 3.5) 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: calc(var(--s) * 2); min-height: calc(var(--s) * 12.5); padding: 0 calc(var(--s) * 5);
  border-radius: calc(var(--s) * 3.5); font-size: calc(var(--s) * 4.5); font-weight: 700; white-space: nowrap;
  text-decoration: none; border: 1px solid rgba(255, 220, 160, .55); background: rgba(30, 18, 30, .6); }
.btn.gold { background: linear-gradient(180deg, #f6dc95, #c99a3e); color: #2a1a08; border: 0; box-shadow: 0 calc(var(--s) * 1.5) calc(var(--s) * 6) rgba(240, 190, 100, .35); }
.btn.wa { background: #1fa855; border: 0; color: #fff; }
.btn.ghost { background: none; }
#count { margin: calc(var(--s) * 4.5) calc(var(--s) * 4) calc(var(--s) * 1); font-size: calc(var(--s) * 4); color: var(--soft); }
#count span { display: block; margin-bottom: calc(var(--s) * 1); }
#count b { display: inline-block; min-width: 2ch; font-variant-numeric: tabular-nums; font-family: var(--caps); font-size: calc(var(--s) * 6.5); color: var(--gold1); margin: 0 calc(var(--s) * .5) 0 calc(var(--s) * 2); }
#contacts { margin: calc(var(--s) * 1.5) calc(var(--s) * 4); font-size: calc(var(--s) * 4); }
#contacts a { color: var(--gold1); font-weight: 700; display: inline-block; margin: calc(var(--s) * 1) calc(var(--s) * 2); }

#loading { position: absolute; inset: 0; display: grid; place-items: center; background: #070a1f; transition: opacity .8s; z-index: 5; }
#loading i { width: calc(var(--s) * 11); height: calc(var(--s) * 11); border-radius: 50%; border: 2px solid rgba(243, 213, 140, .25); border-top-color: var(--gold1); animation: spin 1s linear infinite; }
#loading.gone { opacity: 0; pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }
