/* =========================================================
   Vikash & Priya — Wedding site
   Palette pulled from the invitation video:
   gold, deep navy, cherry-blossom pink, cream
   ========================================================= */
:root {
  --gold:        #c9a14a;
  --gold-deep:   #a97e2f;
  --navy:        #141b2e;
  --navy-soft:   #1e2740;
  --blossom:     #e39ab7;
  --blossom-soft:#f4d6e1;
  --cream:       #f7f2e9;
  --cream-2:     #efe6d6;
  --ink:         #2c2a26;
  --ink-soft:    #5c574e;

  --serif:  "Cormorant Garamond", Georgia, serif;
  --display:"Marcellus", Georgia, serif;
  --script: "Great Vibes", cursive;

  --maxw: 1100px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

/* ---------- DOOR INTRO ---------- */
/* Two halves of the ornate door fill the screen, then swing open in 3D
   to reveal the couple waiting inside the hero arch. */
.door {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  perspective: 1600px;
  perspective-origin: 50% 50%;
  background: #0b1020;
  cursor: pointer;
}
.door__leaf {
  position: relative;
  width: 50%;
  height: 100%;
  overflow: hidden;
  backface-visibility: hidden;
  transition: transform 2.1s cubic-bezier(.6,.02,.24,1);
}
.door__leaf img {
  position: absolute;
  top: 0;
  width: 200%;      /* = full viewport width, so the two halves line up */
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 50% 58%;  /* keeps the handles in frame on wide screens */
}
.door__leaf--l img { left: 0; }
.door__leaf--r img { right: 0; }
.door__leaf--l { transform-origin: left center;  }
.door__leaf--r { transform-origin: right center; }
/* shading that deepens as each leaf turns away from the light */
.door__leaf::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 2.1s cubic-bezier(.6,.02,.24,1);
  pointer-events: none;
}
.door__leaf--l::after { background: linear-gradient(90deg, rgba(0,0,0,.65), rgba(0,0,0,0)); }
.door__leaf--r::after { background: linear-gradient(-90deg, rgba(0,0,0,.65), rgba(0,0,0,0)); }

.door__hint {
  position: absolute;
  left: 50%;
  bottom: clamp(40px, 9vh, 90px);
  transform: translateX(-50%);
  text-align: center;
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.door__script {
  font-family: var(--script);
  font-size: clamp(30px, 6vw, 50px);
  color: #fff;
  line-height: 1;
  margin-bottom: 16px;
  text-shadow: 0 3px 18px rgba(0,0,0,.75);
}
.door__btn {
  font-family: var(--display);
  font-size: clamp(12px, 1.6vw, 14px);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--navy);
  background: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 2px;
  padding: 13px 30px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
  animation: doorPulse 2.6s 1.2s ease-in-out infinite;
  transition: background .25s, color .25s, transform .25s var(--ease);
}
.door__btn:hover { background: var(--gold-deep); border-color: var(--gold-deep); color: #fff; }
.door__btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* --- opening --- */
body.doors-open .door__leaf--l { transform: rotateY(-105deg); }
body.doors-open .door__leaf--r { transform: rotateY(105deg); }
body.doors-open .door__leaf::after { opacity: 1; }
body.doors-open .door__hint { opacity: 0; transform: translate(-50%, 14px); pointer-events: none; }
body.doors-open .door {
  pointer-events: none;
  background: transparent;
  transition: visibility 0s 2.3s;
  visibility: hidden;
}
/* the page is frozen behind the closed door */
body.doors-closed { overflow: hidden; }
body.doors-closed .nav { opacity: 0; pointer-events: none; }

/* hero intro animations wait for the door */
body.doors-closed .hero__stage *,
body.doors-closed .hero__scroll,
body.doors-closed .hero__scroll span,
body.doors-closed .petal { animation-play-state: paused; }

/* ---------- NAV ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(20px, 5vw, 60px);
  transition: background .4s var(--ease), padding .4s var(--ease), opacity .8s 1.1s var(--ease);
}
.nav.is-scrolled {
  background: rgba(20, 27, 46, .92);
  backdrop-filter: blur(8px);
  padding-top: 12px;
  padding-bottom: 12px;
  box-shadow: 0 2px 20px rgba(0,0,0,.25);
}
.nav__brand {
  font-family: var(--display);
  font-size: 24px;
  letter-spacing: 2px;
  color: #fff;
  text-decoration: none;
}
.nav__links { display: flex; gap: clamp(14px, 3vw, 34px); }
.nav__links a {
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,.85);
  text-decoration: none;
  transition: color .25s;
}
.nav__links a:hover { color: var(--gold); }
@media (max-width: 640px) {
  .nav__links a { font-size: 13px; letter-spacing: 1px; }
}

/* ---------- HERO (assembling arch) ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 28%, #26315170 0, transparent 60%),
    radial-gradient(ellipse at 50% 120%, #3a2540 0, transparent 55%),
    linear-gradient(#181f38, #10162a);
}

.hero__stage {
  position: relative;
  width: min(100vw, calc(100svh * 0.5625));
  aspect-ratio: 540 / 960;
}

/* cream "paper" card behind the arch opening */
.hero__card {
  position: absolute;
  inset: 3.5%;
  border-radius: 46% 46% 8% 8% / 26% 26% 8% 8%;
  background: radial-gradient(ellipse at 50% 38%, #fdfaf3, #f0e6d2 85%);
  box-shadow: 0 18px 60px rgba(0,0,0,.45);
  transform-origin: center 60%;
  overflow: hidden;
  animation: cardIn .9s .15s var(--ease) both;
}
/* the couple, waiting behind the door */
.hero__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 100%;
  transform: scale(1.05);
  transform-origin: 50% 100%;
  animation: photoIn 1.6s .5s var(--ease) both;
}
/* cream veil at the top so the names stay readable over the photo */
.hero__card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgb(253,250,243) 0%,
    rgb(253,250,243) 42%,
    rgba(252,248,240,.88) 52%,
    rgba(250,245,235,.45) 62%,
    rgba(250,245,235,.10) 72%,
    rgba(250,245,235,0) 80%
  );
  pointer-events: none;
}

/* the two halves of the golden arch */
.arch {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  will-change: transform;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,.35));
}
.arch { z-index: 1; }
.arch--l { animation: archInL 1.25s .35s var(--ease) both; }
.arch--r { animation: archInR 1.25s .35s var(--ease) both; }

/* blossom clusters: the branch swings into frame after the arch lands,
   then keeps a gentle continuous sway.
   .blossom (wrapper) = one-time entrance   |   .blossom img = looping sway  */
.blossom {
  position: absolute;
  inset: 0;
  z-index: 3;
  opacity: 0;
  will-change: transform, opacity;
}
.blossom img {
  width: 100%; height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(90,20,50,.28));
  will-change: transform;
}
/* entrance — swing in from just outside the frame edge */
.blossom--tr { transform-origin: 74% 8%;  animation: branchTR 1.35s 1.5s var(--ease) both; }
.blossom--tl { transform-origin: 26% 9%;  animation: branchTL 1.35s 1.7s var(--ease) both; }
.blossom--br { transform-origin: 93% 62%; animation: branchBR 1.35s 1.9s var(--ease) both; }
/* continuous sway (starts once the branch has settled) — pivots at the branch base */
.blossom--tr img { transform-origin: 74% 8%;  animation: sway    5.5s 3.1s ease-in-out infinite; }
.blossom--tl img { transform-origin: 26% 9%;  animation: swayAlt 6.3s 3.4s ease-in-out infinite; }
.blossom--br img { transform-origin: 93% 62%; animation: swayBig 5.0s 3.6s ease-in-out infinite; }

/* centre content */
.hero__inner {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  padding: 30% 13% 0;
  color: var(--navy);
  z-index: 4;
  animation: textUp 1s 2.2s var(--ease) both;
}
.hero__eyebrow {
  font-family: var(--display);
  letter-spacing: 1.1px;
  text-transform: uppercase;
  font-size: clamp(11px, 1.6vw, 13px);
  color: var(--gold-deep);
  margin-bottom: 2px;
}
.hero__names {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(28px, 6.4vw, 46px);
  line-height: 1.12;
  margin: 4px 0;
  color: var(--navy);
}
.hero__names span {
  display: block;
  font-family: var(--script);
  font-size: .62em;
  color: var(--gold-deep);
  margin: -2px 0;
}
.hero__tag {
  font-style: italic;
  font-size: clamp(14px, 2.6vw, 20px);
  color: var(--ink-soft);
}
.hero__date {
  font-family: var(--display);
  letter-spacing: 4px;
  font-size: clamp(12px, 2vw, 16px);
  color: var(--gold-deep);
  margin: 10px 0 4px;
  padding-top: 10px;
  border-top: 1px solid rgba(169,126,47,.5);
}
.hero .hero__btn {
  display: block;
  width: fit-content;
  margin: 14px auto 0;
  padding: 10px 24px;
  font-size: 13px;
}
.hero__scroll {
  position: absolute;
  bottom: 22px; left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  width: 26px; height: 42px;
  border: 2px solid rgba(255,255,255,.55);
  border-radius: 20px;
  animation: fadeIn 1s 3.1s var(--ease) both;
}
.hero__scroll span {
  position: absolute;
  top: 8px; left: 50%;
  width: 4px; height: 8px;
  margin-left: -2px;
  background: #fff;
  border-radius: 2px;
  animation: scroll 1.6s 3.1s infinite;
}

/* falling petals */
.hero__petals { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.petal {
  position: absolute;
  top: -6%;
  width: 12px; height: 12px;
  background: radial-gradient(circle at 35% 30%, #f4b8ce, #d9799e);
  border-radius: 60% 10% 60% 10%;
  opacity: 0;
  animation: petalFall linear infinite;
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-block;
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  color: var(--navy);
  background: var(--gold);
  border: 1px solid var(--gold);
  padding: 14px 34px;
  border-radius: 2px;
  transition: transform .25s var(--ease), background .25s, color .25s;
}
.btn:hover { background: var(--gold-deep); border-color: var(--gold-deep); color: #fff; transform: translateY(-2px); }
.btn--ghost {
  background: transparent;
  color: var(--gold-deep);
  border-color: var(--gold);
}
.btn--ghost:hover { background: var(--gold); color: var(--navy); }

/* ---------- COUNTDOWN ---------- */
.countdown {
  background: var(--navy);
  color: #fff;
  padding: 40px 20px;
}
.count {
  display: flex;
  justify-content: center;
  gap: clamp(20px, 6vw, 70px);
  max-width: var(--maxw);
  margin: 0 auto;
}
.count__unit { text-align: center; }
.count__unit span {
  font-family: var(--display);
  font-size: clamp(34px, 6vw, 58px);
  color: var(--gold);
  display: block;
  line-height: 1;
}
.count__unit small {
  font-family: var(--display);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 12px;
  opacity: .8;
}

/* ---------- SECTIONS ---------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(64px, 10vw, 120px) clamp(20px, 5vw, 40px);
  text-align: center;
}
.section--dark {
  max-width: none;
  background: var(--navy);
  color: #fff;
  background-image:
    radial-gradient(circle at 15% 20%, rgba(201,161,74,.10), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(227,154,183,.12), transparent 40%);
}
.section--dark > * { max-width: var(--maxw); margin-left: auto; margin-right: auto; }
.script {
  font-family: var(--script);
  font-size: clamp(34px, 6vw, 52px);
  color: var(--gold-deep);
  line-height: 1;
}
.script--light { color: var(--blossom); }
.section__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(28px, 5vw, 44px);
  color: var(--navy);
  margin: 6px 0 40px;
  position: relative;
}
.section__title--light { color: #fff; }
.section__title::after {
  content: "";
  display: block;
  width: 60px; height: 2px;
  background: var(--gold);
  margin: 18px auto 0;
}

/* ---------- STORY ---------- */
.story__grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: clamp(24px, 5vw, 60px);
  align-items: center;
  text-align: left;
}
.story__text p { margin-bottom: 18px; color: var(--ink-soft); }
.story__text em { color: var(--gold-deep); font-style: italic; }
.story__img {
  border: 8px solid #fff;
  box-shadow: 0 20px 50px rgba(20,27,46,.18);
  background: var(--cream-2);
  max-height: 460px;
  overflow: hidden;
}
.story__img img {
  width: 100%;
  height: 100%;
  max-height: 444px;
  object-fit: cover;
  object-position: center 22%;
}
@media (max-width: 760px) {
  .story__grid { grid-template-columns: 1fr; text-align: center; }
  .story__text { order: 2; }
}

/* ---------- EVENTS ---------- */
.events__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  text-align: center;
}
.event {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(201,161,74,.35);
  border-radius: 6px;
  padding: 30px 22px 34px;
  transition: transform .3s var(--ease), border-color .3s, background .3s;
}
.event:hover {
  transform: translateY(-6px);
  border-color: var(--gold);
  background: rgba(255,255,255,.07);
}
.event__img {
  height: 210px;
  display: grid;
  place-items: center;
  overflow: hidden;
  margin-bottom: 16px;
}
.event__img img {
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.35));
}
.event h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 26px;
  color: var(--gold);
}
.event__date {
  font-size: 15px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--blossom);
  margin: 6px 0 12px;
}
.event__desc { color: rgba(255,255,255,.78); font-size: 17px; }
.event--feature { border-color: var(--gold); background: rgba(201,161,74,.08); }
@media (max-width: 820px) {
  .events__grid { grid-template-columns: 1fr; max-width: 420px; }
}

/* ---------- VENUE ---------- */
.venue__card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 5vw, 50px);
  align-items: center;
  text-align: left;
  background: var(--cream-2);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(20,27,46,.14);
}
.venue__info { padding: clamp(28px, 5vw, 50px); }
.venue__info h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 30px;
  color: var(--navy);
  margin-bottom: 12px;
}
.venue__info p { color: var(--ink-soft); margin-bottom: 14px; }
.venue__note { font-style: italic; font-size: 17px; }
.venue__img { height: 100%; }
.venue__img img { height: 100%; object-fit: cover; }
@media (max-width: 760px) {
  .venue__card { grid-template-columns: 1fr; }
  .venue__img { max-height: 260px; }
}

/* ---------- FOOTER ---------- */
.footer {
  background: var(--navy);
  color: #fff;
  text-align: center;
  padding: 60px 20px;
  border-top: 1px solid rgba(201,161,74,.3);
}
.footer__names {
  font-family: var(--script);
  font-size: 44px;
  color: var(--gold);
}
.footer__date {
  font-family: var(--display);
  letter-spacing: 6px;
  margin: 6px 0 20px;
}
.footer__made {
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: .6;
}

/* ---------- ANIMATIONS ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scroll { 0% { opacity: 0; top: 8px; } 40% { opacity: 1; } 80% { opacity: 0; top: 24px; } 100% { opacity: 0; } }

/* arch halves sliding together */
@keyframes archInL { 0% { opacity: 0; transform: translateX(-110%); } 60% { opacity: 1; } 100% { opacity: 1; transform: translateX(0); } }
@keyframes archInR { 0% { opacity: 0; transform: translateX(110%); } 60% { opacity: 1; } 100% { opacity: 1; transform: translateX(0); } }
@keyframes cardIn { from { opacity: 0; transform: scale(.82); } to { opacity: 1; transform: scale(1); } }
@keyframes photoIn { from { opacity: 0; transform: scale(1.16); } to { opacity: 1; transform: scale(1.05); } }
@keyframes doorPulse { 0%, 100% { transform: none; } 50% { transform: translateY(-4px); } }
@keyframes textUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
/* branch swings in from outside the frame, overshoots slightly, settles */
@keyframes branchTR {
  0%   { opacity: 0; transform: translate(16%, -22%) rotate(8deg)  scale(.9); }
  55%  { opacity: 1; }
  82%  { transform: translate(-1%, 1%) rotate(-1.5deg) scale(1.03); }
  100% { opacity: 1; transform: none; }
}
@keyframes branchTL {
  0%   { opacity: 0; transform: translate(-16%, -22%) rotate(-8deg) scale(.9); }
  55%  { opacity: 1; }
  82%  { transform: translate(1%, 1%) rotate(1.5deg) scale(1.03); }
  100% { opacity: 1; transform: none; }
}
@keyframes branchBR {
  0%   { opacity: 0; transform: translate(20%, 16%) rotate(9deg) scale(.9); }
  55%  { opacity: 1; }
  82%  { transform: translate(-1%, -1%) rotate(-1.5deg) scale(1.03); }
  100% { opacity: 1; transform: none; }
}
/* gentle idle sway, pivoting at the branch base */
@keyframes sway    { 0% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg); } 100% { transform: rotate(-1.5deg); } }
@keyframes swayAlt { 0% { transform: rotate(1.4deg); } 50% { transform: rotate(-1.6deg); } 100% { transform: rotate(1.4deg); } }
@keyframes swayBig { 0% { transform: rotate(-2.2deg); } 50% { transform: rotate(1.3deg); } 100% { transform: rotate(-2.2deg); } }
@keyframes petalFall {
  0%   { opacity: 0; transform: translateY(0) translateX(0) rotate(0deg); }
  10%  { opacity: .9; }
  90%  { opacity: .8; }
  100% { opacity: 0; transform: translateY(105svh) translateX(40px) rotate(320deg); }
}

.reveal { opacity: 0; transform: translateY(36px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  /* intro elements default to hidden via their animations — force them visible */
  .blossom, .hero__inner, .hero__card { opacity: 1 !important; transform: none !important; }
  .hero__photo { opacity: 1 !important; transform: scale(1.22) !important; }
  /* the door still opens, just without the long swing */
  .door__leaf { transition-duration: .45s; }
}
