:root {
  --v2-ivory: #f6eee1;
  --v2-paper: #fcf8f1;
  --v2-parchment: #e9ddca;
  --v2-gold: #a9864f;
  --v2-gold-dark: #8a6737;
  --v2-gold-light: #c6a76e;
  --v2-sage: #a8ad9e;
  --v2-clay: #d6b494;
  --v2-olive: #777966;
  --v2-walnut: #594938;
  --v2-paper-texture: url('/assets/design-v2/texture/14_ivory_paper_texture.webp');
  --ink: var(--v2-walnut);
  --paper: var(--v2-ivory);
  --gold: var(--v2-gold);
  --main: var(--v2-gold-dark);
  --secondary: var(--v2-sage);
  --light-accent: var(--v2-parchment);

  --cap-width: min(132vw, 1400px);
  /* Caps are 2048×768 source art (ratio .375) — used to keep text clear of the opaque artwork. */
  --cap-h: calc(var(--cap-width) * .375);
}

html.invitation-motion {
  scroll-behavior: auto;
}

body {
  background-color: var(--v2-ivory);
  background-image: var(--v2-paper-texture);
  color: var(--v2-walnut);
}

:focus-visible {
  outline: 2px solid var(--v2-gold-dark);
  outline-offset: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.auth-shell {
  background-color: var(--v2-ivory);
  background-image: url('/assets/design-v2/ornament/07_blind_emboss_cluster.webp'),
    url('/assets/design-v2/ornament/12_sage_watercolor_wash.webp'),
    url('/assets/design-v2/ornament/13_clay_watercolor_wash.webp'),
    var(--v2-paper-texture);
  background-position: left bottom, left 15%, right top, center;
  background-repeat: no-repeat, no-repeat, no-repeat, repeat;
  background-size: min(56vw, 570px), min(48vw, 480px), min(44vw, 440px), 627px;
}

.auth-card {
  background: rgb(252 248 241 / .86);
  border: 1px solid rgb(169 134 79 / .32);
  border-radius: 24px;
  box-shadow: 0 22px 65px rgb(89 73 56 / .1);
}

.auth-monogram-v2 {
  display: block;
  width: 130px;
  height: 130px;
  margin: -30px auto -22px;
  object-fit: contain;
}

.auth-card .kicker {
  color: var(--v2-gold-dark);
  margin-top: 0px;
  padding-top: 32px;
  font-size: 42px;
  text-align: center;
}

.auth-card h1 {
  color: var(--v2-walnut);
  font-family: IranNastaliq, Vazirmatn, serif;
  font-size: 38px;
  line-height: 1.35;
  text-align: center;
}

.muted,
.text-button {
  color: rgb(89 73 56 / .74);
  border-radius: 10px;
  font-size: clamp(18px, 4.4vw, 20px);
}

.auth-card .muted {
  font-family: 'VazirmatnLocal', Vazirmatn, sans-serif !important;
  font-size: 11px;
  text-align: center;
}

#phone-form label {
  font-family: 'VazirmatnLocal', Vazirmatn, sans-serif !important;
  font-size: 12px;
}

#phone-form input#phone {
  font-family: 'VazirmatnLocal', Vazirmatn, sans-serif !important;
  font-size: 16px !important;
  margin-top: 14px;
  border-radius: 20px;
}

#phone-form button {
  font-family: 'VazirmatnLocal', Vazirmatn, sans-serif !important;
}

#code-form label {
  font-family: 'VazirmatnLocal', Vazirmatn, sans-serif !important;
  font-size: 12px;
}

#code-form input#code {
  font-family: 'VazirmatnLocal', Vazirmatn, sans-serif !important;
  font-size: 16px !important;
  margin-top: 14px;
  border-radius: 20px;
}

button {
  background: var(--v2-gold-dark);
  color: var(--v2-paper);
  border-radius: 14px;
  font-size: clamp(18px, 4.2vw, 20px) !important;
}

.auth-shell .kicker,
.auth-shell label,
.auth-shell button {
  letter-spacing: normal;
}

input,
textarea {
  border-color: rgb(169 134 79 / .55);
  color: var(--v2-walnut);
  font-size: clamp(18px, 4.4vw, 20px) !important;
}

label {
  font-size: clamp(18px, 4.2vw, 20px);
}

.status {
  font-size: clamp(18px, 4.2vw, 20px);
}

/* Exact registered 941 × 1672 opening stack. */
.gatefold-scene {
  height: 240svh;
  background-color: var(--v2-ivory);
  background-image: url('/assets/palmette-tile/00_background_tile.webp');
  background-repeat: repeat;
  background-size: min(116vw, 1254px) auto;
}

.gatefold-stage {
  display: grid;
  place-items: center;
  background: transparent;
  perspective: 1500px;
  cursor: pointer;
  touch-action: pan-y;
}

.gatefold-stage:focus-visible {
  outline-offset: -4px;
}

.v2-invitation-stage {
  position: relative;
  width: 100%;
  height: 100%;
  align-self: stretch;
  justify-self: stretch;
  flex: none;
  overflow: hidden;
  isolation: isolate;
  background: var(--v2-paper);
  transform-style: preserve-3d;
}

.v2-invitation-stage::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 9;
  border: 1px solid rgb(169 134 79 / .34);
  pointer-events: none;
}

.v2-invitation-stage .fold-content {
  position: absolute;
  inset: 0;
  isolation: isolate;
  z-index: 10;
  padding: 7% 8%;
  padding-top: var(--cap-h);
  /* flex-start (not center) guarantees content grows downward from below
     the cap instead of overflowing upward into it when the stack is taller
     than the viewport — center would let overflow spill above the padding
     and back under the cap image. */
  justify-content: flex-start;
  overflow: hidden;
  border: 0;
  outline: 0;
  background-color: var(--v2-ivory);
  background-image: url('/assets/palmette-tile/00_background_tile.webp');
  background-repeat: repeat;
  background-size: min(116vw, 1254px) auto;
  opacity: calc(.22 + var(--content-reveal) * .78);
  transform: scale(calc(.99 + var(--content-reveal) * .01));
}

.v2-invitation-stage .fold-content > * {
  /* Never let the flex column shrink a child below its natural size when
     the stack is taller than the viewport — shrinking silently compresses
     fixed-height items (like .hero-stems) and lets their absolutely
     positioned contents spill into the item above. Clipping any excess at
     the bottom (via overflow:hidden above) is the safe outcome instead. */
  flex-shrink: 0;
}

.v2-invitation-stage h1 {
  margin: 0;
  color: var(--v2-walnut);
  font-family: IranNastaliq, Vazirmatn, serif;
  font-size: 80px;
  line-height: 1.25;
}

.poem-art {
  width: min(72%, 420px);
  height: auto;
  margin: clamp(20px, 4vh, 40px) auto 0;
  object-fit: contain;
}

.poem-divider {
  width: min(48%, 220px);
  height: auto;
  margin: clamp(14px, 2.6vh, 26px) auto 0;
  object-fit: contain;
}

.poem-art + .poem-divider {
  margin-top: clamp(14px, 2.6vh, 26px);
}

.hero-date {
  margin: clamp(16px, 3vh, 32px) 0 0;
  color: var(--v2-gold-dark);
  font-family: 'VazirmatnLocal', Vazirmatn, sans-serif !important;
  font-size: 18px;
  letter-spacing: .02em;
}

.hero-location {
  margin: clamp(6px, 1.2vh, 14px) 0 0;
  color: var(--v2-gold-dark);
  font-family: 'VazirmatnLocal', Vazirmatn, sans-serif !important;
  font-size: 18px;
  letter-spacing: .02em;
}

.hero-stems {
  position: relative;
  align-self: stretch;
  width: 100%;
  height: 110px;
  margin: clamp(16px, 3vh, 32px) 0 0;
  pointer-events: none;
}

.hero-stem-wrap {
  position: absolute;
  bottom: 0;
  z-index: 11;
  width: 165px;
  height: 110px;
  pointer-events: none;
  opacity: calc(.22 + var(--content-reveal) * .78);
}

.hero-stem-wrap--left {
  right: calc(50% - 15px);
}

.hero-stem-wrap--right {
  left: calc(50% - 15px);
}

.hero-stem {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 110px;
  height: 165px;
  margin: -82.5px 0 0 -55px;
  object-fit: contain;
}

.hero-stem--left {
  transform: rotate(-90deg);
}

.hero-stem--right {
  transform: rotate(90deg);
}

.v2-flap,
.v2-seal {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  will-change: transform, opacity;
  pointer-events: none;
}

.v2-flap img,
.v2-seal img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.v2-flap-upper {
  z-index: 44;
  transform-origin: 50% 0;
  transform: rotateX(calc(var(--inner-fold) * -88deg));
  opacity: calc(1 - var(--inner-fold));
}

.v2-flap-lower {
  z-index: 43;
  transform-origin: 50% 100%;
  transform: rotateX(calc(var(--inner-fold) * 88deg));
  opacity: calc(1 - var(--inner-fold));
}

.v2-flap-right {
  z-index: 32;
  transform-origin: 100% 50%;
  transform: rotateY(calc(var(--outer-fold) * 88deg));
  opacity: calc(1 - var(--outer-fold));
}

.v2-flap-left {
  z-index: 31;
  transform-origin: 0 50%;
  transform: rotateY(calc(var(--outer-fold) * -88deg));
  opacity: calc(1 - var(--outer-fold));
}

.v2-seal {
  z-index: 60;
  opacity: calc(1 - var(--seal-away));
  filter: blur(calc(var(--seal-away) * 2px));
}

.tap-hint {
  position: absolute;
  left: 50%;
  bottom: 9%;
  z-index: 61;
  transform: translateX(-50%);
  pointer-events: none;
  opacity: clamp(0, calc(1 - var(--open) * 8), 1);
}

.tap-hint span {
  display: inline-block;
  color: var(--v2-gold-dark);
  font-family: 'VazirmatnLocal', Vazirmatn, sans-serif !important;
  font-size: 15px;
  letter-spacing: .04em;
  animation: tap-hint-pulse 1.8s ease-in-out infinite;
}

@keyframes tap-hint-pulse {
  0%, 100% { opacity: .55; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .tap-hint span {
    animation: none;
  }
}

@font-face {
  font-family: 'IranNastaliq';
  src: url('/assets/fonts/IranNastaliq.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'VazirmatnLocal';
  src: url('/assets/fonts/Vazirmatn-Variable.ttf') format('truetype-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Zeytoon';
  src: url('/assets/fonts/Zeytoon-AliMamadian.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IranNastaliqN2';
  src: url('/assets/fonts/IranNastaliqN2.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'DimaShekasteh';
  src: url('/assets/fonts/DimaShekasteh.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IRANYekanX';
  src: url('/assets/fonts/IRANYekanX-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IRANYekanX';
  src: url('/assets/fonts/IRANYekanX-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IRANYekanX';
  src: url('/assets/fonts/IRANYekanX-Bold.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IRANYekanX';
  src: url('/assets/fonts/IRANYekanX-Black.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* Unified palmette tile system — one continuous scroll, no separate "pages". */
.invitation-page {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background-color: var(--v2-ivory);
  background-image: url('/assets/palmette-tile/00_background_tile.webp');
  background-repeat: repeat;
  background-size: min(116vw, 1254px) auto;
  color: var(--v2-walnut);

  --content-width: min(60vw, 600px);
  --edge-art-width: clamp(220px, 46vw, 420px);
  /* These assets have ~55-60% transparent padding on their inward side (only the
     outer ~40-44% carries the actual embroidery) — a small bleed here keeps the
     visible motif close to fully on-screen without needing to hide most of the
     asset's width. */
  --edge-bleed: clamp(-22px, -1.5vw, -8px);
}

.cap,
.edge-accent {
  position: absolute;
  z-index: 1;
  display: block;
  height: auto;
  pointer-events: none;
  user-select: none;
}

.cap {
  left: 50%;
  width: var(--cap-width);
  transform: translateX(-50%);
}

.cap--top {
  top: 0;
  transform: translateX(-50%) rotate(180deg);
}

.cap--bottom {
  bottom: 0;
  transform: translateX(-50%) rotate(180deg);
}

.edge-accent {
  top: var(--y);
  width: var(--edge-art-width);
  transform: translateY(-50%);
}

.edge-accent--left {
  left: var(--edge-bleed);
}

.edge-accent--right {
  right: var(--edge-bleed);
}

.edge-accent--quiet {
  width: calc(var(--edge-art-width) * .88);
  opacity: .86;
}

@media (min-width: 900px) {
  .invitation-page {
    --content-width: min(50vw, 660px);
    --edge-art-width: clamp(360px, 34vw, 560px);
    --edge-bleed: clamp(-32px, -1vw, -18px);
  }
}

.invitation-section {
  position: relative;
  z-index: 2;
  width: var(--content-width);
  margin-inline: auto;
  padding-inline: clamp(18px, 7vw, 44px);
  box-sizing: border-box;
}

.dedication-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(20px, 4vh, 40px);
  min-height: 60svh;
  padding-block: clamp(90px, 16vh, 190px) clamp(40px, 8vh, 90px);
  padding-top: 32px;
  padding-bottom: 32px;
  text-align: center;
  font-family: IranNastaliq, Vazirmatn, serif;
  color: var(--v2-walnut);
}

.dedication-name {
  margin: 0;
  font-size: 44px;
  line-height: 1.3;
}

.dedication-name strong {
  color: var(--v2-gold-dark);
}

.dedication-text {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 3vh, 28px);
}

#dedication-title {
  margin: 0;
  font-size: 50px;
  color: var(--v2-gold-dark);
}

#dedication-paragraphs {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 3vh, 28px);
}

#dedication-paragraphs p {
  margin: 0;
  font-size: 28px;
  line-height: 1.9;
}

.details-stems {
  position: relative;
  width: 100%;
  height: 110px;
  margin: clamp(24px, 4vh, 48px) 0 0;
  pointer-events: none;
}

.dedication-stems {
  position: relative;
  align-self: stretch;
  width: 100%;
  height: 110px;
  margin: clamp(24px, 4vh, 48px) 0 0;
  pointer-events: none;
}

.dedication-stem-wrap {
  position: absolute;
  bottom: 0;
  width: 165px;
  height: 110px;
}

.dedication-stem-wrap--left {
  right: calc(50% - 15px);
}

.dedication-stem-wrap--right {
  left: calc(50% - 15px);
}

.invitation-copy {
  min-height: 60svh;
  display: grid;
  place-items: center;
  padding-block: clamp(70px, 12vh, 150px);
  color: var(--v2-walnut);
  font-family: IranNastaliq, Vazirmatn, serif;
  font-size: clamp(22px, 5.5vw, 30px);
  line-height: 2;
}

.details {
  min-height: 60svh;
  padding-block: clamp(70px, 12vh, 150px);
  padding-top: 32px;
  padding-bottom: 32px;
  background: none;
  color: var(--v2-walnut);
}

.detail-grid {
  margin-top: 0px;
  gap: 0;
  text-align: center;
}

.section-label,
.kicker {
  font-size: clamp(19px, 4.4vw, 23px);
}

.section-label {
  margin: 0px;
  font-size: 65px;
  text-align: center;
}

.details .section-label {
  color: var(--v2-gold-dark);
}

.detail-grid > div {
  border-top: 0;
}

.detail-grid > div:first-child {
  margin-bottom: 0px;
  padding-top: 0px;
}

#date {
  font-size: 30px;
}

#time {
  font-size: 24px;
}

.detail-grid > div::before {
  content: '';
  display: none;
  width: 242px;
  height: 18px;
  margin: 0 0;
  background-image: url('/assets/design-v2/ornament/15_gold_line_dot_divider.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

.detail-grid h3 {
  color: var(--v2-walnut);
  font-family: IranNastaliq, Vazirmatn, serif;
  font-size: clamp(40px, 7vw, 74px);
}

.detail-grid p,
.dress b {
  color: var(--v2-olive);
  font-size: 33px;
}

.detail-grid a {
  color: var(--v2-gold-dark);
  text-decoration-color: var(--v2-gold);
  font-size: clamp(19px, 4.6vw, 22px);
}

#venue {
  font-size: 27px;
}

#address {
  font-size: 16px;
}

#map {
  font-size: 14px;
}

.dress {
  font-size: 33px;
  margin-top: 32px;
  letter-spacing: 0;
}

.map-preview-link {
  display: block;
  margin: 14px 0 16px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgb(169 134 79 / .4);
  box-shadow: 0 12px 30px rgb(89 73 56 / .12);
}

.map-preview {
  width: 100%;
  height: clamp(140px, 32vw, 220px);
  background: rgb(252 248 241 / .55);
  pointer-events: none;
}

.neshan-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.neshan-logo {
  display: block;
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
}

.rsvp {
  color: var(--v2-walnut);
  padding-top: 32px;
}

.rsvp fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.rsvp .section-label,
.rsvp .status {
  color: var(--v2-gold-dark);
}

.rsvp .section-label {
  font-size: 19px;
}

.rsvp h2 {
  color: var(--v2-walnut);
  font-family: IranNastaliq, Vazirmatn, serif;
  text-align: center;
  font-size: 65px;
  padding-bottom: 48px;
}

.rsvp > p {
  color: rgb(89 73 56 / .72);
  font-size: clamp(19px, 4.4vw, 22px);
}

.rsvp input,
.rsvp textarea,
.rsvp .choices span {
  color: var(--v2-walnut);
}

.choices label {
  display: flex;
}

.choices span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  border-color: rgb(169 134 79 / .55);
  background: rgb(252 248 241 / .55);
  border-radius: 14px;
  font-size: clamp(15px, 3.8vw, 21px);
  white-space: nowrap;
}

.choices input:checked + span {
  background: var(--v2-gold-dark);
  border-color: var(--v2-gold-dark);
  color: var(--v2-paper);
}

.rsvp button {
  background: var(--v2-gold-dark);
  color: var(--v2-paper);
}

footer {
  min-height: 50svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-block: clamp(70px, 12vh, 150px) calc(var(--cap-h) + clamp(24px, 5vh, 60px));
  padding-top: 0px;
  background: none;
  color: var(--v2-walnut);
  font-size: 38px;
}

footer p {
  font-size: clamp(22px, 5vw, 27px) !important;
}

#closing,
#footer-couple {
  font-size: 55px !important;
  font-style: normal;
  margin-bottom: 0px;
}

.lotus-border {
  display: none;
}

.music-control {
  background: rgb(252 248 241 / .92);
  border-color: var(--v2-gold);
  color: var(--v2-gold-dark);
}

@media (max-width: 767px) {
  .gatefold-scene {
    height: 215svh;
  }

  .gatefold-stage {
    perspective: 1050px;
  }

  .v2-invitation-stage {
    width: 100%;
    height: 100%;
  }

  .v2-invitation-stage .fold-content {
    padding-inline: 7%;
  }

  .hero-palmette-v2 {
    width: 38%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gatefold-scene {
    height: 100svh;
  }

  .v2-flap,
  .v2-seal {
    display: none;
  }

  .v2-invitation-stage .fold-content {
    opacity: 1;
    transform: none;
  }
}

/* Use IranNastaliq for all copy across the invitation, overriding the
   per-section font stacks set earlier in this file and in styles.css/rtl.css. */
html,
body,
h1,
h2,
h3,
h4,
p,
span,
strong,
b,
label,
button,
input,
textarea,
a,
.kicker,
.status,
.section-label {
  font-family: 'IranNastaliq', Vazirmatn, serif !important;
}

/* From "زمان و مکان" onward, switch to Vazirmatn — except the RSVP headline. */
.details .detail-grid,
.details .detail-grid *,
.details .dress,
.details .dress *,
.rsvp,
.rsvp *,
footer,
footer * {
  font-family: 'VazirmatnLocal', Vazirmatn, sans-serif !important;
}

.rsvp h2 {
  font-family: 'IranNastaliq', Vazirmatn, serif !important;
}

.details .dress,
.details .dress b {
  font-family: 'IranNastaliq', Vazirmatn, serif !important;
}

footer,
footer * {
  font-family: 'IranNastaliq', Vazirmatn, serif !important;
}
