/* ══ Peranakan — lacquer red · imperial gold · porcelain teal ══
   Prefix: pr- · Fonts: Cardo · Barlow · Ma Shan Zheng */

:root {
  --pr-red: #9E1B1B;
  --pr-red-2: #C8102E;
  --pr-gold: #E4B13C;
  --pr-gold-2: #F0CC74;
  --pr-teal: #2E7E7A;
  --pr-cream: #F8EFD9;
  --pr-cream-2: #F3E7C9;
  --pr-ink: #3B2A1E;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: "Barlow", system-ui, sans-serif; background: var(--pr-red); color: var(--pr-ink); -webkit-font-smoothing: antialiased; }
body:not(.is-open) { overflow: hidden; }

.pr-page { max-width: 480px; margin: 0 auto; background: var(--pr-cream); box-shadow: 0 0 60px rgba(0,0,0,.45); position: relative; overflow-x: clip; }

/* ── cover: red envelope unseals ── */
.pr-cover {
  position: fixed; inset: 0; z-index: 100; max-width: 480px; margin: 0 auto;
  background: var(--pr-red); display: flex; align-items: center; justify-content: center;
  transition: visibility 0s 1.2s;
}
.pr-cover-tile { position: absolute; inset: 0; opacity: .35; }
.pr-cover-tile svg { width: 100%; height: 100%; }
.pr-envelope { position: absolute; top: 12%; left: 50%; transform: translateX(-50%); width: 210px; height: 130px; }
.pr-env-back { position: absolute; inset: 0; background: var(--pr-red-2); border: 2px solid var(--pr-gold); }
.pr-env-pocket {
  position: absolute; inset: 0; background: var(--pr-red);
  border: 2px solid var(--pr-gold); border-top: none;
  clip-path: polygon(0 0, 100% 0, 100% 32%, 50% 62%, 0 32%);
  transition: transform .8s cubic-bezier(.6,0,.3,1) .25s;
}
.pr-env-seal {
  position: absolute; left: 50%; top: 34%; transform: translate(-50%,-50%);
  width: 58px; height: 58px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--pr-gold-2), var(--pr-gold) 70%);
  display: grid; place-items: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.35), inset 0 0 0 3px rgba(122,74,10,.4);
  transition: transform .55s cubic-bezier(.5,1.6,.4,1), opacity .45s ease;
}
.pr-env-seal span { font-family: "Ma Shan Zheng", serif; font-size: 30px; color: #7A4A0A; line-height: 1; }
body.is-open .pr-cover { visibility: hidden; pointer-events: none; }
body.is-open .pr-env-pocket { transform: translateY(-118%); }
body.is-open .pr-env-seal { transform: translate(-50%,-50%) scale(1.7) rotate(14deg); opacity: 0; }
.pr-cover-inner {
  position: relative; text-align: center; color: var(--pr-cream); padding: 30px;
  transition: opacity .4s ease .5s, transform .5s ease .5s; transform: translateY(30px);
}
body.is-open .pr-cover-inner { opacity: 0; transform: translateY(0); }

.pr-cover-xi { font-family: "Ma Shan Zheng", serif; font-size: 52px; color: var(--pr-gold); line-height: 1; }
.pr-cover-kicker { font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--pr-gold-2); margin: 12px 0 6px; }
.pr-cover-names { font-family: "Cardo", Georgia, serif; font-weight: 700; font-size: 44px; line-height: 1.1; }
.pr-cover-names span { display: block; font-size: 18px; font-style: italic; color: var(--pr-gold-2); margin: 4px 0; }
.pr-cover-date { font-size: 13.5px; letter-spacing: .1em; color: #EBD9A8; margin-top: 6px; }
.pr-cover-guest { margin: 24px 0 20px; font-size: 13px; color: #EBD9A8; }
.pr-guest-name { font-family: "Cardo", serif; font-size: 20px; color: var(--pr-cream); margin-top: 5px; }
.pr-open-btn {
  font-family: "Barlow", sans-serif; font-size: 13px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
  background: var(--pr-gold); color: #6B3F08; border: none; padding: 13px 34px; cursor: pointer;
  transition: background .25s ease, transform .25s ease;
}
.pr-open-btn:hover { background: var(--pr-gold-2); transform: translateY(-2px); }

/* ── hero ── */
.pr-hero { background: var(--pr-red); color: var(--pr-cream); text-align: center; padding: 54px 26px 40px; position: relative; }
.pr-hero::before, .pr-hero::after {
  content: ""; position: absolute; width: 100%; height: 10px; left: 0;
  background: repeating-linear-gradient(90deg, var(--pr-gold) 0 18px, transparent 18px 36px);
}
.pr-hero::before { top: 14px; } .pr-hero::after { bottom: 14px; }
.pr-hero-bismillah { font-size: 13px; line-height: 1.7; color: #EBD9A8; max-width: 34ch; margin: 0 auto; }
.pr-hero-names { font-family: "Cardo", serif; font-weight: 700; font-size: 50px; line-height: 1.05; margin: 18px 0 8px; }
.pr-hero-names em { font-style: italic; font-weight: 400; color: var(--pr-gold); margin: 0 6px; }
.pr-hero-date { font-size: 14px; letter-spacing: .12em; color: var(--pr-gold-2); }
.pr-cd { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; max-width: 330px; margin: 26px auto 8px; }
.pr-cd-cell { background: rgba(228,177,60,.12); border: 1px solid rgba(228,177,60,.5); padding: 10px 4px 8px; }
.pr-cd-cell b { display: block; font-family: "Cardo", serif; font-weight: 700; font-size: 24px; color: var(--pr-gold-2); font-variant-numeric: tabular-nums; }
.pr-cd-cell span { font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: #E7CBA0; }
.pr-tileband { height: 40px; background: var(--pr-red-2); }
.pr-tileband svg { display: block; width: 100%; height: 100%; }

/* ── sections ── */
.pr-sec { padding: 48px 24px; }
.pr-sec-head { text-align: center; margin-bottom: 28px; }
.pr-sec-xi { font-family: "Ma Shan Zheng", serif; font-size: 34px; color: var(--pr-red-2); line-height: 1; }
.pr-sec-title { font-family: "Cardo", serif; font-weight: 700; font-size: 26px; color: var(--pr-red); margin-top: 4px; }

/* ── couple: octagon frames + corner brackets ── */
.pr-person { position: relative; background: #FFFBF0; border: 1px solid #E8D9B4; text-align: center; padding: 30px 22px 24px; margin-bottom: 14px; }
.pr-corner { position: absolute; width: 34px; height: 34px; color: var(--pr-gold); }
.pr-c-tl { top: 8px; left: 8px; }
.pr-c-br { bottom: 8px; right: 8px; transform: rotate(180deg); }
.pr-oct {
  width: 92px; height: 92px; margin: 0 auto 16px;
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
  background: var(--pr-red); color: var(--pr-gold-2);
  display: grid; place-items: center; font-family: "Cardo", serif; font-size: 30px; font-weight: 700;
}
.pr-oct-teal { background: var(--pr-teal); color: #D8F0EA; }
.pr-knot { text-align: center; color: var(--pr-gold); font-size: 24px; margin: 10px 0; }
.pr-person-name { font-family: "Cardo", serif; font-weight: 700; font-size: 23px; color: var(--pr-red); }
.pr-person-parents { margin-top: 8px; font-size: 13.5px; line-height: 1.6; }
.pr-person-ig { margin-top: 6px; font-size: 12.5px; color: var(--pr-teal); letter-spacing: .04em; }

/* ── events: hanging banners ── */
.pr-events { background: linear-gradient(180deg, var(--pr-cream-2), var(--pr-cream)); }
.pr-banners { display: flex; gap: 14px; justify-content: center; align-items: flex-start; }
.pr-banner {
  position: relative; width: 46%; background: var(--pr-red); color: var(--pr-cream);
  padding: 20px 12px 26px; text-align: center; border: 2px solid var(--pr-gold); border-top: none;
  clip-path: polygon(0 0, 100% 0, 100% 96%, 50% 100%, 0 96%);
}
.pr-banner-alt { background: var(--pr-cream); color: var(--pr-ink); border-color: var(--pr-red); }
.pr-banner-rod { position: absolute; top: -10px; left: -6px; right: -6px; height: 8px; background: var(--pr-gold); border-radius: 4px; }
.pr-banner-title { font-family: "Cardo", serif; font-weight: 700; font-size: 17px; line-height: 1.25; min-height: 44px; }
.pr-banner-alt .pr-banner-title { color: var(--pr-red); }
.pr-banner-time { font-size: 12px; font-weight: 600; color: var(--pr-gold-2); margin-top: 4px; }
.pr-banner-alt .pr-banner-time { color: var(--pr-teal); }
.pr-banner-venue { font-size: 12.5px; font-weight: 600; margin-top: 8px; }
.pr-banner-addr { font-size: 10.5px; line-height: 1.5; opacity: .8; margin-top: 2px; }
.pr-banner-tassel { position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%); width: 5px; height: 16px; background: var(--pr-gold); border-radius: 3px; }
.pr-cal { margin-top: 10px; display: grid; gap: 5px; }
.pr-cal a { font-size: 10.5px; font-weight: 600; letter-spacing: .04em; color: var(--pr-gold-2); text-decoration: none; border-bottom: 1px solid rgba(228,177,60,.6); }
.pr-banner-alt .pr-cal a { color: var(--pr-red); border-color: rgba(158,27,27,.4); }
.pr-maps { margin-top: 26px; }
.pr-map-tabs { display: grid; grid-template-columns: 1fr 1fr; }
.pr-map-tab {
  appearance: none; border: 2px solid var(--pr-red); background: var(--pr-cream); cursor: pointer;
  padding: 9px 0; font-family: "Barlow", sans-serif; font-size: 12px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--pr-red);
}
.pr-map-tab.is-active { background: var(--pr-red); color: var(--pr-gold-2); }
.pr-map { display: block; width: 100%; height: 215px; border: 2px solid var(--pr-red); }

/* ── story ── */
.pr-story { list-style: none; position: relative; }
.pr-story::before { content: ""; position: absolute; left: 24px; top: 0; bottom: 0; width: 3px; background: var(--pr-gold); }
.pr-story-item { position: relative; padding: 0 0 24px 60px; }
.pr-story-item:last-child { padding-bottom: 0; }
.pr-story-item::before {
  content: ""; position: absolute; left: 18px; top: 6px; width: 15px; height: 15px;
  background: var(--pr-cream); border: 3px solid var(--pr-red-2); transform: rotate(45deg);
}
.pr-story-year { font-family: "Cardo", serif; font-weight: 700; font-size: 14px; color: var(--pr-red-2); letter-spacing: .06em; }
.pr-story-title { font-family: "Cardo", serif; font-weight: 700; font-size: 18px; color: var(--pr-ink); margin: 3px 0 5px; }
.pr-story-text { font-size: 13.5px; line-height: 1.65; }

/* ── gallery: mosaic cascade ── */
.pr-gal-sec { background: var(--pr-cream-2); }
.pr-gal { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; perspective: 800px; }
.pr-g-item {
  background: #FFFBF0; padding: 6px; border: 1px solid #E8D9B4; cursor: zoom-in;
  transition: transform .7s cubic-bezier(.2,.8,.25,1), opacity .7s ease;
  transform: rotateY(35deg) translateY(18px); transform-origin: center bottom;
 aspect-ratio: 4/3; overflow: hidden; }
.pr-g-item.revealed { transform: rotateY(0) translateY(0); }
.pr-g-item svg { display: block; width: 100%; height: auto; }
.pr-g-item img { display: block; width: 100%; height: 100%; aspect-ratio: 4/3; object-fit: cover; }
.pr-g-item { color: #C8102E; }

/* ── forms ── */
.pr-form { display: grid; gap: 15px; }
.pr-field { display: grid; gap: 6px; border: none; }
.pr-field span, .pr-field legend { font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--pr-red); }
.pr-field input, .pr-field select, .pr-field textarea {
  font-family: "Barlow", sans-serif; font-size: 14.5px; color: var(--pr-ink);
  background: #FFFBF0; border: 1.5px solid #DCC894; padding: 11px 13px; outline: none; width: 100%;
}
.pr-field input:focus, .pr-field select:focus, .pr-field textarea:focus { border-color: var(--pr-red-2); }
.pr-radios { display: block; }
.pr-radios label { display: flex; gap: 9px; align-items: center; font-size: 14px; padding: 4px 0; text-transform: none; letter-spacing: 0; }
.pr-radios input { accent-color: var(--pr-red-2); width: 16px; height: 16px; }
.pr-submit {
  justify-self: center; appearance: none; cursor: pointer;
  background: var(--pr-red); color: var(--pr-gold-2); border: 2px solid var(--pr-gold);
  font-family: "Barlow", sans-serif; font-size: 13px; font-weight: 600; letter-spacing: .18em;
  text-transform: uppercase; padding: 12px 32px; transition: background .25s ease;
}
.pr-submit:hover { background: var(--pr-red-2); }
.pr-thanks { text-align: center; font-family: "Cardo", serif; font-size: 17px; color: var(--pr-red); padding: 22px 8px; }

/* ── wishes ── */
.pr-wish-form { margin-bottom: 24px; }
.pr-wishes { display: grid; gap: 10px; margin-bottom: 16px; }
[data-wishes-list] .wish { background: #FFFBF0; border: 1px solid #E8D9B4; border-left: 4px solid var(--pr-red-2); padding: 12px 15px 10px; }
[data-wishes-list] .wish h4 { font-family: "Cardo", serif; font-weight: 700; font-size: 15.5px; color: var(--pr-red); }
[data-wishes-list] .wish p { font-size: 13px; line-height: 1.6; margin-top: 3px; }
[data-wishes-list] .wish time { display: block; font-size: 10.5px; color: #A6946E; margin-top: 5px; }
.pr-more {
  display: block; margin: 0 auto; appearance: none; background: none; cursor: pointer;
  border: 1.5px solid var(--pr-red); color: var(--pr-red); font-family: "Barlow", sans-serif;
  font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; padding: 9px 20px;
}

/* ── amplop ── */
.pr-amplop { background: var(--pr-cream-2); }
.pr-amplop-note { text-align: center; font-size: 13px; line-height: 1.65; max-width: 36ch; margin: 0 auto 20px; }
.pr-envs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pr-env { background: var(--pr-red); color: var(--pr-cream); text-align: center; padding: 20px 12px 16px; border: 2px solid var(--pr-gold); }
.pr-env-alt { background: var(--pr-teal); border-color: #D8F0EA; }
.pr-env-name { font-size: 10.5px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--pr-gold-2); }
.pr-env-num { font-family: "Cardo", serif; font-size: 17.5px; letter-spacing: .03em; margin-top: 7px; }
.pr-env-holder { font-size: 11px; opacity: .85; margin-top: 3px; }
.pr-copy {
  margin-top: 11px; appearance: none; cursor: pointer; background: var(--pr-gold); color: #6B3F08; border: none;
  font-family: "Barlow", sans-serif; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; padding: 7px 14px;
}

/* ── closing ── */
.pr-closing { background: var(--pr-red); color: var(--pr-cream); text-align: center; padding: 50px 26px 34px; }
.pr-closing-xi { font-family: "Ma Shan Zheng", serif; font-size: 58px; color: var(--pr-gold); }
.pr-closing-text { font-size: 13px; line-height: 1.7; color: #EBD9A8; max-width: 34ch; margin: 14px auto 20px; }
.pr-closing-names { font-family: "Cardo", serif; font-weight: 700; font-size: 34px; }
.pr-closing-fam { margin-top: 14px; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--pr-gold-2); }

/* ── music ── */
.pr-music {
  position: fixed; right: 18px; bottom: 22px; z-index: 90; width: 46px; height: 46px; border-radius: 50%;
  background: var(--pr-red); color: var(--pr-gold); border: 2px solid var(--pr-gold); cursor: pointer;
  display: grid; place-items: center; box-shadow: 0 6px 18px rgba(0,0,0,.35);
}
.pr-music svg { width: 20px; height: 20px; }
.pr-music.is-playing { animation: pr-glow 2.4s ease infinite; }
@keyframes pr-glow { 0%,100% { box-shadow: 0 6px 18px rgba(0,0,0,.35), 0 0 0 0 rgba(228,177,60,.5);} 60% { box-shadow: 0 6px 18px rgba(0,0,0,.35), 0 0 0 11px rgba(228,177,60,0);} }

/* ── reveal (behavior-critical) ── */
[data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity .8s ease, transform .8s ease; }
[data-reveal].revealed { opacity: 1; transform: none; }
.pr-g-item[data-reveal] { transform: rotateY(35deg) translateY(18px); }
.pr-g-item[data-reveal].revealed { transform: rotateY(0) translateY(0); }

.lb-overlay { font-family: "Barlow", sans-serif; }
.map-open { color: var(--pr-red-2); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  /* cover-open end-states so content remains reachable */
  body.is-open [data-cover] { opacity: 0 !important; visibility: hidden !important; }
}
