:root {
  font: 16px/1.5 var(--body-font);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--ink); color: var(--light); }
body:has(dialog[open]) { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.shell { width: min(1600px, calc(100% - 72px)); margin-inline: auto; }
.top { min-height: 65px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.logo { width: 83px; height: 49px; display: grid; place-items: center; }
.logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
nav, .viewer-bar { display: flex; align-items: center; gap: clamp(10px, 3vw, 38px); font-size: .8rem; }
nav a:hover, .viewer-bar button:hover { color: var(--accent); }
#language, #detail-language { display: flex; gap: .35rem; padding: .4rem 0 .4rem .35rem; }
#language span, #detail-language span { display: block; padding: .1rem .36rem; border: 1px solid transparent; }
html[lang="ru"] button[id$="language"] span:first-child,
html[lang="en"] button[id$="language"] span:last-child { border-color: currentColor; }
.masthead { display: flex; justify-content: space-between; align-items: end; gap: 2vw; padding: 13px 0 20px; }
h1, h2 { margin: 0; font-family: var(--display-font); font-weight: 400; line-height: .91; letter-spacing: -.055em; }
h1 { width: fit-content; font-size: clamp(64px, min(12vw, 18dvh), 178px); }
h1 span { display: inline-block; transform: translateY(var(--lift, 0px)) rotate(var(--turn, 0deg)); transition: transform .19s ease; }
.masthead p { white-space: pre-line; margin: 0 0 3px; color: var(--muted); text-align: right; font-size: .82rem; }
.showcase { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 8px; height: min(630px, calc(100dvh - 112px - clamp(64px, min(12vw, 18dvh), 178px))); min-height: 300px; padding: 4px 0 10px; }
.tile { min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; border: 1px solid var(--line); background: var(--surface); }
.tile:first-child { grid-column: span 2; grid-row: span 2; }
.tile:hover { border-color: var(--accent); }
.tile-art { overflow: hidden; background: var(--ink); }
.tile img, .tile video { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .32s ease; }
.tile:hover :is(img, video) { transform: scale(1.045); }
.tile-caption { min-width: 0; padding: 6px 9px; display: flex; flex-direction: column; line-height: 1.17; }
.tile-caption strong { font: 500 clamp(12px, 1.45vw, 23px)/1.15 var(--display-font); }
.tile:first-child strong { font-size: clamp(19px, 2.8vw, 40px); }
.tile-caption small { font-size: clamp(9px, .8vw, 13px); color: var(--muted); margin-top: 3px; }
.work-nav { display: none; }
dialog { inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; color: var(--light); background: var(--night-wall) fixed; overflow-y: auto; overscroll-behavior: contain; }
.viewer-bar { position: sticky; top: 0; z-index: 1; justify-content: space-between; padding: 8px max(5vw, 18px); background: var(--ink); color: var(--light); border-bottom: 1px solid var(--line); }
.viewer-bar button { min-height: 38px; padding-left: 0; }
#detail { width: min(1200px, calc(100% - 10vw)); margin: auto; padding-block: clamp(34px, 6vw, 80px); }
h2 { font-size: clamp(46px, 9vw, 130px); overflow-wrap: anywhere; }
.kind { margin: 0 0 12px; letter-spacing: .05em; font-size: .82rem; color: var(--muted); }
.lead { font-size: clamp(17px, 2.4vw, 26px); line-height: 1.45; max-width: 42em; margin: 24px 0; }
h3 { font: 400 clamp(25px, 4vw, 45px)/1.1 var(--display-font); margin: 0 0 15px; color: var(--accent); }
h4 { margin: 0 0 9px; font-family: var(--display-font); font-weight: 400; }
#detail section { border-top: 1px solid var(--line); margin-top: clamp(32px, 6vw, 70px); padding-top: 16px; }
.text-section p { max-width: 64ch; margin: 0; }
.screen-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 18px; }
.screen-list.vertical { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.screen-list video { display: block; width: 100%; max-height: 72dvh; aspect-ratio: 16 / 9; background: var(--ink); }
.screen-list.vertical video { aspect-ratio: 9 / 16; max-width: 360px; }
.gallery { position: relative; }
.gallery h3 { padding-right: 98px; }
.gallery-controls { display: flex; gap: 5px; position: absolute; top: 12px; right: 0; }
.gallery-controls button, .work-nav button { border: 1px solid currentColor; width: 38px; height: 38px; }
.gallery-rail { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; }
.gallery-rail figure { flex: 0 0 clamp(245px, 43%, 480px); margin: 0; scroll-snap-align: start; }
.gallery-rail img { display: block; width: 100%; height: clamp(230px, 48vw, 510px); object-fit: contain; background: var(--ink); border: 1px solid var(--line); }
.gallery-rail figcaption { padding: 8px 0; }
.gallery-rail p { margin: 4px 0 0; max-width: 46ch; }
.responses blockquote { margin: 0 0 22px; border-left: 1px solid; padding-left: 14px; }
.responses p { margin: 0 0 6px; }
.responses cite { font-style: normal; }
.responses a { display: block; width: fit-content; margin-top: 7px; }
.responses a, .text-link, .contact-links a, .video-fallback { text-decoration: underline; text-underline-offset: .2em; }
.contact-links { display: flex; flex-wrap: wrap; gap: 14px 25px; margin-top: 25px; }
.project-discuss { display: inline-block; background: var(--accent); color: var(--ink); padding: 10px 18px; border-radius: 2px; }
.project-discuss:hover { background: var(--accent-hover); }
.project-title { font-size: clamp(27px, 4.5vw, 66px); line-height: 1.05; }
.featured-media { margin: 20px auto 18px; text-align: center; }
.featured-media p, .featured-media figcaption { margin: 5px 0; font-size: .85rem; }
.featured-media video, .featured-media img { display: block; max-width: 100%; margin-inline: auto; background: var(--ink); object-fit: contain; outline: 1px solid var(--line); box-shadow: 0 15px 45px #09060d9c; }
.featured-media video { width: min(100%, var(--video-width)); aspect-ratio: var(--video-ratio); }
.featured-media img { max-height: 76dvh; }
.featured-media + .project-discuss { display: table; margin-inline: auto; }
.project-category { display: inline-block; margin-bottom: 14px; border-bottom: 1px solid currentColor; color: var(--accent); font-size: .8rem; }
#viewer[open] #detail { animation: project-in .5s cubic-bezier(.2,.7,.25,1) both; }
@keyframes project-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #viewer[open] #detail { animation: none; } }
.series-list { margin: 32px 0 0; padding: 0; list-style: none; max-width: 780px; border-top: 1px solid var(--line); }
.series-list a { display: grid; grid-template-columns: 1fr auto; column-gap: 16px; padding: 16px 0; align-items: center; border-bottom: 1px solid var(--line); }
.series-list a:hover { color: var(--accent); }
.series-list strong { font: 400 clamp(24px, 4vw, 43px)/1.08 var(--display-font); }
.series-list small { grid-column: 1; margin-top: 4px; }
.series-arrow { grid-column: 2; grid-row: 1 / 3; }
@media (max-width: 760px) {
  .shell { width: calc(100% - 30px); }
  .top { min-height: 57px; }
  .logo { width: 67px; height: 42px; }
  .masthead { display: block; padding-block: 13px; }
  h1 { font-size: clamp(61px, 17vw, 105px); }
  .masthead p { text-align: left; margin: 7px 0 0; }
  .showcase { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; height: clamp(215px, calc(100svh - 280px), 510px); min-height: 0; gap: 8px; padding: 4px 1px 6px; }
  .tile { flex: 0 0 100%; scroll-snap-align: start; }
  .tile-caption { padding: 9px 10px; }
  .tile-caption strong, .tile:first-child strong { font-size: 22px; }
  .tile-caption small { font-size: 11px; }
  .work-nav { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 6px 0 9px; font-size: .8rem; }
  .work-nav button:disabled { opacity: .4; cursor: default; }
  .gallery-rail figure { flex-basis: 85%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  h1 span, .tile:hover :is(img, video) { transform: none; }
}
