:root {
  --bg: #fffcf8;
  --white: #fffdfa;
  --cream: #f8f0e3;
  --beige: #dbc2a7;
  --beige-deep: #a37f64;
  --pink: #f4ccd6;
  --pink-deep: #c98b9c;
  --rose: #b87386;
  --ink: #4f3d35;
  --ink-soft: #7f6b61;
  --shadow: 0 26px 70px rgba(103, 74, 58, 0.10);
  --radius: 34px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 0;
  color: var(--ink);
  font-family: "Manrope", system-ui, sans-serif;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% 0%, rgba(244,204,214,.25), transparent 28%),
    radial-gradient(circle at 100% 15%, rgba(219,194,167,.22), transparent 32%),
    linear-gradient(180deg, rgba(255,255,255,.74), rgba(248,240,227,.28)),
    var(--bg);
}
body::before, body::after {
  content: "";
  position: fixed;
  inset: 12px;
  border: 1px solid rgba(201,139,156,.14);
  border-radius: 32px;
  pointer-events: none;
  z-index: 0;
}
body::after {
  inset: 24px;
  border-color: rgba(163,127,100,.08);
  border-style: dashed;
}
.page-bg, .grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.grain {
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.34) 0 1px, transparent 1px),
    radial-gradient(circle at 80% 40%, rgba(255,255,255,.23) 0 1px, transparent 1px);
  background-size: 20px 20px, 18px 18px;
  opacity: .24;
}
a { color: inherit; text-decoration: none; }
main, footer { position: relative; z-index: 1; }

/* persistent animated floral layer */
.three-hero {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 1;
  pointer-events: none;
  overflow: hidden;
}
.three-hero canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* invitation fills roughly 90% of the viewport */
.hero {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) 12px max(24px, env(safe-area-inset-bottom));
  position: relative;
}
.hero-invitation {
  position: relative;
  width: min(90vw, 1080px);
  height: min(90svh, 1010px);
  min-height: 640px;
  display: grid;
  place-items: center;
  z-index: 2;
  isolation: isolate;
}
.hero-svg-stage {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: visible;
  filter: drop-shadow(0 24px 38px rgba(108,78,62,.12));
}
.hero-svg-art {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  opacity: 1;
}
.hero-copy-over-svg {
  position: relative;
  z-index: 2;
  width: min(54%, 560px);
  max-height: 82%;
  margin: 0 auto;
  padding: clamp(10px, 2vh, 24px) clamp(8px, 2vw, 22px);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.hero-copy-over-svg::before {
  content: "";
  position: absolute;
  inset: -20px -26px;
  z-index: -1;
  border-radius: 28px;
  background: radial-gradient(circle at center, rgba(255,253,250,.78) 0%, rgba(255,252,248,.60) 43%, rgba(255,250,246,.18) 68%, rgba(255,250,246,0) 100%);
  box-shadow: 0 18px 45px rgba(164, 135, 112, .10);
  backdrop-filter: blur(1.5px);
}
.hero-kicker, .section-kicker, .meta-label, .event-kicker {
  letter-spacing: .18em;
  text-transform: uppercase;
  font-size: .72rem;
  color: var(--pink-deep);
  font-weight: 700;
}
.guest-line, .invite-line, .section-copy, .venue-info p, footer {
  color: var(--ink-soft);
  line-height: 1.7;
}
.guest-line { margin: 8px 0 7px; }
.invite-line { margin: 0 0 9px; font-size: .9rem; }
.couple-names {
  width: 100%;
  margin: 0;
  font-family: "Cormorant Garamond", "Noto Serif Bengali", serif;
  display: grid;
  gap: 8px;
  font-weight: 600;
}
.person-block {
  display: grid;
  gap: 7px;
}
.name-text {
  display: block;
  font-size: clamp(2.45rem, 5.8vw, 5.55rem);
  line-height: .92;
  color: var(--ink);
  opacity: .64;
  text-shadow: 0 1px 0 rgba(255,255,255,.22);
}


.parents-block {
  display: grid;
  justify-items: center;
  gap: 1px;
  margin-top: 2px;
  font-family: "Manrope", system-ui, sans-serif;
  color: rgba(79,61,53,.86);
}
.parent-role {
  display: block;
  margin-bottom: 3px;
  font-size: clamp(.90rem, 1.55vw, 1.08rem);
  line-height: 1.25;
  font-weight: 600;
  color: rgba(79,61,53,.80);
}
.parent-name {
  display: block;
  font-size: clamp(1rem, 1.85vw, 1.22rem);
  line-height: 1.25;
  font-weight: 650;
  color: rgba(79,61,53,.92);
}
.parent-join {
  display: block;
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.02rem;
  line-height: 1;
  color: var(--pink-deep);
}

.couple-names .bn { display: block; }
.couple-names small {
  justify-self: center;
  display: block;
  margin: 9px 0;
  font-size: .25em;
  letter-spacing: .16em;
  font-family: "Manrope", sans-serif;
  text-transform: uppercase;
  color: var(--pink-deep);
  opacity: 1;
}
.invite-meta {
  width: 100%;
  margin: 22px auto 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.invite-meta-box {
  min-width: 0;
  padding: 11px 8px;
  border-radius: 18px;
  background: rgba(255,253,250,.58);
  border: 1px solid rgba(163,127,100,.10);
  backdrop-filter: blur(4px);
}
.invite-meta-box strong, .invite-meta-box span { display: block; }
.invite-meta-box strong {
  margin-top: 5px;
  color: var(--ink);
  font-size: .79rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.invite-meta-box span:last-child {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: .70rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.hero-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.primary-btn, .soft-btn, .ghost-btn, .text-btn, .admin-footer-btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
}
.primary-btn, .soft-btn, .ghost-btn, .admin-footer-btn {
  padding: 12px 19px;
  border-radius: 999px;
}
.primary-btn {
  background: linear-gradient(180deg, var(--pink-deep), #ba7789);
  color: white;
  box-shadow: 0 12px 26px rgba(201,139,156,.25);
}
.soft-btn {
  background: rgba(255,255,255,.76);
  border: 1px solid rgba(163,127,100,.14);
  color: var(--ink);
}

.luxe-panel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.76), rgba(248,240,227,.66));
  border: 1px solid rgba(163,127,100,.16);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.luxe-panel::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(201,139,156,.11);
  border-radius: calc(var(--radius) - 10px);
  pointer-events: none;
}

.section { padding: 88px clamp(16px, 5vw, 80px); }
.section-heading {
  max-width: 760px;
  margin: 0 auto 38px;
  text-align: center;
}
.section-heading h2, .venue-info h3, .admin-card h1 {
  margin: 10px 0 12px;
  font-family: "Cormorant Garamond", "Noto Serif Bengali", serif;
  font-weight: 600;
  color: var(--ink);
}
.section-heading h2 { font-size: clamp(2.35rem, 5vw, 4.2rem); line-height: .98; }

.countdown-grid {
  width: min(900px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.countdown-card {
  min-height: 172px;
  padding: 28px 14px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.countdown-card strong {
  position: relative;
  z-index: 1;
  display: block;
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(3.2rem, 7vw, 5.3rem);
  font-weight: 600;
  line-height: .78;
  color: var(--rose);
}
.countdown-card span {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 32px;
  line-height: 1.2;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: .17em;
  font-size: .75rem;
}

.venue-layout {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: .82fr 1.38fr;
  gap: 20px;
  align-items: stretch;
}
.venue-info {
  min-height: 420px;
  padding: 38px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.venue-info h3 { font-size: clamp(2.1rem, 4vw, 3.2rem); line-height: 1; }
.venue-info p { margin: 0 0 24px; }
.venue-info .primary-btn { align-self: flex-start; }
.map-shell { min-height: 420px; padding: 10px; }
.map-shell iframe {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: 398px;
  border: 0;
  border-radius: 25px;
  background: var(--cream);
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px clamp(16px, 5vw, 74px) max(36px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(163,127,100,.10);
}
.admin-footer-btn {
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(163,127,100,.16);
  color: var(--ink-soft);
  font-size: .82rem;
  padding: 9px 14px;
}
.form-message { min-height: 1.2em; color: var(--pink-deep); }
.hidden { display: none !important; }
.muted { color: var(--ink-soft); }

/* Admin */
.admin-page {
  min-height: 100vh;
  padding: 40px 20px;
  background: radial-gradient(circle at 10% 10%, rgba(244,204,214,.22), transparent 30%), linear-gradient(180deg, rgba(255,252,248,.96), rgba(248,240,227,.72));
}
.admin-shell { width: min(1050px,100%); margin: 0 auto; position: relative; z-index: 1; }
.back-link { display: inline-block; margin-bottom: 20px; color: var(--ink-soft); }
.admin-card {
  border-radius: 28px;
  padding: clamp(24px,4vw,42px);
  background: rgba(255,255,255,.90);
  border: 1px solid rgba(163,127,100,.14);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.admin-card form { display: grid; gap: 14px; margin-top: 24px; }
.admin-card label { display: grid; gap: 8px; color: var(--ink-soft); }
.admin-header, .admin-subhead, .link-row, .invite-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.invite-form { grid-template-columns: 1fr auto !important; align-items: end; }
.ghost-btn { background: rgba(248,240,227,.88); color: var(--ink); border: 1px solid rgba(163,127,100,.10); }
.text-btn { background: transparent; color: var(--pink-deep); }
.created-invite { margin: 24px 0; padding: 18px; background: rgba(244,204,214,.18); border-radius: 18px; }
.created-invite > span { display: block; margin-bottom: 8px; color: var(--ink-soft); font-size: .92rem; }
.link-row input { flex: 1; }
.invite-list-wrap { margin-top: 34px; }
.invite-list { display: grid; gap: 12px; }
.invite-row { padding: 16px; border: 1px solid rgba(163,127,100,.12); border-radius: 16px; background: rgba(255,255,255,.92); }
.invite-meta { min-width: 0; }
.invite-meta strong, .invite-meta small { display: block; }
.invite-meta small { margin-top: 4px; color: var(--ink-soft); word-break: break-all; }
.invite-actions { display: flex; gap: 8px; }
.settings-card { margin-top: 28px; padding-top: 28px; border-top: 1px solid rgba(163,127,100,.12); }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.settings-grid .wide { grid-column: 1 / -1; }
.settings-actions { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.settings-actions .form-message { margin: 0; }
input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(163,127,100,.20);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255,255,255,.92);
  color: var(--ink);
  font: inherit;
  outline: none;
}
input:focus { border-color: var(--pink-deep); box-shadow: 0 0 0 4px rgba(201,139,156,.12); }

/* tablet */
@media (max-width: 980px) {
  .hero-invitation { width: 92vw; height: 90svh; }
  .hero-copy-over-svg { width: min(64%, 540px); }
  .invite-meta { grid-template-columns: 1fr 1fr; }
  .invite-meta .place-box { grid-column: 1 / -1; }
  .countdown-grid { grid-template-columns: repeat(2, 1fr); }
  .venue-layout, .settings-grid { grid-template-columns: 1fr; }
  .settings-grid .wide { grid-column: auto; }
  .venue-info { min-height: auto; }
}

/* phones */
@media (max-width: 640px) {
  body::before { inset: 7px; border-radius: 24px; }
  body::after { inset: 14px; border-radius: 20px; }
  .hero { padding-left: 7px; padding-right: 7px; }
  .hero-invitation {
    width: 94vw;
    height: 90svh;
    min-height: 610px;
  }
  .hero-svg-stage { border-radius: 22px; }
  .hero-svg-art {
    object-fit: contain;
    object-position: 50% 50%;
  }
  .hero-copy-over-svg {
    width: min(74%, 420px);
    max-height: 78%;
    padding: 8px 2px;
  }
  .hero-kicker { font-size: .60rem; letter-spacing: .12em; }
  .guest-line { font-size: .74rem; line-height: 1.4; margin: 5px 0; }
  .invite-line { font-size: .70rem; line-height: 1.35; margin-bottom: 7px; }
  .couple-names { font-size: clamp(2.0rem, 11vw, 3.6rem); line-height: .86; }
  .couple-names small {
  justify-self: center; margin: 6px 0; }
  .invite-meta { grid-template-columns: 1fr; gap: 5px; margin: 13px auto 11px; }
  .invite-meta .place-box { grid-column: auto; }
  .invite-meta-box { padding: 7px 6px; border-radius: 12px; }
  .meta-label { font-size: .52rem; }
  .invite-meta-box strong { font-size: .65rem; margin-top: 2px; }
  .invite-meta-box span:last-child { font-size: .58rem; line-height: 1.25; }
  .hero-actions { gap: 7px; }
  .primary-btn, .soft-btn { padding: 9px 14px; font-size: .72rem; }

  .section { padding: 72px 14px; }
  .section-heading { margin-bottom: 28px; }
  .section-heading h2 { font-size: clamp(2.1rem, 11vw, 3.1rem); }
  .section-copy { font-size: .9rem; }
  .countdown-grid { gap: 10px; }
  .countdown-card { min-height: 138px; padding: 22px 8px 18px; }
  .countdown-card strong { font-size: clamp(3.2rem, 18vw, 4.4rem); }
  .countdown-card span { margin-top: 26px; font-size: .62rem; letter-spacing: .13em; }

  .venue-info { padding: 28px 22px; }
  .venue-info h3 { font-size: 2.3rem; }
  .venue-info .primary-btn { align-self: stretch; text-align: center; }
  .map-shell { min-height: 350px; padding: 7px; }
  .map-shell iframe { min-height: 336px; border-radius: 20px; }

  footer { align-items: stretch; flex-direction: column; text-align: center; }
  .admin-footer-btn { align-self: center; }

  .invite-form { grid-template-columns: 1fr !important; }
  .admin-header, .admin-subhead, .invite-row, .link-row, .invite-actions, .settings-actions { flex-direction: column; align-items: stretch; }
  .invite-actions button { width: 100%; }
}

/* short-height phones */
@media (max-width: 640px) and (max-height: 720px) {
  .hero-invitation { height: 94svh; min-height: 560px; }
  .hero-copy-over-svg { width: 76%; transform: scale(.92); }
}


.hero-invitation::before {
  content: "";
  position: absolute;
  inset: 4% 7%;
  background: radial-gradient(circle at center, rgba(255,252,248,.12), rgba(255,252,248,0));
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
}
.hero-copy-over-svg .guest-line {
  max-width: 34ch;
}
.hero-copy-over-svg .invite-line {
  max-width: 36ch;
}
@media (max-width: 980px) {
  .hero-copy-over-svg {
    width: min(62%, 500px);
  }
  .name-text {
    font-size: clamp(2.15rem, 6.5vw, 4.1rem);
  }
}
@media (max-width: 680px) {
  .hero-invitation {
    width: min(94vw, 760px);
    height: min(92svh, 980px);
    min-height: 660px;
  }
  .hero-copy-over-svg {
    width: min(64%, 340px);
    max-height: 84%;
    padding: 12px 8px;
  }
  .hero-kicker, .section-kicker, .meta-label, .event-kicker {
    font-size: .64rem;
    letter-spacing: .16em;
  }
  .guest-line {
    margin-top: 4px;
    margin-bottom: 6px;
    font-size: .83rem;
    line-height: 1.48;
  }
  .invite-line {
    font-size: .77rem;
    line-height: 1.4;
  }
  .name-text {
    font-size: clamp(1.72rem, 8.2vw, 3rem);
    opacity: .52;
  }
  .parent-line {
    font-size: .73rem;
    line-height: 1.32;
  }
  .couple-names small {
    margin: 2px 0;
    font-size: .24em;
  }
  .invite-meta {
    margin-top: 14px;
    gap: 6px;
  }
  .invite-meta-box {
    padding: 10px 7px;
  }
  .invite-meta-box strong {
    font-size: .70rem;
  }
  .invite-meta-box span:last-child {
    font-size: .64rem;
  }
}
@media (max-width: 430px) {
  .hero {
    padding-left: 6px;
    padding-right: 6px;
  }
  .hero-invitation {
    width: 96vw;
    height: min(94svh, 920px);
    min-height: 620px;
  }
  .hero-copy-over-svg {
    width: min(66%, 288px);
    padding: 10px 6px;
  }
  .name-text {
    font-size: clamp(1.50rem, 8.8vw, 2.55rem);
    opacity: .54;
  }
  .parent-line {
    font-size: .66rem;
  }
  .hero-actions .primary-btn,
  .hero-actions .soft-btn {
    padding: 10px 15px;
    font-size: .88rem;
  }
}


/* v10 invitation readability + mobile parent layout */
@media (max-width: 680px) {
  .parents-block { gap: 0; }
  .parent-role {
    font-size: .76rem;
    margin-bottom: 2px;
  }
  .parent-name {
    font-size: .82rem;
    line-height: 1.22;
  }
  .parent-join {
    font-size: .82rem;
  }
  .name-text {
    opacity: .68;
  }
}
@media (max-width: 430px) {
  .parent-role { font-size: .68rem; }
  .parent-name { font-size: .75rem; }
  .parent-join { font-size: .75rem; }
  .name-text { opacity: .70; }
}


/* v11: full-height, non-squished mobile invitation artwork */
@media (max-width: 680px) {
  .hero {
    min-height: 100svh;
    padding: 0;
    overflow: hidden;
  }

  .hero-invitation {
    width: 100vw;
    height: 100svh;
    min-height: 100svh;
    max-width: none;
    overflow: hidden;
  }

  .hero-svg-stage {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: 0;
  }

  .hero-svg-art {
    position: absolute;
    top: 50%;
    left: 50%;
    height: 100%;
    width: auto;
    min-width: 100%;
    max-width: none;
    transform: translate(-50%, -50%);
    object-fit: unset;
    object-position: unset;
  }

  .hero-copy-over-svg {
    width: min(72vw, 360px);
    max-height: 88svh;
    padding: 8px 4px;
  }

  .name-text {
    font-size: clamp(2.15rem, 10.5vw, 3.65rem);
    line-height: .88;
    opacity: .72;
  }

  .parent-role {
    font-size: .82rem;
  }

  .parent-name {
    font-size: .92rem;
    line-height: 1.18;
  }

  .parent-join {
    font-size: .88rem;
  }
}

@media (max-width: 430px) {
  .hero-copy-over-svg {
    width: min(74vw, 310px);
    max-height: 90svh;
  }

  .name-text {
    font-size: clamp(2rem, 11.5vw, 3.15rem);
    opacity: .74;
  }

  .parent-role {
    font-size: .76rem;
  }

  .parent-name {
    font-size: .84rem;
  }

  .parent-join {
    font-size: .82rem;
  }
}

/* Very tall/narrow phones: keep the SVG full-height and allow more side crop. */
@media (max-width: 430px) and (min-height: 780px) {
  .hero-svg-art {
    height: 104%;
  }

  .hero-copy-over-svg {
    width: min(72vw, 300px);
  }
}


/* v12: cohesive invitation + separate event-details block */
.invitation-stack {
  width: min(92vw, 1120px);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
}

/* The floral invitation remains the focal piece. */
.invitation-stack .hero-invitation {
  width: min(90vw, 1040px);
  height: min(78svh, 880px);
  min-height: 650px;
  flex: 0 0 auto;
}

/* Keep details visually attached to the invitation instead of isolated cards. */
.event-details-panel {
  position: relative;
  z-index: 4;
  width: min(86vw, 980px);
  margin-top: 34px;
  padding: 24px 26px;
  display: grid;
  grid-template-columns: minmax(130px, .75fr) 1px minmax(120px, .65fr) 1px minmax(260px, 1.7fr) auto;
  align-items: center;
  gap: 20px;
  border: 1px solid rgba(163,127,100,.15);
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,.96), rgba(255,252,247,.88) 58%, rgba(248,240,227,.86)),
    var(--cream);
  box-shadow: 0 24px 58px rgba(103,74,58,.13);
  backdrop-filter: blur(18px);
}
.event-details-panel::before {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 20px;
  border: 1px solid rgba(201,139,156,.10);
  pointer-events: none;
}
.event-detail-item {
  position: relative;
  z-index: 1;
  min-width: 0;
  text-align: center;
}
.event-detail-item > span,
.event-detail-item > strong {
  display: block;
}
.event-detail-item strong {
  margin-top: 5px;
  color: var(--ink);
  font-family: "Cormorant Garamond", "Noto Serif Bengali", serif;
  font-size: clamp(1.18rem, 1.7vw, 1.55rem);
  line-height: 1.08;
  font-weight: 650;
}
.event-place-item > span:last-child {
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: .76rem;
  line-height: 1.35;
}
.event-detail-divider {
  position: relative;
  z-index: 1;
  width: 1px;
  height: 58px;
  background: linear-gradient(180deg, transparent, rgba(163,127,100,.25), transparent);
}
.event-details-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.event-details-actions .primary-btn,
.event-details-actions .soft-btn {
  white-space: nowrap;
  padding: 11px 16px;
  font-size: .88rem;
}

/* Desktop: avoid the disconnected, card-island look. */
@media (min-width: 981px) {
  .hero {
    padding-top: 26px;
    padding-bottom: 78px;
  }
  .event-details-panel {
    margin-top: 42px;
  }
  .hero-copy-over-svg {
    width: min(49%, 520px);
  }
  .hero-copy-over-svg::before {
    inset: -24px -34px;
  }
}

/* Tablet keeps one cohesive wide details block. */
@media (max-width: 980px) and (min-width: 641px) {
  .invitation-stack {
    width: 94vw;
  }
  .invitation-stack .hero-invitation {
    width: 92vw;
    height: min(84svh, 900px);
  }
  .event-details-panel {
    width: min(90vw, 780px);
    grid-template-columns: 1fr 1px 1fr 1px 1.65fr;
    margin-top: 34px;
  }
  .event-details-actions {
    grid-column: 1 / -1;
    justify-content: center;
  }
}

/* Mobile: preserve v11's height-first SVG scaling, then place details naturally below. */
@media (max-width: 640px) {
  .hero {
    min-height: auto;
    padding-bottom: 44px;
  }
  .invitation-stack {
    width: 100%;
  }
  .invitation-stack .hero-invitation {
    width: 100vw;
    height: 100svh;
    min-height: 620px;
  }
  .event-details-panel {
    width: calc(100vw - 24px);
    margin-top: 30px;
    padding: 19px 17px 17px;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-radius: 24px;
  }
  .event-detail-item {
    padding: 8px 10px 14px;
  }
  .event-detail-item:nth-of-type(1) {
    border-right: 1px solid rgba(163,127,100,.12);
  }
  .event-detail-divider {
    display: none;
  }
  .event-place-item {
    grid-column: 1 / -1;
    padding-top: 16px;
    border-top: 1px solid rgba(163,127,100,.12);
  }
  .event-detail-item strong {
    font-size: 1.25rem;
  }
  .event-place-item > span:last-child {
    font-size: .72rem;
  }
  .event-details-actions {
    grid-column: 1 / -1;
    justify-content: center;
    padding-top: 4px;
  }
}

@media (max-width: 430px) {
  .event-details-panel {
    width: calc(100vw - 18px);
    padding-left: 12px;
    padding-right: 12px;
  }
  .event-detail-item {
    padding-left: 6px;
    padding-right: 6px;
  }
}

/* ============================================================
   v14 responsive composition reset
   The invitation scales from the artwork itself, not viewport width.
   ============================================================ */

.hero {
  min-height: auto;
  display: block;
  overflow: visible;
  padding: 28px 14px 78px;
}

.invitation-stack {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Desktop/tablet artwork is always square and sized from vmin.
   This prevents wide monitors from making the names enormous. */
.invitation-stack .hero-invitation {
  container-type: inline-size;
  width: min(72vmin, 760px, calc(100vw - 40px));
  height: auto;
  aspect-ratio: 1 / 1;
  min-height: 0;
  max-width: none;
  overflow: visible;
  display: grid;
  place-items: center;
}

.hero-svg-stage {
  position: absolute;
  inset: 0;
  overflow: visible;
  border-radius: 0;
}

.hero-svg-art {
  position: static;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  object-position: center;
  transform: none;
  display: block;
}

/* Safe text zone inside the white center of the floral artwork. */
.hero-copy-over-svg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  width: 46%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero-copy-over-svg::before {
  inset: -18% -16%;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    rgba(255,253,250,.72) 0%,
    rgba(255,253,250,.48) 42%,
    rgba(255,251,247,.18) 67%,
    rgba(255,251,247,0) 84%
  );
  box-shadow: none;
  backdrop-filter: none;
}

.hero-kicker {
  margin: 0 0 clamp(3px, .6cqw, 7px);
  font-size: clamp(.55rem, 1.25cqw, .68rem);
  letter-spacing: .14em;
  line-height: 1.25;
}

.guest-line {
  max-width: 34ch;
  margin: 0 0 clamp(3px, .55cqw, 6px);
  font-size: clamp(.74rem, 1.75cqw, .92rem);
  line-height: 1.4;
}

.invite-line {
  max-width: 35ch;
  margin: 0 0 clamp(6px, 1cqw, 10px);
  font-size: clamp(.70rem, 1.55cqw, .86rem);
  line-height: 1.4;
}

.couple-names {
  width: 100%;
  display: grid;
  gap: clamp(4px, .9cqw, 9px);
  margin: 0;
}

.person-block {
  display: grid;
  justify-items: center;
  gap: clamp(4px, .65cqw, 7px);
  min-width: 0;
}

.name-text {
  display: block;
  width: 100%;
  font-size: clamp(2.35rem, 7.1cqw, 4.25rem);
  line-height: .88;
  font-weight: 600;
  color: var(--ink);
  opacity: .68;
  text-wrap: balance;
  overflow-wrap: normal;
}

.parents-block {
  display: grid;
  justify-items: center;
  gap: clamp(1px, .3cqw, 3px);
  margin: 0;
  width: 100%;
}

.parent-role {
  margin: 0 0 1px;
  font-size: clamp(.78rem, 1.8cqw, .98rem);
  line-height: 1.2;
  font-weight: 600;
}

.parent-name {
  max-width: 100%;
  font-size: clamp(.88rem, 2.2cqw, 1.08rem);
  line-height: 1.22;
  font-weight: 650;
  text-wrap: balance;
}

.parent-join {
  margin: 0;
  font-size: clamp(.75rem, 1.7cqw, .94rem);
  line-height: 1;
}

.couple-names small {
  margin: clamp(1px, .4cqw, 4px) 0;
  font-size: clamp(.46rem, 1.05cqw, .58rem);
  line-height: 1;
  letter-spacing: .15em;
}

/* Event details are in normal flow, never overlapping the names. */
.event-details-panel {
  width: min(940px, calc(100vw - 40px));
  margin-top: clamp(34px, 5vh, 54px);
  padding: 23px 26px;
  grid-template-columns: minmax(130px,.72fr) 1px minmax(120px,.62fr) 1px minmax(270px,1.72fr) auto;
  gap: 18px;
  border-radius: 28px;
}

.event-detail-item strong {
  font-size: clamp(1.22rem, 1.75vw, 1.55rem);
}

.event-place-item > span:last-child {
  max-width: 42ch;
  margin-left: auto;
  margin-right: auto;
}

/* A tiny visual connector keeps the two pieces cohesive without overlap. */
.invitation-stack::after {
  content: "";
  order: 1;
  width: 1px;
  height: 24px;
  margin-top: -43px;
  margin-bottom: 19px;
  background: linear-gradient(180deg, rgba(201,139,156,0), rgba(201,139,156,.28), rgba(201,139,156,0));
  pointer-events: none;
}
.event-details-panel { order: 2; }
.invitation-stack .hero-invitation { order: 0; }

/* Tablets: still square artwork, but use more width. */
@media (max-width: 980px) and (min-width: 641px) {
  .hero {
    padding-top: 24px;
    padding-bottom: 64px;
  }

  .invitation-stack .hero-invitation {
    width: min(78vmin, 700px, calc(100vw - 32px));
  }

  .hero-copy-over-svg {
    width: 49%;
  }

  .name-text {
    font-size: clamp(2.2rem, 7.7cqw, 4rem);
  }

  .event-details-panel {
    width: min(88vw, 780px);
    margin-top: 42px;
    grid-template-columns: 1fr 1px 1fr 1px 1.7fr;
  }

  .event-details-actions {
    grid-column: 1 / -1;
    justify-content: center;
    margin-top: 2px;
  }
}

/* Phones: keep the full-height artwork behavior that already worked,
   but fit the copy independently and let details scroll below it. */
@media (max-width: 640px) {
  .hero {
    min-height: auto;
    padding: 0 0 48px;
    overflow: visible;
  }

  .invitation-stack {
    width: 100%;
  }

  .invitation-stack .hero-invitation {
    container-type: normal;
    width: 100vw;
    height: max(100svh, 650px);
    min-height: max(100svh, 650px);
    aspect-ratio: auto;
    overflow: hidden;
  }

  .hero-svg-stage {
    inset: 0;
    overflow: hidden;
  }

  .hero-svg-art {
    position: absolute;
    top: 50%;
    left: 50%;
    height: 100%;
    width: auto;
    min-width: 100%;
    max-width: none;
    transform: translate(-50%, -50%);
    object-fit: unset;
  }

  .hero-copy-over-svg {
    top: 50%;
    left: 50%;
    width: min(74vw, 330px);
    max-height: none;
    transform: translate(-50%, -50%);
    padding: 0 2px;
  }

  .hero-copy-over-svg::before {
    inset: -12% -10%;
  }

  .hero-kicker {
    font-size: .60rem;
    margin-bottom: 4px;
  }

  .guest-line {
    font-size: .76rem;
    line-height: 1.35;
    margin-bottom: 4px;
  }

  .invite-line {
    font-size: .70rem;
    line-height: 1.34;
    margin-bottom: 7px;
  }

  .couple-names {
    gap: 5px;
  }

  .person-block {
    gap: 5px;
  }

  .name-text {
    font-size: clamp(2rem, 10.6vw, 3.25rem);
    line-height: .88;
    opacity: .72;
  }

  .parent-role {
    font-size: .78rem;
  }

  .parent-name {
    font-size: .88rem;
    line-height: 1.18;
  }

  .parent-join {
    font-size: .80rem;
  }

  .couple-names small {
    margin: 1px 0;
    font-size: .48rem;
  }

  .invitation-stack::after {
    display: none;
  }

  .event-details-panel {
    order: 2;
    width: calc(100vw - 22px);
    margin-top: 28px;
    padding: 18px 14px 16px;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-radius: 23px;
  }

  .event-detail-item {
    padding: 8px 9px 13px;
  }

  .event-detail-item:nth-of-type(1) {
    border-right: 1px solid rgba(163,127,100,.12);
  }

  .event-place-item {
    grid-column: 1 / -1;
    padding: 15px 10px 13px;
    border-top: 1px solid rgba(163,127,100,.12);
  }

  .event-detail-divider {
    display: none;
  }

  .event-detail-item strong {
    font-size: 1.18rem;
  }

  .event-place-item > span:last-child {
    font-size: .70rem;
    line-height: 1.35;
  }

  .event-details-actions {
    grid-column: 1 / -1;
    justify-content: center;
    padding-top: 3px;
  }
}

@media (max-width: 430px) {
  .invitation-stack .hero-invitation {
    height: max(100svh, 620px);
    min-height: max(100svh, 620px);
  }

  .hero-copy-over-svg {
    width: min(76vw, 300px);
  }

  .name-text {
    font-size: clamp(1.9rem, 11vw, 3rem);
  }

  .parent-role {
    font-size: .72rem;
  }

  .parent-name {
    font-size: .81rem;
  }

  .parent-join {
    font-size: .75rem;
  }

  .event-details-panel {
    width: calc(100vw - 16px);
  }
}

/* Short landscape-ish phones: let the section become taller rather than clipping copy. */
@media (max-width: 640px) and (max-height: 700px) {
  .invitation-stack .hero-invitation {
    height: 700px;
    min-height: 700px;
  }

  .hero-copy-over-svg {
    width: min(72vw, 310px);
  }

  .name-text {
    font-size: clamp(1.85rem, 9.6vw, 2.75rem);
  }
}


/* ============================================================
   v15 DESKTOP SCALE FIX
   Desktop artwork scales from viewport WIDTH, not viewport HEIGHT.
   The invitation may extend below the fold and scroll naturally.
   Mobile rules above remain unchanged.
   ============================================================ */
@media (min-width: 981px) {
  .hero {
    padding: 22px 16px 82px;
    overflow: visible;
  }

  .invitation-stack {
    max-width: 1240px;
  }

  .invitation-stack .hero-invitation {
    width: min(86vw, 1000px);
    height: auto;
    aspect-ratio: 1 / 1;
    min-height: 0;
    max-height: none;
  }

  .hero-svg-stage {
    inset: 0;
    overflow: visible;
  }

  .hero-svg-art {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transform: none;
  }

  /* Keep all copy inside the pale center instead of scaling with the monitor. */
  .hero-copy-over-svg {
    width: 43%;
    top: 49.5%;
  }

  .hero-kicker {
    font-size: clamp(.62rem, 1.18cqw, .76rem);
  }

  .guest-line {
    font-size: clamp(.82rem, 1.58cqw, 1rem);
  }

  .invite-line {
    font-size: clamp(.76rem, 1.42cqw, .92rem);
    margin-bottom: clamp(8px, 1.05cqw, 12px);
  }

  .name-text {
    font-size: clamp(3rem, 6.35cqw, 4.6rem);
    line-height: .9;
  }

  .parent-role {
    font-size: clamp(.88rem, 1.62cqw, 1.05rem);
  }

  .parent-name {
    font-size: clamp(1rem, 1.95cqw, 1.18rem);
  }

  .parent-join {
    font-size: clamp(.82rem, 1.45cqw, .98rem);
  }

  .couple-names small {
    font-size: clamp(.50rem, .95cqw, .62rem);
    margin: clamp(2px, .35cqw, 4px) 0;
  }

  .event-details-panel {
    width: min(1000px, 86vw);
    margin-top: 42px;
  }

  .invitation-stack::after {
    display: none;
  }
}

/* Large desktop displays can show an even larger invitation. */
@media (min-width: 1500px) {
  .invitation-stack .hero-invitation {
    width: min(78vw, 1120px);
  }

  .event-details-panel {
    width: min(1050px, 76vw);
  }
}


/* ============================================================
   v16 MOBILE TYPOGRAPHY FIX
   Desktop sizing from v15 is intentionally unchanged.
   Phones get a wider safe text area and substantially larger type.
   ============================================================ */
@media (max-width: 640px) {
  .hero-copy-over-svg {
    width: min(82vw, 360px);
    top: 49.5%;
  }

  .hero-copy-over-svg::before {
    inset: -10% -7%;
  }

  .hero-kicker {
    font-size: clamp(.67rem, 2.9vw, .80rem);
    line-height: 1.25;
    letter-spacing: .12em;
    margin-bottom: 6px;
  }

  .guest-line {
    font-size: clamp(.86rem, 3.45vw, 1rem);
    line-height: 1.34;
    margin-bottom: 6px;
  }

  .invite-line {
    font-size: clamp(.80rem, 3.15vw, .94rem);
    line-height: 1.34;
    margin-bottom: 10px;
  }

  .couple-names {
    gap: 7px;
  }

  .person-block {
    gap: 7px;
  }

  .name-text {
    font-size: clamp(2.55rem, 12.4vw, 3.8rem);
    line-height: .86;
    opacity: .76;
  }

  .parents-block {
    gap: 3px;
  }

  .parent-role {
    font-size: clamp(.88rem, 3.5vw, 1rem);
    line-height: 1.18;
  }

  .parent-name {
    font-size: clamp(.98rem, 4vw, 1.12rem);
    line-height: 1.18;
  }

  .parent-join {
    font-size: clamp(.86rem, 3.3vw, .98rem);
    line-height: 1;
  }

  .couple-names small {
    font-size: .56rem;
    margin: 3px 0;
  }
}

@media (max-width: 430px) {
  .hero-copy-over-svg {
    width: min(84vw, 330px);
  }

  .name-text {
    font-size: clamp(2.35rem, 12.7vw, 3.4rem);
  }

  .parent-role {
    font-size: clamp(.84rem, 3.8vw, .96rem);
  }

  .parent-name {
    font-size: clamp(.94rem, 4.25vw, 1.06rem);
  }

  .parent-join {
    font-size: clamp(.82rem, 3.55vw, .94rem);
  }

  .guest-line {
    font-size: clamp(.82rem, 3.65vw, .94rem);
  }

  .invite-line {
    font-size: clamp(.76rem, 3.35vw, .88rem);
  }
}

@media (max-width: 640px) and (max-height: 700px) {
  .hero-copy-over-svg {
    width: min(78vw, 330px);
  }

  .name-text {
    font-size: clamp(2.15rem, 10.8vw, 3.05rem);
  }

  .parent-role { font-size: .80rem; }
  .parent-name { font-size: .90rem; }
  .parent-join { font-size: .82rem; }
  .guest-line { font-size: .78rem; }
  .invite-line { font-size: .73rem; }
}


/* v18: personalized invitee emphasis */
.guest-line {
  width: 100%;
  margin: 8px auto 10px !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-align: center;
}
.guest-lead,
.guest-tail {
  display: block;
  color: var(--ink-soft);
  font-family: "Manrope", system-ui, sans-serif;
  font-size: clamp(.78rem, 1.05vw, .96rem);
  line-height: 1.35;
  font-weight: 500;
}
.invitee-name {
  display: block;
  max-width: 100%;
  margin: 2px auto 3px;
  color: #5f4047;
  font-family: "Cormorant Garamond", "Noto Serif Bengali", serif;
  font-size: clamp(1.55rem, 2.35vw, 2.45rem);
  line-height: 1;
  font-weight: 700;
  letter-spacing: .015em;
  overflow-wrap: anywhere;
  text-wrap: balance;
  text-shadow: 0 1px 0 rgba(255,255,255,.48);
}
.invitee-name.hidden,
.guest-tail.hidden {
  display: none !important;
}

@media (max-width: 700px) {
  .guest-line {
    gap: 2px;
    margin: 6px auto 8px !important;
  }
  .guest-lead,
  .guest-tail {
    font-size: clamp(.78rem, 3.4vw, .94rem) !important;
    line-height: 1.28 !important;
  }
  .invitee-name {
    font-size: clamp(1.55rem, 7vw, 2.25rem) !important;
    line-height: 1.02;
    margin: 2px auto 4px;
    color: #57373f;
  }
}

@media (max-width: 430px) {
  .invitee-name {
    font-size: clamp(1.42rem, 7.6vw, 2rem) !important;
  }
  .guest-lead,
  .guest-tail {
    font-size: .78rem !important;
  }
}
