:root {
    color-scheme: light;
    --ink: #221f1d;
    --muted: #756d66;
    --line: #ded4ca;
    --paper: #fffaf5;
    --soft: #f6eee7;
    --accent: #7b3f4b;
    --accent-dark: #562831;
    --green: #2f6f67;
    --rose: #b85e73;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(184, 94, 115, 0.12), transparent 34rem),
        linear-gradient(180deg, #fffaf5 0%, #fffdf9 48%, #f8f0e8 100%);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.modal-open {
    overflow: hidden;
}

button,
input {
    font: inherit;
}

.app-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 20px 0 56px;
}

.hero {
    min-height: 40vh;
    display: flex;
    align-items: center;
    margin: 0 -16px 24px;
    padding: 40px clamp(20px, 6vw, 72px);
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(31, 24, 22, 0.78), rgba(31, 24, 22, 0.2)),
        url("https://images.unsplash.com/photo-1523438885200-e635ba2c371e?auto=format&fit=crop&w=1800&q=82") center/cover;
    color: #fff;
    overflow: hidden;
}

.hero__content {
    max-width: 620px;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 12px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.65rem, 8vw, 5.8rem);
    line-height: 0.95;
    letter-spacing: 0;
    text-wrap: balance;
}

.lead {
    margin-bottom: 0;
    max-width: 680px;
    font-size: clamp(1rem, 2.2vw, 1.25rem);
    line-height: 1.55;
}

.upload-panel,
.gallery-section {
    padding: 24px 0;
}

.access-panel {
    width: min(420px, 100%);
    margin: 24px auto 48px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.86);
}

.access-panel h2 {
    margin-bottom: 8px;
}

.access-panel p {
    color: var(--muted);
    line-height: 1.45;
}

.access-panel form,
.access-panel label {
    display: grid;
    gap: 10px;
}

.access-panel input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.access-error {
    margin: 12px 0;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f8e8e8;
    color: #9a3434;
}

.stats-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: -8px 0 8px;
}

.stats-strip article {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
}

.stats-strip strong,
.stats-strip span {
    display: block;
}

.stats-strip strong {
    font-size: clamp(1.55rem, 6vw, 2.4rem);
    line-height: 1;
    color: var(--accent);
}

.stats-strip span {
    margin-top: 5px;
    color: var(--muted);
    font-size: 0.92rem;
}

.upload-panel {
    display: grid;
    gap: 16px;
}

.dropzone {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 230px;
    border: 2px dashed #cdb9b4;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.78);
    text-align: center;
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease;
}

.dropzone:hover,
.dropzone.is-dragover {
    border-color: var(--accent);
    background: #fff6f6;
}

.dropzone input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.dropzone strong {
    display: block;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.45rem, 4vw, 2.2rem);
    font-weight: 700;
}

.dropzone span,
.uploader span,
.queue-item__status,
.empty {
    color: var(--muted);
}

.wedding-loader {
    grid-column: 1 / -1;
    display: grid;
    place-items: center;
    gap: 12px;
    min-height: 120px;
    color: var(--muted);
}

.wedding-loader__rings {
    position: relative;
    width: 54px;
    height: 34px;
    animation: rings-spin 1.4s linear infinite;
}

.wedding-loader__rings span {
    position: absolute;
    top: 5px;
    width: 28px;
    height: 28px;
    border: 4px solid #d5a84f;
    border-radius: 50%;
    box-shadow: inset 0 0 0 2px rgba(255, 245, 200, 0.58), 0 2px 8px rgba(126, 86, 24, 0.22);
}

.wedding-loader__rings span:first-child {
    left: 4px;
}

.wedding-loader__rings span:last-child {
    right: 4px;
}

.wedding-loader strong {
    font-size: 0.95rem;
}

@keyframes rings-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.uploader {
    display: grid;
    gap: 8px;
    max-width: 420px;
}

.uploader input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.queue {
    display: grid;
    gap: 10px;
    margin-top: 18px;
    max-height: min(320px, 46vh);
    overflow-y: auto;
    padding-right: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(47, 111, 103, 0.55) transparent;
}

.upload-summary {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 14px 13px 42px;
    border: 1px solid rgba(47, 111, 103, 0.34);
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(47, 111, 103, 0.18), rgba(255, 255, 255, 0.95)),
        #f0faf6;
    color: #174641;
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(47, 111, 103, 0.16);
}

.upload-summary[hidden] {
    display: none;
}

.upload-summary__icon {
    color: #1f9d5a;
    font-size: 1.1rem;
}

.upload-summary::before {
    content: "";
    position: absolute;
    left: 14px;
    top: 50%;
    width: 14px;
    height: 14px;
    border: 3px solid #d5a84f;
    border-radius: 50%;
    transform: translateY(-50%);
    box-shadow: 9px 0 0 -3px #f7df94, 9px 0 0 0 #d5a84f;
}

.upload-summary.is-complete {
    border-color: rgba(47, 111, 103, 0.42);
    background:
        linear-gradient(90deg, rgba(47, 111, 103, 0.2), rgba(237, 247, 243, 0.98)),
        #edf7f3;
    color: var(--green);
}

.upload-summary.is-error {
    border-color: rgba(154, 52, 52, 0.35);
    background:
        linear-gradient(90deg, rgba(154, 52, 52, 0.16), rgba(248, 232, 232, 0.98)),
        #f8e8e8;
    color: #9a3434;
}

.queue:empty {
    display: none;
}

.queue::-webkit-scrollbar {
    width: 8px;
}

.queue::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(47, 111, 103, 0.55);
}

.queue-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px;
    gap: 16px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.queue-item__name,
.queue-item__status {
    display: block;
    overflow-wrap: anywhere;
}

progress {
    width: 100%;
    height: 12px;
    accent-color: var(--green);
}

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

h2 {
    margin-bottom: 0;
    font-size: 1.35rem;
}

.section-heading p {
    max-width: 620px;
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.45;
}

button {
    border: 0;
    border-radius: 8px;
    padding: 10px 14px;
    background: var(--green);
    color: #fff;
    cursor: pointer;
}

button:hover {
    background: #1f504a;
}

.gallery-controls {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-top: -4px;
}

.filter-button {
    flex: 0 0 auto;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.8);
    color: var(--ink);
}

.filter-button:hover,
.filter-button.is-active {
    border-color: var(--green);
    background: var(--green);
    color: #fff;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
    gap: 8px;
}

.media-card {
    appearance: none;
    display: block;
    padding: 0;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    cursor: pointer;
}

.media-card__preview {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    background: #e8e1d8;
    color: var(--muted);
}

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

.media-card.is-video .media-card__preview::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 42%, transparent 0 28%, rgba(0, 0, 0, 0.22) 29% 42%, transparent 43%),
        linear-gradient(180deg, rgba(20, 15, 13, 0.06), rgba(20, 15, 13, 0.32));
    pointer-events: none;
}

.media-card__video-thumb {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0 24%, transparent 25% 100%),
        linear-gradient(160deg, #f3efe8, #d8cec0 54%, #a58d77);
}

.media-card__video-thumb::before {
    content: "\f03d";
    position: absolute;
    left: 12px;
    top: 10px;
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: rgba(84, 55, 45, 0.28);
    font-size: 1rem;
}

.media-card__play {
    position: absolute;
    left: 50%;
    top: 45%;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: var(--green);
    box-shadow: 0 8px 22px rgba(24, 18, 17, 0.28);
    transform: translate(-50%, -50%);
}

.media-card__play i {
    margin-left: 3px;
    font-size: 1rem;
}

.media-card:focus-visible {
    outline: 3px solid rgba(47, 111, 103, 0.35);
    outline-offset: 3px;
}

.media-card__badge {
    position: absolute;
    right: 6px;
    bottom: 6px;
    z-index: 3;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(34, 31, 29, 0.78);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
}

.media-card__meta {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    display: grid;
    gap: 1px;
    padding: 18px 6px 6px;
    background: linear-gradient(180deg, transparent, rgba(24, 18, 17, 0.82));
    color: #fff;
    text-align: left;
    font-size: 0.72rem;
    line-height: 1.15;
}

.media-card__meta span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-card__meta span:first-child {
    font-weight: 800;
}

.load-more-row {
    display: flex;
    justify-content: center;
    padding-top: 18px;
}

.media-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    padding: 18px;
}

.media-modal.is-open {
    display: grid;
    place-items: center;
}

.media-modal__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    border-radius: 0;
    background: rgba(24, 18, 17, 0.76);
    cursor: pointer;
}

.media-modal__backdrop:hover {
    background: rgba(24, 18, 17, 0.76);
}

.media-modal__panel {
    position: relative;
    z-index: 1;
    width: min(960px, 100%);
    max-height: min(90vh, 900px);
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    overflow: hidden;
    border-radius: 8px;
    background: #fffaf5;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.media-modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    background: rgba(34, 31, 29, 0.78);
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
}

.media-modal__nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 44px;
    height: 56px;
    padding: 0;
    transform: translateY(-50%);
    border-radius: 8px;
    background: rgba(34, 31, 29, 0.68);
    color: #fff;
    font-size: 2.4rem;
    line-height: 1;
}

.media-modal__nav:hover {
    background: rgba(34, 31, 29, 0.86);
}

.media-modal__nav:disabled {
    opacity: 0.25;
    cursor: default;
}

.media-modal__nav--prev {
    left: 12px;
}

.media-modal__nav--next {
    right: 12px;
}

.media-modal__stage {
    min-height: 280px;
    display: grid;
    place-items: center;
    background: #201c1a;
}

.media-modal__stage img {
    width: 100%;
    height: 100%;
    max-height: 68vh;
    object-fit: contain;
}

.media-modal__stage iframe,
.media-modal__stage video {
    width: 100%;
    height: min(68vh, 720px);
    border: 0;
    background: #201c1a;
}

.media-modal__placeholder {
    padding: 28px;
    color: #fff;
    text-align: center;
}

.media-modal__body {
    padding: 14px 16px 16px;
}

.media-modal__body h3 {
    margin: 0 44px 6px 0;
    font-size: 1rem;
    overflow-wrap: anywhere;
}

.media-modal__body p {
    margin: 3px 0;
    color: var(--muted);
}

@media (max-width: 680px) {
    .app-shell {
        width: min(100% - 24px, 1120px);
        padding-top: 0;
    }

    .hero {
        min-height: 32vh;
        margin-inline: -12px;
        padding: 28px 20px;
        align-items: end;
        background-position: center;
        border-radius: 0 0 8px 8px;
    }

    h1 {
        font-size: clamp(2.2rem, 13vw, 3.4rem);
    }

    .lead {
        font-size: 1rem;
    }

    .stats-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .stats-strip article {
        padding: 11px 9px;
    }

    .stats-strip span {
        font-size: 0.8rem;
    }

    .dropzone {
        min-height: 180px;
    }

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

    .media-modal {
        padding: 0;
    }

    .media-modal__panel {
        width: 100%;
        height: 100%;
        max-height: none;
        border-radius: 0;
    }

    .media-modal__nav {
        width: 38px;
        height: 52px;
        font-size: 2.1rem;
    }

    .media-modal__nav--prev {
        left: 8px;
    }

    .media-modal__nav--next {
        right: 8px;
    }

    .media-modal__stage {
        min-height: 55vh;
    }

    .media-modal__stage img {
        max-height: 72vh;
    }

    .media-modal__stage iframe,
    .media-modal__stage video {
        height: 72vh;
    }

    .section-heading {
        display: grid;
        align-items: start;
    }

    .queue-item {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .queue {
        max-height: 260px;
    }
}
