@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --cream: #f7f2eb;
    --paper: #fffdf9;
    --ink: #2b2825;
    --muted: #766f68;
    --line: rgba(43, 40, 37, .12);
    --accent: #8a665b;
    --accent-dark: #6f4f46;
    --shadow: 0 18px 50px rgba(45, 35, 30, .10);
    --radius: 22px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--cream);
    color: var(--ink);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
}

a { color: inherit; }

.hero {
    min-height: 68vh;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 80px 20px;
    background:
        radial-gradient(circle at 15% 25%, rgba(255,255,255,.9), transparent 28%),
        radial-gradient(circle at 85% 20%, rgba(215,197,184,.45), transparent 30%),
        linear-gradient(145deg, #faf7f2 0%, #eee2d9 100%);
    border-bottom: 1px solid var(--line);
}

.hero-inner {
    max-width: 900px;
}

.eyebrow,
.section-kicker {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .24em;
    color: var(--accent);
}

.hero h1 {
    margin: 12px 0 0;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: clamp(4rem, 11vw, 8.4rem);
    font-weight: 600;
    line-height: .86;
    letter-spacing: -.04em;
}

.heart {
    color: var(--accent);
    margin: 20px 0 6px;
    font-size: 1.25rem;
}

.subtitle {
    margin: 0;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: clamp(1.8rem, 4vw, 3rem);
}

.date {
    margin: 8px 0 0;
    color: var(--muted);
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 34px;
    flex-wrap: wrap;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 0 22px;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: .18s ease;
}

.button:hover { transform: translateY(-1px); }

.button:disabled {
    opacity: .65;
    cursor: wait;
    transform: none;
}

.button-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 10px 24px rgba(111, 79, 70, .22);
}

.button-primary:hover { background: var(--accent-dark); }

.button-light {
    background: rgba(255,255,255,.78);
    border: 1px solid rgba(43,40,37,.12);
}

.button-wide {
    width: 100%;
    margin-top: 18px;
}

main {
    width: min(1220px, calc(100% - 34px));
    margin: 0 auto;
}

.welcome {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 36px;
    padding: 70px 0 46px;
}

.welcome h2,
.section-heading h2,
.small-header h1,
.empty-state h3 {
    font-family: "Cormorant Garamond", Georgia, serif;
    line-height: 1;
}

.welcome h2,
.section-heading h2 {
    margin: 8px 0 12px;
    font-size: clamp(2.4rem, 5vw, 4rem);
}

.welcome p {
    max-width: 720px;
    color: var(--muted);
    margin-bottom: 0;
}

.photo-count {
    min-width: 180px;
    padding: 22px 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255,255,255,.45);
    text-align: center;
}

.photo-count strong {
    display: block;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 3.2rem;
    line-height: 1;
}

.photo-count span {
    color: var(--muted);
    font-size: .86rem;
}

.gallery-section {
    padding-bottom: 80px;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.text-link {
    font-weight: 700;
    color: var(--accent-dark);
    text-decoration: none;
    white-space: nowrap;
}

.gallery {
    columns: 4 240px;
    column-gap: 14px;
}

.photo-card {
    position: relative;
    display: block;
    break-inside: avoid;
    margin-bottom: 14px;
    border-radius: 16px;
    overflow: hidden;
    background: #e7ddd5;
    box-shadow: 0 8px 22px rgba(40, 30, 25, .08);
}

.photo-card img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform .25s ease, filter .25s ease;
}

.photo-card:hover img {
    transform: scale(1.015);
    filter: brightness(.94);
}

.photo-by {
    position: absolute;
    left: 10px;
    bottom: 10px;
    max-width: calc(100% - 20px);
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(25, 22, 20, .70);
    color: white;
    font-size: .72rem;
    backdrop-filter: blur(8px);
}

.empty-state {
    text-align: center;
    padding: 70px 24px;
    border: 1px dashed rgba(43,40,37,.25);
    border-radius: var(--radius);
    background: rgba(255,255,255,.38);
}

.empty-icon {
    color: var(--accent);
    font-size: 2.4rem;
}

.empty-state h3 {
    margin: 8px 0;
    font-size: 2.4rem;
}

.empty-state p {
    color: var(--muted);
    margin: 0 auto 24px;
    max-width: 520px;
}

.notice {
    border-radius: 16px;
    padding: 15px 18px;
    margin: 0 0 26px;
}

.notice.success {
    background: #edf7ef;
    border: 1px solid #cde7d1;
}

.notice.error {
    background: #fff0ee;
    border: 1px solid #efc8c2;
}

.notice ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

footer {
    padding: 34px 20px 48px;
    text-align: center;
    border-top: 1px solid var(--line);
    color: var(--muted);
}

footer strong,
footer span {
    display: block;
}

.footer-heart {
    color: var(--accent);
    margin-bottom: 8px;
}

/* Upload page */
.inner-page {
    min-height: 100vh;
}

.small-header {
    padding: 36px max(22px, calc((100vw - 760px) / 2)) 24px;
}

.small-header h1 {
    font-size: clamp(3rem, 8vw, 5rem);
    margin: 8px 0 8px;
}

.small-header p {
    margin: 0;
    color: var(--muted);
}

.back-link {
    display: inline-block;
    margin-bottom: 40px;
    color: var(--accent-dark);
    text-decoration: none;
    font-weight: 700;
}

.narrow {
    width: min(760px, calc(100% - 34px));
    margin: 0 auto 70px;
}

.upload-card {
    padding: clamp(22px, 5vw, 42px);
    border-radius: 28px;
    background: var(--paper);
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
}

.upload-card > label {
    display: block;
    font-weight: 700;
    margin: 0 0 8px;
}

.optional {
    color: var(--muted);
    font-weight: 400;
}

input[type="text"],
textarea {
    width: 100%;
    border: 1px solid rgba(43,40,37,.20);
    border-radius: 14px;
    padding: 14px 15px;
    font: inherit;
    background: white;
    margin-bottom: 20px;
    outline: none;
}

input[type="text"]:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(138,102,91,.11);
}

.file-picker {
    margin-top: 4px;
}

.file-picker input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.file-picker-button {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 24px;
    border: 2px dashed rgba(138,102,91,.38);
    border-radius: 20px;
    background: #fbf7f2;
    cursor: pointer;
    text-align: center;
}

.file-picker-button:hover {
    border-color: var(--accent);
}

.file-picker-button .camera {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    margin-bottom: 5px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    font-size: 1.8rem;
}

.file-picker-button small {
    color: var(--muted);
}

.selection-text {
    margin-top: 10px;
    color: var(--muted);
    text-align: center;
    font-size: .88rem;
}

.upload-note {
    margin: 18px 0 0;
    text-align: center;
    color: var(--muted);
    font-size: .82rem;
}

.upload-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    padding: 14px;
    border-radius: 14px;
    background: #f4eee8;
}

.upload-progress span {
    display: block;
    color: var(--muted);
    font-size: .82rem;
}

.spinner {
    width: 26px;
    height: 26px;
    border: 3px solid rgba(138,102,91,.18);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Photo viewer */
.viewer-page {
    min-height: 100vh;
    background: #171717;
    color: white;
    overflow-x: hidden;
}

.viewer-topbar {
    min-height: 64px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    background: rgba(18,18,18,.96);
}

.viewer-topbar a {
    color: white;
    text-decoration: none;
    font-size: .9rem;
}

.viewer-title {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 1.5rem;
}

.viewer-download {
    justify-self: end;
}

.viewer {
    position: relative;
    width: 100%;
    min-height: calc(100vh - 150px);
    display: grid;
    place-items: center;
    padding: 18px 64px;
}

.viewer-image {
    display: block;
    max-width: min(100%, 1500px);
    max-height: calc(100vh - 190px);
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 18px 70px rgba(0,0,0,.35);
}

.viewer-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 46px;
    height: 66px;
    display: grid;
    place-items: center;
    color: white;
    text-decoration: none;
    border-radius: 12px;
    background: rgba(255,255,255,.10);
    font-size: 3rem;
    line-height: 1;
}

.viewer-prev { left: 10px; }
.viewer-next { right: 10px; }

.viewer-caption {
    min-height: 70px;
    padding: 12px 20px 24px;
    text-align: center;
}

.viewer-caption strong,
.viewer-caption span {
    display: block;
}

.viewer-caption span {
    color: rgba(255,255,255,.66);
    font-size: .86rem;
}

@media (max-width: 700px) {
    .hero {
        min-height: 62vh;
        padding-top: 64px;
        padding-bottom: 64px;
    }

    .welcome {
        grid-template-columns: 1fr;
        gap: 20px;
        padding-top: 48px;
    }

    .photo-count {
        min-width: 0;
    }

    .section-heading {
        align-items: center;
    }

    .gallery {
        columns: 2 145px;
        column-gap: 8px;
    }

    .photo-card {
        margin-bottom: 8px;
        border-radius: 11px;
    }

    .photo-by {
        display: none;
    }

    .viewer-topbar {
        grid-template-columns: 1fr 1fr;
    }

    .viewer-title {
        display: none;
    }

    .viewer {
        min-height: calc(100vh - 145px);
        padding: 8px;
    }

    .viewer-arrow {
        display: none;
    }

    .viewer-image {
        max-height: calc(100vh - 180px);
    }
}


/* QR upload invitation */
.qr-share-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 42px;
    margin: 4px 0 64px;
    padding: clamp(24px, 5vw, 46px);
    border: 1px solid var(--line);
    border-radius: 28px;
    background: var(--paper);
    box-shadow: var(--shadow);
}

.qr-share-copy h2 {
    margin: 8px 0 12px;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: clamp(2.4rem, 5vw, 4rem);
    line-height: 1;
}

.qr-share-copy p {
    max-width: 650px;
    margin: 0 0 22px;
    color: var(--muted);
}

.qr-card {
    width: min(260px, 32vw);
    min-width: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 18px;
    border-radius: 22px;
    background: #fff;
    border: 1px solid var(--line);
    text-align: center;
    text-decoration: none;
}

.qr-card img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    border-radius: 12px;
}

.qr-card strong {
    margin-top: 10px;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 1.45rem;
}

.qr-card span {
    max-width: 100%;
    color: var(--muted);
    font-size: .72rem;
    overflow-wrap: anywhere;
}


@media (max-width: 700px) {
    .qr-share-section {
        grid-template-columns: 1fr;
        gap: 26px;
        text-align: center;
    }

    .qr-share-copy p {
        margin-left: auto;
        margin-right: auto;
    }

    .qr-card {
        width: min(290px, 100%);
        min-width: 0;
        margin: 0 auto;
    }
}


.viewer-admin-actions {
    margin-top: 14px;
}

.delete-link {
    display: inline-block;
    color: #f4b7ad;
    font-size: .84rem;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.delete-card {
    padding: clamp(22px, 5vw, 38px);
    border-radius: 28px;
    background: var(--paper);
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
}

.delete-preview {
    display: block;
    max-width: 320px;
    width: 100%;
    height: auto;
    margin: 0 auto 24px;
    border-radius: 16px;
}

.delete-card label {
    display: block;
    font-weight: 700;
    margin: 22px 0 8px;
}

.delete-card input[type="password"] {
    width: 100%;
    border: 1px solid rgba(43,40,37,.20);
    border-radius: 14px;
    padding: 14px 15px;
    font: inherit;
    background: white;
    outline: none;
}

.delete-card input[type="password"]:focus {
    border-color: #a14e43;
    box-shadow: 0 0 0 3px rgba(161,78,67,.11);
}

.danger-button {
    background: #a14e43;
    color: white;
}

.danger-button:hover {
    background: #873d34;
}

.cancel-delete {
    display: block;
    margin-top: 16px;
    text-align: center;
    color: var(--muted);
}


.upload-progress-detailed {
    display: block;
}

.progress-status-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-copy {
    min-width: 0;
    flex: 1;
}

.progress-copy strong,
.progress-copy span {
    display: block;
}

.progress-copy span {
    color: var(--muted);
    font-size: .82rem;
    overflow-wrap: anywhere;
}

.progress-track {
    width: 100%;
    height: 12px;
    margin-top: 14px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(138,102,91,.14);
}

.progress-bar {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
    transition: width .18s ease;
}

.progress-numbers {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 7px;
    color: var(--muted);
    font-size: .78rem;
}


.notice.duplicate {
    background: #fff7df;
    border: 1px solid #ead7a0;
}
