/* Шрифты. Самохостинг, CDN не используем. */
@font-face{font-family:'Golos Text';font-style:normal;font-weight:400 900;font-display:swap;src:url('../fonts/golos-text-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:'Golos Text';font-style:normal;font-weight:400 900;font-display:swap;src:url('../fonts/golos-text-cyrillic.woff2') format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:'Golos Text';font-style:normal;font-weight:400 900;font-display:swap;src:url('../fonts/golos-text-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-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Golos Text';font-style:normal;font-weight:400 900;font-display:swap;src:url('../fonts/golos-text-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}
@font-face{font-family:'EB Garamond';font-style:italic;font-weight:400;font-display:swap;src:url('../fonts/ebgaramond-cyrillic-ext-400i.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:'EB Garamond';font-style:italic;font-weight:400;font-display:swap;src:url('../fonts/ebgaramond-cyrillic-400i.woff2') format('woff2');unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116}
@font-face{font-family:'EB Garamond';font-style:italic;font-weight:400;font-display:swap;src:url('../fonts/ebgaramond-latin-ext-400i.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF}
@font-face{font-family:'EB Garamond';font-style:italic;font-weight:400;font-display:swap;src:url('../fonts/ebgaramond-latin-400i.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}
@font-face{font-family:'EB Garamond';font-style:normal;font-weight:400;font-display:swap;src:url('../fonts/ebgaramond-cyrillic-ext-400.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:'EB Garamond';font-style:normal;font-weight:400;font-display:swap;src:url('../fonts/ebgaramond-cyrillic-400.woff2') format('woff2');unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116}
@font-face{font-family:'EB Garamond';font-style:normal;font-weight:400;font-display:swap;src:url('../fonts/ebgaramond-latin-ext-400.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF}
@font-face{font-family:'EB Garamond';font-style:normal;font-weight:400;font-display:swap;src:url('../fonts/ebgaramond-latin-400.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}
@font-face{font-family:'EB Garamond';font-style:normal;font-weight:500;font-display:swap;src:url('../fonts/ebgaramond-cyrillic-ext-500.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:'EB Garamond';font-style:normal;font-weight:500;font-display:swap;src:url('../fonts/ebgaramond-cyrillic-500.woff2') format('woff2');unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116}
@font-face{font-family:'EB Garamond';font-style:normal;font-weight:500;font-display:swap;src:url('../fonts/ebgaramond-latin-ext-500.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF}
@font-face{font-family:'EB Garamond';font-style:normal;font-weight:500;font-display:swap;src:url('../fonts/ebgaramond-latin-500.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}
@font-face{font-family:'EB Garamond';font-style:normal;font-weight:600;font-display:swap;src:url('../fonts/ebgaramond-cyrillic-ext-600.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:'EB Garamond';font-style:normal;font-weight:600;font-display:swap;src:url('../fonts/ebgaramond-cyrillic-600.woff2') format('woff2');unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116}
@font-face{font-family:'EB Garamond';font-style:normal;font-weight:600;font-display:swap;src:url('../fonts/ebgaramond-latin-ext-600.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF}
@font-face{font-family:'EB Garamond';font-style:normal;font-weight:600;font-display:swap;src:url('../fonts/ebgaramond-latin-600.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}
/* Запасные шрифты подогнаны по ширине под основные: без этого подмена
   шрифта двигает текст и даёт скачок раскладки. Замерено на строке в 100px:
   EB Garamond уже Georgia на 14%, Golos Text шире системного на 6%. */
@font-face {
  font-family: 'EB Garamond Fallback';
  src: local('Georgia'), local('Times New Roman'), local('Liberation Serif');
  size-adjust: 86%;
  ascent-override: 92%;
  descent-override: 24%;
}
@font-face {
  font-family: 'Golos Fallback';
  src: local('Segoe UI'), local('Helvetica Neue'), local('Arial');
  size-adjust: 106.3%;
}

/* ==========================================================================
   vdmitriev.com
   Редакторская тема: бумага, графит, латунь. Нулевой радиус у всего, кроме
   телефонов. Работы показаны настоящими экранами на тёмных подложках.
   Порядок @media строго по возрастанию ширины.
   ========================================================================== */

:root {
  --bg:        #fafaf8;
  --bg-elev:   #f1f1ec;
  --bg-ink:    #16181c;
  --text:      #16181c;
  --text-dim:  #50555e;
  --text-mute: #5f6570;
  --line:      #dddcd5;
  --line-soft: #e9e8e2;
  --accent:    #7d5a23;
  --accent-ink:#ffffff;
  --ink:       #16181c;
  --ink-text:  #fafaf8;

  /* Подложки под экраны и финальная полоса: тёмные в обеих темах. */
  --plate:      #1b1d22;
  --plate-line: rgba(255, 255, 255, 0.08);
  --band:       #16181c;
  --band-text:  #f3f1ea;
  --band-dim:   #b4b8bf;
  --band-line:  #33363d;
  --brass:      #d8b05a;
  --brass-hi:   #e4c27a;

  --font-display: 'EB Garamond', 'EB Garamond Fallback', Georgia, serif;
  --font-text: 'Golos Text', 'Golos Fallback', system-ui, -apple-system, sans-serif;

  --step--1: clamp(0.84rem, 0.82rem + 0.1vw, 0.9rem);
  --step-0:  clamp(1rem, 0.96rem + 0.18vw, 1.08rem);
  --step-1:  clamp(1.18rem, 1.08rem + 0.42vw, 1.42rem);
  --step-2:  clamp(1.4rem, 1.2rem + 0.8vw, 1.9rem);
  --step-3:  clamp(2.1rem, 1.3rem + 3.2vw, 4.25rem);
  --step-4:  clamp(2.7rem, 0.9rem + 6.6vw, 6rem);

  --gutter: clamp(1rem, 0.5rem + 2.4vw, 3rem);
  --section-tight: clamp(3rem, 2rem + 3vw, 5rem);
  --section:       clamp(4.5rem, 2.6rem + 6vw, 8.5rem);
  --section-loose: clamp(5.5rem, 3rem + 8vw, 11rem);
  --measure: 62ch;

  --dur: 640ms;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-rule: 900ms;

  /* Тени тонированы под фон: чистый чёрный на бумаге выглядит грязно. */
  --shadow-near: 0 1px 2px rgba(38, 34, 28, 0.05), 0 4px 12px rgba(38, 34, 28, 0.045);
  --shadow-far:  0 2px 6px rgba(38, 34, 28, 0.06), 0 18px 44px rgba(38, 34, 28, 0.085);
  --shadow-shot: 0 2px 6px rgba(0, 0, 0, 0.25), 0 24px 60px rgba(0, 0, 0, 0.45);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg:        #111316;
    --bg-elev:   #171a1e;
    --bg-ink:    #05060a;
    --text:      #ecebe5;
    --text-dim:  #a3a8b1;
    --text-mute: #8d939c;
    --line:      #2b2f36;
    --line-soft: #23272d;
    --accent:    #d8b05a;
    --accent-ink:#0c0e12;
    --ink:       #ecebe5;
    --ink-text:  #111316;
    --plate:      #1c1f25;
    --band:       #07080b;
    --band-line:  #24272d;
    --shadow-near: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.32);
    --shadow-far:  0 2px 8px rgba(0, 0, 0, 0.45), 0 22px 50px rgba(0, 0, 0, 0.42);
  }
}

:root[data-theme='dark'] {
  --bg:        #111316;
  --bg-elev:   #171a1e;
  --bg-ink:    #05060a;
  --text:      #ecebe5;
  --text-dim:  #a3a8b1;
  --text-mute: #8d939c;
  --line:      #2b2f36;
  --line-soft: #23272d;
  --accent:    #d8b05a;
  --accent-ink:#0c0e12;
  --ink:       #ecebe5;
  --ink-text:  #111316;
  --plate:      #1c1f25;
  --band:       #07080b;
  --band-line:  #24272d;
  --shadow-near: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.32);
  --shadow-far:  0 2px 8px rgba(0, 0, 0, 0.45), 0 22px 50px rgba(0, 0, 0, 0.42);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-color: color-mix(in oklab, var(--text) 28%, transparent) var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  caret-color: var(--accent);
  font-family: var(--font-text);
  font-size: var(--step-0);
  line-height: 1.62;
  font-feature-settings: 'ss01', 'kern', 'liga';
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; text-underline-offset: 0.2em; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.012em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }
figure { margin: 0; }

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

/* Плёночное зерно поверх всей страницы. Фиксированный слой, не участвует в скролле. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) body::after { opacity: 0.055; }
}
:root[data-theme='dark'] body::after { opacity: 0.055; }

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

/* --- служебное ------------------------------------------------------------ */

/* Один левый край на всю страницу: все секции в одной обёртке, ширину текста
   ограничивает сетка внутри, а не разные контейнеры. */
.wrap {
  width: 100%;
  max-width: 1360px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--text);
  color: var(--bg);
  padding: 0.7rem 1.1rem;
  z-index: 100;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }


.lede {
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--text-dim);
  max-width: 40ch;
}

/* Курсивное слово с латунной чертой: подпись сайта, повторяется в финале. */
.mark {
  position: relative;
  font-style: italic;
  font-weight: 400;
  padding-bottom: 0.06em;
}
.mark::after {
  content: '';
  position: absolute;
  left: 0.04em;
  right: 0.02em;
  bottom: -0.06em;
  height: 0.045em;
  min-height: 2px;
  background: var(--accent);
  transform-origin: left center;
}

/* --- движение ------------------------------------------------------------- */

.js .reveal { opacity: 0; }
.reveal.is-in {
  opacity: 1;
  transition: opacity var(--dur) var(--ease);
}
.js .case .stage { clip-path: inset(0 0 12% 0); transition: clip-path 1100ms var(--ease); }
.case.is-in .stage { clip-path: inset(0 0 0 0); }

/* Линии услуг и шагов прочерчиваются слева направо, как по линейке. */
.service, .step { position: relative; }
.service::before, .step::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: var(--line);
  transform-origin: left center;
}
.step::before { height: 2px; background: var(--text); }
.js .service::before, .js .step::before { transform: scaleX(0); }
.js .service.is-in::before, .js .step.is-in::before {
  transform: scaleX(1);
  transition: transform var(--dur-rule) var(--ease);
}
.js .service.is-in > *, .js .step.is-in > * { animation: ink-in 520ms var(--ease) 240ms both; }
@keyframes ink-in { from { opacity: 0; } }

/* Главный момент: заголовок проявляется из-под маски, потом под акцентным словом
   прочерчивается латунная линия. В финале та же черта рисуется при появлении. */
@media (prefers-reduced-motion: no-preference) {
  .hero__title { animation: set-in 820ms var(--ease) both; }
  .hero__side, .hero__stage { animation: ink-in 700ms var(--ease) 380ms both; }
  .hero__title .mark::after { animation: rule-draw 700ms var(--ease) 860ms both; }
  .js .contact__title .mark::after { transform: scaleX(0); }
  .js .contact__title.is-in .mark::after { transform: scaleX(1); transition: transform 900ms var(--ease) 260ms; }
  @keyframes set-in {
    from { clip-path: inset(0 0 100% 0); transform: translateY(0.14em); }
    to   { clip-path: inset(0 0 -0.3em 0); transform: none; }
  }
  @keyframes rule-draw { from { transform: scaleX(0); } }
}

/* Телефоны чуть плывут относительно экранов браузера: даёт глубину без лишних эффектов. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) and (min-width: 768px) {
    .stage .phone {
      animation: float linear both;
      animation-timeline: view();
      animation-range: entry 0% exit 100%;
    }
    @keyframes float {
      from { translate: 0 7%; }
      to   { translate: 0 -7%; }
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transition: none; }
  .js .case .stage { clip-path: none; transition: none; }
  .js .service::before, .js .step::before { transform: none; transition: none; }
  .js .service.is-in > *, .js .step.is-in > * { animation: none; }
  .nav__links a::after { transition: none; }
  .btn, .btn__arrow, .shot { transition-property: opacity, color, background-color, border-color, box-shadow; }
  .btn:active, .btn:hover .btn__arrow, .case:hover .shot--main { transform: none; }
}

/* --- кнопки и ссылки ------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 48px;
  white-space: nowrap;
  font-family: var(--font-text);
  font-size: var(--step-0);
  font-weight: 600;
  letter-spacing: 0.005em;
  padding: 0.95rem 1.7rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--ink-text);
  cursor: pointer;
  transition: transform 220ms var(--ease), background-color 320ms var(--ease),
              border-color 320ms var(--ease), box-shadow 320ms var(--ease);
}
.btn:hover {
  background: color-mix(in oklab, var(--ink) 84%, var(--accent));
  border-color: color-mix(in oklab, var(--ink) 84%, var(--accent));
  box-shadow: var(--shadow-near);
}
.btn:active { transform: translateY(1px) scale(0.985); }

.btn--brass {
  background: var(--brass);
  border-color: var(--brass);
  color: #16181c;
  font-size: var(--step-1);
  padding: 1.15rem 2.2rem;
  min-height: 60px;
}
.btn--brass:hover { background: var(--brass-hi); border-color: var(--brass-hi); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), 0 14px 32px rgba(0, 0, 0, 0.35); }

.btn__arrow { transition: transform 320ms var(--ease); }
.btn:hover .btn__arrow { transform: translateX(4px); }

.link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  font-weight: 600;
  font-size: var(--step--1);
  color: var(--text);
  box-shadow: inset 0 -1px 0 var(--line);
  transition: box-shadow 220ms var(--ease), color 220ms var(--ease);
}
.link:hover { box-shadow: inset 0 -1px 0 var(--accent); color: var(--accent); }
.link--accent { color: var(--accent); box-shadow: inset 0 -1px 0 color-mix(in oklab, var(--accent) 40%, transparent); }

/* --- шапка ---------------------------------------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 68px;
  display: flex;
  align-items: center;
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}

.nav__in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}

.nav__name {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 0.9rem + 0.7vw, 1.22rem);
  font-weight: 600;
  white-space: nowrap;
}

.nav__right { display: flex; align-items: center; gap: clamp(0.25rem, 1.6vw, 1.9rem); }

.nav__links { display: none; gap: clamp(0.9rem, 1.7vw, 1.75rem); }
.nav__links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: var(--step--1);
  color: var(--text-dim);
  transition: color 300ms var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 360ms var(--ease);
}
.nav__links a[aria-current='true'] { color: var(--text); }
.nav__links a[aria-current='true']::after { transform: scaleX(1); }

/* Язык текстом, а не сегментом: в шапке телефона место нужнее кнопке. */
.lang { display: flex; align-items: center; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em; }
.lang a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 30px;
  color: var(--text-mute);
  transition: color 180ms var(--ease);
}
.lang a:hover { color: var(--text); }
.lang a[aria-current='true'] { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }

.nav__cta { min-height: 44px; padding: 0.6rem 1rem; font-size: var(--step--1); }
.nav__cta-long { display: none; }

/* Переключатель темы. Иконки нарисованы (SVG, один штрих), без эмодзи.
   Показана иконка того, КУДА переключит: луна на светлой, солнце на тёмной.
   Кнопка только при JS — без скрипта она ничего не делает. */
.theme {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 30px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-mute);
  cursor: pointer;
  transition: color 180ms var(--ease);
}
.js .theme { display: inline-flex; }
/* На совсем узких экранах (≈320px) шапке не хватает места на четвёртый
   элемент — прячем тумблер, системная тема продолжает работать. */
@media (max-width: 359.98px) { .js .theme { display: none; } }
.theme:hover { color: var(--text); }
.theme__icon { width: 18px; height: 18px; }
.theme__sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .theme__sun { display: block; }
  :root:not([data-theme='light']) .theme__moon { display: none; }
}
:root[data-theme='dark'] .theme__sun { display: block; }
:root[data-theme='dark'] .theme__moon { display: none; }

/* --- герой ---------------------------------------------------------------- */

.hero { padding-block: clamp(2.6rem, 1.6rem + 3.6vw, 5.5rem) var(--section); }

.hero__grid { display: grid; gap: clamp(1.8rem, 1rem + 3vw, 3.4rem); }

.hero__title {
  font-size: var(--step-4);
  line-height: 0.98;
  letter-spacing: -0.024em;
  max-width: 24ch;
}

.hero__side { display: grid; gap: 2rem; align-content: start; }
.hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.6rem; }

main { overflow-x: clip; }

/* --- подложка с экранами -------------------------------------------------- */

.stage {
  position: relative;
  background: var(--plate);
  border: 1px solid var(--plate-line);
  padding: clamp(1.1rem, 0.5rem + 3vw, 3rem);
  isolation: isolate;
  overflow: hidden;
}
/* Тёплый свет из угла: подложка читается как поверхность, а не как плашка. */
.stage::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(120% 90% at 100% 0%, rgba(216, 176, 90, 0.16), transparent 55%);
}
.stage--night { background: #131220; }
.stage--night::before { background: radial-gradient(90% 80% at 20% 100%, rgba(233, 166, 74, 0.22), transparent 60%); }

.shot {
  position: relative;
  background: #0e0f12;
  box-shadow: var(--shadow-shot);
  transition: transform 700ms var(--ease);
}
.shot__bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  height: clamp(20px, 1.2rem + 0.5vw, 30px);
  padding-inline: 0.8rem;
  background: #24272d;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: clamp(0.6rem, 0.55rem + 0.2vw, 0.72rem);
  color: #a6abb3;
  white-space: nowrap;
  overflow: hidden;
}
.shot__bar::before {
  content: '';
  flex: none;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--brass);
  opacity: 0.8;
}
.shot img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top center; }
.case:hover .shot--main { transform: translateY(-4px); }

.shot--over {
  position: absolute;
  width: 54%;
  right: clamp(0.6rem, 2vw, 1.6rem);
  bottom: clamp(0.6rem, 2vw, 1.6rem);
}
.stage--layered { padding-bottom: clamp(5rem, 2rem + 14vw, 13rem); padding-right: clamp(3rem, 1rem + 10vw, 9rem); }

.phone {
  position: relative;
  width: clamp(120px, 26%, 250px);
  padding: 7px;
  border-radius: clamp(20px, 2.6vw, 34px);
  background: #08090c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-shot);
}
.phone img { width: 100%; aspect-ratio: 390 / 844; object-fit: cover; object-position: top; border-radius: clamp(14px, 2.1vw, 27px); }


.phones { display: flex; justify-content: center; align-items: flex-start; gap: clamp(0.8rem, 3vw, 2.6rem); }
.phones .phone { width: clamp(130px, 38%, 270px); }
.phones .phone:nth-child(2) { margin-top: clamp(2rem, 6vw, 5rem); }

/* --- витрина в первом экране ---------------------------------------------- */

/* Экраны лежат стопкой в одной ячейке сетки, высоту задаёт самый высокий.
   Смена: уходящий экран гаснет и чуть отъезжает, новый проявляется из-под
   маски снизу вверх. Темп задаёт полоса на активной вкладке. */
.showcase { --slide: 5200ms; }
.showcase__stage { display: grid; }
.showcase__slide {
  grid-area: 1 / 1;
  display: grid;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(0.985);
  clip-path: inset(-3rem -3rem 100% -3rem);
  transition: opacity 700ms var(--ease), transform 900ms var(--ease),
              clip-path 900ms var(--ease), visibility 0s linear 900ms;
}
.showcase__slide.is-on {
  opacity: 1;
  visibility: visible;
  transform: none;
  clip-path: inset(-3rem);
  transition: opacity 700ms var(--ease) 120ms, transform 900ms var(--ease) 120ms,
              clip-path 1000ms var(--ease) 120ms, visibility 0s;
}
.showcase__slide.is-out {
  opacity: 0;
  transform: translateY(-10px) scale(0.99);
  clip-path: inset(-3rem);
}
.showcase__slide--phone { justify-items: center; }
.showcase__slide--phone .phone { width: clamp(108px, 29%, 240px); }

/* Без скрипта вкладки ничего не переключают, поэтому показываем их только при JS. */
.showcase__controls { display: none; }
.js .showcase__controls { display: flex; align-items: flex-start; gap: clamp(0.8rem, 2vw, 1.6rem); margin-top: 0.9rem; }
.showcase__tabs {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(0.8rem, 2vw, 1.6rem);
}
.showcase__pause {
  flex: none;
  min-height: 44px;
  min-width: 44px;
  padding: 0.75rem 0 0.4rem;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-mute);
  box-shadow: inset 0 2px 0 var(--line);
  cursor: pointer;
  transition: color 300ms var(--ease);
}
@media (hover: hover) { .showcase__pause:hover { color: var(--text); } }
.showcase__pause.is-on { color: var(--accent); }
.showcase__tab {
  position: relative;
  min-height: 44px;
  padding: 0.75rem 0 0.4rem;
  border: 0;
  background: none;
  font: inherit;
  font-size: var(--step--1);
  font-weight: 600;
  text-align: left;
  color: var(--text-mute);
  cursor: pointer;
  transition: color 300ms var(--ease);
}
.showcase__tab::before,
.showcase__tab::after {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--line);
}
.showcase__tab::after { background: var(--accent); transform: scaleX(0); transform-origin: left center; }
@media (hover: hover) { .showcase__tab:hover { color: var(--text); } }
.showcase__tab.is-on { color: var(--text); }
.showcase__tab.is-on::after { transform: scaleX(1); }
.showcase.is-playing .showcase__tab.is-on::after { animation: tab-run var(--slide) linear both; }
.showcase.is-paused .showcase__tab.is-on::after { animation-play-state: paused; }
@keyframes tab-run { from { transform: scaleX(0); } }

@media (prefers-reduced-motion: reduce) {
  .showcase__slide, .showcase__slide.is-on, .showcase__slide.is-out { transform: none; clip-path: none; transition: opacity 200ms linear, visibility 0s; }
}

@media (min-width: 768px) {
  .showcase__tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* --- условия работы ------------------------------------------------------- */

.terms { border-block: 1px solid var(--line); padding-block: clamp(1.8rem, 1rem + 2vw, 2.8rem); }
.terms__grid { display: grid; gap: 1.4rem clamp(1.4rem, 3vw, 2.6rem); margin: 0; }
.terms dt { font-size: 0.82rem; font-weight: 600; color: var(--accent); margin-bottom: 0.35rem; }
.terms dd { margin: 0; font-family: var(--font-display); font-size: var(--step-1); line-height: 1.25; }

/* --- услуги --------------------------------------------------------------- */

.services { padding-block: var(--section) var(--section-tight); }
.services__grid { display: grid; gap: clamp(2rem, 1rem + 3vw, 3.5rem); }
.services__title { font-size: var(--step-3); line-height: 1.04; letter-spacing: -0.02em; max-width: 13ch; }
.services__note { margin-top: 1.4rem; color: var(--text-dim); max-width: 34ch; }

.services__list { display: grid; list-style: none; margin: 0; padding: 0; }
.service { display: grid; gap: 0.4rem; padding-block: clamp(1.2rem, 0.9rem + 1vw, 1.7rem); }
.service h3 { font-size: var(--step-2); line-height: 1.15; }
.service p { color: var(--text-dim); font-size: var(--step--1); max-width: 52ch; }

/* --- работы --------------------------------------------------------------- */

.work { padding-block: var(--section-loose) var(--section); }
.work__head { display: grid; gap: 1rem; margin-bottom: clamp(2.4rem, 1.4rem + 3vw, 4.5rem); }
.work__title { font-size: var(--step-4); line-height: 0.95; letter-spacing: -0.026em; }
.work__note { color: var(--text-dim); font-size: var(--step--1); max-width: 46ch; }

.cases { display: grid; gap: clamp(3.5rem, 2rem + 5vw, 7rem); }

.case { display: grid; gap: clamp(1.3rem, 0.8rem + 1.6vw, 2.2rem); align-items: center; }
.case__body { display: grid; gap: 0.85rem; align-content: start; }
.case__kind { font-size: 0.82rem; font-weight: 600; color: var(--accent); }
.case__title { font-size: var(--step-3); line-height: 1.02; letter-spacing: -0.02em; }
.case--wide .case__title { font-size: clamp(2rem, 1.2rem + 2.4vw, 3.4rem); }
.case--half .case__title { font-size: var(--step-2); }
.case__text { color: var(--text-dim); max-width: 48ch; }
.case__links { display: flex; flex-wrap: wrap; gap: 0.2rem 1.4rem; }
.case__meta { font-size: 0.8rem; color: var(--text-mute); padding-top: 0.3rem; }

.cases__pair { display: grid; gap: clamp(3rem, 2rem + 3vw, 4rem) clamp(1.5rem, 3vw, 3rem); }
.case--half { align-items: start; }

/* Небольшие работы без картинок: строка с названием, сутью и стеком. */
.more { border-top: 2px solid var(--text); }
.more__title { font-family: var(--font-text); font-size: 0.82rem; font-weight: 600; color: var(--text-mute); padding-block: 1rem 0.4rem; letter-spacing: 0; }
.more__list { list-style: none; margin: 0; padding: 0; }
.more__item { display: grid; gap: 0.3rem; padding-block: 1.1rem; border-bottom: 1px solid var(--line); }
.more__item h4 { font-size: var(--step-1); line-height: 1.2; }
.more__item p { color: var(--text-dim); font-size: var(--step--1); }
.more__item span { font-size: 0.8rem; color: var(--text-mute); }

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

.process { padding-block: var(--section); background: var(--bg-elev); }
.process__title { font-size: var(--step-3); line-height: 1.04; letter-spacing: -0.02em; max-width: 16ch; margin-bottom: clamp(2.2rem, 1.5rem + 2vw, 3.6rem); }
.process__grid { display: grid; gap: clamp(1.6rem, 1rem + 2vw, 2.4rem); counter-reset: step; }
.step { padding-top: 1.1rem; counter-increment: step; }
.step h3 { display: flex; gap: 0.9rem; align-items: baseline; font-size: var(--step-2); line-height: 1.15; margin-bottom: 0.5rem; }
.step h3::before { content: counter(step); font-family: var(--font-text); font-size: 0.82rem; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
.step p { color: var(--text-dim); font-size: var(--step--1); max-width: 44ch; }
.process__stack { margin-top: clamp(2.6rem, 2rem + 2vw, 4rem); padding-top: 1.2rem; border-top: 1px solid var(--line); font-size: var(--step--1); color: var(--text-dim); max-width: 80ch; }
.process__stack b { color: var(--text); font-weight: 600; }

/* --- финал ---------------------------------------------------------------- */

.contact {
  padding-block: var(--section-loose);
  background: var(--band);
  color: var(--band-text);
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.contact::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(70% 90% at 85% 10%, rgba(216, 176, 90, 0.12), transparent 60%);
}
.contact ::selection { background: var(--brass); color: #16181c; }
.contact :focus-visible { outline-color: var(--brass); }
.contact .mark::after { background: var(--brass); }

.contact__grid { display: grid; gap: clamp(2.6rem, 1.6rem + 3vw, 4.5rem); }
.contact__title { font-size: clamp(3rem, 0.8rem + 9vw, 6rem); line-height: 0.95; letter-spacing: -0.028em; margin-bottom: 2.4rem; }
.contact__text { color: var(--band-dim); font-size: var(--step-1); line-height: 1.5; max-width: 34ch; margin-bottom: 2.2rem; }
.contact__actions { display: grid; gap: 1.1rem; justify-items: start; }
.contact__mail { font-size: var(--step--1); color: var(--band-dim); }
.contact__mail a { color: var(--band-text); box-shadow: inset 0 -1px 0 var(--band-line); transition: box-shadow 220ms var(--ease); }
.contact__mail a:hover { box-shadow: inset 0 -1px 0 var(--brass); }

.brief { align-self: end; }
.brief__title { font-size: 0.82rem; font-weight: 600; color: var(--brass); margin-bottom: 0.6rem; }
.brief ul { list-style: none; margin: 0; padding: 0; }
.brief li { padding-block: 0.85rem; border-bottom: 1px solid var(--band-line); color: var(--band-dim); }
.brief li:last-child { border-bottom: none; }

/* --- подвал --------------------------------------------------------------- */

.foot { padding-block: 2.2rem; background: var(--band); color: var(--band-dim); border-top: 1px solid var(--band-line); }
.foot__in { display: grid; gap: 0.6rem; font-size: 0.85rem; }
.foot a { display: inline-flex; align-items: center; min-height: 44px; color: var(--band-dim); transition: color 200ms var(--ease); }
.foot a:hover { color: var(--band-text); }
.foot__links { display: flex; flex-wrap: wrap; column-gap: 1.5rem; }

/* На тёмной теме подложка сливается с фоном, обводим её линией. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .stage { border-color: var(--line); }
}
:root[data-theme='dark'] .stage { border-color: var(--line); }

/* ==========================================================================
   Адаптив. Строго по возрастанию ширины.
   ========================================================================== */

@media (max-width: 559.98px) {
  .hero__cta .btn { width: 100%; }
}

@media (min-width: 560px) {
  .terms__grid { grid-template-columns: repeat(2, 1fr); }
  .foot__in { grid-template-columns: 1fr auto; align-items: center; }
}

@media (min-width: 768px) {
  .nav__cta-long { display: inline; }
  .nav__cta-short { display: none; }
  .services__list { grid-template-columns: repeat(2, 1fr); column-gap: clamp(1.5rem, 3vw, 3rem); }
  .cases__pair { grid-template-columns: repeat(2, 1fr); }
  .process__grid { grid-template-columns: repeat(2, 1fr); }
  .more__item { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) 11rem; align-items: baseline; gap: 1.5rem; }
  .more__item span { text-align: right; }
  .contact__grid { grid-template-columns: 1.35fr 0.65fr; align-items: end; }
}

@media (min-width: 1024px) {
  .nav__links { display: flex; }
  .hero__grid { grid-template-columns: repeat(12, 1fr); row-gap: clamp(2.4rem, 3vw, 3.6rem); }
  .hero__title { grid-column: 1 / -1; }
  .hero__side { grid-column: 1 / span 4; }
  .hero__figure { grid-column: 5 / -1; margin-right: calc(-1 * var(--gutter)); }
  .terms__grid { grid-template-columns: repeat(4, 1fr); }
  .services__grid { grid-template-columns: 4fr 8fr; }
  .services__head { position: sticky; top: 104px; align-self: start; }
  .services__list { grid-template-columns: 1fr; }
  .service { grid-template-columns: 1fr 1.25fr; column-gap: 2.5rem; align-items: baseline; }
  .work__head { grid-template-columns: 1fr auto; align-items: end; }
  .case--wide { grid-template-columns: 7.4fr 4.6fr; column-gap: clamp(2rem, 4vw, 4.5rem); }
  .case--flip .case__media { order: 2; }
  .case--flip { grid-template-columns: 4.6fr 7.4fr; }
  .process__grid { grid-template-columns: repeat(12, 1fr); gap: clamp(2rem, 1.2rem + 2.4vw, 3.2rem) 0; }
  .step { grid-column: span 7; }
  .step:nth-child(2) { grid-column: 3 / span 7; }
  .step:nth-child(3) { grid-column: 5 / span 7; }
  .step:nth-child(4) { grid-column: 6 / span 7; }
}

