:root {
  --sage: #5d6b51;
  --sage-deep: #3e4c36;
  --cream: #faf6ed;
  --cream-soft: #fffbf5;
  --cream-warm: #f8f0e0;
  --cream-deep: #e7d9c2;
  --ink: #1a1510;
  --ink-soft: #4a3c2a;
  --ink-muted: #7a6b58;
  --maroon: #8b1538;
  --maroon-deep: #5c0f26;
  --maroon-soft: #a82048;
  --gold: #c9a227;
  --gold-rich: #d4af37;
  --gold-soft: #e5d5a8;
  --gold-muted: #c4b896;
  --gold-dark: #8b7722;
  --seal: #f6f1e6;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --face: 50% 52%;
  --zoom: 1.75;
}

@media (min-aspect-ratio: 1/1) {
  :root {
    --face: 50% 42%;
    --zoom: 1.55;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  display: grid;
  place-items: center;
  background: #4a0f16;
  color: var(--ink);
  font-family: "Noto Serif Devanagari", "Bodoni Moda", "Iowan Old Style", Palatino, serif;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--maroon);
  color: var(--gold-soft);
}

.stage {
  position: relative;
  width: 100vw;
  height: 100dvh;
  container-type: size;
  overflow: hidden;
  background: var(--cream);
}

.card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--cream);
}

.glow,
.interior {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: high-quality;
  will-change: transform, opacity;
  backface-visibility: hidden;
  object-position: center center;
  transform: scale(1);
  transform-origin: var(--face);
  transition:
    opacity 1.45s ease,
    transform 3.4s cubic-bezier(0.33, 0, 0.2, 1),
    filter 1.45s ease;
}

.glow {
  z-index: 0;
  filter: blur(18px) brightness(1.35);
  opacity: 0;
  transform: scale(1);
}

.interior {
  z-index: 1;
}

[data-state="darshan"] .glow,
[data-state="darshan"] .interior {
  animation: none;
  transform: scale(var(--zoom));
}

[data-state="darshan"] .glow {
  opacity: 0.45;
}

[data-state="darshan"] .interior {
  filter: brightness(1.08);
}

[data-state="departing"] .glow,
[data-state="departing"] .interior,
[data-state="reading"] .glow,
[data-state="reading"] .interior {
  animation: none;
  opacity: 0;
  transform: scale(calc(var(--zoom) * 1.12));
  filter: blur(12px) brightness(2.6);
  pointer-events: none;
}

/* ---------- Patrika (scrollable Hindi invitation) ---------- */

.letter {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  background: 
    linear-gradient(180deg, #e8dce6 0%, #f0e8ef 15%, #faf6f9 50%, #f0e8ef 85%, #e8dce6 100%);
  padding: 0;
  opacity: 0;
  filter: blur(8px);
  pointer-events: none;
  transition:
    opacity 700ms var(--ease) 360ms,
    filter 700ms var(--ease) 360ms;
}

[data-state="reading"] .letter {
  opacity: 1;
  filter: blur(0);
  pointer-events: auto;
}

.patrika {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  background: #d9a526;
}

/* Hero generated invitation image */
.hero-image {
  width: 100%;
  line-height: 0;
}

.hero-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Visually hidden names (kept for accessibility / scroll target) */
.sr-names {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ========== ORNATE ARCH HEADER ========== */
.arch-header {
  position: relative;
  background: var(--maroon);
  padding: clamp(1rem, 3vmin, 2rem) clamp(0.5rem, 2vmin, 1.5rem);
  overflow: hidden;
}

/* Intricate paisley pattern overlay */
.arch-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cpath d='M50 10 Q70 30 50 50 Q30 30 50 10' fill='none' stroke='%23a82048' stroke-width='0.8'/%3E%3Cpath d='M10 50 Q30 70 50 50 Q30 30 10 50' fill='none' stroke='%23a82048' stroke-width='0.8'/%3E%3Cpath d='M90 50 Q70 70 50 50 Q70 30 90 50' fill='none' stroke='%23a82048' stroke-width='0.8'/%3E%3Cpath d='M50 90 Q70 70 50 50 Q30 70 50 90' fill='none' stroke='%23a82048' stroke-width='0.8'/%3E%3Ccircle cx='50' cy='50' r='8' fill='none' stroke='%23a82048' stroke-width='0.5'/%3E%3Ccircle cx='50' cy='50' r='3' fill='%23a82048'/%3E%3C/svg%3E");
  background-size: 50px 50px;
  opacity: 0.6;
}

/* Gold border line */
.arch-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-rich), var(--gold), var(--gold-rich), var(--gold-dark));
}

/* Ganesha icon at top */
.ganesha-icon {
  position: relative;
  width: clamp(60px, 12vmin, 90px);
  height: clamp(60px, 12vmin, 90px);
  margin: 0 auto 0.5rem;
  background: linear-gradient(180deg, #fff8e7, #ffe4b5);
  border-radius: 50% 50% 45% 45%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.8rem, 5vmin, 2.8rem);
  box-shadow: 
    0 4px 16px rgba(0,0,0,0.3),
    inset 0 2px 4px rgba(255,255,255,0.5);
  border: 3px solid var(--gold-rich);
}

/* Scalloped shape cutout at bottom of arch */
.arch-scallop {
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(200px, 70%, 400px);
  height: clamp(30px, 6vmin, 50px);
  background: #faf6f9;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  box-shadow: inset 0 3px 8px rgba(139, 21, 56, 0.15);
}

/* ========== MAIN CONTENT AREA ========== */
.main-content {
  position: relative;
  background: 
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.18), transparent 55%),
    linear-gradient(180deg, #e3ad28 0%, #d9a520 45%, #d09c1a 100%);
  padding: clamp(2.5rem, 7vmin, 4.5rem) clamp(2.5rem, 9vw, 5rem);
  flex: 1;
  /* Ornate maroon paisley frame via border-image */
  border-style: solid;
  border-width: clamp(30px, 9vw, 64px) clamp(28px, 8vw, 58px);
  border-image-source: url("patrika-frame-tall.jpg?v=1");
  border-image-slice: 150 140;
  border-image-repeat: round;
}

/* Side decorations - hanging toran/garlands (disabled; using ornate frame instead) */
.toran-left,
.toran-right {
  display: none;
  position: absolute;
  top: 0;
  width: clamp(25px, 5vw, 50px);
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.toran-left {
  left: 0;
  background: 
    repeating-linear-gradient(
      180deg,
      var(--gold-rich) 0px,
      var(--gold-rich) 4px,
      transparent 4px,
      transparent 20px
    ),
    linear-gradient(90deg, var(--maroon) 0%, transparent 100%);
  background-size: 3px 24px, 100% 100%;
  background-position: 0 0, 0 0;
}

.toran-right {
  right: 0;
  background: 
    repeating-linear-gradient(
      180deg,
      var(--gold-rich) 0px,
      var(--gold-rich) 4px,
      transparent 4px,
      transparent 20px
    ),
    linear-gradient(270deg, var(--maroon) 0%, transparent 100%);
  background-size: 3px 24px, 100% 100%;
  background-position: calc(100% - 3px) 0, 0 0;
}

/* Hanging marigold dots */
.toran-left::before,
.toran-right::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 8px;
  background: 
    repeating-linear-gradient(
      180deg,
      #ff9500 0px,
      #ff9500 6px,
      #ffc107 6px,
      #ffc107 12px,
      transparent 12px,
      transparent 30px
    );
  border-radius: 50%;
}

.toran-left::before {
  left: 12px;
}

.toran-right::before {
  right: 12px;
}

/* ========== CONTENT SECTIONS ========== */
.invocation {
  margin: 0;
  color: var(--maroon);
  font-family: "Yatra One", "Rozha One", "Noto Serif Devanagari", serif;
  font-size: clamp(1.1rem, 2.5vmin, 1.4rem);
  letter-spacing: 0.08em;
  text-align: center;
  position: relative;
  z-index: 2;
}

.shloka {
  margin: 1rem auto;
  max-width: 30rem;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  color: var(--ink-soft);
  font-size: clamp(0.95rem, 2vmin, 1.1rem);
  line-height: 1.9;
  font-style: italic;
  text-align: center;
  position: relative;
  z-index: 2;
}

/* Elegant ornate divider */
.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 1.25rem auto;
  max-width: 280px;
  position: relative;
  z-index: 2;
}

.divider span {
  color: var(--gold-rich);
  font-size: 1.2rem;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-rich), transparent);
}

.kicker {
  margin: 0.5rem auto;
  display: inline-block;
  padding: 0.4rem 1.5rem;
  background: var(--maroon);
  color: var(--gold-soft);
  font-weight: 600;
  font-size: clamp(1rem, 2.2vmin, 1.2rem);
  letter-spacing: 0.04em;
  border-radius: 0;
  position: relative;
  z-index: 2;
  text-align: center;
}

.blessing {
  margin: 1rem auto 0;
  max-width: 36rem;
  color: var(--ink-soft);
  font-size: clamp(0.95rem, 1.9vmin, 1.08rem);
  line-height: 1.8;
  text-align: center;
  position: relative;
  z-index: 2;
}

/* Main names heading */
h1 {
  margin: 1.25rem 0;
  font-family: "Rozha One", "Yatra One", "Noto Serif Devanagari", serif;
  font-weight: 400;
  font-size: clamp(2.6rem, 8vmin, 4.5rem);
  line-height: 1.15;
  color: var(--maroon);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.15em 0.3em;
  text-align: center;
  position: relative;
  z-index: 2;
}

h1:focus {
  outline: none;
}

.name {
  display: inline-block;
}

.sang {
  display: inline-block;
  font-family: "Bodoni Moda", serif;
  font-size: 0.5em;
  font-weight: 400;
  font-style: italic;
  color: var(--gold-rich);
  transform: translateY(-0.1em);
}

/* Couple info grid */
.couple-grid {
  margin: 1.5rem auto 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  text-align: center;
  position: relative;
  z-index: 2;
}

@media (min-width: 600px) {
  .couple-grid {
    grid-template-columns: 1fr auto 1fr;
    gap: 1.25rem;
    align-items: center;
  }
}

.person {
  position: relative;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0.75rem 0.5rem;
}

.person-title {
  margin: 0;
  color: var(--maroon);
  font-family: "Rozha One", "Noto Serif Devanagari", serif;
  font-weight: 400;
  font-size: clamp(1.3rem, 2.8vmin, 1.65rem);
}

.person-lineage {
  margin: 0.6rem 0 0;
  color: #2a1a10;
  font-weight: 500;
  font-size: clamp(0.88rem, 1.7vmin, 0.98rem);
  line-height: 1.75;
}

.person-lineage .role {
  display: inline-block;
  color: var(--gold-dark);
  font-weight: 700;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.person-city {
  margin: 0.5rem 0 0;
  display: inline-block;
  padding: 0.2rem 0.8rem;
  background: var(--maroon);
  color: var(--gold-soft);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
}

.couple-mark {
  align-self: center;
  justify-self: center;
  color: var(--gold-soft);
  font-family: "Yatra One", "Noto Serif Devanagari", serif;
  font-size: 0.95rem;
  padding: 0.5rem 1.1rem;
  border: 2px solid var(--gold-rich);
  border-radius: 999px;
  background: var(--maroon);
  box-shadow: 0 3px 10px rgba(92, 15, 38, 0.3);
}

.invite-note {
  margin: 1.5rem auto 0;
  padding: 0.75rem 1rem;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.1), transparent);
  border-top: 1px solid var(--gold-soft);
  border-bottom: 1px solid var(--gold-soft);
  color: var(--ink);
  font-weight: 600;
  font-size: clamp(1rem, 2vmin, 1.15rem);
  line-height: 1.7;
  text-align: center;
  position: relative;
  z-index: 2;
}

.invite-plea {
  margin: 0.75rem auto 0;
  max-width: 36rem;
  color: var(--ink-muted);
  font-size: clamp(0.9rem, 1.8vmin, 1rem);
  line-height: 1.8;
  font-style: italic;
  text-align: center;
  position: relative;
  z-index: 2;
}

/* ========== EVENTS SECTION ========== */
.folio {
  position: relative;
  padding: clamp(1.5rem, 4vmin, 2.5rem) clamp(1rem, 3vw, 2rem);
  text-align: center;
  z-index: 2;
}

/* Events — printed program style on the golden page */
.folio[aria-labelledby="events-heading"] {
  margin-top: 1rem;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.section-heading {
  margin: 0 0 1.25rem;
  color: var(--maroon);
  font-family: "Rozha One", "Noto Serif Devanagari", serif;
  font-weight: 400;
  font-size: clamp(1.5rem, 3.2vmin, 2rem);
}

.events {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 34rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  text-align: center;
}

.event {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0.65rem 0.5rem;
  text-align: center;
  position: relative;
}

.event + .event::before {
  content: "❖";
  position: absolute;
  top: -0.65rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--maroon);
  font-size: 0.7rem;
  opacity: 0.7;
}

.event-highlight {
  background: transparent;
}

.event-date {
  display: inline-block;
  padding: 0;
  background: transparent;
  color: var(--maroon-deep);
  font-weight: 700;
  font-size: clamp(0.85rem, 1.7vmin, 0.95rem);
  letter-spacing: 0.02em;
}

.event-title {
  margin: 0.25rem 0 0;
  color: #2a1a10;
  font-size: clamp(1.05rem, 2.2vmin, 1.3rem);
  font-weight: 700;
  line-height: 1.5;
}

.event-highlight .event-title {
  color: var(--maroon-deep);
}

.event-meta {
  margin: 0.25rem 0 0;
  color: #6b4a1a;
  font-size: 0.88rem;
  font-style: italic;
}

/* ========== FAMILY SECTION ========== */
.folio[aria-labelledby="family-heading"] {
  margin-top: 1rem;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.family-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

@media (min-width: 540px) {
  .family-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

.family-card,
.family-block {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0.75rem 0.5rem;
  text-align: center;
}

.family-block {
  margin-top: 0.5rem;
}

.group-title {
  margin: 0;
  color: var(--maroon);
  font-family: "Rozha One", "Noto Serif Devanagari", serif;
  font-weight: 400;
  font-size: clamp(1.2rem, 2.4vmin, 1.4rem);
}

.group-names {
  margin: 0.5rem 0 0;
  color: #2a1a10;
  font-weight: 600;
  font-size: clamp(0.98rem, 1.9vmin, 1.1rem);
  line-height: 1.7;
}

.sub-groups {
  margin-top: 0.85rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 580px) {
  .sub-groups {
    grid-template-columns: repeat(2, 1fr);
  }
}

.sub-title {
  margin: 0 0 0.6rem;
  color: var(--maroon-deep);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pill-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
}

.pill-list li {
  background: rgba(74, 15, 22, 0.9);
  border: 1px solid var(--gold-rich);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gold-soft);
}

.all-family {
  margin: 0.75rem 0 0;
  padding: 0.35rem 1rem;
  display: inline-block;
  background: var(--maroon-deep);
  border-radius: 999px;
  color: var(--gold-soft);
  font-weight: 600;
  font-size: 0.92rem;
}

.kids {
  margin: 0.5rem 0 0;
  color: #2a1a10;
  font-weight: 600;
  font-size: clamp(0.98rem, 1.9vmin, 1.1rem);
  line-height: 1.7;
}

/* ========== FOOTER ========== */
.folio-footer {
  margin-top: 1rem;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.to-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 0.4rem 0.6rem;
  font-size: clamp(0.95rem, 1.9vmin, 1.08rem);
}

.to-label {
  color: var(--maroon-deep);
  font-weight: 700;
}

.to-value {
  color: #2a1a10;
  font-weight: 600;
  padding: 0.2rem 0.9rem;
  border: 1px dashed var(--maroon);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
}

.sender-name {
  margin: 0.5rem 0 0;
  font-weight: 700;
  font-size: clamp(1.1rem, 2.2vmin, 1.25rem);
  color: var(--maroon);
}

.sender-address {
  margin: 0.4rem 0 0;
  padding: 0;
  background: transparent;
  border: none;
  font-style: normal;
  color: #2a1a10;
  font-weight: 600;
  line-height: 1.75;
  font-size: clamp(0.92rem, 1.8vmin, 1.02rem);
  text-align: center;
  display: block;
}

.sender-phones {
  margin: 0.75rem 0 0;
  color: #2a1a10;
  font-weight: 600;
  font-size: 0.95rem;
}

.sender-phones a {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  margin: 0.15rem;
  color: var(--gold-soft);
  text-decoration: none;
  border-radius: 999px;
  background: var(--maroon-deep);
}

.sender-phones a:hover {
  background: var(--maroon);
  color: #fff;
}

/* Seal again button */
.again {
  margin-top: 1.25rem;
  margin-bottom: clamp(1.5rem, 5vmin, 4rem);
  padding: 0.65rem 1.75rem;
  border: none;
  background: var(--maroon);
  color: var(--gold-soft);
  font: 600 0.95rem / 1.3 "Noto Serif Devanagari", "Bodoni Moda", Palatino, serif;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(139, 21, 56, 0.25);
  transition: all 0.2s ease;
}

.again:hover {
  background: var(--maroon-soft);
  transform: translateY(-2px);
}

.again:focus-visible,
.seal:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
}

/* ========== BOTTOM DECORATIVE STRIP ========== */
.bottom-decor {
  height: clamp(60px, 12vmin, 100px);
  background: var(--maroon);
  position: relative;
  margin-top: auto;
}

.bottom-decor::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cpath d='M50 10 Q70 30 50 50 Q30 30 50 10' fill='none' stroke='%23a82048' stroke-width='0.8'/%3E%3Cpath d='M10 50 Q30 70 50 50 Q30 30 10 50' fill='none' stroke='%23a82048' stroke-width='0.8'/%3E%3Cpath d='M90 50 Q70 70 50 50 Q70 30 90 50' fill='none' stroke='%23a82048' stroke-width='0.8'/%3E%3Cpath d='M50 90 Q70 70 50 50 Q30 70 50 90' fill='none' stroke='%23a82048' stroke-width='0.8'/%3E%3Ccircle cx='50' cy='50' r='8' fill='none' stroke='%23a82048' stroke-width='0.5'/%3E%3Ccircle cx='50' cy='50' r='3' fill='%23a82048'/%3E%3C/svg%3E");
  background-size: 50px 50px;
  opacity: 0.6;
}

.bottom-decor::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-rich), var(--gold), var(--gold-rich), var(--gold-dark));
}

/* Scalloped top for bottom section */
.bottom-scallop {
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(200px, 70%, 400px);
  height: clamp(25px, 5vmin, 40px);
  background: #faf6f9;
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
  box-shadow: 0 3px 8px rgba(139, 21, 56, 0.15) inset;
}

/* ========== FOLIO HERO (no separate box styling) ========== */
.folio-hero {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.folio-hero::before,
.folio-hero::after {
  display: none;
}

/* ---------- Music toggle ---------- */
.music-toggle {
  position: fixed;
  top: clamp(0.75rem, 2.5vmin, 1.25rem);
  right: clamp(0.75rem, 2.5vmin, 1.25rem);
  z-index: 20;
  width: clamp(40px, 9vmin, 50px);
  height: clamp(40px, 9vmin, 50px);
  display: grid;
  place-items: center;
  padding: 0;
  border: 2px solid var(--gold-rich);
  border-radius: 50%;
  background: var(--maroon-deep);
  color: var(--gold-soft);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, background 0.2s ease, opacity 0.3s ease;
}

.music-toggle:hover {
  transform: scale(1.08);
  background: var(--maroon);
}

.music-toggle:focus-visible {
  outline: 3px solid var(--gold-soft);
  outline-offset: 3px;
}

.music-icon {
  font-size: clamp(1.1rem, 3vmin, 1.4rem);
  line-height: 1;
  animation: note-pulse 1.6s ease-in-out infinite;
}

.music-toggle.is-muted {
  background: #555;
  border-color: #999;
  color: #ccc;
}

.music-toggle.is-muted .music-icon {
  animation: none;
  opacity: 0.6;
}

.music-toggle.is-muted::after {
  content: "";
  position: absolute;
  width: 2px;
  height: 118%;
  background: #ddd;
  transform: rotate(45deg);
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
}

@keyframes note-pulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.18); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .music-icon { animation: none; }
}

/* ---------- Doors & Seal ---------- */

.leaf {
  position: absolute;
  inset: 0;
  z-index: 4;
  background-color: #4a0f16;
  background-image: url("bg-door-maroon.jpg?v=1");
  background-size: cover;
  background-position: center;
  transition: transform 3.6s cubic-bezier(0.42, 0, 0.58, 1);
}

@media (min-aspect-ratio: 1/1) {
  .leaf {
    background-image: url("bg-door-maroon-wide.jpg?v=1");
  }
}

.leaf-l {
  clip-path: inset(0 50% 0 0);
}

.leaf-r {
  clip-path: inset(0 0 0 50%);
}

/* Silver door-seam line down the center where the two doors meet */
.leaf-l::after,
.leaf-r::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(
    180deg,
    #8a8d93,
    #c7cace 18%,
    #f4f6f8 50%,
    #c7cace 82%,
    #8a8d93
  );
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.45);
  z-index: 5;
}

.leaf-l::after {
  right: 50%;
}

.leaf-r::after {
  left: 50%;
}

.cord {
  display: none;
}

.strand {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.strand-upper {
  top: 0;
  height: 39%;
}

.strand-lower {
  top: 55%;
  height: 42%;
  clip-path: inset(0 0 100% 0);
  transition: clip-path 920ms var(--ease);
}

.bead {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  flex: none;
}

.seal {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: 46%;
  width: min(46cqw, 30cqh, 250px);
  padding: 0;
  border: 0;
  background: transparent;
  transform: translate(-50%, -50%);
  cursor: pointer;
  animation: rest 2.6s var(--ease) infinite;
  transition:
    opacity 420ms var(--ease),
    transform 420ms var(--ease);
}

.seal img {
  display: block;
  width: 100%;
  height: auto;
}

.seal:hover {
  animation: none;
  transform: translate(-50%, -50%) scale(1.04);
}

.seal:active {
  transform: translate(-50%, -50%) scale(0.97);
}

@keyframes rest {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.035);
  }
}

[data-state="unzipping"] .strand-lower,
[data-state="parting"] .strand-lower,
[data-state="reading"] .strand-lower {
  clip-path: inset(0 0 0 0);
}

[data-state="parting"] .leaf-l,
[data-state="darshan"] .leaf-l,
[data-state="departing"] .leaf-l,
[data-state="reading"] .leaf-l {
  transform: translateX(-104%);
}

[data-state="parting"] .leaf-r,
[data-state="darshan"] .leaf-r,
[data-state="departing"] .leaf-r,
[data-state="reading"] .leaf-r {
  transform: translateX(104%);
}

[data-state="parting"] .cord,
[data-state="darshan"] .cord,
[data-state="departing"] .cord,
[data-state="reading"] .cord,
[data-state="parting"] .seal,
[data-state="darshan"] .seal,
[data-state="departing"] .seal,
[data-state="reading"] .seal {
  opacity: 0;
  pointer-events: none;
  animation: none;
  transition:
    opacity 800ms ease 900ms,
    transform 800ms ease 900ms;
}

@media (prefers-reduced-motion: reduce) {
  .leaf,
  .glow,
  .interior,
  .cord,
  .strand-lower,
  .letter,
  .seal {
    transition-duration: 160ms;
    transition-delay: 0ms;
    animation: none;
  }

  .letter {
    filter: none;
  }

  [data-state="parting"] .leaf-l,
  [data-state="reading"] .leaf-l,
  [data-state="parting"] .leaf-r,
  [data-state="reading"] .leaf-r {
    transform: none;
    opacity: 0;
  }
}
