/* Dyce portfolio. Тема авто (prefers-color-scheme), один акцент, радиусы: кнопки pill, медиа и плитки 16px. */

@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/assets/fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #0d0e0c;
  --bg-2: #141612;
  --bg-3: #1b1e19;
  --fg: #eceee8;
  --muted: #9da197;
  --faint: #6d7168;
  --line: rgb(236 238 232 / 0.09);
  --line-2: rgb(236 238 232 / 0.16);
  --accent: #c9f26b;
  --accent-ink: #11140b;
  --warn: #e3b341;
  --shadow: 0 30px 80px -30px rgb(0 0 0 / 0.7);
  --r: 16px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --sans: "Geist", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f2f3ef;
    --bg-2: #e8eae4;
    --bg-3: #dfe2da;
    --fg: #131510;
    --muted: #555a50;
    --faint: #7b8075;
    --line: rgb(19 21 16 / 0.09);
    --line-2: rgb(19 21 16 / 0.18);
    --accent: #3f6b00;
    --accent-ink: #f5f9ec;
    --warn: #9a6700;
    --shadow: 0 30px 70px -34px rgb(40 50 30 / 0.35);
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }
:lang(zh) { --sans: "Geist", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", sans-serif; }
:lang(ja) { --sans: "Geist", "Hiragino Sans", "Yu Gothic UI", "Meiryo", "Noto Sans JP", "Noto Sans CJK JP", sans-serif; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ol, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(1240px, 100% - 32px); margin-inline: auto; }
@media (min-width: 768px) { .wrap { width: min(1240px, 100% - 64px); } }

.skip { position: absolute; left: 16px; top: -60px; z-index: 30; padding: 10px 16px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }
.skip:focus { top: 12px; }

/* ---------- type ---------- */
.eyebrow {
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.h2 {
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 600;
}
.h3 { font-size: 22px; line-height: 1.2; letter-spacing: -0.02em; font-weight: 600; }
.lead { font-size: clamp(18px, 1.6vw, 21px); color: var(--muted); max-width: 58ch; line-height: 1.55; }
.tags { font: 500 12px/1.5 var(--mono); color: var(--faint); }
:lang(zh) .h2, :lang(ja) .h2, :lang(zh) .hero__title, :lang(ja) .hero__title, :lang(zh) .contact__title, :lang(ja) .contact__title { letter-spacing: -0.01em; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 52px; padding: 0 26px;
  border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 600; font-size: 16px; white-space: nowrap;
  transition: transform 0.25s var(--ease), background-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.98); transition-duration: 0.08s; }
.btn--ghost { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn--ghost:hover { box-shadow: inset 0 0 0 1px var(--fg); }
.btn--sm { height: 40px; padding: 0 16px 0 12px; font-size: 14px; gap: 8px; }
.tg { width: 18px; height: 18px; fill: currentColor; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  /* плотный фон и лёгкий блюр: backdrop-filter пересчитывается на каждом кадре
     прокрутки, большой радиус с saturate заметно грузит слабые видеокарты */
  background: color-mix(in oklab, var(--bg) 90%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.nav.is-stuck { border-bottom-color: var(--line); }
.nav__in { height: 68px; display: flex; align-items: center; gap: 24px; }
.brand { font-weight: 700; font-size: 20px; letter-spacing: -0.04em; }
.nav__links { display: none; gap: 28px; margin-left: 16px; font-size: 15px; color: var(--muted); }
.nav__links a { transition: color 0.2s; }
.nav__links a:hover { color: var(--fg); }
.nav__end { margin-left: auto; display: flex; align-items: center; gap: 10px; }
@media (min-width: 860px) { .nav__links { display: flex; } }
@media (max-width: 420px) { .nav .btn--sm span { display: none; } .nav .btn--sm { padding: 0 11px; } }

.lang { position: relative; }
.lang summary {
  list-style: none; cursor: pointer;
  height: 40px; min-width: 52px; padding: 0 14px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-2);
  font: 500 13px/1 var(--mono); letter-spacing: 0.06em;
  transition: box-shadow 0.2s;
  user-select: none;
}
.lang summary::-webkit-details-marker { display: none; }
.lang summary:hover { box-shadow: inset 0 0 0 1px var(--fg); }
.lang__menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 168px; padding: 6px;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 14px;
  box-shadow: var(--shadow);
  transform-origin: top right;
  animation: pop 0.18s var(--ease);
}
.lang__menu button {
  all: unset; box-sizing: border-box; display: block; width: 100%;
  padding: 9px 12px; border-radius: 9px; cursor: pointer; font-size: 15px;
}
.lang__menu button:hover, .lang__menu button:focus-visible { background: var(--bg-3); outline: none; }
.lang__menu button[aria-current="true"] { color: var(--accent); }
@keyframes pop { from { opacity: 0; transform: scale(0.96) translateY(-4px); } }

/* ---------- hero ---------- */
.hero {
  display: grid; gap: 48px;
  padding-block: 48px 72px;
  min-height: calc(100dvh - 68px);
  align-items: center;
}
@media (min-width: 1000px) {
  .hero { grid-template-columns: 1.05fr 1fr; gap: 40px; padding-block: 40px 64px; }
}
.hero__eyebrow { margin-bottom: 24px; }
.hero__title {
  font-size: clamp(40px, 5.2vw, 76px);
  line-height: 1.0;
  letter-spacing: -0.045em;
  font-weight: 600;
  max-width: 13ch;
  text-wrap: balance;
}
.hero__sub { margin-top: 24px; font-size: clamp(18px, 1.5vw, 20px); color: var(--muted); max-width: 40ch; }
.hero__cta { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- deck: три карточки проектов ----------
   Раздача при загрузке, параллакс за курсором, клик выводит карточку вперёд.
   Только 2D-трансформы: 3D (perspective + translateZ) Chrome растрирует в низком
   масштабе, и скрины в карточках мылятся. Глубина задаётся масштабом, порядком
   слоёв и затемнением, параллакс живёт на внутреннем слое без transition. */
.deck {
  width: 100%; max-width: 600px; justify-self: center;
  container-type: inline-size;
  display: grid; gap: 18px;
}
.deck__stage { position: relative; aspect-ratio: 1 / 0.92; isolation: isolate; }
.card {
  appearance: none; border: 0; padding: 0; margin: 0; background: none; color: inherit; font: inherit;
  position: absolute; left: 50%; top: 50%;
  width: var(--w); z-index: var(--zi, 1);
  cursor: pointer;
  transform: translate(-50%, -50%) translate(var(--x), var(--y)) rotate(var(--r)) scale(var(--s, 1));
  transition: transform 0.8s cubic-bezier(0.34, 1.25, 0.64, 1), opacity 0.5s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.card__body {
  position: relative; display: block;
  border-radius: 18px; overflow: hidden;
  background: var(--bg-2);
  box-shadow: 0 0 0 1px var(--line), 0 28px 56px -26px rgb(0 0 0 / 0.75);
  /* параллакс: глубина карточки умножает смещение курсора */
  transform: translate(calc(var(--px, 0) * var(--d, 8) * 1px), calc(var(--py, 0) * var(--d, 8) * 1px)) translateY(var(--lift, 0px));
  transition: box-shadow 0.4s var(--ease);
}
.card__body img { display: block; width: 100%; height: auto; }
/* затемнение задних карточек подложкой, а не filter: дешевле и не мылит */
.card__body::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: rgb(8 9 8 / var(--dim, 0));
  transition: background-color 0.5s var(--ease);
}
/* блик двигается transform-ом, без перерисовки градиента. Центр круга стоит в
   (0, 0) карточки, --gx/--gy это точка курсора в её собственных координатах */
.card__glare {
  position: absolute; z-index: 2; left: 0; top: 0; width: 90%; aspect-ratio: 1;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgb(255 255 255 / 0.2), rgb(255 255 255 / 0.06) 55%, transparent);
  opacity: 0; transition: opacity 0.35s var(--ease);
  transform: translate(var(--gx, 0px), var(--gy, 0px)) translate(-50%, -50%);
}
.card:focus-visible { outline: none; }
.card:focus-visible .card__body { box-shadow: 0 0 0 2px var(--accent), 0 28px 56px -26px rgb(0 0 0 / 0.75); }
.card--ksu { --w: 40cqw; }
.card--popup { --w: 40cqw; }
.card--music { --w: 44cqw; }

.card[data-slot="front"] { --x: 2cqw;   --y: 3cqw;  --r: -1.5deg; --s: 1;    --zi: 3; --d: 14; --dim: 0; }
.card[data-slot="left"]  { --x: -23cqw; --y: -3cqw; --r: -8deg;   --s: 0.94; --zi: 1; --d: 5;  --dim: 0.3; }
.card[data-slot="right"] { --x: 24cqw;  --y: -6cqw; --r: 7deg;    --s: 0.96; --zi: 2; --d: 8;  --dim: 0.18; }
.card[data-slot="front"] .card__body { box-shadow: 0 0 0 1px var(--line-2), 0 40px 70px -28px rgb(0 0 0 / 0.85); }
@media (hover: hover) {
  .card:hover { --lift: -10px; --dim: 0; }
  .card:hover .card__glare { opacity: 1; }
}
@media (prefers-color-scheme: light) {
  .card__body { box-shadow: 0 0 0 1px var(--line), 0 28px 56px -28px rgb(40 50 30 / 0.45); }
  .card[data-slot="left"] { --dim: 0.1; }
  .card[data-slot="right"] { --dim: 0.05; }
}

/* до раздачи все карточки лежат стопкой внизу; .js ставится в <head>, поэтому без вспышки */
.js .deck:not(.is-dealt) .card { --x: 0cqw; --y: 34cqw; --r: 0deg; --s: 0.8; opacity: 0; }
.deck.is-dealt:not(.is-live) .card { transition-delay: calc(0.2s + var(--i) * 0.12s); }

.deck__label {
  display: flex; justify-content: center; align-items: baseline; gap: 12px; flex-wrap: wrap;
  min-height: 1.5em; text-align: center;
}
.deck__name { font-weight: 600; font-size: 15px; }
.deck__hint { font: 500 12px/1.4 var(--mono); color: var(--faint); }
@media (prefers-reduced-motion: no-preference) {
  .deck__name.is-swap { animation: label 0.45s var(--ease); }
}
@keyframes label { from { opacity: 0; transform: translateY(6px); } }

/* вход текста: ступенькой, только transform/opacity */
@media (prefers-reduced-motion: no-preference) {
  .hero__copy > * { animation: rise 0.9s var(--ease) both; }
  .hero__copy > :nth-child(2) { animation-delay: 0.06s; }
  .hero__copy > :nth-child(3) { animation-delay: 0.14s; }
  .hero__copy > :nth-child(4) { animation-delay: 0.22s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

/* ---------- reveal on scroll ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); transition-delay: var(--d, 0s); }
  .js .reveal.is-in { opacity: 1; transform: none; }
}

/* ---------- mitray ---------- */
.mitray { background: var(--bg-2); border-block: 1px solid var(--line); padding-block: 96px; }
@media (min-width: 768px) { .mitray { padding-block: 128px; } }
.mitray__head { display: grid; gap: 20px; }
.mitray__head .h2 { display: flex; align-items: center; gap: 18px; font-size: clamp(48px, 8vw, 104px); letter-spacing: -0.05em; }
.mitray__logo { width: 0.82em; height: 0.82em; border-radius: 22%; }
/* живые цифры сервиса: крупное число, подпись мелко */
.stats { list-style: none; display: flex; flex-wrap: wrap; gap: 16px 56px; margin-top: 8px; }
.stats li { display: grid; gap: 6px; }
.stats strong { font-size: clamp(40px, 5vw, 64px); line-height: 1; font-weight: 600; letter-spacing: -0.04em; color: var(--accent); }
.stats span { font: 500 13px/1.4 var(--mono); color: var(--faint); }
:lang(zh) .stats strong, :lang(ja) .stats strong { letter-spacing: -0.01em; }

.arch {
  margin-top: 56px;
  display: grid; gap: 12px;
  padding: 20px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--bg);
}
.arch__col { display: grid; gap: 10px; }
.arch__wire { height: 22px; width: 1px; margin-inline: auto; background: linear-gradient(var(--line-2), var(--accent)); }
.arch__ctrl { display: grid; gap: 10px; margin-top: 10px; padding-top: 18px; border-top: 1px dashed var(--line-2); }
.node {
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  min-height: 56px; padding: 12px 16px; border-radius: 12px;
  background: var(--bg-3); font-size: 15px; font-weight: 500; line-height: 1.3;
}
.node small { font: 500 12px/1.4 var(--mono); color: var(--accent-ink); opacity: 0.75; letter-spacing: 0.08em; }
.node--soft { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); }
.node--accent { background: var(--accent); color: var(--accent-ink); }
.node--line { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
@media (min-width: 900px) {
  .arch { grid-template-columns: 1fr 56px 1.1fr 56px 1fr; align-items: center; padding: 28px; }
  .arch__wire { width: 100%; height: 1px; background: linear-gradient(90deg, var(--line-2), var(--accent)); }
  .arch__ctrl { grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); }
  .node { min-height: 64px; }
}
/* бегущий импульс по проводам: показывает направление трафика */
@media (prefers-reduced-motion: no-preference) {
  .arch__wire { position: relative; overflow: hidden; }
  .arch__wire::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent, var(--accent), transparent);
    animation: pulseY 2.4s var(--ease) infinite;
    animation-play-state: paused;
  }
  /* импульсы бегут, только пока схема на экране */
  .arch.is-visible .arch__wire::after { animation-play-state: running; }
  @media (min-width: 900px) {
    .arch__wire::after { background: linear-gradient(90deg, transparent, var(--accent), transparent); animation-name: pulseX; }
  }
}
@keyframes pulseY { from { transform: translateY(-100%); } to { transform: translateY(100%); } }
@keyframes pulseX { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.mitray__body { margin-top: 64px; display: grid; gap: 48px; }
@media (min-width: 1000px) { .mitray__body { grid-template-columns: 1fr 1.05fr; gap: 64px; align-items: start; } }
.facts { display: grid; gap: 28px; }
.facts > div { display: grid; gap: 6px; }
@media (min-width: 600px) { .facts > div { grid-template-columns: 170px 1fr; gap: 24px; } }
.facts dt { font-weight: 600; font-size: 16px; }
.facts dd { color: var(--muted); font-size: 16px; line-height: 1.6; }
.mitray__media { display: grid; gap: 16px; }
@media (min-width: 1000px) { .mitray__media { position: sticky; top: 96px; } .mitray__media .media:last-child { width: 82%; margin-left: auto; margin-top: -48px; } }
.media { border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--bg); }

/* ---------- bento ---------- */
.more { padding-block: 112px 40px; }
.more > .h2 { margin-bottom: 40px; }
.bento { display: grid; gap: 16px; }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 14px;
  padding: 28px; border-radius: var(--r);
  background: var(--bg-2); border: 1px solid var(--line);
  overflow: hidden;
  transition: border-color 0.3s var(--ease), transform 0.5s var(--ease);
}
.tile:hover { border-color: var(--line-2); }
.tile p:not(.tags, .status) { color: var(--muted); font-size: 16px; }
@media (min-width: 900px) {
  .bento { grid-template-columns: repeat(6, 1fr); }
  .tile--jewel { grid-column: span 6; flex-direction: row; align-items: center; gap: 40px; padding: 20px 40px 20px 20px; }
  .tile--music { grid-column: span 4; }
  .tile--watch { grid-column: span 2; }
}
.tile__gallery { display: grid; grid-template-columns: 1.4fr 1fr; grid-template-rows: 1fr 1fr; gap: 8px; flex: 1.25; min-width: 0; }
.tile__gallery img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; background: #fff; aspect-ratio: 1; }
.tile__gallery img:first-child { grid-row: span 2; }
.tile__text { flex: 1; display: grid; gap: 14px; }
.tile__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
/* честная пометка: проект не доведён до прода */
.status {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-2);
  font: 500 12px/1.5 var(--mono); color: var(--muted); white-space: nowrap;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }
@media (max-width: 899px) { .tile--jewel { padding: 16px 16px 28px; } .tile__text { padding-inline: 12px; } }

.tile--music { background: radial-gradient(120% 80% at 100% 0%, color-mix(in oklab, var(--accent) 16%, transparent), transparent 60%), var(--bg-2); }
.tile__shot { margin: -28px -28px 8px; border-bottom: 1px solid var(--line); overflow: hidden; }
.tile__shot img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: left top; transition: transform 0.8s var(--ease); }
@media (hover: hover) { .tile--music:hover .tile__shot img { transform: scale(1.03); } }
.tile__top { display: flex; align-items: center; gap: 16px; }
.appicon { width: 56px; height: 56px; border-radius: 14px; }
.flow { margin-top: auto; padding-top: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font: 500 13px/1.3 var(--mono); }
.flow span { padding: 12px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line-2); text-align: center; }
.flow i { grid-column: 1 / -1; height: 14px; width: 1px; margin-inline: auto; background: var(--line-2); }
.flow__mid { grid-column: 1 / -1; background: var(--bg-3); box-shadow: none !important; }
.flow__end { grid-column: 1 / -1; background: var(--accent); color: var(--accent-ink); box-shadow: none !important; }

.tile--watch { background:
  radial-gradient(circle at 88% 22%, transparent 46px, var(--line-2) 47px, transparent 48px),
  radial-gradient(circle at 88% 22%, transparent 62px, var(--line) 63px, transparent 64px),
  var(--bg-2); }

/* ---------- approach ---------- */
.approach { padding-block: 96px; }
.principles { margin-top: 40px; display: grid; gap: 4px; counter-reset: p; }
/* принцип крупно, конкретный пример под ним обычным текстом */
.principles li { display: grid; gap: 12px; padding-block: 22px; }
@media (min-width: 900px) { .principles li { max-width: 680px; } .principles li:nth-child(2) { margin-left: 12%; } .principles li:nth-child(3) { margin-left: 24%; } }
.principles strong { font-size: clamp(24px, 2.6vw, 34px); line-height: 1.2; letter-spacing: -0.025em; color: var(--fg); font-weight: 600; }
.principles span { font-size: clamp(17px, 1.4vw, 19px); line-height: 1.55; color: var(--muted); }

/* ---------- stack ---------- */
.stack { padding-block: 64px 96px; }
.stack__grid { margin-top: 40px; display: grid; gap: 32px 24px; }
@media (min-width: 640px) { .stack__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .stack__grid { grid-template-columns: repeat(3, 1fr); } }
.stack__grid > div { padding-top: 18px; border-top: 1px solid var(--line-2); }
.stack__grid h3 { font: 500 12px/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); margin-bottom: 10px; }
.stack__grid p { font-size: 19px; line-height: 1.45; letter-spacing: -0.01em; }

/* ---------- contact ---------- */
.contact { padding-block: 112px 120px; border-top: 1px solid var(--line); }
.contact__title { font-size: clamp(34px, 5.2vw, 68px); line-height: 1.03; letter-spacing: -0.04em; font-weight: 600; max-width: 18ch; text-wrap: balance; }
.contact__sub { margin-top: 24px; color: var(--muted); font-size: 19px; max-width: 46ch; }
.contact__handle {
  margin-top: 48px; display: inline-flex; align-items: baseline; gap: 0.2em;
  font-size: clamp(44px, 9vw, 128px); line-height: 1; letter-spacing: -0.05em; font-weight: 600;
  color: var(--accent);
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 3px no-repeat;
  padding-bottom: 8px;
  transition: background-size 0.5s var(--ease);
}
.contact__handle span { font-size: 0.5em; transition: transform 0.4s var(--ease); }
.contact__handle:hover { background-size: 100% 3px; }
.contact__handle:hover span { transform: translate(4px, -4px); }

.foot { display: flex; justify-content: space-between; gap: 16px; padding-block: 28px 40px; border-top: 1px solid var(--line); font: 500 13px/1 var(--mono); color: var(--faint); }

/* ---------- широкие экраны: 1080p и 2K ----------
   До 1680px вёрстка упирается в 1240px; выше растим контейнер, шрифты и колоду,
   иначе на 2K всё собирается в узкую полосу посередине. */
@media (min-width: 1680px) {
  body { font-size: 18px; }
  .wrap { width: min(1520px, 100% - 128px); }
  .nav__in { height: 76px; }
  .brand { font-size: 22px; }
  .nav__links { font-size: 16px; gap: 32px; }
  .hero { grid-template-columns: 1fr 1.05fr; gap: 64px; }
  .hero__title { font-size: clamp(76px, 4.9vw, 104px); }
  .hero__sub { font-size: 22px; max-width: 42ch; margin-top: 28px; }
  .hero__cta { margin-top: 40px; }
  .btn { height: 58px; padding: 0 30px; font-size: 17px; }
  .btn--sm { height: 44px; padding: 0 18px 0 14px; font-size: 15px; }
  .lang summary { height: 44px; min-width: 58px; }
  .eyebrow { font-size: 13px; }
  .deck { max-width: 780px; gap: 22px; }
  .card__body { border-radius: 22px; }
  .deck__name { font-size: 17px; }
  .deck__hint { font-size: 13px; }
  .h2 { font-size: clamp(60px, 4vw, 76px); }
  .h3 { font-size: 25px; }
  .lead { font-size: 22px; }
  .facts > div { grid-template-columns: 200px 1fr; }
  .facts dt, .facts dd, .tile p:not(.tags, .status) { font-size: 17.5px; }
  .node { font-size: 16px; min-height: 72px; }
  .tags { font-size: 13px; }
  .tile { padding: 34px; }
  .tile__shot { margin: -34px -34px 10px; }
  .tile--jewel .tile__gallery { flex: 0 1 820px; }
  .tile--jewel .tile__text { max-width: 56ch; }
  .principles li { max-width: 820px; }
  .principles strong { font-size: clamp(34px, 2.2vw, 42px); }
  .principles span { font-size: 21px; }
  .stack__grid p { font-size: 21px; }
  .contact__title { font-size: clamp(68px, 4.4vw, 88px); }
  .contact__sub { font-size: 21px; }
}
@media (min-width: 2200px) {
  .wrap { width: min(1800px, 100% - 160px); }
  .hero__title { font-size: clamp(104px, 4.6vw, 124px); }
  .hero__sub { font-size: 24px; }
  .deck { max-width: 920px; }
  .deck__name { font-size: 19px; }
  .h2 { font-size: clamp(76px, 3.6vw, 92px); }
  .lead, .contact__sub { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- КГУ: проект в проде у заказчика ---------- */
.ksu { padding-block: 112px 40px; }
.ksu__grid { display: grid; gap: 56px; align-items: center; }
@media (min-width: 1000px) { .ksu__grid { grid-template-columns: 0.85fr 1.15fr; gap: 64px; } }
.ksu__copy { display: grid; gap: 22px; justify-items: start; }
.ksu__flow { display: grid; gap: 18px; margin-block: 8px; }
.ksu__flow li { display: grid; gap: 2px; padding-left: 18px; border-left: 2px solid var(--line-2); }
.ksu__flow li:first-child { border-left-color: var(--accent); }
.ksu__flow strong { font-weight: 600; }
.ksu__flow span { color: var(--muted); font-size: 16px; }
.ksu__gh { margin-top: 6px; }
.ksu__media { position: relative; padding-bottom: 14%; }
.ksu__desk { position: relative; z-index: 1; }
.ksu__print { position: absolute; left: -4%; bottom: 0; width: 46%; z-index: 2; transform: rotate(-2deg); }
.ksu__phone { position: absolute; right: -2%; bottom: -6%; width: 24%; z-index: 3; border-radius: 22px; transform: rotate(3deg); }
@media (max-width: 599px) {
  .ksu__print { left: 0; width: 52%; }
  .ksu__phone { right: 0; width: 30%; }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .ksu__print, .ksu__phone { transition: transform 0.6s var(--ease); }
  .ksu__media:hover .ksu__print { transform: rotate(-4deg) translate(-8px, 6px); }
  .ksu__media:hover .ksu__phone { transform: rotate(5deg) translate(8px, 10px); }
}
.ksu__note { margin-top: 72px; padding: 22px 26px; border-radius: var(--r); background: var(--bg-2); border: 1px solid var(--line); color: var(--muted); font-size: 16px; }
.ksu__note strong { color: var(--fg); font-weight: 600; }
@media (min-width: 1680px) {
  .ksu__flow span, .ksu__note { font-size: 17.5px; }
}

/* ссылка на код проекта */
.gh-link { display: inline-flex; align-items: baseline; gap: 6px; font: 500 13px/1.4 var(--mono); color: var(--accent); width: fit-content; }
.gh-link span:last-child { transition: transform 0.3s var(--ease); }
.gh-link:hover span:last-child { transform: translate(2px, -2px); }
.gh-link:hover span:first-child { text-decoration: underline; text-underline-offset: 3px; }
.tile .gh-link { margin-top: 2px; }
.foot a { transition: color 0.2s; }
.foot a:hover { color: var(--fg); }

/* ---------- производительность ----------
   Секции ниже первого экрана браузер не рендерит, пока к ним не подскроллили.
   contain-intrinsic-size держит примерную высоту, чтобы полоса прокрутки не прыгала. */
.ksu, .more, .approach, .stack, .contact {
  content-visibility: auto;
  contain-intrinsic-size: auto 900px;
}
.approach, .stack { contain-intrinsic-size: auto 600px; }
@media (max-width: 599px) {
  /* на телефонах блюр под шапкой не нужен: фон и так почти непрозрачный */
  .nav { backdrop-filter: none; -webkit-backdrop-filter: none; background: color-mix(in oklab, var(--bg) 96%, transparent); }
}
