/* ── TOKENS ──────────────────────────────────────────────── */
:root {
  --bg:           #0e0c09;
  --surface:      #161310;
  --text-primary: #ede8e0;
  --text-muted:   #6d6058;
  --gold:         #c4903a;
  --gold-soft:    #e2b06a;
  --red-ghost:    #5c1a1a;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --font-mono:    'DM Mono', 'Courier New', monospace;
  --font-script:  'Noto Serif', Georgia, serif;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --max-w: 1100px;
  --section-px: clamp(1.5rem, 5vw, 5rem);
  --section-py: clamp(5rem, 12vw, 10rem);
}

/* ── RESET ──────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

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

/* Ensure [hidden] always hides, even when element has a display class */
[hidden] { display: none !important; }

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

a { color: inherit; }

ul { list-style: none; }

/* ── BASE ───────────────────────────────────────────────── */
body {
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Warmth overlay — amber tint animated by GSAP over Kolkata section */
.warmth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(196, 144, 58, 0.04);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  will-change: opacity;
}

/* ── SECTION HEADINGS ───────────────────────────────────── */
.section-heading {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2rem, 6vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

/* ── INITIAL HIDDEN STATE for JS-animated elements ─────── */
/* These are overridden when JS runs; if JS fails they show normally */
@media (prefers-reduced-motion: no-preference) {
  .js-hero-blessing,
  .js-hero-names,
  .js-hero-date,

  .js-dog-left,
  .js-dog-right,
  .js-quote-p1,
  .js-quote-p2,
  .js-the-day-photo,
  .js-fade-up,
  .js-place,
  .js-clip-reveal {
    opacity: 0;
  }
}

/* ── HERO ───────────────────────────────────────────────── */
#hero {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: flex-start; /* proposal subjects are on the right — content lives left */
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 130%; /* extra height so parallax y-shift doesn't expose background */
  object-fit: cover;
  object-position: center center;
  transform-origin: center top;
  will-change: transform;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(to bottom,
      rgba(14, 12, 9, 0.60) 0%,   /* stronger top shadow for blessing legibility */
      rgba(14, 12, 9, 0.15) 38%,
      rgba(14, 12, 9, 0.80) 100%),
    radial-gradient(ellipse at 30% top,
      transparent 35%,
      rgba(14, 12, 9, 0.35) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: left;
  padding: 0 var(--section-px) 0 clamp(2.5rem, 7vw, 8rem);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(0.75rem, 2vw, 1.25rem);
  max-width: min(54vw, 680px);
}

@media (max-width: 639px) {
  .hero-content {
    text-align: center;
    align-items: center;
    padding: 0 var(--section-px);
    max-width: none;
  }

  /* Shift crop right to keep both people in frame; pan down to cut sky */
  .hero-bg img {
    object-position: 68% center;
    transform: translateY(-20%);
  }
}

.blessing {
  font-family: var(--font-script);
  font-size: clamp(0.7rem, 1.8vw, 0.9rem);
  letter-spacing: 0.22em;
  color: rgba(237, 232, 224, 0.82);
  text-shadow: 0 1px 8px rgba(0,0,0,0.65);
}

.names {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(3.8rem, 13vw, 9rem);
  line-height: 0.95;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

.names .amp {
  font-style: italic;
  color: var(--gold);
  font-weight: 300;
}

.hero-date {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.6rem, 3.8vw, 2.8rem);
  letter-spacing: 0.06em;
  color: var(--gold);
  text-shadow: 0 2px 16px rgba(0,0,0,0.7);
}


/* ── STORY ──────────────────────────────────────────────── */
#story {
  position: relative;
  background: var(--bg);
  overflow: hidden;
}

.story-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
  padding: clamp(2rem, 5vw, 4rem) var(--section-px) var(--section-py);
  max-width: var(--max-w);
  margin: 0 auto;
}

/* Dog photos */
.dogs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  width: 100%;
  max-width: 680px;
}

.dog-photo {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 2px;
}

.dog-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

/* Quote */
.story-quote {
  max-width: 640px;
  width: 100%;
  border-left: 1.5px solid var(--gold);
  padding-left: clamp(1.25rem, 3vw, 2rem);
  display: flex;
  flex-direction: column;
  gap: 1.25em;
}

.story-quote p {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  line-height: 1.6;
  color: var(--text-primary);
}

@media (min-width: 768px) {
  .dog-photo.dog-left {
    transform: translateY(2rem);
  }
}

/* ── THE DAY ────────────────────────────────────────────── */
#the-day {
  padding: clamp(3rem, 6vw, 5rem) var(--section-px) clamp(2rem, 5vw, 4rem);
}

.the-day-layout {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(3rem, 8vw, 5rem);
  align-items: start;
}

@media (min-width: 900px) {
  .the-day-layout {
    grid-template-columns: minmax(0, 340px) 1fr;
    gap: clamp(4rem, 7vw, 7rem);
  }
}

/* Umbrella photo — left column */
.the-day-photo {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 2px;
}

.the-day-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.06);
}

/* Right column: countdown + timeline + venue stacked */
.the-day-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(2rem, 5vw, 4.5rem);
}

@media (max-width: 639px) {
  /* Content first, photo second on mobile */
  .the-day-photo  { order: 2; aspect-ratio: 4 / 3; }
  .the-day-content { order: 1; align-items: stretch; }
}

/* Countdown */
.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1rem, 3vw, 2.5rem);
  text-align: center;
  width: 100%;
  max-width: 560px;
}

@media (max-width: 360px) {
  .countdown {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem 2rem;
  }
}

.countdown-unit {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.countdown-value {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.8rem, 8vw, 5rem);
  line-height: 1;
  color: var(--text-primary);
  min-width: 2ch;
  display: inline-block;
}

.countdown-label {
  font-family: var(--font-mono);
  font-size: clamp(0.55rem, 1.2vw, 0.65rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Timeline */
.timeline-wrap {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.timeline-svg {
  display: block;
}

.timeline-mobile {
  display: none; /* always hidden — horizontal layout used at all widths */
}

.timeline-desktop {
  display: block;
  width: 100%;
  height: 60px;
}

.tl-track {
  stroke: var(--gold);
  stroke-width: 1;
  stroke-linecap: round;
  /* stroke-dasharray and stroke-dashoffset set by JS after measuring */
}

.tl-node {
  fill: var(--bg);
  stroke: var(--gold);
  stroke-width: 1.5;
}

/* Timeline events layout — always side-by-side */
.timeline-events {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  width: 100%;
}

.timeline-event--right {
  text-align: right;
}

.timeline-event {
  max-width: 48%;
}

.event-time {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.4rem;
}

.event-name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  margin-bottom: 0.5rem;
}

.event-note {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Venue */
.venue {
  width: 100%;
  text-align: center;
}

.venue-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: clamp(0.75rem, 1.5vw, 0.85rem);
  line-height: 1.8;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: color 0.2s;
}

.venue-link:hover { color: var(--gold-soft); }

.venue-pin {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--gold);
}

.venue-name {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.venue-address {
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 1.6vw, 1rem);
  line-height: 1.8;
  letter-spacing: 0.04em;
}

/* ── KOLKATA ────────────────────────────────────────────── */
#kolkata {
  position: relative;
  padding: clamp(3rem, 6vw, 5rem) var(--section-px) var(--section-py);
}

.kolkata-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(3rem, 8vw, 5rem);
  align-items: start;
}

@media (min-width: 768px) {
  .kolkata-inner {
    grid-template-columns: 1fr 1fr;
    align-items: center;
  }
}

.kolkata-text {
  display: flex;
  flex-direction: column;
  gap: clamp(1.5rem, 4vw, 2.5rem);
}

.getting-here {
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  color: var(--text-muted);
  line-height: 1.7;
}

.places-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}

.places-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.places-list li {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  border-bottom: 1px solid rgba(237, 232, 224, 0.06);
  padding: 0.6rem 0 0.7rem;
}

.place-name {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.2rem, 2.8vw, 1.6rem);
  color: var(--text-primary);
  line-height: 1.2;
}

.place-desc {
  font-family: var(--font-body);
  font-size: clamp(0.72rem, 1.4vw, 0.8rem);
  color: var(--text-muted);
  line-height: 1.5;
}

/* Kolkata photos column */
.kolkata-photos {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 440px;
  width: 100%;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .kolkata-photos {
    margin: 0;
  }
}

/* Kolkata photo — clip-path reveal animation */
.kolkata-photo {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 2px;
  width: 100%;
  clip-path: inset(100% 0 0 0); /* animated to inset(0% 0 0 0) by JS */
}

.kolkata-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.08); /* matches JS initial state; JS animates to scale(1) */
}

/* ── RSVP ───────────────────────────────────────────────── */
#rsvp {
  position: relative;
  padding: var(--section-py) var(--section-px);
  overflow: hidden;
}

/* 囍 ghost watermark — the signature aesthetic element */
#rsvp::before {
  content: '囍';
  position: absolute;
  right: -5vw;
  top: 50%;
  transform: translateY(-50%);
  font-size: clamp(20rem, 45vw, 55rem);
  line-height: 1;
  font-family: var(--font-script);
  color: var(--text-primary);
  opacity: 0.035;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

/* Two-column layout: portrait left, form right (desktop only) */
.rsvp-layout {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .rsvp-layout {
    grid-template-columns: minmax(0, 340px) 1fr;
    gap: clamp(4rem, 7vw, 7rem);
    align-items: start;
  }
}

.rsvp-photo-col {
  display: block;
}

@media (max-width: 639px) {
  .rsvp-photo {
    aspect-ratio: 4 / 3;
  }
}

.rsvp-photo {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 2px;
  clip-path: inset(100% 0 0 0);
}

.rsvp-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transform: scale(1.08);
}

.rsvp-inner {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(2rem, 5vw, 3.5rem);
}

@media (min-width: 900px) {
  .rsvp-inner {
    max-width: none;
    margin: 0;
  }
}

.rsvp-heading {
  /* inherits .section-heading */
}

/* Form */
#rsvp-form {
  display: flex;
  flex-direction: column;
  gap: clamp(1.5rem, 4vw, 2rem);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.field-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

input[type="text"],
textarea {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(237, 232, 224, 0.15);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.6rem 0;
  width: 100%;
  outline: none;
  transition: border-color 0.25s;
  border-radius: 0;
  -webkit-appearance: none;
}

input[type="text"]::placeholder,
textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

input[type="text"]:focus,
textarea:focus {
  border-bottom-color: var(--gold);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

/* Attend toggle */
.attend-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.toggle-btn {
  padding: 0.9rem 0.5rem;
  border: 1px solid rgba(237, 232, 224, 0.15);
  border-radius: 2px;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.85rem;
  transition: border-color 0.2s, color 0.2s, background-color 0.2s;
  min-height: 52px;
}

.toggle-btn:hover {
  border-color: rgba(237, 232, 224, 0.3);
  color: var(--text-primary);
}

.toggle-btn.is-selected {
  background-color: var(--gold);
  border-color: var(--gold);
  color: var(--bg);
}

/* Guest stepper */
.stepper {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.stepper-btn {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(237, 232, 224, 0.2);
  border-radius: 50%;
  color: var(--text-primary);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s;
}

.stepper-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.stepper-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 300;
  min-width: 2ch;
  text-align: center;
  color: var(--text-primary);
}

/* Submit */
.field-submit {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
}

.submit-btn {
  background: var(--gold);
  color: var(--bg);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 1rem 2.5rem;
  border-radius: 2px;
  transition: background-color 0.2s;
  min-height: 52px;
}

.submit-btn:hover { background: var(--gold-soft); }
.submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.deadline {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}

.rsvp-error {
  font-size: 0.85rem;
  color: #e07070;
  line-height: 1.5;
}

.rsvp-error a { color: var(--gold-soft); }

/* Success state */
.rsvp-success {
  text-align: center;
  padding: 2rem 0;
}

.success-message {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  color: var(--text-primary);
}

/* ── FOOTER ─────────────────────────────────────────────── */
#footer {
  padding: clamp(3rem, 6vw, 5rem) var(--section-px);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  border-top: 1px solid rgba(237, 232, 224, 0.06);
}

.footer-blessing {
  font-family: var(--font-script);
  font-size: clamp(0.8rem, 1.8vw, 1rem);
  letter-spacing: 0.15em;
  color: var(--text-muted);
}

.footer-email {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-email:hover { color: var(--gold-soft); }

/* ── MOBILE OVERRIDES ───────────────────────────────────── */
@media (max-width: 639px) {
  /* Story: fill the pinned viewport and center content vertically */
  #story { min-height: 100svh; }
  .story-inner {
    min-height: 100svh;
    justify-content: center;
    padding-top: clamp(2rem, 5vw, 3rem);
    padding-bottom: clamp(2rem, 5vw, 3rem);
  }
}

@media (max-width: 480px) {
  /* Dogs fill more of the screen on mobile */
  .dogs { max-width: 100%; margin: 0; }

  /* Timeline events stack cleanly */
  .timeline-event { max-width: 100%; }

  /* 囍 on small screens: keep it proportional */
  #rsvp::before { font-size: 80vw; right: -12vw; opacity: 0.02; }
}

/* ── FOCUS STYLES (keyboard nav) ────────────────────────── */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* ── SELECTION COLOR ───────────────────────────────────── */
::selection {
  background: var(--gold);
  color: var(--bg);
}

/* ── SMOOTH SCROLL ─────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
