/* ============================================
   VIDEO EDITOR PORTFOLIO
   ============================================ */

:root {
  --bg: #0a0a0b;
  --bg-soft: #111113;
  --ink: #f4f2ee;
  --ink-dim: rgba(244, 242, 238, 0.55);
  --ink-faint: rgba(244, 242, 238, 0.28);
  --accent: #ff4d2e;
  --accent-soft: rgba(255, 77, 46, 0.12);
  --line: rgba(244, 242, 238, 0.1);
  --font-display: "Syne", sans-serif;
  --font-body: "Inter", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --pad: clamp(20px, 5vw, 80px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* scroll-behavior left to Lenis (script.js) — native smooth-scroll would fight its easing */
html { scroll-padding-top: 90px; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: var(--bg); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { background: none; border: none; cursor: pointer; color: inherit; font-family: inherit; }

/* ===== Preloader ===== */
.preloader {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.9s var(--ease);
}
.preloader.is-done { transform: translateY(-100%); }
.preloader__inner { text-align: center; }
.preloader__count {
  font-family: var(--font-display);
  font-size: clamp(64px, 12vw, 160px);
  font-weight: 800;
  display: block;
  line-height: 1;
}
.preloader__label {
  display: block; margin-top: 16px;
  font-size: 12px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--ink-dim);
}

/* ===== Film grain ===== */
/* Static film-grain texture. Kept as a small fixed layer (not animated): the
   previous animated 9×-viewport overlay caused constant GPU repaints / jank. */
.grain {
  position: fixed; inset: 0; z-index: 999; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.05;
}
/* Hide the grain while a video lightbox is open (no overlay cost over playback) */
body.lightbox-open .grain { display: none; }

/* ===== Custom cursor ===== */
.cursor {
  /* Above everything incl. the lightbox (z 1200) — the native pointer is
     hidden globally, so if any overlay covers this dot the mouse "vanishes" */
  position: fixed; top: 0; left: 0; z-index: 1300;
  width: 14px; height: 14px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--ease), height 0.3s var(--ease), background 0.3s;
  display: flex; align-items: center; justify-content: center;
  mix-blend-mode: difference;
}
.cursor.is-hover { width: 56px; height: 56px; background: var(--ink); }
.cursor.is-label {
  width: 88px; height: 88px;
  background: var(--accent);
  mix-blend-mode: normal;
}
.cursor__label {
  font-size: 12px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--bg);
  opacity: 0; transition: opacity 0.2s;
}
.cursor.is-label .cursor__label { opacity: 1; }
@media (hover: none) { .cursor { display: none; } }
/* Hide the native OS pointer wherever the custom cursor takes over — without
   this the system arrow sits on top of the dot/circle the whole time.
   !important beats per-element `cursor: pointer` rules (buttons, inputs…)
   that would otherwise win by specificity. Touch devices keep the native
   pointer since the custom cursor never activates there (no real "hover"). */
@media (hover: hover) {
  * { cursor: none !important; }
}

/* ===== Scroll progress ===== */
.scroll-progress {
  position: fixed; top: 0; left: 0; z-index: 997;
  height: 2px; width: 0;
  background: var(--accent);
}

/* ===== Side nav (section index) ===== */
.side-nav {
  position: fixed; right: clamp(18px, 2.4vw, 36px); top: 50%; z-index: 90;
  transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  padding: 18px 0;
  transition: opacity 0.3s var(--ease);
}
.side-nav::before {
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px;
  background: var(--line); transform: translateX(-50%);
}
.side-nav__dot {
  position: relative; z-index: 1;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink-faint);
  transition: background 0.3s var(--ease), transform 0.3s var(--ease);
}
.side-nav__dot::after {
  content: attr(data-label);
  position: absolute; right: 18px; top: 50%;
  transform: translateY(-50%) translateX(6px);
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-dim); white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.side-nav__dot:hover { background: var(--ink); transform: scale(1.3); }
.side-nav__dot:hover::after { opacity: 1; transform: translateY(-50%) translateX(0); }
.side-nav__dot.is-active { background: var(--accent); transform: scale(1.7); }
.side-nav__dot.is-active::after { color: var(--accent); opacity: 1; transform: translateY(-50%) translateX(0); }
body.lightbox-open .side-nav { opacity: 0; pointer-events: none; }
@media (max-width: 1180px), (hover: none) { .side-nav { display: none; } }

/* ===== Header ===== */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px var(--pad);
  transition: background 0.4s, backdrop-filter 0.4s, padding 0.4s;
}
.header.is-scrolled {
  background: rgba(10, 10, 11, 0.7);
  backdrop-filter: blur(16px);
  padding: 14px var(--pad);
  border-bottom: 1px solid var(--line);
}
.header__logo {
  font-family: var(--font-display);
  font-weight: 800; font-size: 22px; letter-spacing: 0.02em;
  display: inline-flex; align-items: baseline;
}
.header__logo-dot { color: var(--accent); }
.header__logo-sub {
  margin-left: 8px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-dim);
  align-self: center;
}
.header__nav { display: flex; gap: 36px; }
.header__link {
  font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-dim);
  transition: color 0.3s;
  position: relative;
}
.header__link::after {
  content: ""; position: absolute; left: 0; bottom: -5px;
  width: 100%; height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.4s var(--ease);
}
.header__link:hover { color: var(--ink); }
.header__link:hover::after { transform: scaleX(1); transform-origin: left; }
.header__cta {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px solid var(--line);
  padding: 10px 20px; border-radius: 100px;
  transition: border-color 0.3s, background 0.3s;
}
.header__cta:hover { border-color: var(--accent); background: var(--accent-soft); }
.header__cta-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #3eea7a;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(62, 234, 122, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(62, 234, 122, 0); }
}
.header__burger { display: none; flex-direction: column; gap: 6px; padding: 8px; }
.header__burger span {
  display: block; width: 26px; height: 2px; background: var(--ink);
  transition: transform 0.4s var(--ease), opacity 0.3s;
}
.header__burger.is-open span:first-child { transform: translateY(4px) rotate(45deg); }
.header__burger.is-open span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ===== Mobile menu ===== */
.mobile-menu {
  position: fixed; inset: 0; z-index: 99;
  background: var(--bg);
  display: flex; flex-direction: column; justify-content: center;
  padding: var(--pad);
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.7s var(--ease);
}
.mobile-menu.is-open { clip-path: inset(0 0 0 0); }
.mobile-menu__link {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(40px, 10vw, 72px);
  font-weight: 700;
  padding: 8px 0;
  color: var(--ink-dim);
  transition: color 0.3s, padding-left 0.3s;
}
.mobile-menu__link:hover { color: var(--ink); padding-left: 16px; }
.mobile-menu__footer {
  position: absolute; bottom: 40px; color: var(--ink-dim); font-size: 14px;
  display: flex; flex-direction: column; align-items: flex-start;
}

/* ===== Shared section bits ===== */
.section-tag {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 12px; letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--accent);
}
.section-tag::before {
  content: ""; width: 36px; height: 1px; background: var(--accent);
}
.section-tag--center::before { display: none; }
.section-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 6.5vw, 88px);
  font-weight: 700; line-height: 1.02; letter-spacing: -0.02em;
  margin-top: 24px;
}

/* ===== Reveal animations ===== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal[data-delay="1"] { transition-delay: 0.12s; }
.reveal[data-delay="2"] { transition-delay: 0.24s; }
.reveal[data-delay="3"] { transition-delay: 0.36s; }
.reveal[data-delay="4"] { transition-delay: 0.48s; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* Line-by-line title reveal — same masked slide-up as the hero, reused on
   section headlines (script.js wraps each line in .split-line/.split-line__inner
   and swaps the .reveal class for .title-split). */
.split-line { display: block; overflow: hidden; }
.split-line__inner {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 0.9s var(--ease);
}
.title-split.is-visible .split-line:nth-child(1) .split-line__inner { transition-delay: 0.05s; }
.title-split.is-visible .split-line:nth-child(2) .split-line__inner { transition-delay: 0.16s; }
.title-split.is-visible .split-line__inner { transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .split-line__inner { transition: none; transform: none; }
}

/* ===== Hero ===== */
.hero {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 140px var(--pad) 80px;
  position: relative;
  overflow: hidden;
}
/* overflow:hidden — чтобы размытые «шары» не вылезали за край экрана: на узких
   телефонах (320px) они добавляли ~36px горизонтальной прокрутки, и страницу
   можно было утянуть вбок на чёрную пустоту. Визуально клип не заметен. */
.hero__bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.hero__orb {
  position: absolute; border-radius: 50%; filter: blur(70px);
}
.hero__orb--1 {
  width: 50vw; height: 50vw; max-width: 700px; max-height: 700px;
  background: radial-gradient(circle, rgba(255, 77, 46, 0.16), transparent 70%);
  top: -10%; right: -10%;
  animation: drift 14s ease-in-out infinite alternate;
}
.hero__orb--2 {
  width: 36vw; height: 36vw; max-width: 500px; max-height: 500px;
  background: radial-gradient(circle, rgba(80, 90, 255, 0.1), transparent 70%);
  bottom: -10%; left: -8%;
  animation: drift 18s ease-in-out infinite alternate-reverse;
}
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-60px, 50px) scale(1.15); }
}
/* Cursor-tracked spotlight — JS writes --mx/--my, only shown on hover-capable devices */
.hero__spotlight {
  position: absolute; inset: 0;
  background: radial-gradient(480px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 77, 46, 0.18), transparent 62%);
  opacity: 0;
  mix-blend-mode: screen;
  transition: opacity 0.5s var(--ease);
}
.hero:hover .hero__spotlight { opacity: 1; }
[data-theme="light"] .hero__spotlight { mix-blend-mode: multiply; opacity: 0; }
[data-theme="light"] .hero:hover .hero__spotlight { opacity: 0.5; }
@media (hover: none) { .hero__spotlight { display: none; } }
.hero__meta { display: flex; gap: 32px; margin-bottom: 32px; flex-wrap: wrap; }
.hero__meta-item {
  font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-dim);
  padding-left: 16px; position: relative;
}
.hero__meta-item::before {
  content: ""; position: absolute; left: 0; top: 50%;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); transform: translateY(-50%);
}
.hero__title {
  font-family: var(--font-display);
  font-size: clamp(38px, 12.5vw, 190px);
  font-weight: 800;
  line-height: 0.94;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.hero__title em { color: var(--accent); font-style: normal; }
.hero__line { display: block; overflow: hidden; }
.hero__line-inner {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 1.1s var(--ease);
}
body.is-loaded .hero__line:nth-child(1) .hero__line-inner { transform: translateY(0); transition-delay: 0.1s; }
body.is-loaded .hero__line:nth-child(2) .hero__line-inner { transform: translateY(0); transition-delay: 0.22s; }
body.is-loaded .hero__line:nth-child(3) .hero__line-inner { transform: translateY(0); transition-delay: 0.34s; }
.hero__line--accent .hero__line-inner {
  color: transparent;
  -webkit-text-stroke: 2px var(--ink);
  position: relative;
}
/* One-shot RGB-split glitch flick — fired once after entrance + on hover (script.js) */
.hero__line--accent .hero__line-inner::before,
.hero__line--accent .hero__line-inner::after {
  content: ""; position: absolute; inset: 0;
  color: transparent; opacity: 0; pointer-events: none;
}
.hero__line--accent .hero__line-inner.is-glitching::before {
  content: attr(data-text);
  -webkit-text-stroke: 2px #4dd6ff;
  animation: glitchSlice 0.5s steps(10, end) 1;
}
.hero__line--accent .hero__line-inner.is-glitching::after {
  content: attr(data-text);
  -webkit-text-stroke: 2px var(--accent);
  animation: glitchSlice 0.5s steps(10, end) 1 reverse;
}
@keyframes glitchSlice {
  0%   { opacity: 0; clip-path: inset(0 0 0 0); transform: translate(0, 0); }
  8%   { opacity: 1; clip-path: inset(10% 0 70% 0); transform: translate(-4px, 0); }
  16%  { opacity: 1; clip-path: inset(60% 0 5% 0); transform: translate(4px, 0); }
  24%  { opacity: 1; clip-path: inset(30% 0 40% 0); transform: translate(-3px, 0); }
  32%  { opacity: 0; clip-path: inset(0 0 90% 0); transform: translate(0, 0); }
  48%  { opacity: 1; clip-path: inset(70% 0 0 0); transform: translate(5px, 0); }
  64%  { opacity: 0; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hero__line--accent .hero__line-inner.is-glitching::before,
  .hero__line--accent .hero__line-inner.is-glitching::after { animation: none; opacity: 0; }
}
.hero__bottom {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 40px; margin-top: 56px; flex-wrap: wrap;
}
.hero__desc { max-width: 440px; color: var(--ink-dim); font-size: 16px; }
.hero__scroll { display: flex; align-items: center; gap: 16px; font-size: 14px; }
.hero__scroll-circle {
  width: 56px; height: 56px; border: 1px solid var(--line); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.3s, border-color 0.3s;
  animation: bob 2.4s ease-in-out infinite;
}
.hero__scroll-circle svg { width: 20px; height: 20px; }
.hero__scroll:hover .hero__scroll-circle { background: var(--accent); border-color: var(--accent); }
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}
.hero__frame {
  position: absolute; width: 56px; height: 56px;
  border: 1px solid var(--ink-faint); pointer-events: none;
}
.hero__frame--tl { top: 110px; left: var(--pad); border-right: 0; border-bottom: 0; }
.hero__frame--br { bottom: 40px; right: var(--pad); border-left: 0; border-top: 0; }

/* ===== Marquee ===== */
.marquee {
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  overflow: hidden; padding: 22px 0;
  background: var(--bg-soft);
}
.marquee__track {
  display: flex; gap: 48px; width: max-content;
  animation: marquee 24s linear infinite;
}
.marquee__track span {
  font-family: var(--font-display);
  font-size: clamp(18px, 2.5vw, 28px);
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  white-space: nowrap;
}
.marquee__track i { color: var(--accent); font-style: normal; font-size: 20px; align-self: center; }
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ===== Showreel ===== */
.reel { padding: clamp(80px, 12vw, 160px) var(--pad); }
.reel__head { margin-bottom: 56px; }
.reel__player {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  cursor: pointer;
  will-change: transform, filter;
}
.reel__video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
}
.reel__placeholder {
  display: none; /* запасной вариант — включается из JS только при ошибке загрузки видео */
  position: absolute; inset: 0;
  align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255, 77, 46, 0.1), transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(80, 90, 255, 0.08), transparent 50%),
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,0.012) 3px 4px);
}
.reel__placeholder-inner { text-align: center; }
.reel__rec {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: 0.3em; color: var(--accent);
  margin-bottom: 20px;
}
.reel__rec i {
  width: 10px; height: 10px; border-radius: 50%; background: var(--accent);
  animation: blink 1.2s infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.15; } }
.reel__placeholder-title {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 64px); font-weight: 800; letter-spacing: 0.04em;
}
.reel__placeholder-note {
  display: block; margin-top: 14px;
  font-size: 13px; color: var(--ink-faint);
}
.reel__timecode {
  position: absolute; bottom: 24px; right: 28px;
  font-size: 14px; letter-spacing: 0.15em; color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}
.reel__play {
  position: absolute; bottom: 24px; left: 28px;
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--accent); color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.3s var(--ease);
}
.reel__play svg { width: 24px; height: 24px; margin-left: 3px; }
.reel__play:hover { transform: scale(1.1); }

/* ===== Work ===== */
.work { padding: 0 var(--pad) clamp(80px, 12vw, 160px); }
.work__head { margin-bottom: 64px; }
.work__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(24px, 4vw, 56px);
}
.work-card {
  display: block; width: 100%; text-align: left;
  background: none; border: none; padding: 0; cursor: pointer;
  font: inherit; color: inherit;
  transform-style: preserve-3d;
  transition: transform 0.25s var(--ease);
}
.work-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  transition: border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
/* Whichever card is crossing the viewport centre while scrolling gets a quiet
   accent glow — a cinematic "in focus" cue distinct from the hover state. */
.work-card.is-focused .work-card__media {
  border-color: rgba(255, 77, 46, 0.45);
  box-shadow: 0 0 0 1px rgba(255, 77, 46, 0.18), 0 30px 70px rgba(0, 0, 0, 0.35);
}
.work-card__thumb {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.8s var(--ease), filter 0.5s var(--ease);
}
.work-card:hover .work-card__thumb { transform: scale(1.06); filter: brightness(1.06); }
/* Vertical clips: show the full portrait poster, with a blurred fill behind */
.work-card[data-vertical] .work-card__thumb { object-fit: contain; }
.work-card[data-vertical] .work-card__media::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: var(--poster) center / cover no-repeat;
  filter: blur(34px) brightness(0.45); transform: scale(1.25);
}
.work-card[data-vertical]:hover .work-card__thumb { transform: scale(1.03); }
/* Hover preview video (desktop) — fades in over the poster */
.work-card__preview {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%; object-fit: cover; background: #000;
  opacity: 0; transition: opacity 0.45s var(--ease);
}
.work-card__preview.is-ready { opacity: 1; }
.work-card[data-vertical] .work-card__preview { object-fit: contain; }
/* Blur-up: poster fades in over its tiny LQIP background placeholder */
.work-card__thumb.blurup { opacity: 0; }
.work-card__thumb.blurup.is-loaded { opacity: 1; transition: opacity 0.5s var(--ease); }
/* Play overlay */
.work-card__play {
  position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink);
  background: linear-gradient(180deg, rgba(10,10,11,0) 40%, rgba(10,10,11,0.45));
  opacity: 0; transition: opacity 0.4s var(--ease);
}
.work-card:hover .work-card__play { opacity: 1; }
.work-card__play svg {
  width: 26px; height: 26px; margin-left: 3px;
  display: grid; place-items: center;
  padding: 18px; box-sizing: content-box;
  border-radius: 50%;
  background: var(--accent); color: #fff;
  transform: scale(0.8); transition: transform 0.4s var(--ease);
  box-shadow: 0 10px 40px rgba(255, 77, 46, 0.4);
}
.work-card:hover .work-card__play svg { transform: scale(1); }
.work-card__duration {
  position: absolute; top: 16px; right: 16px; z-index: 3;
  font-size: 12px; letter-spacing: 0.1em;
  padding: 6px 12px; border-radius: 100px;
  background: rgba(10, 10, 11, 0.6); backdrop-filter: blur(8px);
  border: 1px solid var(--line);
}
.work-card__info {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 20px; gap: 16px;
}
.work-card__title {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.6vw, 32px); font-weight: 700;
  transition: color 0.3s;
}
.work-card:hover .work-card__title { color: var(--accent); }
.work-card__type { color: var(--ink-dim); font-size: 14px; margin-top: 4px; }
.work-card__year { color: var(--ink-faint); font-size: 14px; }
.work-card__role {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-faint);
}
.work__more { margin-top: 72px; text-align: center; }
.btn-outline {
  display: inline-flex; align-items: center; gap: 14px;
  font-size: 14px; letter-spacing: 0.05em;
  border: 1px solid var(--line);
  padding: 18px 36px; border-radius: 100px;
  transition: border-color 0.3s, background 0.3s, gap 0.3s;
}
.btn-outline svg { width: 18px; height: 18px; }
.btn-outline:hover { border-color: var(--accent); background: var(--accent-soft); gap: 22px; }

/* ===== Video lightbox ===== */
.lightbox {
  position: fixed; inset: 0; z-index: 1200;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 24px; padding: clamp(20px, 5vw, 64px);
  background: rgba(6, 6, 7, 0.985);
  opacity: 0; visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0.4s var(--ease);
  /* The lightbox is always dark — force a light text/control palette here so
     it stays readable in the light theme too. */
  --ink: #f4f2ee;
  --ink-dim: rgba(244, 242, 238, 0.6);
  --ink-faint: rgba(244, 242, 238, 0.34);
  --line: rgba(244, 242, 238, 0.12);
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox__stage {
  position: relative;
  max-width: min(1100px, 100%);
  width: 100%;
  display: flex; align-items: center; justify-content: center;
  transform: scale(0.97); transition: transform 0.5s var(--ease);
}
.lightbox.is-open .lightbox__stage { transform: scale(1); }
/* ===== Custom video player (branded controls) ===== */
.player {
  position: relative;
  width: 100%; max-width: min(1100px, 100%);
  border-radius: 12px; overflow: hidden;
  background: #000;
  border: 1px solid var(--line);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6);
}
.lightbox.is-vertical .player { max-width: min(420px, 100%); }
.player__video {
  width: 100%; max-height: 72vh;
  display: block;
}
/* Centre play button (shown when paused) */
.player__big {
  position: absolute; inset: 0; z-index: 3;
  display: grid; place-items: center;
  background: linear-gradient(180deg, rgba(10,10,11,0.05), rgba(10,10,11,0.25));
  transition: opacity 0.3s var(--ease);
}
.player__big svg {
  width: 30px; height: 30px; margin-left: 4px;
  padding: 26px; box-sizing: content-box; border-radius: 50%;
  background: var(--accent); color: #fff;
  box-shadow: 0 14px 50px rgba(255, 77, 46, 0.45);
  transition: transform 0.3s var(--ease);
}
.player__big:hover svg { transform: scale(1.06); }
.player.is-playing .player__big { opacity: 0; pointer-events: none; }
/* Buffering spinner */
.player__spinner {
  position: absolute; top: 50%; left: 50%; z-index: 4;
  width: 46px; height: 46px; margin: -23px 0 0 -23px;
  border: 3px solid rgba(244, 242, 238, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  opacity: 0; pointer-events: none;
  animation: player-spin 0.8s linear infinite;
}
.player.is-buffering .player__spinner { opacity: 1; }
.player.is-buffering .player__big { opacity: 0; }
@keyframes player-spin { to { transform: rotate(360deg); } }
/* Control bar */
.player__bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; align-items: center; gap: 14px;
  padding: 28px 16px 14px;
  background: linear-gradient(180deg, transparent, rgba(6, 6, 7, 0.85));
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.player:not(.is-playing) .player__bar,
.player.is-active .player__bar { opacity: 1; transform: none; }
.player__btn {
  flex: none; display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 8px;
  color: var(--ink);
  transition: color 0.2s, background 0.2s;
}
.player__btn svg { width: 20px; height: 20px; }
.player__btn:hover { color: var(--accent); background: rgba(244, 242, 238, 0.06); }
/* Icon toggles */
.player__ic-pause, .player__ic-mute, .player__ic-fsx { display: none; }
.player.is-playing #playerPlay .player__ic-play { display: none; }
.player.is-playing #playerPlay .player__ic-pause { display: block; }
.player.is-muted .player__ic-vol { display: none; }
.player.is-muted .player__ic-mute { display: block; }
.player.is-fs .player__ic-fs { display: none; }
.player.is-fs .player__ic-fsx { display: block; }
.player__time {
  flex: none; font-size: 12px; font-variant-numeric: tabular-nums;
  color: var(--ink-dim); min-width: 34px; text-align: center;
}
.player__time--dur { color: var(--ink-faint); }
/* Seek bar */
.player__seek {
  position: relative; flex: 1 1 auto; height: 28px;
  display: flex; align-items: center; cursor: pointer; touch-action: none;
}
.player__seek-track {
  position: relative; width: 100%; height: 4px; border-radius: 100px;
  background: rgba(244, 242, 238, 0.2); overflow: hidden;
  transition: height 0.2s;
}
.player__seek:hover .player__seek-track { height: 6px; }
.player__seek-buf {
  position: absolute; inset: 0 auto 0 0; width: 0;
  background: rgba(244, 242, 238, 0.28);
}
.player__seek-fill {
  position: absolute; inset: 0 auto 0 0; width: 0;
  background: var(--accent);
}
.player__seek-knob {
  position: absolute; top: 50%; left: 0; width: 12px; height: 12px;
  margin: -6px 0 0 -6px; border-radius: 50%; background: var(--accent);
  opacity: 0; transition: opacity 0.2s; pointer-events: none;
}
.player__seek:hover .player__seek-knob { opacity: 1; }
.lightbox__info { text-align: center; max-width: 720px; }
.lightbox__title {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 34px); font-weight: 700;
}
.lightbox__meta { color: var(--ink-dim); font-size: 14px; margin-top: 6px; }
.lightbox__role {
  margin-top: 12px;
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-faint);
}
.lightbox__close {
  position: absolute; top: clamp(16px, 3vw, 32px); right: clamp(16px, 3vw, 32px);
  z-index: 2;
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  background: rgba(244, 242, 238, 0.04);
  color: var(--ink);
  transition: border-color 0.3s, background 0.3s, transform 0.3s;
}
.lightbox__close svg { width: 22px; height: 22px; }
.lightbox__close:hover { border-color: var(--accent); background: var(--accent-soft); transform: rotate(90deg); }

/* ===== Stats ===== */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.stats__item {
  padding: clamp(40px, 6vw, 72px) var(--pad);
  border-right: 1px solid var(--line);
}
.stats__item:last-child { border-right: 0; }
.stats__num, .stats__plus {
  font-family: var(--font-display);
  font-size: clamp(40px, 5.5vw, 76px); font-weight: 800; line-height: 1;
}
.stats__plus { color: var(--accent); }
.stats__label {
  display: block; margin-top: 14px;
  font-size: 13px; color: var(--ink-dim);
  letter-spacing: 0.05em;
}

/* ===== About ===== */
.about {
  display: grid; grid-template-columns: 1fr 1.4fr;
  gap: clamp(40px, 6vw, 100px);
  padding: clamp(80px, 12vw, 160px) var(--pad);
}
.about__portrait { margin-top: 40px; }
.about__portrait-frame {
  aspect-ratio: 3 / 4; max-width: 380px;
  border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 50% 30%, rgba(255, 77, 46, 0.14), transparent 65%),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E"),
    var(--bg-soft);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.about__portrait-frame img { width: 100%; height: 100%; object-fit: cover; }
.about__portrait-corner {
  position: absolute; width: 26px; height: 26px;
  border: 1px solid var(--ink-faint); pointer-events: none;
}
.about__portrait-corner--tl { top: 18px; left: 18px; border-right: 0; border-bottom: 0; }
.about__portrait-corner--br { bottom: 18px; right: 18px; border-left: 0; border-top: 0; }
.about__portrait-placeholder {
  font-family: var(--font-display);
  /* Единственный крупный размер, остававшийся жёстким: на 320px монограмма
     занимала почти всю карточку. Остальная типографика уже флюидная. */
  font-size: clamp(52px, 14vw, 96px); font-weight: 800;
  color: var(--ink-faint);
  animation: portraitBreathe 5s ease-in-out infinite;
}
@keyframes portraitBreathe {
  0%, 100% { opacity: 0.45; transform: scale(1) rotate(0deg); }
  50% { opacity: 0.85; transform: scale(1.1) rotate(10deg); }
}
.about__portrait-caption {
  position: absolute; bottom: 22px; left: 0; right: 0; text-align: center;
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-faint);
}
@media (prefers-reduced-motion: reduce) {
  .about__portrait-placeholder { animation: none; }
}
.about__statement {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.6vw, 48px);
  font-weight: 600; line-height: 1.2; letter-spacing: -0.01em;
  max-width: 980px;
}
.about__statement em { color: var(--accent); font-style: normal; }
.about__text {
  margin-top: 32px; max-width: 560px;
  color: var(--ink-dim); font-size: 17px; line-height: 1.8;
}
.about__tools { margin-top: 48px; }
.about__tools-label {
  font-size: 12px; letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--ink-faint);
}
.about__tools-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.about__tools-list li {
  font-size: 13px; padding: 9px 18px;
  border: 1px solid var(--line); border-radius: 100px;
  transition: border-color 0.3s, color 0.3s;
}
.about__tools-list li:hover { border-color: var(--accent); color: var(--accent); }
/* Wide screens: the 1fr photo column outgrows the 380px portrait, leaving a
   huge hole between photo and text. Pin the column to the portrait width. */
@media (min-width: 1440px) {
  .about {
    grid-template-columns: 460px minmax(0, 1fr);
    align-items: center;
    max-width: 1720px;
    margin-inline: auto;
    /* Extra right inset keeps the headline clear of the side-nav label */
    padding-right: calc(var(--pad) + 120px);
  }
  .about__portrait-frame { max-width: 460px; }
}

/* ===== Services ===== */
.services { padding: 0 var(--pad) clamp(80px, 12vw, 160px); }
.services__head { margin-bottom: 64px; }
.services__list { border-top: 1px solid var(--line); }
.service {
  display: grid;
  /* minmax(0, …) вместо голого 1fr: иначе колонка не имеет права стать уже
     самого длинного слова внутри, и вся строка вылезает за экран. */
  grid-template-columns: 80px minmax(0, 1fr) minmax(0, 1.2fr) 60px;
  align-items: center;
  gap: clamp(20px, 4vw, 56px);
  padding: clamp(28px, 4vw, 44px) 0;
  border-bottom: 1px solid var(--line);
  position: relative;
  transition: padding-left 0.4s var(--ease);
}
.service::before {
  content: ""; position: absolute; left: 0; top: 0;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, var(--accent-soft), transparent 60%);
  opacity: 0; transition: opacity 0.4s;
  pointer-events: none;
}
.service:hover { padding-left: 24px; }
.service:hover::before { opacity: 1; }
.service__num { font-size: 13px; color: var(--ink-faint); letter-spacing: 0.1em; }
.service__title {
  font-family: var(--font-display);
  font-size: clamp(24px, 3.2vw, 40px); font-weight: 700;
  /* Длинные слова («Цветокоррекция», «Моушн-графика») шире своей колонки сетки:
     колонка 1fr не сжимается ниже содержимого, поэтому карточка распирала
     страницу вбок на узких экранах. Разрешаем перенос внутри слова. */
  overflow-wrap: break-word; min-width: 0;
}
.service__desc {
  color: var(--ink-dim); font-size: 15px; max-width: 480px;
  overflow-wrap: break-word; min-width: 0;
}
.service__arrow {
  font-size: 26px; color: var(--ink-faint);
  transition: transform 0.4s var(--ease), color 0.3s;
}
.service:hover .service__arrow { transform: translateX(10px); color: var(--accent); }

/* ===== Process ===== */
.process { padding: 0 var(--pad) clamp(80px, 12vw, 160px); }
.process__head { margin-bottom: 64px; }
.process__steps {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: clamp(20px, 3vw, 40px);
}
.process__step {
  padding: 32px 28px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg-soft);
  transition: transform 0.4s var(--ease), border-color 0.3s;
}
.process__step:hover { transform: translateY(-8px); border-color: rgba(255, 77, 46, 0.4); }
.process__step-num {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 700; color: var(--accent);
}
.process__step h3 {
  font-family: var(--font-display);
  font-size: 21px; font-weight: 700; margin: 18px 0 12px;
}
.process__step p { color: var(--ink-dim); font-size: 14px; }

/* ===== Quotes ===== */
.quotes {
  padding: clamp(80px, 12vw, 150px) var(--pad);
  text-align: center;
  border-top: 1px solid var(--line);
}
.quotes__slider { position: relative; max-width: 880px; margin: 48px auto 0; min-height: 220px; }
.quote {
  position: absolute; inset: 0;
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  pointer-events: none;
}
.quote.is-active { opacity: 1; transform: translateY(0); pointer-events: auto; }
.quote p {
  font-family: var(--font-display);
  font-size: clamp(20px, 3vw, 34px);
  font-weight: 500; line-height: 1.35;
}
.quote footer { margin-top: 28px; color: var(--ink-dim); font-size: 14px; letter-spacing: 0.08em; }
.quotes__dots { display: flex; gap: 10px; justify-content: center; margin-top: 40px; }
.quotes__dots button {
  width: 36px; height: 3px; border-radius: 2px;
  background: var(--line);
  transition: background 0.3s;
}
.quotes__dots button.is-active { background: var(--accent); }

/* ===== Contact ===== */
.contact {
  padding: clamp(100px, 15vw, 200px) var(--pad);
  text-align: center;
  border-top: 1px solid var(--line);
  position: relative; overflow: hidden;
}
.contact::before {
  content: ""; position: absolute; left: 50%; bottom: -30%;
  width: 80vw; height: 60vh;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(255, 77, 46, 0.1), transparent 65%);
  pointer-events: none;
}
.contact__title {
  font-family: var(--font-display);
  font-size: clamp(40px, 7.5vw, 104px);
  font-weight: 800; line-height: 1.04; letter-spacing: -0.02em;
  margin-top: 28px;
}
.contact__title span { display: block; }
.contact__title-accent {
  color: transparent;
  -webkit-text-stroke: 2px var(--accent);
}
/* Contact form */
.contact__form {
  max-width: 580px; margin: 48px auto 0;
  display: flex; flex-direction: column; gap: 14px; text-align: left;
  position: relative; z-index: 1;
}
.contact__hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.contact__fields { display: flex; gap: 14px; }
.contact__fields .contact__input { flex: 1 1 0; min-width: 0; }
.contact__input {
  width: 100%; font-size: 15px; color: var(--ink);
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 10px; padding: 14px 16px;
  transition: border-color 0.25s, background 0.25s;
}
.contact__input::placeholder { color: var(--ink-faint); }
.contact__input:focus { outline: none; border-color: var(--accent); }
.contact__textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
.contact__submit {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 12px;
  font-size: 15px; font-weight: 600; color: #fff;
  background: var(--accent); border: none; cursor: pointer;
  padding: 15px 30px; border-radius: 100px;
  position: relative; overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s, opacity 0.25s, gap 0.25s;
}
.contact__submit svg { width: 18px; height: 18px; }
.contact__submit:hover { gap: 18px; box-shadow: 0 12px 40px rgba(255, 77, 46, 0.35); }
/* Light sweeps across the (already-solid) button on hover — a glaze, not a fill */
.contact__submit::after {
  content: ""; position: absolute; top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(115deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transform: skewX(-20deg);
  transition: left 0.65s var(--ease);
  pointer-events: none;
}
.contact__submit:hover::after { left: 130%; }
.contact__submit:disabled { opacity: 0.55; cursor: default; }
.contact__note { font-size: 14px; min-height: 20px; color: var(--ink-dim); }
.contact__note.ok { color: #4ade80; }
.contact__note.err { color: #ff6a4d; }

.contact__email {
  display: inline-block; margin-top: 40px;
  font-size: clamp(15px, 1.8vw, 18px);
  border-bottom: 1px solid var(--ink-faint);
  padding-bottom: 6px;
  transition: color 0.3s, border-color 0.3s;
}
.contact__email:hover { color: var(--accent); border-color: var(--accent); }
.contact__socials {
  display: flex; gap: clamp(20px, 4vw, 48px); justify-content: center;
  margin-top: 56px; flex-wrap: wrap;
}
.contact__socials a {
  font-size: 13px; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--ink-dim);
  transition: color 0.3s;
}
.contact__socials a:hover { color: var(--accent); }

/* ===== FAQ ===== */
.faq {
  padding: clamp(60px, 10vw, 140px) var(--pad);
  display: grid; grid-template-columns: 0.85fr 1.5fr;
  gap: clamp(32px, 6vw, 90px); align-items: start;
}
.faq__head { position: sticky; top: 110px; }
.faq__list { display: flex; flex-direction: column; }
.faq__item { border-top: 1px solid var(--line); }
.faq__item:last-child { border-bottom: 1px solid var(--line); }
.faq__item summary {
  list-style: none; cursor: pointer; position: relative;
  padding: 26px 48px 26px 0;
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(18px, 2vw, 24px);
  transition: color 0.3s;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary:hover { color: var(--accent); }
.faq__item summary::after {
  content: ""; position: absolute; right: 4px; top: 50%;
  width: 15px; height: 15px; margin-top: -7px;
  background:
    linear-gradient(var(--accent), var(--accent)) center / 15px 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) center / 2px 15px no-repeat;
  transition: transform 0.35s var(--ease);
}
.faq__item[open] summary::after { transform: rotate(135deg); }
.faq__answer { padding: 0 48px 28px 0; color: var(--ink-dim); max-width: 62ch; }
.faq__answer p { font-size: clamp(15px, 1.5vw, 17px); line-height: 1.65; }

/* ===== Footer ===== */
.footer {
  display: flex; justify-content: space-between; align-items: center;
  gap: 20px; flex-wrap: wrap;
  padding: 28px var(--pad);
  border-top: 1px solid var(--line);
  font-size: 13px; color: var(--ink-dim);
}
.footer a { transition: color 0.3s; }
.footer a:hover { color: var(--accent); }
.footer__links { display: inline-flex; align-items: center; gap: 22px; }

/* Видно только скринридеру: подпись действия у кнопок-карточек и т.п.
   Не display:none и не visibility:hidden — их скринридер тоже пропускает. */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

/* Строка согласия под формой связи.
   Была 12px + opacity 0.75 поверх приглушённого цвета — контраст падал ниже
   нормы читаемости. Убрали прозрачность и подняли размер: текст про
   персональные данные должен читаться, а не угадываться. */
.contact__consent { font-size: 13px; color: var(--ink-dim); max-width: 460px; }
.contact__consent a { text-decoration: underline; text-underline-offset: 3px; }
.contact__consent a:hover { color: var(--accent); }

/* ===== Правовые страницы (политика конфиденциальности) ===== */
.legal__bar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 20px; padding: 24px var(--pad);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap; /* страховка: содержимое переносится, а не растягивает страницу */
}
.legal__back {
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-dim); transition: color 0.3s;
}
.legal__back:hover { color: var(--accent); }
.legal {
  max-width: 760px; margin: 0 auto; padding: 80px var(--pad) 100px;
}
.legal__title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(28px, 6vw, 60px); line-height: 1.05; letter-spacing: -0.02em;
  /* «конфиденциальности» — одно слово шириной больше телефона: без переноса
     оно вылезало за экран и давало горизонтальную прокрутку. */
  overflow-wrap: break-word; hyphens: auto;
}
.legal__updated {
  margin-top: 14px; font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-dim);
}
.legal__intro {
  margin-top: 28px; font-size: clamp(16px, 2vw, 19px); line-height: 1.65;
  color: var(--ink);
}
.legal__block { margin-top: 44px; }
.legal__block h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(19px, 2.4vw, 24px); letter-spacing: -0.01em;
  overflow-wrap: break-word;
}
.legal__block p {
  margin-top: 14px; line-height: 1.75; color: var(--ink-dim);
}
.legal__block strong { color: var(--ink); font-weight: 600; }
.legal__block a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
/* На узком экране «Вернуться на сайт» рядом с логотипом и переключателем языка
   не помещается в строку и растягивает страницу вбок. Логотип и так ведёт на
   главную, плюс та же ссылка есть в подвале — здесь её прячем. */
@media (max-width: 560px) {
  .legal__bar { padding: 18px var(--pad); }
  .legal__back { display: none; }
  .legal { padding-top: 56px; }
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .work__grid { grid-template-columns: 1fr; }
  .process__steps { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats__item:nth-child(2) { border-right: 0; }
  .stats__item:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .service { grid-template-columns: 60px minmax(0, 1fr) 40px; }
  .service__desc { grid-column: 2; grid-row: 2; }
  .service__arrow { grid-column: 3; grid-row: 1; }
  /* Tablet range (~769-1020px): logo + nav + CTA pill have nowhere left to
     breathe (gap between logo and nav hits 0px around 900-940px, wrapping
     the CTA pill's text into 2-3 lines). Fall back to the burger menu here
     instead of only below 768px. */
  .header__nav, .header__cta { display: none; }
  .header__burger { display: flex; }
}
@media (max-width: 768px) {
  .about { grid-template-columns: 1fr; }
  .about__portrait { order: 2; }
  .process__steps { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .stats__item { border-right: 0; border-bottom: 1px solid var(--line); }
  .stats__item:last-child { border-bottom: 0; }
  .hero__bottom { flex-direction: column; align-items: flex-start; }
  .footer { justify-content: center; text-align: center; }
  .faq { grid-template-columns: 1fr; gap: 24px; }
  .faq__head { position: static; }
  .contact__fields { flex-direction: column; }
  /* Lightbox: leave room for caption + close on small screens */
  .lightbox { gap: 18px; padding: 16px; }
  .player__video { max-height: 60vh; }
  .lightbox.is-vertical .player__video { max-height: 64vh; }
  .lightbox__close { top: 12px; right: 12px; width: 44px; height: 44px; }
  .player__bar { gap: 8px; padding: 24px 10px 10px; }
  .player__time { min-width: 28px; font-size: 11px; }
}

/* Узкие телефоны: в строке услуги фиксированные колонки (номер + стрелка)
   съедали ~100px из 320, и на текст оставалась треть экрана — русские
   названия вроде «Цветокоррекция» переносились по слогам. Стрелка
   декоративная, убираем; номер ужимаем. Переполнения тут нет (колонки
   объявлены через minmax(0, …)), это именно про читаемость. */
@media (max-width: 480px) {
  .service { grid-template-columns: 34px minmax(0, 1fr); gap: 14px; }
  .service__arrow { display: none; }
  .service__num { font-size: 12px; }
  .service__title { font-size: clamp(21px, 6.4vw, 28px); }
  .service__desc { grid-column: 2; grid-row: 2; }
}

/* ===== Performance on touch / mobile devices =====
   Constant full-screen repaints and large blurs are the main cause of jank on
   phones. Disable them on touch (desktop keeps the full effects). */
@media (hover: none) {
  /* Film grain: keep the texture, drop the constant animation */
  .grain { animation: none; inset: 0; opacity: 0.045; }
  /* Hero orbs: huge blur + drift is brutal on mobile GPUs — lighten & freeze */
  .hero__orb { filter: blur(60px); animation: none; opacity: 0.6; }
  /* backdrop-filter (live background blur) is expensive — use solid fills */
  .header.is-scrolled { backdrop-filter: none; background: rgba(10, 10, 11, 0.94); }
  .work-card__duration { backdrop-filter: none; background: rgba(10, 10, 11, 0.8); }
  .lightbox { backdrop-filter: none; background: rgba(6, 6, 7, 0.97); }
  /* Vertical card: replace the blurred poster fill with a flat dark backdrop */
  .work-card[data-vertical] .work-card__media::before {
    filter: none; transform: none; background: #050506;
  }
  /* Hover-only scale effects never trigger on touch — keep posters static */
  .work-card:hover .work-card__thumb { transform: none; filter: none; }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .hero__line-inner { transform: none; }
}

/* ===== Header tools: language + theme ===== */
/* Две круглые кнопки держим вместе, иначе space-between в шапке растащил бы их
   по разным углам. */
.header__tools { flex: none; display: flex; align-items: center; gap: 10px; }

/* Переключатель языка — ссылка на вторую версию сайта, по виду пара к теме */
.lang-toggle {
  flex: none; height: 42px; min-width: 42px; padding: 0 12px;
  border-radius: 100px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); color: var(--ink);
  font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  transition: border-color 0.3s, color 0.3s, background 0.3s;
}
.lang-toggle:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
/* На узких экранах (320px и подобные) логотип + язык + тема + бургер перестают
   помещаться в строку и растягивают страницу вбок. Ужимаем: приписка STUDIO
   у логотипа прячется, кнопки становятся компактнее. */
@media (max-width: 400px) {
  .header__logo-sub { display: none; }
  .header__tools { gap: 6px; }
  .lang-toggle { height: 38px; min-width: 38px; padding: 0 9px; font-size: 11px; }
  .theme-toggle { width: 38px; height: 38px; }
  .header__burger { padding: 8px 0 8px 8px; }
}

/* В мобильном меню — отдельной строкой под почтой */
.mobile-menu__lang {
  display: inline-block; margin-top: 14px;
  padding: 8px 16px; border: 1px solid var(--line); border-radius: 100px;
  font-size: 13px; letter-spacing: 0.08em;
  transition: border-color 0.3s, color 0.3s;
}
.mobile-menu__lang:hover { border-color: var(--accent); color: var(--accent); }

/* ===== Theme toggle button ===== */
.theme-toggle {
  flex: none; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line); color: var(--ink);
  transition: border-color 0.3s, color 0.3s, background 0.3s, transform 0.3s;
}
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); transform: rotate(12deg); }
.theme-toggle__moon { display: none; }
[data-theme="light"] .theme-toggle__sun { display: none; }
[data-theme="light"] .theme-toggle__moon { display: block; }

/* ===== Light theme ===== */
[data-theme="light"] {
  --bg: #f4f2ee;
  --bg-soft: #eceae3;
  --ink: #16130f;
  --ink-dim: rgba(22, 19, 15, 0.6);
  --ink-faint: rgba(22, 19, 15, 0.34);
  --accent-soft: rgba(255, 77, 46, 0.12);
  --line: rgba(22, 19, 15, 0.13);
  color-scheme: light;
}
/* Dark hardcoded spots that need a light counterpart */
[data-theme="light"] .grain { opacity: 0.035; mix-blend-mode: multiply; }
[data-theme="light"] .header.is-scrolled { background: rgba(244, 242, 238, 0.82); }
[data-theme="light"] .work-card__duration { background: rgba(244, 242, 238, 0.72); color: var(--ink); }
[data-theme="light"] .cursor { mix-blend-mode: normal; }
[data-theme="light"] .work-card[data-vertical] .work-card__media::before { background: var(--bg-soft); }
/* The video lightbox stays dark in both themes (best backdrop for footage) */
