/* sadchikov.com — public site styles. Sizes mirror the original Tilda Zero blocks (1200 grid). */

@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(fonts/manrope-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(fonts/manrope-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(fonts/manrope-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(fonts/manrope-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #000;
  --fg: #fff;
  --muted: #aaa;
  --body: #ccc;
  --line: #383838;
  --line-table: #353535;
  --gutter: 24px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.5 Manrope, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
.b { margin-top: calc(var(--sp, 0) * 1px); }

/* ------------------------------------------------------------------ home */

/* home, case pages (wide blocks), their top bar and «Следующий проект» share one grid: 1200px */
.home {
  max-width: calc(1200px + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter) 60px;
}
/* hover on «Проекты» in the top bar: dust along a wave under the link (Render::navDust, www/assets/hero/navdust.js) */
/* fixed: stays under the link at any scroll; above the top bar (z 10) so its dark backing does not dim the dust;
   the engine's canvas is opaque black, `screen` drops the black. On scroll the wave shrinks inside the engine (navdust.js) and the host is scaled toward the link (Render::navDust) */
/* wide screens: at most 1400 px wide and its right edge 240 px past the content column (1128 px), not at the screen
   edge — otherwise the wave runs far from the link and thins out */
.nav-dust { position: fixed; top: 0; right: max(0px, calc((100vw - 1248px) / 2 - 240px)); z-index: 11; mix-blend-mode: screen; transform-origin: 100% 0; width: min(82vw, 1400px); height: min(48vh, 480px); pointer-events: none; }
.nav-dust .ph-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
/* hover on «Проекты», second layer: a ring of project cards turning around a vertical axis (Render::navCards).
   In the right column above the contacts (two equal columns, gap 100: its centre is a quarter of the content width
   + 25px right of the page centre — 325px on the 1200 grid; gap 40 below 961px: 25vw − 2px);
   absolute → scrolls with the page; above the dust (z 11) */
.nav-cards {
  position: absolute; top: 72px; left: calc(50% + min(325px, (100vw - 48px) / 4 + 25px)); z-index: 12;
  --w: 148px; --t: 4px;   /* card width, card thickness */
  width: var(--w); height: 228px; margin-left: calc(var(--w) / -2);
  perspective: 1100px; pointer-events: none;
  opacity: 0; visibility: hidden; transition: opacity .45s, visibility .45s;
}
/* --vis: fades out over the first 200 px of scroll (Render::navDust) — the ring lies above the top bar and would
   slide over it */
.nav-cards.is-on { opacity: var(--vis, 1); visibility: visible; }
.nav-cards__tilt { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(-8deg) rotateZ(-5deg) scale(.79); transition: transform .7s cubic-bezier(.2, .8, .2, 1); }
.nav-cards.is-on .nav-cards__tilt { transform: rotateX(-8deg) rotateZ(-5deg) scale(.9); }
.nav-cards__ring { position: absolute; inset: 0; transform-style: preserve-3d; animation: nav-cards-spin 16s linear infinite paused; }
.nav-cards.is-on .nav-cards__ring { animation-play-state: running; }
@keyframes nav-cards-spin { to { transform: rotateY(-360deg); } }
.nav-cards__card {
  position: absolute; inset: 0; transform-style: preserve-3d;
  transform: rotateY(calc(var(--i) * 360deg / var(--n))) translateZ(127px);   /* radius: sets the gaps between cards */
}
/* front and back faces, --t apart; the back is turned 180° so its picture reads the right way round, a bit darker */
.nav-cards__face {
  position: absolute; inset: 0; overflow: hidden; border-radius: 14px; background: #111;
  backface-visibility: hidden; box-shadow: 0 18px 40px rgb(0 0 0 / .55);
  transform: translateZ(calc(var(--t) / 2));
}
.nav-cards__face--back { transform: rotateY(180deg) translateZ(calc(var(--t) / 2)); }
/* the card's edge: rounded layers 1 px apart between the faces (--z = -1, 0, 1); seen from the side they merge into
   a solid rim that follows the rounded corners */
.nav-cards__layer {
  position: absolute; inset: 0; border-radius: 14px;
  background: linear-gradient(to bottom, #7d8089, #3b3d44 55%, #26272c);
  transform: translateZ(calc(var(--z) * 1px));
}
.nav-cards__face--back img { filter: brightness(.6); }
.nav-cards__face img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* the same two columns as .cv__cols below (equal, gap 100 / 40), so the contacts line up with the right column */
.profile {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 100px;
  align-items: end;
  padding: 40px 0 78px;
}
.profile__main { max-width: 410px; }   /* the bio keeps its measure in the wider column */
.avatar { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; }
.profile__name { margin-top: 32px; font-size: 24px; line-height: 31px; font-weight: 700; }
.profile__role { margin-top: 8px; font-size: 15px; line-height: 23px; color: var(--muted); }
.profile__bio { margin-top: 32px; font-size: 16px; line-height: 24px; }
.profile__bio p + p { margin-top: 0; }
.profile__contacts { list-style: none; padding: 0; font-size: 12px; line-height: 16px; }
.profile__contacts li { padding: 17px 0; border-top: 1px solid var(--line); }
.profile__contacts li:first-child { padding-top: 0; border-top: 0; }
.profile__contacts li:last-child { padding-bottom: 0; }

.ext { text-decoration: none; transition: color .2s; }
.ext:hover { color: var(--muted); }
.arrow { display: inline-block; margin-left: 6px; color: #ababab; vertical-align: -1px; }

.cv { border-top: 1px solid var(--line); padding: 30px 0 61px; }
.cv__title { font-size: 12px; line-height: 18px; font-weight: 700; text-transform: uppercase; }
.cv__icons { list-style: none; padding: 0; margin-top: 30px; display: flex; flex-wrap: wrap; gap: 10px; }
.cv__icons img { width: 40px; height: 40px; }
.cv__cols {
  margin-top: 31px;
  display: grid;
  grid-template-columns: repeat(var(--cols, 2), 1fr);
  column-gap: 100px;
}
.cv__cols[style*="--cols:3"] { column-gap: 42px; }
.cv__cols[style*="--cols:4"] { column-gap: 40px; }
.cv__icons + .cv__cols { margin-top: 33px; }
.cv-col { display: flex; flex-direction: column; gap: 32px; }
.cv-item { font-size: 15px; line-height: 23px; }
.cv-item__caption { color: var(--muted); line-height: 20px; }
.cv-item__body { margin-top: 12px; }
.cv__icons + .cv__cols .cv-item__body { margin-top: 20px; }
.cv-item ul { padding-left: 20px; }

.projects {
  list-style: none;
  padding: 0;
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.card { display: block; aspect-ratio: 353 / 276; overflow: hidden; background: #111; }
.card img, .card video { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
a.card:hover img { transform: scale(1.03); } /* animated tiles (video) don't zoom */

/* last cell of «Избранные проекты»: link to /projects */
.card--all {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: var(--bg);
  font-size: 15px; /* Nav/Item */
  line-height: 23px;
  color: var(--muted);
  text-decoration: none;
  transition: color .2s;
}
.card--all:hover { color: var(--fg); }
/* particles (Render::tileParticles, www/assets/hero/tile.js) under the plain HTML label */
.card--all .ph-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.card--all > span { position: relative; z-index: 1; text-shadow: 0 0 14px #000, 0 0 4px #000; }
/* → appears on hover to the right of the label (absolute, so the label stays centred), like .pcard__arrow */
.card__arrow { position: absolute; left: calc(100% + 8px); top: 50%; margin-top: -7px; opacity: 0; transform: translateX(-6px); transition: opacity .25s, transform .25s; }
.card--all:hover .card__arrow, .card--all:focus-visible .card__arrow { opacity: 1; transform: none; }

/* ---------------------------------------------------------------- top bar */
/* One fixed row, content as wide as the 1080 column. Home and /projects: transparent until scrolled. */

.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  height: 70px;
}
/* Progressive blur backing: a dark gradient plus 7 backdrop-filter layers (0.5 → 32px) whose masks hand
   over to each other, so the content under the bar gets blurrier and darker toward the top edge and
   stays sharp at the bottom edge, with no visible line. Without backdrop-filter only the gradient remains. */
/* the backing runs 30px below the bar, so the nav text sits in the strong part and the fade-out happens under it */
.topbar__blur { position: absolute; inset: 0 0 -30px; pointer-events: none; }
.topbar__blur::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgb(0 0 0 / .9) 0%, rgb(0 0 0 / .75) 45%, rgb(0 0 0 / .35) 75%, rgb(0 0 0 / 0) 100%);
  transition: opacity .25s;
}
/* home and /projects before scrolling: no backing. Only the tint fades: opacity < 1 on an ancestor
   would turn off backdrop-filter, so the blur layers are switched, not faded. */
.topbar--overlay:not(.is-scrolled) .topbar__blur::before { opacity: 0; }
.topbar--overlay:not(.is-scrolled) .topbar__blur i { visibility: hidden; }
.topbar__blur i { position: absolute; inset: 0; }
.topbar__blur i:nth-child(1) { --b: .5px; --m: linear-gradient(to top, transparent 0%, #000 12.5%, #000 25%, transparent 37.5%); }
.topbar__blur i:nth-child(2) { --b: 1px; --m: linear-gradient(to top, transparent 12.5%, #000 25%, #000 37.5%, transparent 50%); }
.topbar__blur i:nth-child(3) { --b: 2px; --m: linear-gradient(to top, transparent 25%, #000 37.5%, #000 50%, transparent 62.5%); }
.topbar__blur i:nth-child(4) { --b: 4px; --m: linear-gradient(to top, transparent 37.5%, #000 50%, #000 62.5%, transparent 75%); }
.topbar__blur i:nth-child(5) { --b: 8px; --m: linear-gradient(to top, transparent 50%, #000 62.5%, #000 75%, transparent 87.5%); }
.topbar__blur i:nth-child(6) { --b: 16px; --m: linear-gradient(to top, transparent 62.5%, #000 75%, #000 87.5%, transparent 100%); }
.topbar__blur i:nth-child(7) { --b: 32px; --m: linear-gradient(to top, transparent 75%, #000 87.5%, #000 100%); }
.topbar__blur i { -webkit-backdrop-filter: blur(var(--b)); backdrop-filter: blur(var(--b)); -webkit-mask-image: var(--m); mask-image: var(--m); }
.topbar__in {
  position: relative;
  max-width: calc(1200px + 2 * var(--gutter));
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  gap: 20px;
}
.topbar__left, .topbar__right { flex: 1 1 0; min-width: 0; display: flex; align-items: center; }
.topbar__right { justify-content: flex-end; gap: 30px; }

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  line-height: 23px;
  color: var(--muted);   /* grey at rest, white on hover — like the inactive language in RUS / ENG */
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s;
}
.nav-item--grid { gap: 3px; } /* the 28px icon has 6.5px inner padding: visually the same 10px */
.nav-item:hover, .nav-item:focus-visible { color: var(--fg); }
.nav-item__avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.grid-icon { display: block; flex: none; }

/* «← Все проекты»: thin SVG arrow 16px from the label, as on the live site */
.back { display: inline-flex; align-items: center; gap: 16px; font-size: 15px; line-height: 23px; color: var(--muted); text-decoration: none; white-space: nowrap; transition: color .2s; }
.back svg { flex: none; display: block; }
.back:hover { color: var(--fg); }

.tabs { display: flex; gap: 20px; font-size: 15px; line-height: 23px; white-space: nowrap; }
.tab { color: var(--muted); text-decoration: none; transition: color .2s; }
a.tab:hover, .tab.is-active { color: var(--fg); }

/* RUS / ENG: current language white, the other grey */
.lang { display: flex; align-items: center; gap: 4px; font-size: 12px; line-height: 16px; color: var(--muted); white-space: nowrap; }
.lang__item { color: var(--muted); text-decoration: none; transition: color .2s; }
a.lang__item:hover, .lang__item.is-active { color: var(--fg); }

/* -------------------------------------------------------------- /projects */

/* wider than the site's 1080 column on big screens: 75% of the window, 1080…1600 (the card layout is in %) */
.plist {
  max-width: calc(clamp(1080px, 75vw, 1600px) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 40px var(--gutter) 80px;
}
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Groups of 2 and 3 cards with offset columns (Figma «Projects — v03», 1080 column):
   pair  = 490 + 100 gap + 490, the right card dropped (200 px in the first pair, 127 px later);
   triple = 357-wide cards in a cascade: left on top, right 235 px lower, middle 407 px lower between them.
   Offsets are margins in % — for grid items they resolve against the card's own column width, so the
   rhythm scales with the screen. A dropped card that should not push the next group down gets the same
   negative bottom margin («hangs» into the gap). */
/* short intro under the animation, right column, above the first project */
.plist__intro { position: relative; top: 40px; width: min(38.5%, 440px); margin: 0 0 50px auto; font-size: 16px; line-height: 24px; color: var(--muted); text-wrap: pretty; }
/* lines set by hand in the admin (Render: line breaks → .plist__br): kept while the longest line fits the column
   (a bit wider than the column is allowed); when it does not, the breaks are dropped and the text wraps in the column
   (projects.js measures both and sets .is-wrap) */
.plist__intro--lines:not(.is-wrap) { width: max-content; max-width: 100%; white-space: nowrap; text-wrap: nowrap; }
.plist__intro--lines.is-wrap .plist__br { display: none; }
/* fades (and on desktop drifts down ~0.65 px per px — i.e. slowly up on screen) with the scroll; --intro-end = where the
   hero is gone, set by the hero script. Without scroll timelines the same is done from JS (Render::particleHero) */
@supports (animation-timeline: scroll()) {
  .plist__intro { animation: intro-fade linear both; animation-timeline: scroll(root); animation-range: 0 var(--intro-end, 600px); }
  @media (min-width: 640px) and (prefers-reduced-motion: no-preference) { .plist__intro { animation-name: intro-drift; } }
}
@keyframes intro-fade { to { opacity: 0; } }
@keyframes intro-drift { to { opacity: 0; transform: translateY(calc(var(--intro-end, 600px) * 0.65)); } }
.pgrid { display: flex; flex-direction: column; gap: 120px; padding-bottom: 200px; }
.pgroup { display: grid; align-items: start; }
.pgroup--2 { grid-template-columns: 1fr 1fr; column-gap: 9.26%; }
.pgroup--2 > .pcell:nth-child(2) { margin-top: 25.9%; margin-bottom: -25.9%; }
.pgroup--2:first-child > .pcell:nth-child(2) { margin-top: 40.8%; margin-bottom: -40.8%; }
.pgroup--3 { grid-template-columns: 26.2% 6.85% 26.2% 7.6% 33.15%; }
.pgroup--3 > .pcell { grid-row: 1; }
.pgroup--3 > .pcell:nth-child(1) { grid-column: 1 / 3; }
.pgroup--3 > .pcell:nth-child(2) { grid-column: 5 / 6; margin-top: 65.8%; margin-bottom: -65.8%; }
.pgroup--3 > .pcell:nth-child(3) { grid-column: 2 / 4; margin-top: 114%; }
.pcell { position: relative; scroll-margin-top: 90px; }

.pcard { display: block; color: var(--fg); text-decoration: none; }
.pcard__cover { aspect-ratio: 525 / 410; overflow: hidden; border-radius: 4px; background: #111; }
.pcard__cover img, .pcard__cover video { display: block; width: 100%; height: 100%; object-fit: cover; }
/* «Floorcloud ↗ ……… SaaS · IoT · Mobile» */
.pcard__meta { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 16px; margin-top: 14px; }
.pcard__title { display: inline-flex; align-items: center; gap: 8px; font-size: 22px; line-height: 33px; font-weight: 500; color: #ededed; transition: color .2s; }
.pcard__arrow { flex: none; opacity: 0; transform: translateX(-6px); transition: opacity .25s, transform .25s; }   /* → slides in from the left */
.pcard__tags { font-size: 14px; line-height: 20px; color: var(--muted); }
/* the description shows on hover under the card, in the gap — nothing below moves */
.pcard__text {
  position: absolute; left: 0; right: 0; top: 100%;
  margin-top: 8px; font-size: 18px; line-height: 27px; color: var(--muted);
  opacity: 0; transform: translateY(-6px); transition: opacity .3s, transform .3s; pointer-events: none;
}
/* entrance (www/assets/projects.js): rise 42px, un-blur, fade in; html.js-reveal is set only when JS runs */
.js-reveal .pcell { opacity: 0; transform: translateY(42px); filter: blur(8px); }
.js-reveal .pcell.is-in {
  opacity: 1; transform: none; filter: none;
  transition: opacity .9s cubic-bezier(.2, .7, .2, 1), transform .9s cubic-bezier(.2, .7, .2, 1), filter .9s cubic-bezier(.2, .7, .2, 1);
  transition-delay: calc(var(--d, 0) * 1ms);
}
/* tilt after the pointer (±4°, vars set by projects.js) + glare */
.pcard__cover { position: relative; transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); will-change: transform; }
.pcard__cover::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(60% 60% at var(--mx, 50%) var(--my, 30%), rgb(255 255 255 / .22), rgb(255 255 255 / 0) 70%);
  mix-blend-mode: soft-light; opacity: 0; transition: opacity .3s;
}
a.pcard:hover .pcard__cover::after { opacity: 1; }
/* dust behind the cards: above the hero, below the list */
.pdust { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.pcard:hover .pcard__title, .pcard:focus-visible .pcard__title { color: var(--fg); }
.pcard:hover .pcard__arrow, .pcard:focus-visible .pcard__arrow { opacity: 1; transform: none; }
.pcard:hover .pcard__text, .pcard:focus-visible .pcard__text { opacity: 1; transform: none; }

/* particle hero «Оболочка» above the list (www/assets/hero/). The stage is sticky: the list scrolls
   over the animation, which fades out as you scroll (script in Render::particleHero). */
/* Height follows the word, whose size follows the screen width: top bar (--tb) + overlap with the list
   (--ov, = -margin-top of .plist--hero) + gaps and word height as a share of the width (--k).
   The word's vertical position is set to match in Render::particleHero (same numbers). */
.ph-stage {
  --tb: 70px;
  --ov: 120px;
  --k: .392;   /* gap above .042 + word .206 + gap below .144 (engine: word = 0.96 × width on desktop) */
  position: sticky;
  top: 0;
  z-index: 0;
  height: min(84vh, 860px, calc(var(--tb) + var(--ov) + var(--k) * 100vw));
}
@media (max-width: 759px) {
  .ph-stage { --k: .406; }   /* engine "mobile" mode: word = 0.94 × width, gap above .06 */
}
.ph-hero { position: absolute; inset: 0; overflow: hidden; background: var(--bg); transform-origin: 50% 37%; /* refined to the word centre by the mount script */ will-change: opacity, transform; }
.ph-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; }
/* ring of words (www/assets/hero/ring.js): back half under the particles, front half over them.
   The particle canvas is opaque black, so it is blended with `screen`: black lets the back half show through. */
.ph-hero { isolation: isolate; }
.ph-hero > .ph-canvas { z-index: 1; mix-blend-mode: screen; }
.ph-ring { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ph-ring--back { z-index: 0; }
.ph-ring--front { z-index: 2; }
/* 3D UI objects (www/assets/hero/objects.js) over the rings, under the bottom fade */
.ph-obj { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
.ph-obj--gl { z-index: 5; }   /* inflated objects stay out of the bottom fade (they fade with the whole hero on scroll) */
/* the toggle (objects.js) switches the particles off: their canvas fades out, pictures of the word, the cursor and
   glossy balls fade in with a light parallax (offlayer.js) — the word between the ring's halves like the particles,
   the cursor and the balls over the bottom fade */
.ph-hero > .ph-canvas { transition: opacity .6s; }
.ph-hero > .ph-canvas.is-off { opacity: 0; }
.ph-off { position: absolute; left: 0; top: 0; max-width: none; height: auto; pointer-events: none; user-select: none;
  opacity: 0; transition: opacity .6s; will-change: transform; }
.ph-off.is-on { opacity: 1; }
.ph-off--word { z-index: 1; }
.ph-off--cursor { z-index: 5; }
.ph-off--ball { z-index: 5; }
.ph-hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 46%;
  pointer-events: none;
  z-index: 4;
  background: linear-gradient(to bottom, rgb(0 0 0 / 0) 0%, rgb(0 0 0 / .35) 30%, rgb(0 0 0 / .75) 62%, var(--bg) 100%);
}
.plist--hero { position: relative; z-index: 2; margin-top: -120px; padding-top: 0; }

/* ------------------------------------------------------------------ case */

.case {
  max-width: calc(1200px + 2 * var(--gutter));
  margin: 0 auto;
  padding: 70px var(--gutter) 80px;
}
.case > .b { margin-left: auto; margin-right: auto; max-width: 1200px; }
.case > .w-narrow { max-width: 900px; }
.case > .w-medium, .case > .b-table { max-width: 1080px; }
.case > .b-divider { max-width: 1200px; }

.h-title { font-size: 32px; line-height: 32px; font-weight: 700; text-align: center; }
.h-m { font-size: 26px; line-height: 34px; font-weight: 400; }
.h-l { font-size: 30px; line-height: 45px; font-weight: 400; }

.t { font-size: 20px; line-height: 30px; color: var(--body); }
.t p + p, .t p + ul, .t ul + p, .t ul + ul { margin-top: 20px; }
.t ul, .t ol { padding-left: 20px; }
.t a { color: var(--fg); }
.t-lead { font-size: 26px; line-height: 34px; color: var(--fg); }
.t-lead-l { font-size: 30px; line-height: 45px; color: var(--fg); }
.t-strong { font-weight: 700; color: var(--fg); }
.t-center { text-align: center; }
.t-indent { padding-left: 20px; }

.fig { margin-left: auto; margin-right: auto; }
.fig img { width: 100%; }
.fig figcaption { margin-top: 20px; font-size: 20px; line-height: 30px; color: var(--body); text-align: center; }
.gallery { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: var(--gap); margin: 0 auto; }

.video { margin: 0 auto; }
.video__frame { position: relative; background: #111; }
.video__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video__frame video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
/* own-file case videos are rounded like the case images: 20 px at 1200 px wide, scaling with the block */
.video { container-type: inline-size; }
.video__frame:has(> video) { border-radius: calc(100cqw * 20 / 1200); overflow: hidden; background: transparent; }

.tbl__title { font-size: 20px; line-height: 30px; font-weight: 700; padding-left: 20px; margin-bottom: 40px; }
.tbl__scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 20px; line-height: 30px; color: var(--body); }
.tbl th { font-weight: 700; text-align: left; padding: 0 20px 10px; vertical-align: top; }
.tbl td { padding: 10px 20px; vertical-align: top; }
.tbl th:last-child, .tbl td:last-child { padding-right: 0; }
.tbl thead tr, .tbl tbody tr:not(:last-child) { border-bottom: 1px solid var(--line-table); }

.divider { border: 0; height: 1px; background: var(--line); margin: 0; }

.btn-row { text-align: center; }
.btn { font-size: 20px; line-height: 31px; color: var(--muted); text-decoration: none; transition: color .2s; }
.btn:hover { color: var(--fg); }

/* end of a case (Figma 131:6395): cover + «Следующий проект» / title (→ slides in on hover, as on /projects cards),
   «Проекты» on the right as in the top bar (.nav-item), with the hover dust rising from the bottom of the page */
.next-wrap { overflow-x: clip; }   /* the dust reaches past the column; 100vw counts the scrollbar — no sideways scroll */
.next { position: relative; max-width: calc(1200px + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.next__in {
  position: relative; z-index: 1;   /* above its dust */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 40px 0;
  border-top: 1px solid var(--line);
}
.next__link { display: flex; align-items: center; gap: 20px; min-width: 0; color: var(--fg); text-decoration: none; }
.next__cover { flex: none; width: 130px; height: 100px; overflow: hidden; border-radius: 4px; background: #111; }
.next__cover img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.next__link:hover .next__cover img { transform: scale(1.04); }
.next__text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.next__label { font-size: 14px; line-height: 20px; color: var(--muted); }
.next__title { display: inline-flex; align-items: center; gap: 8px; font-size: 22px; line-height: 33px; font-weight: 500; color: #ededed; transition: color .2s; }
.next__arrow { flex: none; opacity: 0; transform: translateX(-6px); transition: opacity .25s, transform .25s; }
.next__link:hover .next__title, .next__link:focus-visible .next__title { color: var(--fg); }
.next__link:hover .next__arrow, .next__link:focus-visible .next__arrow { opacity: 1; transform: none; }
/* the dust host of «Проекты» here: at the bottom of the page under the link, mirrored (the wave rises from the
   bottom edge); its right edge as in the top bar — up to 240px past the content column */
.nav-dust.nav-dust--foot {
  position: absolute; top: auto; bottom: 0; z-index: 0;
  width: min(75vw, 1200px); height: min(34vh, 300px);   /* smaller than in the top bar: rises less above the block */
  right: calc(-1 * min(max(0px, (100vw - 1248px) / 2), 216px));
  transform: scaleY(-1); transform-origin: 50% 50%;
}

.notfound { padding: 120px 0; text-align: center; color: var(--body); font-size: 20px; line-height: 30px; }
.notfound h1 { font-size: 64px; line-height: 1; color: var(--fg); margin-bottom: 24px; }

.preview-bar {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  padding: 8px 16px;
  border-radius: 20px;
  background: #ffd600;
  color: #000;
  font-size: 13px;
  font-weight: 700;
}

/* cross-document View Transitions: soft fade between pages */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 260ms ease both vt-out; }
::view-transition-new(root) { animation: 420ms cubic-bezier(.22, .8, .2, 1) both vt-in; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

/* ------------------------------------------------------------ responsive */

@media (max-width: 960px) {
  .profile { column-gap: 40px; }
  .nav-cards { left: calc(50% + 25vw - 2px); }
  .cv__cols { column-gap: 40px; }
  .cv__cols[style*="--cols:3"], .cv__cols[style*="--cols:4"] { column-gap: 24px; }
}

@media (max-width: 639px) {
  .nav-cards { display: none; }
  .b { margin-top: calc(var(--spm, 0) * 1px); }

  /* the same side fields as a case page (6.25vw = 20px of the 320px artboard) */
  .home { padding: 0 6.25vw 40px; }
  .cv { padding-bottom: 41px; }
  .profile { grid-template-columns: 1fr; padding-bottom: 58px; }
  .profile__contacts { margin-top: 38px; }
  .profile__contacts li { padding: 18px 0; }
  .cv__cols { display: flex; flex-direction: column; gap: 30px; }
  .cv-col { display: contents; }
  .cv__icons { gap: 7px; }
  .cv__icons img { width: 48px; height: 48px; }
  .projects { grid-template-columns: 1fr; }

  /* top bar: 50px; the same side fields on every page (6.25vw, as home and case content) */
  .topbar { height: 50px; }
  .topbar__in { gap: 12px; padding: 0 6.25vw; }
  .topbar__right { gap: 18px; }
  .nav-item, .back, .card--all { font-size: 13px; line-height: 28px; }
  .back { color: var(--fg); }
  .back__label { display: none; }
  .tabs { gap: 12px; font-size: 13px; line-height: 28px; }
  /* compact language switch: only the language you can switch to */
  .lang { font-size: 11px; line-height: 28px; }
  .lang__item { color: var(--fg); }
  .lang__item.is-active, .lang__sep { display: none; }

  .plist { padding: 40px 6.25vw 80px; }   /* the same side fields as home and a case */
  .ph-stage { --tb: 50px; --ov: 60px; }
  .plist--hero { margin-top: -60px; padding-top: 0; }
  .plist__intro { top: 0; width: auto; margin: 28px 0 40px; font-size: 15px; line-height: 23px; }   /* 28px: air under the animation */
  .plist__br { display: none; }   /* phones: the text wraps on its own */
  .plist__intro--lines:not(.is-wrap) { width: auto; white-space: normal; text-wrap: pretty; }
  /* one column, no offsets; no hover on phones, so the description is always shown */
  .pgrid { gap: 40px; padding-bottom: 40px; }
  .pgroup { display: flex; flex-direction: column; gap: 40px; }
  .pgrid .pgroup:nth-child(n) > .pcell:nth-child(n) { margin: 0; }   /* beats every desktop offset rule */
  .pcell { scroll-margin-top: 70px; }
  .pcard__meta { flex-direction: column; align-items: flex-start; gap: 0; margin-top: 10px; }
  .pcard__title { font-size: 18px; line-height: 27px; }
  .pcard__tags { font-size: 13px; }
  .pcard__text { position: static; margin-top: 8px; font-size: 16px; line-height: 24px; opacity: 1; transform: none; }

  .next { padding: 0 6.25vw; }
  .next__in { flex-direction: column; align-items: flex-start; gap: 24px; padding: 24px 0 48px; }
  .next__cover { width: 84px; height: 65px; }
  .next__link { gap: 16px; }
  .next__label { font-size: 13px; }
  .next__title { font-size: 20px; line-height: 28px; }
  /* «Все проекты» under a divider of its own (Figma, 2026-10-30) */
  .next__all { align-self: stretch; padding-top: 24px; border-top: 1px solid var(--line); }

  /* Case pages: Tilda lays them out on a 320px artboard and scales it to the screen width,
     so every size is "N px at 320" = N/3.2 vw, capped at the desktop value. */
  .case { padding: 50px 6.25vw 15vw; }
  .case > .b { margin-top: min(calc(var(--spm, 0) * 100vw / 320), calc(var(--sp, 0) * 1px)); }
  .h-title { font-size: min(8.125vw, 32px); line-height: min(8.125vw, 32px); }
  .t, .tbl__title, .btn { font-size: min(5vw, 20px); line-height: min(7.5vw, 30px); }
  .h-m, .h-l, .t.t-lead, .t.t-lead-l { font-size: min(7.5vw, 26px); line-height: min(9.375vw, 34px); }
  .t ul, .t ol { padding-left: min(6.25vw, 20px); }
  .t p + p, .t p + ul, .t ul + p, .t ul + ul { margin-top: min(7.5vw, 24px); }
  .t-indent { padding-left: min(7.8vw, 20px); }
  .fig figcaption { margin-top: 3.75vw; font-size: min(5vw, 20px); line-height: min(7.5vw, 30px); }
  .gallery { gap: 3.75vw; }
  .tbl__title { padding-left: 0; margin-bottom: 7.5vw; }
  .tbl { min-width: 187vw; font-size: min(5vw, 20px); line-height: min(7.5vw, 30px); }
  .tbl th, .tbl td { padding-left: 0; }
  .case > .bleed { margin-left: -6.25vw; margin-right: -6.25vw; max-width: none; }
}
