:root {
    --blue: #0f4d8a;
    --blue-deep: #082f5e;
    --blue-bright: #1a67b7;
    --green: #4d7228;
    --green-deep: #274817;
    --gold: #d4a935;
    --gold-light: #f2d98d;
    --cream: #f8f0dc;
    --paper: #fffaf0;
    --ink: #1d261a;
    --muted: #66705e;
    --purple: #624184;
    --danger: #a93434;
    --shadow: 0 24px 70px rgba(15, 35, 20, .18);
    --radius: 26px;
    --pixel-shadow: 4px 4px 0 rgba(6, 27, 51, .88), -2px -2px 0 rgba(255,255,255,.5);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html.is-locked { overflow: hidden; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}
img, video { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.skip-link { position: fixed; left: 12px; top: -100px; z-index: 9999; background: #fff; padding: 10px 14px; border-radius: 8px; }
.skip-link:focus { top: 12px; }

.opening {
    position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px;
    background: radial-gradient(circle at 50% 20%, rgba(32,102,174,.65), rgba(3,25,51,.97) 65%);
    transition: opacity .65s ease, visibility .65s ease;
}
.opening--closed { opacity: 0; visibility: hidden; }
.opening__media { position: absolute; inset: 0; background: url('../images/escena-luminosa.webp') center/cover; opacity: .18; filter: blur(3px); }
.opening__card { position: relative; width: min(94vw, 410px); max-height: 94vh; display: grid; border-radius: 24px; overflow: hidden; box-shadow: 0 30px 100px rgba(0,0,0,.55); background: var(--cream); }
.opening__card picture, .opening__card img { width: 100%; min-height: 0; object-fit: cover; }
.opening__actions { position: absolute; left: 0; right: 0; bottom: 0; padding: 38px 20px 20px; text-align: center; color: white; background: linear-gradient(transparent, rgba(5,31,60,.96) 45%); }
.opening__actions p { margin: 0 0 10px; font-weight: 800; text-shadow: 0 2px 10px rgba(0,0,0,.5); }

.hero { min-height: 100svh; position: relative; display: grid; align-items: end; color: #fff; overflow: hidden; background: var(--blue-deep); }
.hero__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(4,20,38,.24), rgba(4,25,49,.25) 35%, rgba(4,25,49,.92)); }
.topbar { position: absolute; z-index: 3; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: max(16px, env(safe-area-inset-top)) 20px 16px; }
.brand { text-decoration: none; font-weight: 950; letter-spacing: .08em; }
.topbar__links { display: none; gap: 24px; }
.topbar__links a { text-decoration: none; font-weight: 700; }
.hero__content { position: relative; z-index: 2; width: min(100% - 34px, 1180px); margin: 0 auto; padding: 100px 0 14vh; }
.eyebrow { display: inline-block; text-transform: uppercase; letter-spacing: .19em; font-size: .76rem; font-weight: 900; color: var(--gold-light); }
.eyebrow--dark { color: var(--blue); }
.hero h1 { margin: .1em 0 0; font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif; font-size: clamp(4.2rem, 25vw, 10rem); line-height: .82; letter-spacing: .01em; color: #f4d36d; text-shadow: var(--pixel-shadow); }
.hero__surname { margin: .5rem 0 0; font-size: clamp(1.4rem, 6vw, 3rem); font-weight: 900; letter-spacing: .03em; }
.hero__date { font-size: 1.05rem; font-weight: 700; }
.hero__buttons, .closing-actions, .calendar-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.scroll-cue { position: absolute; z-index: 3; bottom: 20px; right: 24px; width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.45); border-radius: 50%; color: #fff; text-decoration: none; font-size: 1.8rem; animation: bob 1.8s infinite; }

.button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border: 0; border-radius: 999px; text-decoration: none; font-weight: 850; cursor: pointer; transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease; }
.button:hover { transform: translateY(-2px); }
.button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.button:disabled { opacity: .55; cursor: wait; }
.button--large { min-height: 56px; padding-inline: 26px; }
.button--primary { color: #fff; background: linear-gradient(135deg, var(--blue-bright), var(--blue-deep)); box-shadow: 0 12px 28px rgba(8,47,94,.3); }
.button--secondary { color: #fff; background: var(--green-deep); }
.button--glass { color: #fff; background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.45); backdrop-filter: blur(14px); }
.button--outline { color: var(--blue-deep); background: transparent; border: 2px solid rgba(15,77,138,.4); }
.button--whatsapp { color: #fff; background: #168c4b; }

.section { position: relative; padding: 78px 0; }
.section__inner { width: min(100% - 34px, 1180px); margin: 0 auto; }
.section__inner--narrow { max-width: 850px; text-align: center; }
.section--cream { background: var(--cream); }
.section--paper { background: var(--paper); }
.section-heading { max-width: 690px; margin: 0 auto 38px; text-align: center; }
h2 { margin: .15em 0 .45em; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.1rem, 8vw, 4.5rem); line-height: 1.05; color: var(--blue-deep); }
h3 { margin: .35em 0; font-size: 1.55rem; line-height: 1.2; }
p { margin: 0 0 1em; }
.lead { font-size: clamp(1.08rem, 3.5vw, 1.35rem); color: #394431; }
.decor { position: absolute; opacity: .1; font-size: 8rem; }
.decor--cross { top: 30px; right: 6vw; color: var(--gold); }
.welcome__grid { display: grid; gap: 34px; align-items: center; }
.family-card { margin-top: 26px; padding: 20px; border-left: 5px solid var(--gold); background: rgba(255,255,255,.55); border-radius: 0 18px 18px 0; }
.family-card p:last-child { margin-bottom: 0; }
.welcome__art img { width: 100%; max-height: 640px; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }

.countdown-section { color: #fff; background: linear-gradient(rgba(4,28,53,.78), rgba(4,28,53,.92)), url('../images/lineart-correr.webp') center/cover fixed; }
.countdown-section h2 { color: #fff; }
.countdown { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 28px; }
.countdown > div { padding: 20px 8px; border: 1px solid rgba(255,255,255,.23); border-radius: 18px; background: rgba(255,255,255,.08); backdrop-filter: blur(10px); }
.countdown strong { display: block; font-family: Impact, sans-serif; font-size: clamp(2.2rem, 12vw, 5rem); color: var(--gold-light); line-height: 1; }
.countdown span { font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; }
.countdown__message { min-height: 1.5em; margin-top: 18px; font-weight: 800; }

.location-grid { display: grid; gap: 20px; }
.location-card { padding: 28px; border-radius: var(--radius); background: linear-gradient(145deg, #fff, #eef5fb); border: 1px solid rgba(15,77,138,.12); box-shadow: var(--shadow); overflow: hidden; }
.location-card--green { background: linear-gradient(145deg, #fff, #edf4e6); border-color: rgba(77,114,40,.16); }
.location-card__icon { font-size: 2rem; }
.tag { display: inline-block; margin: 8px 0; padding: 5px 10px; border-radius: 999px; color: #fff; background: var(--blue); font-size: .75rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.location-card--green .tag { background: var(--green); }
.location-card__time { font-family: Impact, sans-serif; font-size: 2rem; color: var(--blue); }
.map-disclosure { margin-top: 18px; }
.map-disclosure summary { cursor: pointer; font-weight: 800; color: var(--blue); }
.map-disclosure iframe { width: 100%; height: 260px; margin-top: 12px; border: 0; border-radius: 16px; }
.calendar-actions { justify-content: center; }

.rsvp-section { color: #fff; background: linear-gradient(145deg, var(--blue-deep), #0f5695 58%, #306c2c); }
.rsvp-section h2 { color: #fff; }
.rsvp-layout { display: grid; gap: 34px; align-items: start; }
.rsvp-intro img { width: min(100%, 430px); margin: 26px auto 0; opacity: .82; }
.form-card { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 22px; border-radius: var(--radius); color: var(--ink); background: rgba(255,250,240,.97); box-shadow: 0 28px 80px rgba(0,0,0,.3); }
.field { display: grid; gap: 7px; min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field label, .field > label, .form-card legend { font-weight: 800; }
.field label span { font-weight: 500; color: var(--muted); }
input, textarea, select { width: 100%; border: 1px solid #c8d0bd; border-radius: 12px; padding: 12px 13px; color: var(--ink); background: #fff; }
input:focus, textarea:focus, select:focus { outline: 3px solid rgba(26,103,183,.2); border-color: var(--blue-bright); }
textarea { resize: vertical; }
.choice-group { border: 0; padding: 0; margin: 0; }
.choice-group label { display: flex; align-items: center; gap: 10px; padding: 11px; border: 1px solid #d6ddcd; border-radius: 12px; cursor: pointer; }
.choice-group input, .privacy-check input { width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--blue); }
.choice-group span { color: var(--ink) !important; font-weight: 750 !important; }
.privacy-check { display: flex; align-items: flex-start; gap: 10px; font-size: .88rem; }
.form-status { min-height: 1.5em; padding: 0; font-weight: 750; }
.form-status--success, .form-status--error { padding: 12px 14px; border-radius: 12px; }
.form-status--success { color: #155b33; background: #dff6e8; }
.form-status--error { color: #842c2c; background: #fde7e7; }
.after-submit { display: flex; flex-wrap: wrap; gap: 10px; }

.guest-stats { color: #fff; text-align: center; background: var(--green-deep); }
.guest-stats h2 { color: #fff; }
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stats-grid > div { padding: 22px 10px; border-radius: 18px; background: rgba(255,255,255,.1); }
.stats-grid strong { display: block; font-family: Impact, sans-serif; font-size: clamp(2.5rem, 13vw, 5rem); color: var(--gold-light); line-height: 1; }
.stats-grid span { text-transform: uppercase; letter-spacing: .1em; font-size: .75rem; font-weight: 850; }
.small-note { margin-top: 18px; font-size: .85rem; opacity: .8; }

.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; grid-auto-rows: 180px; }
.gallery__item, .gallery__video { min-width: 0; border: 0; padding: 0; border-radius: 16px; overflow: hidden; background: #d8dccf; cursor: zoom-in; }
.gallery__item img, .gallery__video video { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.gallery__item:hover img { transform: scale(1.04); }
.gallery__item--tall { grid-row: span 2; }
.gallery__item--wide { grid-column: span 2; }
.gallery__video { cursor: default; }
.gallery--uploaded { margin-top: 10px; }
.lightbox { width: min(94vw, 1100px); max-height: 94vh; padding: 0; border: 0; border-radius: 18px; background: #07182a; box-shadow: 0 30px 100px rgba(0,0,0,.65); }
.lightbox::backdrop { background: rgba(0,0,0,.84); }
.lightbox img { width: 100%; max-height: 90vh; object-fit: contain; }
.lightbox__close { position: fixed; right: 18px; top: 14px; z-index: 2; width: 48px; height: 48px; border: 0; border-radius: 50%; color: #fff; background: rgba(0,0,0,.65); font-size: 2rem; cursor: pointer; }

.upload-section { color: #fff; background: linear-gradient(145deg, #1e4216, #527a2c); }
.upload-section h2 { color: #fff; }
.upload-layout { display: grid; gap: 30px; }
.clean-list { padding-left: 20px; }
.upload-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.upload-button { display: grid; place-items: center; min-height: 120px; padding: 14px; text-align: center; border: 2px dashed #b6c5ab; border-radius: 16px; cursor: pointer; background: #fff; }
.upload-button span { font-size: 2rem; }
.upload-button input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; }
.preview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.preview-grid figure { margin: 0; aspect-ratio: 1; border-radius: 10px; overflow: hidden; }
.preview-grid img { width: 100%; height: 100%; object-fit: cover; }
.progress { height: 10px; overflow: hidden; border-radius: 999px; background: #dce2d7; }
.progress span { display: block; width: 0; height: 100%; background: var(--blue-bright); transition: width .2s; }

.closing-section { color: #fff; background: radial-gradient(circle at top, #155a99, var(--blue-deep)); text-align: center; }
.closing-section h2 { color: #fff; }
.closing-section img { width: min(100%, 540px); margin: 0 auto 20px; }
.gift-note { display: inline-block; padding: 12px 18px; border: 1px solid rgba(255,255,255,.3); border-radius: 999px; }
.closing-actions { justify-content: center; }
.footer { padding: 26px 18px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 24px; text-align: center; background: #061b32; color: rgba(255,255,255,.72); font-size: .85rem; }
.footer p { margin: 0; }
.footer a { color: inherit; }
.music-button { position: fixed; right: 18px; bottom: 18px; z-index: 100; width: 52px; height: 52px; border: 0; border-radius: 50%; color: #fff; background: var(--purple); box-shadow: 0 10px 30px rgba(0,0,0,.3); font-size: 1.3rem; }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@keyframes bob { 50% { transform: translateY(6px); } }

@media (min-width: 720px) {
    .topbar { padding-inline: 5vw; }
    .topbar__links { display: flex; }
    .hero__content { padding-bottom: 12vh; }
    .welcome__grid, .rsvp-layout, .upload-layout { grid-template-columns: 1fr 1fr; }
    .countdown, .stats-grid { grid-template-columns: repeat(4, 1fr); }
    .location-grid { grid-template-columns: 1fr 1fr; }
    .gallery { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 210px; }
    .gallery__item--wide { grid-column: span 2; }
    .section { padding: 105px 0; }
    .form-card { padding: 32px; }
}

@media (min-width: 1200px) {
    .hero__content { padding-left: 4vw; }
    .hero h1 { font-size: 9.5rem; }
    .opening__card { width: 430px; }
    .gallery { grid-auto-rows: 260px; }
}

@media (min-width: 1900px) {
    .section__inner, .hero__content { max-width: 1500px; }
    body { font-size: 1.18rem; }
    .hero h1 { font-size: 12rem; }
    .gallery { grid-auto-rows: 330px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    .reveal { opacity: 1; transform: none; }
    .hero__video { display: none; }
    .hero { background: linear-gradient(rgba(4,25,49,.45), rgba(4,25,49,.93)), url('../images/video-portada.jpg') center/cover; }
}
