/* ==========================================================================
   LUMIÈRE — plantilla cinemática. Mobile-first.
   ========================================================================== */

/* ---------- Temas ---------- */
:root, :root[data-theme="noir"] {
  --c-bg: #0e0d0b; --c-ink: #efe7d8; --c-muted: #a8a091; --c-line: rgba(239, 231, 216, .16); --c-surface: #17150f;
  --c-accent: #c9a96e; --c-accent-ink: #14110b; --c-deep: #070605;
  --f-display: "Cormorant Garamond", "Times New Roman", serif; --f-body: "Inter", system-ui, sans-serif;
  --display-weight: 300; --display-style: italic; --display-track: -.02em;
}
:root[data-theme="terracota"] {
  --c-bg: #f3ebe2; --c-ink: #2f211a; --c-muted: #6f5a4d; --c-line: rgba(47, 33, 26, .15); --c-surface: #fbf6f0;
  --c-accent: #a84d28; --c-accent-ink: #fff; --c-deep: #1e140f;
  --f-display: "Playfair Display", Georgia, serif; --f-body: "DM Sans", system-ui, sans-serif;
  --display-weight: 400; --display-style: italic; --display-track: -.02em;
}
:root[data-theme="salvia"] {
  --c-bg: #eef0e8; --c-ink: #232b22; --c-muted: #56614f; --c-line: rgba(35, 43, 34, .15); --c-surface: #f8f9f4;
  --c-accent: #55694a; --c-accent-ink: #fff; --c-deep: #161c15;
  --f-display: "Italiana", "Didot", serif; --f-body: "Jost", system-ui, sans-serif;
  --display-weight: 400; --display-style: normal; --display-track: .01em;
}
:root[data-theme="medianoche"] {
  --c-bg: #0b1220; --c-ink: #e6e9f2; --c-muted: #9aa5bd; --c-line: rgba(230, 233, 242, .15); --c-surface: #121b2e;
  --c-accent: #b4c6ec; --c-accent-ink: #0b1220; --c-deep: #060a13;
  --f-display: "Bodoni Moda", "Didot", serif; --f-body: "Manrope", system-ui, sans-serif;
  --display-weight: 400; --display-style: italic; --display-track: -.02em;
}
:root[data-theme="terracota"] { --hero-accent: #f0a27c; }
:root[data-theme="salvia"] { --hero-accent: #c9d8b6; }
:root { --radius: 4px; --btn-radius: 999px; --gutter: 20px; --ease: cubic-bezier(.2, .8, .2, 1); --hero-ink: #f6f1e7; }

html { scroll-padding-top: 72px; }
body { font-size: 16px; line-height: 1.6; }
section { position: relative; }

/* ---------- Tipografía base ---------- */
.eyebrow { margin: 0 0 14px; font-size: 11px; font-weight: 500; letter-spacing: .32em; text-transform: uppercase; color: var(--c-accent); }
.h2 { margin: 0; font-family: var(--f-display); font-weight: var(--display-weight); font-style: var(--display-style); font-size: clamp(44px, 12vw, 120px); line-height: .95; letter-spacing: var(--display-track); }

/* ---------- Grano de película ---------- */
.grain { position: absolute; inset: -50%; pointer-events: none; opacity: .14; mix-blend-mode: overlay; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); animation: grain 1s steps(6) infinite; }
@keyframes grain { 0%, 100% { transform: translate(0, 0); } 20% { transform: translate(-4%, 3%); } 40% { transform: translate(3%, -5%); } 60% { transform: translate(-6%, -2%); } 80% { transform: translate(5%, 4%); } }

/* ---------- Loader ---------- */
.loader { position: fixed; inset: 0; z-index: 10000; pointer-events: none; display: grid; place-items: center; }
.loader__bar { position: absolute; left: 0; right: 0; height: 50.5%; background: var(--c-deep); }
.loader__bar--top { top: 0; } .loader__bar--bottom { bottom: 0; }
.loader__mark { position: relative; display: flex; align-items: center; gap: 18px; color: var(--hero-ink); font-family: var(--f-display); font-style: var(--display-style); font-size: 44px; }
.loader__mark i { width: 0; height: 1px; background: var(--c-accent); }
.is-loaded .loader { display: none; }
.wb-embed .loader, .no-loader .loader { display: none; }

/* ---------- Nav ---------- */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 900; display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left)); padding-top: env(safe-area-inset-top); color: var(--hero-ink); transition: background .5s var(--ease), color .5s var(--ease), transform .5s var(--ease), box-shadow .5s; }
.nav.is-solid { background: color-mix(in srgb, var(--c-bg) 82%, transparent); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); color: var(--c-ink); box-shadow: 0 1px 0 var(--c-line); }
.nav.is-hidden { transform: translateY(-100%); }
.nav__mark { font-family: var(--f-display); font-style: var(--display-style); font-size: 24px; text-decoration: none; letter-spacing: .02em; margin-right: auto; }
.nav__mark span { color: var(--c-accent); padding: 0 2px; }
.nav__links { display: none; }
.nav__cta { display: inline-flex; align-items: center; height: 40px; padding: 0 18px; border-radius: 999px; background: var(--c-accent); color: var(--c-accent-ink); font-size: 14px; font-weight: 600; text-decoration: none; transition: transform .3s var(--ease); }
.nav__cta:hover { transform: translateY(-1px); }
.nav__burger { display: grid; place-content: center; gap: 6px; width: 44px; height: 44px; margin-right: -10px; border: 0; background: none; }
.nav__burger span { display: block; width: 22px; height: 1.5px; background: currentColor; transition: transform .4s var(--ease); }
.nav__burger[aria-expanded="true"] span:first-child { transform: translateY(3.75px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:last-child { transform: translateY(-3.75px) rotate(-45deg); }
.menu-open .nav { color: var(--hero-ink); background: transparent; box-shadow: none; backdrop-filter: none; }

.menu { position: fixed; inset: 0; z-index: 800; display: flex; flex-direction: column; justify-content: center; padding: 96px 28px max(32px, env(safe-area-inset-bottom)); background: var(--c-deep); color: var(--hero-ink); clip-path: inset(0 0 100% 0); transition: clip-path .7s var(--ease); }
.menu[hidden] { display: flex; visibility: hidden; }
.menu.is-open { clip-path: inset(0); visibility: visible; }
.menu nav { display: grid; gap: 6px; }
.menu a { display: flex; align-items: baseline; gap: 14px; padding: 8px 0; font-family: var(--f-display); font-style: var(--display-style); font-size: clamp(34px, 9vw, 56px); line-height: 1.1; text-decoration: none; opacity: 0; transform: translateY(20px); transition: opacity .5s, transform .6s var(--ease); }
.menu a small { font-family: var(--f-body); font-style: normal; font-size: 12px; color: var(--c-accent); letter-spacing: .1em; }
.menu.is-open a { opacity: 1; transform: none; }
.menu.is-open a:nth-child(2) { transition-delay: .05s; } .menu.is-open a:nth-child(3) { transition-delay: .1s; } .menu.is-open a:nth-child(4) { transition-delay: .15s; } .menu.is-open a:nth-child(5) { transition-delay: .2s; }
.menu__foot { margin: auto 0 0; padding-top: 32px; font-size: 13px; letter-spacing: .08em; opacity: .6; }

/* ---------- Hero ---------- */
.hero { height: 100svh; min-height: 560px; display: grid; place-items: center; overflow: hidden; color: var(--hero-ink); background: var(--c-deep); isolation: isolate; }
.hero__media { position: absolute; inset: 0; z-index: -1; }
.hero__video { width: 100%; height: 100%; object-fit: cover; transform-origin: center; }
.hero__media::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 80% at 50% 40%, rgba(0,0,0,.05), rgba(0,0,0,.55)), linear-gradient(to bottom, rgba(0,0,0,.35), transparent 30%, transparent 55%, rgba(0,0,0,.65)); }
.hero__inner { position: relative; text-align: center; padding: 0 var(--gutter); }
.hero__eyebrow { margin: 0 0 18px; font-size: 11px; letter-spacing: .4em; text-transform: uppercase; }
.hero__greet:not(:empty) { display: block; margin-bottom: 10px; font-family: var(--f-display); font-style: var(--display-style); font-size: 20px; letter-spacing: .02em; text-transform: none; color: var(--hero-accent, var(--c-accent)); }
.hero__names { margin: 0; display: flex; flex-direction: column; align-items: center; font-family: var(--f-display); font-weight: var(--display-weight); font-style: var(--display-style); font-size: clamp(76px, 24vw, 240px); line-height: .82; letter-spacing: var(--display-track); }
.hero__amp { display: block; font-size: .42em; line-height: 1.1; color: var(--hero-accent, var(--c-accent)); }
.hero__date { display: inline-flex; align-items: center; gap: 14px; margin: 28px 0 0; font-size: 13px; letter-spacing: .3em; text-transform: uppercase; }
.hero__date i { width: 36px; height: 1px; background: currentColor; opacity: .6; }
.hero__scroll { position: absolute; bottom: max(28px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: grid; justify-items: center; gap: 10px; font-size: 10px; letter-spacing: .3em; text-transform: uppercase; text-decoration: none; opacity: .8; }
.hero__scroll i { width: 1px; height: 44px; background: linear-gradient(currentColor, transparent); animation: scrollcue 2.2s var(--ease) infinite; transform-origin: top; }
@keyframes scrollcue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------- Intro statement ---------- */
.intro { padding: 120px var(--gutter) 90px; max-width: 1100px; margin: 0 auto; }
.intro__kicker { margin: 0 0 22px; font-size: 11px; letter-spacing: .32em; text-transform: uppercase; color: var(--c-accent); }
.intro__text { margin: 0; font-family: var(--f-display); font-weight: var(--display-weight); font-size: clamp(30px, 7.4vw, 72px); line-height: 1.12; letter-spacing: -.01em; }
.intro__text .w { opacity: .18; transition: opacity .3s; }
.intro__text .w.is-on { opacity: 1; }
.no-scrub .intro__text .w { opacity: 1; }

/* ---------- Esenciales ---------- */
.essentials { display: grid; gap: 1px; margin: 0 var(--gutter) 40px; background: var(--c-line); border: 1px solid var(--c-line); }
.ess { padding: 28px 24px; background: var(--c-bg); }
.ess__k { margin: 0 0 12px; font-family: var(--f-body); font-size: 11px; font-weight: 500; letter-spacing: .32em; text-transform: uppercase; color: var(--c-accent); }
.ess__v { margin: 0; font-family: var(--f-display); font-size: 30px; line-height: 1.1; }
.ess__s { margin: 6px 0 18px; color: var(--c-muted); font-size: 15px; }
.link-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0; border: 0; background: none; font-size: 15px; font-weight: 500; text-decoration: none; border-bottom: 1px solid currentColor; }
.link-btn::after { content: "→"; transition: transform .3s var(--ease); }
.link-btn:hover::after { transform: translateX(4px); }

/* ---------- Historia ---------- */
.story { padding: 90px 0 70px; overflow: hidden; }
.story__head { padding: 0 var(--gutter); margin-bottom: 36px; }
.story__hint { margin: 18px 0 0; font-size: 13px; color: var(--c-muted); letter-spacing: .08em; }
.story__viewport { overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.story__viewport::-webkit-scrollbar { display: none; }
.story__track { display: flex; gap: 16px; margin: 0; padding: 0 var(--gutter); list-style: none; width: max-content; }
.scene { width: 78vw; max-width: 420px; scroll-snap-align: center; }
.scene__img { position: relative; margin: 0; aspect-ratio: 4 / 5; overflow: hidden; background: var(--c-surface); }
.scene__img img { width: 100%; height: 115%; object-fit: cover; }
.scene__txt { padding-top: 18px; }
.scene__year { font-family: var(--f-display); font-style: var(--display-style); font-size: 56px; line-height: 1; color: var(--c-accent); }
.scene h3 { margin: 6px 0 8px; font-family: var(--f-display); font-weight: 400; font-size: 28px; line-height: 1.1; }
.scene p { margin: 0; color: var(--c-muted); font-size: 15px; }

/* ---------- Cuenta atrás ---------- */
.count { min-height: 88svh; display: grid; place-items: center; overflow: hidden; color: var(--hero-ink); background: var(--c-deep); isolation: isolate; }
.count__video { position: absolute; inset: 0; z-index: -1; width: 100%; height: 120%; object-fit: cover; opacity: .55; }
.count::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(70% 60% at 50% 50%, transparent, rgba(0,0,0,.6)); }
.count__inner { text-align: center; padding: 80px var(--gutter); }
.count__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 34px 28px; }
.count__grid span { display: block; font-family: var(--f-display); font-weight: var(--display-weight); font-size: clamp(64px, 19vw, 170px); line-height: 1.05; font-variant-numeric: lining-nums tabular-nums; }
.count__grid small { display: block; margin-top: 4px; font-size: 11px; letter-spacing: .32em; text-transform: uppercase; opacity: .75; }

/* ---------- Timeline ---------- */
.day { padding: 110px var(--gutter) 90px; max-width: 980px; margin: 0 auto; }
.day__head { margin-bottom: 48px; }
.timeline { position: relative; margin: 0; padding: 0 0 0 30px; list-style: none; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 10px; bottom: 10px; width: 1px; background: var(--c-line); }
.timeline__line { display: none; }
.tl { position: relative; display: grid; gap: 4px; padding: 0 0 40px; }
.tl::before { content: ""; position: absolute; left: -30px; top: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--c-bg); box-shadow: 0 0 0 1px var(--c-accent); transition: background .5s, box-shadow .5s; }
.tl.is-in::before { background: var(--c-accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--c-accent) 22%, transparent); }
.tl time { font-family: var(--f-display); font-size: 44px; line-height: 1; color: var(--c-accent); font-variant-numeric: lining-nums tabular-nums; }
.tl h3 { margin: 6px 0 4px; font-family: var(--f-display); font-weight: 400; font-size: 30px; line-height: 1.1; }
.tl p { margin: 0; color: var(--c-muted); max-width: 46ch; }

/* ---------- Lugar ---------- */
.place { display: grid; }
.place__media { margin: 0; height: 64svh; overflow: hidden; clip-path: inset(0 0 0 0); }
.place__media img { width: 100%; height: 120%; object-fit: cover; }
.place__card { position: relative; margin: -70px var(--gutter) 0; padding: 32px 24px; background: var(--c-surface); box-shadow: 0 30px 60px -30px rgba(0,0,0,.35); }
.place__card .h2 { font-size: clamp(38px, 10vw, 72px); }
.place__addr { margin: 12px 0 14px; font-weight: 500; }
.place__card p:not(.eyebrow):not(.place__addr) { color: var(--c-muted); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 24px; border: 1px solid var(--c-accent); border-radius: var(--btn-radius); background: var(--c-accent); color: var(--c-accent-ink); font-size: 15px; font-weight: 600; text-decoration: none; transition: transform .3s var(--ease); }
.btn:hover { transform: translateY(-2px); }
.btn--ghost { background: transparent; color: var(--c-ink); border-color: var(--c-line); }

/* ---------- Galería ---------- */
.gallery { padding: 110px var(--gutter) 70px; }
.gallery__head { margin-bottom: 40px; }
.gallery__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ph { position: relative; display: block; padding: 0; border: 0; overflow: hidden; aspect-ratio: 1; background: var(--c-surface); cursor: zoom-in; }
.ph--tall { grid-row: span 2; aspect-ratio: auto; }
.ph img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease), filter .6s; }
.ph:hover img { transform: scale(1.05); }

.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(5,5,5,.94); }
.lightbox[open] { display: grid; place-items: center; animation: lbIn .4s var(--ease); }
.lightbox::backdrop { background: transparent; }
.lightbox img { max-width: 94vw; max-height: 86dvh; object-fit: contain; }
.lightbox__close { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px; width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255,255,255,.1); color: #fff; font-size: 28px; line-height: 1; }
@keyframes lbIn { from { opacity: 0; } }

/* ---------- Info ---------- */
.info { padding: 100px var(--gutter); }
.info__head { margin-bottom: 40px; }
.info__grid { display: grid; gap: 14px; }
.card { padding: 28px 24px; border: 1px solid var(--c-line); background: var(--c-surface); }
.card h3 { margin: 0 0 10px; font-family: var(--f-display); font-weight: 400; font-size: 28px; line-height: 1.1; }
.card p { margin: 0 0 10px; color: var(--c-muted); }
.card p b { color: var(--c-ink); font-weight: 600; }
.card__note { font-size: 14px; color: var(--c-accent) !important; }
.swatches { display: flex; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.swatches li { width: 34px; height: 34px; border-radius: 50%; background: var(--s); box-shadow: inset 0 0 0 1px rgba(255,255,255,.15), 0 0 0 1px var(--c-line); }
.iban { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 52px; margin-top: 8px; padding: 0 16px; border: 1px dashed var(--c-accent); border-radius: var(--radius); background: transparent; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; letter-spacing: .02em; text-align: left; }
.iban span { flex: none; font-family: var(--f-body); font-weight: 600; color: var(--c-accent); }

/* ---------- RSVP ---------- */
.rsvp-sec { padding: 110px var(--gutter) 120px; overflow: hidden; color: var(--hero-ink); background: var(--c-deep); isolation: isolate; }
.rsvp-sec__bg { position: absolute; inset: 0; z-index: -1; }
.rsvp-sec__bg img { width: 100%; height: 100%; object-fit: cover; opacity: .32; filter: saturate(.8); }
.rsvp-sec__bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, var(--c-deep), transparent 30%, transparent 70%, var(--c-deep)); }
.rsvp-sec__head { text-align: center; margin-bottom: 40px; }
.rsvp-sec .h2 { font-size: clamp(42px, 11vw, 104px); }
.rsvp { --r-bg: var(--c-bg); --r-ink: var(--c-ink); --r-radius: 6px; --r-title-weight: var(--display-weight); --r-shadow: 0 40px 100px -30px rgba(0,0,0,.6); }
.rsvp .rsvp__title { font-style: var(--display-style); }

/* ---------- Footer ---------- */
.foot { padding: 100px var(--gutter) max(110px, calc(env(safe-area-inset-bottom) + 90px)); text-align: center; background: var(--c-bg); }
.foot__names { margin: 0; font-family: var(--f-display); font-weight: var(--display-weight); font-style: var(--display-style); font-size: clamp(54px, 15vw, 190px); line-height: .9; letter-spacing: var(--display-track); }
.foot__tag { margin: 20px 0 0; color: var(--c-accent); letter-spacing: .14em; }
.foot__credit { margin: 30px 0 0; font-size: 12px; color: var(--c-muted); }

/* ==========================================================================
   ≥ 720px
   ========================================================================== */
@media (min-width: 720px) {
  :root { --gutter: 40px; }
  .essentials { grid-template-columns: repeat(3, 1fr); margin: 0 var(--gutter) 60px; }
  .ess { padding: 40px 32px; }
  .count__grid { grid-template-columns: repeat(4, auto); gap: 0 56px; }
  .gallery__grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .info__grid { grid-template-columns: 1fr 1fr; gap: 18px; }
  .place__card { max-width: 560px; margin: -120px var(--gutter) 0 auto; padding: 48px 44px; }
  .scene { width: 46vw; }
}

/* ==========================================================================
   ≥ 1024px — escritorio
   ========================================================================== */
@media (min-width: 1024px) {
  :root { --gutter: 56px; }
  .nav { height: 80px; }
  .nav__links { display: flex; gap: 34px; margin-right: 24px; font-size: 14px; letter-spacing: .04em; }
  .nav__links a { position: relative; text-decoration: none; opacity: .85; }
  .nav__links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .4s var(--ease); }
  .nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }
  .nav__burger { display: none; }
  .nav__cta { height: 44px; padding: 0 24px; }

  .hero__names { flex-direction: row; align-items: baseline; gap: .12em; font-size: clamp(96px, 12.5vw, 210px); }
  .hero__amp { font-size: .5em; }
  .intro { padding: 200px var(--gutter) 160px; }

  /* Historia: scroll horizontal fijado (lo controla GSAP; sin JS queda el carrusel) */
  .story.is-pinned { height: 100vh; padding: 0; display: flex; flex-direction: column; justify-content: center; }
  .story.is-pinned .story__viewport { overflow: visible; }
  .story.is-pinned .story__hint { display: none; }
  .story__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; }
  .scene { width: 32vw; max-width: none; display: grid; }
  .scene:nth-child(even) { margin-top: 12vh; }
  .story__track { gap: 5vw; padding-right: 10vw; }

  .day { display: grid; grid-template-columns: 1fr 1.3fr; gap: 80px; align-items: start; }
  .day__head { position: sticky; top: 140px; }
  .tl { grid-template-columns: 140px 1fr; gap: 24px; padding-bottom: 56px; }

  .place { grid-template-columns: 1.4fr 1fr; align-items: center; }
  .place__media { height: 92vh; }
  .place__card { margin: 0 0 0 -140px; max-width: none; }

  .gallery__grid { grid-template-columns: repeat(4, 1fr); }
  .ph--tall { grid-row: span 2; }
  .info__grid { grid-template-columns: repeat(4, 1fr); }
  .info__head, .gallery__head { display: flex; align-items: flex-end; justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
  .loader { display: none; }
}
