/* ================================================
   layout.css · Sections, Cards, Grid
   ================================================ */

/* --- Particle Canvas --- */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: var(--z-particles);
  pointer-events: none;
}

/* --- Progress Bar --- */
#bar-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  z-index: var(--z-progress);
}
#bar {
  width: 100%;
  height: 100%;
  background: var(--gold);
  transform-origin: left;
  transform: scaleX(0);
}

/* --- Page Structure --- */
main {
  position: relative;
  z-index: var(--z-content);
}

/* --- Vellum Gate (Step 4) --- */
.vellum {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(253, 248, 238, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: var(--z-vellum);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: var(--sp-lg);
}

.vellum-content {
  max-width: 400px;
}

.vellum-btn {
  margin-top: var(--sp-lg);
  padding: var(--sp-md) var(--sp-lg);
  background: var(--maroon);
  color: var(--cream);
  border: 1px solid var(--gold);
  border-radius: var(--radius-pill);
  font-family: 'Mulish', sans-serif;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: background 0.3s;
}

.vellum-btn:hover {
  background: var(--maroon-deep);
}

/* --- Act 1: The Envelope (Step 1-3) --- */
.env-scene {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--maroon-deep);
  z-index: var(--z-envelope);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  perspective: 1200px;
}

.envelope-wrapper {
  position: relative;
  width: 320px;
  height: 480px;
  transform-style: preserve-3d;
}

.envelope {
  position: absolute;
  width: 100%;
  height: 100%;
  background: var(--maroon);
  border: 2px solid var(--gold);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  transform-style: preserve-3d;
}

/* Red Ribbon Cross */
.ribbon-v {
  position: absolute;
  left: calc(50% - 15px);
  top: 0;
  width: 30px;
  height: 100%;
  background: linear-gradient(to right, #7a1523, var(--fire), #7a1523);
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.3);
  z-index: 10;
  transform-origin: top;
}

.ribbon-h {
  position: absolute;
  top: calc(50% - 15px);
  left: 0;
  width: 100%;
  height: 30px;
  background: linear-gradient(to bottom, #7a1523, var(--fire), #7a1523);
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.3);
  z-index: 10;
  transform-origin: right;
}

/* Golden Bow */
.bow {
  position: absolute;
  left: calc(50% - 30px);
  top: calc(50% - 30px);
  width: 60px;
  height: 60px;
  z-index: 20;
  cursor: pointer;
}

.bow-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
}

/* Envelope Flap on Back/Inside */
.env-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: var(--maroon-deep);
  border-bottom: 2px solid var(--gold);
  border-left: 2px solid var(--gold);
  border-right: 2px solid var(--gold);
  transform-origin: top;
  z-index: 5;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.inner-card {
  position: absolute;
  top: 10%;
  left: 5%;
  width: 90%;
  height: 80%;
  background: var(--paper);
  border: 1px solid var(--gold);
  border-radius: var(--radius-sm);
  z-index: 2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--sp-md);
  text-align: center;
}

.inner-card .names {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  color: var(--maroon);
  font-weight: bold;
}

.env-hint {
  position: absolute;
  bottom: var(--sp-lg);
  color: var(--gold-light);
  font-family: 'Mulish', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-align: center;
  width: 100%;
  pointer-events: none;
}

/* --- Main Card Hero --- */
.hero-section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: var(--sp-xl) var(--sp-md);
  position: relative;
  background: var(--paper);
  color: var(--maroon-deep);
}

.hero-card {
  max-width: 600px;
  width: 100%;
  background: rgba(253, 248, 238, 0.9);
  padding: var(--sp-xl) var(--sp-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(201, 162, 75, 0.25);
  position: relative;
}

.ganesha-wrapper {
  width: 70px;
  height: 70px;
  margin: 0 auto var(--sp-md);
}

.vandana {
  font-size: 1.2rem;
  color: var(--maroon);
  margin-bottom: var(--sp-lg);
}

.hero-art-wrapper {
  margin: var(--sp-lg) auto;
  max-width: 320px;
  position: relative;
}

.hero-art {
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(74, 14, 24, 0.15);
  border: 1px solid var(--gold);
}

.host-line {
  font-size: 1.05rem;
  margin-bottom: var(--sp-md);
  font-style: italic;
}

.hero-names {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  margin: var(--sp-md) 0;
}
.hero-names .weds {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-style: italic;
  font-weight: 500;
  display: block;
  color: var(--gold);
  margin: 0.2rem 0;
}

.wedding-dates {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--maroon);
  margin-top: var(--sp-md);
}

.hashtag {
  display: inline-block;
  margin-top: var(--sp-lg);
  padding: var(--sp-xs) var(--sp-md);
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--maroon);
  background: rgba(201, 162, 75, 0.12);
  border: 1px solid var(--gold);
}

.scroll-cue {
  margin-top: var(--sp-xl);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--gold);
}

/* --- Story Strip --- */
.story-strip {
  background: var(--maroon-deep);
  color: var(--cream);
  text-align: center;
  padding: var(--sp-xl) var(--sp-md);
  border-top: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
}

.story-content {
  max-width: 500px;
  margin: 0 auto;
}

.story-eyebrow {
  margin-bottom: var(--sp-md);
}

.story-text {
  font-style: italic;
  color: var(--gold-light);
}

/* --- Chapters Base --- */
.chapter {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--sp-xl) var(--sp-md);
  position: relative;
  overflow: hidden;
}

.card-container {
  max-width: 580px;
  width: 100%;
  position: relative;
  z-index: 2;
}

/* The Glass Glassmorphism card */
.glass-card {
  background: rgba(253, 248, 238, 0.95);
  border: 1px solid rgba(201, 162, 75, 0.35);
  border-radius: var(--radius-lg);
  padding: var(--sp-xl) var(--sp-lg);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  text-align: center;
}

.chapter-number {
  color: var(--gold);
  font-weight: 600;
}

.chapter-title {
  margin: var(--sp-xs) 0 var(--sp-lg);
  font-size: clamp(2rem, 5vw, 3rem);
}

.chapter-art {
  margin: var(--sp-lg) auto;
  max-width: 280px;
  position: relative;
}

.meta-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-md);
  font-size: 0.95rem;
}

.meta-row svg {
  width: 18px;
  height: 18px;
  color: var(--gold);
  flex-shrink: 0;
}

.btn-row {
  margin-top: var(--sp-lg);
  display: flex;
  justify-content: center;
  gap: var(--sp-md);
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-xs);
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  cursor: pointer;
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(46, 33, 25, 0.3);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: all 0.3s;
}

.btn-primary {
  background: var(--maroon);
  color: var(--cream);
  border-color: var(--gold);
}

.btn-primary:hover {
  background: var(--maroon-deep);
  border-color: var(--gold-light);
}

/* Garland (Genda/Marigold) dots decoration */
.genda {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: var(--sp-md) 0 var(--sp-xl);
}
.genda i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--haldi);
}
.genda i:nth-child(even) {
  background: #e65c00; /* saffron petal */
}

/* --- Chapter Unique Overrides --- */

/* I: Haldi & Mehndi */
#chapter-1 {
  background: linear-gradient(135deg, var(--haldi-bg), #fffbf0);
}
#chapter-1 .chapter-title { color: var(--haldi); }
#chapter-1 .genda i { background: var(--haldi); }
#chapter-1 .genda i:nth-child(even) { background: #e07b1f; }
#chapter-1 .haldi-hand {
  width: 90px;
  height: 90px;
  margin: 0 auto;
}
.splash {
  position: absolute;
  border-radius: 50%;
  background: rgba(232, 168, 32, 0.15);
  pointer-events: none;
  z-index: 1;
}
.splash-1 { width: 60px; height: 60px; top: 10%; left: 8%; }
.splash-2 { width: 90px; height: 90px; bottom: 12%; right: 5%; }
.splash-3 { width: 40px; height: 40px; top: 75%; left: 12%; }

/* II: Baraat & Cocktail */
#chapter-2 {
  background: linear-gradient(135deg, #101935, #1c2a52);
  color: var(--cream);
}
#chapter-2 .glass-card {
  background: rgba(28, 42, 82, 0.92);
  border-color: rgba(201, 162, 75, 0.4);
  color: var(--cream);
}
#chapter-2 .chapter-title { color: var(--gold-light); }
#chapter-2 .dhol-wrapper {
  width: 100px;
  height: 100px;
  margin: 0 auto;
}
.baraat-sparks {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}
.spark-dot {
  position: absolute;
  width: 5px;
  height: 5px;
  background: var(--gold-light);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--gold-light);
}

/* III: Pheras */
#chapter-3 {
  background: linear-gradient(135deg, #2a070d, #4a0e18);
  color: var(--cream);
}
#chapter-3 .glass-card {
  background: rgba(74, 14, 24, 0.95);
  border-color: rgba(201, 162, 75, 0.45);
  color: var(--cream);
}
#chapter-3 .chapter-title { color: var(--gold); }
.phera-arch-frame {
  position: relative;
  overflow: hidden;
  border-radius: 120px 120px var(--radius-md) var(--radius-md); /* jharokha arch mask */
  border: 3px double var(--gold);
  padding: 4px;
  background: var(--maroon-deep);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  max-width: 260px;
  margin: 0 auto;
}
.phera-arch-img {
  width: 100%;
  height: auto;
  border-radius: 116px 116px var(--radius-sm) var(--radius-sm);
}
.glow-fire {
  position: absolute;
  bottom: 12%;
  left: calc(50% - 25px);
  width: 50px;
  height: 50px;
  background: radial-gradient(circle, rgba(232, 107, 32, 0.8) 0%, rgba(232, 107, 32, 0) 70%);
  filter: blur(2px);
  pointer-events: none;
}
.fire-embers {
  position: absolute;
  bottom: 15%;
  left: 0;
  width: 100%;
  height: 80px;
  pointer-events: none;
}
.fire-embers span {
  position: absolute;
  bottom: 0;
  width: 3px;
  height: 3px;
  background: var(--saffron);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--saffron);
  opacity: 0;
}

/* Vow list sliding */
.vows-list {
  text-align: left;
  max-width: 420px;
  margin: var(--sp-lg) auto 0;
  border-top: 1px solid rgba(201, 162, 75, 0.2);
  padding-top: var(--sp-md);
}
.vows-list li {
  margin-bottom: var(--sp-sm);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--cream);
  opacity: 0.4;
  transform: translateX(-16px);
  transition: opacity 0.5s, transform 0.5s;
}
.vows-list li.visible {
  opacity: 1;
  transform: translateX(0);
}
.vows-list li .vow-hindi {
  display: block;
  font-family: 'Tiro Devanagari Hindi', serif;
  color: var(--gold-light);
  font-size: 0.95rem;
  margin-bottom: 2px;
}

/* IV: Anand Karaj */
#chapter-4 {
  background: linear-gradient(135deg, var(--serene), #ffffff);
}
#chapter-4 .glass-card {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(39, 75, 143, 0.25);
  border-top: 4px solid var(--saffron); /* saffron top border */
}
#chapter-4 .chapter-title { color: var(--blue); }
#chapter-4 .genda i { background: var(--saffron); }
#chapter-4 .genda i:nth-child(even) { background: var(--blue); }
.ik-onkar-wrapper {
  font-family: 'Mukta Mahee', sans-serif;
  font-size: 3.5rem;
  font-weight: bold;
  color: var(--saffron);
  margin-bottom: var(--sp-md);
  text-shadow: 0 0 10px rgba(224, 123, 31, 0.2);
}
.etiquette-card {
  background: rgba(39, 75, 143, 0.08);
  border: 1px dashed var(--blue);
  border-radius: var(--radius-md);
  padding: var(--sp-md);
  margin-top: var(--sp-lg);
  text-align: left;
  font-size: 0.85rem;
}
.etiquette-card h4 {
  color: var(--blue);
  margin-bottom: var(--sp-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.etiquette-card ul {
  list-style: disc;
  padding-left: var(--sp-md);
}
.etiquette-card li {
  margin-bottom: 2px;
  color: var(--ink);
}

/* V: Reception */
#chapter-5 {
  background: linear-gradient(135deg, var(--champagne), #ffffff);
}
#chapter-5 .chapter-title { color: var(--maroon); }
#chapter-5 .glass-card {
  background: rgba(253, 248, 238, 0.96);
  border-color: rgba(74, 14, 24, 0.25);
}
.champagne-wrapper {
  width: 90px;
  height: 90px;
  margin: 0 auto;
}

/* --- Details & Travel & RSVP --- */
.details-section {
  background: var(--paper);
  padding: var(--sp-2xl) var(--sp-md);
  border-top: 1px solid rgba(201, 162, 75, 0.2);
}

.details-grid {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--sp-xl);
}

.details-panel {
  background: #ffffff;
  border: 1px solid rgba(201, 162, 75, 0.18);
  border-radius: var(--radius-lg);
  padding: var(--sp-xl) var(--sp-lg);
  box-shadow: var(--shadow-card);
}

.details-panel h3 {
  color: var(--maroon);
  border-bottom: 1px solid var(--gold);
  padding-bottom: var(--sp-sm);
  margin-bottom: var(--sp-lg);
  text-align: center;
}

/* Timeline list */
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
}
.timeline-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: var(--sp-md);
  align-items: start;
}
.timeline-time {
  font-family: 'Cormorant Garamond', serif;
  font-weight: bold;
  color: var(--gold);
  font-size: 1.1rem;
}
.timeline-info h4 {
  font-size: 1rem;
  color: var(--maroon-deep);
}
.timeline-info p {
  font-size: 0.85rem;
  color: var(--ink);
  opacity: 0.8;
}

/* Travel Info */
.travel-info {
  display: flex;
  flex-direction: column;
  gap: var(--sp-lg);
}
.travel-node h4 {
  color: var(--maroon-deep);
  margin-bottom: var(--sp-xs);
}

/* RSVP Form CSS */
.rsvp-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
  text-align: left;
}
.form-group label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
}
.form-control {
  padding: var(--sp-sm) var(--sp-md);
  border: 1px solid rgba(201, 162, 75, 0.3);
  border-radius: var(--radius-md);
  background: var(--paper);
  color: var(--ink);
}
.form-control:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 6px rgba(201, 162, 75, 0.2);
}
.radio-group {
  display: flex;
  gap: var(--sp-lg);
}
.radio-label {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  font-size: 0.9rem;
  cursor: pointer;
}

/* --- Footer --- */
.footer-section {
  background: var(--maroon-deep);
  color: var(--cream);
  text-align: center;
  padding: var(--sp-2xl) var(--sp-md) var(--sp-xl);
  border-top: 2px solid var(--gold);
}
.footer-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.2rem;
  color: var(--gold-light);
  margin-bottom: var(--sp-md);
}
.footer-hosts {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--cream);
  opacity: 0.9;
  margin-bottom: var(--sp-lg);
}

/* --- Responsive Helpers --- */
@media (max-width: 480px) {
  .envelope-wrapper {
    width: 280px;
    height: 420px;
  }
  .inner-card {
    padding: var(--sp-sm);
  }
  .glass-card {
    padding: var(--sp-lg) var(--sp-md);
  }
}
