:root {
  --ivory: #FAF7EF;
  --ink: #282D26;
  --olive: #41543D;
  --olive-dark: #30402D;
  --deep: #233021;
  --slate: #485E72;
  --pale-blue: #E6EBEE;
  --gold: #B0925A;                       /* ornamen di atas gading */
  --gold-line: rgba(176, 146, 90, .45);
  --champagne: #C9B58C;                  /* ornamen & teks di atas zaitun pekat */
  --champagne-line: rgba(201, 181, 140, .45);
  --linen: #ECE5D6;
  --mat: #FFFDF8;
  --photo-bg: #D9D2C1;

  --serif: "Baskervville", Georgia, serif;
  --script: "Pinyon Script", "Baskervville", Georgia, serif;
  --sans: "DM Sans", Arial, sans-serif;

  --gutter: 16px;
  --section-pad: 88px;
  --ease-curtain: cubic-bezier(.65, 0, .25, 1);
  --ring-gap: var(--ivory);
  --ring: var(--slate);

  /* Tekstur kertas halus */
  --paper: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .3 0 0 0 0 .2 .09 0 0 0 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
html.gate-open, html.gate-open body { overflow: hidden; }

body {
  margin: 0;
  background: var(--ivory) var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  line-height: 1.5;
  overflow-wrap: break-word;
  overflow-x: clip;
}

img { display: block; max-width: 100%; height: auto; }
figure, blockquote { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; }
p { margin: 0; }

.wrap {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Unsur tipografi klasik ---------- */
.caps {
  font-family: var(--serif);
  text-transform: uppercase;
  letter-spacing: .2em;
  padding-left: .2em; /* imbangi spasi huruf agar tetap di tengah */
  font-size: .9375rem;
  font-variant-numeric: lining-nums;
}
.script-names {
  display: grid;
  font-family: var(--script);
  font-weight: 400;
  line-height: 1.1;
}
.script-names .amp { font-family: var(--serif); font-style: italic; font-size: .42em; line-height: 1.5; color: var(--gold); }
.amp { font-family: var(--serif); font-style: italic; color: var(--gold); }

.section-title {
  font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.25rem);
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: .18em;
  padding-left: .18em;
}

.orn { display: block; width: 180px; height: 16px; color: var(--gold); }

/* Monogram */
.crest {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  outline: 1px solid var(--gold-line);
  outline-offset: 4px;
  font-family: var(--script);
  font-size: 2.125rem;
  line-height: 1;
  color: var(--ink);
}
.crest span { font-family: var(--serif); font-style: italic; font-size: .6em; color: var(--gold); margin-inline: 3px; }

/* Bingkai klasik: garis tepi dengan siku di keempat sudut */
.frame {
  --fc: var(--gold);
  position: relative;
  border: 1px solid var(--gold-line);
  background:
    linear-gradient(var(--fc), var(--fc)) left 8px top 8px / 28px 1px no-repeat,
    linear-gradient(var(--fc), var(--fc)) left 8px top 8px / 1px 28px no-repeat,
    linear-gradient(var(--fc), var(--fc)) right 8px top 8px / 28px 1px no-repeat,
    linear-gradient(var(--fc), var(--fc)) right 8px top 8px / 1px 28px no-repeat,
    linear-gradient(var(--fc), var(--fc)) left 8px bottom 8px / 28px 1px no-repeat,
    linear-gradient(var(--fc), var(--fc)) left 8px bottom 8px / 1px 28px no-repeat,
    linear-gradient(var(--fc), var(--fc)) right 8px bottom 8px / 28px 1px no-repeat,
    linear-gradient(var(--fc), var(--fc)) right 8px bottom 8px / 1px 28px no-repeat;
}

/* Bingkai lengkung */
.arch {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 50% 50% 0 0 / 33.34% 33.34% 0 0;
  outline: 1px solid var(--gold);
  outline-offset: 10px;
  background: var(--photo-bg);
}
.arch > img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Fokus ---------- */
:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring-gap), 0 0 0 5px var(--ring);
}
[tabindex="-1"]:focus { outline: none; box-shadow: none; }

/* ---------- Tombol ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 28px;
  border-radius: 2px;
  font: 600 .9375rem/1.25 var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn--primary {
  background: var(--olive);
  color: var(--ivory);
  border: 1px solid var(--olive);
  box-shadow: inset 0 0 0 3px var(--olive), inset 0 0 0 4px rgba(201, 181, 140, .55);
  min-width: min(100%, 260px);
}
.btn--primary:hover, .btn--primary:active {
  background: var(--olive-dark);
  border-color: var(--olive-dark);
  box-shadow: inset 0 0 0 3px var(--olive-dark), inset 0 0 0 4px rgba(201, 181, 140, .55);
}
.btn--primary:focus-visible {
  box-shadow: inset 0 0 0 3px var(--olive), inset 0 0 0 4px rgba(201, 181, 140, .55), 0 0 0 3px var(--ring-gap), 0 0 0 5px var(--ring);
}
.btn--outline {
  background: transparent;
  color: var(--ivory);
  border: 1px solid var(--champagne);
}
.btn--outline:hover, .btn--outline:active { background: var(--champagne); color: var(--deep); }

/* ============ TIRAI PEMBUKA ============ */
.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  padding: 24px max(var(--gutter), env(safe-area-inset-left));
  overflow-y: auto;
}
.no-js .gate, .gate[hidden] { display: none; }

.gate__panel {
  position: fixed;
  top: 0; bottom: 0;
  width: 50.5%;
  background-color: var(--linen);
  background-image:
    repeating-linear-gradient(90deg,
      rgba(255, 255, 255, .38) 0,
      rgba(255, 255, 255, 0) 16px,
      rgba(80, 64, 36, .08) 30px,
      rgba(255, 255, 255, 0) 46px,
      rgba(255, 255, 255, .2) 58px);
  transition: transform 1.7s var(--ease-curtain) .35s, opacity .6s ease 1.6s;
  will-change: transform;
}
.gate__panel--left { left: 0; transform-origin: left center; box-shadow: inset -24px 0 36px -20px rgba(60, 48, 26, .28); }
.gate__panel--right { right: 0; transform-origin: right center; box-shadow: inset 24px 0 36px -20px rgba(60, 48, 26, .28); }

.gate__content {
  display: grid;
  justify-items: center;
  gap: 16px;
  width: min(100%, 440px);
  margin: auto; /* tengah, tapi tetap bisa digulir bila layar pendek */
  padding: 40px 24px 32px;
  text-align: center;
  background-color: rgba(250, 247, 239, .9);
  transition: opacity .5s ease, transform .5s ease;
}
.gate__kicker { color: var(--slate); font-size: .8125rem; }
.gate .script-names { font-size: clamp(3rem, 2.4rem + 3vw, 4.25rem); color: var(--ink); }
.gate__date { color: var(--slate); }
.gate__guest { display: grid; gap: 4px; }
.gate__to { font-size: .9375rem; color: var(--slate); }
.gate__guest-name { font-family: var(--serif); font-size: 1.5rem; line-height: 1.25; }

.gate.is-opening .gate__content { opacity: 0; transform: translateY(-12px); pointer-events: none; }
.gate.is-opening .gate__panel { transform: scaleX(.06); opacity: 0; }

/* ============ SAMPUL ============ */
.hero {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 56px var(--gutter) calc(96px + env(safe-area-inset-bottom));
}
.hero__inner { display: grid; justify-items: center; gap: 16px; text-align: center; }
.hero__kicker { color: var(--slate); }
.hero__frame { padding: 12px; margin-block: 4px 8px; }
.hero__photo { width: min(60vw, 260px, 42svh); }
.plx {
  position: absolute;
  inset: 0;
  transform: translate3d(0, var(--plx, 0px), 0);
  will-change: transform;
}
.plx img { width: 100%; height: 100%; object-fit: cover; }
.hero__photo .plx { inset: -8% 0; }
.hero__names { font-size: clamp(3rem, 2.4rem + 3vw, 4.5rem); line-height: 1; color: var(--ink); }
.hero__date { color: var(--slate); }

/* Satu momen: setelah tirai terbuka */
.js .hero__img { transform: scale(1.14); transition: transform 3.2s cubic-bezier(.2, .6, .2, 1) .4s; }
.js .hero__inner > * { opacity: 0; transform: translateY(14px); transition: opacity 1s ease, transform 1s ease; }
.js .hero__inner > :nth-child(1) { transition-delay: .9s; }
.js .hero__inner > :nth-child(2) { transition-delay: .6s; }
.js .hero__inner > :nth-child(3) { transition-delay: 1.3s; }
.js .hero__inner > :nth-child(4) { transition-delay: 1.5s; }
.js .hero__inner > :nth-child(5) { transition-delay: 1.65s; }
.js .hero__inner > :nth-child(6) { transition-delay: 1.8s; }
.is-open .hero__img { transform: scale(1); }
.is-open .hero__inner > * { opacity: 1; transform: none; }

/* ============ MEMPELAI ============ */
.intro { padding-block: 24px var(--section-pad); text-align: center; }
.intro__inner { display: grid; justify-items: center; gap: 36px; }
.intro__lead {
  max-width: 44ch;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.125rem, 1rem + .5vw, 1.375rem);
  line-height: 1.7;
}
.couple { display: grid; gap: 6px; }
.couple__name {
  font-family: var(--serif);
  font-size: clamp(1.75rem, 1.35rem + 2.2vw, 3rem);
  line-height: 1.15;
}
.couple__amp { font-family: var(--serif); font-style: italic; font-size: clamp(1.5rem, 1.3rem + 1vw, 2rem); line-height: 1.2; color: var(--gold); }

/* ============ DETAIL ACARA ============ */
.detail {
  padding-block: var(--section-pad);
  background: var(--deep);
  color: var(--ivory);
  --ring-gap: var(--deep);
  --ring: var(--champagne);
}
.detail .orn { color: var(--champagne); }
.detail__head { display: grid; justify-items: center; gap: 14px; margin-bottom: 48px; text-align: center; }
.detail__date { color: var(--champagne); }
.detail__countdown { font-family: var(--serif); font-style: italic; font-size: 1.25rem; color: rgba(250, 247, 239, .8); }

.events { display: grid; gap: 28px; }
.event {
  --fc: var(--champagne);
  border-color: var(--champagne-line);
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 6px;
  padding: 48px 24px 44px;
  text-align: center;
}
.event__title { font-size: clamp(1.875rem, 1.5rem + 1.5vw, 2.5rem); line-height: 1.15; margin-bottom: 6px; }
.event__day { color: rgba(250, 247, 239, .8); }
.event__time {
  color: var(--champagne);
  font-weight: 600;
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums lining-nums;
}
.event__rule { width: 40px; height: 1px; margin: 14px 0; background: var(--champagne); }
.event__venue { font-weight: 600; max-width: 30ch; }
.event__address { max-width: 36ch; margin-bottom: 20px; font-style: normal; color: rgba(250, 247, 239, .8); }

/* ============ PITA AYAT ============ */
.verse {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 78vh;
  min-height: 78svh;
  padding: 96px var(--gutter);
  overflow: hidden;
  color: var(--ivory);
  background: var(--deep);
}
.verse__media { position: absolute; inset: 0; overflow: hidden; }
.verse__media::after { content: ""; position: absolute; inset: 0; background: rgba(28, 38, 26, .62); }
.verse__plx { inset: -18% 0; }
.verse__plx img { object-position: 50% 45%; }
.verse__quote { position: relative; display: grid; justify-items: center; gap: 28px; max-width: 30ch; text-align: center; }
.verse__quote .orn { color: var(--champagne); }
.verse__quote p {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.5rem, 1.1rem + 2vw, 2.5rem);
  line-height: 1.4;
}
.verse__quote cite { font-style: normal; color: var(--champagne); }

/* ============ GALERI ============ */
.gallery { padding-block: var(--section-pad); }
.gallery__head { display: grid; justify-items: center; gap: 14px; margin-bottom: 56px; text-align: center; }
.gallery__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 36px;
}
.gallery__grid li {
  padding: 10px;
  background: var(--mat);
  border: 1px solid var(--gold-line);
  box-shadow: 0 12px 32px rgba(40, 45, 38, .08);
}
.gallery__grid img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background: var(--photo-bg);
}

/* ============ PENUTUP ============ */
.closing {
  background: var(--pale-blue) var(--paper);
  padding-block: var(--section-pad) calc(var(--section-pad) + 24px);
}
.closing__inner { display: grid; justify-items: center; gap: 24px; text-align: center; }
.closing__photo { width: min(70vw, 320px); margin-bottom: 28px; }
.closing__title { font-family: var(--script); font-size: clamp(3rem, 2.4rem + 3vw, 4.5rem); line-height: 1.1; color: var(--ink); }
.closing__msg { max-width: 46ch; }
.closing__names { display: block; font-size: clamp(2.25rem, 1.8rem + 2vw, 3.25rem); color: var(--slate); }

.footer {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 48px var(--gutter) calc(96px + env(safe-area-inset-bottom));
  background: var(--deep);
  color: rgba(250, 247, 239, .8);
  text-align: center;
}
.footer .crest { color: var(--ivory); border-color: var(--champagne); outline-color: var(--champagne-line); }
.footer .crest span { color: var(--champagne); }
.footer .caps { font-size: .8125rem; }
.crest--small { width: 64px; height: 64px; font-size: 1.625rem; }

/* ============ MUSIK ============ */
/* Di kiri bawah: kanan bawah dipakai lencana "Powered by Netlify" */
.music {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 50;
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 10px;
  --ring-gap: var(--ivory);
  --ring: var(--slate);
}
.music[hidden] { display: none; }
.music__msg {
  max-width: 220px;
  padding: 8px 12px;
  border-radius: 2px;
  background: var(--deep);
  color: var(--ivory);
  font-size: .875rem;
  line-height: 1.35;
}
.music__msg:empty { display: none; }
.music__btn {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--champagne-line);
  background: var(--deep);
  color: var(--champagne);
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(20, 28, 19, .3);
}
.music__play { width: 20px; height: 20px; display: none; }
.music__bars { display: flex; align-items: flex-end; gap: 3px; height: 18px; }
.music__bars i {
  width: 3px;
  height: 100%;
  background: currentColor;
  border-radius: 1px;
  transform-origin: bottom;
  animation: bar 1s ease-in-out infinite;
}
.music__bars i:nth-child(2) { animation-delay: -.35s; }
.music__bars i:nth-child(3) { animation-delay: -.7s; }
@keyframes bar { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
.music__btn.is-paused .music__bars { display: none; }
.music__btn.is-paused .music__play { display: block; }

/* ============ RESPONSIF ============ */
@media (min-width: 360px) {
  :root { --gutter: 24px; }
  .event { padding-inline: 32px; }
}

@media (min-width: 768px) {
  :root { --gutter: 32px; --section-pad: 112px; }
  .gallery__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 32px; }
  .event { padding: 56px 48px 52px; }
  .hero__names { display: flex; align-items: baseline; justify-content: center; gap: .22em; }
  .hero__names .amp { font-size: .5em; }
}

@media (min-width: 1024px) {
  :root { --section-pad: 136px; }
  .hero__photo { width: min(300px, 40svh); }
  .events { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; }
  .gallery__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 56px 40px; padding-block: 30px 70px; }
  .gallery__grid > [data-parallax] { transform: translate3d(0, var(--plx, 0px), 0); will-change: transform; }
}

/* Ponsel lanskap */
@media (orientation: landscape) and (max-height: 540px) and (max-width: 1023px) {
  .gate__content { gap: 10px; padding: 28px 24px 24px; width: min(100%, 520px); }
  .gate .script-names { font-size: 2.75rem; }
  .crest { width: 64px; height: 64px; font-size: 1.625rem; }
  .hero { padding-top: 32px; }
}

@media (prefers-reduced-motion: no-preference) {
  html:not(.gate-open) { scroll-behavior: smooth; }
}

@media (prefers-reduced-motion: reduce) {
  .gate__panel { transition: opacity .4s ease; }
  .gate.is-opening .gate__panel { transform: none; }
  .js .hero__img, .js .hero__inner > * { transform: none; transition: opacity .4s ease; transition-delay: 0s !important; }
  .music__bars i { animation: none; transform: scaleY(.7); }
}
