:root {
    --serif: 'Cormorant Garamond', Georgia, serif;
    --sans: 'Jost', system-ui, sans-serif;
    --polaroid-bg: #f7f3ec;
    --polaroid-shadow-1: 0 2px 8px rgba(0, 0, 0, 0.12);
    --polaroid-shadow-2: 0 8px 32px rgba(0, 0, 0, 0.14);
    --polaroid-shadow-3: 0 1px 3px rgba(0, 0, 0, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.07);
    --glass-border: rgba(255, 255, 255, 0.16);
    --glass-blur: 22px;
    --radius-lg: 2rem;
    --radius-md: 1.5rem;
    --radius-sm: 1rem;
    --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --transition-slow: 1.2s;
    --transition-med: 0.8s;
    --transition-fast: 0.4s;
}

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

html {
    height: 100vh;
    height: -webkit-fill-available;
}
body {
    font-family: var(--sans);
    font-size: 1.1rem;
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
    height: -webkit-fill-available;
    height: 100dvh;
    width: 100vw;
    color: #fff;
    user-select: none;
    background: #0b0b15;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==================== GPU SKY BACKGROUND (crossfade) ==================== */
#sky-bg-container {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background: #0b0b15;
}
.sky-bg-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.9s ease-in-out;
    will-change: opacity;
    background-size: cover;
    background-position: center;
}
.sky-bg-layer.active {
    opacity: 1;
}

#bg-canvas,
#stars-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}
#stars-canvas {
    z-index: 1;
    opacity: 0;
    transition: opacity 1.8s ease;
}

#scroll-container {
    position: relative;
    z-index: 2;
    width: 100vw;
    height: 100vh;
    height: -webkit-fill-available;
    height: 100dvh;
    overflow: hidden;
}

#slides-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transition: transform 0.9s var(--ease-smooth);
    will-change: transform;
}
#slides-wrapper.horizontal-mode {
    display: flex;
    flex-direction: row;
    height: 100%;
}
#slides-wrapper.vertical-mode {
    display: flex;
    flex-direction: column;
}

section {
    width: 100vw;
    min-height: 100vh;
    min-height: 100dvh;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 4rem 2rem;
    position: relative;
    overflow: hidden;
}
#slides-wrapper.horizontal-mode section {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
}

/* ============ GLASS PANELS (UNIFIED) ============ */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: box-shadow var(--transition-fast) ease, transform var(--transition-fast) ease;
}
.glass:hover {
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.dark-glass {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 28px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    color: #1a1a1a;
}
.dark-glass h3 {
    color: #1a1a1a !important;
}
.dark-glass p:not(.venue-gift-lead) {
    color: #1a1a1a !important;
}
.dark-glass .venue-gift-lead {
    color: #9a5b3c !important;
}
.dark-glass strong {
    color: #000;
}

/* ============ POLAROID CARDS ============ */
.polaroid-card {
    background: var(--polaroid-bg);
    border-radius: 0.18rem 0.18rem 0.55rem 0.55rem;
    box-shadow:
        var(--polaroid-shadow-1),
        var(--polaroid-shadow-2),
        var(--polaroid-shadow-3),
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        inset 0 -1px 0 rgba(0, 0, 0, 0.04);
    position: relative;
    transition: transform 0.5s var(--ease-smooth), box-shadow 0.5s var(--ease-smooth);
    will-change: transform;
    z-index: 1;
    overflow: hidden;
}
.polaroid-card::before {
    content: '';
    display: block;
    position: absolute;
    inset: 0.4rem;
    border-radius: 0.08rem;
    background: linear-gradient(150deg,
            rgba(255, 255, 255, 0.55) 0%,
            rgba(255, 255, 255, 0.12) 18%,
            transparent 42%,
            rgba(255, 255, 255, 0.04) 68%,
            rgba(255, 255, 255, 0.28) 100%);
    pointer-events: none;
    z-index: 3;
    opacity: 0.9;
}
.polaroid-card::after {
    content: '';
    position: absolute;
    left: 8%;
    right: 8%;
    bottom: 0.55rem;
    height: 0.4rem;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(180, 170, 155, 0.35) 25%,
            rgba(180, 170, 155, 0.5) 50%,
            rgba(180, 170, 155, 0.35) 75%,
            transparent 100%);
    border-radius: 2px;
    pointer-events: none;
    z-index: 3;
}
.polaroid-card img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 0.06rem;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06), inset 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 1;
    transition: filter 0.6s ease;
}
.polaroid-card:hover {
    box-shadow:
        0 6px 18px rgba(0, 0, 0, 0.16),
        0 16px 48px rgba(0, 0, 0, 0.18),
        0 2px 6px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        inset 0 -1px 0 rgba(0, 0, 0, 0.04);
}
/* Only the hero polaroid lifts on hover — child photos must not move on hover */
.hero-photo-desktop.polaroid-card:hover {
    transform: translateY(-6px) rotate(0deg) !important;
}

/* Hero polaroid on desktop — rules in desktop.css */
.hero-photo-desktop {
    display: none;
}

/* Child polaroids on intro slide */
.child-photo {
    position: absolute;
    width: clamp(140px, 17vw, 220px);
    padding: 0.6rem 0.6rem 2rem 0.6rem;
    z-index: 1;
    opacity: 0;
    transform: translateY(60px) perspective(800px) rotateX(20deg) rotateZ(0deg);
    transition: opacity 1.1s ease 0.5s, transform 0.84s var(--ease-smooth), width 0.84s var(--ease-smooth), box-shadow 0.84s var(--ease-smooth);
    will-change: transform;
}
.child-photo img {
    aspect-ratio: 1/1;
    object-fit: cover;
    width: 100%;
    height: auto;
}
#s1.active .child-photo {
    opacity: 1;
    transform: translateY(0) perspective(800px) rotateX(6deg) rotateZ(var(--rot));
}
.child-photo-left {
    left: 5vw;
    top: 8%;
    --rot: -4deg;
}
.child-photo-right {
    right: 5vw;
    top: 50%;
    --rot: 4deg;
}

/* ============ HERO ============ */
.hero-section {
    position: relative;
    overflow: hidden;
}
.hero-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 4vh;
}
.hero-photo-bg {
    display: none;
}

/* Polaroid drop keyframes (shared) */
@keyframes polaroidDrop {
    0% {
        opacity: 0;
        transform: translateY(-50%) translateY(-260px) rotate(-6deg) scale(0.72);
        filter: brightness(3.5) blur(12px);
    }
    18% {
        opacity: 1;
        filter: brightness(2.2) blur(4px);
        transform: translateY(-50%) translateY(30px) rotate(-2deg) scale(1.06);
    }
    40% {
        filter: brightness(1) blur(0);
        transform: translateY(-50%) translateY(-10px) rotate(-1.8deg) scale(0.96);
    }
    62% {
        transform: translateY(-50%) translateY(5px) rotate(-1.5deg) scale(1.02);
    }
    80% {
        transform: translateY(-50%) translateY(-2px) rotate(-1.3deg) scale(0.99);
    }
    100% {
        opacity: 1;
        transform: translateY(-50%) translateY(0) rotate(-1.2deg) scale(1);
        filter: brightness(1) blur(0);
    }
}
@keyframes polaroidFlyOut {
    0% {
        opacity: 1;
        transform: translateY(-50%) translateY(0) rotate(-1.2deg) scale(1);
        filter: brightness(1) blur(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-50%) translateY(-15px) rotate(0deg) scale(1.04);
        filter: brightness(1.4) blur(1px);
    }
    100% {
        opacity: 0;
        transform: translateY(-50%) translateY(-280px) rotate(8deg) scale(0.55);
        filter: brightness(3.8) blur(14px);
    }
}

.countdown {
    display: flex;
    gap: 1.6rem;
    justify-content: center;
    position: absolute;
    bottom: 3rem;
    left: 0;
    width: 100%;
    transform: translateY(30px);
    opacity: 0;
    transition: opacity 1.1s ease 0.55s, transform 1.1s var(--ease-smooth) 0.55s;
    z-index: 4;
}
.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
}
.countdown-num {
    font-family: var(--serif);
    font-size: clamp(1.8rem, 4.5vw, 3.2rem);
    font-weight: 300;
    line-height: 1;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 2px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}
.countdown-label {
    font-size: 0.5rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 500;
}
.countdown-sep {
    font-size: clamp(1.3rem, 2.5vw, 1.9rem);
    color: rgba(255, 255, 255, 0.3);
    font-weight: 100;
    align-self: center;
    padding-bottom: 0.7rem;
}

.hero-eyebrow {
    font-family: var(--sans);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 8px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    opacity: 0;
    transform: translateY(-36px);
    transition: opacity 0.9s ease, transform 0.9s var(--ease-smooth);
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    z-index: 3;
}
.hero-names {
    font-family: var(--serif);
    font-size: clamp(4rem, 11vw, 10rem);
    font-weight: 300;
    line-height: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}
.names-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    line-height: 0.88;
}
.names-col .name-and {
    font-size: 0.36em;
    line-height: 1;
    position: relative;
    top: -0.04em;
    left: 0.35em;
    z-index: 2;
    filter: blur(1.2px);
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.08em;
}
.names-col .name-left {
    margin-bottom: -0.16em;
}
.names-col .name-right {
    margin-top: -0.16em;
}
.name-left {
    opacity: 0;
    transform: translateX(-180px) scale(0.82);
    filter: blur(5px);
    transition: opacity 2s ease 0.12s, transform 2s var(--ease-smooth) 0.12s, filter 2s ease 0.12s;
}
.name-right {
    opacity: 0;
    transform: translateX(180px) scale(0.82);
    filter: blur(5px);
    transition: opacity 2s ease 0.12s, transform 2s var(--ease-smooth) 0.12s, filter 2s ease 0.12s;
}
.name-and {
    font-style: italic;
    font-weight: 300;
    font-size: 0.52em;
    color: rgba(255, 255, 255, 0.7);
    opacity: 0;
    transform: scale(0.25) rotate(-10deg);
    filter: blur(4px);
    transition: opacity 1.4s ease 0.55s, transform 1.4s var(--ease-bounce) 0.55s, filter 1.4s ease 0.55s;
}
.hero-date-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    opacity: 0;
    transform: translateY(-26px);
    transition: opacity 1.1s ease 0.35s, transform 1.1s var(--ease-smooth) 0.35s;
}
.hero-date-address {
    font-family: var(--sans);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 6px;
    text-transform: uppercase;
    color: #87c3eb;
}
.hero-date-sep {
    color: rgba(135, 195, 235, 0.4);
    font-size: 0.65rem;
}
.date-wrapper {
    position: relative;
    display: inline-block;
    cursor: default;
    z-index: 3;
}
.date-trigger {
    font-family: var(--sans);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 6px;
    text-transform: uppercase;
    color: #87c3eb;
    border-bottom: 1px dashed rgba(135, 195, 235, 0.4);
    padding-bottom: 1px;
    transition: color 0.25s;
}
.date-wrapper:hover .date-trigger {
    color: #a8d4f5;
    border-bottom-color: rgba(135, 195, 235, 0.8);
}
.mini-cal {
    position: absolute;
    bottom: auto;
    top: calc(100% + 0.7rem);
    left: 50%;
    transform: translateX(-50%) scale(0.94) translateY(-12px);
    background: rgba(240, 245, 252, 0.94);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 1.5rem;
    padding: 1.4rem 1.6rem;
    width: 320px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.5s var(--ease-smooth);
    color: #1e2a3a;
    z-index: 60;
    box-shadow: 0 20px 50px rgba(0, 30, 60, 0.2);
    overflow: hidden;
}
.date-wrapper:hover .mini-cal,
.date-wrapper.open .mini-cal {
    opacity: 1;
    transform: translateX(-50%) scale(1) translateY(0);
    pointer-events: auto;
}
.cal-month {
    font-family: var(--serif);
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 0.7rem;
    color: #0b2b4f;
    font-weight: 600;
}
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    text-align: center;
    font-size: 0.78rem;
    justify-items: center;
    align-items: center;
}
.cal-hd {
    font-weight: 700;
    color: #3b6e9e;
    padding: 3px 0;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}
.cal-d {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 500;
    color: #1e3b5a;
    transition: background 0.2s;
    margin: 0;
    line-height: 1;
    background: transparent;
}
.cal-d.heart-day {
    position: relative;
    background: transparent !important;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulseHeart 2s ease-in-out infinite;
}
.cal-d.heart-day::before {
    content: "\f004";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    font-size: 1.8rem;
    color: #ff4d6d;
    opacity: 0.9;
    z-index: 0;
    pointer-events: none;
}
.cal-d.heart-day span {
    position: relative;
    z-index: 1;
    font-weight: 700;
    color: #fff !important;
    text-shadow: none;
    background: transparent;
}
@keyframes pulseHeart {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* ============ INTRO / STORY PANELS ============ */
.intro-content {
    max-width: 850px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
    position: relative;
    z-index: 2;
}
.intro-tag {
    font-size: 0.65rem;
    letter-spacing: 9px;
    text-transform: uppercase;
    font-weight: 600;
    opacity: 0;
    transform: translateY(-28px);
    transition: all 0.8s var(--ease-smooth);
}
.intro-heading {
    font-family: var(--serif);
    font-size: clamp(2rem, 4.5vw, 3.8rem);
    font-weight: 400;
    font-style: italic;
    line-height: 1.2;
    opacity: 0;
    transform: translateX(-70px);
    transition: all 1s var(--ease-smooth) 0.1s;
}
.intro-body {
    font-size: 1.15rem;
    font-weight: 300;
    line-height: 1.7;
    opacity: 0;
    transform: translateX(70px);
    transition: all 1s var(--ease-smooth) 0.2s;
}
.story-panel {
    max-width: 900px;
    width: 100%;
    padding: 2.5rem 2.6rem;
}
.story-panel h3 {
    font-family: var(--serif);
    font-size: clamp(2.2rem, 4.5vw, 3.5rem);
    font-weight: 400;
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(-40px);
    transition: all 0.9s var(--ease-smooth);
}
.story-panel p {
    font-size: 1.1rem;
    font-weight: 300;
    line-height: 1.65;
    opacity: 0;
    transform: translateY(35px);
    transition: all 0.9s var(--ease-smooth) 0.15s;
}
.venue-gift-lead {
    font-family: var(--serif);
    font-style: italic;
    font-size: 1.4rem;
    font-weight: 400;
    line-height: 1.5;
    margin-bottom: 0.8rem;
    color: #9a5b3c;
}
