:root {
    --pink: #d64d79;
    --pink-dark: #bd3d67;
    --pink-light: #f8dce6;
    --pink-extra-light: #fff6f9;

    --green: #667747;
    --text: #524249;
    --muted: #8c737c;
    --white: #ffffff;
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(
            circle at top,
            #ffffff 0%,
            #fff8fa 50%,
            #fceaf0 100%
        );
    color: var(--text);
    font-family: "Montserrat", sans-serif;
}

body.lightbox-open {
    overflow: hidden;
}

button,
input {
    font: inherit;
}

.page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 35px 18px;
}

.wedding-card {
    width: 100%;
    max-width: 760px;
    position: relative;
    overflow: hidden;
    background: rgba(255,255,255,.95);
    border: 1px solid rgba(214,77,121,.12);
    border-radius: 34px;
    box-shadow: 0 30px 80px rgba(146, 67, 91, .13);
    text-align: center;
}

.wedding-card::before {
    content: "";
    position: absolute;
    width: 320px;
    height: 320px;
    background: rgba(214,77,121,.08);
    border-radius: 50%;
    top: -170px;
    left: -150px;
    filter: blur(10px);
}

.wedding-card::after {
    content: "";
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(102,119,71,.06);
    border-radius: 50%;
    bottom: -190px;
    right: -130px;
    filter: blur(10px);
}

.content {
    position: relative;
    z-index: 2;
    padding: 10px 55px 50px;
}

.floral-wrapper {
    position: relative;
    width: calc(100% + 110px);
    margin-left: -55px;
    margin-bottom: -5px;
}

.floral-image {
    width: 100%;
    display: block;
    max-height: 320px;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.date {
    text-transform: uppercase;
    letter-spacing: 5px;
    font-size: 11px;
    color: var(--pink);
    margin-bottom: 18px;
    font-weight: 600;
}

h1 {
    font-family: "Cormorant Garamond", serif;
    font-size: clamp(45px, 8vw, 67px);
    line-height: .92;
    font-weight: 500;
    letter-spacing: -2px;
    color: var(--pink-dark);
    max-width: 600px;
    margin: auto;
}

.subtitle {
    font-family: "Cormorant Garamond", serif;
    font-size: 23px;
    line-height: 1.45;
    color: #76636a;
    max-width: 510px;
    margin: 25px auto 31px;
}

.heart {
    color: var(--pink);
    display: inline-block;
    margin: 0 3px;
}

.separator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 13px;
    margin: 25px auto 30px;
    max-width: 250px;
}

.separator-line {
    height: 1px;
    background: rgba(214,77,121,.25);
    flex: 1;
}

.separator-flower {
    color: var(--pink);
    font-size: 13px;
}

.upload-box {
    position: relative;
    max-width: 520px;
    margin: auto;
    padding: 34px 24px;
    border: 1.5px dashed rgba(214,77,121,.45);
    border-radius: 24px;
    background:
        linear-gradient(
            145deg,
            rgba(255,255,255,.95),
            rgba(255,245,248,.85)
        );
    cursor: pointer;
    transition:
        transform .25s ease,
        border .25s ease,
        background .25s ease,
        box-shadow .25s ease;
}

.upload-box:hover,
.upload-box.dragging {
    transform: translateY(-3px);
    border-color: var(--pink);
    background: var(--pink-extra-light);
    box-shadow: 0 15px 35px rgba(214,77,121,.10);
}

.upload-icon {
    width: 66px;
    height: 66px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pink-light);
    color: var(--pink);
    font-size: 28px;
}

.upload-title {
    font-family: "Cormorant Garamond", serif;
    font-size: 29px;
    font-weight: 600;
    color: var(--pink-dark);
}

.upload-description {
    font-size: 13px;
    line-height: 1.7;
    color: var(--muted);
    margin-top: 7px;
}

#fileInput {
    display: none;
}

.upload-button {
    border: none;
    margin-top: 23px;
    padding: 15px 27px;
    border-radius: 100px;
    background: linear-gradient(135deg, var(--pink), var(--pink-dark));
    color: white;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .3px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(214,77,121,.24);
    transition: transform .2s ease, box-shadow .2s ease;
}

.upload-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(214,77,121,.32);
}

.supported {
    margin-top: 15px;
    color: #ad929b;
    font-size: 10px;
    letter-spacing: .5px;
    text-transform: uppercase;
}

.selected-files-wrap {
    display: none;
    max-width: 520px;
    margin: 18px auto 0;
    text-align: left;
}

.selected-files-wrap.visible {
    display: block;
}

.mini-title {
    margin-bottom: 9px;
    padding-left: 4px;
    text-transform: uppercase;
    letter-spacing: 1.3px;
    font-size: 9px;
    font-weight: 600;
    color: #aa838f;
}

.files {
    display: grid;
    gap: 9px;
}

.file {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #fff8fa;
    border: 1px solid #f4d6df;
}

.file-thumb {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 11px;
    overflow: hidden;
    background: #f8dce6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pink);
    font-size: 17px;
}

.file-thumb img,
.file-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-info {
    min-width: 0;
    flex: 1;
}

.file-name {
    font-size: 12px;
    font-weight: 500;
    color: #614e55;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 10px;
    color: #ad929b;
    margin-top: 3px;
}

.file-check {
    color: var(--pink);
    font-weight: 600;
}

.gallery-separator {
    margin-top: 48px;
    margin-bottom: 38px;
}

.memories-section {
    max-width: 620px;
    margin: 0 auto;
}

.section-kicker {
    color: var(--pink);
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 3px;
    font-weight: 600;
    margin-bottom: 8px;
}

h2 {
    font-family: "Cormorant Garamond", serif;
    color: var(--pink-dark);
    font-size: clamp(36px, 7vw, 50px);
    font-weight: 500;
    line-height: 1;
}

.gallery-intro {
    max-width: 480px;
    margin: 15px auto 25px;
    color: var(--muted);
    font-family: "Cormorant Garamond", serif;
    font-size: 20px;
    line-height: 1.45;
}

.gallery-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin: 0 3px 13px;
}

.gallery-count {
    font-size: 10px;
    color: #a68791;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.refresh-button {
    border: 0;
    background: transparent;
    color: var(--pink);
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 145px;
    gap: 8px;
}

.gallery-item {
    position: relative;
    border: 0;
    padding: 0;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    background: #faedf1;
    min-width: 0;
    box-shadow: inset 0 0 0 1px rgba(214,77,121,.08);
}

.gallery-item:nth-child(5n + 1) {
    grid-row: span 2;
}

.gallery-item:nth-child(7n + 4) {
    grid-column: span 2;
}

.gallery-item img,
.gallery-item video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease, filter .35s ease;
}

.gallery-item:hover img,
.gallery-item:hover video {
    transform: scale(1.035);
    filter: saturate(1.05);
}

.gallery-item-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    padding: 11px;
    background: linear-gradient(to top, rgba(61,35,44,.45), transparent 55%);
    opacity: 0;
    transition: opacity .25s ease;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-author {
    color: white;
    font-size: 9px;
    text-shadow: 0 1px 8px rgba(0,0,0,.2);
}

.video-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 31px;
    height: 31px;
    border-radius: 50%;
    background: rgba(255,255,255,.88);
    color: var(--pink);
    font-size: 12px;
}

.gallery-empty {
    display: none;
    padding: 45px 15px;
    border: 1px dashed rgba(214,77,121,.3);
    border-radius: 18px;
    color: #9b7c86;
    font-family: "Cormorant Garamond", serif;
    font-size: 20px;
}

.gallery-empty.visible {
    display: block;
}

.gallery-empty-heart {
    color: var(--pink);
    font-size: 34px;
    margin-bottom: 8px;
}

.thanks {
    margin-top: 45px;
    font-family: "Cormorant Garamond", serif;
    font-size: 20px;
    font-style: italic;
    color: #7f696f;
}

.initials {
    margin-top: 15px;
    color: var(--pink);
    font-family: "Cormorant Garamond", serif;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 2px;
}

.privacy {
    max-width: 430px;
    margin: 21px auto 0;
    font-size: 10px;
    line-height: 1.6;
    color: #ad999f;
}

/* fullscreen gallery preview */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(45, 28, 34, .93);
    backdrop-filter: blur(8px);
    padding: 52px 65px 70px;
}

.lightbox.visible {
    display: flex;
}

.lightbox-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img,
.lightbox-content video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 14px;
    box-shadow: 0 25px 80px rgba(0,0,0,.25);
}

.lightbox-close,
.lightbox-nav {
    position: absolute;
    border: 0;
    background: rgba(255,255,255,.1);
    color: white;
    cursor: pointer;
    backdrop-filter: blur(7px);
}

.lightbox-close {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    right: 20px;
    top: 18px;
    font-size: 28px;
    line-height: 1;
}

.lightbox-nav {
    width: 44px;
    height: 60px;
    border-radius: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 38px;
    line-height: 1;
}

.lightbox-prev {
    left: 15px;
}

.lightbox-next {
    right: 15px;
}

.lightbox-caption {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 50px);
    color: rgba(255,255,255,.8);
    font-size: 11px;
    text-align: center;
    letter-spacing: .3px;
}

@media(max-width: 600px) {
    .page {
        padding: 0;
        align-items: flex-start;
    }

    .wedding-card {
        min-height: 100vh;
        border-radius: 0;
        border: none;
        box-shadow: none;
    }

    .content {
        padding: 0 17px 40px;
    }

    .floral-wrapper {
        width: calc(100% + 34px);
        margin-left: -17px;
        margin-top: 8px;
    }

    .floral-image {
        max-height: 260px;
    }

    .date {
        margin-top: -2px;
        letter-spacing: 4px;
    }

    h1 {
        font-size: 48px;
    }

    .subtitle {
        font-size: 20px;
        padding: 0 5px;
        margin-top: 20px;
    }

    .upload-box {
        padding: 28px 18px;
    }

    .upload-title {
        font-size: 26px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 150px;
        gap: 6px;
    }

    .gallery-item:nth-child(7n + 4) {
        grid-column: span 1;
    }

    .gallery-item:nth-child(5n + 1) {
        grid-row: span 2;
    }

    .gallery-item-overlay {
        opacity: 1;
        background: linear-gradient(to top, rgba(61,35,44,.36), transparent 45%);
    }

    .lightbox {
        padding: 58px 10px 65px;
    }

    .lightbox-nav {
        top: auto;
        bottom: 12px;
        transform: none;
        width: 44px;
        height: 44px;
        border-radius: 50%;
    }

    .lightbox-prev {
        left: 18px;
    }

    .lightbox-next {
        right: 18px;
    }

    .lightbox-caption {
        bottom: 25px;
        max-width: calc(100% - 150px);
    }
}
