/* ==========================================================
   Chapters A — hero, welcome, blessing, families, countdown
   ========================================================== */

/* ================= HERO ================= */
.hero {
  --archW: clamp(240px, 29vw, 420px);
  position: relative; z-index: 3; min-height: 100svh; overflow: hidden;
  display: grid; grid-template-rows: 1fr auto; padding: 96px var(--gut) 34px;
  background:
    radial-gradient(ellipse 50% 55% at 50% 46%, rgba(225, 240, 234, .9), transparent 70%),
    radial-gradient(ellipse 90% 70% at 50% 110%, rgba(245, 217, 211, .55), transparent 60%),
    var(--ivory);
}
.hero-sprig { position: absolute; width: clamp(140px, 18vw, 260px); height: auto; aspect-ratio: 1; opacity: 0; transition: opacity 2s var(--ease) .6s; }
.hs-1 { left: -2%; top: 8%; rotate: 100deg; }
.hs-2 { right: -2%; bottom: 14%; rotate: -80deg; }
.entered .hero-sprig { opacity: .95; animation: sway 9s ease-in-out infinite; }
.entered .hs-2 { animation-delay: -4s; }
@keyframes sway { 50% { scale: 1.04; filter: hue-rotate(-6deg); } }

.hero-side {
  position: absolute; top: 50%; margin: 0; writing-mode: vertical-rl; translate: 0 -50%;
  font-family: var(--caps); font-size: .62rem; letter-spacing: .5em; text-transform: uppercase; color: var(--rosegold);
  opacity: 0; transition: opacity 1.6s var(--ease) 1.6s;
}
.hs-l { left: var(--gut); rotate: 180deg; }
.hs-r { right: var(--gut); }
.entered .hero-side { opacity: 1; }

.hero-stage { position: relative; display: grid; place-items: center; min-height: calc(var(--archW) * 1.4 + 40px); }
.hero-arch { position: relative; width: var(--archW); aspect-ratio: 100 / 140; }
.arch-mask { position: absolute; inset: 0; clip-path: url(#archClip); overflow: hidden; background: var(--paper-2); }
.arch-mask img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; transform: scale(1.35); transition: transform 3.2s var(--ease); }
.arch-mask::after { content: ''; position: absolute; inset: 0; background: var(--ivory); transform-origin: 50% 0; transition: transform 1.8s var(--ease-io) .2s; }
.entered .arch-mask img { transform: scale(1.04); animation: kenburns 22s ease-in-out 3.2s infinite alternate; }
.entered .arch-mask::after { transform: scaleY(0); }
@keyframes kenburns { from { transform: scale(1.04); } to { transform: scale(1.14) translateY(-2%); } }

.arch-line { position: absolute; inset: -16px; width: calc(100% + 32px); height: calc(100% + 32px); overflow: visible; pointer-events: none; }
.arch-line path { fill: none; stroke: url(#foil); stroke-width: 1.3; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 3s var(--ease-io) .5s; }
.entered .arch-line path { stroke-dashoffset: 0; }
.hero-arch::after { /* lotus pond line under the arch */
  content: ''; position: absolute; left: -30px; right: -30px; bottom: -16px; height: 1px; background: linear-gradient(90deg, transparent, var(--rosegold), transparent);
}

.hero-names { position: absolute; inset: 0; margin: 0; font-weight: 400; pointer-events: none; }
.hn {
  position: absolute; font-family: var(--script); font-size: clamp(3.4rem, 9.2vw, 9.4rem); line-height: 1;
  color: var(--wine); white-space: nowrap; text-shadow: 0 0 30px rgba(251, 247, 240, .85), 0 0 2px rgba(251, 247, 240, .6);
}
.hn-1 { top: 6%; right: calc(50% + var(--archW) * .08); }
.hn-2 { bottom: 4%; left: calc(50% + var(--archW) * .02); }
.wipe { display: inline-block; padding: .12em .32em .22em .2em; clip-path: inset(0 100% 0 0); transition: clip-path 2.4s var(--ease-io); }
.entered .hn-1 .wipe { transition-delay: 1s; clip-path: inset(0 0 0 0); }
.entered .hn-2 .wipe { transition-delay: 1.7s; clip-path: inset(0 0 0 0); }
.hn-amp {
  position: absolute; top: 50%; left: calc(50% - var(--archW) / 2); translate: -50% -50%;
  width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%;
  font-family: var(--serif); font-style: italic; font-size: 2rem; color: var(--rosegold);
  background: var(--ivory); box-shadow: 0 0 0 1px rgba(180, 122, 99, .5), 0 0 0 6px var(--ivory), 0 0 0 7px rgba(180, 122, 99, .3), 0 18px 30px -16px rgba(86, 24, 49, .5);
  opacity: 0; scale: .4; transition: opacity 1s var(--ease) 2.2s, scale 1.2s var(--ease) 2.2s;
}
.entered .hn-amp { opacity: 1; scale: 1; }

.hero-foot { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; margin-top: 18px; opacity: 0; transform: translateY(24px); transition: opacity 1.4s var(--ease) 2.4s, transform 1.4s var(--ease) 2.4s; }
.entered .hero-foot { opacity: 1; transform: none; }
.medal { width: 118px; justify-self: start; }
.medal svg { width: 100%; height: auto; overflow: visible; }
.medal-spin { transform-origin: 100px 100px; animation: spin 40s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.m-arc { font-family: var(--caps); font-size: 13px; letter-spacing: 4px; fill: var(--wine); }
.m-day { font-variant-numeric: lining-nums; font-family: var(--serif); font-size: 40px; font-weight: 500; fill: var(--wine); }
.m-yr { font-variant-numeric: lining-nums; font-family: var(--serif); font-size: 20px; fill: var(--rosegold); }
.hero-invite { margin: 0; text-align: center; font-style: italic; color: var(--muted); font-size: 1.08rem; line-height: 1.5; }
.scroll-cue { justify-self: end; display: flex; flex-direction: column; align-items: center; gap: 10px; text-decoration: none; font-family: var(--caps); font-size: .56rem; letter-spacing: .4em; color: var(--rosegold); }
.scroll-cue i { position: relative; width: 1px; height: 54px; overflow: hidden; background: rgba(180, 122, 99, .25); }
.scroll-cue i::after { content: ''; position: absolute; left: 0; top: -50%; width: 100%; height: 50%; background: var(--wine); animation: drip 2.2s var(--ease-io) infinite; }
@keyframes drip { to { top: 100%; } }

@media (max-width: 760px) {
  .hero { --archW: min(62vw, 300px); padding-top: 84px; }
  .hero-side { display: none; }
  .hero-stage { padding: 3.4rem 0 3.8rem; }
  .hn { font-size: clamp(3rem, 15vw, 4.6rem); }
  .hn-1 { top: 0; right: auto; left: 2%; }
  .hn-2 { bottom: 0; left: auto; right: 2%; }
  .hn-amp { width: 50px; height: 50px; font-size: 1.6rem; }
  .hero-foot { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 14px; }
  .medal { justify-self: center; width: 104px; }
  .scroll-cue { justify-self: center; }
}

/* ================= WELCOME ================= */
.welcome {
  position: relative; z-index: 3; text-align: center; padding: clamp(90px, 12vw, 150px) var(--gut);
  background: linear-gradient(180deg, var(--ivory), var(--mint) 50%, var(--ivory));
}
.welcome-lotus { width: 64px; height: 40px; color: var(--rosegold); }
.welcome-host { margin: 1rem 0 0; font-family: var(--caps); font-size: .8rem; letter-spacing: .36em; text-transform: uppercase; color: var(--wine); }
.welcome-mid { margin: .4rem 0; font-style: italic; color: var(--muted); }
.welcome-guest { margin: 0; font-family: var(--script); font-size: clamp(3.2rem, 9vw, 6.6rem); line-height: 1.15; padding: 0 .2em; }
.welcome-note { max-width: 520px; margin: 1rem auto 0; font-style: italic; color: var(--muted); }

/* ================= I · BLESSING / PAPER ================= */
.blessing-ch { background: var(--ivory); }
.paper {
  position: relative; max-width: 660px; margin: 0 auto; padding: clamp(14px, 2.4vw, 22px);
  background: linear-gradient(180deg, #fffdf9, #faf3e8);
  border-radius: 999px 999px 22px 22px / 260px 260px 22px 22px;
  box-shadow: var(--shadow);
}
.paper-in {
  position: relative; text-align: center; padding: clamp(80px, 12vw, 120px) clamp(20px, 6vw, 70px) clamp(50px, 7vw, 70px);
  border: 1px solid rgba(180, 122, 99, .55); border-radius: inherit;
  outline: 1px solid rgba(180, 122, 99, .25); outline-offset: -8px;
}
.paper-sprig { position: absolute; width: clamp(110px, 18vw, 170px); height: auto; aspect-ratio: 1; z-index: 2; pointer-events: none; }
.paper-sprig.tl { left: -40px; top: 34%; rotate: 70deg; }
.paper-sprig.br { right: -40px; bottom: 6%; rotate: -110deg; }
.paper-ganesha { width: 64px; height: 64px; color: var(--wine); }
.p-shloka { margin: .4rem 0 1.6rem; font-style: italic; font-size: .95rem; letter-spacing: .06em; color: var(--muted); }
.p-parents { margin: 0; font-size: clamp(1.4rem, 3vw, 1.9rem); line-height: 1.35; color: var(--wine); font-weight: 500; }
.p-parents span { font-style: italic; color: var(--rosegold); }
.p-copy { margin: 1.4rem 0; font-style: italic; color: var(--ink); }
.p-name { margin: .2rem 0 0; font-family: var(--script); font-size: clamp(3.4rem, 9vw, 5rem); line-height: 1.1; color: var(--wine); }
.p-rel { margin: .2rem 0 0; font-size: .95rem; font-style: italic; color: var(--muted); }
.p-with { margin: 1rem 0 .2rem; font-family: var(--caps); font-size: .7rem; letter-spacing: .4em; color: var(--rosegold); }
.p-compl { margin: 0; font-style: italic; color: var(--muted); }
.p-compl b { display: inline-block; margin-top: .4rem; font-style: normal; font-weight: 500; color: var(--wine); font-size: 1.1rem; }
.js .paper .line { opacity: 0; transform: translateY(18px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); transition-delay: var(--d, 0s); }
.js .paper.in .line { opacity: 1; transform: none; }

/* ================= II · FAMILIES ================= */
.families { background: linear-gradient(180deg, var(--ivory), var(--paper)); }
.fam-grid { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: clamp(24px, 4vw, 60px); max-width: 1200px; margin: 0 auto; }
.fam { text-align: center; }
.fam-role { margin: 0; font-family: var(--caps); font-size: .7rem; letter-spacing: .42em; text-transform: uppercase; color: var(--rosegold); }
.fam-name { margin: .2rem 0 0; font-family: var(--script); font-weight: 400; font-size: clamp(3.6rem, 7vw, 6rem); line-height: 1.1; color: var(--wine); }
.fam-full { margin: 0; font-family: var(--caps); font-size: .78rem; letter-spacing: .18em; color: var(--ink); }
.fam-rule { display: block; width: 1px; height: 46px; margin: 1.2rem auto; background: linear-gradient(var(--rosegold), transparent); }
.fam-of { margin: 0; font-style: italic; color: var(--muted); }
.fam-parents { margin: .4rem 0 0; font-size: 1.15rem; font-weight: 500; color: var(--wine); line-height: 1.5; }
.fam-parents i { color: var(--rosegold); font-weight: 400; }
.fam-center { position: relative; width: clamp(280px, 30vw, 380px); aspect-ratio: 1; display: grid; place-items: center; }
.ring-text { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 50s linear infinite; }
.ring-text text { font-family: var(--caps); font-size: 11.4px; letter-spacing: 3.2px; fill: var(--rosegold); }
.fam-arch { position: relative; width: 62%; aspect-ratio: 100 / 140; clip-path: url(#archClip); overflow: hidden; box-shadow: var(--shadow); }
.fam-arch img { width: 100%; height: 118%; object-fit: cover; object-position: 50% 20%; margin-top: -9%; }

@media (max-width: 900px) {
  .fam-grid { grid-template-columns: 1fr; }
  .fam-center { order: -1; margin: 0 auto; width: min(320px, 82vw); }
}

/* ================= III · COUNTDOWN ================= */
.countdown {
  position: relative; z-index: 3; overflow: hidden; text-align: center; color: var(--ivory);
  padding: clamp(100px, 13vw, 170px) var(--gut);
  background: radial-gradient(ellipse 80% 90% at 50% 0%, #7a2647, var(--wine) 50%, var(--wine-2));
}
.cd-pattern {
  position: absolute; inset: -50%; opacity: .11; animation: spin 240s linear infinite;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23e9c2aa' stroke-width='1'%3E%3Cpath d='M40 6 C50 22 58 30 74 40 C58 50 50 58 40 74 C30 58 22 50 6 40 C22 30 30 22 40 6Z'/%3E%3Ccircle cx='40' cy='40' r='9'/%3E%3Ccircle cx='0' cy='0' r='6'/%3E%3Ccircle cx='80' cy='0' r='6'/%3E%3Ccircle cx='0' cy='80' r='6'/%3E%3Ccircle cx='80' cy='80' r='6'/%3E%3C/g%3E%3C/svg%3E") center / 80px;
}
.countdown > *:not(.cd-pattern) { position: relative; }
.cd-kicker { text-wrap: balance; margin: 0 0 2.4rem; font-family: var(--script); font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1.2; color: var(--rosegold-lt); }
.cd-grid { display: grid; grid-template-columns: repeat(4, auto); justify-content: center; }
.cd-cell { padding: 0 clamp(14px, 4vw, 54px); display: flex; flex-direction: column; align-items: center; }
.cd-cell + .cd-cell { border-left: 1px solid rgba(233, 194, 170, .3); }
.cd-n {
  font-family: var(--serif); font-weight: 300; font-size: clamp(3rem, 10vw, 8rem); line-height: 1; font-variant-numeric: lining-nums tabular-nums;
  background: var(--foil); background-size: 260% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: foil 6s var(--ease-io) infinite alternate;
}
.cd-n.tick { animation: tick .7s var(--ease), foil 6s var(--ease-io) infinite alternate; }
@keyframes tick { from { opacity: .2; transform: translateY(-30%); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.cd-l { margin-top: .7rem; font-family: var(--caps); font-size: .62rem; letter-spacing: .38em; text-transform: uppercase; color: rgba(251, 247, 240, .7); }
.cd-date { text-wrap: balance; margin: 2.8rem 0 0; font-style: italic; color: rgba(251, 247, 240, .75); }
.cd-done { margin: 2rem 0 0; font-family: var(--script); font-size: 2.6rem; color: var(--rosegold-lt); }
/* phones — compact: one row of four, tighter rhythm */
@media (max-width: 560px) {
  .countdown { padding: 56px 14px 52px; }
  .countdown .ch-num { margin-bottom: .5rem; font-size: .66rem; }
  .cd-kicker { margin-bottom: 1.4rem; font-size: 1.9rem; }
  .cd-grid { grid-template-columns: repeat(4, 1fr); max-width: 360px; margin: 0 auto; }
  .cd-cell { padding: 0 4px; }
  .cd-n { font-size: clamp(2.2rem, 11vw, 2.8rem); }
  .cd-l { margin-top: .4rem; font-size: .5rem; letter-spacing: .22em; }
  .cd-date { margin-top: 1.4rem; font-size: .88rem; }
  .cd-done { font-size: 2rem; }
}
