/* =============================================================================
   WEDDING INVITATION — Liquid Glass / Glassmorphism
   -----------------------------------------------------------------------------
   ORGANIZATION
   1. Theme variables (CENTRALIZED PALETTE — change colors here)
   2. Reset & base
   3. Background with depth
   4. Reusable "glass" material (.glass)
   5. Typography / titles / buttons
   6. Per-section components
   7. Micro-interactions (reveal on scroll)
   8. Side navigation + theme toggle
   9. Responsive (mobile-first is the base; here are >= tablet enhancements)
   ============================================================================= */

/* =============================================================================
   1. THEME VARIABLES  ·  the WHOLE palette lives here
   ============================================================================= */
:root {
  /* Typography */
  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-sans:  "Jost", system-ui, -apple-system, sans-serif;

  /* Shared measurements / shapes */
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --maxw: 720px;
  --blur: 18px;               /* glass blur intensity */
  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* ---- THEME A · LIGHT (pink marble + powdered rose / rose-gold) ------------- */
body.theme-light {
  --bg-base:        #f3dde3;                        /* background fallback */

  /* PINK MARBLE tones (combined in .bg-image as gradients) */
  --marble-base:    #f1d8df;
  --marble-1:       #fdeff2;                        /* light veins/areas */
  --marble-2:       #e7c2cf;                        /* deeper pink */
  --marble-3:       #f8e6ec;
  --marble-vein:    rgba(150, 92, 112, 0.10);       /* fine marble veins */
  --bg-overlay:     rgba(250, 237, 241, 0.12);      /* VERY subtle veil (marble shows through) */

  --text:           #4a3940;                        /* main text (soft plum) */
  --text-soft:      #836e76;                        /* secondary text */
  --accent:         #b06a79;                        /* powdered rose / rose-gold */
  --accent-soft:    rgba(176, 106, 121, 0.16);

  /* Glass material (translucent white, stands out over the marble) */
  --glass-bg:       rgba(255, 255, 255, 0.34);
  --glass-bg-strong:rgba(255, 255, 255, 0.52);
  --glass-border:   rgba(255, 255, 255, 0.78);
  --glass-highlight:rgba(255, 255, 255, 0.95);
  --glass-shadow:   0 12px 44px rgba(120, 70, 90, 0.18);

  --on-accent:      #fff6f8;                          /* text over the button */
}

/* ---- THEME B · DARK (same pink marble, plum dusk) ------------------------- */
body.theme-dark {
  --bg-base:        #1a1117;

  --marble-base:    #f1d8df;
  --marble-1:       #fdeff2;
  --marble-2:       #e7c2cf;
  --marble-3:       #f8e6ec;
  --marble-vein:    rgba(150, 92, 112, 0.10);
  --bg-overlay:     rgba(24, 14, 20, 0.66);          /* dark plum veil over the marble */

  --text:           #f3e8ec;
  --text-soft:      #c3b0b8;
  --accent:         #e0b48c;                          /* warm champagne */
  --accent-soft:    rgba(224, 180, 140, 0.18);

  --glass-bg:       rgba(255, 255, 255, 0.08);
  --glass-bg-strong:rgba(255, 255, 255, 0.13);
  --glass-border:   rgba(255, 255, 255, 0.20);
  --glass-highlight:rgba(255, 255, 255, 0.38);
  --glass-shadow:   0 14px 50px rgba(0, 0, 0, 0.45);

  --on-accent:      #2a1a12;
}

/* =============================================================================
   2. RESET & BASE
   ============================================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg-base);
  line-height: 1.65;
  font-weight: 300;
  overflow-x: hidden;
  transition: color .5s var(--ease), background .5s var(--ease);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

/* =============================================================================
   3. BACKGROUND — PINK MARBLE
   The marble is generated with CSS gradients (looks crisp, little blur) so the
   Liquid Glass style stands out over it. To use a marble PHOTO instead, place
   assets/img/fondo.jpg: it shows on top of the CSS marble automatically.
   Fixed so the glass "floats" while scrolling.
   ============================================================================= */
.bg-layer { position: fixed; inset: 0; z-index: -2; overflow: hidden; }

.bg-image {
  position: absolute; inset: -4%;
  background-color: var(--marble-base);
  background-image:
    /* Optional layer: your marble photo (ignored if it doesn't exist) */
    url("../assets/img/fondo.jpg"),
    /* Fine diagonal marble veins */
    repeating-linear-gradient(118deg, var(--marble-vein) 0 1px, transparent 1px 46px),
    repeating-linear-gradient(64deg,  var(--marble-vein) 0 1px, transparent 1px 70px),
    /* Soft blooms of light and pink for the marble veining */
    radial-gradient(60% 50% at 18% 22%, var(--marble-1) 0%, transparent 60%),
    radial-gradient(55% 45% at 82% 18%, var(--marble-3) 0%, transparent 55%),
    radial-gradient(70% 60% at 72% 82%, var(--marble-2) 0%, transparent 60%),
    radial-gradient(50% 50% at 30% 78%, var(--marble-1) 0%, transparent 55%),
    linear-gradient(125deg, var(--marble-3), var(--marble-base) 55%, var(--marble-2));
  background-size: cover, auto, auto, cover, cover, cover, cover, cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: saturate(1.03);
  transform: none;
}

/* Color veil over the marble (subtle in light, darkens in dark theme) */
.bg-gradient {
  position: absolute; inset: 0;
  background: var(--bg-overlay);
  transition: background .5s var(--ease);
}

/* =============================================================================
   4. REUSABLE "GLASS" MATERIAL
   ============================================================================= */
.glass {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.4);
  backdrop-filter: blur(var(--blur)) saturate(1.4);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease),
              background .5s var(--ease), border-color .5s var(--ease);
}

/* Subtle highlight on the top edge (light glint) */
.glass::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, var(--glass-highlight), transparent 40%, transparent 70%, var(--glass-highlight));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: .6;
  pointer-events: none;
}

/* =============================================================================
   5. TYPOGRAPHY, TITLES, BUTTONS
   ============================================================================= */
.container { width: min(100% - 2.5rem, var(--maxw)); margin-inline: auto; }

.section { padding: clamp(3.5rem, 9vw, 6.5rem) 0; }

.section__index,
.hero__index {
  font-family: var(--font-sans);
  font-size: .72rem;
  letter-spacing: .35em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
  font-weight: 400;
}

.section__title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2rem, 7vw, 2.9rem);
  line-height: 1.1;
  letter-spacing: .01em;
  margin-bottom: .35rem;
}

.section__subtitle {
  color: var(--text-soft);
  font-size: 1rem;
  margin-bottom: 1.75rem;
  max-width: 46ch;
}

/* Lead heading (e.g. "When & Where") centered above a group of cards */
.section__index--lead,
.section__title--lead { text-align: center; }
.section__title--lead { margin-bottom: 2rem; }

/* Standard glass card for content */
.card { padding: clamp(1.6rem, 5vw, 2.75rem); }
.card--center { text-align: center; }
.card--center .section__subtitle { margin-inline: auto; }

/* Buttons */
.btn {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: .85rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  padding: .95em 2.2em;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease),
              background .3s var(--ease), color .3s var(--ease);
}

.btn--primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: transparent;
  box-shadow: 0 8px 24px var(--accent-soft);
}
.btn--primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px var(--accent-soft);
}
.btn--full { width: 100%; margin-top: .5rem; }

/* Delicate glass lift on hover (only on hover-capable devices) */
@media (hover: hover) {
  .card.glass:hover { transform: translateY(-4px); box-shadow: 0 20px 60px rgba(0,0,0,.22); }
}

/* "Placeholder" tag over photo blocks */
.placeholder-tag {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 1rem;
  font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-soft);
  background: repeating-linear-gradient(45deg, var(--accent-soft) 0 12px, transparent 12px 24px);
}

/* =============================================================================
   6. PER-SECTION COMPONENTS
   ============================================================================= */

/* ---- HERO ---------------------------------------------------------------- */
.section--hero {
  min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  padding: 2rem 0;
  text-align: center;
}
.hero__photo {
  position: absolute; inset: 0; z-index: -1;
  background-image: url("../assets/img/portada.jpg");
  background-size: cover; background-position: center;
}
.hero__photo .placeholder-tag {
  background: rgba(0,0,0,.25); color: #fff;
  align-items: flex-start; padding-top: 2rem;
}

.hero__panel {
  width: min(100% - 2.5rem, 540px);
  padding: clamp(2.2rem, 8vw, 3.5rem) clamp(1.5rem, 6vw, 3rem);
  text-align: center;
}
.hero__phrase {
  font-family: var(--font-sans);
  text-transform: uppercase; letter-spacing: .32em;
  font-size: .82rem; color: var(--accent); margin-bottom: 1.2rem;
}
.hero__names {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2.8rem, 13vw, 4.5rem);
  line-height: 1.02;
  display: flex; flex-direction: column; gap: .1em;
  margin-bottom: 1.2rem;
}
.hero__amp { font-style: italic; color: var(--accent); font-size: .7em; }
.hero__date {
  font-family: var(--font-sans); letter-spacing: .2em; text-transform: uppercase;
  font-size: .9rem; color: var(--text-soft); margin-bottom: 2rem;
}

/* Scroll indicator */
.hero__scroll {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  width: 26px; height: 42px; border: 1.5px solid var(--glass-border);
  border-radius: 999px; display: flex; justify-content: center; padding-top: 8px;
}
.hero__scroll span {
  width: 4px; height: 8px; border-radius: 4px; background: var(--accent);
  animation: scrollDot 1.8s infinite var(--ease);
}
@keyframes scrollDot { 0%{opacity:0;transform:translateY(-4px)} 40%{opacity:1} 80%,100%{opacity:0;transform:translateY(10px)} }

/* ---- COUNTDOWN ----------------------------------------------------------- */
.countdown {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: .6rem; margin-top: 2rem;
}
.countdown__unit {
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1rem .4rem; text-align: center;
}
.countdown__num {
  display: block;
  font-family: var(--font-serif); font-weight: 600;
  font-size: clamp(1.8rem, 9vw, 3rem); line-height: 1; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.countdown__label {
  display: block; margin-top: .4rem;
  font-size: .65rem; letter-spacing: .18em; text-transform: uppercase; color: var(--text-soft);
}

/* ---- OUR STORY ----------------------------------------------------------- */
.story__grid { display: grid; gap: 1.25rem; }
.story__photo {
  position: relative; min-height: clamp(340px, 80vw, 460px);
  background-image: url("../assets/img/historia.jpg");
  background-size: cover; background-position: center;
  overflow: hidden;
}
/* Subtle floral icon while there is no photo (assets/img/historia.jpg).
   main.js adds .has-photo when the image exists, and the icon disappears. */
.story__photo::after {
  content: "❀"; position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 2rem; color: var(--accent); opacity: .4;
}
.story__photo.has-photo::after { content: none; }
#story-paragraphs p { margin-bottom: 1rem; color: var(--text-soft); }
#story-paragraphs p:last-child { margin-bottom: 0; }

/* ---- WHEN & WHERE (two venue cards, each with its own map) --------------- */
.venues { display: grid; gap: 1.5rem; }
.venue { text-align: center; display: flex; flex-direction: column; }
.venue__title { font-family: var(--font-serif); font-size: 1.7rem; font-weight: 500; }
.venue__time { color: var(--accent); letter-spacing: .12em; font-size: .9rem; margin: .25rem 0 .7rem; }
.venue__place { font-weight: 400; font-size: 1.1rem; }
.venue__address { color: var(--text-soft); font-size: .9rem; }
.venue__note { color: var(--text-soft); font-size: .85rem; font-style: italic; margin-top: .5rem; }

.map {
  border-radius: var(--radius-md); overflow: hidden;
  border: 1px solid var(--glass-border);
  aspect-ratio: 16 / 11;
  margin: 1.25rem 0;
}
.map iframe { width: 100%; height: 100%; border: 0; display: block; filter: grayscale(.15); }

.venue__directions {
  align-self: center; margin-top: auto;
  background: var(--glass-bg-strong); color: var(--text);
}
.venue__directions:hover { background: var(--accent-soft); transform: translateY(-2px); }

/* ---- SCHEDULE (timeline) ------------------------------------------------- */
.timeline { list-style: none; margin-top: 1.5rem; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 26px; top: 6px; bottom: 6px;
  width: 1px; background: var(--glass-border);
}
.timeline__item {
  position: relative; padding-left: 4.2rem; padding-bottom: 1.8rem;
}
.timeline__item:last-child { padding-bottom: 0; }
.timeline__dot {
  position: absolute; left: 12px; top: 2px;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-size: .9rem;
  background: var(--glass-bg-strong); border: 1px solid var(--glass-border);
}
.timeline__time { color: var(--accent); font-size: .82rem; letter-spacing: .12em; }
.timeline__title { font-family: var(--font-serif); font-size: 1.35rem; font-weight: 500; line-height: 1.2; }
.timeline__detail { color: var(--text-soft); font-size: .92rem; }

/* ---- DRESS CODE ---------------------------------------------------------- */
.dresscode__label {
  font-family: var(--font-serif); font-size: clamp(1.6rem, 7vw, 2.2rem);
  color: var(--accent); margin: .4rem 0 .8rem;
}
/* Two "avoid these colors" panels (ellas / ellos) inside the same card */
.dresscode__avoid {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 1.2rem; margin-top: 1.5rem;
}
.dresscode__panel {
  flex: 1 1 240px; max-width: 320px;
  padding: 1.4rem 1.1rem;
  background: var(--glass-bg-strong); border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
}
.dresscode__group {
  font-family: var(--font-serif); font-size: 1.45rem; color: var(--accent);
  margin-bottom: .35rem;
}
.dresscode__note { color: var(--text-soft); font-size: .9rem; margin-bottom: 1.1rem; }
.dresscode__swatches {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 1.4rem;
}
.dresscode__swatch { display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.dresscode__dot {
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow), inset 0 0 0 3px rgba(255,255,255,.12);
}
.dresscode__color-name {
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-soft);
}

/* ---- HONOR PARTY (Damas & Caballeros de Honor) --------------------------- */
.honor__grid {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 1.4rem; margin-top: 2rem;
}
.honor__group {
  flex: 1 1 240px; max-width: 320px;
  padding: 1.6rem 1.2rem;
  background: var(--glass-bg-strong); border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
}
.honor__role {
  font-family: var(--font-serif); font-size: 1.5rem; color: var(--accent);
  margin-bottom: 1rem;
}
.honor__names { list-style: none; display: grid; gap: .55rem; }
.honor__names li { font-size: 1.08rem; line-height: 1.3; }

/* ---- GODPARENTS ---------------------------------------------------------- */
/* Flex + center so any number of cards (incl. an odd 5) stays evenly centered,
   with the last partial row centered instead of left-aligned with a gap. */
.godparents__grid {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 1.6rem 1rem; margin-top: 2rem;
}
.godparent { text-align: center; flex: 0 0 calc(50% - 0.5rem); } /* 2 per row on mobile */
/* Circular couple photo (elegant placeholder if there is no photo) */
.godparent__photo {
  width: clamp(96px, 28vw, 130px); aspect-ratio: 1; margin: 0 auto .9rem;
  border-radius: 50%;
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow), inset 0 0 0 4px rgba(255,255,255,.12);
  background-size: cover; background-position: center;
  display: grid; place-items: center;
  transition: transform .4s var(--ease);
}
.godparent__photo::after {          /* subtle icon only when there is NO photo */
  content: "❀"; font-size: 1.6rem; color: var(--accent); opacity: .5;
}
.godparent__photo.has-photo::after { content: none; }
@media (hover: hover) { .godparent:hover .godparent__photo { transform: translateY(-4px) scale(1.03); } }
.godparent__role {
  font-size: .72rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .25rem;
}
.godparent__names { font-family: var(--font-serif); font-size: 1.15rem; line-height: 1.25; }

/* ---- GIFTS --------------------------------------------------------------- */
.gifts__list { display: grid; gap: .9rem; margin-top: 1.5rem; }
.gift {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: .5rem;
  padding: 1rem 1.2rem;
  background: var(--glass-bg-strong); border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  transition: transform .3s var(--ease);
}
@media (hover: hover) { .gift:hover { transform: translateY(-2px); } }
.gift__icon { font-size: 1.5rem; }
.gift__label { font-weight: 400; }
.gift__value { color: var(--text-soft); font-size: .85rem; }
/* Only long URLs need to break anywhere — plain notes must NOT split words. */
.gift__value a { color: var(--accent); word-break: break-all; }

/* "Lluvia de sobres" legend (type "note"): larger serif label, no button. */
.gift--note .gift__label { font-family: var(--font-serif); font-size: 1.15rem; }
.gift__copy {
  margin-left: auto; flex-shrink: 0;
  font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  padding: .5em 1em; border-radius: 999px;
  border: 1px solid var(--glass-border); background: transparent; color: var(--text);
  cursor: pointer; transition: background .25s var(--ease);
}
.gift__copy:hover { background: var(--accent-soft); }

/* ---- RSVP ---------------------------------------------------------------- */
.rsvp__deadline { font-size: .9rem; color: var(--text-soft); margin-bottom: 1.75rem; }
.rsvp__deadline strong { color: var(--accent); font-weight: 400; }

.rsvp-form { display: grid; gap: 1.25rem; text-align: left; }
.field { display: grid; gap: .5rem; }
.field label, .field__label {
  font-size: .82rem; letter-spacing: .06em; color: var(--text-soft);
}
.field .opt { color: var(--text-soft); opacity: .7; text-transform: none; letter-spacing: 0; }

.field input,
.field select {
  width: 100%; font-family: var(--font-sans); font-size: 1rem; color: var(--text);
  padding: .85em 1em; border-radius: var(--radius-sm);
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.field input::placeholder { color: var(--text-soft); opacity: .6; }
.field input:focus,
.field select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field select { appearance: none; cursor: pointer; }

.radio-row { display: flex; gap: .75rem; flex-wrap: wrap; }
.radio-pill { flex: 1 1 140px; cursor: pointer; }
.radio-pill input { position: absolute; opacity: 0; pointer-events: none; }
.radio-pill span {
  display: block; text-align: center; padding: .85em 1em;
  border-radius: var(--radius-sm);
  background: var(--glass-bg-strong); border: 1px solid var(--glass-border);
  font-size: .92rem; transition: all .25s var(--ease);
}
.radio-pill input:checked + span {
  background: var(--accent); color: var(--on-accent); border-color: transparent;
}
.radio-pill input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }

/* Fields that only apply if attending: dim out when "No" is chosen */
[data-only-yes].is-hidden {
  opacity: .4; filter: grayscale(.5);
  pointer-events: none;
  max-height: 0; overflow: hidden; margin: 0;
  transition: opacity .35s var(--ease), max-height .35s var(--ease);
}

/* Success message */
.rsvp-success { text-align: center; padding: 1rem 0; animation: fadeUp .6s var(--ease); }
.rsvp-success__mark {
  width: 64px; height: 64px; margin: 0 auto 1rem;
  border-radius: 50%; display: grid; place-items: center;
  font-size: 1.8rem; color: var(--on-accent); background: var(--accent);
  box-shadow: 0 10px 30px var(--accent-soft);
}
.rsvp-success h3 { font-family: var(--font-serif); font-size: 2rem; font-weight: 500; margin-bottom: .4rem; }
.rsvp-success p { color: var(--text-soft); }

/* ---- GALLERY (horizontal film-strip carousel) ---------------------------- */
.section__subtitle--lead { text-align: center; margin-inline: auto; margin-bottom: 2rem; }

/* Full-bleed viewport: native horizontal scroll, snap, hidden scrollbar */
.gallery__carousel {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: auto;            /* instant wraps for the seamless loop */
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;            /* Firefox */
  -ms-overflow-style: none;          /* old Edge */
  /* Soft fade on both edges so tiles melt into the background */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}
.gallery__carousel::-webkit-scrollbar { display: none; } /* Chrome/Safari */

.gallery__track {
  display: flex;
  gap: 1rem;
  width: max-content;
  padding: .5rem clamp(1rem, 5vw, 3rem);
}

.gallery__tile {
  flex: 0 0 auto;
  width: clamp(190px, 62vw, 300px);
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-md);
  background: var(--glass-bg-strong); border: 1px solid var(--glass-border);
  background-size: cover; background-position: center;
  overflow: hidden; padding: 0;
  display: grid; place-items: center;
  box-shadow: var(--glass-shadow);
  cursor: pointer; transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
@media (hover: hover) {
  .gallery__tile.has-photo:hover { transform: translateY(-4px) scale(1.02); box-shadow: 0 18px 50px rgba(0,0,0,.28); }
}
.gallery__tile--placeholder { cursor: default; }
.gallery__tile--placeholder span { font-size: 2rem; color: var(--accent); opacity: .4; }

/* "Sube tus fotos" call-to-action under the carousel */
.gallery__upload { text-align: center; margin-top: 2rem; }
.gallery__upload-note {
  margin-top: .8rem; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-soft);
}
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: .55; cursor: not-allowed; box-shadow: none;
}
.btn:disabled:hover,
.btn[aria-disabled="true"]:hover { transform: none; box-shadow: none; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center; padding: 1.5rem;
  background: rgba(20, 12, 18, 0.78);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .3s var(--ease);
}
.lightbox.is-open { opacity: 1; }
.lightbox[hidden] { display: none; }   /* keep the attribute working despite display:grid */
.lightbox__img {
  max-width: 92vw; max-height: 82vh; border-radius: var(--radius-md);
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.lightbox__close {
  position: absolute; top: 1.1rem; right: 1.1rem;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--glass-border); background: var(--glass-bg-strong);
  color: var(--text); font-size: 1.1rem; cursor: pointer;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}

/* ---- FOOTER -------------------------------------------------------------- */
.section--footer { padding-bottom: 3rem; }
.footer__names {
  font-family: var(--font-serif); font-weight: 500;
  font-size: clamp(2rem, 9vw, 3rem); line-height: 1.1; margin-bottom: .3rem;
}
.footer__date { letter-spacing: .25em; color: var(--text-soft); font-size: .85rem; margin-bottom: 1.5rem; }
.footer__contacts { display: grid; gap: .6rem; margin-bottom: 1.5rem; }
.footer__contact-label { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-soft); }
.footer__contact-value { font-size: 1.05rem; }
.footer__hashtag { font-family: var(--font-serif); font-style: italic; color: var(--accent); font-size: 1.3rem; margin-bottom: .5rem; }
.footer__message { letter-spacing: .15em; text-transform: uppercase; font-size: .8rem; color: var(--text-soft); }
.footer__credit { text-align: center; margin-top: 1.5rem; font-size: .72rem; letter-spacing: .1em; color: var(--text-soft); opacity: .7; }

/* =============================================================================
   7. MICRO-INTERACTIONS — reveal on scroll (IntersectionObserver)
   Soft animation that replays each time the section enters the viewport.
   ============================================================================= */
.reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

/* =============================================================================
   8. NAVIGATION: MENU BUTTON (top-left) + SIDE NAV + THEME TOGGLE
   ============================================================================= */

/* ---- Menu button (hamburger → X) ----------------------------------------- */
.menu-toggle {
  position: fixed; top: 1.1rem; left: 1.1rem; z-index: 60;
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--glass-border); color: var(--text);
  transition: transform .3s var(--ease), background .5s var(--ease), border-color .5s var(--ease);
}
.menu-toggle:hover { transform: scale(1.06); }
.menu-toggle__bars { position: relative; width: 20px; height: 14px; }
.menu-toggle__bars i {
  position: absolute; left: 0; width: 100%; height: 1.5px; border-radius: 2px;
  background: var(--text);
  transition: transform .35s var(--ease), opacity .25s var(--ease), top .35s var(--ease);
}
.menu-toggle__bars i:nth-child(1) { top: 0; }
.menu-toggle__bars i:nth-child(2) { top: 6px; }
.menu-toggle__bars i:nth-child(3) { top: 12px; }
/* Open state: the bars form an X */
.menu-toggle.is-open .menu-toggle__bars i:nth-child(1) { top: 6px; transform: rotate(45deg); }
.menu-toggle.is-open .menu-toggle__bars i:nth-child(2) { opacity: 0; }
.menu-toggle.is-open .menu-toggle__bars i:nth-child(3) { top: 6px; transform: rotate(-45deg); }

/* ---- Veil behind the panel ----------------------------------------------- */
.menu-overlay {
  position: fixed; inset: 0; z-index: 55;
  background: rgba(20, 12, 18, 0.35);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  opacity: 0; transition: opacity .4s var(--ease);
}
.menu-overlay.is-open { opacity: 1; }

/* ---- Menu panel (opens from the top-left corner) ------------------------- */
.menu-panel {
  position: fixed; top: 1.1rem; left: 1.1rem; z-index: 58;
  width: min(82vw, 320px);
  padding: 4.2rem 1.4rem 1.6rem;
  border-radius: var(--radius-lg);
  transform-origin: top left;
  transform: scale(.7) translateY(-8px);
  opacity: 0; visibility: hidden;
  transition: transform .42s var(--ease), opacity .32s var(--ease), visibility 0s linear .42s;
}
.menu-panel.is-open {
  transform: none; opacity: 1; visibility: visible;
  transition: transform .42s var(--ease), opacity .3s var(--ease), visibility 0s;
}
.menu-panel__title {
  font-size: .68rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 1rem;
}
.menu-panel ul { list-style: none; display: grid; gap: .15rem; }
.menu-panel a {
  display: flex; align-items: baseline; gap: .8rem;
  padding: .7em .6em; border-radius: var(--radius-sm);
  font-family: var(--font-serif); font-size: 1.25rem; line-height: 1.1;
  color: var(--text);
  opacity: 0; transform: translateX(-10px);
  transition: background .25s var(--ease), color .25s var(--ease),
              opacity .4s var(--ease), transform .4s var(--ease);
}
.menu-panel.is-open a { opacity: 1; transform: none; transition-delay: calc(.06s * var(--i, 0) + .1s); }
.menu-panel a:hover { background: var(--accent-soft); color: var(--accent); }
.menu-panel a .menu-num {
  font-family: var(--font-sans); font-size: .7rem; letter-spacing: .1em;
  color: var(--accent); min-width: 1.6em;
}
.menu-panel a.is-active { color: var(--accent); }

/* ---- Theme toggle -------------------------------------------------------- */
.theme-toggle {
  position: fixed; top: 1.1rem; right: 1.1rem; z-index: 50;
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  font-size: 1.2rem; color: var(--text);
  border: 1px solid var(--glass-border);
}
.theme-toggle:hover { transform: scale(1.06); }

/* ---- Background music button (bottom-left) -------------------------------- */
.music-toggle {
  position: fixed; bottom: 1.1rem; left: 1.1rem; z-index: 50;
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  color: var(--text); border: 1px solid var(--glass-border);
  transition: transform .3s var(--ease), background .5s var(--ease), border-color .5s var(--ease);
}
.music-toggle:hover { transform: scale(1.06); }
.music-toggle__eq { display: flex; align-items: flex-end; gap: 2px; height: 16px; }
.music-toggle__eq i { width: 3px; height: 5px; border-radius: 2px; background: var(--accent); transition: height .2s var(--ease); }
/* Animated equalizer while playing; flat bars when paused */
.music-toggle.is-playing .music-toggle__eq i { animation: eq .9s ease-in-out infinite; }
.music-toggle.is-playing .music-toggle__eq i:nth-child(2) { animation-delay: .2s; }
.music-toggle.is-playing .music-toggle__eq i:nth-child(3) { animation-delay: .4s; }
@keyframes eq { 0%, 100% { height: 5px; } 50% { height: 15px; } }

/* ---- Welcome screen: liquid-glass envelope ------------------------------- */
.entry {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2rem; padding: 1.5rem;
  perspective: 1200px;                  /* 3D space for the flap */
  background:
    radial-gradient(60% 50% at 18% 22%, var(--marble-1) 0%, transparent 60%),
    radial-gradient(70% 60% at 82% 85%, var(--marble-2) 0%, transparent 60%),
    linear-gradient(125deg, var(--marble-3), var(--marble-base) 55%, var(--marble-2));
  opacity: 1; transition: opacity .9s var(--ease);
}
/* Final state: fade the whole screen out while the envelope zooms in */
.entry.is-zooming { opacity: 0; pointer-events: none; }

.envelope {
  position: relative;
  width: clamp(280px, 82vw, 400px);
  aspect-ratio: 7 / 5;
  transform-style: preserve-3d;
  transition: transform .9s var(--ease);
  animation: fadeUp .7s var(--ease);
  cursor: pointer;
}
.entry.is-zooming .envelope { transform: scale(8); }   /* zoom "into" the envelope */

/* Body / pocket (glass) */
.envelope__body {
  position: absolute; inset: 0; border-radius: 14px; overflow: hidden;
  background: var(--glass-bg-strong); border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.4); backdrop-filter: blur(var(--blur)) saturate(1.4);
}
/* Front pocket triangle (rises from the bottom corners to the centre) */
.envelope__body::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(var(--glass-highlight), transparent);
  opacity: .22;
  clip-path: polygon(0 100%, 50% 44%, 100% 100%);
  border-top: 1px solid var(--glass-border);
}

/* Closed flap (triangle pointing down); flips up to open */
.envelope__flap {
  position: absolute; top: 0; left: 0; right: 0; height: 60%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px 14px 0 0;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center; transform: rotateX(0deg);
  transition: transform .7s var(--ease), opacity .4s var(--ease);
  -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur));
  z-index: 3;
}
.envelope.is-open .envelope__flap { transform: rotateX(180deg); z-index: 0; }

/* Wax-seal disc at the flap tip */
.envelope__seal {
  position: absolute; top: calc(60% - 27px); left: 50%; transform: translateX(-50%);
  width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.4rem;
  color: var(--on-accent); background: var(--accent);
  box-shadow: 0 8px 22px var(--accent-soft), inset 0 0 0 2px rgba(255,255,255,.3);
  z-index: 4; transition: opacity .3s var(--ease);
}
.envelope.is-open .envelope__seal { opacity: 0; }

/* Open button */
.entry__open { animation: fadeUp .7s var(--ease); }
.entry.is-opening .entry__open { opacity: 0; pointer-events: none; transition: opacity .3s var(--ease); }

.side-nav {
  position: fixed; top: 50%; right: 1.1rem; transform: translateY(-50%);
  z-index: 40; display: none;          /* hidden on mobile; visible >= tablet */
}
.side-nav ul { list-style: none; display: grid; gap: .85rem; }
.side-nav a {
  display: block; width: 10px; height: 10px; border-radius: 50%;
  background: var(--glass-border); position: relative;
  transition: background .3s var(--ease), transform .3s var(--ease);
}
.side-nav a:hover { transform: scale(1.4); }
.side-nav a.is-active { background: var(--accent); transform: scale(1.4); }
.side-nav a::after {
  content: attr(data-label);
  position: absolute; right: 22px; top: 50%; transform: translateY(-50%);
  white-space: nowrap; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text); background: var(--glass-bg-strong);
  padding: .3em .7em; border-radius: 999px; border: 1px solid var(--glass-border);
  opacity: 0; pointer-events: none; transition: opacity .25s var(--ease);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.side-nav a:hover::after { opacity: 1; }

/* =============================================================================
   9. RESPONSIVE — tablet/desktop enhancements (mobile-first is the base)
   ============================================================================= */
@media (min-width: 768px) {
  .side-nav { display: block; }

  .story__grid { grid-template-columns: 1fr 1fr; align-items: stretch; }
  .story__photo { min-height: 100%; }

  .venues { grid-template-columns: 1fr 1fr; align-items: stretch; gap: 1.75rem; }

  .godparents__grid { gap: 2.2rem 1.6rem; }
  .godparent { flex: 0 0 clamp(140px, 16%, 180px); } /* fits the 5 cards centered in one row */
}

@media (min-width: 1024px) {
  :root { --maxw: 760px; }
}

/* =============================================================================
   10. PHASE 2 — GROUP RSVP, QR TICKETS, VALIDATOR
   ============================================================================= */

/* ---- Personalized greeting + per-person name inputs ---------------------- */
.rsvp-greeting { margin: 0 0 1.5rem; }
.rsvp-greeting__hi { font-family: var(--font-serif); font-size: 1.7rem; font-weight: 500; }
.rsvp-greeting__quota { color: var(--text-soft); }
.rsvp-greeting__quota strong { color: var(--accent); font-weight: 500; }
.rsvp-greeting__loading { color: var(--text-soft); }
.rsvp-greeting__error { color: #b3261e; }

.group-names { display: grid; gap: .6rem; }
.group-names__input {
  width: 100%; font-family: var(--font-sans); font-size: 1rem; color: var(--text);
  padding: .75em 1em; border-radius: var(--radius-sm);
  background: var(--glass-bg-strong); border: 1px solid var(--glass-border);
}
.group-names__input::placeholder { color: var(--text-soft); opacity: .6; }
.group-names__input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---- QR tickets ---------------------------------------------------------- */
.tickets__list { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem; margin-top: 1.5rem; }
.tickets__actions { text-align: center; margin-top: 1.5rem; }
.ticket-cell { display: flex; flex-direction: column; align-items: center; gap: .7rem; }

/* The ticket has its OWN opaque gradient (no backdrop-filter) so it exports
   cleanly to PNG/PDF and looks good as a standalone image. */
.ticket {
  width: 280px; padding: 1.6rem 1.4rem; border-radius: var(--radius-lg);
  text-align: center; color: #4a3940;
  background:
    radial-gradient(120% 80% at 50% 0%, #fdeff2 0%, #f6dde6 45%, #ecc7d6 100%);
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: 0 14px 40px rgba(120, 70, 90, 0.22);
}
.ticket__couple { font-family: var(--font-serif); font-size: 1.4rem; font-weight: 600; line-height: 1.1; }
.ticket__date { font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: #b06a79; margin-top: .2rem; }
.ticket__qr {
  width: 168px; height: 168px; margin: 1rem auto; padding: 9px;
  background: #fff; border-radius: 12px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.05);
  display: grid; place-items: center;
}
.ticket__qr canvas, .ticket__qr img {
  width: 150px; height: 150px; display: block;
  image-rendering: pixelated;   /* keep QR modules crisp when scaled */
}
.ticket__person { font-family: var(--font-serif); font-size: 1.2rem; font-weight: 500; }
.ticket__group { color: #836e76; font-size: .9rem; }
.ticket__mesa {
  display: inline-block; margin-top: .55rem; padding: .3em 1.1em;
  font-family: var(--font-serif); font-size: 1.05rem; font-weight: 600; color: #8a4a5a;
  background: rgba(255,255,255,.55); border: 1px solid rgba(176,106,121,.4);
  border-radius: 999px;
}
.ticket__no { color: #b06a79; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; margin-top: .55rem; }
.ticket__hint {
  margin-top: 1rem; padding-top: .8rem; border-top: 1px dashed rgba(120,70,90,.3);
  font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: #9c8088;
}
.ticket__download {
  font-size: .7rem; padding: .55em 1.2em;
  background: var(--glass-bg-strong); color: var(--text);
}
.ticket__download:hover { background: var(--accent-soft); }

/* ---- Validator (entrance scanner) page ----------------------------------- */
.validator__main { min-height: 100svh; display: flex; align-items: center; padding: 2.5rem 0; }
.validator__header { text-align: center; margin-bottom: 1.5rem; }
.validator__gate { max-width: 420px; margin: 0 auto; text-align: center; }
.validator__gate .section__subtitle { margin-inline: auto; }

.validator__reader {
  width: 100%; max-width: 360px; margin: 0 auto 1.25rem;
  border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--glass-border);
  background: rgba(0,0,0,.15);
}
.validator__reader video { width: 100% !important; height: auto !important; display: block; }

.validator__result {
  text-align: center; padding: 1.25rem; border-radius: var(--radius-md);
  margin: 1rem 0; border: 1px solid var(--glass-border); background: var(--glass-bg-strong);
}
.validator__result-title { font-family: var(--font-serif); font-size: 1.6rem; font-weight: 600; }
.validator__result-group { font-size: 1.05rem; margin-top: .3rem; }
.validator__result-person { color: var(--text-soft); }
.validator__result-when { color: var(--text-soft); font-size: .82rem; margin-top: .3rem; }
.validator__result.is-valid   { background: rgba(46,160,90,.18);  border-color: rgba(46,160,90,.5); }
.validator__result.is-used    { background: rgba(224,160,60,.18); border-color: rgba(224,160,60,.55); }
.validator__result.is-invalid { background: rgba(179,38,30,.16);  border-color: rgba(179,38,30,.5); }
.validator__result.is-loading,
.validator__result.is-error   { background: var(--glass-bg-strong); }

.validator__manual { margin-top: 1rem; }
.validator__manual summary { cursor: pointer; color: var(--accent); font-size: .9rem; }
.validator__logout {
  display: block; margin: 1.25rem auto 0; font-size: .72rem;
  background: transparent; color: var(--text-soft);
}
.validator__error { color: #b3261e; text-align: center; margin-top: 1rem; }

/* ---- Scanner cooldown (after each scan) ---------------------------------- */
.validator__cooldown { text-align: center; margin: .8rem 0 0; }
.validator__cooldown-text { color: var(--text-soft); font-size: .85rem; margin-bottom: .6rem; }
.validator__cooldown-text strong { color: var(--accent); font-weight: 500; }

/* ---- Organizer dashboard ------------------------------------------------- */
.dash { max-width: 760px; margin: 0 auto; }
.dash__metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: .9rem; margin: 1.25rem 0; }
@media (min-width: 680px) { .dash__metrics { grid-template-columns: repeat(4, 1fr); } }
.metric {
  background: var(--glass-bg-strong); border: 1px solid var(--glass-border);
  border-radius: var(--radius-md); padding: 1.1rem .8rem; text-align: center;
}
.metric__num { font-family: var(--font-serif); font-weight: 600; font-size: 2rem; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.metric__label { margin-top: .35rem; font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-soft); }
.metric__sub { font-size: .72rem; color: var(--accent); margin-top: .25rem; }
.metric--accent .metric__num { color: var(--accent); }

.dash__actions { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; margin: 1.25rem 0; }
.dash__section-title { font-family: var(--font-serif); font-size: 1.3rem; margin: 1.75rem 0 .6rem; }
.dash__table { display: grid; gap: .4rem; }
.dash__row {
  display: flex; align-items: center; gap: .6rem; justify-content: space-between;
  padding: .6em .9em; border-radius: var(--radius-sm);
  background: var(--glass-bg-strong); border: 1px solid var(--glass-border); font-size: .9rem;
}
.dash__row-main { display: flex; flex-direction: column; text-align: left; }
.dash__row-meta { color: var(--text-soft); font-size: .8rem; }
.dash__badge { flex-shrink: 0; font-size: .64rem; letter-spacing: .08em; text-transform: uppercase; padding: .3em .7em; border-radius: 999px; border: 1px solid var(--glass-border); }
.dash__badge.is-yes { background: rgba(46,160,90,.18); }
.dash__badge.is-pending { background: var(--accent-soft); }
.dash__badge.is-no { background: rgba(179,38,30,.14); }
.dash__empty { color: var(--text-soft); font-size: .85rem; text-align: center; padding: .6rem; }
.dash__refresh { display: block; margin: 0 auto; font-size: .72rem; background: transparent; color: var(--text-soft); }

/* =============================================================================
   11. ANÉCDOTAS — vertical "stories" feed
   ============================================================================= */
.anecdotas__feed {
  width: min(100% - 2.5rem, 560px);
  margin: 1.75rem auto 0;
  height: clamp(360px, 58vh, 460px);
  overflow-y: auto; overflow-x: hidden;
  scroll-behavior: auto;                 /* instant wraps for the loop */
  scrollbar-width: none; -ms-overflow-style: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 10%, #000 90%, transparent);
          mask-image: linear-gradient(to bottom, transparent, #000 10%, #000 90%, transparent);
}
.anecdotas__feed::-webkit-scrollbar { display: none; }
.anecdotas__track { display: flex; flex-direction: column; gap: 1rem; padding: 1rem 0; }
.anecdota {
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg); box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.4); backdrop-filter: blur(var(--blur)) saturate(1.4);
  padding: 1.4rem 1.5rem; text-align: center;
}
.anecdota__text { font-family: var(--font-serif); font-style: italic; font-size: 1.15rem; line-height: 1.4; }
.anecdota__author { margin-top: .7rem; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.anecdotas__share { text-align: center; margin-top: 1.75rem; }
.anecdotas__share-note { margin-top: .8rem; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-soft); }
