/* =========================================================
   Voskresenskiy Design — public site
   Palette: Scarlet #F5332C · Black #000000 · Creme #CCC8B9
   Strict, editorial; Apple-grade motion.
   ========================================================= */

:root {
  --scarlet: #f5332c;
  --black: #000000;
  --creme: #ccc8b9;

  --a: var(--scarlet);           /* overridable from admin */
  --b: var(--creme);

  --bg: #000;
  --bg-2: #0b0b0a;
  --surface: #121211;
  --line: rgba(204, 200, 185, 0.14);
  --line-strong: rgba(204, 200, 185, 0.28);
  --text: #eceae3;
  --muted: rgba(236, 234, 227, 0.6);
  --faint: rgba(236, 234, 227, 0.38);

  --l-bg: var(--b);
  --l-text: #000;
  --l-muted: rgba(0, 0, 0, 0.6);
  --l-line: rgba(0, 0, 0, 0.16);

  --r-sm: 10px;
  --r: 14px;
  --r-lg: 24px;
  --r-xl: 28px;
  --gutter: clamp(16px, 4vw, 48px);
  --maxw: 1320px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  --font: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: var(--font); /* мелкие подписи — тем же шрифтом, что и весь сайт */
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 1rem/1.55 var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--a); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--a); color: #fff; }
body.is-locked { overflow: hidden; }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; padding: 10px 14px; background: var(--b); color: #000; border-radius: 8px; }
.skip:focus { left: 8px; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.wrap--wide { max-width: 1680px; }

i[data-icon] { display: inline-flex; width: 1.1em; height: 1.1em; }
i[data-icon] svg { width: 100%; height: 100%; }

/* ——— Type ——— */
.h2 {
  margin: 0; font-size: clamp(2rem, 4.4vw, 3.6rem); line-height: 1.02; letter-spacing: -0.04em; font-weight: 600; text-wrap: balance;
}
.lead { margin: 16px 0 0; max-width: 46ch; color: var(--muted); font-size: clamp(1rem, 1.25vw, 1.1rem); line-height: 1.55; text-wrap: pretty; }
.kicker, .mono {
  font-family: var(--mono); font-size: 0.74rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase;
}
.kicker { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px; color: var(--l-muted); }
.kicker::before { content: ""; width: 7px; height: 7px; background: var(--a); }
.kicker--light { color: var(--muted); }

/* ——— Buttons ——— */
.btn {
  --h: 50px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--h); padding: 0 22px; border-radius: 999px;
  font-weight: 500; font-size: 0.96rem; letter-spacing: -0.005em; white-space: nowrap;
  transition: transform 160ms var(--ease-out), background-color 200ms ease, color 200ms ease, box-shadow 200ms ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn--sm { --h: 40px; padding: 0 16px; font-size: 0.9rem; }
.btn--light { background: var(--b); color: #000; }
.btn--glass { color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); background: rgba(0,0,0,.25); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.btn i[data-icon] { transition: transform 200ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .btn--light:hover { background: var(--a); color: #fff; }
  .btn--light:hover i[data-icon] { transform: translateX(3px); }
  .btn--glass:hover { box-shadow: inset 0 0 0 1px var(--b); }
}

.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: transform 160ms var(--ease-out), background-color 200ms ease, color 200ms ease;
}
.icon-btn i[data-icon] { width: 20px; height: 20px; }
.icon-btn:active { transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) { .icon-btn:hover { background: var(--b); color: #000; } }

/* =========================================================
   Header
   ========================================================= */
.nav { position: fixed; inset: 0 0 auto; z-index: 50; padding: 12px clamp(12px, 2vw, 20px) 0; pointer-events: none; }
.nav__bar {
  pointer-events: auto; position: relative;
  display: flex; align-items: center; gap: 16px;
  max-width: 1480px; margin: 0 auto; height: 62px; padding: 0 10px 0 20px; border-radius: 18px;
  transition: background-color 300ms ease, box-shadow 300ms ease;
}
.nav.is-scrolled .nav__bar, .nav.is-open .nav__bar {
  background: rgba(0, 0, 0, 0.66);
  box-shadow: inset 0 0 0 1px var(--line);
  backdrop-filter: blur(24px) saturate(140%); -webkit-backdrop-filter: blur(24px) saturate(140%);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.03em; font-size: 1.06rem; }
.brand__mark { position: relative; width: 26px; height: 26px; border-radius: 50%; background: var(--a); overflow: hidden; }
.brand__mark i { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: #000; transition: transform 420ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .brand:hover .brand__mark i { transform: scale(1.6); } }
.brand__suffix { font-weight: 400; color: var(--muted); margin-left: -4px; }

.nav__links { position: relative; display: flex; gap: 2px; margin-left: auto; margin-right: auto; padding: 4px; }
.nav__links a { position: relative; z-index: 1; padding: 9px 16px; border-radius: 999px; font-size: 0.92rem; font-weight: 500; color: var(--muted); transition: color 200ms ease; }
.nav__links a.is-active, .nav__links a:hover { color: var(--text); }
.nav__pill { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-strong); opacity: 0;
  transition: transform 420ms var(--ease-out), width 420ms var(--ease-out), opacity 200ms ease; }
.nav__right { display: flex; align-items: center; gap: 10px; }

.lang { position: relative; display: inline-flex; padding: 3px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); }
.lang button { position: relative; z-index: 1; min-width: 38px; height: 30px; padding: 0 9px; border-radius: 999px; font: 500 0.74rem var(--mono); letter-spacing: 0.04em; color: var(--muted); transition: color 200ms ease; }
.lang button[aria-pressed="true"] { color: #000; }
.lang__thumb { position: absolute; top: 3px; bottom: 3px; left: 0; border-radius: 999px; background: var(--b); transition: transform 360ms var(--ease-out), width 360ms var(--ease-out); }

/* social icons — filled glyphs, monochrome, scarlet on hover */
.socials { display: inline-flex; gap: 6px; }
.social {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  color: var(--text); box-shadow: inset 0 0 0 1px var(--line);
  transition: transform 160ms var(--ease-out), color 200ms ease, background-color 200ms ease, box-shadow 200ms ease;
}
.social svg { width: 17px; height: 17px; }
.social:active { transform: scale(0.92); }
@media (hover: hover) and (pointer: fine) { .social:hover { background: var(--a); color: #fff; box-shadow: none; } }
.socials--plain .social { box-shadow: none; color: var(--muted); }

.burger { display: none; position: relative; width: 44px; height: 44px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line-strong); }
.burger span { position: absolute; left: 14px; right: 14px; height: 1.6px; background: currentColor; transition: transform 300ms var(--ease-out); }
.burger span:first-child { top: 18px; }
.burger span:last-child { top: 25px; }
.nav.is-open .burger span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav.is-open .burger span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

.sheet {
  pointer-events: auto; max-width: 1480px; margin: 8px auto 0; padding: 12px; border-radius: 20px;
  background: rgba(0, 0, 0, 0.86); box-shadow: inset 0 0 0 1px var(--line);
  backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px);
  transform-origin: top right;
  transition: opacity 240ms var(--ease-out), transform 300ms var(--ease-out), filter 240ms ease;
}
.sheet[data-state="closed"] { opacity: 0; transform: translateY(-8px) scale(0.97); filter: blur(6px); }
.sheet__links { display: grid; }
.sheet__links a { padding: 14px; font-size: 1.6rem; font-weight: 500; letter-spacing: -0.03em; border-bottom: 1px solid var(--line); }
.sheet__links a:last-child { border-bottom: 0; }
.sheet__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 8px 4px; margin-top: 8px; border-top: 1px solid var(--line); flex-wrap: wrap; }

@media (max-width: 1080px) { .nav__links { display: none; } .nav__right { margin-left: auto; } }
@media (max-width: 860px) {
  .nav__bar > .nav__right > .socials, .nav__bar > .nav__right > .lang { display: none; }
  .burger { display: block; }
}
@media (max-width: 520px) { .nav__cta { display: none; } .nav__bar { height: 58px; padding-left: 16px; } }

/* =========================================================
   Hero — full-bleed video cover
   ========================================================= */
.hero { padding: 12px clamp(12px, 2vw, 20px) 0; }
.hero__stage {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: max(620px, calc(100svh - 24px)); border-radius: var(--r-xl);
  background: #050505; display: flex; align-items: flex-end;
}
.hero__media { position: absolute; inset: 0; z-index: 0; }
.hero__media img, .hero__media video { width: 100%; height: 100%; object-fit: cover; }
.hero__media:not(:empty) ~ .hero__placeholder { display: none; }

/* shown until the cover video is uploaded */
.hero__placeholder { position: absolute; inset: 0; z-index: 0; }
.hero__placeholder .glow {
  position: absolute; width: 70vw; height: 70vw; right: -18vw; top: -22vw; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--a) 55%, transparent) 0%, transparent 62%);
  filter: blur(40px); opacity: .7; will-change: transform;
}
.hero__placeholder .lines {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 96px 96px; background-position: -1px -1px;
  -webkit-mask: radial-gradient(80% 70% at 70% 30%, #000, transparent 75%); mask: radial-gradient(80% 70% at 70% 30%, #000, transparent 75%);
  opacity: .5;
}

.grain {
  position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0.1; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.hero__shade { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,.45) 0%, transparent 26%, transparent 42%, rgba(0,0,0,.82) 100%); }

.hero__content { position: relative; z-index: 3; width: 100%; padding: clamp(110px, 16vh, 160px) clamp(22px, 5vw, 72px) clamp(32px, 5vw, 64px); }
/* ——— статус: векторные зацикленные иконки ——— */
.status { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 6px; margin: 0 0 22px; color: var(--text); }
.st { display: block; width: clamp(92px, 7.5vw, 120px); height: auto; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.st text { stroke: none; fill: var(--a); font: 700 7px var(--font); }
.st__ground { stroke: color-mix(in srgb, currentColor 28%, transparent); }
.st .st__head { fill: var(--bg); }
.status__cap { display: inline-flex; align-items: center; gap: 7px; font: 600 0.66rem var(--font); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.status__dot { position: relative; width: 6px; height: 6px; border-radius: 50%; background: var(--a); }
.status[data-mode="rest"] .status__dot { background: color-mix(in srgb, var(--text) 45%, transparent); }
.status[data-mode="work"] .status__dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1.5px solid var(--a); opacity: 0; animation: ping 2.4s var(--ease-out) infinite; }
@keyframes ping { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.8); opacity: 0; } }

/* отдыхаю: нога качается от колена, Z всплывают по очереди, грудь дышит */
.st__leg { transform-box: view-box; transform-origin: 45.2px 21.8px; animation: st-swing 1.8s ease-in-out infinite alternate; }
@keyframes st-swing { from { transform: rotate(-9deg); } to { transform: rotate(7deg); } }
.st .z { opacity: 0; transform-box: fill-box; transform-origin: center; animation: st-z 3s ease-out infinite; }
.st .z2 { animation-delay: 1s; } .st .z3 { animation-delay: 2s; font-size: 9px; }
@keyframes st-z { 0% { opacity: 0; transform: translate(-2px, 4px) scale(.6); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(4px, -6px) scale(1.15); } }

/* работаю: голова качается в ритм, руки печатают, логотип ноутбука светится, код всплывает */
.st__headset { transform-box: view-box; transform-origin: 36px 20px; animation: st-nod .9s ease-in-out infinite alternate; }
@keyframes st-nod { from { transform: rotate(-5deg) translateY(0); } to { transform: rotate(5deg) translateY(.6px); } }
.st .st__phones { stroke: var(--a); stroke-width: 2.2; }
.st .st__cup { fill: var(--a); stroke: none; }
.st .st__lid { fill: var(--bg); }
.st .st__logo { fill: var(--a); stroke: none; animation: st-glow 1.8s ease-in-out infinite; }
@keyframes st-glow { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
.st__arm { animation: st-type .26s ease-in-out infinite alternate; }
.st__arm--r { animation-delay: .13s; }
@keyframes st-type { from { transform: translateY(0); } to { transform: translateY(-1.4px); } }
.st .c { opacity: 0; font-size: 6px; animation: st-code 2.8s ease-out infinite; }
.st .c2 { animation-delay: 1.4s; }
@keyframes st-code { 0% { opacity: 0; transform: translateY(5px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-7px); } }

.hero__eyebrow { margin: 0 0 18px; color: var(--muted); font: 500 0.8rem var(--mono); letter-spacing: 0.04em; }
.hero__title {
  margin: 0; max-width: 14ch;
  font-size: clamp(2.8rem, 7.6vw, 7.6rem); line-height: 0.95; letter-spacing: -0.055em; font-weight: 600; text-wrap: balance;
}
.hero__title .hl { color: var(--a); }
.hero__title .w { display: inline-block; }
.hero__sub { margin: 26px 0 0; max-width: 42ch; color: var(--muted); font-size: clamp(1rem, 1.3vw, 1.15rem); line-height: 1.55; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }

.reveal-in { opacity: 0; transform: translateY(16px); filter: blur(6px); }
.is-ready .reveal-in { opacity: 1; transform: none; filter: none; transition: opacity 900ms var(--ease-out), transform 900ms var(--ease-out), filter 900ms var(--ease-out); transition-delay: var(--d, 0ms); }

@media (max-width: 760px) {
  .hero__stage { border-radius: 22px; min-height: max(580px, calc(100svh - 24px)); }
  .hero__actions .btn { flex: 1 1 auto; }
  .hero__placeholder .glow { width: 120vw; height: 120vw; right: -50vw; top: -30vw; }
}

/* =========================================================
   Works — masonry
   ========================================================= */
.works { padding: clamp(80px, 11vw, 150px) 0 clamp(60px, 8vw, 110px); }
.section-head { margin-bottom: clamp(32px, 4vw, 56px); }
.section-head--split { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; flex-wrap: wrap; }

.filters { position: relative; display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters button { position: relative; z-index: 1; flex: none; height: 38px; padding: 0 16px; border-radius: 999px; font-size: 0.9rem; font-weight: 500; color: var(--muted); transition: color 200ms ease; }
.filters button[aria-selected="true"] { color: #000; }
.filters button sup { font: 500 0.62rem var(--mono); margin-left: 4px; opacity: .6; }
.filters__thumb { position: absolute; top: 4px; bottom: 4px; left: 0; border-radius: 999px; background: var(--b); transition: transform 420ms var(--ease-out), width 420ms var(--ease-out); }

.masonry { display: flex; gap: var(--mgap, 16px); align-items: flex-start; }
.masonry__col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: var(--mgap, 16px); }

.tile { position: relative; overflow: hidden; border-radius: var(--r); background: var(--surface); cursor: zoom-in; isolation: isolate; aspect-ratio: var(--ratio, 4 / 5); transform: translateZ(0); -webkit-tap-highlight-color: transparent; }
.tile.is-entering { opacity: 0; transform: translateY(24px) scale(0.98); }
.tile.is-in { opacity: 1; transform: none; transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); transition-delay: var(--d, 0ms); }
.tile__media { position: absolute; inset: 0; }
.tile__media img, .tile__media video { width: 100%; height: 100%; object-fit: cover; transition: transform 900ms var(--ease-out), opacity 500ms ease; }
.tile__media img { opacity: 0; }
.tile__media img.is-loaded { opacity: 1; }
.tile::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,.8) 100%); opacity: 0; transition: opacity 300ms ease; }
.tile__info { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 18px 20px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; opacity: 0; transform: translateY(8px); transition: opacity 260ms var(--ease-out), transform 360ms var(--ease-out); }
.tile__title { margin: 6px 0 0; font-size: 1.04rem; font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; }
.tile__cat { font: 500 0.68rem var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: rgba(236,234,227,.7); }
.tile__go { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--a); color: #fff; }
.tile__go svg { width: 17px; height: 17px; }
.tile__badge { position: absolute; top: 14px; right: 14px; z-index: 2; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: rgba(0,0,0,.5); color: #fff; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transition: opacity 200ms ease; }
.tile__badge svg { width: 13px; height: 13px; margin-left: 2px; }
.tile:active { transform: scale(0.985); transition: transform 160ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .tile:hover::after, .tile:focus-visible::after { opacity: 1; }
  .tile:hover .tile__info, .tile:focus-visible .tile__info { opacity: 1; transform: none; }
  .tile:hover .tile__media img, .tile:hover .tile__media video { transform: scale(1.04); }
  .tile:hover .demo__shape { transform: var(--shape-t, none) scale(1.06) rotate(6deg); }
  .tile.is-playing .tile__badge { opacity: 0; }
}
@media (hover: none) {
  .tile::after { opacity: .9; background: linear-gradient(180deg, transparent 62%, rgba(0,0,0,.72) 100%); }
  .tile__info { opacity: 1; transform: none; padding: 14px; }
  .tile__go { display: none; }
  .tile__title { font-size: .92rem; }
}

/* procedural demo artwork (placeholders until real work is uploaded) */
.demo { position: absolute; inset: 0; overflow: hidden; background: radial-gradient(90% 70% at 18% 12%, color-mix(in srgb, var(--p0) 45%, transparent) 0%, transparent 60%), var(--p2); }
.demo__shape { position: absolute; left: 50%; top: 48%; width: 52%; aspect-ratio: 1; translate: -50% -50%; transition: transform 1200ms var(--ease-out); }
.demo--sphere .demo__shape { border-radius: 50%; background: radial-gradient(circle at 32% 28%, #fff 0 3%, var(--p0) 30%, var(--p1) 70%, #000 100%); box-shadow: 0 40px 80px -20px rgba(0,0,0,.7); }
.demo--ring .demo__shape { border-radius: 50%; background: conic-gradient(from 140deg, var(--p0), #fff 18%, var(--p1) 45%, var(--p0) 75%, var(--p0)); -webkit-mask: radial-gradient(circle, transparent 52%, #000 53%); mask: radial-gradient(circle, transparent 52%, #000 53%); --shape-t: rotateX(58deg); transform: rotateX(58deg); }
.demo--torus .demo__shape { border-radius: 50%; background: radial-gradient(circle, transparent 30%, var(--p1) 31%, var(--p0) 47%, #fff 52%, var(--p0) 58%, var(--p1) 70%, transparent 71%); --shape-t: rotate(-18deg) scaleY(.62); transform: rotate(-18deg) scaleY(.62); }
.demo--blob .demo__shape { width: 60%; border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%; background: linear-gradient(140deg, #fff -20%, var(--p0) 25%, var(--p1) 90%); box-shadow: inset -20px -30px 60px rgba(0,0,0,.4); }
.demo--pill .demo__shape { width: 32%; aspect-ratio: 1 / 2.1; border-radius: 999px; background: linear-gradient(180deg, #fff -30%, var(--p0) 30%, var(--p1) 100%); --shape-t: rotate(28deg); transform: rotate(28deg); }
.demo--wave .demo__shape { width: 140%; aspect-ratio: 2; top: 60%; background: repeating-linear-gradient(100deg, var(--p0) 0 5%, transparent 5% 12%); -webkit-mask: radial-gradient(60% 50% at 50% 50%, #000 40%, transparent 72%); mask: radial-gradient(60% 50% at 50% 50%, #000 40%, transparent 72%); --shape-t: skewY(-12deg); transform: skewY(-12deg); opacity: .85; }
.demo--grid .demo__shape { width: 72%; background-image: radial-gradient(circle, var(--p0) 0 20%, transparent 22%); background-size: 16.66% 16.66%; -webkit-mask: radial-gradient(circle, #000 30%, transparent 72%); mask: radial-gradient(circle, #000 30%, transparent 72%); }
.demo__label { position: absolute; left: 16px; top: 14px; z-index: 1; font: 500 .64rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: rgba(236,234,227,.5); }

.works__empty { text-align: center; color: var(--muted); padding: 60px 0; }
.works__more { display: flex; justify-content: center; margin-top: 40px; }

/* =========================================================
   About
   ========================================================= */
.about { padding: clamp(40px, 6vw, 80px) 0 clamp(100px, 12vw, 160px); }
.about__grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: start; padding-top: clamp(32px, 4vw, 48px); border-top: 1px solid var(--line); }
.about__title { font-size: clamp(2rem, 4vw, 3.4rem); }
.about__text { margin: 6px 0 0; color: var(--muted); font-size: clamp(1.02rem, 1.3vw, 1.16rem); line-height: 1.65; text-wrap: pretty; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 40px 0 0; border-top: 1px solid var(--line); }
.stat { padding: 22px 16px 0 0; }
.stat + .stat { padding-left: 16px; border-left: 1px solid var(--line); }
.stat dt { font-size: clamp(2rem, 3.4vw, 2.9rem); font-weight: 600; letter-spacing: -0.05em; line-height: 1; }
.stat dd { margin: 12px 0 0; color: var(--muted); font: 500 .7rem/1.4 var(--mono); letter-spacing: .05em; text-transform: uppercase; }
.stat:nth-child(2) dt { color: var(--a); }
@media (max-width: 860px) { .about__grid { grid-template-columns: 1fr; } }

/* =========================================================
   Light zone (creme) — skills + clients
   ========================================================= */
.light { position: relative; background: var(--l-bg); color: var(--l-text); border-radius: var(--r-xl) var(--r-xl) 0 0; color-scheme: light; margin: 0 clamp(0px, 1vw, 12px); }
.light .lead { color: var(--l-muted); }
.light .h2 { color: var(--l-text); }
.light ::selection { background: #000; color: var(--b); }

.skills { padding: clamp(80px, 10vw, 140px) 0 clamp(50px, 6vw, 80px); }
.skills .section-head { max-width: 760px; }
.skills__grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  border-top: 1px solid var(--l-line); border-left: 1px solid var(--l-line);
}
.skill {
  position: relative; display: flex; flex-direction: column; gap: 22px; min-height: 190px; padding: 22px;
  border-right: 1px solid var(--l-line); border-bottom: 1px solid var(--l-line);
  transition: background-color 300ms ease;
}
.skill__icon {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px;
  background: var(--bg-c, #000); color: var(--fg-c, var(--b));
  font-weight: 600; letter-spacing: -0.03em; font-size: 1.15rem;
  transition: background-color 300ms ease, color 300ms ease;
}
.skill__icon[data-len="3"] { font-size: .92rem; }
.skill__icon img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.skill__icon.has-img { background: transparent; }
.skill__name { margin: auto 0 0; font-size: 1.08rem; font-weight: 600; letter-spacing: -0.02em; }
.skill__desc { margin: 6px 0 0; color: var(--l-muted); font-size: .88rem; line-height: 1.45; }
@media (hover: hover) and (pointer: fine) {
  .skill:hover { background: rgba(0,0,0,.04); }
  .skill:hover .skill__icon:not(.has-img) { background: var(--a); color: #fff; }
}
@media (max-width: 520px) {
  .skills__grid { grid-template-columns: 1fr 1fr; }
  .skill { min-height: 160px; padding: 16px; gap: 16px; }
  .skill__icon { width: 44px; height: 44px; font-size: 1rem; }
  .skill__name { font-size: .98rem; }
  .skill__desc { font-size: .8rem; }
}

/* clients — bare logos, three rows drifting right */
.clients { padding: clamp(50px, 6vw, 80px) 0 clamp(100px, 12vw, 160px); overflow: hidden; }
.clients__head { display: flex; flex-direction: column; align-items: flex-start; gap: clamp(14px, 1.6vw, 22px); margin-bottom: clamp(40px, 6vw, 80px); }
.clients__count { margin: 0; font-size: clamp(4.4rem, 13vw, 11rem); font-weight: 600; letter-spacing: -0.07em; line-height: .82; color: var(--a); }
.clients__title { max-width: none; padding-left: .06em; font-size: clamp(1.4rem, 2.8vw, 2.4rem); }

.marquee { display: grid; gap: clamp(28px, 4vw, 48px);
  -webkit-mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee__row { display: flex; align-items: center; width: max-content; animation: marquee-right var(--dur, 60s) linear infinite; }
.marquee__row:nth-child(2) { animation-duration: calc(var(--dur, 60s) * 1.25); }
.marquee__row:nth-child(3) { animation-duration: calc(var(--dur, 60s) * 0.85); }
.marquee:hover .marquee__row { animation-play-state: paused; }
@keyframes marquee-right { from { transform: translateX(-50%); } to { transform: translateX(0); } }
.logo-card { flex: none; display: flex; align-items: center; height: 44px; padding: 0 clamp(26px, 3.4vw, 48px); color: rgba(0,0,0,.62); transition: color 200ms ease; }
.logo-card img { height: 100%; max-height: 40px; width: auto; max-width: 180px; object-fit: contain; filter: grayscale(1) brightness(0); opacity: .62; transition: filter 300ms ease, opacity 300ms ease; }
.logo-card span { font-size: clamp(1.25rem, 2vw, 1.7rem); font-weight: 600; letter-spacing: -0.04em; white-space: nowrap; }
.logo-card:nth-child(4n+2) span { font-weight: 500; letter-spacing: .16em; font-size: clamp(.95rem, 1.4vw, 1.15rem); text-transform: uppercase; }
.logo-card:nth-child(4n+3) span { font-style: italic; font-weight: 500; }
.logo-card:nth-child(4n) span { font-weight: 800; letter-spacing: -0.06em; }
@media (hover: hover) and (pointer: fine) {
  .logo-card:hover { color: #000; }
  .logo-card:hover img { opacity: 1; filter: none; }
}

/* =========================================================
   Contact
   ========================================================= */
.contact { position: relative; padding: 0; background: var(--l-bg); margin: 0 clamp(0px, 1vw, 12px); }
.contact > .wrap { max-width: none; padding: 0; }
.contact__card {
  position: relative; overflow: hidden; isolation: isolate;
  padding: clamp(64px, 10vw, 140px) clamp(24px, 6vw, 96px);
  border-radius: var(--r-xl) var(--r-xl) 0 0; background: #000; color: var(--text);
}
.contact__glow { position: absolute; z-index: -1; width: 60vw; height: 60vw; left: -20vw; bottom: -40vw; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--a) 40%, transparent), transparent 62%); filter: blur(30px); }
.contact__title { margin: 0; max-width: 14ch; font-size: clamp(2.6rem, 7vw, 6.4rem); line-height: .95; letter-spacing: -0.055em; font-weight: 600; text-wrap: balance; }
.contact__cv { margin-top: 32px; }
.contact__cv-meta { font-size: .7rem; font-weight: 500; letter-spacing: .06em; opacity: .55; margin-left: 2px; }
.contact__links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: clamp(40px, 6vw, 72px); border-top: 1px solid var(--line); }
.contact-link {
  position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
  padding: 26px 20px 26px 0; color: var(--text);
  transition: color 200ms ease;
}
.contact-link + .contact-link { padding-left: 20px; border-left: 1px solid var(--line); }
.contact-link__ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--b); color: #000; transition: background-color 240ms ease, color 240ms ease, transform 160ms var(--ease-out); }
.contact-link__ic svg { width: 19px; height: 19px; }
.contact-link__txt { display: grid; min-width: 0; line-height: 1.25; }
.contact-link__txt small { font: 500 .68rem var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.contact-link__txt b { margin-top: 4px; font-weight: 500; font-size: 1rem; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contact-link__go { width: 18px; height: 18px; color: var(--faint); transition: transform 240ms var(--ease-out), color 200ms ease; }
.contact-link__go svg { width: 100%; height: 100%; }
.contact-link:active .contact-link__ic { transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) {
  .contact-link:hover .contact-link__ic { background: var(--a); color: #fff; }
  .contact-link:hover .contact-link__go { color: var(--a); transform: translate(2px, -2px); }
}
@media (max-width: 1360px) {
  .contact__links { grid-template-columns: 1fr 1fr; }
  .contact-link:nth-child(3) { padding-left: 0; border-left: 0; }
  .contact-link:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .contact__links { grid-template-columns: 1fr; }
  .contact-link, .contact-link + .contact-link { padding: 20px 0; border-left: 0; }
  .contact-link + .contact-link { border-top: 1px solid var(--line); }
}

.footer { background: #000; margin: 0 clamp(0px, 1vw, 12px); color: var(--faint); font-size: .86rem; }
.footer__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 22px; padding-bottom: 28px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.footer p { margin: 0; }
.footer__top { color: var(--muted); font: 500 .74rem var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.footer__top:hover { color: var(--a); }

/* =========================================================
   Lightbox
   ========================================================= */
.lightbox { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: clamp(0px, 2vw, 28px); }
.lightbox__scrim { position: absolute; inset: 0; background: rgba(0,0,0,.8); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); opacity: 0; transition: opacity 250ms var(--ease-out); }
.lightbox__panel { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 340px; width: min(1480px, 100%); height: min(920px, 100%); border-radius: 20px; overflow: hidden; background: #0a0a0a; box-shadow: inset 0 0 0 1px var(--line);
  opacity: 0; transform: scale(0.96); transition: opacity 250ms var(--ease-out), transform 250ms var(--ease-out); }
.lightbox.is-open .lightbox__scrim { opacity: 1; }
.lightbox.is-open .lightbox__panel { opacity: 1; transform: none; }
.lightbox__media { position: relative; display: grid; place-items: center; background: #000; min-height: 0; touch-action: pan-y; }
.lightbox__media { overflow: hidden; height: 100%; }
.lightbox__media > img, .lightbox__media > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.lightbox__media > iframe { width: 100%; height: 100%; border: 0; }
.lightbox__media .demo { position: relative; width: min(100%, 720px); aspect-ratio: var(--ratio); max-height: 100%; }
.lightbox__media > * { transition: opacity 220ms ease, transform 300ms var(--ease-out), filter 220ms ease; }
.lightbox__media.is-swapping > * { opacity: 0; filter: blur(4px); }
.lightbox__info { display: flex; flex-direction: column; padding: 72px 28px 24px; border-left: 1px solid var(--line); overflow-y: auto; }
.lightbox__cat { margin: 0 0 12px; font: 500 .7rem var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--a); }
.lightbox__title { margin: 0; font-size: 1.8rem; line-height: 1.08; letter-spacing: -0.035em; font-weight: 600; }
.lightbox__desc { margin: 16px 0 0; color: var(--muted); line-height: 1.6; white-space: pre-line; }
.lightbox__meta { display: grid; grid-template-columns: auto 1fr; gap: 10px 20px; margin: 28px 0 0; padding-top: 22px; border-top: 1px solid var(--line); font-size: .92rem; }
.lightbox__meta dt { color: var(--faint); font: 500 .7rem/1.9 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.lightbox__meta dd { margin: 0; }
.lightbox__nav { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 24px; }
.lightbox__count { color: var(--faint); font: 500 .8rem var(--mono); }
.lightbox__close { position: absolute; top: 16px; right: 16px; z-index: 2; background: rgba(0,0,0,.6); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
@media (max-width: 900px) {
  .lightbox { padding: 0; }
  .lightbox__panel { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; height: 100%; border-radius: 0; }
  .lightbox__info { border-left: 0; border-top: 1px solid var(--line); padding: 20px 20px calc(16px + env(safe-area-inset-bottom)); max-height: 42vh; }
  .lightbox__title { font-size: 1.35rem; }
  .lightbox__meta { margin-top: 18px; padding-top: 16px; }
}

/* =========================================================
   Global film noise (top layer)
   ========================================================= */
.noise {
  position: fixed; inset: 0; z-index: 2147483647; pointer-events: none;
  opacity: .052;
}

/* =========================================================
   Scroll reveal & preferences
   ========================================================= */
.reveal { opacity: 0; transform: translateY(24px); }
.reveal.is-visible { opacity: 1; transform: none; transition: opacity 800ms var(--ease-out), transform 800ms var(--ease-out); transition-delay: var(--d, 0ms); }

/* =========================================================
   Roles — pipeline: бренд → направления → задачи
   ========================================================= */
.roles { padding: clamp(30px, 4vw, 60px) 0 clamp(70px, 8vw, 120px); }
.roles .section-head { max-width: 760px; }
.pipe { --gap: clamp(12px, 1.4vw, 20px); --stub: 36px; --link: 22px; --ln: rgba(0, 0, 0, .22); position: relative; display: grid; justify-items: center; }

.pipe__hub { position: relative; display: inline-flex; align-items: center; gap: 12px; padding: 13px 22px 13px 18px; border-radius: 999px; background: #000; color: var(--b); }
.pipe__hub b { font-size: 1.02rem; font-weight: 600; letter-spacing: -0.02em; }
.pipe__hub small { color: color-mix(in srgb, var(--b) 58%, transparent); font-size: .78rem; font-weight: 500; letter-spacing: .02em; }
.pipe__pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--a); }
.pipe__pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1.5px solid var(--a); opacity: 0; animation: ping 2.4s var(--ease-out) infinite; }
.pipe__hub::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1px; height: var(--stub); background: var(--ln); }

/* общая шина от центра первой колонки до центра последней */
.pipe__bus { position: relative; height: 1px; margin-top: var(--stub); background: var(--ln); overflow: hidden;
  width: calc(100% - (100% - (var(--n) - 1) * var(--gap)) / var(--n)); }
.pipe__bus i { position: absolute; top: 0; bottom: 0; left: -30%; width: 30%; background: linear-gradient(90deg, transparent, var(--a), transparent); animation: pipe-bus 3.6s cubic-bezier(.45, 0, .55, 1) infinite; }
@keyframes pipe-bus { to { left: 100%; } }

.pipe__grid { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: var(--gap); }
.pipe__col { position: relative; display: flex; flex-direction: column; padding-top: var(--stub); }
.pipe__col::before { content: ""; position: absolute; left: 50%; top: 0; width: 1px; height: var(--stub); background: var(--ln); transition: background-color 300ms ease; }

.pipe__role { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 16px; background: #000; color: var(--b); }
.pipe__icon { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 11px; background: var(--b); color: #000; font-weight: 600; font-size: 1.05rem; letter-spacing: -0.03em; transition: background-color 300ms ease, color 300ms ease; }
.pipe__role small { display: block; margin-bottom: 3px; color: color-mix(in srgb, var(--b) 50%, transparent); font-size: .7rem; font-weight: 600; letter-spacing: .12em; }
.pipe__role h3 { margin: 0; font-size: 1.04rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }

.pipe__tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pipe__task { position: relative; display: flex; align-items: flex-start; gap: 12px; margin-top: var(--link); padding: 14px 16px; border-radius: 12px; border: 1px solid var(--l-line); color: var(--l-text); font-size: .92rem; line-height: 1.4; transition: border-color 300ms ease, background-color 300ms ease; }
/* соединительная линия к блоку выше */
.pipe__task::before { content: ""; position: absolute; left: 50%; bottom: 100%; width: 1px; height: var(--link); background: var(--ln); transition: background-color 300ms ease; }
/* бегущий импульс по линии — сверху вниз, волной по колонке */
.pipe__task::after { content: ""; position: absolute; left: 50%; bottom: 100%; width: 5px; height: 5px; margin: 0 0 -2px -2.5px; border-radius: 50%; background: var(--a); opacity: 0;
  animation: pipe-drop 2.8s ease-in infinite; animation-delay: calc(var(--i, 0) * .35s + var(--j, 0) * .3s); }
@keyframes pipe-drop {
  0% { opacity: 0; transform: translateY(calc(var(--link) * -1)); }
  12% { opacity: 1; }
  28% { opacity: 1; transform: translateY(0); }
  36%, 100% { opacity: 0; transform: translateY(0); }
}
.pipe__node { flex: none; width: 7px; height: 7px; margin-top: .45em; background: var(--a); }

@media (hover: hover) and (pointer: fine) {
  .pipe__col:hover::before, .pipe__col:hover .pipe__task::before { background: var(--a); }
  .pipe__col:hover .pipe__icon { background: var(--a); color: #000; }
  .pipe__col:hover .pipe__task { border-color: rgba(0, 0, 0, .42); background: rgba(0, 0, 0, .03); }
}

@media (max-width: 1080px) {
  .pipe__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 44px; }
  .pipe__bus, .pipe__col::before { display: none; }
  .pipe__hub { margin-bottom: 30px; }
  .pipe__hub::after { height: 30px; }
  .pipe__col { padding-top: 0; }
}
@media (max-width: 600px) {
  .pipe__grid { grid-template-columns: 1fr; }
  .pipe__hub { flex-wrap: wrap; justify-content: center; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .status__dot::after, .st *, .pipe * { animation: none !important; }
  .st .z, .st .c { opacity: 1; }
  .marquee__row { animation-duration: 240s !important; }
  .reveal, .reveal-in, .tile.is-entering { transform: none !important; filter: none !important; }
  .reveal.is-visible, .is-ready .reveal-in, .tile.is-in { transition: opacity 300ms ease !important; }
  .lightbox__panel, .sheet { transform: none !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .nav.is-scrolled .nav__bar, .sheet, .btn--glass { backdrop-filter: none; background: #0b0b0a; }
}
@media (prefers-contrast: more) { :root { --muted: rgba(236,234,227,.85); --line: rgba(204,200,185,.35); } }
