/* ========================================
   MASGARES.COM/DEMO — RECONSTRUCTION CSS
   ======================================== */

/* ========================================
   LOADING SCREEN
   ======================================== */
body.is-loading {
  overflow: hidden !important;
}

#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fffaf1;
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
              visibility 0s linear 0.8s;
}

#loading-screen.dismissed {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  animation: loaderFadeIn 0.6s ease-out both;
}

.loader-logo {
  width: 64px;
  height: auto;
  margin-bottom: 24px;
  animation: loaderPulse 2s ease-in-out infinite;
}

.loader-names {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-size: clamp(28px, 6vw, 42px);
  font-weight: 400;
  color: #2f241b;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.loader-date {
  font-family: 'Instrument Sans', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.35em;
  color: #76614d;
  margin-bottom: 32px;
}

.loader-bar-track {
  width: 120px;
  height: 2px;
  background: rgba(138, 90, 43, 0.15);
  border-radius: 2px;
  overflow: hidden;
}

.loader-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #8a5a2b, #e7c88a);
  border-radius: 2px;
  transition: width 0.3s ease-out;
}

@keyframes loaderFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes loaderPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.7; transform: scale(0.96); }
}

/* ========================================
   HERO ENTRANCE ANIMATIONS
   ======================================== */
.hero-entrance {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-entrance.entered {
  opacity: 1;
  transform: none;
}

#hero-card {
  opacity: 0;
  transition: opacity 1s cubic-bezier(0.22, 1, 0.36, 1);
}

#hero-card.entered {
  opacity: 1;
}

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

html,
body {
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

/* Lenis smooth scroll integration */
html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

html {
  overflow-x: clip;
}

/* --- CSS Custom Properties (Theme) --- */
:root {
  --template-background: #fffaf1;
  --template-surface: #fffaf1;
  --template-surface-accent: #fffaf1;
  --template-card: #ffffff;
  --template-card-muted: #f7efe2;
  --template-text: #2f241b;
  --template-muted: #76614d;
  --template-accent: #8a5a2b;
  --template-accent-soft: #e7c88a;
  --template-border: rgba(47, 36, 27, 0.12);
  --template-hero-overlay: rgba(21, 16, 11, 0.18);
  --template-footer-overlay: rgba(17, 12, 9, 0.52);
  --template-button-text: #fff9f1;
  --template-page-background: #fffaf1;
}

/* --- Font Faces --- */
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('www.masgares.com/_next/static/media/9cc5b37ab1350db7-s.p.woff2.woff2') format('woff2');
}

@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('www.masgares.com/_next/static/media/e6099e249fd938cc-s.p.woff2.woff2') format('woff2');
}

@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('www.masgares.com/_next/static/media/26d0ba92e140f0dc-s.p.woff2.woff2') format('woff2');
}

@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('www.masgares.com/_next/static/media/26d0ba92e140f0dc-s.p.woff2.woff2') format('woff2');
}

@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('www.masgares.com/_next/static/media/26d0ba92e140f0dc-s.p.woff2.woff2') format('woff2');
}

@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('www.masgares.com/_next/static/media/26d0ba92e140f0dc-s.p.woff2.woff2') format('woff2');
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  height: 100%;
}

body {
  font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--template-text);
  background-color: var(--template-page-background);
  min-height: 100%;
  display: flex;
  flex-direction: column;
  transition: background-color 0.5s ease;
  line-height: 1.5;
}

.template-font-display {
  font-family: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  font-weight: 400;
}

.template-font-heading {
  font-family: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  font-weight: 400;
}

.template-font-body {
  font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

a {
  color: inherit;
  text-decoration: none;
}

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

.fade-in-up {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 1s ease-out, transform 1s ease-out;
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-only {
  opacity: 0;
  transition: opacity 1s ease-out;
}

.fade-in-only.visible {
  opacity: 1;
}

/* ========================================
   SECTION 1: NAVIGATION
   ======================================== */

/*
  Navigation scroll animation strategy:
  --nav-progress (0→1) is set by JS on every rAF frame.
  All visual properties interpolate from their "hero" state (progress=0)
  to their "pill" state (progress=1) using CSS calc().
  This gives perfectly smooth, bidirectional scroll response with no
  class-toggle jank.
*/
.crest-hint {
  font-family: 'Reenie Beanie', cursive;
  font-size: 20px;
  line-height: 1.2;
}
.crest-hint p {
  margin-bottom: 4px;
}
.nav {
  --nav-progress: 0;
  /* 0 = over hero, 1 = pill mode */
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 50;
  /* Vertical padding: 44px initial (clears hero card top-gap + border-radius zone),
     shrinks to 10px in pill mode for compact feel */
  padding-top: calc(44px - var(--nav-progress) * 34px);
  /* No horizontal padding on .nav; pill-mx handles alignment */
  padding-left: 0;
  padding-right: 0;
  /* Text color: white over hero → dark in pill */
  color: rgb(calc(255 - var(--nav-progress) * 162),
      calc(255 - var(--nav-progress) * 172),
      calc(255 - var(--nav-progress) * 179));
  pointer-events: auto;
}

.nav-pill {
  position: relative;
  margin: 0 auto;
  /* Width driven entirely by --nav-pill-mx: at progress=0 it spans the image edge-to-edge.
     At progress=1 pill-mx is ~24px each side, giving a narrower centered pill. */
  width: calc(100% - var(--nav-pill-mx, 26px) * 2);
  max-width: none;
  height: 60px;
  /* Border-radius: 0 flat over hero → pill */
  border-radius: calc(var(--nav-progress) * 9999px);
  overflow: visible;
  will-change: transform, width;
}

.nav-pill-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  border-radius: inherit;
  /* Background: transparent → frosted translucent white */
  background-color: rgba(255, 255, 255, calc(var(--nav-progress) * 0.5));
  /* Shadow: none → soft elevation */
  box-shadow: 0 calc(var(--nav-progress) * 12px) calc(var(--nav-progress) * 40px) rgba(0, 0, 0, calc(var(--nav-progress) * 0.12));
  /* Border: none → subtle */
  border: 1px solid rgba(0, 0, 0, calc(var(--nav-progress) * 0.09));
  /* Backdrop blur: none → blur(6px) for soft glassmorphism */
  backdrop-filter: blur(calc(var(--nav-progress) * 6px));
  -webkit-backdrop-filter: blur(calc(var(--nav-progress) * 6px));
  will-change: background-color, box-shadow, border;
}

.nav-inner {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: space-between;
  /* At hero state: 12px inner padding → content sits just inside the image edge.
     At pill state: 20px for comfortable internal pill spacing. */
  padding: 0 calc(12px + var(--nav-progress) * 8px);
}

@media (min-width: 768px) {
  .nav-inner {
    padding: 0 calc(14px + var(--nav-progress) * 10px);
  }
}

.nav-logo {
  display: flex;
  align-items: center;
  white-space: nowrap;
  transition: opacity 0.3s;
  color: inherit;
  text-decoration: none;
}

.nav-logo-img {
  height: 40px;
  /* Standard elegant logo height */
  width: auto;
  /* 
     Logo swapping logic:
     The user provided two specific versions. 
     We use content: url() to swap them based on the nav state.
  */
  content: url('assets/logo-light.png');
  /* Black version for light/pill background */
  transition: transform 0.3s;
}

/* On hero section (dark background), show the white version */
.nav.is-at-hero .nav-logo-img {
  content: url('assets/logo-dark.png');
}

@media (max-width: 767px) {
  .nav-logo-img {
    height: 32px;
  }
}

.nav-logo:hover {
  opacity: 0.7;
}

/* Desktop Navigation */
.nav-desktop {
  display: none;
  align-items: center;
  gap: 24px;
}

.nav-desktop a {
  font-size: 16px;
  font-weight: 300;
  transition: opacity 0.3s;
  color: inherit;
}

.nav-desktop a:hover {
  opacity: 0.7;
}

@media (min-width: 768px) {
  .nav-desktop {
    display: flex;
  }

  .hamburger {
    display: none !important;
  }
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-rsvp {
  display: inline-block;
  border-radius: 9999px;
  background-color: #722838;
  padding: 8px 20px;
  color: white !important;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.3s, opacity 0.3s, transform 0.3s;
}

.nav-rsvp:hover {
  background-color: #5a1f2c;
  opacity: 1;
}

.hamburger {
  display: block;
  padding: 8px;
  transition: transform 0.3s;
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
}

.hamburger:active {
  transform: scale(0.9);
}

.hamburger-lines {
  position: relative;
  display: flex;
  height: 10px;
  width: 24px;
  flex-direction: column;
  justify-content: space-between;
}

.hamburger-line {
  display: block;
  height: 2px;
  width: 100%;
  background: currentColor;
  transform-origin: center;
  transition: all 0.3s;
}

.hamburger.open .hamburger-line:first-child {
  transform: translateY(4px) rotate(45deg);
}

.hamburger.open .hamburger-line:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

/* Dropdown menu */
.nav-dropdown {
  position: absolute;
  right: var(--nav-pill-mx, 26px);
  top: 100%;
  margin-top: 8px;
  min-width: 160px;
  transform-origin: top right;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.6);
  padding: 16px;
  text-align: right;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  transform: scale(0.95);
  opacity: 0;
}

.nav-dropdown.open {
  pointer-events: auto;
  transform: scale(1);
  opacity: 1;
}

.nav-dropdown ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.nav-dropdown a {
  display: block;
  padding: 8px 8px;
  font-size: 16px;
  font-weight: 400;
  color: var(--template-muted);
  transition: color 0.25s ease;
}

.nav-dropdown a:hover {
  color: var(--template-text);
}

/* ========================================
   SECTION 2: HERO
   ======================================== */
.hero {
  position: relative;
  height: 100svh;
}

.hero-card-wrapper {
  perspective: 1000px;
}

.hero-card {
  transform-origin: center center;
  background: black;
}

.hero-image-wrap {
  position: relative;
  height: 100%;
  overflow: hidden;
}

.hero-image-inner {
  position: relative;
  height: 100%;
  overflow: hidden;
  background: transparent;
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  opacity: 0.2;
}

.hg-img {
  position: absolute;
  z-index: 15;
  border-radius: 20px;
  object-fit: cover;
  opacity: 1;
  pointer-events: none;
  transform: translateX(-110vw);
}

.hg-img-3, .hg-img-4 {
  transform: translateX(110vw);
}

/* Desktop styles */
.hg-img-1 { left: 11.2%; top: 10%; width: 22%; height: 30%; object-position: top; }
.hg-img-2 { left: 15.2%; top: 41.4%; width: 18%; height: 20%; }
.hg-img-3 { left: 66.8%; top: 32.6%; width: 18%; height: 20%; }
.hg-img-4 { left: 66.8%; top: 54%; width: 22%; height: 36%; }

/* Mobile styles */
@media (max-width: 767px) {
  .nav {
    padding-top: calc(28px - var(--nav-progress) * 18px) !important;
  }
  
  .hg-img {
    border-radius: 12px;
  }
  
  /* Top row */
  .hg-img-1 { left: 4vw; width: 38vw; height: 22svh; top: calc(36.5svh - 4vw - 22svh); }
  .hg-img-2 { left: 46vw; width: 50vw; height: 22svh; top: calc(36.5svh - 4vw - 22svh); }
  
  /* Bottom row */
  .hg-img-3 { left: 4vw; width: 54vw; height: 20svh; top: calc(71.5svh + 4vw); }
  .hg-img-4 { left: 62vw; width: 34vw; height: 20svh; top: calc(71.5svh + 4vw); }
}

.hero-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 32px;
}

.hero-headline-wrap {
  pointer-events: none;
  position: absolute;
  bottom: 128px;
  left: 0;
  right: 0;
  display: flex;
  width: 100%;
  justify-content: center;
  padding: 0 24px;
  transform: scale(1);
  transform-origin: bottom center;
}

@media (min-width: 768px) {
  .hero-headline-wrap {
    padding: 0 48px;
  }
}

.hero-headline-svg {
  height: auto;
  width: 100%;
  overflow: visible;
}

.hero-headline-text {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  fill: white;
  font-size: 140px;
}

.hero-bottom {
  pointer-events: none;
  position: relative;
  z-index: 10;
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 24px;
  padding: 0 24px 16px;
}

@media (min-width: 768px) {
  .hero-bottom {
    padding: 0 48px 16px;
  }
}

.hero-divider {
  height: 1px;
  width: 100%;
  background: rgba(255, 255, 255, 0.5);
}

.hero-scroll-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4em;
  color: rgba(255, 255, 255, 0.9);
}

@media (max-width: 767px) {
  .hero-scroll-row {
    justify-content: center;
    gap: 16px;
    font-size: 9px;
  }
}

.hero-arrow {
  animation: bounce 1s infinite;
  opacity: 0.8;
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-25%);
  }
}

/* ========================================
   SECTION 3 & 7: SCROLL WORD REVEAL
   ======================================== */
.scroll-text-section {
  position: relative;
  z-index: 30;
  display: flex;
  min-height: 60svh;
  width: 100%;
  align-items: center;
  justify-content: center;
  padding: 96px 16px;
  text-align: center;
  background-color: var(--template-background);
}

@media (min-width: 768px) {
  .scroll-text-section {
    padding: 128px 32px;
  }
}

.scroll-text {
  max-width: 90vw;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--template-text);
}

.scroll-text.size-sm {
  font-size: 3rem;
}

.scroll-text.size-base {
  font-size: 3.5rem;
}

@media (min-width: 768px) {
  .scroll-text.size-sm {
    font-size: 3.75rem;
  }

  .scroll-text.size-base {
    font-size: 6rem;
  }
}

.vision-word {
  opacity: 0.05;
}

/* ========================================
   SECTION 4: OUR STORY (Polaroid Stack)
   ======================================== */
.story-section {
  position: relative;
  width: 100%;
  z-index: 30;
  height: calc(1100vh + 0px);
  background-color: var(--template-background);
}

/* Mobile: reduce scroll length so the section doesn't feel endless */
@media (max-width: 767px) {
  .story-section {
    height: 800vh;
  }
}

.story-sticky {
  position: sticky;
  top: 0;
  height: 100svh;
  width: 100%;
}

@media (max-width: 767px) {
  .story-sticky {
    top: 70px;
    height: calc(100svh - 70px);
    /* Removed overflow: hidden to allow polaroids to cleanly bleed off the bottom of the screen */
  }
}

/* Story title */
.story-title-wrap {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 10vh;
  transform-origin: center center;
  padding-left: 16px;
  padding-right: 16px;
}

@media (max-width: 767px) {
  .story-title-wrap {
    padding-top: 3svh;
  }
}

.story-title {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  text-align: center;
  font-size: 18vw;
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--template-text);
}

@media (max-width: 767px) {
  .story-title {
    font-size: 15vw;
  }
}

@media (min-width: 768px) {
  .story-title {
    font-size: 14vw;
  }
}

/* Story captions (desktop) */
.story-caption-group {
  pointer-events: none;
  position: absolute;
  left: 0;
  right: 0;
  z-index: 25;
  top: 45%;
  display: none;
}

@media (min-width: 768px) {
  .story-caption-group {
    display: block;
  }
}

.story-caption-inner {
  margin: 0 auto;
  display: flex;
  width: 100%;
  max-width: 1400px;
  align-items: flex-start;
  justify-content: center;
  padding: 0 32px;
}

.story-caption-text {
  width: 40%;
  padding: 0 16px;
}

.story-caption-text h3 {
  margin-bottom: 8px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--template-text);
}

.story-caption-text p {
  font-size: 1rem;
  color: var(--template-muted);
}

.story-caption-spacer {
  margin: 0 16px;
  flex-shrink: 0;
  pointer-events: none !important;
}

/* Story captions (mobile) */
.story-caption-mobile {
  pointer-events: none;
  position: absolute;
  left: 0;
  right: 0;
  z-index: 25;
  padding: 0 20px;
  text-align: center;
  top: 14%;
  /* Let the container flow naturally; text will go over polaroids if needed due to z-index */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

@media (min-width: 768px) {
  .story-caption-mobile {
    display: none;
  }
}

.story-caption-mobile h3 {
  margin-bottom: 8px;
  font-size: clamp(1.25rem, 5vw, 1.5rem);
  line-height: 1.2;
  font-weight: 700;
  color: var(--template-text);
}

.story-caption-mobile p {
  margin: 0 auto;
  max-width: 42rem;
  font-size: clamp(0.9rem, 3.6vw, 1rem);
  line-height: 1.38;
  color: var(--template-muted);
  -webkit-font-smoothing: antialiased;
}

/* Story polaroid cards */
.story-card {
  pointer-events: auto;
  position: absolute;
  left: 0;
  right: 0;
  z-index: 20;
  margin: 0 auto;
  display: flex;
  width: 100%;
  max-width: 1400px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  top: 58%; /* Mobile: pushed down further to give text more space */
  backface-visibility: hidden;
}

@media (min-width: 768px) {
  .story-card {
    flex-direction: row;
    align-items: flex-start;
    padding: 0 32px;
    top: 45%;
  }
}

.story-card-side {
  display: none;
  width: 25%;
}

@media (min-width: 768px) {
  .story-card-side {
    display: block;
  }
}

.story-polaroid-wrap {
  position: relative;
  margin: 0 16px;
  flex-shrink: 0;
  transform: translateZ(0);
}

@media (max-width: 767px) {
  .story-polaroid-wrap {
    /* Bigger on mobile so photos look great */
    width: calc(100vw - 48px) !important;
    max-width: 380px !important;
    height: auto !important;
    aspect-ratio: 4/3;
  }

  .story-polaroid {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
  }
}

.story-polaroid-hover {
  height: 100%;
  width: 100%;
  transition: transform 0.3s ease-out;
}

@media (min-width: 768px) {
  .story-polaroid-hover:hover {
    transform: translateY(-16px) scale(1.03);
  }
}

.story-polaroid {
  position: relative;
  height: 100%;
  width: 100%;
  border-radius: 0.45rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #f8f3e8;
  padding: 4.5%;
  padding-bottom: 18%;
  transition: box-shadow 0.3s;
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.32);
}

.story-polaroid:hover {
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.4);
}

.story-polaroid-img-wrap {
  position: relative;
  height: 100%;
  width: 100%;
  overflow: hidden;
  border-radius: 0.2rem;
  background: rgba(0, 0, 0, 0.05);
}

.story-polaroid-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-polaroid-caption {
  position: absolute;
  bottom: 7%;
  left: 50%;
  transform: translateX(-50%);
  max-width: 92%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  font-size: clamp(0.75rem, 2.2vw, 1rem);
  color: rgba(0, 0, 0, 0.7);
  -webkit-font-smoothing: antialiased;
}

/* ========================================
   LIGHTBOX OVERLAY
   ======================================== */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.lightbox-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-polaroid-wrap {
  width: 90vw;
  max-width: 650px;
  max-height: 80vh;
  aspect-ratio: 4/3;
  position: relative;
  transform: scale(0.95);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox-overlay.active .lightbox-polaroid-wrap {
  transform: scale(1);
}

.lightbox-polaroid {
  /* Override any hover transform from .story-polaroid if needed */
  transform: none !important;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4) !important;
  cursor: default;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10000;
  transition: background 0.3s, transform 0.3s;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: scale(1.05);
}

/* ========================================
   SECTION 5: LOGISTICS
   ======================================== */
.logistics-section {
  position: relative;
  z-index: 20;
  width: 100%;
  background-color: var(--template-page-background);
}

.logistics-scroll-area {
  position: relative;
  height: 200vh;
  width: 100%;
}

.logistics-sticky {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  text-align: center;
}

.logistics-kicker {
  margin-bottom: 64px;
  font-size: 3rem;
  line-height: 0.92;
  color: var(--template-text);
  font-style: normal;
}

@media (min-width: 768px) {
  .logistics-kicker {
    font-size: 3.75rem;
  }
}

.logistics-date-wrap {
  width: 100%;
  padding: 0;
}

.logistics-date-text {
  margin: 0;
  width: 100%;
  text-align: center;
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  color: var(--template-text);
  font-size: clamp(3.2rem, 10.5vw, 9.5rem);
  line-height: 1;
  letter-spacing: -0.025em;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: block;
}

#save-date-btn {
  display: block;
  width: 100%;
  max-width: 1120px;
  padding: 60px 0 40px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.logistics-date-text.clicked {
  animation: dateClickPulse 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dateClickPulse {
  0% {
    transform: scale(1);
    filter: blur(0px);
  }
  15% {
    transform: scale(0.96);
    filter: blur(5px);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    filter: blur(0px);
    opacity: 1;
  }
}

/* Calendar Hint — pop entrance on scroll */
.calendar-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-350px, -195px) rotate(-6deg) scale(0);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0px;
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.calendar-hint.visible {
  opacity: 1;
  transform: translate(-350px, -195px) rotate(-6deg) scale(1);
  animation: floatCalendarHint 4s ease-in-out 0.5s infinite;
}

.calendar-hint p {
  margin: 0;
  font-family: 'Shadows Into Light', cursive;
  font-size: 1.4rem;
  line-height: 1.1;
  color: #bbb1a2;
  text-align: center;
}

.calendar-hint svg {
  margin-top: -2px;
  transform: rotate(0deg);
}

@keyframes floatCalendarHint {
  0%, 100% { transform: translate(-350px, -195px) rotate(-6deg) scale(1); }
  50% { transform: translate(-345px, -200px) rotate(-4deg) scale(1); }
}

@media (max-width: 767px) {
  .calendar-hint {
    left: 50%;
    top: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-65px, -145px) rotate(-5deg) scale(0);
  }

  .calendar-hint.visible {
    opacity: 1;
    transform: translate(-65px, -145px) rotate(-5deg) scale(1);
    animation: floatCalendarHintMobile 4s ease-in-out 0.5s infinite;
  }

  .calendar-hint p {
    font-size: 1.15rem;
    text-align: center;
  }

  @keyframes floatCalendarHintMobile {
    0%, 100% { transform: translate(-65px, -145px) rotate(-5deg) scale(1); }
    50% { transform: translate(-60px, -150px) rotate(-3deg) scale(1); }
  }
}

/* Countdown */
.countdown {
  display: flex;
  margin: 72px auto 0;
  max-width: 48rem;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
}

@media (min-width: 768px) {
  .countdown {
    gap: 16px;
  }
}

.countdown-unit {
  display: flex;
  width: 64px;
  flex-direction: column;
  align-items: center;
}

@media (min-width: 640px) {
  .countdown-unit {
    width: 80px;
  }
}

@media (min-width: 768px) {
  .countdown-unit {
    width: 96px;
  }
}

.countdown-number {
  margin-bottom: 4px;
  font-size: 1.875rem;
  font-weight: 300;
}

@media (min-width: 640px) {
  .countdown-number {
    font-size: 2.25rem;
  }
}

@media (min-width: 768px) {
  .countdown-number {
    margin-bottom: 8px;
    font-size: 3.75rem;
  }
}

.countdown-label {
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  opacity: 0.8;
  color: var(--template-text);
}

@media (min-width: 640px) {
  .countdown-label {
    font-size: 0.65rem;
    letter-spacing: 0.2em;
  }
}

@media (min-width: 768px) {
  .countdown-label {
    font-size: 0.875rem;
  }
}

.countdown-colon {
  margin-top: 4px;
  font-size: 1.5rem;
  font-weight: 300;
  opacity: 0.3;
  color: var(--template-text);
}

@media (min-width: 640px) {
  .countdown-colon {
    font-size: 1.875rem;
  }
}

@media (min-width: 768px) {
  .countdown-colon {
    margin-top: 8px;
    font-size: 3rem;
  }
}

/* Venue area */
.logistics-venue-area {
  position: relative;
  z-index: 30;
  width: 100%;
  padding-bottom: 64px;
  background-color: var(--template-page-background);
}

@media (min-width: 768px) {
  .logistics-venue-area {
    padding-bottom: 128px;
  }
}

.logistics-venue-inner {
  margin: 0 auto;
  max-width: 72rem;
  padding: 0 16px;
  text-align: center;
}

.venue-image-wrap {
  position: relative;
  margin: 0 auto 8px;
  width: 100%;
  max-width: 480px;
  overflow: visible; /* Changed to visible for 3D shadows */
  perspective: 1200px;
}

@media (min-width: 768px) {
  .venue-image-wrap {
    margin-bottom: 12px;
    max-width: 750px;
  }
}

.venue-image {
  display: block;
  height: auto;
  width: 100%;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); /* Much smoother and floatier */
  transform-style: preserve-3d;
}

.venue-name {
  margin-bottom: 8px;
  font-size: 3rem;
  line-height: 0.92;
  color: var(--template-text);
  font-style: normal;
}

@media (min-width: 768px) {
  .venue-name {
    font-size: 3.75rem;
  }
}

.venue-address {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--template-text);
  opacity: 0.8;
  transition: opacity 0.3s;
}

.venue-address:hover {
  opacity: 1;
}

@media (min-width: 768px) {
  .venue-address {
    font-size: 14px;
  }
}

/* Maps Hint — simple pop + float */
.maps-hint {
  position: absolute;
  left: 50%;
  top: calc(100% + 20px);
  bottom: auto;
  right: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  transform: translate(-50%, 10px) rotate(0deg) scale(0);
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.maps-hint.visible {
  opacity: 1;
  transform: translate(-50%, 0) rotate(0deg) scale(1);
  animation: floatMapsHint 4s ease-in-out 0.5s infinite;
}

.maps-hint p {
  margin: 0;
  font-family: 'Shadows Into Light', cursive;
  font-size: 1.4rem;
  line-height: 1.1;
  color: #bbb1a2;
  text-align: center;
}

.maps-hint svg {
  margin-bottom: 2px;
  transform: rotate(0deg);
}

@keyframes floatMapsHint {
  0%, 100% { transform: translate(-50%, 0) rotate(0deg) scale(1); }
  50% { transform: translate(-50%, -6px) rotate(1deg) scale(1); }
}

@media (max-width: 767px) {
  .maps-hint {
    right: 8px;
    left: auto;
    top: auto;
    bottom: -4px;
    transform: translate(0, 100%) rotate(-4deg) scale(0);
    align-items: flex-end;
    text-align: right;
  }

  .maps-hint.visible {
    opacity: 1;
    transform: translate(0, 100%) rotate(-4deg) scale(1);
    animation: floatMapsHintMobile 4s ease-in-out 0.5s infinite;
  }

  @keyframes floatMapsHintMobile {
    0%, 100% { transform: translate(0, 100%) rotate(-4deg) scale(1); }
    50% { transform: translate(-3px, 105%) rotate(-1deg) scale(1); }
  }

  .maps-hint p {
    font-size: 1.15rem;
    text-align: right;
  }
}

.rsvp-area {
  margin-top: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

@media (min-width: 768px) {
  .rsvp-area {
    margin-top: 180px;
  }
}

.rsvp-button {
  display: inline-flex;
  margin-bottom: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  padding: 16px 48px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  background-color: #722838;
  /* Burgundy */
  color: #ffffff;
  transition: transform 0.3s, background-color 0.3s;
}

.rsvp-button:hover {
  transform: scale(1.05);
  background-color: #5d202d;
  /* Slightly darker burgundy */
}

@media (min-width: 768px) {
  .rsvp-button {
    font-size: 14px;
  }
}

.rsvp-note {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--template-text);
  opacity: 0.8;
}

@media (min-width: 768px) {
  .rsvp-note {
    font-size: 14px;
  }
}

/* ========================================
   SECTION 6: DETAILS CARDS
   ======================================== */
.details-section {
  position: relative;
  z-index: 20;
  width: 100%;
  background-color: var(--template-background);
}

.details-inner {
  width: 100%;
  padding: 96px 32px 80px;
}

@media (min-width: 768px) {
  .details-inner {
    padding: 112px 40px 96px;
  }
}

@media (min-width: 1280px) {
  .details-inner {
    padding: 112px 64px 96px;
  }
}

.details-header {
  margin-bottom: 24px;
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
}

.details-title {
  font-size: 3rem;
  line-height: 0.92;
  color: var(--template-text);
  font-style: normal;
}

@media (min-width: 768px) {
  .details-title {
    font-size: 3.75rem;
  }
}

.details-subtitle {
  margin-top: 16px;
  max-width: 48rem;
  text-align: center;
  font-size: 1rem;
  color: var(--template-muted);
}

@media (min-width: 768px) {
  .details-subtitle {
    font-size: 1.125rem;
  }
}

.details-grid {
  margin: 48px auto 0;
  display: grid;
  max-width: 1600px;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 768px) {
  .details-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }
}

@media (min-width: 1280px) {
  .details-grid {
    grid-template-columns: repeat(6, 1fr);
  }
  
  /* Row 1: 2 cards (longer but same height as bottom) */
  .detail-card:nth-child(1),
  .detail-card:nth-child(2) {
    grid-column: span 3;
    aspect-ratio: 2 / 1; /* Adjusting ratio to match height of 3-column cards */
  }
  
  /* Row 2: 3 cards */
  .detail-card:nth-child(3),
  .detail-card:nth-child(4),
  .detail-card:nth-child(5) {
    grid-column: span 2;
    aspect-ratio: 4 / 3; /* Standard ratio */
  }
}

.details-grid {
  perspective: 1500px;
}

.detail-card {
  position: relative;
  aspect-ratio: 4 / 3;
  width: 100%;
  cursor: pointer;
  text-align: left;
  transform-style: preserve-3d;
  transition: transform 0.3s ease-out;
  border-radius: 2rem;
}

.detail-card-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 2rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background: rgba(0, 0, 0, 0.05);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.detail-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s;
}

.detail-card:hover .detail-card-img {
  transform: scale(1.05);
}

.detail-card-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.2), transparent);
}

.detail-card-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  padding-right: 80px;
  color: white;
}

@media (min-width: 768px) {
  .detail-card-content {
    padding: 32px;
    padding-right: 96px;
  }
}

.detail-card-title {
  margin-bottom: 8px;
  font-size: 1.875rem;
  font-weight: 700;
}

@media (min-width: 768px) {
  .detail-card-title {
    font-size: 2.25rem;
  }
}

.detail-card-subtitle {
  font-size: 1.125rem;
  opacity: 0.9;
}

@media (min-width: 768px) {
  .detail-card-subtitle {
    font-size: 1.25rem;
  }
}

.detail-card-icon {
  position: absolute;
  bottom: 24px;
  right: 24px;
  display: flex;
  height: 48px;
  width: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.3);
  transition: transform 0.3s;
}

@media (min-width: 768px) {
  .detail-card-icon {
    bottom: 32px;
    right: 32px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
  }
}

.detail-card:hover .detail-card-icon {
  transform: scale(1.1);
}

@media (min-width: 768px) {
  .detail-card:hover .detail-card-icon {
    background: rgba(255, 255, 255, 0.3);
  }
}

/* ========================================
   SECTION 7: GIFT SECTION (CREST + IBAN)
   ======================================== */
.crest-separator {
  padding: 120px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--template-page-background);
  overflow: hidden;
}

.gift-container {
  position: relative;
  width: 100%;
  max-width: 1000px;
  height: 350px;
  display: flex;
  justify-content: center;
  align-items: center;
}

@media (max-width: 767px) {
  .gift-container {
    height: 450px;
  }
}

/* Handwritten Hint — simple pop + float */
.crest-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(120px, -140px) rotate(8deg) scale(0);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.crest-hint.gravity-entered {
  opacity: 1;
  transform: translate(120px, -140px) rotate(8deg) scale(1);
  animation: floatHint 4s ease-in-out 0.5s infinite;
}

.crest-hint p {
  margin: 0;
  font-family: 'Shadows Into Light', cursive;
  font-size: 1.6rem;
  line-height: 1.1;
  color: #bbb1a2;
  text-align: center;
}

.crest-hint svg {
  margin-top: -2px;
  transform: rotate(0deg);
}

@keyframes floatHint {
  0%, 100% { transform: translate(120px, -140px) rotate(8deg) scale(1); }
  50% { transform: translate(125px, -145px) rotate(10deg) scale(1); }
}

.gift-container.is-revealed .crest-hint {
  opacity: 0 !important;
  animation: none !important;
  transform: translate(120px, -180px) rotate(8deg) scale(1);
}

@media (max-width: 767px) {
  .crest-hint {
    transform: translate(50px, -180px) rotate(5deg) scale(0);
  }

  .crest-hint.gravity-entered {
    opacity: 1;
    transform: translate(50px, -180px) rotate(5deg) scale(1);
    animation: floatHintMobile 4s ease-in-out 0.5s infinite;
  }

  @keyframes floatHintMobile {
    0%, 100% { transform: translate(50px, -180px) rotate(5deg) scale(1); }
    50% { transform: translate(55px, -185px) rotate(8deg) scale(1); }
  }

  .gift-container.is-revealed .crest-hint {
    transform: translate(50px, -200px) rotate(5deg) scale(1);
  }
}

/* Movers (handle sliding and blurring) */
.crest-mover {
  position: absolute;
  z-index: 2;
  transition: all 1.2s cubic-bezier(0.23, 1, 0.32, 1);
  cursor: pointer;
  transform-origin: center;
  transform: scale(1);
  opacity: 1;
}

.iban-card-float {
  display: none; /* Hide physically */
  position: absolute;
  z-index: 1;
  opacity: 1;
  transform: translateY(0) scale(0.6);
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.8s ease, visibility 0.8s;
  /* transform will be handled by JS entirely */
}

.iban-card-float.is-revealed {
  display: block; /* Show physically */
  position: fixed; /* Switch to fixed to travel everywhere */
  z-index: 9999;
  pointer-events: auto;
  visibility: visible;
  /* We remove transitions for transform here to allow ultra-smooth JS control */
  transition: opacity 0.8s ease, visibility 0s;
}

/* Cleanup old sticky classes as we now handle it via pure math in JS */
.iban-card-float.is-compact,
.iban-card-float.is-compact-top,
.iban-card-float.is-compact-bottom {
  display: none !important; /* Replaced by fluid logic */
}

/* Revealed State */
.gift-container.is-revealed .crest-mover {
  transform: scale(1.4) rotate(-6deg);
  opacity: 0.5;
  pointer-events: none;
}

.iban-card-float.is-revealed .iban-card {
  opacity: 1;
  pointer-events: auto;
}

/* Wrap (handles JS 3D Tilt) */
.crest-wrap {
  width: 220px;
  height: auto;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

@media (min-width: 768px) {
  .crest-wrap {
    width: 340px;
  }
}

.crest-img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 15px 35px rgba(0,0,0,0.08));
  pointer-events: auto;
}

.iban-card {
  width: 300px;
  padding: 32px 24px;
  position: relative;
  background: rgba(255, 252, 245, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  text-align: center;
  box-shadow: 0 30px 60px rgba(0,0,0,0.1), inset 0 0 0 1px rgba(255, 255, 255, 0.4);
  /* Tilt will be handled by JS */
  transition: transform 0.2s ease-out;
  z-index: 3;
}

.iban-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(17, 12, 9, 0.4);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, visibility 0.6s ease;
  pointer-events: none;
}
.iban-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.iban-close-btn {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.iban-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}
.iban-close-btn.visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.iban-blur-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(30px) saturate(160%);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
  border-radius: inherit;
  pointer-events: none;
  opacity: 1; /* Always 1 to prevent snapping */
  transform: translateZ(0);
}

@media (min-width: 768px) {
  .iban-card {
    width: 440px;
    padding: 48px 40px;
  }
}

.iban-phrase {
  font-size: 1.25rem;
  color: var(--template-text);
  margin-bottom: 24px;
  line-height: 1.3;
  transform: translateZ(20px);
}

@media (min-width: 768px) {
  .iban-phrase {
    font-size: 1.5rem;
  }
}

.iban-number-wrap {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--template-text);
  color: var(--template-background);
  padding: 16px 20px;
  border-radius: 16px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  transform: translateZ(30px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.iban-number-wrap:hover {
  transform: translateZ(30px) translateY(-2px) scale(1.02);
  box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.iban-text {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.95rem;
  letter-spacing: 1px;
  font-weight: bold;
}

@media (min-width: 768px) {
  .iban-text {
    font-size: 1.15rem;
  }
}

.copy-btn {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 0.3s ease, transform 0.2s;
}

.copy-btn:hover {
  opacity: 1;
  transform: scale(1.1);
}

.copy-feedback {
  position: absolute;
  top: 50%;
  left: calc(100% + 24px);
  width: 240px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.25));
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  padding: 16px 20px;
  border-radius: 24px 24px 24px 4px; /* Apple/WhatsApp Chat Bubble */
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 20px 40px rgba(0,0,0,0.08), inset 0 0 0 1px rgba(255, 255, 255, 0.3);
  font-size: 0.95rem;
  line-height: 1.35;
  color: #2f241b;
  opacity: 0;
  transform: translate(20px, -50%) scale(0.6) rotate(5deg);
  transform-origin: left bottom;
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  z-index: 100;
  text-align: left;
  font-style: normal;
}

.copy-feedback.show {
  opacity: 1;
  transform: translate(0, -50%) scale(1) rotate(0deg);
}

@media (min-width: 992px) {
  .iban-card.feedback-left .copy-feedback {
    left: auto;
    right: calc(100% + 24px);
    border-radius: 24px 24px 4px 24px; /* Mirrored bubble tail */
    transform: translate(-20px, -50%) scale(0.6) rotate(-5deg);
    transform-origin: right bottom;
  }
  .iban-card.feedback-left .copy-feedback.show {
    transform: translate(0, -50%) scale(1) rotate(0deg);
  }
}

@media (max-width: 991px) {
  .copy-feedback {
    position: absolute;
    left: 50%;
    transform: translate(-50%, 10px) scale(0.8);
    transform-origin: center top;
    width: calc(100% - 16px);
    max-width: 280px;
    border-radius: 20px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0;
  }
  .iban-card.feedback-above .copy-feedback {
    top: auto;
    bottom: calc(100% + 12px);
    transform: translate(-50%, -10px) scale(0.8);
    transform-origin: center bottom;
  }
  .iban-card.feedback-above .copy-feedback.show {
    transform: translate(-50%, 0) scale(1);
    opacity: 1;
  }
  .iban-card.feedback-below .copy-feedback {
    bottom: auto;
    top: calc(100% + 12px);
    transform: translate(-50%, 10px) scale(0.8);
    transform-origin: center top;
  }
  .iban-card.feedback-below .copy-feedback.show {
    transform: translate(-50%, 0) scale(1);
    opacity: 1;
  }
}

/* ========================================
   SECTION 9: FAQ
   ======================================== */
.faq-section {
  position: relative;
  z-index: 20;
  width: 100%;
  padding: 96px 0;
  background-color: var(--template-surface);
}

@media (min-width: 768px) {
  .faq-section {
    padding: 128px 0;
  }
}

.faq-inner {
  margin: 0 auto;
  max-width: 72rem;
  padding: 0 24px;
}

.faq-layout {
  display: flex;
  flex-direction: column;
  gap: 64px;
}

@media (min-width: 1024px) {
  .faq-layout {
    flex-direction: row;
    gap: 96px;
  }
}

.faq-sidebar {
  display: flex;
  flex-direction: column;
}

@media (min-width: 1024px) {
  .faq-sidebar {
    width: 33.333%;
  }
}



@media (min-width: 1024px) {
  .faq-sidebar-sticky {
    position: sticky;
    top: 128px;
  }
}

.faq-title {
  margin-bottom: 24px;
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-style: normal;
  color: var(--template-text);
}

@media (min-width: 768px) {
  .faq-title {
    font-size: 3.75rem;
  }
}

@media (min-width: 1024px) {
  .faq-title {
    font-size: 4.5rem;
  }
}

.faq-intro {
  margin-bottom: 4px;
  font-size: 1.125rem;
  color: var(--template-muted);
}

@media (min-width: 768px) {
  .faq-intro {
    font-size: 1.25rem;
  }
}

.faq-contact {
  font-size: 1.125rem;
  color: var(--template-text);
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: opacity 0.3s;
}

.faq-contact:hover {
  opacity: 0.8;
}

@media (min-width: 768px) {
  .faq-contact {
    font-size: 1.25rem;
  }
}

.faq-list {
  border-top: 1px solid color-mix(in srgb, var(--template-text) 20%, transparent);
}

@media (min-width: 1024px) {
  .faq-list {
    width: 66.666%;
  }
}

.faq-item {
  border-bottom: 1px solid color-mix(in srgb, var(--template-text) 20%, transparent);
}

.faq-question {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0;
  text-align: left;
  cursor: pointer;
  background: none;
  border: none;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.faq-question:focus,
.faq-question:active,
.faq-question::-moz-focus-inner {
  outline: none;
  border: none;
  background: transparent;
}

.faq-question-text {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--template-text);
  transition: opacity 0.3s;
  flex-grow: 1;
  pointer-events: none;
}

.faq-question:hover .faq-question-text {
  opacity: 0.8;
}

@media (min-width: 768px) {
  .faq-question-text {
    font-size: 1.25rem;
  }
}

.faq-chevron-wrap {
  display: flex;
  height: 32px;
  width: 32px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--template-text);
  background-color: color-mix(in srgb, var(--template-text) 8%, transparent);
  transition: background-color 0.3s ease;
  pointer-events: none;
}

.faq-question:hover .faq-chevron-wrap {
  background-color: color-mix(in srgb, var(--template-text) 14%, transparent);
}

.faq-chevron {
  transition: transform 0.3s;
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
}

.faq-answer {
  overflow: hidden;
  transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
  max-height: 0;
  opacity: 0;
}

.faq-item.open .faq-answer {
  opacity: 1;
}

.faq-answer-inner {
  padding-bottom: 24px;
  padding-right: 16px;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--template-muted);
  white-space: pre-line;
}

@media (min-width: 768px) {
  .faq-answer-inner {
    padding-right: 48px;
    font-size: 1.125rem;
  }
}

/* ========================================
   SECTION 9: FOOTER
   ======================================== */
.footer-section {
  position: relative;
  height: 100svh;
  width: 100%;
  padding: 12px;
  background-color: var(--template-surface);
}

@media (min-width: 768px) {
  .footer-section {
    padding: 16px 16px 24px;
  }
}

@media (min-width: 1024px) {
  .footer-section {
    padding: 20px 20px 20px;
  }
}

.footer-image-wrap {
  position: relative;
  display: flex;
  height: 100%;
  width: 100%;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 24px;
  /* Safari overflow: hidden + border-radius fix */
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  mask-image: radial-gradient(white, black);
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  isolation: isolate;
  z-index: 0;
  background-clip: padding-box;
}

.footer-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
  filter: blur(20px); /* JS will override this immediately on first scroll tick */
  border-radius: 24px;
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  will-change: filter;
}

.footer-overlay {
  position: absolute;
  inset: 0;
  background-color: var(--template-footer-overlay);
  /* Force rounded corners directly on the overlay to prevent flickering/square edges in Safari */
  border-radius: 24px;
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.footer-content {
  position: relative;
  z-index: 10;
  margin: 0 auto;
  display: flex;
  width: 100%;
  max-width: 64rem;
  transform: translate3d(0, 14vh, 0); /* JS will override this immediately */
  filter: blur(12px);                   /* JS will override this immediately */
  opacity: 0.1;                         /* JS will override this immediately */
  will-change: filter, transform, opacity;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  text-align: center;
  color: white;
}

.footer-quote {
  max-height: 58vh;
  max-width: 100%;
  overflow: hidden;
  font-size: 3rem;
  line-height: 0.92;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  font-style: normal;
}

@media (min-width: 768px) {
  .footer-quote {
    font-size: 5rem;
  }
}

.footer-attribution {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0.8;
}

.attribution-text {
  font-family: 'Instrument Serif', serif;
  font-size: 0.9rem;
  font-style: italic;
  letter-spacing: 0.05em;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.attribution-line {
  width: 40px;
  height: 1px;
  background-color: rgba(255, 255, 255, 0.5);
}

/* ========================================
   CLICK HEARTS CANVAS
   ======================================== */
.click-hearts-canvas {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  height: 100vh;
  width: 100vw;
  pointer-events: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  touch-action: none !important;
  /* Safari composting hit-testing fix */
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

/* ========================================
   CONFETTI CANVAS
   ======================================== */
.confetti-canvas {
  pointer-events: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  touch-action: none !important;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1; /* Keep it inside sticky, behind interactive text */
  height: 100%;
  width: 100%;
  /* Safari composting hit-testing fix */
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

/* ========================================
   MAIN
   ======================================== */
main {
  padding-bottom: 24px;
}

@media (min-width: 768px) {
  main {
    padding-bottom: 40px;
  }
}

/* ========================================
   DETAIL CARD POPUP (LIQUID GLASS)
   ======================================== */
.detail-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(17, 12, 9, 0.45); /* Matching polaroid overlay tone */
  backdrop-filter: blur(15px); /* Matching polaroid blur */
  -webkit-backdrop-filter: blur(15px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  padding: 24px;
  perspective: 1200px;
}

.detail-popup-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.detail-popup-panel {
  position: relative;
  width: 100%;
  max-width: 640px;
  /* Matching IBAN card frosted glass style */
  background: rgba(255, 255, 255, 0.12); 
  backdrop-filter: blur(35px) saturate(180%);
  -webkit-backdrop-filter: blur(35px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 40px;
  padding: 64px 48px;
  box-shadow: 
    0 40px 100px rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.3);
  color: white;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.5s ease;
  transform-style: preserve-3d;
  pointer-events: auto;
}

.detail-popup-overlay.active .detail-popup-panel {
  opacity: 1;
}

/* Internal reflection/sheen */
.detail-popup-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 60%);
  border-radius: 40px;
  pointer-events: none;
  z-index: -1;
}

.detail-popup-content h3 {
  font-size: 48px;
  margin-bottom: 24px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.detail-popup-content p {
  font-size: 20px;
  line-height: 1.6;
  opacity: 0.9;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

@keyframes popup-float {
  0%, 100% { transform: scale(1) rotateX(0deg) translateY(0); }
  50% { transform: scale(1) rotateX(0deg) translateY(-10px); }
}

.detail-popup-overlay.active .detail-popup-panel {
  transform: scale(1) rotateX(0deg);
  opacity: 1;
}

.detail-popup-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  transition: all 0.3s ease;
}

.detail-popup-close:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: rotate(90deg);
}

.detail-popup-title {
  font-family: 'Instrument Serif', serif;
  font-size: 2.5rem;
  margin-bottom: 16px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.detail-popup-content {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  line-height: 1.6;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Card flip animation class */
.detail-card.flipping {
  transform: rotateY(180deg) scale(0.9) !important;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.6s ease;
}

/* Mobile adjustments for Detail Card Popup (Liquid Glass) */
@media (max-width: 767px) {
  .detail-popup-overlay {
    background: rgba(17, 12, 9, 0.25); /* Lighter backdrop to appreciate background content */
    backdrop-filter: blur(4px);        /* Softened background blur */
    -webkit-backdrop-filter: blur(4px);
    padding: 16px;
  }

  .detail-popup-panel {
    background: rgba(255, 255, 255, 0.16); /* Milky-white glass base */
    backdrop-filter: blur(50px) saturate(140%); /* Ultra-pronounced blur for maximum separation */
    -webkit-backdrop-filter: blur(50px) saturate(140%);
    border: 0.5px solid rgba(255, 255, 255, 0.35); /* Elegantly defined fine border */
    border-radius: 24px;              /* Sleek, premium rounded corners */
    padding: 44px 20px 32px;          /* Proportional padding on mobile */
    box-shadow: 
      0 20px 55px rgba(0, 0, 0, 0.2),
      inset 0 0 0 1px rgba(255, 255, 255, 0.25); /* Polished bevelled glass highlight */
  }

  .detail-popup-panel::before {
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), transparent 60%); /* Specular highlight */
  }

  .detail-popup-title {
    font-size: 1.8rem;
    margin-bottom: 12px;
    text-shadow: none !important; /* Flat minimalist typography */
  }

  .detail-popup-content {
    font-size: 0.95rem;
    text-shadow: none !important;
  }

  .detail-popup-content h3 {
    font-size: 20px !important;
    margin-bottom: 12px !important;
    text-shadow: none !important;
  }

  .detail-popup-content p {
    font-size: 14px !important;
    line-height: 1.5 !important;
    text-shadow: none !important;
    opacity: 0.95;
  }

  .detail-popup-close {
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border: 0.5px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
  }

  .footer-image {
    object-position: 45% center; /* Shift slightly right to show a bit more of Álvaro while keeping María visible */
  }

  /* Compact and minimal mobile dropdown menu styling */
  .nav-dropdown {
    min-width: 140px;
    padding: 8px 12px;
    border-radius: 12px;
    margin-top: 6px;
    border: 0.5px solid rgba(47, 36, 27, 0.08);
    background: rgba(255, 255, 255, 0.65);
    box-shadow: 0 8px 24px rgba(47, 36, 27, 0.05);
  }

  .nav-dropdown ul {
    gap: 6px;
  }

  .nav-dropdown a {
    font-size: 12.5px;
    font-weight: 400;
    padding: 4px 6px;
    letter-spacing: 0.04em;
    color: var(--template-muted);
  }
}