:root {
  --bg: #050505;
  --ink: #111111;
  --fg: #f3f2ee;
  --dim: rgba(243, 242, 238, 0.5);
  --line: rgba(243, 242, 238, 0.14);
  --gut: clamp(16px, 1.6vw, 28px);
  --gap: clamp(6px, 0.55vw, 10px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sans: "Inter Tight", "Helvetica Neue", Arial, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
ul, ol { list-style: none; margin: 0; padding: 0; }
p, h1, h2 { margin: 0; }
::selection { background: var(--fg); color: var(--bg); }

.mono {
  font-family: var(--mono);
  font-size: clamp(10px, 0.72vw, 12px);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.5;
}
.dim { color: var(--dim); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Film grain */
.grain {
  position: fixed; inset: -50%; z-index: 90; pointer-events: none; opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.9s steps(4) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 25% { transform: translate(-3%, 2%); }
  50% { transform: translate(2%, -3%); } 75% { transform: translate(-2%, -1%); } 100% { transform: translate(0, 0); }
}

/* Header */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 14px var(--gut);
  mix-blend-mode: difference;
}
.nav__mark img { width: 22px; height: auto; transition: transform 0.6s var(--ease); }
.nav__mark:hover img { transform: rotate(-8deg) scale(1.1); }
.nav__clock { color: var(--dim); }
.nav__links { margin-left: auto; display: flex; gap: clamp(16px, 2.6vw, 44px); }
.nav__links a { position: relative; padding: 4px 0; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform 0.5s var(--ease);
}
.nav__links a:hover::after, .nav__links a.is-active::after { transform: scaleX(1); transform-origin: left; }

/* Hero */
.hero { padding: 64px var(--gut) 0; }
.wordmark svg { width: 100%; height: auto; overflow: visible; }
.hero__claim {
  margin-top: clamp(18px, 2.4vw, 44px);
  font-weight: 700; text-transform: uppercase; letter-spacing: -0.01em;
  font-size: clamp(30px, 5.4vw, 92px); line-height: 0.92;
}
.hero__tags { margin-top: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); color: var(--dim); }

/* "р" → "R": the leg slides out of the bowl (clipped above the bowl's lower edge) */
.r-leg { transform: translate(-96px, -101px); transition: transform 1s var(--ease); }
.leg-on .r-leg { transform: translate(0, 0); transition-duration: 0.9s; transition-timing-function: cubic-bezier(0.34, 1.4, 0.64, 1); }

/* Language switch */
.lang { display: flex; gap: 2px; }
.lang button { padding: 4px 6px; color: var(--dim); text-transform: uppercase; transition: color 0.3s, background 0.3s; }
.lang button:hover { color: var(--fg); }
.lang button[aria-pressed="true"] { color: var(--bg); background: var(--fg); }

/* Focus block */
.focus { padding: clamp(80px, 10vw, 170px) var(--gut) 0; }
.focus__title {
  display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap;
  padding: clamp(20px, 2.4vw, 40px) 0 clamp(14px, 1.4vw, 24px);
  font-weight: 800; text-transform: uppercase; letter-spacing: -0.02em;
  font-size: clamp(42px, 8.4vw, 160px); line-height: 0.86;
}
.focus__title i { font-style: normal; font-weight: 400; letter-spacing: 0.02em; padding-bottom: 0.6em; transition: transform 0.5s var(--ease); }
.focus__title:hover i { transform: translateX(6px); }
.focus__grid {
  display: grid; gap: var(--gap); grid-template-columns: repeat(6, 1fr); grid-auto-flow: dense;
  grid-auto-rows: calc(((100vw - 2 * var(--gut) - 5 * var(--gap)) / 3 + var(--gap)) * 0.5625);
}
.focus__item { position: relative; overflow: hidden; grid-column: span 2; background: var(--ink); }
.focus__item--big { grid-column: span 4; grid-row: span 2; }
.focus__item img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--ease), opacity 0.6s; }
.focus__item:hover img { transform: scale(1.05); }
.focus__grid:hover .focus__item:not(:hover) img { opacity: 0.6; }
@media (hover: hover) and (pointer: fine) { .focus__item { cursor: none; } }

/* Eyes */
.eye__pupil { transition: transform 0.25s ease-out; }
.eye__lid { transform-box: fill-box; transform-origin: center; animation: blink 6s infinite; }
.eye + .eye .eye__lid { animation-delay: 0.04s; }
@keyframes blink { 0%, 95%, 100% { transform: scaleY(1); } 97% { transform: scaleY(0.08); } }

/* Showreel */
.reel { position: relative; margin: var(--gap) var(--gut) 0; aspect-ratio: 16 / 9; max-height: 86vh; width: auto; overflow: hidden; background: var(--ink); }
.reel__video { width: 100%; height: 100%; object-fit: cover; }
.reel__meta {
  position: absolute; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; padding: 12px;
}
.reel__meta span, .tile__tag { background: rgba(0, 0, 0, 0.55); padding: 5px 7px; line-height: 1; }

/* Section heads */
.section-head {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 14px 0; color: var(--dim); border-bottom: 1px solid var(--line);
}
.only-touch { display: none; }
@media (hover: none) { .only-hover { display: none; } .only-touch { display: inline; } }

/* Work grid */
.work { padding: clamp(48px, 7vw, 120px) var(--gut) 0; }
.grid {
  margin-top: var(--gap);
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: calc((100vw - 2 * var(--gut) - 3 * var(--gap)) / 4 * 0.62);
}
.t-a { grid-column: 1 / 3; grid-row: 1 / 3; }
.t-b { grid-column: 3; grid-row: 1; }
.t-c { grid-column: 4; grid-row: 1 / 3; }
.t-d { grid-column: 3; grid-row: 2; }
.t-e { grid-column: 1; grid-row: 3; }
.t-f { grid-column: 2; grid-row: 3; }
.t-g { grid-column: 3 / 5; grid-row: 3 / 5; }
.t-h { grid-column: 1; grid-row: 4; }
.t-i { grid-column: 2; grid-row: 4; }

.tile {
  position: relative; overflow: hidden; background: var(--ink);
  cursor: pointer; outline-offset: 3px;
}
.tile img, .tile video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: opacity 0.7s var(--ease), transform 1.4s var(--ease);
}
.tile__poster { transform: scale(1.001); }
.tile video { opacity: 0; transform: scale(1.08); }
.tile .tile__slide { opacity: 0; transform: scale(1.08); }
.tile .tile__slide.is-on { opacity: 1; transform: scale(1); }
.tile.is-live video { opacity: 1; transform: scale(1); }
.tile.is-live .tile__poster { transform: scale(1.04); }
.tile__tag {
  position: absolute; top: 10px; z-index: 2; opacity: 0;
  transition: opacity 0.5s var(--ease);
}
.tile__tag--l { left: 10px; }
.tile__tag--r { right: 10px; }
.tile__cap {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: clamp(10px, 1vw, 16px);
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.78) 38%);
  padding-top: 40px;
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.tile__title {
  font-weight: 700; text-transform: uppercase; line-height: 0.92; letter-spacing: -0.01em;
  font-size: clamp(18px, 1.9vw, 36px);
}
.tile--big .tile__title { font-size: clamp(22px, 3vw, 54px); }
.tile__meta { margin-top: 6px; color: rgba(243, 242, 238, 0.75); }
.tile:hover .tile__tag, .tile:focus-visible .tile__tag,
.tile:hover .tile__cap, .tile:focus-visible .tile__cap { opacity: 1; transform: none; }
.grid:hover .tile:not(:hover) .tile__poster { opacity: 0.55; }
@media (hover: none) {
  .tile__cap, .tile__tag { opacity: 1; transform: none; }
}

/* Studio */
.studio { padding: clamp(80px, 12vw, 200px) var(--gut) 0; }
.statement {
  display: grid; grid-template-columns: 1fr minmax(180px, 22%); gap: 32px; align-items: end;
  padding-bottom: clamp(40px, 6vw, 96px); margin-bottom: clamp(40px, 6vw, 96px);
  border-bottom: 1px solid var(--line);
}
.statement__big {
  font-weight: 700; text-transform: uppercase; letter-spacing: -0.015em;
  font-size: clamp(34px, 6.2vw, 112px); line-height: 0.9;
}
.statement__big--mid { font-size: clamp(26px, 3.9vw, 70px); line-height: 0.95; }
.statement__side { color: var(--dim); display: grid; gap: 14px; }
.statement__side p:first-child { color: var(--fg); }

.services li {
  display: grid; grid-template-columns: 60px 1fr minmax(180px, 30%); align-items: baseline; gap: 16px;
  padding: clamp(14px, 1.6vw, 24px) 0; border-bottom: 1px solid var(--line);
  transition: padding 0.5s var(--ease), color 0.5s;
}
.services li:first-child { border-top: 1px solid var(--line); }
.services b { font-weight: 600; text-transform: uppercase; font-size: clamp(20px, 2.6vw, 44px); line-height: 1; letter-spacing: -0.01em; }
.services li:hover { padding-left: 14px; }

/* Author */
.author { padding: clamp(80px, 12vw, 200px) var(--gut) 0; }
.author__name {
  margin: clamp(24px, 3vw, 48px) 0;
  font-weight: 800; text-transform: uppercase; letter-spacing: -0.02em;
  font-size: clamp(48px, 11vw, 200px); line-height: 0.86;
}
.author__cols { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 72px); }
.label { margin-bottom: 10px; }
.biglist { margin-bottom: 12px; }
.biglist li {
  font-weight: 700; text-transform: uppercase; letter-spacing: -0.01em;
  font-size: clamp(26px, 3.6vw, 64px); line-height: 1; padding: 8px 0; border-bottom: 1px solid var(--line);
}
.biglist a { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.biglist i, .contact__list i { font-style: normal; font-size: 0.6em; transition: transform 0.5s var(--ease); }
.biglist a:hover i, .contact__list a:hover i { transform: translate(4px, -4px); }
.biglist a:hover { color: var(--dim); }

/* Contact */
.contact { padding: clamp(80px, 12vw, 200px) var(--gut) clamp(60px, 8vw, 120px); }
.contact__big {
  margin: clamp(24px, 3vw, 48px) 0;
  font-weight: 800; text-transform: uppercase; letter-spacing: -0.02em;
  font-size: clamp(48px, 11vw, 200px); line-height: 0.86;
}
.contact__list a {
  display: grid; grid-template-columns: minmax(110px, 22%) 1fr auto; align-items: baseline; gap: 16px;
  padding: clamp(12px, 1.4vw, 20px) 0; border-bottom: 1px solid var(--line);
  transition: padding 0.5s var(--ease), color 0.3s;
}
.contact__list li:first-child a { border-top: 1px solid var(--line); }
.contact__list b { font-weight: 600; font-size: clamp(22px, 3vw, 52px); line-height: 1; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.contact__list a:hover { padding-left: 14px; color: var(--dim); }

/* Footer */
.footer { padding: 0 var(--gut) 14px; overflow: hidden; }
.footer__mark svg { width: 100%; height: auto; overflow: visible; }
.footer__row { display: flex; justify-content: space-between; gap: 16px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--dim); }
.footer__row a:hover { color: var(--fg); }

/* Project overlay */
.project {
  position: fixed; inset: 0; z-index: 70; background: var(--bg);
  display: flex; flex-direction: column;
  clip-path: inset(100% 0 0 0); transition: clip-path 0.8s var(--ease);
}
.project.is-open { clip-path: inset(0 0 0 0); }
.project__bar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 14px var(--gut); border-bottom: 1px solid var(--line);
}
.project__ctrl { display: flex; gap: clamp(12px, 2vw, 32px); }
.project__ctrl button:hover { color: var(--dim); }
.project__scroll { overflow-y: auto; flex: 1; padding: 0 var(--gut) var(--gut); overscroll-behavior: contain; }
.project__head {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--gut); align-items: end;
  padding: clamp(28px, 5vw, 80px) 0 clamp(20px, 2.4vw, 40px);
}
.project__title {
  font-weight: 800; text-transform: uppercase; letter-spacing: -0.02em;
  font-size: clamp(42px, 8vw, 150px); line-height: 0.86;
}
.project__lead { font-size: clamp(17px, 1.4vw, 24px); line-height: 1.3; margin-bottom: 14px; max-width: 34em; }
.project__links { margin-top: 18px; }
.project__links a {
  display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: clamp(11px, 0.8vw, 13px); text-transform: uppercase;
  transition: padding 0.4s var(--ease);
}
.project__links li:first-child a { border-top: 1px solid var(--line); }
.project__links a:hover { padding-left: 10px; }
.project__media { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap); }
.project__media > * { width: 100%; background: var(--ink); aspect-ratio: 16 / 9; object-fit: cover; }
.project__media > :first-child { grid-column: 1 / -1; }
.project__media .is-tall { aspect-ratio: auto; height: 100%; object-fit: cover; }

/* Cursor */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none;
  width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
  border: 1.5px solid rgba(243, 242, 238, 0.85);
  display: grid; place-items: center;
  transition: width 0.45s var(--ease), height 0.45s var(--ease), margin 0.45s var(--ease), background 0.45s, opacity 0.3s, border-color 0.3s;
  opacity: 0; mix-blend-mode: difference;
}
.cursor__label { font-family: var(--mono); font-size: 10px; text-transform: uppercase; opacity: 0; transition: opacity 0.3s; color: #000; }
.cursor.is-visible { opacity: 1; }
.cursor.is-view { width: 96px; height: 96px; margin: -48px 0 0 -48px; background: var(--fg); border-color: var(--fg); mix-blend-mode: normal; }
.cursor.is-view .cursor__label { opacity: 1; }
.cursor.is-link { width: 14px; height: 14px; margin: -7px 0 0 -7px; background: var(--fg); }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }
@media (hover: hover) and (pointer: fine) { .tile { cursor: none; } }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.reveal-mark svg { clip-path: inset(0 0 100% 0); transform: translateY(6%); transition: clip-path 1.3s var(--ease), transform 1.3s var(--ease); }
.reveal-mark.is-in svg { clip-path: inset(-20% 0 -2% 0); transform: none; }
.grid .tile { opacity: 0; transform: translateY(24px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.grid .tile.is-in { opacity: 1; transform: none; }

/* Tablet */
@media (max-width: 1000px) {
  .grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: calc((100vw - 2 * var(--gut) - var(--gap)) / 2 * 0.62); }
  .t-a, .t-g { grid-column: 1 / -1; grid-row: span 2; }
  .t-b, .t-d, .t-e, .t-f, .t-h, .t-i { grid-column: auto; grid-row: auto; }
  .t-c { grid-column: auto; grid-row: span 2; }
  .grid { grid-auto-flow: dense; }
  .project__head { grid-template-columns: 1fr; }
}

/* Phone */
@media (max-width: 640px) {
  .nav { gap: 14px; }
  .nav { flex-wrap: wrap; row-gap: 6px; }
  .nav__links { gap: 12px; order: 3; width: 100%; margin-left: 0; justify-content: space-between; }
  .lang { margin-left: auto; }
  .hero { padding-top: 84px; }
  .focus__grid { grid-template-columns: 1fr 1fr; grid-auto-rows: auto; }
  .focus__item { grid-column: span 1; aspect-ratio: 16 / 9; }
  .focus__item--big { grid-column: span 2; grid-row: auto; }
  .section-head .only-hover, .section-head .only-touch { text-align: right; }
  .grid { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .grid .tile { grid-column: auto !important; grid-row: auto !important; aspect-ratio: 16 / 10; }
  .grid .t-c, .grid .t-i { aspect-ratio: 4 / 5; }
  .statement { grid-template-columns: 1fr; gap: 18px; }
  .services li { grid-template-columns: 34px 1fr; }
  .services li > span.dim { grid-column: 2; }
  .author__cols { grid-template-columns: 1fr; gap: 40px; }
  .contact__list a { grid-template-columns: 1fr auto; }
  .contact__list a > span { grid-column: 1 / -1; }
  .project__media { grid-template-columns: 1fr; }
  .project__ctrl button[data-p-prev], .project__ctrl button[data-p-next] { display: none; }
  .footer__row { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grain, .eye__lid { animation: none; }
  .reveal, .reveal-mark svg, .grid .tile { opacity: 1; transform: none; clip-path: none; transition: none; }
  .tile img, .tile video, .project { transition: none; }
}
