:root {
    --bg: #f7f3ef;
    --card: #fffdfb;
    --text: #302925;
    --muted: #7d716b;
    --accent: #8b6257;
    --dark: #6e4a42;
    --line: #e9dfd8;
    --soft: #efe5df
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, sans-serif
}

.page {
    width: 100%;
    max-width: 720px;
    margin: auto;
    padding: 32px 18px 28px
}

.hero {
    text-align: center;
    padding: 18px 8px 26px
}

.eyebrow {
    margin: 0 0 12px;
    font-size: 11px;
    letter-spacing: 2.5px;
    color: var(--muted);
    font-weight: 700
}

.hero h1 {
    margin: 0;
    font: 400 clamp(42px, 12vw, 68px)/1 Georgia, serif
}

.hero h1 span {
    font-style: italic;
    color: var(--accent)
}

.date {
    margin: 14px 0 0;
    font: 18px Georgia, serif
}

.intro {
    max-width: 500px;
    margin: 18px auto 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.65
}

.upload-card,
.gallery {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 24px 18px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(70, 50, 40, .05)
}

.icon {
    width: 54px;
    height: 54px;
    margin: 0 auto 14px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--soft);
    color: var(--accent);
    font: 28px Georgia, serif
}

.upload-card h2,
.gallery h2 {
    margin: 0;
    font: 400 27px Georgia, serif
}

.hint,
.gallery p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5
}

.choose,
.upload {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 52px;
    margin-top: 20px;
    border: 0;
    border-radius: 14px;
    background: var(--accent);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer
}

.choose span {
    font-size: 20px
}

#input {
    display: none
}

.preview {
    margin-top: 22px
}

.head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px
}

.head strong {
    font-size: 14px
}

.clear {
    border: 0;
    background: transparent;
    color: var(--dark);
    font-weight: 700;
    cursor: pointer
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px
}

.item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 10px;
    background: #eee
}

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

.remove {
    position: absolute;
    right: 5px;
    top: 5px;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .68);
    color: #fff;
    font-size: 18px;
    cursor: pointer
}

.upload {
    background: var(--dark)
}

.upload:disabled {
    opacity: .45;
    cursor: not-allowed
}

.status {
    min-height: 20px;
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5
}

.gallery {
    margin-top: 18px;
    padding: 26px 18px
}

.gallery button {
    min-height: 50px;
    padding: 12px 20px;
    border: 0;
    border-radius: 14px;
    background: var(--soft);
    color: var(--dark);
    font-weight: 700;
    cursor: pointer
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 18px;
    text-align: left
}

.gallery-photo {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border: 0;
    border-radius: 10px;
    background: #eee;
    cursor: pointer
}

.gallery-photo:active {
    transform: scale(.985)
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 16, 14, .94);
    padding: 50px 42px
}

.lightbox img {
    max-width: 100%;
    max-height: calc(100vh - 90px);
    object-fit: contain;
    border-radius: 8px
}

.lightbox-close,
.lightbox-nav {
    position: fixed;
    border: 0;
    color: #fff;
    background: rgba(255, 255, 255, .13);
    cursor: pointer;
    border-radius: 50%;
    display: grid;
    place-items: center
}

.lightbox-close {
    right: 16px;
    top: 16px;
    width: 44px;
    height: 44px;
    font-size: 32px;
    line-height: 1
}

.lightbox-nav {
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    font-size: 38px;
    line-height: 1
}

.lightbox-nav.prev {
    left: 12px
}

.lightbox-nav.next {
    right: 12px
}

.gallery-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 18px 8px;
    color: var(--muted);
    font-size: 14px
}

.gallery-loading {
    padding: 10px;
    color: var(--muted);
    font-size: 13px
}

@media(min-width:520px) {
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr)
    }
}

footer {
    text-align: center;
    padding: 24px 8px 0;
    color: var(--muted);
    font-size: 12px
}

footer p {
    margin: 0 0 9px
}

footer a {
    color: var(--dark);
    text-decoration: none;
    font-weight: 700
}

.hidden {
    display: none
}

@media(min-width:520px) {
    .page {
        padding-top: 46px
    }

    .grid {
        grid-template-columns: repeat(4, 1fr)
    }
}