:root {
  color-scheme: dark;
  --night: #211e19;
  --white: #fffaf1;
  --muted: #e9dfd0;
  --gold: #f0d7ad;
  --edge: rgb(246 222 186 / .46);
  --panel: rgb(34 28 23 / .80);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
  --script: "Great Vibes", "Brush Script MT", cursive;
  --shell: 430px;
  --corner-bottom: calc(13px + env(safe-area-inset-bottom));
  --creator-height: 44px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--night); scroll-behavior: smooth; }
html.gate-closed, html.lightbox-open { overflow: hidden; overscroll-behavior: none; }
body {
  margin: 0;
  color: var(--white);
  font: 400 1rem/1.6 var(--sans);
  background: var(--night);
  -webkit-font-smoothing: antialiased;
}
body::before {
  position: fixed;
  inset: 0;
  content: "";
  background: linear-gradient(135deg, #211e19bd, #171511d9), url("assets/cover-pasangan.webp") center 43% / cover;
  filter: blur(13px);
  transform: scale(1.06);
  pointer-events: none;
}
.site-shell {
  position: relative;
  width: min(100%, var(--shell));
  margin-inline: auto;
  background: var(--night);
  box-shadow: 0 0 80px #0b090785;
}
img { display: block; max-width: 100%; }
p, h1, h2, h3 { margin: 0; }
h1, h2, h3 { font: 600 1em/1 var(--serif); text-wrap: balance; }
h2 { font-size: clamp(2.4rem, 11vw, 3.15rem); }
h3 { font-size: 2.65rem; }
a, button, input, textarea { -webkit-tap-highlight-color: transparent; }
button, input, textarea { font: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

.scene {
  position: relative;
  display: grid;
  min-width: 0;
  isolation: isolate;
  overflow: clip;
  background: #3d332b;
  border-bottom: 1px solid rgb(236 210 172 / .23);
}
.scene-media, .scene::before {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.scene-media {
  z-index: -2;
  object-fit: cover;
  object-position: center var(--position, 50%);
}
.scene::before {
  z-index: -1;
  content: "";
  background: var(--shade, linear-gradient(180deg, #20181080, #261d16db));
}
.scene-content {
  width: 100%;
  padding: 64px clamp(18px, 6vw, 27px);
  text-align: center;
}
.scene-content > p:not(.eyebrow, .guest, .cover-date, .signature, .form-status),
.scene-content > div:not([class]) > p,
.scene-content > .reveal > p {
  max-width: 31ch;
  margin: 13px auto 0;
  color: var(--muted);
  text-wrap: pretty;
}
.eyebrow {
  color: var(--gold);
  font-size: .8rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 9px 16px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  font: 700 .84rem/1.25 var(--sans);
  transition: background-color .2s ease, color .2s ease;
}
.button-primary { background: var(--gold); color: #241c14; }
.button-primary:hover { background: #ffebcd; }
.button-outline { color: var(--white); border-color: var(--edge); background: #221a15b5; }
.button-outline:hover { background: #574438; }
.button:disabled { opacity: .68; cursor: wait; }

.cover {
  min-height: 100svh;
  align-items: end;
  --shade: linear-gradient(180deg, #16110e24 0%, #1b130e12 24%, #1b130e89 53%, #19130fe8 89%);
}
.gate-closed .cover { height: 100svh; overflow: auto; }
.cover-slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, center); opacity: 0; transition: opacity 1.5s ease; }
.cover-slide.current { opacity: 1; }
.cover-frame {
  position: absolute;
  z-index: 1;
  inset: 13px;
  border: 1px solid var(--edge);
  pointer-events: none;
}
.cover-content { padding: 42px 23px max(38px, calc(env(safe-area-inset-bottom) + 21px)); }
.cover h1 {
  display: grid;
  justify-items: center;
  margin: 14px 0 8px;
  font: 500 clamp(2.1rem, 12vw, 3.6rem)/1.02 var(--serif);
  text-shadow: 0 2px 24px #100b08c9;
}
.cover-name { white-space: nowrap; }
.cover-amp {
  margin-block: .04em;
  font: 500 .67em/1 var(--serif);
  color: var(--gold);
}
.cover-date { color: var(--white); font-size: .94rem; }
.guest { margin: 22px auto 14px; font-size: .82rem; color: var(--muted); }
.guest span, .guest strong { display: block; }
.guest strong { color: var(--white); font-size: 1rem; overflow-wrap: anywhere; }
.cover .button { min-width: min(205px, 100%); }
.cover-content > * { animation: arrive .8s both; }
.cover-content > :nth-child(2) { animation-delay: .12s; }
.cover-content > :nth-child(3) { animation-delay: .24s; }
.cover-content > :nth-child(4) { animation-delay: .36s; }
.cover-content > :nth-child(5) { animation-delay: .46s; }

.welcome {
  min-height: 490px;
  align-items: end;
  --position: 55%;
  --shade: linear-gradient(180deg, #2018101a 20%, #23181138 43%, #211812f0 95%);
}
.welcome-copy { padding-block: 55px 56px; }
.portrait {
  min-height: clamp(490px, 80svh, 630px);
  align-items: end;
  --shade: linear-gradient(180deg, #271b1408 25%, #26191226 45%, #201710ed 88%);
}
.groom { --position: 63%; }
.bride { --position: 38%; }
.portrait-copy { padding-block: 35px 48px; }
.portrait h2 {
  margin: 7px auto 0;
  font-size: clamp(1.5rem, 7vw, 1.94rem);
  line-height: 1.12;
  text-wrap: wrap;
}
.portrait h2 span { white-space: nowrap; }
.groom h2 { font-size: clamp(1.5rem, 6.5vw, 1.75rem); }
.portrait p:last-child { font-size: .94rem; }

.date-scene {
  --position: 65%;
  --shade: linear-gradient(180deg, #21170e24, #21171096 60%, #211810dc);
  min-height: 450px;
  align-items: end;
  padding: 38px 22px;
}
.date-frame {
  border: 1px solid var(--edge);
  border-radius: 150px 150px 5px 5px;
  padding: 38px 16px 25px;
  background: #201810b8;
}
.date-frame h2 { margin: 9px 0 14px; font-size: clamp(2.65rem, 11vw, 3.5rem); }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 auto 21px; max-width: 300px; }
.countdown > div + div { border-left: 1px solid var(--edge); }
.countdown strong, .countdown span { display: block; }
.countdown strong { font: 600 1.9rem/1.1 var(--serif); font-variant-numeric: tabular-nums; }
.countdown span { font-size: .79rem; color: var(--muted); }

.schedule { --position: 73%; --shade: linear-gradient(180deg, #201610ab, #21170ed8); }
.event-card {
  width: 100%;
  margin: 18px 0 0;
  border: 1px solid var(--edge);
  border-radius: 5px;
  padding: 23px 16px 18px;
  background: var(--panel);
}
.event-card:first-of-type { margin-top: 29px; }
.event-card h3 { margin: 6px 0; }
.event-time { font-weight: 700; }
.event-address { margin: 8px auto 0; max-width: 33ch; font-size: .88rem; color: var(--muted); }
.event-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.event-actions .button { padding-inline: 12px; }

.photo-band {
  height: clamp(350px, 110vw, 470px);
  --position: 48%;
  --shade: linear-gradient(180deg, transparent 58%, #18100bc4);
  align-items: end;
}
.photo-band > .scene-content { padding-block: 24px; }
.signature { font: 400 clamp(2.25rem, 10vw, 3rem)/1.06 var(--script); color: var(--gold); }

.gallery { --position: 72%; --shade: linear-gradient(180deg, #21170fb6, #201710df); }
.gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: 25px 0 0; }
.gallery-grid a { display: block; aspect-ratio: 4 / 5; overflow: hidden; border: 1px solid var(--edge); border-radius: 3px; background: #4a3c32; }
.gallery-grid a:last-child:nth-child(3n + 1) { grid-column: 2; }
.gallery-grid img { width: 100%; height: 100%; object-fit: cover; object-position: var(--crop, center); transition: transform .28s ease; }
.gallery-grid a:hover img { transform: scale(1.07); }

.wishes { --position: 74%; --shade: linear-gradient(180deg, #201610ad, #201610dc); }
.wish-form, .wish-feed {
  margin-top: 21px;
  border: 1px solid var(--edge);
  border-radius: 5px;
  padding: 17px;
  background: var(--panel);
  text-align: left;
}
.wish-form label { display: block; margin-bottom: 4px; font-size: .9rem; font-weight: 700; }
.wish-form input, .wish-form textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-bottom: 13px;
  border: 1px solid var(--edge);
  border-radius: 4px;
  padding: 8px 10px;
  color: var(--white);
  background: #1e1713;
}
.wish-form textarea { resize: vertical; }
.wish-form .button { width: 100%; }
.form-note, .form-status, .wish-empty { font-size: .84rem; color: var(--muted); }
.form-note { margin: 0 0 13px; }
.form-status:not(:empty) { margin-top: 10px; }
.trap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wish-entry + .wish-entry { margin-top: 12px; border-top: 1px solid var(--edge); padding-top: 11px; }
.wish-entry { overflow-wrap: anywhere; }
.wish-entry strong { color: var(--gold); font-weight: 700; }
.wish-entry p { margin-top: 3px; color: var(--white); font-size: .94rem; white-space: pre-wrap; }
#moreWishes { margin-top: 12px; }

.closing {
  min-height: 590px;
  align-items: end;
  --position: 49%;
  --shade: linear-gradient(180deg, #2319100d 12%, #271b1396 55%, #211711f2);
}
.closing .signature { margin: 21px auto 13px; }
.closing .button { margin-top: 22px; }
.site-footer {
  padding: 10px 16px;
  text-align: center;
  background: var(--night);
  color: var(--muted);
  font-size: .85rem;
}
.site-footer a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: .28em;
  padding-inline: 10px;
  color: inherit;
  text-decoration: none;
}
.site-footer strong { color: var(--gold); }
.site-footer a:hover strong { text-decoration: underline; }
.gate-closed .site-footer { visibility: hidden; }

.corner-controls {
  position: fixed;
  z-index: 3;
  inset-inline-end: calc(13px + env(safe-area-inset-right));
  inset-block-end: var(--corner-bottom);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
  pointer-events: none;
}
.corner-controls > * { pointer-events: auto; }
.creator-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--creator-height);
  padding: 5px 12px 5px 8px;
  border: 1px solid rgb(255 255 255 / .15);
  border-radius: 11px;
  background: #111;
  color: #fff;
  box-shadow: 0 3px 13px #100b0880;
  font: 500 .85rem/1.2 var(--sans);
  text-decoration: none;
}
.creator-badge:hover { background: #29241f; }
.creator-mark {
  flex: 0 0 32px;
  object-fit: cover;
  border-radius: 50%;
  background: #fff9ed;
}
.music-toggle {
  display: grid; place-items: center;
  width: 46px; height: 46px;
  color: var(--gold);
  background: #261e18;
  border: 1px solid var(--edge);
  border-radius: 50%;
  box-shadow: 0 3px 18px #100b08a1;
  font-size: 1.25rem; cursor: pointer;
}

.lightbox {
  width: min(94vw, 460px);
  max-height: 94svh;
  border: 1px solid var(--edge);
  border-radius: 5px;
  padding: 9px;
  color: var(--white);
  background: #221c17;
  overscroll-behavior: contain;
}
.lightbox::backdrop { background: #0e0a08e9; }
.lightbox-bar, .lightbox-nav { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lightbox-bar { padding: 0 3px 7px; font-size: .85rem; }
.lightbox-nav { padding-top: 8px; }
.lightbox img { width: 100%; max-height: 71svh; object-fit: contain; }
.lightbox button {
  min-width: 44px; min-height: 44px;
  border: 1px solid var(--edge);
  border-radius: 4px;
  padding: 5px 9px;
  color: var(--white);
  background: transparent;
  cursor: pointer;
}
#lightboxClose { font-size: 1.65rem; line-height: 1; }

@keyframes arrive {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}
.reveal-ready .reveal:not(.seen):not(:focus-within) { opacity: 0; transform: translateY(15px); }
.reveal-ready .reveal { transition: opacity .75s ease, transform .75s ease; }

@media (max-height: 590px) {
  .cover-frame { inset: 8px; }
  .cover-content { padding-block-start: 20px; }
  .cover h1 { margin-top: 8px; font-size: clamp(2.1rem, 11vw, 3.5rem); }
  .guest { margin-block: 12px 9px; }
}
@media (max-width: 740px) {
  .cover-content { padding-block-end: calc(var(--corner-bottom) + var(--creator-height) + 13px); }
  .site-footer { padding-block-end: calc(var(--corner-bottom) + var(--creator-height) + 13px); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal-ready .reveal:not(.seen):not(:focus-within) { opacity: 1; transform: none; }
}
