:root {
    --paper: #f4ead8;
    --paper-2: #e9d9bf;
    --ink: #3a2a1b;
    --muted: #6c5743;
    --accent: #9a6a44;
    --accent-2: #6a472e;
    --line: rgba(110, 79, 46, 0.3);
    --card: rgba(251, 246, 236, 0.9);
    --shadow: 0 20px 48px rgba(58, 39, 20, 0.16);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    font-family: "Cormorant Garamond", serif;
    color: var(--ink);
    scroll-behavior: smooth;
    background:
        radial-gradient(circle at 17% 22%, rgba(138, 92, 58, 0.09) 0 210px, transparent 220px),
        radial-gradient(circle at 84% 78%, rgba(138, 92, 58, 0.07) 0 230px, transparent 250px),
        repeating-linear-gradient(110deg, rgba(123, 95, 65, 0.06) 0 2px, transparent 2px 11px),
        linear-gradient(160deg, var(--paper), var(--paper-2));
    background-attachment: fixed;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    width: 320px;
    height: 320px;
    right: -70px;
    top: 22px;
    border-radius: 50%;
    pointer-events: none;
    border: 2px solid rgba(94, 69, 44, 0.24);
    opacity: 0.24;
    background:
        linear-gradient(rgba(94, 69, 44, 0.45), rgba(94, 69, 44, 0.45)) center/2px 82% no-repeat,
        linear-gradient(90deg, rgba(94, 69, 44, 0.45), rgba(94, 69, 44, 0.45)) center/82% 2px no-repeat,
        linear-gradient(45deg, rgba(94, 69, 44, 0.3), rgba(94, 69, 44, 0.3)) center/65% 2px no-repeat,
        linear-gradient(-45deg, rgba(94, 69, 44, 0.3), rgba(94, 69, 44, 0.3)) center/65% 2px no-repeat;
}

section {
    position: relative;
    z-index: 1;
}

.crossfade-section {
    min-height: 96vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 72px 18px;
    opacity: 0.74;
    filter: saturate(0.9) brightness(0.97);
    transform: translateY(20px) scale(0.995);
    transition:
        opacity 0.95s cubic-bezier(0.22, 1, 0.36, 1),
        filter 0.95s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.95s cubic-bezier(0.22, 1, 0.36, 1);
}

.crossfade-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(95vw, 980px);
    border-top: 1px dashed var(--line);
}

.crossfade-section::after {
    content: attr(data-stamp);
    position: absolute;
    top: 24px;
    right: max(14px, calc((100vw - 980px) / 2 + 20px));
    width: 104px;
    height: 104px;
    border-radius: 50%;
    border: 1px solid rgba(138, 92, 58, 0.34);
    color: rgba(138, 92, 58, 0.9);
    font-family: "Cinzel", serif;
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    display: grid;
    place-items: center;
    text-align: center;
    transform: rotate(-12deg);
    opacity: 0.88;
    pointer-events: none;
    z-index: 2;
    background:
        linear-gradient(rgba(251, 246, 236, 0.56), rgba(251, 246, 236, 0.56)),
        url("../img/assets/selloAvioncito.png") center/cover no-repeat;
}

.crossfade-section.is-active {
    opacity: 1;
    filter: saturate(1.03) brightness(1);
    transform: translateY(0) scale(1);
}

.crossfade-section.is-near {
    opacity: 0.9;
    filter: saturate(0.97) brightness(0.99);
    transform: translateY(8px) scale(0.998);
}

.crossfade-section.is-active::after {
    opacity: 0.96;
}

#wedding-date,
[data-section="rsvp"] {
    background:
        linear-gradient(rgba(244, 234, 216, 0.42), rgba(244, 234, 216, 0.48)),
        url("../img/assets/fondoCartas.jpg") center/cover no-repeat;
}

[data-section="rsvp"] {
    background:
        linear-gradient(rgba(244, 234, 216, 0.34), rgba(244, 234, 216, 0.4)),
        url("../img/assets/fondoBoardinpass.png") center/cover no-repeat;
}

[data-section="destino"] {
    background:
        linear-gradient(rgba(239, 229, 210, 0.4), rgba(239, 229, 210, 0.46)),
        url("../img/assets/fondoMapas.jpg") center/cover no-repeat;
}

[data-section="dress-code"] {
    background:
        radial-gradient(circle at 16% 20%, rgba(154, 106, 68, 0.12) 0 140px, transparent 150px),
        radial-gradient(circle at 85% 75%, rgba(154, 106, 68, 0.1) 0 120px, transparent 130px),
        linear-gradient(165deg, #f6eee2, #efe2cf);
}

.card2 h2 {
    position: relative;
}

.card2 h2::before {
    content: "✂  ·  🪡  ·  ✂";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: -20px;
    font-size: 0.9rem;
    color: rgba(106, 71, 46, 0.58);
    letter-spacing: 0.25rem;
}

.card2 .img-compare::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    height: 34px;
    border-radius: 8px;
    border: 1px dashed rgba(110, 79, 46, 0.22);
    background:
        repeating-linear-gradient(
            90deg,
            rgba(154, 106, 68, 0.18) 0 11px,
            rgba(154, 106, 68, 0.04) 11px 22px
        );
    pointer-events: none;
}

.dresscode-tease {
    margin-top: 14px;
    min-height: 220px;
    border-radius: 14px;
    border: 1px solid rgba(110, 79, 46, 0.26);
    background:
        linear-gradient(rgba(248, 239, 225, 0.9), rgba(248, 239, 225, 0.92)),
        url("../img/assets/selloAvioncito.png") center/120px 120px no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 20px;
}

.tease-text {
    margin: 0;
    font-size: 1.08rem;
    color: var(--accent-2);
}

.tease-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 168px;
    margin-top: 0;
    padding: 10px 18px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(154, 106, 68, 0.98), rgba(106, 71, 46, 0.98));
    color: #f8eee0;
    text-decoration: none;
    font-size: 0.8rem;
}

.location-btn {
    margin-top: 6px;
}

#hero {
    padding-top: 96px;
}

.polaroid-background {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.bg-polaroid {
    position: absolute;
    width: 250px;
    background: #fff;
    padding: 9px 9px 24px;
    border-radius: 2px;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.16);
    filter: sepia(38%) saturate(85%);
    opacity: 0.42;
    animation: drift 9s ease-in-out infinite alternate;
}

.p1 { top: 2%; right: 16%; transform: rotate(-12deg); }
.p2 { top: 20%; right: 2%; transform: rotate(8deg); }
.p3 { bottom: 6%; right: 13%; transform: rotate(4deg); }
.p4 { top: 4%; left: 15%; transform: rotate(15deg); }
.p5 { top: 11%; left: 2%; transform: rotate(5deg); }
.p6 { bottom: 6%; left: 4%; transform: rotate(-6deg); }

@keyframes drift {
    from { transform: translateY(-8px) rotate(-2deg); }
    to { transform: translateY(10px) rotate(2deg); }
}

.hero-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.34), transparent 60%),
        linear-gradient(rgba(247, 242, 232, 0.25), rgba(247, 242, 232, 0.56));
}

.card0,
.card1,
.card2,
.card3,
.date-overlay {
    width: min(94vw, 760px);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 34px 28px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.card0::before,
.card1::before,
.card2::before,
.card3::before,
.date-overlay::before {
    content: "";
    position: absolute;
    inset: 12px;
    border: 1px solid rgba(99, 74, 48, 0.22);
    border-radius: 10px;
    pointer-events: none;
}

.card0::after,
.card1::after,
.card2::after,
.card3::after,
.date-overlay::after {
    content: "";
    position: absolute;
    left: 16px;
    right: 16px;
    top: 16px;
    bottom: 16px;
    border: 1px dashed rgba(123, 95, 65, 0.2);
    border-radius: 8px;
    pointer-events: none;
}

.card0.dark,
.card1.dark,
.card2.dark,
.card3.dark {
    background: var(--card);
    color: var(--ink);
}

.card0 {
    z-index: 2;
}


.hero-content {
    position: relative;
    z-index: 2;
    max-width: 100%;
}

h1,
h2 {
    font-family: "Cinzel", serif;
    color: var(--ink);
    letter-spacing: 0.04em;
    margin-bottom: 14px;
    text-transform: uppercase;
}

h1 {
    font-size: clamp(2rem, 5.2vw, 3rem);
}

h2 {
    font-size: clamp(1.45rem, 3.2vw, 2.15rem);
}

p {
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 1.2rem;
    line-height: 1.48;
}

small {
    color: var(--muted);
}

.polaroid {
    margin: 1.6rem auto 0.8rem;
    background: #f8f2e7;
    padding: 11px 11px 34px;
    width: min(100%, 290px);
    border: 1px solid rgba(99, 74, 48, 0.28);
    box-shadow: 0 10px 26px rgba(53, 34, 18, 0.2);
    transform: rotate(-1.5deg);
}

.polaroid img {
    width: 100%;
    display: block;
}

.icono-anillo,
.icono-enlace {
    font-size: 23px;
}

.airmail-divider {
    position: relative;
    width: 100%;
    margin: 0;
    height: clamp(38px, 5vw, 56px);
    background: url("../img/assets/bordeAereo.png") repeat-x center center;
    background-size: auto 100%;
    overflow: hidden;
}

.airmail-divider::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.04));
}

.airmail-divider::after {
    content: none;
}

.date-overlay {
    padding: 34px 24px;
}

.wedding-day {
    font-size: 1.2rem;
    margin-bottom: 0.9rem;
}

#wedding-date .wedding-day:first-of-type {
    font-size: clamp(1.9rem, 5.2vw, 2.9rem);
    line-height: 1.12;
    font-family: "Cinzel", serif;
    color: var(--accent-2);
    letter-spacing: 0.04em;
}

.wedding-timeline {
    position: relative;
    max-width: 700px;
    margin: 1.1rem auto 0;
    padding: 0 8px;
    text-align: left;
}

.wedding-timeline::before {
    content: "";
    position: absolute;
    left: 25%;
    transform: translateX(-50%);
    top: 4px;
    bottom: 8px;
    width: 2px;
    background: rgba(106, 71, 46, 0.45);
}

.timeline-item {
    position: relative;
    display: flex;
    align-items: baseline;
    padding: 0 0 0.95rem calc(25% + 20px);
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: 25%;
    top: 0.45rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-2);
    box-shadow: 0 0 0 3px rgba(244, 234, 216, 0.85);
    transform: translateX(-50%);
}

.timeline-time {
    display: inline-block;
    width: 68px;
    margin-right: 0.65rem;
    text-align: center;
    font-family: "Cinzel", serif;
    font-size: 0.94rem;
    color: var(--accent-2);
    letter-spacing: 0.04em;
}

.timeline-item p {
    display: inline;
    margin: 0;
    font-size: 1.05rem;
    color: var(--ink);
}

.airport-board {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 1rem 0 1.2rem;
}

.time-block {
    width: 92px;
    border-radius: 10px;
    background: #f8efe0;
    border: 1px solid rgba(99, 74, 48, 0.35);
    box-shadow: inset 0 -4px 0 rgba(94, 69, 44, 0.13);
    padding: 0.8rem 0.5rem;
}

.time-block span {
    display: block;
    font-family: "Cinzel", serif;
    font-size: 1.85rem;
    color: var(--ink);
    animation: flip 0.6s ease;
}

.time-block label {
    display: block;
    margin-top: 3px;
    font-family: "Cinzel", serif;
    font-size: 0.62rem;
    letter-spacing: 2px;
    color: var(--muted);
}

@keyframes flip {
    0% { transform: rotateX(90deg); opacity: 0; }
    100% { transform: rotateX(0); opacity: 1; }
}

#map-container {
    position: relative;
    width: 100%;
    height: 340px;
    border-radius: 14px;
    overflow: hidden;
    margin: 1rem 0;
    border: 1px solid rgba(99, 74, 48, 0.28);
}

#map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

#map-photo {
    position: absolute;
    inset: 0;
    z-index: 2;
    opacity: 0;
}

#map-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.img-compare {
    position: relative;
    width: 100%;
    height: 520px;
    margin-top: 16px;
    border-radius: 14px;
    border: 1px solid rgba(99, 74, 48, 0.28);
    overflow: hidden;
}

.img-compare img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.img-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    overflow: hidden;
}

.slider {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 82%;
    accent-color: var(--accent);
}

.labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-family: "Cinzel", serif;
    color: var(--muted);
    font-size: 0.94rem;
}

.fade-in {
    opacity: 1;
    transform: none;
}

.fade-in.visible {
    opacity: 1;
    transform: none;
}

.hidden {
    display: none;
}

form {
    text-align: left;
}

.boarding-pass {
    border-radius: 16px;
    padding: 14px 28px 14px 14px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(99, 74, 48, 0.23);
    position: relative;
}

.boarding-pass::before {
    content: "";
    position: absolute;
    top: 12px;
    bottom: 12px;
    right: 16px;
    width: 1px;
    background: repeating-linear-gradient(
        to bottom,
        rgba(99, 74, 48, 0.45),
        rgba(99, 74, 48, 0.45) 9px,
        transparent 9px,
        transparent 16px
    );
    opacity: 0.9;
}

.bp-title {
    margin: -14px -28px 16px -14px;
    padding: 12px 20px;
    border-radius: 14px 14px 0 0;
    background: linear-gradient(180deg, rgba(106, 71, 46, 0.96), rgba(86, 58, 37, 0.95));
    color: #f8eee0;
    font-family: "Cinzel", serif;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: left;
}

.bp-flight-strip {
    margin-bottom: 14px;
    padding: 8px 0 12px;
    border-bottom: 1px dashed rgba(99, 74, 48, 0.32);
}

.bp-flight-strip label {
    margin-top: 0;
}

.bp-flight-strip input {
    font-family: "Cinzel", serif;
    font-size: 1rem;
    letter-spacing: 0.08em;
    color: var(--accent-2);
}

.bp-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 18px;
}

.bp-row.bp-row-compact {
    grid-template-columns: 2fr 1fr;
}

label {
    margin-top: 10px;
    display: block;
    font-family: "Cinzel", serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
    font-size: 0.7rem;
}

.boarding-pass label {
    display: inline-block;
    margin-top: 12px;
    margin-bottom: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    background: linear-gradient(180deg, rgba(106, 71, 46, 0.96), rgba(86, 58, 37, 0.95));
    color: #f8eee0;
    letter-spacing: 0.06em;
    font-weight: 700;
    font-size: 0.76rem;
}

input,
select {
    width: 100%;
    padding: 10px;
    margin-top: 6px;
    border: 1px solid rgba(99, 74, 48, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--ink);
    font-family: "Cormorant Garamond", serif;
    font-size: 1.05rem;
}

.boarding-pass input,
.boarding-pass select {
    border: none;
    border-bottom: 1px solid rgba(99, 74, 48, 0.45);
    border-radius: 0;
    background: transparent;
    padding-left: 4px;
}

button {
    margin-top: 20px;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-family: "Cinzel", serif;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

button:hover {
    background: var(--accent-2);
    transform: translateY(-1px);
}

#submitBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.submit-loader {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

#mensaje {
    margin-top: 12px;
    font-size: 1.05rem;
    color: var(--accent-2);
}

.passenger-help {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed rgba(99, 74, 48, 0.3);
}

.passenger-help h3 {
    margin: 0 auto 8px;
    width: fit-content;
    text-align: center;
    font-family: "Cinzel", serif;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #f8eee0;
    padding: 4px 10px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(106, 71, 46, 0.96), rgba(86, 58, 37, 0.95));
}

.passenger-help p {
    margin-bottom: 10px;
    font-size: 0.98rem;
    line-height: 1.4;
}

.help-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.help-call {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    padding: 10px 14px;
    border-radius: 999px;
    text-decoration: none;
    background: linear-gradient(180deg, rgba(106, 71, 46, 0.96), rgba(86, 58, 37, 0.95));
    color: #f8eee0;
    font-family: "Cinzel", serif;
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.help-row {
    display: grid;
    grid-template-columns: 110px 1fr 1fr;
    align-items: center;
    gap: 8px;
}

.help-name {
    font-family: "Cinzel", serif;
    font-size: 0.82rem;
    color: var(--accent-2);
    min-width: 86px;
    text-align: right;
}

.help-buttons {
    grid-column: 2 / 4;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.leaflet-marker-icon {
    transition: transform 0.1s linear;
    transform-origin: center center;
}

.plane-icon {
    font-size: 35px;
    transition: transform 0.1s linear, opacity 0.8s ease, scale 0.8s ease;
    transform-origin: center center;
}

.plane-fade-out {
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

@keyframes softBounce {
    0% { transform: translateY(0); }
    30% { transform: translateY(-12px); }
    50% { transform: translateY(0); }
    70% { transform: translateY(-6px); }
    100% { transform: translateY(0); }
}

.pin-bounce {
    animation: softBounce 1s ease-out;
    font-size: 36px;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.gallery img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 12px;
}

@media (max-width: 900px) {
    .crossfade-section::after {
        width: 82px;
        height: 82px;
        font-size: 0.52rem;
        top: 16px;
        right: 10px;
    }

    .card0,
    .card1,
    .card2,
    .card3,
    .date-overlay {
        width: min(95vw, 640px);
        padding: 26px 18px;
    }

    .img-compare {
        height: 370px;
    }

    #map-container {
        height: 300px;
    }

    .bp-row {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-bottom: 12px;
    }

    .bp-flight-strip input {
        font-size: 0.9rem;
    }

    .boarding-pass {
        padding-right: 24px;
    }

    .boarding-pass::before {
        right: 12px;
    }

    .bp-title {
        margin: -14px -24px 14px -14px;
        padding: 10px 16px;
        font-size: 0.72rem;
    }

    .bg-polaroid {
        width: 180px;
        opacity: 0.32;
    }

    .p5,
    .p6 {
        display: none;
    }

    .airmail-divider {
        height: clamp(30px, 5vw, 44px);
    }
}

@media (max-width: 640px) {
    body::before {
        width: 180px;
        height: 180px;
        right: -55px;
        top: 14px;
    }

    h1 {
        font-size: 1.78rem;
    }

    h2 {
        font-size: 1.24rem;
    }

    p {
        font-size: 1.03rem;
    }

    .time-block {
        width: 74px;
    }

    .time-block span {
        font-size: 1.4rem;
    }

    .labels {
        font-size: 0.82rem;
    }

    .polaroid {
        width: min(100%, 220px);
    }

    #hero {
        padding-top: 62px;
        padding-bottom: 62px;
    }

    #hero.crossfade-section::after {
        top: 96px;
        right: 12px;
    }

    .bg-polaroid {
        width: 132px;
        opacity: 0.52;
    }

    .p1 { top: 2%; left: 4%; right: auto; }
    .p2 { top: 3%; right: 10%; }
    .p4 { top: 12%; left: 30%; }

    .p3 { bottom: 4%; right: 6%; }
    .p5 { display: block; top: auto; bottom: 7%; left: 4%; }
    .p6 { display: block; top: auto; bottom: 2%; left: 33%; }

    .wedding-timeline {
        max-width: 560px;
        padding: 0 4px;
    }

    .wedding-timeline::before {
        left: 12px;
    }

    .timeline-item {
        padding-left: 22px;
    }

    .timeline-item::before {
        left: 12px;
    }

    .timeline-time {
        width: 58px;
        margin-right: 0.5rem;
        font-size: 0.84rem;
    }

    .timeline-item p {
        font-size: 0.96rem;
    }

    .help-row {
        grid-template-columns: 96px 1fr;
        align-items: start;
    }

    .help-name {
        text-align: left;
        padding-top: 6px;
    }

    .help-buttons {
        grid-column: 2;
        grid-template-columns: 1fr;
    }

    .help-call {
        min-width: 0;
        width: 100%;
    }
}
