/* JACUB Architecture — макет на бумаге, один красный квадрат */

@font-face {
  font-family: 'Montserrat';
  src: url('../assets/fonts/montserrat.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #efece6;
  --ink: #2b2a29;
  --red: #c32422;
  --night: #161514;
  --pad: clamp(20px, 4.2vw, 72px);
  --header-h: 84px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --n: 0; /* 0 — день, 1 — ночь; задаётся из сцены */
  --fg: color-mix(in srgb, var(--paper) calc(var(--n) * 100%), var(--ink));
  --bg: color-mix(in srgb, var(--night) calc(var(--n) * 100%), var(--paper));
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

html.is-locked {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Montserrat', 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

h1, h2, h3, h4, p, dl, dd, ol, ul, figure {
  margin: 0;
}

ol, ul {
  padding: 0;
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

::selection {
  background: var(--red);
  color: #fff;
}

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.skip {
  position: fixed;
  left: 12px;
  top: -80px;
  z-index: 200;
  padding: 12px 18px;
  background: var(--ink);
  color: var(--paper);
}

.skip:focus {
  top: 12px;
}

/* ───── типографика ───── */

.display {
  font-weight: 300;
  font-size: clamp(2.6rem, 5.7vw, 6.4rem);
  line-height: 1;
  letter-spacing: -0.035em;
}

.ln {
  display: block;
  overflow: hidden;
  padding-bottom: 0.16em;
  margin-bottom: -0.16em;
}

.ln > span {
  display: block;
}

.label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.label::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--red);
  flex: none;
}

.lead {
  font-size: clamp(1rem, 1.25vw, 1.2rem);
  line-height: 1.6;
  max-width: 34em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 18px 28px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-size: 0.71875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: background 0.35s, border-color 0.35s, color 0.35s;
}

.btn:hover {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.btn--small {
  padding: 12px 18px;
  background: transparent;
  border-color: currentColor;
  color: inherit;
}

.btn--light {
  background: #fff;
  border-color: #fff;
  color: var(--ink);
}

.btn--light:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.link {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 0;
  font-size: 0.71875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  transition: background-size 0.5s var(--ease);
}

.link:hover {
  background-size: 0 1px;
  background-position: 100% 100%;
}

.link span {
  font-weight: 400;
  letter-spacing: 0.08em;
  opacity: 0.6;
}

/* ───── загрузка ───── */

.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--paper);
  transition: transform 1s var(--ease), visibility 0s 1s;
}

html:not(.js) .loader,
.is-ready .loader {
  transform: translateY(-100%);
  visibility: hidden;
}

.loader-mark,
.gate-square {
  position: relative;
  width: 34vmin;
  aspect-ratio: 1;
  background: var(--red);
  color: #fff;
}

.loader-mark {
  width: clamp(96px, 16vmin, 150px);
  container-type: inline-size;
}

.loader-mark span,
.gate-square span {
  position: absolute;
  left: 0;
  bottom: 0;
  font-weight: 600;
  line-height: 0.74;
  letter-spacing: -0.005em;
}

.loader-mark span {
  font-size: 28.4cqw;
}

.loader-count {
  position: absolute;
  left: var(--pad);
  bottom: calc(var(--pad) * 0.8);
  font-size: clamp(2.6rem, 7vw, 6rem);
  font-weight: 200;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.loader-count i {
  font-style: normal;
  font-size: 0.3em;
  margin-left: 0.3em;
  letter-spacing: 0;
}

/* ───── холст ───── */

#scene {
  position: fixed;
  inset: 0 0 auto 0;
  width: 100%;
  height: 100vh;
  height: 100lvh;
  z-index: 0;
  pointer-events: none;
}

.no-webgl #scene {
  display: none;
}

main {
  position: relative;
  z-index: 1;
}

/* ───── шапка ───── */

.header {
  --hc: var(--ink);
  --hbg: var(--paper);
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 48px);
  color: var(--hc);
  transition: color 0.4s, opacity 0.4s, visibility 0s;
}

/* финальный переход: шапка уступает место логотипу */
.header[data-theme='hidden'] {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s, visibility 0s 0.4s;
}

.header::before {
  content: '';
  position: absolute;
  inset: 0 0 -24px 0;
  z-index: -1;
  background: linear-gradient(var(--hbg) 30%, transparent);
  opacity: 0.92;
  pointer-events: none;
  transition: opacity 0.4s;
}

.header[data-theme='dark'] {
  --hc: var(--paper);
  --hbg: var(--night);
}

.header[data-theme='red'] {
  --hc: #fff;
  --hbg: var(--red);
}

.header[data-theme='plain']::before {
  opacity: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
}

.brand-mark {
  width: 26px;
  height: 26px;
  background: var(--red);
  transition: background 0.4s;
}

.header[data-theme='red'] .brand-mark {
  background: #fff;
}

.brand-text {
  display: flex;
  align-items: baseline;
  gap: 8px;
  line-height: 1;
}

.brand-text b {
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: 0.02em;
}

.brand-text i {
  font-style: normal;
  font-weight: 300;
  font-size: 0.8125rem;
}

.nav {
  display: flex;
  gap: clamp(18px, 2.4vw, 40px);
  font-size: 0.8125rem;
  font-weight: 500;
}

.nav a {
  position: relative;
  padding: 8px 0;
}

.nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.45s var(--ease);
}

.nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  position: relative;
}

.menu-toggle span {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 50%;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.4s var(--ease);
}

.menu-toggle span:first-child {
  transform: translateY(-4px);
}

.menu-toggle span:last-child {
  transform: translateY(4px);
}

.menu-toggle[aria-expanded='true'] span:first-child {
  transform: rotate(45deg);
}

.menu-toggle[aria-expanded='true'] span:last-child {
  transform: rotate(-45deg);
}

.menu {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--header-h) + 6vh) var(--pad) calc(var(--pad) + 12px);
  background: var(--ink);
  color: var(--paper);
}

.menu[hidden] {
  display: none;
}

.menu nav {
  display: grid;
  gap: 4px;
}

.menu nav a {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 10px 0;
  font-size: clamp(2.2rem, 10vw, 3.4rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.menu nav i {
  font-style: normal;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: #e8605e;
}

.menu p {
  display: grid;
  gap: 6px;
  font-size: 1rem;
}

/* ───── первый экран ───── */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--header-h) + 2vh) var(--pad) clamp(24px, 4vh, 44px);
  display: grid;
  grid-template-rows: 1fr auto;
  grid-template-columns: 1fr auto;
  column-gap: 24px;
}

.hero-copy {
  grid-column: 1 / -1;
  align-self: center;
  max-width: min(52vw, 760px);
  display: grid;
  gap: clamp(18px, 2.6vh, 30px);
  justify-items: start;
  opacity: calc(1 - var(--out, 0) * 1.6);
  transform: translate3d(0, calc(var(--out, 0) * -70px), 0);
}

.hero-copy .lead {
  max-width: 27em;
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 30px;
  margin-top: 6px;
}

.hero-facts {
  display: flex;
  gap: clamp(28px, 4.4vw, 72px);
  opacity: calc(1 - var(--out, 0) * 2.4);
}

.hero-facts dt {
  font-size: clamp(1.25rem, 1.9vw, 1.8rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.2;
  white-space: nowrap;
}

.hero-facts dd {
  margin-top: 4px;
  font-size: 0.75rem;
  line-height: 1.4;
  opacity: 0.7;
}

.scroll-cue {
  align-self: end;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: calc(1 - var(--out, 0) * 4);
}

.scroll-cue span {
  width: 56px;
  height: 1px;
  background: currentColor;
  transform-origin: left;
  animation: cue 2.4s var(--ease) infinite;
}

@keyframes cue {
  0% { transform: scaleX(0); transform-origin: left; }
  50% { transform: scaleX(1); transform-origin: left; }
  51% { transform: scaleX(1); transform-origin: right; }
  100% { transform: scaleX(0); transform-origin: right; }
}

.hero-fallback {
  display: none;
}

.no-webgl .hero-fallback {
  display: block;
  position: absolute;
  inset: 0 0 0 50%;
  z-index: -1;
}

.no-webgl .hero-fallback img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* вступление */

.js [data-intro] {
  opacity: 0;
  transform: translateY(22px);
}

.js.is-ready [data-intro] {
  opacity: 1;
  transform: none;
  transition: opacity 1.1s ease, transform 1.3s var(--ease);
  transition-delay: calc(0.55s + var(--i, 0) * 0.11s);
}

.js .hero h1[data-intro] {
  opacity: 1;
  transform: none;
}

.js .hero h1 .ln > span {
  transform: translateY(112%);
}

.js.is-ready .hero h1 .ln > span {
  transform: none;
  transition: transform 1.4s var(--ease);
  transition-delay: calc(0.5s + var(--l, 0) * 0.12s);
}

.ln:nth-child(2) > span { --l: 1; }
.ln:nth-child(3) > span { --l: 2; }

/* ───── манифест ───── */

.manifesto {
  min-height: 150vh;
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
}

.manifesto-inner {
  max-width: min(50vw, 720px);
  display: grid;
  gap: clamp(22px, 3.4vh, 40px);
}

/* ───── процесс ───── */

.process {
  height: 540vh;
  color: var(--fg);
}

.process-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  padding: calc(var(--header-h) + 3vh) var(--pad) clamp(28px, 5vh, 56px);
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.process-head {
  display: grid;
  gap: 14px;
  max-width: min(44vw, 520px);
}

.process-head h2 {
  font-size: clamp(1.05rem, 1.5vw, 1.4rem);
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.stages {
  align-self: center;
  display: grid;
  max-width: min(44vw, 560px);
}

.stage {
  grid-area: 1 / 1;
  display: grid;
  gap: clamp(10px, 1.6vh, 18px);
  align-content: start;
}

.js .stage {
  opacity: 0;
  visibility: hidden;
  transform: translateY(34px);
  transition: opacity 0.5s ease, transform 0.8s var(--ease), visibility 0s 0.5s;
}

.js .stage.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.8s ease 0.15s, transform 1s var(--ease) 0.15s, visibility 0s;
}

.stage-n {
  display: flex;
  align-items: baseline;
  gap: 14px;
  line-height: 1;
}

.stage-n b {
  font-size: clamp(4.4rem, 10vw, 10rem);
  font-weight: 200;
  letter-spacing: -0.05em;
  margin-left: -0.05em;
}

.stage-n i {
  font-style: normal;
  font-size: 0.8125rem;
  opacity: 0.6;
}

.stage-n span {
  margin-left: auto;
  padding: 7px 12px;
  border: 1px solid currentColor;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.stage h3 {
  font-size: clamp(2rem, 3.6vw, 3.8rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.stage > p:last-child {
  max-width: 27em;
  font-size: clamp(0.95rem, 1.1vw, 1.0625rem);
}

.process-rail {
  width: min(44vw, 320px);
  height: 1px;
  background: color-mix(in srgb, currentColor 25%, transparent);
}

.process-rail span {
  display: block;
  height: 3px;
  margin-top: -1px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
}

html:not(.js) .process {
  height: auto;
}

html:not(.js) .process-pin {
  position: static;
  height: auto;
}

html:not(.js) .stage {
  grid-area: auto;
  margin-bottom: 40px;
}

/* ───── проекты ───── */

[data-theme='dark'] {
  background: var(--night);
  color: var(--paper);
}

.section-head {
  padding: clamp(110px, 20vh, 220px) var(--pad) clamp(60px, 11vh, 130px);
  display: grid;
  gap: clamp(20px, 3vh, 34px);
}

.features {
  display: grid;
  gap: clamp(90px, 20vh, 240px);
}

.feature {
  padding: 0 var(--pad);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: auto 1fr;
  column-gap: clamp(16px, 2vw, 32px);
}

.clip {
  display: block;
  overflow: hidden;
  background: #232120;
}

.clip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform;
}

.feature-media {
  grid-column: 1 / 9;
  grid-row: 1 / 3;
}

.feature-media .clip {
  aspect-ratio: 16 / 10;
}

.feature-media img,
.feature-aside img {
  transform: scale(1.16);
}

.feature-aside {
  grid-column: 10 / 13;
  grid-row: 1;
  margin-top: clamp(30px, 9vh, 110px);
}

.feature-aside .clip {
  aspect-ratio: 4 / 5;
}

.feature-info {
  grid-column: 9 / 13;
  grid-row: 2;
  align-self: end;
  display: grid;
  gap: 12px;
  justify-items: start;
  padding-top: 40px;
}

.feature--flip .feature-media { grid-column: 5 / 13; }
.feature--flip .feature-aside { grid-column: 1 / 4; }
.feature--flip .feature-info { grid-column: 1 / 5; }

.feature-n {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.2em;
}

.feature-n::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--red);
}

.feature h3 {
  font-size: clamp(1.9rem, 3.3vw, 3.5rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.feature-meta {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  opacity: 0.66;
}

.feature-desc {
  max-width: 26em;
  font-size: 0.9375rem;
  opacity: 0.86;
}

.feature .link {
  margin-top: 12px;
}

/* список */

.index {
  padding: clamp(120px, 24vh, 260px) var(--pad) clamp(100px, 18vh, 200px);
}

.index-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 28px 40px;
  margin-bottom: clamp(30px, 6vh, 60px);
}

.index-head h2 {
  font-size: clamp(2rem, 4.2vw, 4.2rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.035em;
}

.index-head sup {
  font-size: 0.26em;
  font-weight: 600;
  letter-spacing: 0.04em;
  vertical-align: top;
  position: relative;
  top: 0.5em;
  margin-left: 0.3em;
  color: #e8605e;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filters button {
  padding: 10px 14px;
  border: 1px solid rgba(239, 236, 230, 0.32);
  font-size: 0.75rem;
  font-weight: 500;
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}

.filters button:hover {
  border-color: var(--paper);
}

.filters button[aria-pressed='true'] {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--night);
}

.subfilters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px 16px;
  margin: calc(clamp(30px, 6vh, 60px) * -0.5) 0 clamp(24px, 4vh, 40px);
}

.subfilters:not(:has(label:not([hidden]))) {
  display: none;
}

.select {
  display: grid;
  gap: 6px;
  font-size: 0.6875rem;
}

.select span {
  opacity: 0.66;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.select select {
  appearance: none;
  min-width: 150px;
  padding: 10px 34px 10px 14px;
  border: 1px solid rgba(239, 236, 230, 0.32);
  border-radius: 0;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23efece6' stroke-width='1.2'/%3E%3C/svg%3E") no-repeat right 14px center;
  color: inherit;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.3s;
}

.select select:hover,
.select select:focus-visible {
  border-color: var(--paper);
}

.select option {
  background: var(--night);
  color: var(--paper);
}

.subfilters-reset {
  padding: 10px 0;
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 4px;
  opacity: 0.8;
}

.rows-empty {
  padding: 32px 0;
  opacity: 0.66;
}

.viz {
  padding: 0 var(--pad) clamp(100px, 18vh, 200px);
}

.viz-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px 40px;
  margin-bottom: clamp(30px, 6vh, 60px);
}

.viz-head h2 {
  font-size: clamp(2rem, 4.2vw, 4.2rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.035em;
}

.viz-head sup {
  font-size: 0.26em;
  font-weight: 600;
  letter-spacing: 0.04em;
  vertical-align: top;
  position: relative;
  top: 0.5em;
  margin-left: 0.3em;
  color: #e8605e;
}

.viz-head p {
  max-width: 420px;
  font-size: 0.875rem;
  opacity: 0.66;
}

.viz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: clamp(20px, 3vw, 40px);
}

.viz-grid a {
  display: block;
}

.viz-grid .clip {
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.viz-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease);
}

.viz-grid a:hover img {
  transform: scale(1.04);
}

.viz-grid h3 {
  margin-top: 16px;
  font-size: clamp(1.1rem, 1.6vw, 1.5rem);
  font-weight: 300;
  letter-spacing: -0.02em;
}

.viz-grid p {
  margin-top: 6px;
  font-size: 0.75rem;
  opacity: 0.66;
}

.rows {
  border-top: 1px solid rgba(239, 236, 230, 0.2);
}

.row[hidden] {
  display: none;
}

.row a {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 27% 15% 40px;
  align-items: baseline;
  gap: 16px;
  padding: clamp(16px, 2.3vh, 24px) 0;
  border-bottom: 1px solid rgba(239, 236, 230, 0.2);
  font-size: 0.78125rem;
  transition: opacity 0.4s;
}

.row-n,
.row-cat,
.row-city,
.row-count {
  opacity: 0.66;
  font-variant-numeric: tabular-nums;
}

.row-count {
  text-align: right;
}

.row-name {
  position: relative;
  font-size: clamp(1.2rem, 2.1vw, 2rem);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.02em;
  transition: transform 0.6s var(--ease);
}

.row-name::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 0.58em;
  width: 9px;
  height: 9px;
  margin-top: -4px;
  background: var(--red);
  transform: scale(0);
  transition: transform 0.4s var(--ease);
}

.row-thumb {
  display: none;
}

.row-preview {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 40;
  width: clamp(220px, 23vw, 340px);
  aspect-ratio: 1;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  clip-path: inset(50% 50%);
  transition: opacity 0.3s, clip-path 0.6s var(--ease);
}

.row-preview.is-on {
  opacity: 1;
  clip-path: inset(0);
}

.row-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (hover: hover) and (pointer: fine) {
  .rows:hover .row a {
    opacity: 0.38;
  }

  .rows .row a:hover,
  .rows .row a:focus-visible {
    opacity: 1;
  }

  .row a:hover .row-name {
    transform: translateX(28px);
  }

  .row a:hover .row-name::before {
    transform: scale(1);
  }

  .feature-media .clip img {
    transition: filter 0.6s;
  }

  .feature-media:hover .clip img {
    filter: brightness(1.08);
  }
}

/* ───── бюро ───── */

.bureau {
  background: var(--paper);
  padding: 0 var(--pad) clamp(100px, 18vh, 200px);
}

.bureau .section-head {
  padding-left: 0;
  padding-right: 0;
}

.bureau-intro {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(16px, 2vw, 32px);
  align-items: end;
}

.director {
  grid-column: 1 / 5;
}

.director .clip {
  aspect-ratio: 3 / 4;
  background: #dcd7ce;
}

.director img {
  filter: grayscale(1) contrast(1.05);
}

.director figcaption {
  display: grid;
  gap: 2px;
  margin-top: 16px;
  font-size: 0.8125rem;
}

.director figcaption b {
  font-weight: 600;
}

.director figcaption span {
  opacity: 0.7;
}

.bureau-copy {
  grid-column: 7 / 13;
  display: grid;
  gap: 22px;
  padding-bottom: 60px;
  max-width: 38em;
}

.bureau-copy .lead {
  font-size: clamp(1.2rem, 1.9vw, 1.75rem);
  font-weight: 300;
  line-height: 1.4;
  letter-spacing: -0.015em;
}

.facts {
  margin-top: clamp(90px, 18vh, 200px);
  display: grid;
  grid-template-columns: 1fr 1fr 1.6fr;
  column-gap: clamp(16px, 2vw, 32px);
}

.facts > div {
  padding-top: 22px;
  border-top: 1px solid var(--ink);
}

.facts dt {
  font-size: clamp(2.3rem, 5.2vw, 5.6rem);
  font-weight: 200;
  line-height: 1.05;
  letter-spacing: -0.045em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.facts dd {
  margin-top: 14px;
  max-width: 24em;
  font-size: 0.875rem;
  opacity: 0.78;
}

.strengths,
.team {
  margin-top: clamp(90px, 18vh, 200px);
}

.strengths ol,
.team ul {
  margin-top: 34px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px clamp(16px, 2vw, 32px);
}

.strengths li {
  padding-top: 20px;
  border-top: 1px solid rgba(43, 42, 41, 0.28);
  display: grid;
  gap: 10px;
  align-content: start;
}

.strengths i {
  font-style: normal;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--red);
}

.strengths h4 {
  font-size: clamp(1.25rem, 1.9vw, 1.7rem);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.strengths p {
  max-width: 24em;
  font-size: 0.9375rem;
  opacity: 0.8;
}

.team header {
  display: grid;
  gap: 18px;
}

.team-title {
  font-size: clamp(2rem, 4.2vw, 4.2rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.035em;
}

.team ul {
  margin-top: 50px;
}

.team img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #dcd7ce;
  filter: grayscale(1) contrast(1.05);
  transition: filter 0.7s;
}

.team li:hover img {
  filter: none;
}

.team h4 {
  margin-top: 16px;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
}

.team p {
  font-size: 0.8125rem;
  opacity: 0.72;
}

/* ───── финал: логотип раскрывается в красную страницу ───── */

.gate {
  height: 230vh;
  background: var(--paper);
}

.gate-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  overflow: clip;
}

.gate-square {
  will-change: transform;
}

.gate-square span {
  font-size: 9.66vmin;
}

.gate-tag {
  position: absolute;
  left: calc(50% - 17vmin);
  top: calc(50% + 17vmin + 1.2vmin);
  font-size: 3.42vmin;
  font-weight: 300;
  line-height: 1.1;
  white-space: nowrap;
}

html:not(.js) .gate {
  display: none;
}

.contact {
  background: var(--red);
  color: #fff;
  padding: clamp(110px, 18vh, 200px) var(--pad) 0;
}

.contact .label::before {
  background: #fff;
}

.contact-main {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(16px, 2vw, 32px);
  align-items: start;
}

.contact-lead {
  grid-column: 1 / 7;
  display: grid;
  gap: clamp(22px, 3.4vh, 38px);
}

.contact-links {
  display: grid;
  gap: 18px;
  margin-top: 14px;
}

.contact-links li {
  display: grid;
  gap: 2px;
}

.contact-links span {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.85;
}

.contact-links a {
  justify-self: start;
  font-size: clamp(1.2rem, 1.9vw, 1.7rem);
  font-weight: 300;
  letter-spacing: -0.015em;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 0.5s var(--ease);
}

.contact-links a:hover {
  background-size: 100% 1px;
}

.form {
  grid-column: 8 / 13;
  display: grid;
  gap: 26px;
  justify-items: start;
}

.field {
  width: 100%;
  display: grid;
  gap: 4px;
}

.field label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.field label i {
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: none;
}

.field input,
.field textarea {
  width: 100%;
  padding: 10px 0 12px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 0;
  background: transparent;
  font-size: 1.125rem;
  font-weight: 300;
  resize: vertical;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.field input::placeholder {
  color: rgba(255, 255, 255, 0.75);
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: #fff;
  box-shadow: 0 1px 0 #fff;
}

.field input[aria-invalid='true'] {
  box-shadow: 0 2px 0 #fff;
}

.form-status:empty {
  display: none;
}

.form-status {
  font-size: 0.875rem;
  font-weight: 600;
}

.form-note {
  font-size: 0.78125rem;
  max-width: 30em;
}

.footer {
  margin-top: clamp(100px, 18vh, 200px);
  padding: 34px 0 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.4);
  font-size: 0.78125rem;
  line-height: 1.6;
}

.legal {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px clamp(16px, 2vw, 32px);
}

.legal h3 {
  margin-bottom: 6px;
  font-size: 0.78125rem;
  font-weight: 600;
}

.footer-line {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 44px;
}

.footer-line a {
  font-weight: 600;
}

/* ───── просмотр проекта ───── */

.viewer {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #0f0e0e;
  color: var(--paper);
}

.viewer[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  animation: viewer-in 0.5s var(--ease);
}

@keyframes viewer-in {
  from { opacity: 0; transform: translateY(18px); }
}

.viewer::backdrop {
  background: #0f0e0e;
}

.viewer-top,
.viewer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 20px var(--pad);
}

.viewer-top {
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.viewer-close {
  padding: 10px 0;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.viewer-stage {
  position: relative;
  min-height: 0;
  touch-action: pan-y;
}

.viewer-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.35s;
  user-select: none;
}

.viewer-stage img:not([src]) {
  visibility: hidden;
}

.viewer-stage.is-loading img {
  opacity: 0.25;
}

.viewer-nav {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 22%;
  min-width: 64px;
  display: flex;
  align-items: center;
  padding: 0 var(--pad);
  font-size: 1.5rem;
}

.viewer-nav[hidden] {
  display: none;
}

.viewer-nav--prev { left: 0; cursor: w-resize; }
.viewer-nav--next { right: 0; justify-content: flex-end; cursor: e-resize; }

.viewer-nav span {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  background: rgba(15, 14, 14, 0.55);
  border: 1px solid rgba(239, 236, 230, 0.35);
  transition: background 0.3s, color 0.3s;
}

.viewer-nav:hover span {
  background: var(--paper);
  color: var(--night);
}

.viewer-bottom {
  align-items: end;
  padding-bottom: 26px;
}

.viewer-bottom h2 {
  font-size: clamp(1.4rem, 2.4vw, 2.2rem);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.viewer-bottom p {
  margin-top: 6px;
  max-width: 44em;
  font-size: 0.8125rem;
  opacity: 0.75;
}

.viewer-bottom p:empty {
  display: none;
}

.viewer-actions {
  display: flex;
  align-items: center;
  gap: 22px;
  flex: none;
}

/* ───── появление при прокрутке ───── */

.js [data-reveal]:not([data-reveal='lines']):not([data-reveal='clip']) {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 1s ease, transform 1.2s var(--ease);
  transition-delay: calc(var(--i, 0) * 0.09s);
}

.js [data-reveal].is-in:not([data-reveal='lines']):not([data-reveal='clip']) {
  opacity: 1;
  transform: none;
}

.js [data-reveal='lines'] .ln > span {
  transform: translateY(112%);
  transition: transform 1.3s var(--ease);
  transition-delay: calc(var(--l, 0) * 0.11s);
}

.js [data-reveal='lines'].is-in .ln > span {
  transform: none;
}

/* клип — на вложенном элементе: IntersectionObserver не видит полностью обрезанный узел */
.js [data-reveal='clip'] .clip {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1.5s var(--ease);
}

.js [data-reveal='clip'].is-in .clip {
  clip-path: inset(0);
}

/* ───── адаптив ───── */

@media (max-width: 1100px) {
  .header-cta {
    display: none;
  }
}

@media (max-width: 860px) {
  :root {
    --header-h: 64px;
  }

  .nav {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top: calc(var(--header-h) + 3vh);
  }

  .hero-copy {
    align-self: start;
    max-width: none;
    gap: 16px;
  }

  .hero-copy .lead {
    font-size: 0.9375rem;
  }

  /* на телефоне под кнопкой сразу макет: вторую ссылку заменяет меню и финальный блок */
  .hero-actions .link {
    display: none;
  }

  .hero-facts {
    gap: 14px;
    justify-content: space-between;
  }

  .hero-facts dt {
    font-size: 1.0625rem;
  }

  .hero-facts dd {
    font-size: 0.6875rem;
  }

  .scroll-cue {
    display: none;
  }

  .manifesto {
    align-items: flex-end;
    padding-bottom: 12vh;
  }

  .manifesto-inner,
  .process-head,
  .stages {
    max-width: none;
  }

  .process-pin {
    grid-template-rows: 1fr auto auto;
    row-gap: 22px;
  }

  .process-head {
    align-self: start;
  }

  .process-head h2 {
    display: none;
  }

  .stages {
    align-self: end;
  }

  .stage-n b {
    font-size: 3.6rem;
  }

  .process-rail {
    width: 100%;
  }

  .feature {
    display: block;
  }

  .feature-aside {
    display: none;
  }

  .feature-info {
    padding-top: 22px;
  }

  .row a {
    grid-template-columns: 60px minmax(0, 1fr) auto;
    grid-template-areas: 'thumb name count' 'thumb cat count';
    align-items: center;
    gap: 4px 16px;
    padding: 12px 0;
  }

  .row-n,
  .row-city,
  .row-name::before {
    display: none;
  }

  .row-thumb {
    display: block;
    grid-area: thumb;
    width: 60px;
    height: 60px;
    object-fit: cover;
  }

  .row-name {
    grid-area: name;
    align-self: end;
    font-size: 1.125rem;
  }

  .row-cat {
    grid-area: cat;
    align-self: start;
    font-size: 0.71875rem;
  }

  .row-count {
    grid-area: count;
  }

  .row-preview {
    display: none;
  }

  .bureau-intro,
  .contact-main {
    grid-template-columns: 1fr;
    row-gap: 48px;
  }

  .director,
  .bureau-copy,
  .contact-lead,
  .form {
    grid-column: 1;
  }

  .director {
    max-width: 320px;
  }

  .bureau-copy {
    padding-bottom: 0;
  }

  .facts,
  .strengths ol,
  .legal {
    grid-template-columns: 1fr;
    row-gap: 36px;
  }

  .team ul {
    grid-template-columns: 1fr 1fr;
  }

  .viewer-bottom {
    flex-direction: column;
    align-items: stretch;
  }

  .viewer-nav span {
    width: 44px;
    height: 44px;
  }

  .footer-line {
    flex-wrap: wrap;
  }
}

@media (max-height: 620px) and (min-width: 861px) {
  .hero-copy .lead {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }

  .js [data-reveal],
  .js [data-intro],
  .js [data-reveal] .ln > span,
  .js .hero h1 .ln > span {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
  }

  .hero-copy {
    opacity: 1;
    transform: none;
  }
}
