:root {
    --gallery-paper: #f5f0e8;
    --gallery-ink: #33291f;
    --gallery-muted: #766e64;
    --gallery-gold: #8c7451;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--gallery-paper);
    overflow-x: clip;
    overscroll-behavior: none;
    scroll-behavior: smooth;
}

body.gallery-page {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    overscroll-behavior: none;
    background: var(--gallery-paper);
    color: var(--gallery-ink);
    font-family: "Cormorant Garamond", Georgia, serif;
}

.rose-snow {
    position: fixed;
    z-index: 15;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

body.gallery-menu-open {
    overflow: hidden;
}

.gallery-header {
    position: relative;
    z-index: 20;
    display: flex;
    min-height: 88px;
    padding: 16px clamp(22px, 5vw, 76px);
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(51, 41, 31, 0.16);
}

.gallery-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 19px;
    letter-spacing: 0.08em;
    text-decoration: none;
}

.gallery-brand img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.gallery-nav {
    display: flex;
    align-items: center;
    gap: clamp(14px, 2.4vw, 34px);
}

.gallery-nav a {
    color: inherit;
    font-family: Arial, sans-serif;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-decoration: none;
    text-transform: uppercase;
}

.gallery-nav a:hover,
.gallery-nav a:focus-visible {
    color: var(--gallery-gold);
    text-decoration: underline;
    text-underline-offset: 5px;
}

.gallery-menu-toggle {
    display: none;
}

.gallery-main {
    width: min(100% - 48px, 1440px);
    margin: 0 auto;
    padding: clamp(54px, 9vw, 122px) 0 100px;
}

.gallery-heading {
    max-width: 850px;
    margin: 0 auto clamp(36px, 6vw, 76px);
    text-align: center;
}

.gallery-eyebrow {
    margin: 0 0 14px;
    color: var(--gallery-gold);
    font-family: Arial, sans-serif;
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.gallery-heading h1 {
    margin: 0;
    font-size: clamp(46px, 7vw, 92px);
    font-weight: 400;
    letter-spacing: -0.045em;
    line-height: 0.98;
}

.gallery-heading h1 em {
    font-weight: 400;
}

.gallery-intro {
    max-width: 680px;
    margin: 22px auto 0;
    color: var(--gallery-muted);
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.8;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(16px, 2vw, 28px);
}

.gallery-card {
    min-width: 0;
    margin: 0;
    background: #ebe4da;
}

.gallery-card-media {
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, #393027, #171411);
    aspect-ratio: 4 / 5;
}

.gallery-card-media img,
.gallery-card-media video,
.gallery-card-media iframe {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-card-media iframe {
    border: 0;
    background: #211c18;
}

.portfolio-local-video {
    position: absolute;
    z-index: 1;
    inset: 0;
}

.portfolio-local-video[hidden] {
    visibility: hidden;
}

.portfolio-video-loading,
.portfolio-video-load-button {
    position: absolute;
    z-index: 2;
}

.portfolio-video-loading {
    top: 50%;
    left: 50%;
    display: flex;
    max-width: calc(100% - 32px);
    margin: 0;
    padding: 12px 15px;
    align-items: center;
    gap: 10px;
    transform: translate(-50%, -50%);
    background: rgba(26, 22, 19, 0.88);
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 12px;
    line-height: 1.5;
    pointer-events: none;
}

.portfolio-video-loading[data-stalled="true"] {
    top: auto;
    bottom: 12px;
    left: 12px;
    max-width: calc(100% - 150px);
    transform: none;
}

.portfolio-video-load-button[data-retry="true"] {
    top: auto;
    right: 12px;
    bottom: 12px;
    left: auto;
    transform: none;
}

.portfolio-video-loading:not([hidden])::before {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #d6bd8c;
    border-radius: 50%;
    animation: portfolio-video-spin 800ms linear infinite;
    content: "";
}

.portfolio-video-load-button {
    top: 50%;
    left: 50%;
    display: inline-flex;
    min-height: 48px;
    padding: 0 20px;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 30px;
    background: rgba(34, 29, 25, 0.86);
    color: #fff;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.portfolio-video-load-button:hover,
.portfolio-video-load-button:focus-visible {
    background: #d6bd8c;
    color: #211c18;
}

.portfolio-video-load-button:disabled {
    cursor: wait;
}

.portfolio-video-loading[hidden],
.portfolio-video-load-button[hidden] {
    display: none;
}

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

.gallery-card figcaption {
    padding: 14px 16px 18px;
    color: var(--gallery-ink);
    font-size: 20px;
    line-height: 1.2;
}

.beauty-gallery-card figcaption strong {
    display: block;
    font-size: 21px;
    font-weight: 500;
}

.gallery-card figcaption strong {
    display: block;
    font-size: 21px;
    font-weight: 500;
}

.gallery-card figcaption p {
    min-height: 42px;
    margin: 8px 0 14px;
    color: var(--gallery-muted);
    font-family: Arial, sans-serif;
    font-size: 12px;
    line-height: 1.6;
}

.beauty-gallery-card figcaption p {
    min-height: 42px;
    margin: 8px 0 14px;
    color: var(--gallery-muted);
    font-family: Arial, sans-serif;
    font-size: 12px;
    line-height: 1.6;
}

.beauty-gallery-open {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.beauty-gallery-open img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 450ms ease;
}

.beauty-gallery-open:hover img,
.beauty-gallery-open:focus-visible img {
    transform: scale(1.035);
}

.beauty-gallery-open:focus-visible {
    outline: 2px solid var(--gallery-gold);
    outline-offset: -5px;
}

.beauty-gallery-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    background: rgba(34, 29, 25, 0.62);
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 18px;
}

.beauty-gallery-more,
.beauty-project-cta,
.portfolio-gallery-more,
.portfolio-project-cta {
    display: inline-flex;
    min-height: 42px;
    padding: 0 18px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--gallery-gold);
    border-radius: 24px;
    background: transparent;
    color: var(--gallery-ink);
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-decoration: none;
    text-transform: uppercase;
    transition: background-color 180ms ease, color 180ms ease;
}

.beauty-gallery-more:hover,
.beauty-gallery-more:focus-visible,
.beauty-project-cta:hover,
.beauty-project-cta:focus-visible,
.portfolio-gallery-more:hover,
.portfolio-gallery-more:focus-visible,
.portfolio-project-cta:hover,
.portfolio-project-cta:focus-visible {
    background: var(--gallery-gold);
    color: #fff;
}

.beauty-project-dialog {
    position: fixed;
    width: min(900px, calc(100% - 32px));
    max-width: none;
    max-height: min(92vh, 960px);
    margin: auto;
    padding: clamp(24px, 5vw, 48px);
    overflow: auto;
    border: 1px solid rgba(140, 116, 81, 0.5);
    background: var(--gallery-paper);
    color: var(--gallery-ink);
}

.beauty-project-dialog::backdrop {
    background: rgba(20, 17, 15, 0.82);
    backdrop-filter: blur(5px);
}

.beauty-project-content {
    display: grid;
    gap: 14px;
}

.beauty-project-content .gallery-eyebrow,
.beauty-project-content h2,
.beauty-project-content > p {
    margin: 0;
    text-align: left;
}

.beauty-project-content h2 {
    font-size: clamp(32px, 5vw, 52px);
    font-weight: 400;
    line-height: 1;
}

.beauty-project-description,
.beauty-project-status {
    color: var(--gallery-muted);
    font-family: Arial, sans-serif;
    font-size: 13px;
    line-height: 1.6;
}

.beauty-project-video {
    display: block;
    width: 100%;
    max-height: 58vh;
    aspect-ratio: 16 / 9;
    background: #211c18;
    object-fit: contain;
}

.beauty-project-close {
    position: absolute;
    top: 10px;
    right: 12px;
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid rgba(51, 41, 31, 0.3);
    border-radius: 50%;
    background: transparent;
    color: var(--gallery-ink);
    cursor: pointer;
    font-size: 25px;
    line-height: 1;
}

.beauty-project-cta {
    justify-self: start;
    background: var(--gallery-ink);
    color: var(--gallery-paper);
}

.beauty-project-status:empty {
    display: none;
}

.portfolio-gallery-more {
    appearance: none;
}

.portfolio-project-dialog {
    position: fixed;
    width: min(900px, calc(100% - 32px));
    max-width: none;
    max-height: min(92vh, 960px);
    margin: auto;
    padding: clamp(24px, 5vw, 48px);
    overflow: auto;
    border: 1px solid rgba(140, 116, 81, 0.5);
    background: var(--gallery-paper);
    color: var(--gallery-ink);
}

.portfolio-project-dialog::backdrop {
    background: rgba(20, 17, 15, 0.82);
    backdrop-filter: blur(5px);
}

.portfolio-project-content {
    display: grid;
    gap: 14px;
}

.portfolio-project-content .gallery-eyebrow,
.portfolio-project-content h2,
.portfolio-project-content > p {
    margin: 0;
    text-align: left;
}

.portfolio-project-content h2 {
    font-size: clamp(32px, 5vw, 52px);
    font-weight: 400;
    line-height: 1;
}

.portfolio-project-description,
.portfolio-project-status {
    color: var(--gallery-muted);
    font-family: Arial, sans-serif;
    font-size: 13px;
    line-height: 1.6;
}

.portfolio-project-video {
    display: block;
    width: 100%;
    max-height: 58vh;
    aspect-ratio: 16 / 9;
    background: #211c18;
    object-fit: contain;
}

.portfolio-project-close {
    position: absolute;
    top: 10px;
    right: 12px;
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid rgba(51, 41, 31, 0.3);
    border-radius: 50%;
    background: transparent;
    color: var(--gallery-ink);
    cursor: pointer;
    font-size: 25px;
    line-height: 1;
}

.portfolio-project-cta {
    justify-self: start;
    background: var(--gallery-ink);
    color: var(--gallery-paper);
}

.portfolio-project-status:empty {
    display: none;
}

.gallery-card figcaption span {
    display: block;
    margin-bottom: 5px;
    color: var(--gallery-gold);
    font-family: Arial, sans-serif;
    font-size: 9px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.gallery-drive-link {
    display: inline-block;
    margin-top: 9px;
    color: var(--gallery-gold);
    font-family: Arial, sans-serif;
    font-size: 10px;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.gallery-more-link {
    display: inline-flex;
    min-height: 48px;
    padding: 0 20px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 1px solid currentColor;
    color: inherit;
    font-family: Arial, sans-serif;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-decoration: none;
    text-transform: uppercase;
    transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

.gallery-more-actions {
    display: flex;
    margin: 32px auto 0;
    justify-content: center;
}

.gallery-more-actions.beauty-gallery-more {
    display: flex;
    width: fit-content;
    max-width: 100%;
    margin-top: 14px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.gallery-more-actions.beauty-gallery-more .gallery-more-link {
    min-height: 36px;
    padding: 0 14px;
    gap: 7px;
    border: 1px solid #33291f;
    border-radius: 999px;
    background: #33291f;
    color: #f5f0e8;
    font-size: 9px;
    letter-spacing: 0.08em;
}

.gallery-more-link {
    border-color: rgba(51, 41, 31, 0.4);
    color: var(--gallery-ink);
}

.gallery-more-link:hover,
.gallery-more-link:focus-visible {
    border-color: var(--gallery-ink);
    background: var(--gallery-ink);
    color: var(--gallery-paper);
}

.gallery-more-actions.beauty-gallery-more .gallery-more-link:hover,
.gallery-more-actions.beauty-gallery-more .gallery-more-link:focus-visible {
    border-color: #211c18;
    background: #211c18;
    color: #f5f0e8;
}

@media (max-width: 760px) {
    .gallery-header {
        min-height: 72px;
        padding: 12px 18px;
    }

    .gallery-brand {
        position: relative;
        z-index: 101;
        font-size: 16px;
    }

    .gallery-brand img {
        width: 36px;
        height: 36px;
    }

    .gallery-menu-toggle {
        position: relative;
        z-index: 102;
        display: grid;
        width: 44px;
        height: 44px;
        padding: 12px 10px;
        align-content: center;
        gap: 6px;
        border: 1px solid rgba(51, 41, 31, 0.4);
        border-radius: 50%;
        background: var(--gallery-paper);
        color: var(--gallery-ink);
        cursor: pointer;
    }

    .gallery-menu-toggle span {
        display: block;
        height: 1px;
        background: currentColor;
        transition: transform 180ms ease;
    }

    .gallery-menu-toggle[aria-expanded="true"] span:first-child {
        transform: translateY(3.5px) rotate(45deg);
    }

    .gallery-menu-toggle[aria-expanded="true"] span:last-child {
        transform: translateY(-3.5px) rotate(-45deg);
    }

    .gallery-nav {
        display: none;
    }

    .gallery-nav.is-open {
        position: fixed;
        z-index: 100;
        inset: 0;
        display: flex;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        padding: 100px 28px 40px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: clamp(22px, 4vh, 38px);
        overflow-y: auto;
        background: rgba(34, 29, 25, 0.98);
    }

    .gallery-nav.is-open a {
        color: var(--gallery-paper);
        font-family: "Cormorant Garamond", Georgia, serif;
        font-size: clamp(25px, 7vw, 38px);
        letter-spacing: 0.02em;
        text-transform: none;
    }

    .gallery-nav.is-open a:hover,
    .gallery-nav.is-open a:focus-visible {
        color: #d6bd8c;
    }

    .gallery-main {
        width: min(100% - 36px, 1440px);
        padding-top: 56px;
    }

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

    .gallery-card figcaption {
        padding: 10px 11px 13px;
        font-size: 17px;
    }

}

@media (max-width: 460px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-card-media {
        aspect-ratio: 4 / 5;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
