:root {
    color-scheme: dark;
    --ink: #101014;
    --ink-soft: #1a1622;
    --cream: #ece8e2;
    --muted: #ada5b5;
    --violet: #9270c6;
    --lavender: #e7dff0;
    --paper: #e8e5e6;
    /* Предел для сайта: два семейства. Новые элементы используют эти переменные. */
    --font-body: "Inter", sans-serif;
    --font-technical: "Bank Gothic LT BT", var(--font-body);
    --accent-text: #cda9ff;
    --accent-secondary: #9270c6;
    --warm: var(--cream);
    --graphite: var(--ink-soft);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--cream); background: var(--ink); font: 400 16px/1.6 var(--font-body); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 5px; }
::selection { background: var(--violet); color: #fff; }
.skip-link { position: fixed; z-index: 1001; top: 12px; left: 12px; transform: translateY(-180%); padding: 10px 16px; background: #fff; color: #111; }
.skip-link:focus { transform: none; }
.editorial-width { width: min(100% - clamp(40px, 7vw, 150px), 1720px); margin-inline: auto; }
.section-kicker, .project-index { font: 600 11px/1.5 var(--font-technical); letter-spacing: .18em; text-transform: uppercase; }
.section-kicker { color: var(--accent-text); }
.period { color: var(--violet); }

/* Первый экран: исходный арт остаётся целиком видимым на широком экране. */
.hero { background: var(--paper); }
.site-topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 76px; padding: 16px clamp(22px, 4vw, 80px); background: var(--ink); color: var(--cream); }
.wordmark { flex: none; text-decoration: none; font: 700 clamp(15px, 1.3vw, 21px)/1 var(--font-technical); letter-spacing: .06em; }
.wordmark span { color: var(--accent-text); }
.header-actions { display: flex; flex: 1; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px clamp(20px, 3vw, 52px); min-width: 0; }
.main-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px clamp(16px, 2.6vw, 42px); }
.main-nav a { text-decoration: none; font-size: 12px; font-weight: 600; letter-spacing: .04em; }
.main-nav a:hover { color: var(--accent-text); }
.social-links { display: flex; align-items: center; gap: 4px; }
.social-link { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 50%; color: inherit; text-decoration: none; transition: color .2s ease, background-color .2s ease, transform .2s ease; }
.social-link svg { display: block; width: 22px; height: 22px; }
.social-link:hover { color: var(--accent-text); transform: translateY(-2px); }
.social-link--pending { opacity: .48; cursor: default; }
.social-link--pending:hover { color: inherit; transform: none; }
.hero-art { width: 100%; }
.hero-art img { display: block; width: 100%; height: auto; }
.hero-transition { display: flex; align-items: end; justify-content: center; min-height: clamp(110px, 16vh, 190px); padding: 0 24px 24px; background: linear-gradient(180deg, #d5d4dd 0%, #f8f4f6 100%); }
.hero-transition span { color: #514554; font: 600 11px/1 var(--font-technical); letter-spacing: .25em; }

/* Рассказ об авторе: светлый фон постепенно переходит в розовый. */
.about { overflow: clip; color: #29212d; background: linear-gradient(180deg, #f8f4f6 0%, #f8f4f6 38%, #f2b4c8 80%, var(--lavender) 100%); }
.about-layout { max-width: 1440px; padding-block: clamp(48px, 5vw, 90px) clamp(80px, 8vw, 130px); }
.about-heading { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); align-items: start; gap: 32px; }
.about .section-kicker { margin-top: 18px; color: #944d76; font-family: var(--font-body); }
.about h1 { margin: 0; font-size: clamp(70px, 8.2vw, 104px); line-height: 1; font-weight: 500; letter-spacing: -.075em; }
.about h1 em { color: #ad5889; font-weight: 400; }
.about-stories { display: grid; grid-template-columns: minmax(0, 680px); gap: clamp(48px, 14.5svh, 140px); margin-top: clamp(70px, 7vw, 115px); }
.about-story, .about-bottom p { font: 600 clamp(24px, 2.1vw, 31px)/1.32 var(--font-body); letter-spacing: -.035em; text-align: justify; text-align-last: left; overflow-wrap: break-word; }
.about-story { min-width: 0; }
.about-story p { margin: 0 0 24px; }
.about-story p:last-child { margin-bottom: 0; }
.about-lead { margin: 0; }
.about-lead strong { font-weight: inherit; }
.about-bottom { margin-top: clamp(55px, 9svh, 100px); padding-top: 30px; border-top: 1px solid rgb(54 42 60 / 25%); }
.about-bottom p { max-width: 680px; margin: 0; }
.inline-link { display: inline-flex; align-items: center; gap: 55px; padding: 12px 0; border-bottom: 1px solid currentColor; text-decoration: none; font: 600 12px/1.5 var(--font-technical); letter-spacing: .16em; }
.inline-link:hover { color: var(--accent-text); }
.inline-link span { font: 24px/1 var(--font-body); }

/* Полноширинный разделитель и две категории внутри него. */
.works-intro { min-height: 76svh; display: flex; align-items: center; padding-block: 12vh; background: var(--lavender); color: #21182c; }
.works-intro-inner { width: min(100% - clamp(40px, 7vw, 150px), 1720px); }
.works-intro .section-kicker { color: #685185; }
.works-intro h2 { margin: 8vh 0 7vh; font-size: clamp(82px, 17vw, 340px); line-height: .78; letter-spacing: -.095em; font-weight: 500; white-space: nowrap; }
.works-intro .period { color: #9a6fcb; }
.gallery-filter { display: flex; flex-wrap: wrap; gap: 20px clamp(30px, 6vw, 110px); }
.gallery-filter a { display: inline-flex; align-items: center; gap: 20px; padding: 14px 0; border-bottom: 1px solid #9a8aa6; color: #6b5977; font-size: clamp(16px, 1.5vw, 23px); text-decoration: none; }
.gallery-filter a:hover, .gallery-filter a[aria-current="page"] { color: #20132c; border-color: #20132c; }
.gallery-filter a[aria-current="page"] { font-weight: 700; }

/* Серии занимают всю ширину и чередуют цвет среды. */
.photoset { padding-block: clamp(90px, 11vw, 190px) clamp(100px, 12vw, 210px); background: #111015; color: var(--cream); }
.photoset:nth-of-type(3n + 2) { background: #2c1d39; }
.photoset:nth-of-type(3n) { background: #e3dfe8; color: #241c2b; }
.photoset-heading { padding-bottom: clamp(35px, 5vw, 90px); }
.photoset:nth-of-type(3n) .section-kicker { color: #694a86; }
.photoset-heading-main { display: flex; justify-content: space-between; align-items: end; gap: 28px; margin: 22px 0 18px; }
.photoset-heading h3 { max-width: 1280px; margin: 0; font-size: clamp(52px, 8vw, 155px); line-height: .95; letter-spacing: -.075em; font-weight: 500; overflow-wrap: anywhere; }
.photoset-kind { flex: none; padding-bottom: 8px; color: var(--muted); font: 600 11px/1.5 var(--font-technical); letter-spacing: .15em; text-transform: uppercase; }
.photoset:nth-of-type(3n) .photoset-kind { color: #645a69; }
.photoset-description { max-width: 690px; margin: 0; font-size: clamp(16px, 1.35vw, 21px); line-height: 1.65; opacity: .8; }
.photo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: clamp(180px, 40vh, 320px); gap: clamp(5px, .7vw, 12px); padding-inline: clamp(12px, 2vw, 38px); }
.photo-grid figure { position: relative; min-width: 0; margin: 0; overflow: hidden; background: #332b3b; }
.photo-link { display: block; width: 100%; height: 100%; cursor: zoom-in; }
.photo-grid img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-grid figcaption { position: absolute; inset: auto 0 0; padding: 30px 15px 12px; background: linear-gradient(transparent, rgb(0 0 0 / 75%)); color: #fff; font-size: 13px; pointer-events: none; }
.gallery-empty { padding-block: 110px; color: var(--muted); }
@media (min-width: 901px) {
    .photo-grid { grid-template-columns: repeat(10, minmax(0, 1fr)); grid-auto-rows: clamp(75px, 10vh, 110px); }
    .photo-grid figure { grid-row: span 3; }
    .photo-grid figure:nth-child(11n + 1), .photo-grid figure:nth-child(11n + 3), .photo-grid figure:nth-child(11n + 7) { grid-column: span 4; }
    .photo-grid figure:nth-child(11n + 2), .photo-grid figure:nth-child(11n + 4), .photo-grid figure:nth-child(11n + 5), .photo-grid figure:nth-child(11n + 6), .photo-grid figure:nth-child(11n + 8), .photo-grid figure:nth-child(11n + 9) { grid-column: span 2; }
    .photo-grid figure:nth-child(11n + 10), .photo-grid figure:nth-child(11n + 11) { grid-column: span 3; }
    .photo-grid figure:nth-child(11n + 4), .photo-grid figure:nth-child(11n + 5), .photo-grid figure:nth-child(11n + 6), .photo-grid figure:nth-child(11n + 7) { grid-row: span 4; }
}

/* Компактная очередь: бумажные карточки в одну горизонтальную ленту. */
.queue { display: flex; flex-direction: column; padding-block: clamp(76px, 8vw, 130px) clamp(48px, 6vw, 90px); }
@media (min-width: 901px) {
    .queue {
        min-height: 100svh;
        padding-block: clamp(150px, 16vh, 220px) clamp(64px, 8vh, 110px);
    }
}
.queue-return { margin-top: auto; padding-top: clamp(48px, 8vh, 96px); }
.queue-heading { flex: none; display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 34px; }
.queue h2 { margin: 18px 0 16px; font-size: clamp(42px, 5.5vw, 82px); line-height: 1; letter-spacing: -.065em; font-weight: 500; }
.queue-heading p { max-width: 520px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.queue-controls { display: flex; gap: 8px; padding-bottom: 2px; }
.queue-controls[hidden] { display: none; }
.queue-controls button { width: 44px; height: 44px; padding: 0; border: 1px solid #6e5f7b; border-radius: 50%; background: transparent; color: var(--cream); font: 23px/1 var(--font-body); cursor: pointer; }
.queue-controls button:hover:enabled { background: #34253f; border-color: var(--accent-text); }
.queue-controls button:disabled { opacity: .28; cursor: default; }
.project-list { flex: none; display: flex; align-items: stretch; gap: 14px; width: 100%; margin: 0; padding: 4px max(clamp(20px, 3.5vw, 75px), calc((100% - 1720px) / 2)) 22px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding-inline: max(clamp(20px, 3.5vw, 75px), calc((100% - 1720px) / 2)); scrollbar-color: #9e82bc #2a2232; scrollbar-width: thin; list-style: none; }
.project-list:focus-visible { outline: 2px solid var(--accent-text); outline-offset: -2px; }
.project-card { display: flex; flex: 0 0 276px; flex-direction: column; align-items: flex-start; min-width: 0; min-height: 310px; padding: 22px; border-top: 4px solid #a78ac4; background: #f0edf3; color: #24202a; scroll-snap-align: start; }
.project-card:nth-child(even) { background: #e9e2ef; }
.project-index { color: #74637f; font-size: 9px; letter-spacing: .12em; }
.project-title { width: 100%; min-height: 90px; margin-top: 17px; }
.project-title h3 { margin: 0; font-size: 27px; line-height: 1.13; letter-spacing: -.055em; font-weight: 600; overflow-wrap: anywhere; }
.project-title p { margin: 8px 0 0; color: #64586e; font-size: 13px; overflow-wrap: anywhere; }
.project-kind { margin: 12px 0 8px; color: #66566f; font-size: 11px; font-weight: 600; }
.status { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 5px 8px; background: #e1d2ef; color: #5c337f; font-size: 10px; line-height: 1.4; }
.status::before { content: ""; width: 5px; height: 5px; flex: none; border-radius: 50%; background: currentColor; }
.status--planned { background: #e3e0e8; color: #6a6274; }
.status--selection { background: #eee2cb; color: #795922; }
.project-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; margin: auto 0 0; padding-top: 26px; }
.project-dates dt { margin: 0 0 5px; color: #75687e; font-size: 9px; }
.project-dates dd { margin: 0; font-size: 13px; font-weight: 500; }
.project-dates div:last-child dd { color: #4a2d66; font-weight: 700; }
.project-empty { padding-block: 36px; color: var(--muted); }

/* Фиолетовый футер сразу после чёрной секции очереди. */
.site-footer { background: #1b1423; }
.footer-contact-bar { background: inherit; color: var(--cream); }
.footer-contact-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px 40px; min-height: 170px; padding-block: 32px; }
.footer-contact-brand { font: 700 clamp(21px, 2.6vw, 40px)/1 var(--font-technical); letter-spacing: -.04em; }
.footer-contact-brand span { color: var(--accent-text); }
.footer-copyright { padding-block: 24px 36px; border-top: 1px solid #493b55; font-size: 13px; line-height: 1.65; }
.footer-copyright p { margin: 0; }
.footer-copyright > p:first-child { font-weight: 600; }
.footer-copyright .footer-notice { max-width: 1000px; margin-top: 14px; color: #c6bbcf; }
.social-links--footer { gap: 9px; }
.social-links--footer .social-link { width: 48px; height: 48px; background: #34283e; color: var(--cream); }
.social-links--footer .social-link:hover { background: #785592; color: #fff; }

/* Существующий просмотр фото и управление с клавиатуры. */
.photo-viewer { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 68px 20px 88px; border: 0; color: var(--cream); background: var(--ink); }
.photo-viewer[open] { display: flex; align-items: center; justify-content: center; }
.photo-viewer::backdrop { background: rgb(0 0 0 / 90%); }
.photo-viewer-image { display: block; width: auto; height: auto; min-width: 0; min-height: 0; max-width: 100%; max-height: 100%; object-fit: contain; }
.photo-viewer-close, .photo-viewer-controls button { min-height: 44px; padding: 9px 16px; border: 1px solid #746b7d; color: var(--cream); background: #24202b; font: 500 13px/1.3 var(--font-body); cursor: pointer; }
.photo-viewer-close { position: absolute; top: 16px; right: 20px; }
.photo-viewer-controls { position: absolute; right: 16px; bottom: 16px; left: 16px; display: flex; align-items: center; justify-content: center; gap: 14px; }
.photo-viewer-controls button:hover, .photo-viewer-close:hover { border-color: var(--accent-text); }
.photo-viewer-controls button:disabled { opacity: .4; cursor: default; }
.photo-viewer-controls [data-photo-counter] { min-width: 55px; text-align: center; white-space: nowrap; font-size: 13px; }
html.photo-viewer-open { overflow: hidden; }

@media (max-width: 900px) {
    .about-heading { grid-template-columns: 1fr; gap: 18px; }
    .about .section-kicker { margin-top: 0; }
    .works-intro h2 { font-size: clamp(75px, 16vw, 170px); }
}
@media (max-width: 700px) {
    .site-topbar { align-items: flex-start; flex-direction: column; min-height: 0; gap: 16px; padding-block: 17px; }
    .header-actions { width: 100%; justify-content: space-between; gap: 10px 20px; }
    .main-nav { justify-content: flex-start; gap: 8px 18px; }
    .main-nav a { font-size: 11px; }
    .hero-art { min-height: 58svh; }
    .hero-art img { width: 100%; height: 58svh; object-fit: cover; object-position: center; }
    .hero-transition { min-height: clamp(110px, 16svh, 160px); }
    .about-layout { padding-block: 52px 76px; }
    .about h1 { font-size: clamp(58px, 12vw, 82px); }
    .about-stories { margin-top: 52px; }
    .about-story, .about-bottom p { font-size: 26px; }
    .works-intro { min-height: 68svh; }
    .works-intro h2 { font-size: clamp(72px, 15vw, 130px); margin-block: 60px; }
    .gallery-filter { gap: 15px 32px; }
    .photoset-heading-main { align-items: start; flex-direction: column; }
    .photoset-heading h3 { font-size: clamp(53px, 12vw, 100px); }
    .photo-grid { grid-template-columns: 1fr; grid-auto-rows: clamp(250px, 60vh, 540px); padding-inline: 10px; }
    .queue-heading { align-items: start; }
    .queue-controls { padding-top: 35px; }
    .queue-heading p { font-size: 11px; }
    .project-card { flex-basis: min(276px, 82vw); }
    .footer-contact-inner { min-height: 0; padding-block: 36px; }
}
@media (max-width: 380px) {
    .works-intro h2 { font-size: 19vw; }
    .photo-viewer-controls { gap: 8px; }
    .photo-viewer-controls button { padding-inline: 10px; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: .01ms !important; }
}
