/* =========================================================
   Wedding Invitation H5  —  Kaijie & Mengying
   palette : cream #F6EEE0  · gold #B08D4F  · ink #5C4226
   ========================================================= */

:root{
  --cream:        #F6EEE0;
  --cream-deep:   #ECDFC6;
  --gold:         #B08D4F;
  --gold-soft:    #CDB073;
  --gold-light:   #E5D3A8;
  --ink:          #5C4226;
  --ink-soft:     #8C6E4E;
  --shadow:       0 8px 30px rgba(92, 66, 38, .15);

  --serif-cn:    "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "宋体", "SimSun", serif;
  --display-cn:  "ZCOOL XiaoWei", "Noto Serif SC", "STSong", "宋体", serif;
  --calli-cn:    "Ma Shan Zheng", "Noto Serif SC", "STKaiti", "楷体", serif;
  --kai-cn:      "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "宋体", serif;
  --serif-en:   "Cormorant Garamond", "Cormorant", Georgia, serif;
  --display-en: "Cinzel", "Cormorant Garamond", Georgia, serif;
  --num-en:     "Cormorant Garamond", "Cormorant", Georgia, serif;
  --script-en:  "Pinyon Script", "Allura", "Lucida Handwriting", cursive;
}

*{ box-sizing:border-box; margin:0; padding:0; -webkit-tap-highlight-color: transparent; }
html, body{
  background: var(--cream);
  color: var(--ink);
  font-family: var(--serif-cn);
  font-weight: 400;
  scroll-behavior: smooth;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
body.invitation-locked{
  overflow: hidden;
  height: 100vh;
  height: 100svh;
}
body.invitation-locked #music-toggle{
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
}
body.invitation-opened #music-toggle{
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* mobile: hard-locked pagination handled in JS (touch-action none) */
body.paged-mobile{
  overflow: hidden;
  height: 100vh; height: 100svh;
  touch-action: none;
  overscroll-behavior: none;
}
body.paged-mobile #amap{ touch-action: pan-x pan-y pinch-zoom; }
/* keep buttons clickable */
body.paged-mobile button,
body.paged-mobile .btn-action,
body.paged-mobile #music-toggle{ touch-action: auto; }
img{ max-width:100%; display:block; }
button{ font-family: inherit; }

/* =========================================================
   entrance gate
   ========================================================= */
.intro-gate{
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 5vh, 42px);
  min-height: 100vh;
  min-height: 100svh;
  padding: max(48px, env(safe-area-inset-top)) 24px max(44px, env(safe-area-inset-bottom));
  color: var(--ink);
  cursor: pointer;
  background-color: #f5ebd9;
  background-image:
    radial-gradient(ellipse 85% 62% at 50% 44%, rgba(255,250,238,.82) 0%, rgba(255,250,238,.42) 46%, rgba(232,214,181,.28) 100%),
    radial-gradient(ellipse 120% 90% at 50% 100%, rgba(176,141,79,.14), transparent 58%),
    url('assets/decor/paper.jpg');
  background-size: auto, auto, 100% auto;
  background-position: center, center, center top;
  background-blend-mode: normal, multiply, soft-light;
  overflow: hidden;
  transition: opacity .5s ease, visibility .5s ease;
}
.intro-gate:focus{
  outline: none;
}
.intro-gate.is-hidden{
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.intro-copy{
  position: relative;
  z-index: 8;
  text-align: center;
  transform: translateY(0);
  transition: opacity .38s ease, transform .38s ease;
}
.intro-title{
  font-family: "Cormorant Garamond", "Cinzel", Georgia, serif;
  font-size: clamp(18px, 4.8vw, 25px);
  font-weight: 500;
  letter-spacing: .18em;
  margin-left: .18em;
  color: #4a3520;
  text-transform: none;
}
.intro-subtitle{
  margin-top: 15px;
  font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  font-size: clamp(15px, 3.8vw, 18px);
  font-weight: 600;
  letter-spacing: .34em;
  margin-left: .34em;
  color: #78572f;
}
.intro-envelope{
  position: relative;
  z-index: 6;
  width: min(88vw, 430px);
  aspect-ratio: 14 / 9;
  perspective: 1200px;
  transform-style: preserve-3d;
  filter: drop-shadow(0 22px 34px rgba(92,66,38,.16));
  transition: opacity .45s ease, transform .55s ease;
}
.intro-photo-card{
  position: absolute;
  left: 50%;
  top: 40%;
  z-index: 3;
  width: min(50vw, 210px);
  height: min(31vw, 130px);
  overflow: hidden;
  border-radius: 2px;
  background:
    linear-gradient(#fffaf0, #fffaf0) padding-box,
    linear-gradient(135deg, rgba(176,141,79,.6), rgba(255,255,255,.7), rgba(176,141,79,.5)) border-box;
  border: 5px solid transparent;
  box-shadow:
    0 12px 28px rgba(92,66,38,.18),
    0 0 0 1px rgba(176,141,79,.16);
  opacity: 0;
  transform: translate(-50%, -4%) rotate(-90deg) scale(.66);
  transform-origin: 50% 50%;
  transition:
    width 1.9s cubic-bezier(.18,.76,.14,1),
    height 1.9s cubic-bezier(.18,.76,.14,1),
    top 1.9s cubic-bezier(.18,.76,.14,1),
    transform 1.9s cubic-bezier(.18,.76,.14,1),
    border-width .9s ease,
    border-radius .9s ease,
    box-shadow .9s ease,
    filter 1.35s ease,
    opacity .42s ease;
}
.intro-photo-card::after{
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.4) 45%, rgba(0,0,0,0.65) 100%),
    radial-gradient(circle at 50% 34%, rgba(255,245,220,.08), transparent 44%);
  opacity: 0;
  transition: opacity 1.55s ease;
}
.intro-photo-card img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: filter 1.55s ease, transform 1.9s cubic-bezier(.18,.76,.14,1);
}
.envelope-back-art,
.envelope-front-art,
.envelope-flap-art{
  position: absolute;
  display: block;
  user-select: none;
  pointer-events: none;
}
.envelope-back-art{
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: auto;
}
.envelope-front-art{
  z-index: 5;
  left: 0;
  top: 0;
  width: 100%;
  height: auto;
}
.envelope-flap-art{
  z-index: 7;
  left: 0;
  top: 0;
  width: 100%;
  height: auto;
  transform-origin: 50% 11%;
  transform: rotateX(0deg);
  transition: transform 1.28s cubic-bezier(.16,.72,.16,1), opacity .7s ease;
  backface-visibility: visible;
}
.intro-hint{
  position: relative;
  z-index: 8;
  font-family: var(--serif-cn);
  font-size: 13px;
  letter-spacing: .34em;
  margin-left: .34em;
  color: var(--ink-soft);
  animation: introPulse 1.8s ease-in-out infinite;
}
@keyframes introPulse{
  0%, 100%{ opacity: .48; transform: translateY(0); }
  50%{ opacity: .96; transform: translateY(-2px); }
}
.intro-gate.is-opening .intro-copy,
.intro-gate.is-opening .intro-hint{
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity .62s ease, transform .62s ease;
}
.intro-gate.is-opening .intro-hint{
  animation: none;
}
.intro-gate.is-opening .envelope-flap-art{
  z-index: 4;
  transform: rotateX(164deg);
}
.intro-gate.is-opening .intro-photo-card{
  z-index: 3;
}
.intro-gate.is-photo-out .envelope-flap-art{
  z-index: 2;
  opacity: 1;
  transition: transform 1.28s cubic-bezier(.16,.72,.16,1), opacity .7s ease;
}
.intro-gate.is-photo-out .intro-photo-card{
  z-index: 4;
  opacity: 1;
}
.intro-gate.is-photo-out .intro-photo-card{
  top: -74%;
  width: min(56vw, 220px);
  height: min(82vw, 326px);
  transform: translate(-50%, -50%) rotate(0deg) scale(1);
}
.intro-gate.is-covering .intro-photo-card{
  opacity: 0;
  transition: opacity .25s ease;
}
.intro-gate.is-covering .intro-photo-card::after{
  opacity: 1;
}
.intro-gate.is-covering .intro-photo-card img{
  filter: brightness(.72) contrast(1.02);
  transform: scale(1.08);
}
.intro-gate.is-covering .intro-envelope{
  filter: none;
}
.intro-gate.is-covering .envelope-back-art,
.intro-gate.is-covering .envelope-front-art,
.intro-gate.is-covering .envelope-flap-art{
  opacity: 0;
  transition: opacity .55s ease;
}
.intro-gate.is-covering{
  background-color: #f5ebd9;
}
.intro-photo-flight{
  position: fixed;
  z-index: 312;
  left: var(--flight-left);
  top: var(--flight-top);
  width: var(--flight-width);
  height: var(--flight-height);
  overflow: hidden;
  border: 5px solid rgba(255,250,240,.96);
  border-radius: 2px;
  background: #fffaf0;
  box-shadow:
    0 16px 34px rgba(92,66,38,.2),
    0 0 0 1px rgba(176,141,79,.16);
  transform: rotate(var(--flight-rotate, 0deg));
  transform-origin: 50% 50%;
  transition:
    left 2.2s cubic-bezier(.18,.76,.14,1),
    top 2.2s cubic-bezier(.18,.76,.14,1),
    width 2.2s cubic-bezier(.18,.76,.14,1),
    height 2.2s cubic-bezier(.18,.76,.14,1),
    border-width 1.05s ease,
    border-radius 1.05s ease,
    box-shadow 1.05s ease,
    transform 2.2s cubic-bezier(.18,.76,.14,1);
}
.intro-photo-flight::after{
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.4) 45%, rgba(0,0,0,0.65) 100%);
  transition: opacity 1.65s ease;
}
.intro-photo-flight img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 2.2s cubic-bezier(.18,.76,.14,1), filter 1.65s ease;
}
.intro-photo-flight.is-covering{
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  height: 100svh;
  border-width: 0;
  border-radius: 0;
  box-shadow: none;
  transform: rotate(0deg);
}
.intro-photo-flight.is-covering::after{
  opacity: 1;
}
.intro-photo-flight.is-covering img{
  filter: brightness(.72) contrast(1.02);
  transform: scale(1.08);
}
body.invitation-locked .cover-content,
body.invitation-locked .scroll-hint{
  opacity: 0;
}
body.invitation-opened .cover-content{
  opacity: 0;
  animation: coverTextAfterIntro 1.15s .36s ease forwards;
}
body.invitation-opened .scroll-hint{
  opacity: 0;
  animation: fadeIn 1.1s 1.45s forwards;
}
@keyframes coverTextAfterIntro{
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 430px){
  .intro-gate{
    gap: 34px;
  }
  .intro-envelope{
    width: min(88vw, 370px);
  }
  .intro-photo-card{
    width: min(50vw, 190px);
    height: min(31vw, 118px);
  }
}

/* =========================================================
   screen scaffold
   ========================================================= */
.screen{
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(56px, 14vw, 96px) clamp(28px, 8vw, 56px);
  overflow: hidden;
  background: var(--cream);
}
.content{
  position: relative; z-index: 2;
  width: 100%;
  max-width: 480px;
  text-align: center;
}

/* parchment texture — deeper warm tones */
.screen:not(.cover-screen):not(.closing-screen){
  background-color: #EAD9B6;
  background-image:
    radial-gradient(ellipse at 30% 20%, rgba(176,141,79,0.12), transparent 60%),
    radial-gradient(ellipse at 70% 80%, rgba(110,75,30,0.10), transparent 55%),
    url('assets/decor/paper.jpg');
  background-size: auto, auto, 100% auto;
  background-repeat: no-repeat, no-repeat, repeat-y;
  background-position: center top, center top, center top;
  background-blend-mode: multiply, multiply, normal;
}
.screen:not(.cover-screen):not(.closing-screen)::before{
  content:""; position:absolute; inset:0; pointer-events:none;
  background:
    /* subtle stained-edge vignette */
    radial-gradient(ellipse 130% 100% at center,
      transparent 50%,
      rgba(140, 95, 40, 0.08) 80%,
      rgba(110, 70, 25, 0.18) 100%),
    /* very fine paper fiber grain */
    repeating-linear-gradient(45deg,
      transparent 0,
      rgba(120, 80, 30, 0.018) 1px,
      transparent 2px,
      transparent 4px);
  z-index: 0;
}

/* =========================================================
   shared decorative components
   ========================================================= */

/* floral corner PNGs */
.corner-deco{
  position: absolute;
  width: clamp(100px, 28vw, 160px);
  height: auto;
  opacity: 0.9;
  pointer-events: none;
  z-index: 3;
  user-select: none;
}
.corner-deco.small{
  width: clamp(80px, 22vw, 120px);
  opacity: 0.75;
}
.corner-deco.tl{ top: 0;    left: 0;   transform-origin: top left;    }
.corner-deco.tr{ top: 0;    right: 0;  transform-origin: top right;   }
.corner-deco.bl{ bottom: 0; left: 0;   transform-origin: bottom left; }
.corner-deco.br{ bottom: 0; right: 0;  transform-origin: bottom right;}

/* horizontal ornate divider */
.ornate-divider{
  position: absolute;
  left: 50%; transform: translateX(-50%);
  width: min(82%, 440px);
  height: auto;
  opacity: 0.85;
  pointer-events: none;
  z-index: 1;
}
.ornate-divider.top{ top: clamp(48px, 12vw, 80px); }
.ornate-divider.bot{ bottom: clamp(48px, 12vw, 80px); }

.mini-divider{
  width: min(70%, 300px);
  height: auto;
  margin: 18px auto;
  display: block;
  opacity: 0.82;
}
.mini-divider.white{ opacity: 0.9; filter: brightness(1.5); }

/* =========================================================
   background image + overlay
   ========================================================= */
.bg-image{
  position: absolute; inset:0;
  background-size: cover;
  background-position: center;
  transform: scale(1.08);
  animation: kenburns 22s ease-in-out infinite alternate;
}
@keyframes kenburns{
  from { transform: scale(1.08) translate(0, 0); }
  to   { transform: scale(1.18) translate(-1.5%, -2.5%); }
}
.bg-overlay{
  position: absolute; inset:0;
  background: linear-gradient(180deg,
    rgba(0,0,0,0.55) 0%,
    rgba(0,0,0,0.4) 45%,
    rgba(0,0,0,0.65) 100%);
}

/* =========================================================
   progress & music toggle
   ========================================================= */
#progress{
  position: fixed; top:0; left:0;
  height: 2px; width: 0%;
  background: linear-gradient(90deg, var(--gold-soft), var(--gold));
  z-index: 100;
  transition: width .15s linear;
}
#music-toggle{
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: 16px;
  z-index: 90;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--gold-soft);
  background: rgba(246, 238, 224, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--gold);
  font-size: 20px;
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .2s;
}
#music-toggle:active{ transform: scale(0.92); }
#music-toggle.playing .note-icon{
  animation: spin 4s linear infinite; display: inline-block;
}
@keyframes spin{ to { transform: rotate(360deg); } }

/* =========================================================
   1. cover — option D (pure visual, no "婚礼邀请函")
   ========================================================= */
.cover-screen{
  color: #fff;
  padding: 0;
  align-items: flex-start;        /* put content in upper area, not center */
}
.cover-content{
  position: relative; z-index: 4;
  text-align: center; width: 100%;
  padding: clamp(80px, 18vh, 140px) 32px 0;
}
.cover-content::before{
  content:""; position: absolute;
  left: -20%; right: -20%;
  top: 5%; bottom: 5%;
  background: radial-gradient(ellipse 75% 60% at center,
    rgba(0,0,0,0.75) 0%,
    rgba(0,0,0,0.55) 40%,
    rgba(0,0,0,0.2) 75%,
    rgba(0,0,0,0) 100%);
  z-index: -1;
  pointer-events: none;
}

.cover-title{
  font-family: var(--script-en);
  font-size: clamp(48px, 14vw, 78px);
  font-weight: 400;
  color: #fff;
  line-height: 1.1;
  letter-spacing: -.005em;
  text-shadow:
    0 0 40px rgba(0,0,0,0.85),
    0 4px 20px rgba(0,0,0,0.9),
    0 0 3px rgba(0,0,0,0.6);
  margin: 0 auto;
  display: inline-block;
}
.cover-names-cn{
  font-family: var(--serif-cn);
  font-weight: 500;
  font-size: clamp(24px, 6.5vw, 30px);
  color: #fff;
  letter-spacing: .18em;
  margin-top: 24px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.7);
  opacity: 0;
  animation: fadeUp 1.2s 1.2s forwards;
  white-space: nowrap;
}

.cover-divider{
  display: flex; align-items: center; justify-content: center;
  gap: 12px;
  margin: 30px auto 0;
  opacity: 0;
  animation: fadeUp 1.2s 1.8s forwards;
}
.cover-divider .line{
  width: 56px; height: 1px;
  background: var(--gold-light);
  box-shadow: 0 0 6px rgba(0,0,0,0.5);
}
.cover-divider .dot{
  width: 6px; height: 6px; border: 1px solid var(--gold-light);
  transform: rotate(45deg);
  box-shadow: 0 0 6px rgba(0,0,0,0.5);
}

.cover-date{
  font-family: var(--display-en);
  font-weight: 500;
  font-size: clamp(15px, 3.8vw, 18px);
  color: #fff;
  letter-spacing: .35em;
  text-shadow: 0 2px 10px rgba(0,0,0,0.6);
  opacity: 0;
  animation: fadeUp 1.2s 2s forwards;
}

@keyframes fadeUp{ to { opacity: 1; transform: translateY(0); } }

.scroll-hint{
  position: absolute;
  bottom: max(28px, env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%);
  width: 22px; height: 36px;
  border: 1px solid rgba(255,255,255,0.55);
  border-radius: 12px;
  z-index: 5;
  opacity: 0;
  animation: fadeIn 1s 3s forwards;
}
@keyframes fadeIn{ to { opacity: 1; } }
.scroll-hint span{
  position: absolute; left: 50%; top: 8px;
  width: 3px; height: 7px;
  background: rgba(255,255,255,0.85);
  border-radius: 2px;
  transform: translateX(-50%);
  animation: scroll-dot 1.6s ease-in-out infinite;
}
@keyframes scroll-dot{
  0%, 100% { transform: translate(-50%, 0); opacity:1; }
  60%  { transform: translate(-50%, 12px); opacity:0; }
  61%  { transform: translate(-50%, 0); opacity:0; }
}

/* =========================================================
   handwriting trace (script-trace)
   ========================================================= */
.script-trace{
  display: inline-block;
  position: relative;
  -webkit-clip-path: inset(0 100% 0 0);
          clip-path: inset(0 100% 0 0);
}
.script-trace.is-tracing{
  animation: trace 2.8s cubic-bezier(.55,.05,.32,1) forwards;
}
@keyframes trace{
  to { -webkit-clip-path: inset(0 0 0 0); clip-path: inset(0 0 0 0); }
}

/* =========================================================
   reveal-on-scroll
   ========================================================= */
.reveal{
  opacity: 0; transform: translateY(28px);
  transition: opacity .9s ease, transform .9s ease;
}
.reveal.is-visible{ opacity: 1; transform: translateY(0); }

/* =========================================================
   typography
   ========================================================= */
.kicker{
  font-family: var(--display-en);
  font-size: 12px;
  letter-spacing: .4em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 22px;
  opacity: 0.9;
}
.section-title{
  font-family: var(--serif-cn);
  font-weight: 500;
  font-size: clamp(26px, 6.5vw, 32px);
  letter-spacing: .25em;
  color: var(--ink);
  margin-bottom: 40px;
  margin-left: .25em;
}

/* =========================================================
   2. poem
   ========================================================= */
.poem-line{
  font-family: var(--serif-en);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(20px, 5vw, 24px);
  line-height: 1.7;
  color: var(--ink);
  letter-spacing: .02em;
}
.poem-line + .poem-line{ margin-top: 2px; }
.poem-cn{
  font-family: var(--serif-cn);
  font-weight: 400;
  font-size: clamp(17px, 4.4vw, 20px);
  letter-spacing: .35em;
  margin: 36px 0 0 .35em;
  color: var(--ink-soft);
  line-height: 2;
}

/* =========================================================
   3. names
   ========================================================= */
.names-cn{
  font-family: var(--serif-cn);
  font-weight: 500;
  font-size: clamp(36px, 9vw, 52px);
  color: var(--ink);
  margin: 14px 0 26px;
  display: flex; justify-content: center; align-items: center;
  gap: clamp(14px, 4vw, 24px);
  white-space: nowrap;
}
.names-cn .name{ letter-spacing: .12em; white-space: nowrap; }
.names-cn .amp{
  font-family: var(--serif-en);
  font-style: italic;
  color: var(--gold);
  font-size: .95em;
  font-weight: 300;
}
.names-en{
  font-family: var(--script-en);
  font-size: clamp(26px, 7.5vw, 40px);
  color: var(--gold);
  margin-top: 4px;
  font-weight: 400;
}
.names-tag{
  margin-top: 34px;
  font-family: var(--serif-cn);
  font-weight: 400;
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: .3em;
  margin-left: .3em;
}

/* =========================================================
   4. countdown
   ========================================================= */
.big-date{
  font-family: var(--num-en);
  font-weight: 500;
  font-size: clamp(48px, 13.5vw, 72px);
  color: var(--ink);
  letter-spacing: .02em;
  margin: 14px 0 10px;
  line-height: 1;
}
.big-date i{
  display: inline-block;
  margin: 0 .14em;
  color: var(--gold);
  font-style: normal;
  transform: translateY(-.18em);
  font-size: .65em;
  font-weight: 400;
}
.lunar{
  font-family: var(--serif-cn);
  font-weight: 400;
  font-size: 14px;
  color: var(--ink-soft);
  letter-spacing: .3em;
  margin-left: .3em;
}
.cd-tail{
  margin-top: 6px;
  font-family: var(--serif-cn);
  font-weight: 400;
  font-size: 12px;
  color: var(--gold);
  letter-spacing: .4em;
  margin-left: .4em;
}
.countdown-grid{
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.cd-cell{
  background: linear-gradient(180deg, var(--cream-deep), #F9F0DC);
  border: 1px solid var(--gold-light);
  border-radius: 4px;
  padding: 16px 4px 12px;
  position: relative;
}
.cd-cell::before, .cd-cell::after{
  content:""; position: absolute;
  width: 6px; height: 6px;
  border: 1px solid var(--gold-soft);
  opacity: .5;
}
.cd-cell::before{ top: 3px; left: 3px; border-right: 0; border-bottom: 0; }
.cd-cell::after{ bottom: 3px; right: 3px; border-left: 0; border-top: 0; }
.cd-cell span{
  display: block;
  font-family: var(--num-en);
  font-weight: 500;
  font-size: clamp(24px, 7vw, 32px);
  color: var(--ink);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.cd-cell em{
  display: block;
  margin-top: 6px;
  font-style: normal;
  font-family: var(--serif-cn);
  font-weight: 400;
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: .2em;
  margin-left: .2em;
}

/* =========================================================
   5. schedule — with real PNG icons
   ========================================================= */
.schedule-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 16px;
}
.sched-cell{
  padding: 18px 6px;
  border-left: 1px solid var(--gold-light);
}
.sched-cell:first-child{ border-left: 0; }
.sched-icon{
  height: 56px; width: auto;
  margin: 0 auto 16px;
  display: block;
  opacity: .92;
}
.sched-cell:nth-child(1) .sched-icon{ transform: rotate(-8deg); }
.sched-cell .time{
  font-family: var(--num-en);
  font-size: 26px;
  color: var(--ink);
  font-weight: 500;
  line-height: 1;
  letter-spacing: .02em;
}
.sched-cell .cn{
  margin-top: 14px;
  font-family: var(--serif-cn);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: .25em;
  margin-left: .25em;
  color: var(--ink);
}
.sched-cell .en{
  margin-top: 4px;
  font-family: var(--serif-en);
  font-style: italic;
  font-size: 12px;
  color: var(--gold);
  letter-spacing: .08em;
}

/* =========================================================
   6. location
   ========================================================= */
.venue-cn{
  font-family: var(--serif-cn);
  font-weight: 500;
  font-size: clamp(20px, 5vw, 24px);
  letter-spacing: .2em;
  margin: 20px 0 6px .2em;
  line-height: 1.7;
  color: var(--ink);
}
.venue-en{
  font-family: var(--serif-en);
  font-style: italic;
  font-size: 14px;
  color: var(--gold);
  letter-spacing: .04em;
  line-height: 1.6;
}
.map-wrap{
  margin-top: 32px;
  height: 230px;
  border-radius: 6px;
  border: 1px solid var(--gold-light);
  overflow: hidden;
  position: relative;
  background: #f4ecd8;
  box-shadow: 0 2px 12px rgba(92,66,38,0.08);
}
#amap{ width: 100%; height: 100%; }
/* hide the Amap logo + copyright slightly */
.amap-copyright, .amap-logo{ opacity: .4 !important; transform: scale(.8); transform-origin: bottom left; }

.action-row{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}
.btn-action{
  background: #fff;
  border: 1px solid var(--gold-soft);
  color: var(--gold);
  padding: 13px 0;
  border-radius: 3px;
  font-family: var(--serif-cn);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: .2em;
  margin-left: .2em;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer;
  transition: background .2s, transform .15s;
}
.btn-action svg{ width: 16px; height: 16px; margin-left: -.25em; }
.btn-action:active{
  background: var(--cream-deep);
  transform: scale(0.97);
}
.venue-tip{
  margin-top: 18px;
  font-family: var(--serif-cn);
  font-weight: 400;
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: .2em;
  margin-left: .2em;
}

/* =========================================================
   7-8. photo
   ========================================================= */
.photo-screen .photo-frame{
  margin: 18px auto 28px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--gold-light);
  box-shadow: var(--shadow), 0 0 0 1px rgba(205, 176, 115, 0.15) inset;
  max-width: 340px;
  position: relative;
}
.photo-screen .photo-frame::before,
.photo-screen .photo-frame::after{
  content:""; position: absolute;
  width: 10px; height: 10px;
  border: 1px solid var(--gold);
}
.photo-screen .photo-frame::before{ top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.photo-screen .photo-frame::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.photo-screen .photo-frame img{
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}
.photo-caption{
  font-family: var(--serif-en);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(17px, 4.6vw, 21px);
  color: var(--ink);
  line-height: 1.65;
  margin-bottom: 14px;
}
.photo-caption-cn{
  font-family: var(--serif-cn);
  font-weight: 400;
  font-size: 14px;
  letter-spacing: .3em;
  margin-left: .3em;
  color: var(--ink-soft);
  line-height: 2;
}

/* =========================================================
   9. closing
   ========================================================= */
.closing-screen{ color: #fff; padding: 60px 32px; }
.closing-screen .bg-overlay{
  background: linear-gradient(180deg,
    rgba(0,0,0,0.4) 0%,
    rgba(0,0,0,0.55) 100%);
}
.closing-screen .corner-deco{
  opacity: 0.8;
  width: clamp(120px, 32vw, 170px);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}
.closing-content{
  position: relative; z-index: 2;
  text-align: center; width: 100%;
  max-width: 420px;
}
.blessing-cn{
  font-family: var(--serif-cn);
  font-weight: 500;
  font-size: clamp(26px, 7vw, 32px);
  letter-spacing: .25em;
  margin-left: .25em;
  margin-bottom: 14px;
  line-height: 1.8;
  text-shadow: 0 2px 14px rgba(0,0,0,.5);
}
.blessing-en{
  font-family: var(--script-en);
  font-size: clamp(24px, 6.5vw, 30px);
  color: var(--gold-light);
  line-height: 1.5;
  margin: 10px 0 30px;
  text-shadow: 0 2px 14px rgba(0,0,0,.5);
  font-weight: 400;
  display: block;
}
.signature{
  font-family: var(--display-en);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: .3em;
  opacity: 0.95;
  line-height: 2;
}
.signature p:first-child{
  font-family: var(--serif-cn);
  font-weight: 500;
  letter-spacing: .2em;
  margin-left: .2em;
  font-size: 18px;
}
.closing-foot{
  margin-top: 38px;
  font-family: var(--serif-en);
  font-style: italic;
  font-size: 13px;
  letter-spacing: .25em;
  color: var(--gold-light);
  opacity: .85;
}

/* =========================================================
   toast
   ========================================================= */
#toast{
  position: fixed;
  left: 50%; bottom: 80px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(92, 66, 38, 0.92);
  color: var(--cream);
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 14px;
  letter-spacing: .15em;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 200;
}
#toast.show{
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
