*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #000;
    --text: #b0b0b0;
    --text-dim: #555;
    --accent: #fff;
    --nav-width: 260px;
    --gap: 20px;
    --radius: 14px;
    --lb-btn-size: clamp(24px, 3vw, 48px);
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    min-height: 100vh;
    width: 100vw;
    min-width: 100vw;
    -webkit-font-smoothing: antialiased;
}

/* ── Sidebar ─────────────────────────────────── */

#sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--nav-width);
    height: 100vh;
    padding: 44px 28px 44px 32px;
    border-right: 1px solid #141414;
    overflow-y: auto;
    z-index: 100;
    scrollbar-width: none;
}

#sidebar::-webkit-scrollbar { display: none; }

.nav-header {
    margin-bottom: 40px;
}

.site-title {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--accent);
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.3s ease, letter-spacing 0.3s ease, opacity 0.3s ease;
}

.site-title:hover {
    color: #aaa;
    letter-spacing: 0.25em;
    opacity: 0.6;
}

.nav-list {
    list-style: none;
    font-size: 15px;
}

.nav-list > li {
    margin-bottom: 4px;
}

.nav-list a,
.nav-list .nav-link {
    color: var(--text-dim);
    text-decoration: none;
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: color 0.2s;
    display: block;
    padding: 2px 0;
}

.nav-list a:hover,
.nav-list .nav-link:hover,
.nav-list .nav-link.active {
    color: var(--accent);
}

.nav-group {
    margin-top: 26px;
}

.nav-category {
    display: block;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #aaa;
    margin-bottom: 10px;
}

.nav-group ul {
    list-style: none;
}

.nav-group ul li {
    margin-bottom: 3px;
}

.nav-bio {
    margin-top: 28px;
}

.nav-bio .nav-link {
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #aaa;
    text-decoration: none;
    transition: color 0.2s;
}

.nav-bio .nav-link:hover {
    color: var(--accent);
}

/* ── Main content ────────────────────────────── */

#main-content {
    margin-left: var(--nav-width);
    min-height: 100vh;
    padding: 40px;
    pointer-events: none;
}

#main-content .section,
#main-content .home-card,
#main-content .gallery-item,
#main-content .nav-link,
#main-content .bio-text a {
    pointer-events: auto;
}

.section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Home grid ───────────────────────────────── */

.home-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 35px;
    max-width: 1600px;
    margin-left: 0;
    margin-right: auto;
}

.home-card {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    aspect-ratio: 3 / 2;
    background: #0a0a0a;
    border-radius: var(--radius);
}

.home-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease, filter 0.4s ease;
    filter: brightness(1);
}

.home-card:hover img {
    transform: scale(1.04);
    filter: brightness(0.55);
}

.home-card-meta {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 14px 16px;
    pointer-events: none;
}

.home-card-category {
    display: block;
    font-size: 9px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.75);
    margin-bottom: 4px;
}

.home-card-title {
    display: block;
    font-size: 12px;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.75);
    font-weight: 400;
}

/* ── Gallery ─────────────────────────────────── */

.gallery-title {
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.12em;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 28px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--gap);
    max-width: 1600px;
    margin-left: 0;
    margin-right: auto;
}

.gallery-item {
    aspect-ratio: 3 / 2;
    cursor: pointer;
    overflow: hidden;
    background: #0a0a0a;
    border-radius: 10px;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.25s, transform 0.35s ease;
}

.gallery-item:hover img {
    opacity: 0.7;
    transform: scale(1.02);
}

/* ── Biography ───────────────────────────────── */

.bio-content {
    max-width: 820px;
    padding-top: 10px;
}

.bio-layout {
    display: grid;
    grid-template-columns: 218px 1fr;
    gap: 52px;
    align-items: start;
}

.bio-photo img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

.bio-text h2 {
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 28px;
}

.bio-text h2 {
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-top: 36px;
    margin-bottom: 14px;
}

.bio-text p {
    font-size: 13px;
    line-height: 1.9;
    color: var(--text);
    margin-bottom: 18px;
}

.bio-text a {
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid #383838;
    padding-bottom: 1px;
    transition: color 0.2s, border-color 0.2s;
}

.bio-text a:hover {
    color: var(--accent);
    border-color: #666;
}

@media (max-width: 640px) {
    .bio-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .bio-photo img { max-width: 240px; }
}

/* ── Lightbox ────────────────────────────────── */

.lightbox {
    position: fixed;
    inset: 0;
    left: 0;
    width: 100vw !important;
    background: #000;
    z-index: 1000;
    display: grid;
    place-items: center;
    overflow: hidden;
    animation: fadeIn 0.2s ease;
}

.lightbox.hidden {
    display: none;
}

#lbImg {
    display: block;
    user-select: none;
    max-width: 75vw;
    max-height: 75vh;
    width: 75vw;
    height: auto;
    object-fit: contain;
}

@keyframes slideFromRight {
    from { transform: translateX(50px); }
    to   { transform: translateX(0); }
}
@keyframes slideFromLeft {
    from { transform: translateX(-50px); }
    to   { transform: translateX(0); }
}
@keyframes lbFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
#lbImg.slide-next  { animation: slideFromRight 0.28s ease; }
#lbImg.slide-prev  { animation: slideFromLeft  0.28s ease; }
#lbImg.lb-fadein   { animation: lbFadeIn       0.25s ease forwards; }

.lb-close {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1020;
    background: none;
    border: none;
    color: #2e2e2e;
    font-size: clamp(14px, 1.5vw, 28px) !important;
    cursor: pointer;
    padding: 0 !important;
    line-height: 1 !important;
    transition: color 0.2s;
    white-space: nowrap;
}

.lb-close:hover { color: #aaa; }

.lb-prev,
.lb-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1010;
    background: none;
    border: none;
    color: #2e2e2e;
    font-size: var(--lb-btn-size);
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
    height: auto;
    transition: color 0.2s;
    user-select: none;
}

.lb-prev { left: 0; }
.lb-next { right: 0; }

.lb-prev:hover,
.lb-next:hover { color: #aaa !important; }

.lb-prev:active,
.lb-next:active,
.lb-close:active { color: #ccc !important; }

/* ── Mobile menu toggle ──────────────────────── */

.menu-toggle {
    display: none;
    position: fixed;
    top: env(safe-area-inset-top, 14px);
    left: 12px;
    z-index: 300;
    background: rgba(0,0,0,0.4);
    border: none;
    border-radius: 4px;
    color: #ccc;
    font-size: 20px;
    cursor: pointer;
    padding: 6px 8px;
    line-height: 1;
    transition: color 0.2s, background 0.2s;
}

.menu-toggle:hover { color: #fff; background: rgba(0,0,0,0.6); }

/* ── Responsive ──────────────────────────────── */

@media (max-width: 1200px) {
    .home-grid    { grid-template-columns: repeat(3, 1fr); }
    .gallery-grid { grid-template-columns: repeat(4, 1fr); }
    #main-content { padding: 40px 30px; }
}

@media (max-width: 860px) {
    .home-grid    { grid-template-columns: repeat(2, 1fr); }
    .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .menu-toggle { display: block; }

    #sidebar {
        transform: translateX(-100%);
        transition: transform 0.28s ease;
        background: #000;
        z-index: 150;
    }

    #sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,0.8);
    }

    #sidebarOverlay {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 140;
    }

    #sidebarOverlay.active {
        display: block;
    }

    #main-content {
        margin-left: 0;
        padding: 72px 18px 60px;
    }

.lb-close { top: 60px; }
    .lb-prev, .lb-next  { color: #fff; opacity: 0.08; background: none; }
    .lb-prev:active, .lb-next:active { opacity: 0.9; }
    #lbImg { width: auto; max-width: 100vw; max-height: 92dvh; }
}

@media (max-width: 500px) {
    .home-grid    { grid-template-columns: repeat(1, 1fr); }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (orientation: landscape) {
    .lb-close { top: 8px; font-size: clamp(10px, 1.2vw, 20px) !important; }
}

@media (orientation: landscape) and (max-width: 1024px) {
    .lb-prev, .lb-next  { color: #fff; opacity: 0.08; background: none; }
    .lb-prev:active, .lb-next:active { opacity: 0.9; }
    #lbImg { width: auto; max-width: 96vw; max-height: 96dvh; }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
