:root {
    --bg: #050506;
    --panel: #111114;
    --panel-2: #17171b;
    --line: rgba(255,255,255,.10);
    --text: #f8f8f8;
    --muted: rgba(248,248,248,.66);
    --soft: rgba(248,248,248,.48);
    --gold: #e8c27d;
    --rose: #ef7187;
    --radius-xl: 28px;
    --radius-lg: 22px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html {
    background: var(--bg);
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 18% -10%, rgba(232,194,125,.18), transparent 28rem),
        radial-gradient(circle at 85% 0%, rgba(239,113,135,.14), transparent 26rem),
        #050506;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.lightbox-open { overflow: hidden; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

.app-shell {
    width: min(1500px, 100%);
    margin: 0 auto;
    padding: max(14px, var(--safe-top)) clamp(10px, 2.5vw, 30px) calc(40px + var(--safe-bottom));
}

.ios-hero {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background:
        linear-gradient(180deg, rgba(255,255,255,.08), transparent 42%),
        linear-gradient(135deg, rgba(232,194,125,.26), rgba(239,113,135,.10) 38%, rgba(17,17,20,.92));
    box-shadow: 0 18px 80px rgba(0,0,0,.30);
    isolation: isolate;
}

.ios-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 15% 26%, rgba(255,255,255,.20) 0 1px, transparent 2px),
        radial-gradient(circle at 72% 34%, rgba(255,255,255,.16) 0 1px, transparent 2px),
        radial-gradient(circle at 84% 72%, rgba(232,194,125,.18) 0 1px, transparent 2px);
    pointer-events: none;
    opacity: .84;
    z-index: -1;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: clamp(16px, 3vw, 28px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand__mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    border-radius: 50%;
    color: #25160c;
    background: linear-gradient(135deg, #fff4dc, var(--gold));
    box-shadow: 0 10px 26px rgba(232,194,125,.22);
    font-family: ui-serif, Georgia, serif;
    font-weight: 800;
    letter-spacing: -.06em;
}

.brand__text, .topbar__date {
    color: rgba(255,255,255,.82);
    font-size: .94rem;
    letter-spacing: .01em;
}

.topbar__date {
    padding: 9px 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(0,0,0,.16);
}

.hero-copy {
    padding: clamp(26px, 7vw, 82px) clamp(18px, 7vw, 86px) clamp(34px, 8vw, 92px);
}

.eyebrow, .section-kicker {
    display: block;
    margin: 0 0 10px;
    color: var(--gold);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.hero-copy h1 {
    margin: 0;
    font-family: ui-serif, Georgia, "Times New Roman", serif;
    font-size: clamp(4rem, 12vw, 10.5rem);
    line-height: .82;
    letter-spacing: -.075em;
}

.hero-copy p:not(.eyebrow) {
    max-width: 640px;
    margin: 24px 0 0;
    color: var(--muted);
    font-size: clamp(1.02rem, 2vw, 1.28rem);
    line-height: 1.62;
}

.gallery-app {
    display: grid;
    gap: 14px;
    margin-top: 14px;
}

.category-dock {
    position: sticky;
    top: max(8px, var(--safe-top));
    z-index: 20;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(17,17,20,.82);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    box-shadow: 0 10px 44px rgba(0,0,0,.24);
    padding: 10px;
}

.category-rail {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
}
.category-rail::-webkit-scrollbar { display: none; }

.category-chip {
    appearance: none;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    padding: 11px 14px;
    color: rgba(255,255,255,.82);
    background: rgba(255,255,255,.07);
    cursor: pointer;
    scroll-snap-align: start;
    transition: transform .15s ease, background .15s ease, color .15s ease;
}

.category-chip:hover,
.category-chip:focus-visible {
    outline: none;
    transform: translateY(-1px);
    background: rgba(255,255,255,.12);
}

.category-chip.is-active {
    color: #140f08;
    background: linear-gradient(135deg, #fff2d4, var(--gold));
}

.category-chip--featured:not(.is-active) {
    color: #fff5dd;
    background: rgba(232,194,125,.16);
}

.category-chip small {
    opacity: .72;
    font-size: .78em;
    font-weight: 800;
}

.gallery-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: rgba(17,17,20,.78);
    padding: clamp(14px, 2.5vw, 26px);
    min-height: 420px;
}

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

.gallery-head h2 {
    margin: 0;
    font-size: clamp(1.55rem, 3vw, 2.55rem);
    letter-spacing: -.045em;
}

.gallery-head p {
    max-width: 760px;
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.ghost-button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 10px 13px;
    color: var(--text);
    background: rgba(255,255,255,.07);
    cursor: pointer;
    font-weight: 700;
    transition: transform .15s ease, background .15s ease;
}
.ghost-button:hover, .ghost-button:focus-visible {
    outline: none;
    transform: translateY(-1px);
    background: rgba(255,255,255,.12);
}

.gallery-grid, .loading-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
    gap: clamp(5px, .85vw, 10px);
}

.photo-card {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    border-radius: clamp(11px, 1.6vw, 18px);
    background: #1c1c20;
    content-visibility: auto;
    contain-intrinsic-size: 170px 170px;
    transform: translateZ(0);
}

.photo-open {
    appearance: none;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: zoom-in;
}

.photo-open img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #202024;
    transform: scale(1.001);
    transition: transform .22s ease, filter .22s ease;
}

.photo-card:hover .photo-open img,
.photo-open:focus-visible img {
    transform: scale(1.035);
    filter: saturate(1.04) contrast(1.02);
}

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

.photo-meta {
    position: absolute;
    left: 6px;
    right: 6px;
    bottom: 6px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    pointer-events: none;
}

.mini-stat {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 0;
    border-radius: 999px;
    padding: 5px 7px;
    color: #fff;
    background: rgba(0,0,0,.46);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    font-size: .78rem;
    font-weight: 800;
    line-height: 1;
}

button.mini-stat {
    cursor: pointer;
    pointer-events: auto;
}

.mini-stat--like.is-liked {
    color: #fff;
    background: rgba(239,113,135,.84);
}

.loading-grid span {
    display: block;
    aspect-ratio: 1;
    border-radius: clamp(11px, 1.6vw, 18px);
    background: linear-gradient(110deg, rgba(255,255,255,.05), rgba(255,255,255,.11), rgba(255,255,255,.05));
    background-size: 200% 100%;
    animation: shimmer 1.05s linear infinite;
}
@keyframes shimmer { to { background-position-x: -200%; } }

.empty-state {
    display: grid;
    place-items: center;
    text-align: center;
    min-height: 260px;
    border: 1px dashed var(--line);
    border-radius: var(--radius-lg);
    color: var(--muted);
    padding: 34px;
}
.empty-state span { font-size: 2.4rem; }
.empty-state h3 {
    margin: 10px 0 4px;
    color: var(--text);
    font-size: 1.55rem;
}
.empty-state p { margin: 0; max-width: 460px; line-height: 1.6; }

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .16s ease, visibility .16s ease;
}
.lightbox.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.96);
}
.lightbox__stage {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    background: #000;
}

.lightbox__topbar,
.lightbox__bottombar {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(180deg, rgba(0,0,0,.74), rgba(0,0,0,.30));
}

.lightbox__topbar {
    justify-content: space-between;
    padding: calc(10px + var(--safe-top)) clamp(10px, 2vw, 22px) 10px;
}

.lightbox__titlewrap { min-width: 0; }
.lightbox__titlewrap strong,
.lightbox__titlewrap span { display: block; }
.lightbox__titlewrap strong {
    max-width: min(62vw, 680px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lightbox__titlewrap span {
    margin-top: 2px;
    color: var(--soft);
    font-size: .84rem;
}

.circle-button {
    appearance: none;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(255,255,255,.13);
    cursor: pointer;
    font-size: 1.6rem;
    line-height: 1;
}

.lightbox__figure {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: clamp(6px, 1.4vw, 18px) clamp(8px, 5vw, 76px);
}

.lightbox__figure img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    border-radius: clamp(8px, 1vw, 14px);
    background: #050505;
}

.lightbox__bottombar {
    justify-content: center;
    flex-wrap: wrap;
    padding: 10px clamp(10px, 2vw, 22px) calc(12px + var(--safe-bottom));
    background: linear-gradient(0deg, rgba(0,0,0,.78), rgba(0,0,0,.26));
}

.action-pill {
    appearance: none;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 999px;
    padding: 10px 14px;
    color: #fff;
    background: rgba(255,255,255,.10);
    cursor: pointer;
    font-weight: 800;
}
.action-pill.is-liked,
.action-pill--like.is-liked {
    border-color: rgba(239,113,135,.55);
    background: rgba(239,113,135,.26);
    color: #fff;
}
.heart-icon { font-size: 1.14rem; line-height: 1; }

.nav-button {
    position: absolute;
    top: 50%;
    z-index: 4;
    transform: translateY(-50%);
    width: clamp(42px, 5vw, 58px);
    height: clamp(42px, 5vw, 58px);
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(255,255,255,.11);
    cursor: pointer;
    font-size: clamp(2rem, 4.8vw, 3rem);
    line-height: 0;
    transition: transform .15s ease, background .15s ease;
}
.nav-button:hover,
.nav-button:focus-visible {
    outline: none;
    transform: translateY(-50%) scale(1.04);
    background: rgba(255,255,255,.18);
}
.nav-button--prev { left: clamp(10px, 2vw, 24px); }
.nav-button--next { right: clamp(10px, 2vw, 24px); }

@media (min-width: 760px) {
    .gallery-grid,
    .loading-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}

@media (min-width: 1180px) {
    .gallery-grid,
    .loading-grid { grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); }
}

@media (max-width: 720px) {
    .app-shell { padding-inline: 8px; }
    .ios-hero { border-radius: 24px; }
    .brand__text { display: none; }
    .topbar__date { font-size: .82rem; padding: 8px 11px; }
    .hero-copy { padding-inline: 18px; padding-bottom: 42px; }
    .hero-copy h1 { font-size: clamp(4rem, 22vw, 7rem); }
    .hero-copy p:not(.eyebrow) { margin-top: 18px; }
    .category-dock { border-radius: 21px; padding: 8px; }
    .category-chip { padding: 10px 12px; font-size: .9rem; }
    .gallery-panel { border-radius: 23px; padding: 10px; }
    .gallery-head { display: block; padding: 4px 2px 6px; }
    .gallery-head .ghost-button { display: none; }
    .gallery-grid,
    .loading-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 5px;
    }
    .photo-card,
    .loading-grid span { border-radius: 9px; }
    .mini-stat { font-size: .72rem; padding: 4px 6px; }
    .lightbox__figure { padding-inline: 0; }
    .nav-button {
        top: auto;
        bottom: calc(70px + var(--safe-bottom));
        width: 42px;
        height: 42px;
        transform: none;
        background: rgba(255,255,255,.12);
    }
    .nav-button:hover,
    .nav-button:focus-visible { transform: scale(1.04); }
    .nav-button--prev { left: 12px; }
    .nav-button--next { right: 12px; }
    .action-pill { min-height: 40px; padding: 9px 12px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .001ms !important;
    }
}

/* v3 performance/mobile polish */
html, body { overflow-x: hidden; }

.load-more {
    display: grid;
    place-items: center;
    gap: 8px;
    padding: 22px 0 6px;
    color: var(--soft);
    font-size: .9rem;
}
.load-more[hidden] { display: none; }
.load-more__button {
    appearance: none;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 999px;
    padding: 13px 22px;
    color: #170f08;
    background: linear-gradient(135deg, #fff2d4, var(--gold));
    box-shadow: 0 14px 34px rgba(232,194,125,.18);
    cursor: pointer;
    font-weight: 900;
    transition: transform .16s ease, filter .16s ease, opacity .16s ease;
}
.load-more__button:hover,
.load-more__button:focus-visible {
    outline: none;
    transform: translateY(-1px);
    filter: brightness(1.03);
}
.load-more__button:disabled {
    cursor: progress;
    opacity: .68;
    transform: none;
}
.load-more__button.is-loading::after {
    content: "";
    width: 13px;
    height: 13px;
    margin-left: 9px;
    display: inline-block;
    vertical-align: -2px;
    border: 2px solid rgba(0,0,0,.18);
    border-top-color: rgba(0,0,0,.62);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.lightbox {
    transition: opacity .24s ease, visibility .24s ease;
}
.lightbox__stage {
    transform: translateY(10px) scale(.985);
    opacity: .96;
    transition: transform .26s cubic-bezier(.2,.8,.2,1), opacity .26s ease;
}
.lightbox.is-open .lightbox__stage {
    transform: translateY(0) scale(1);
    opacity: 1;
}
.lightbox__figure::after {
    content: "";
    position: absolute;
    width: 34px;
    height: 34px;
    border: 3px solid rgba(255,255,255,.18);
    border-top-color: rgba(255,255,255,.74);
    border-radius: 50%;
    opacity: 0;
    transform: scale(.92);
    transition: opacity .16s ease, transform .16s ease;
    animation: spin .8s linear infinite;
    pointer-events: none;
}
.lightbox.is-loading-image .lightbox__figure::after {
    opacity: 1;
    transform: scale(1);
}
.lightbox__figure img {
    opacity: 0;
    transform: scale(.992);
    transition: opacity .24s ease, transform .24s cubic-bezier(.2,.8,.2,1);
    box-shadow: 0 22px 80px rgba(0,0,0,.48);
}
.lightbox__figure img.is-ready {
    opacity: 1;
    transform: scale(1);
}

@media (max-width: 720px) {
    body { background: #050506; }
    .app-shell {
        width: 100%;
        padding: 8px 0 calc(24px + var(--safe-bottom));
    }
    .ios-hero {
        margin-inline: 8px;
        border-radius: 22px;
    }
    .topbar { padding: 12px 14px; }
    .brand__mark { width: 38px; height: 38px; }
    .hero-copy {
        padding: 22px 16px 30px;
    }
    .hero-copy h1 {
        font-size: clamp(3.15rem, 19vw, 5.8rem);
        line-height: .86;
        max-width: 100%;
        overflow-wrap: anywhere;
    }
    .hero-copy p:not(.eyebrow) {
        font-size: .98rem;
        line-height: 1.46;
    }
    .gallery-app { gap: 8px; margin-top: 8px; }
    .category-dock {
        top: max(5px, var(--safe-top));
        margin-inline: 6px;
        border-radius: 18px;
        padding: 6px;
    }
    .category-chip {
        padding: 9px 10px;
        font-size: .86rem;
        gap: 6px;
    }
    .gallery-panel {
        border-left: 0;
        border-right: 0;
        border-radius: 18px;
        padding: 8px 5px 12px;
    }
    .gallery-head {
        padding: 7px 7px 10px;
        margin-bottom: 4px;
    }
    .gallery-head h2 { font-size: 1.45rem; }
    .gallery-head p {
        font-size: .92rem;
        line-height: 1.42;
    }
    .gallery-grid,
    .loading-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 3px;
    }
    .photo-card,
    .loading-grid span {
        border-radius: 6px;
        contain-intrinsic-size: 124px 124px;
    }
    .photo-meta {
        left: 4px;
        right: 4px;
        bottom: 4px;
    }
    .mini-stat {
        font-size: .68rem;
        padding: 4px 5px;
        gap: 3px;
    }
    .lightbox__stage {
        grid-template-rows: auto minmax(0, 1fr) auto;
        height: 100svh;
    }
    .lightbox__topbar {
        padding: calc(8px + var(--safe-top)) 10px 8px;
    }
    .lightbox__bottombar {
        padding: 8px 8px calc(10px + var(--safe-bottom));
        gap: 7px;
    }
    .lightbox__figure {
        padding: 0;
        width: 100vw;
    }
    .lightbox__figure img {
        max-width: 100vw;
        max-height: 100%;
        border-radius: 0;
        box-shadow: none;
    }
    .circle-button {
        width: 38px;
        height: 38px;
    }
    .action-pill {
        min-height: 38px;
        padding: 8px 10px;
        font-size: .88rem;
    }
    .nav-button {
        bottom: calc(62px + var(--safe-bottom));
        width: 40px;
        height: 40px;
        font-size: 2rem;
    }
    .load-more { padding-top: 18px; }
    .load-more__button { width: min(92vw, 360px); }
}
