:root {
    --bg: #efe9df;
    --paper: #f7f2eb;
    --ink: #171515;
    --muted: #5c5550;
    --line: rgba(23, 21, 21, 0.12);
    --soft: #e1d7ca;
    --accent: #7a6657;
    --accent-2: #9a826d;
    --panel: #f9f6f1;
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    overflow: hidden;
}

button, a {
    font: inherit;
}

.page {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 100svh;
    overflow: hidden;
    background: var(--bg);
}

.header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 20;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    padding: 28px 42px 0;
}

.brand-block {
    display: flex;
    flex-direction: column;
    justify-self: start;
    align-self: center;
    gap: 8px;
    padding-top: 2px;
}

.brand {
    color: var(--ink);
    text-decoration: none;
    font-size: clamp(1.9rem, 2.5vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.08em;
    line-height: 0.88;
}

.brand-subtitle {
    font-size: 9px;
    letter-spacing: 0.28rem;
    text-transform: uppercase;
    color: var(--muted);
    padding-left: 2px;
}

.meta-tag {
    justify-self: center;
    align-self: center;
    font-size: 8px;
    letter-spacing: 0.28rem;
    text-transform: uppercase;
    color: var(--muted);
    border: 1px solid var(--line);
    padding: 9px 12px;
    background: rgba(255, 255, 255, 0.12);
    line-height: 1;
}

.nav {
    justify-self: end;
    display: flex;
    gap: 26px;
    align-items: center;
    padding-top: 4px;
}

.nav button {
    border: none;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    padding: 16px 14px 18px;
    font-size: 15px;
    letter-spacing: 0.42rem;
    text-transform: uppercase;
    position: relative;
    font-weight: 900;
    opacity: 1;
    transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.nav button:hover,
.nav button:focus-visible {
    transform: translateY(-1px);
    color: #000000;
}

.nav button::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 1.5px;
    background: rgba(23, 21, 21, 0.7);
    transition: width 0.25s ease;
}

.nav button:hover::after,
.nav button:focus-visible::after {
    width: 100%;
}

.gallery {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-label {
    position: absolute;
    left: 36px;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
    transform-origin: left center;
    font-size: 9px;
    letter-spacing: 0.34rem;
    text-transform: uppercase;
    color: #ffd36a !important;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.72);
    z-index: 3;
}

.gallery-section-rail {
    position: absolute;
    left: 52px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    display: flex;
    flex-direction: column;
    gap: 26px;
    align-items: flex-start;
    padding-left: 18px;
    border-left: 2px solid rgba(255, 211, 106, 0.72);
}

.gallery-section {
    position: relative;
    border: none;
    background: transparent;
    color: #ffd36a !important;
    font-size: 19px;
    letter-spacing: 0.28rem;
    text-transform: lowercase;
    padding: 6px 0;
    cursor: pointer;
    font-weight: 500;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.78);
    transition: color 0.2s ease, transform 0.2s ease, letter-spacing 0.2s ease;
}

.gallery-section::before {
    content: "";
    position: absolute;
    left: -14px;
    top: 50%;
    width: 6px;
    height: 1px;
    background: rgba(255, 211, 106, 0.82);
    transform: translateY(-50%);
    transition: background 0.2s ease, width 0.2s ease;
}

.gallery-section.active {
    color: #ffffff !important;
    transform: translateX(14px);
    font-weight: 900;
    letter-spacing: 0.35rem;
    font-size: 22px;
}

.gallery-section.active::before {
    background: #ffffff;
    width: 10px;
}

.gallery-window {
    width: min(92vw, 1280px);
    height: min(88vh, 860px);
    background: var(--paper);
    border: 12px solid var(--paper);
    box-shadow: 0 34px 80px rgba(20, 15, 10, 0.16), inset 0 0 0 1px var(--line);
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    overscroll-behavior-y: contain;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
}

.gallery-window::-webkit-scrollbar {
    display: none;
}

.category-slide {
    position: relative;
    height: 100%;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 54px 70px;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid rgba(23, 21, 21, 0.12);
    overflow: hidden;
    scroll-snap-align: start;
}

.category-slide::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(17, 14, 11, 0.68), rgba(17, 14, 11, 0.28) 42%, rgba(17, 14, 11, 0.1));
}

.category-slide.paintings {
    background-image: url('https://images.unsplash.com/photo-1515405295579-ba7b45403062?auto=format&fit=crop&w=1200&q=80');
}

.category-slide.drawings {
    background-image: url('https://images.unsplash.com/photo-1521572267360-ee0c2909d518?auto=format&fit=crop&w=1200&q=80');
}

.category-slide.digital {
    background-image: url('https://images.unsplash.com/photo-1493246507139-91e8fad9978e?auto=format&fit=crop&w=1200&q=80');
}

.slide-content {
    position: absolute;
    top: 24px;
    left: 34px;
    z-index: 1;
    color: #ffffff;
    width: auto;
    max-width: min(55vw, 520px);
    padding-left: 0;
    border-left: 0;
    pointer-events: none;
}

.slide-kicker {
    display: block;
    font-size: 10px;
    letter-spacing: 0.42rem;
    text-transform: uppercase;
    margin-bottom: 8px;
    opacity: 0.98;
    font-weight: 600;
}

.slide-content h2 {
    font-size: clamp(2rem, 3vw, 3.6rem);
    line-height: 0.9;
    letter-spacing: -0.04em;
    text-transform: lowercase;
    text-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
    font-weight: 700;
}

.slide-gallery {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(100%, 820px);
    height: min(100%, 720px);
}

.slide-images {
    display: flex;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    width: min(100%, 700px);
    height: min(100%, 720px);
    padding: 0;
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.34);
    background: #15120f;
    border: 10px solid #f8f3eb;
    aspect-ratio: 4 / 5;
}

.slide-images::-webkit-scrollbar {
    display: none;
}

.photo-card {
    flex: 0 0 100%;
    height: 100%;
    width: 100%;
    margin: 0;
    overflow: hidden;
    scroll-snap-align: center;
    background: #15120f;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-card img,
.photo-card object,
.photo-card iframe {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.photo-card img {
    object-fit: contain;
    object-position: center;
}

.photo-card object,
.photo-card iframe {
    border: 0;
}

.slide-arrow {
    position: absolute;
    top: 50%;
    z-index: 2;
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    background: rgba(17, 14, 11, 0.22);
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transform: translateY(-50%);
}

.slide-arrow.left {
    left: 18px;
}

.slide-arrow.right {
    right: 18px;
}

.gallery-arrow {
    position: absolute;
    right: 4%;
    width: 42px;
    height: 42px;
    border: 1px solid var(--ink);
    border-radius: 50%;
    background: rgba(248, 244, 238, 0.9);
    color: var(--ink);
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.gallery-arrow:hover {
    background: var(--ink);
    color: var(--paper);
    transform: scale(1.05);
}

.gallery-arrow.left {
    top: calc(50% - 56px);
}

.gallery-arrow.right {
    top: calc(50% + 20px);
}

.gallery-status {
    position: absolute;
    right: 36px;
    bottom: 30px;
    font-size: 9px;
    letter-spacing: 0.26rem;
    text-transform: uppercase;
}

.slash {
    opacity: 0.5;
    margin: 0 5px;
}

.drag-label {
    position: absolute;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    font-size: 8px;
    letter-spacing: 0.26rem;
    text-transform: uppercase;
    color: var(--muted);
}

.overlay-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(72vw, 980px);
    height: min(68vh, 620px);
    background: var(--panel);
    border: 1px solid rgba(23, 21, 21, 0.78);
    z-index: 30;
    transform: translate(-50%, 125%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.75s cubic-bezier(0.77, 0, 0.18, 1), opacity 0.3s ease;
    box-shadow: 0 36px 78px rgba(0, 0, 0, 0.12);
}

.overlay-panel.active {
    transform: translate(-50%, -50%);
    opacity: 1;
    pointer-events: auto;
}

.close {
    position: absolute;
    top: 18px;
    right: 22px;
    border: none;
    background: transparent;
    color: var(--ink);
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
}

.panel-top {
    position: absolute;
    top: 24px;
    left: 28px;
    font-size: 9px;
    letter-spacing: 0.26rem;
    text-transform: uppercase;
    color: var(--muted);
}

.panel-body {
    position: absolute;
    left: 62px;
    bottom: 54px;
    max-width: 640px;
}

.panel-body h1 {
    font-size: clamp(3.4rem, 7vw, 7.2rem);
    line-height: 0.8;
    letter-spacing: -0.08em;
    margin-bottom: 22px;
}

.intro-text {
    font-size: 1.1rem;
    line-height: 1.35;
    margin-bottom: 18px;
    color: var(--muted);
}

.panel-body p:not(.intro-text) {
    max-width: 560px;
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 14px;
    color: rgba(23, 21, 21, 0.82);
}

.panel-accent {
    position: absolute;
    width: 88px;
    height: 88px;
    right: -130px;
    top: -18px;
    border-radius: 62% 38% 55% 45%;
}

.panel-accent.blue {
    background: linear-gradient(135deg, #a18b75, #d8c8b8);
}

.panel-accent.purple {
    background: linear-gradient(135deg, #8b7565, #c6b09a);
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 28px;
}

.contact-links a {
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid var(--ink);
    width: fit-content;
    padding-bottom: 5px;
    font-size: 12px;
    letter-spacing: 0.2rem;
    text-transform: uppercase;
}

.contact-links a:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.panel-bottom {
    position: absolute;
    right: 28px;
    bottom: 22px;
    font-size: 8px;
    letter-spacing: 0.24rem;
    text-transform: uppercase;
    color: var(--muted);
}

.site-footer {
    position: absolute;
    left: 36px;
    right: 36px;
    bottom: 18px;
    display: flex;
    justify-content: space-between;
    font-size: 8px;
    letter-spacing: 0.2rem;
    text-transform: uppercase;
    color: var(--muted);
    z-index: 5;
}

@media (max-width: 768px) {
    body {
        overflow-x: hidden;
        overflow-y: auto;
    }

    .page,
    .gallery {
        width: 100%;
        max-width: 100vw;
        height: auto;
        min-height: 100svh;
        overflow: visible;
    }

    .gallery {
        display: block;
        padding: 0 12px 48px;
    }

    .header {
        position: relative;
        padding: 16px 16px 0;
        align-items: center;
        display: flex;
        justify-content: space-between;
        gap: 12px;
    }

    .brand-block {
        gap: 6px;
        min-width: 0;
    }

    .brand {
        font-size: 1.2rem;
        letter-spacing: -0.03em;
    }

    .brand-subtitle {
        font-size: 7px;
        letter-spacing: 0.14rem;
    }

    .meta-tag {
        display: none;
    }

    .nav {
        flex: 0 0 auto;
        flex-direction: column;
        align-items: flex-end;
        gap: 2px;
        justify-self: end;
    }

    .nav button {
        letter-spacing: 0.06rem;
        font-size: 8px;
        padding: 10px 4px 6px;
    }

    .gallery-section-rail {
        position: sticky;
        left: auto;
        top: 0;
        bottom: auto;
        transform: none;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 14px;
        width: 100%;
        margin: 18px auto 8px;
        padding-left: 0;
        border-left: 0;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .gallery-section-rail::-webkit-scrollbar {
        display: none;
    }

    .gallery-section {
        font-size: 10px;
        letter-spacing: 0.08rem;
        padding: 8px 0;
    }

    .gallery-section::before {
        display: none;
    }

    .gallery-section.active {
        transform: none;
        font-size: 11px;
        letter-spacing: 0.1rem;
    }

    .gallery-window {
        width: 100%;
        height: auto;
        max-height: none;
        margin: 0 auto 54px;
        border-width: 6px;
        overflow: visible;
        scroll-snap-type: none;
        overscroll-behavior-y: auto;
    }

    .category-slide {
        display: block;
        height: auto;
        min-height: auto;
        padding: 28px 12px 52px;
        overflow: visible;
        scroll-snap-align: none;
    }

    .slide-content {
        position: relative;
        top: auto;
        left: auto;
        max-width: 76vw;
        margin-bottom: 14px;
    }

    .slide-content h2 {
        font-size: clamp(1.55rem, 8vw, 2.4rem);
    }

    .slide-gallery {
        left: auto;
        width: 100%;
        height: auto;
        max-height: none;
        min-height: 0;
        margin-left: 0;
        transform: none;
    }

    .slide-images {
        width: min(100%, 420px);
        max-width: 100%;
        height: auto;
        max-height: none;
        margin: 0 auto;
        aspect-ratio: 4 / 5;
        border-width: 6px;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .photo-card img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .photo-card {
        min-width: 100%;
        flex: 0 0 100%;
    }

    .slide-arrow {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .slide-arrow.left {
        left: 10px;
    }

    .slide-arrow.right {
        right: 10px;
    }

    .gallery-arrow.left {
        left: 3%;
        top: 50%;
        bottom: auto;
    }

    .gallery-arrow.right {
        right: 3%;
        top: 50%;
        bottom: auto;
    }

    .gallery-label {
        display: none;
    }

    .overlay-panel {
        width: 90vw;
        height: 75vh;
    }

    .panel-body {
        left: 26px;
        right: 26px;
        bottom: 42px;
    }

    .panel-body h1 {
        font-size: 3.5rem;
    }

    .intro-text {
        font-size: 1rem;
    }

    .site-footer {
        left: 20px;
        right: 20px;
        font-size: 7px;
        letter-spacing: 0.16rem;
    }
}

@media (max-width: 768px) {
    html,
    body {
        height: auto;
        min-height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
    }

    body,
    .page,
    .gallery,
    .gallery-window,
    .category-slide,
    .slide-gallery,
    .slide-images,
    .photo-card {
        max-width: 100%;
    }

    .page {
        height: auto;
        min-height: 100svh;
        overflow: visible;
    }

    .gallery {
        display: block;
        height: auto;
        min-height: 0;
        padding: 0 12px 48px;
        overflow: visible;
    }

    .gallery-window {
        width: 100%;
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .category-slide {
        display: block;
        height: auto;
        min-height: 0;
        padding: 28px 12px 52px;
        overflow: visible;
    }

    .slide-gallery {
        width: 100%;
        height: auto;
        margin: 0;
        transform: none;
    }

    .slide-images {
        width: min(100%, 420px);
        height: auto;
        aspect-ratio: 4 / 5;
        margin: 0 auto;
    }

    .photo-card {
        flex: 0 0 100%;
        min-width: 100%;
        height: 100%;
    }

    .photo-card img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
}
