/* =============================================================================
   Luxury wedding invitation — design tokens & base
   ============================================================================= */

:root {
  --bg: #0c0b0a;
  --bg-elevated: #141210;
  --fg: #f7f3eb;
  --fg-muted: rgba(247, 243, 235, 0.72);
  --gold: #c9a962;
  --gold-soft: rgba(201, 169, 98, 0.35);
  --beige: #e8e0d4;
  --beige-dark: #c4b8a8;
  --shadow-soft: 0 18px 48px rgba(0, 0, 0, 0.45);
  --shadow-card: 0 12px 40px rgba(0, 0, 0, 0.35);
  --radius-lg: 20px;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Cormorant", Georgia, serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --hero-names-duration: 1.15s;
  --hero-tagline-duration: 1s;
  --hero-tagline-delay: 0.55s;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

/* =============================================================================
   Music toggle (floating)
   ============================================================================= */

.music-toggle {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 50;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: 1px solid var(--gold-soft);
  background: rgba(12, 11, 10, 0.85);
  color: var(--gold);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.25s var(--ease-out), border-color 0.25s, box-shadow 0.25s;
  backdrop-filter: blur(8px);
}

.music-toggle:hover:not(:disabled) {
  transform: scale(1.06);
  border-color: var(--gold);
  box-shadow: 0 8px 24px rgba(201, 169, 98, 0.2);
}

.music-toggle:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.music-toggle__icon {
  position: absolute;
  font-size: 1.25rem;
  line-height: 1;
  transition: opacity 0.3s;
}

.music-toggle__icon--on {
  opacity: 0;
}

.music-toggle[aria-pressed="true"] .music-toggle__icon--off {
  opacity: 0;
}

.music-toggle[aria-pressed="true"] .music-toggle__icon--on {
  opacity: 1;
}

/* =============================================================================
   Hero
   ============================================================================= */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 1.35s var(--ease-out);
}

.hero__video--desaturated {
  filter: grayscale(1);
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(12, 11, 10, 0.35) 0%,
    rgba(12, 11, 10, 0.5) 45%,
    rgba(12, 11, 10, 0.65) 100%
  );
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem 1.5rem 5rem;
  max-width: 90vw;
}

.hero__names {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.25rem, 7vw, 4rem);
  letter-spacing: 0.06em;
  line-height: 1.15;
}

.hero__tagline {
  margin: 1.1rem 0 0;
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.6vw, 1.2rem);
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.04em;
  line-height: 1.5;
  color: var(--beige);
  text-shadow: 0 1px 20px rgba(12, 11, 10, 0.75), 0 0 1px rgba(12, 11, 10, 0.5);
}

/* Initial hidden state for lines — JS adds .hero--started for animation */
.hero__line {
  display: inline-block;
  opacity: 0;
  transform: translate3d(0, 28px, 0);
}

.hero--started .hero__line--names {
  animation: heroLineIn var(--hero-names-duration) var(--ease-out) forwards;
}

.hero--started .hero__line--tagline {
  animation: heroLineIn var(--hero-tagline-duration) var(--ease-out) forwards;
  animation-delay: var(--hero-tagline-delay);
}

@keyframes heroLineIn {
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* Ensure hero lines are readable even if animation/CSS cache fails on deploy */
.hero--color .hero__line--names,
.hero--color .hero__line--tagline {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  .hero__line {
    opacity: 1;
    transform: none;
  }

  .hero--started .hero__line--names,
  .hero--started .hero__line--tagline {
    animation: none;
  }

  .hero__video {
    transition: none;
  }

  .hero__video--desaturated {
    filter: none;
  }
}

/* Scroll hint */
.hero__scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s var(--ease-out);
}

.hero--color .hero__scroll {
  opacity: 1;
}

.hero__scroll-text {
  font-size: 0.65rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.hero__scroll-line {
  width: 1px;
  height: 2rem;
  background: linear-gradient(to bottom, var(--gold), transparent);
  opacity: 0.7;
}

.hero__scroll-chevron {
  width: 0.5rem;
  height: 0.5rem;
  border-right: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
  transform: rotate(45deg);
  margin-top: -0.25rem;
  animation: scrollBounce 2.2s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%,
  100% {
    transform: rotate(45deg) translateY(0);
    opacity: 0.6;
  }
  50% {
    transform: rotate(45deg) translateY(6px);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__scroll {
    opacity: 1;
  }

  .hero__scroll-chevron {
    animation: none;
  }
}

/* =============================================================================
   Date section — scratch cards
   ============================================================================= */

.date-section {
  padding: 4rem 1.25rem 4.5rem;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-elevated) 50%, var(--bg) 100%);
}

.date-section__inner {
  max-width: 960px;
  margin: 0 auto;
}

.date-section__heading {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  text-align: center;
  margin: 0 0 0.5rem;
  letter-spacing: 0.08em;
  color: var(--beige);
}

.date-section__sub {
  text-align: center;
  margin: 0 0 2.5rem;
  color: var(--fg-muted);
  font-size: 1rem;
}

.date-section__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  justify-items: center;
}

@media (min-width: 700px) {
  .date-section__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }
}

.date-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  transition: transform 0.35s var(--ease-out), filter 0.35s;
}

.date-card:hover {
  transform: scale(1.02);
}

.date-card__caption {
  font-size: 0.75rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
}

.date-card__circle {
  position: relative;
  width: min(72vw, 220px);
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: var(--shadow-card), 0 0 0 1px rgba(201, 169, 98, 0.12);
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.08), transparent 55%);
}

.date-card__value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 5vw, 2.5rem);
  font-weight: 600;
  color: var(--fg);
  z-index: 0;
  user-select: none;
  pointer-events: none;
}

.date-card__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  cursor: grab;
  touch-action: none;
  z-index: 1;
}

.date-card__canvas:active {
  cursor: grabbing;
}

.section--observe {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

.section--observe.in-view {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

@media (prefers-reduced-motion: reduce) {
  .section--observe {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* =============================================================================
   Location
   ============================================================================= */

.location-section {
  padding: 3rem 1.25rem 4rem;
  background: var(--bg);
}

.location-section__inner {
  max-width: 920px;
  margin: 0 auto;
}

.location-section__heading {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  text-align: center;
  margin: 0 0 2rem;
  letter-spacing: 0.06em;
  color: var(--beige);
}

.location-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(201, 169, 98, 0.15);
}

.location-card__text {
  padding: 2rem 1.75rem 1.5rem;
  text-align: center;
}

@media (min-width: 768px) {
  .location-card__text {
    padding: 2.25rem 2.5rem 1.75rem;
  }
}

.location-card__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
  color: var(--fg);
}

.location-card__address {
  margin: 0 0 1.5rem;
  color: var(--fg-muted);
  font-size: 1.05rem;
}

.location-card__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.75rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--bg);
  background: linear-gradient(135deg, var(--gold) 0%, #a88b4a 100%);
  border-radius: 999px;
  border: none;
  box-shadow: 0 8px 24px rgba(201, 169, 98, 0.25);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s;
}

.location-card__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(201, 169, 98, 0.35);
}

.location-card__btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.location-card__map {
  line-height: 0;
  min-height: 280px;
  background: #1a1816;
}

.location-card__map iframe {
  display: block;
  border: 0;
  min-height: 280px;
  filter: grayscale(0.15) contrast(1.02);
}

/* =============================================================================
   Message
   ============================================================================= */

.message-section {
  padding: 4.5rem 1.5rem 3rem;
  background: radial-gradient(ellipse 120% 80% at 50% 0%, rgba(201, 169, 98, 0.08), transparent 55%),
    var(--bg);
}

.message-section__inner {
  max-width: 640px;
  margin: 0 auto;
}

.message-section__quote {
  margin: 0;
  padding: 0;
  border: none;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.8vw, 1.45rem);
  font-weight: 400;
  font-style: italic;
  line-height: 1.75;
  color: var(--beige);
  text-align: center;
}

.message-section__quote p {
  margin: 0 0 1.25rem;
}

.message-section__signoff {
  font-style: normal;
  font-size: 0.95rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-top: 2rem !important;
}

.message-section__names {
  font-style: normal;
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 0 !important;
}

.message-section__actions {
  margin-top: 2rem;
  text-align: center;
}

/* Message uses the same .section--observe fade as date & location */

/* =============================================================================
   Footer
   ============================================================================= */

.site-footer {
  padding: 2rem 1rem 2.5rem;
  text-align: center;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-muted);
  border-top: 1px solid rgba(201, 169, 98, 0.12);
}

.site-footer p {
  margin: 0;
}
