/**
 * ==========================================================================
 * WEDLIY / WEDSARO — DESIGN 6 STYLESHEET
 * Theme: Aditya ♡ Meera — Kerala Love Storybook
 * Aesthetic: Artisanal Parchment, Botanical Sage, Sand & Terracotta
 * ==========================================================================
 */

:root {
  --radius: 4px;
  --background: #F8F6F0;
  --paper: #FDFCFA;
  --foreground: #383431;
  --card: #FDFCFA;
  --card-foreground: #383431;
  
  --primary: #2C5E43;
  --primary-foreground: #F8F6F0;
  --secondary: #8C9B7F;
  --secondary-foreground: #383431;
  
  --muted: #EFECE6;
  --muted-foreground: #78736E;
  --accent: #E5DAC6;
  --accent-foreground: #383431;
  
  --sage: #8C9B7F;
  --sand: #E5DAC6;
  --terracotta: #C46D50;
  
  --border: rgba(56, 52, 49, 0.15);
  --border-card: rgba(44, 94, 67, 0.2);
  --input: rgba(56, 52, 49, 0.25);
  --ring: #2C5E43;

  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-script: "Pinyon Script", cursive;
  --font-calligraphy: "Great Vibes", cursive;
}

html {
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
}

body {
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  background-image: radial-gradient(rgba(56, 52, 49, 0.05) 1px, transparent 1px);
  background-size: 3px 3px;
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  position: relative;
}

main {
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
  position: relative;
}

::selection {
  background-color: var(--sand);
  color: var(--foreground);
}

/* ── Typography Helpers ───────────────────────────────────────────────────── */
.font-serif {
  font-family: var(--font-serif);
}

.font-sans {
  font-family: var(--font-sans);
}

.font-script {
  font-family: var(--font-script);
}

.font-calligraphy {
  font-family: var(--font-calligraphy);
}

.font-quote {
  font-family: var(--font-serif);
  font-style: italic;
}

.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

@media (min-width: 640px) {
  .eyebrow {
    letter-spacing: 0.35em;
  }
}

/* ── Paper Note Elevation ─────────────────────────────────────────────────── */
.paper-note {
  background-color: var(--paper);
  box-shadow: 
    0 1px 2px rgba(56, 52, 49, 0.06), 
    0 14px 30px -18px rgba(56, 52, 49, 0.22);
}

/* ── Hero Artwork Blend & Feathering ─────────────────────────────────────── */
.parallax-hero {
  margin-top: 0.75rem;
  overflow: hidden;
  max-width: 100%;
}

@media (min-width: 640px) {
  .parallax-hero {
    margin-top: -18vh;
  }
}

@media (min-width: 1024px) {
  .parallax-hero {
    margin-top: -26vh;
  }
}

.hero-blend-container {
  position: relative;
  overflow: hidden;
  max-width: 100%;
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    black 4%,
    black 75%,
    rgba(0, 0, 0, 0.4) 86%,
    transparent 95%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    black 4%,
    black 75%,
    rgba(0, 0, 0, 0.4) 86%,
    transparent 95%,
    transparent 100%
  );
}

/* ── Keyframe Animations ──────────────────────────────────────────────────── */
@keyframes drift {
  0%, 100% {
    transform: translateX(0) scale(1.03);
  }
  50% {
    transform: translateX(-1%) scale(1.05);
  }
}

@keyframes ripple {
  0%, 100% {
    transform: translateX(0) scaleY(1);
    opacity: 0.4;
  }
  50% {
    transform: translateX(2%) scaleY(1.15);
    opacity: 0.7;
  }
}

@keyframes pop {
  0% {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

.animate-drift {
  animation: drift 24s ease-in-out infinite;
}

.animate-ripple {
  animation: ripple 7s ease-in-out infinite;
}

.animate-pop {
  animation: pop 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

/* ── Viewport Scroll Reveal (Subtle Upward Fade Entrance) ─────────────────── */
/* Exactly matching "Two hearts. One journey. Forever to go." animation */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1.3s cubic-bezier(0.2, 0.7, 0.2, 1), transform 1.3s cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: opacity, transform;
}

.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* ── Sound Bars Equalizer ─────────────────────────────────────────────────── */
.sound-bars {
  display: flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 14px;
}

.sound-bar {
  width: 2.5px;
  background-color: currentColor;
  border-radius: 2px;
  height: 4px;
  transition: height 0.2s ease;
}

.sound-bars.playing .sound-bar:nth-child(1) {
  animation: soundBarBounce 1s infinite ease-in-out;
}
.sound-bars.playing .sound-bar:nth-child(2) {
  animation: soundBarBounce 1.2s infinite ease-in-out 0.2s;
}
.sound-bars.playing .sound-bar:nth-child(3) {
  animation: soundBarBounce 0.8s infinite ease-in-out 0.4s;
}
.sound-bars.playing .sound-bar:nth-child(4) {
  animation: soundBarBounce 1.1s infinite ease-in-out 0.1s;
}

@keyframes soundBarBounce {
  0%, 100% { height: 4px; }
  50% { height: 14px; }
}

/* ── Moments Gallery Layout & Hover Zoom ──────────────────────────────────── */
.gallery-card {
  position: relative;
  overflow: hidden;
  background-color: var(--paper);
  padding: 0.5rem;
  border: 1px solid rgba(44, 94, 67, 0.2);
  box-shadow: 0 4px 16px -4px rgba(56, 52, 49, 0.08);
  border-radius: 2px;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (min-width: 640px) {
  .gallery-card {
    padding: 0.75rem;
  }
}

.gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px -8px rgba(56, 52, 49, 0.16);
}

.gallery-img-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--muted);
  border-radius: 1px;
}

.gallery-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* Subtly softened resting tone */
  filter: saturate(0.85) contrast(0.96) brightness(0.98);
  transition: filter 0.8s cubic-bezier(0.2, 0.7, 0.2, 1), transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.gallery-card:hover .gallery-img-wrap img {
  /* On hover: rich full color vibrance and slight zoom */
  filter: saturate(1.1) contrast(1.02) brightness(1);
  transform: scale(1.05);
}

/* ── Blended Letterpress RSVP Card ────────────────────────────────────────── */
.rsvp-stationery-card {
  position: relative;
  background: var(--paper);
  border: 1px solid rgba(44, 94, 67, 0.25);
  box-shadow: 
    0 2px 4px rgba(56, 52, 49, 0.04),
    0 16px 36px -12px rgba(56, 52, 49, 0.16);
  padding: 2.5rem 1.5rem;
}

@media (min-width: 640px) {
  .rsvp-stationery-card {
    padding: 3.5rem 2.75rem;
  }
}

.rsvp-inner-border {
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(44, 94, 67, 0.14);
  pointer-events: none;
}

/* ── Custom Scrollbar ─────────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 7px;
}

::-webkit-scrollbar-track {
  background: var(--background);
}

::-webkit-scrollbar-thumb {
  background: var(--sand);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* ── Parchment Notes Scrollbar ───────────────────────────────────────────── */
.parchment-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(44, 94, 67, 0.32) rgba(239, 236, 230, 0.4);
}

.parchment-scroll::-webkit-scrollbar {
  width: 5px;
}

.parchment-scroll::-webkit-scrollbar-track {
  background: rgba(239, 236, 230, 0.45);
  border-radius: 9999px;
}

.parchment-scroll::-webkit-scrollbar-thumb {
  background: rgba(44, 94, 67, 0.3);
  border-radius: 9999px;
  transition: background-color 0.2s ease;
}

.parchment-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(44, 94, 67, 0.65);
}

/* ── Accessibility: Reduced Motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .animate-drift,
  .animate-ripple,
  .animate-pop {
    animation: none !important;
  }
}
