@font-face { font-family: Plex; font-weight: 300 600; font-display: swap; src: url(fonts/sans-cyr.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116 }
@font-face { font-family: Plex; font-weight: 300 600; font-display: swap; src: url(fonts/sans-lat.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+2212, U+2215, U+FEFF, U+FFFD }
@font-face { font-family: Plex; font-weight: 300 600; font-display: swap; src: url(fonts/sans-sym.woff2) format('woff2'); unicode-range: U+2190-2193, U+2197, U+2248, U+2264-2265, U+2300 }
@font-face { font-family: 'Plex Mono'; font-weight: 400; font-display: swap; src: url(fonts/mono-cyr.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116 }
@font-face { font-family: 'Plex Mono'; font-weight: 400; font-display: swap; src: url(fonts/mono-lat.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+2212, U+2215, U+FEFF, U+FFFD }

:root {
  --bg: #020B13;
  --panel: #05111C;
  --glow: #0B1D2E;
  --line: rgba(160, 170, 179, .14);
  --line-2: rgba(160, 170, 179, .32);
  --text: #A0AAB3;
  --dim: #76808A;
  --head: #FFFFFF;
  --accent: #0066FF;
  --sans: Plex, 'Segoe UI', Roboto, system-ui, sans-serif;
  --mono: 'Plex Mono', ui-monospace, Consolas, monospace;
  --wrap: 1280px;
  --pad: clamp(16px, 4vw, 56px);
  --sec: clamp(72px, 10vw, 144px);
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box }
html { background: var(--bg); color: var(--text); font: 400 16px/1.6 var(--sans); -webkit-text-size-adjust: 100%; scroll-behavior: smooth }
body { margin: 0; overflow-x: clip }
body:has(dialog[open]) { overflow: hidden }
body.admin { padding-bottom: 96px }
h1, h2, h3, h4 { margin: 0; color: var(--head); font-weight: 500; line-height: 1.1; letter-spacing: -.02em; text-wrap: balance }
p { margin: 0 }
a { color: inherit }
img, video { display: block; max-width: 100% }
button { font: inherit; color: inherit; background: none; border: 0; border-radius: 0; padding: 0; cursor: pointer }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px }
::selection { background: var(--accent); color: #fff }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto }
  *, *::before, *::after { transition: none !important; animation: none !important }
}

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--pad) }
.sec { padding-block: var(--sec) }
.h2 { font-size: clamp(30px, 3.6vw, 50px); letter-spacing: -.035em; line-height: 1.05 }
.sub { margin-top: 20px; max-width: 54ch; font-size: clamp(16px, 1.3vw, 18px); line-height: 1.55 }
.center { text-align: center; margin-inline: auto; justify-content: center }

/* Разделитель как на чертеже: штрих и метка совмещения по центру */
.sep { position: relative; height: 1px; background: repeating-linear-gradient(90deg, var(--line-2) 0 4px, transparent 4px 9px) }
.sep::after {
  content: ''; position: absolute; left: 50%; top: 0; width: 13px; height: 13px; transform: translate(-50%, -50%);
  border: 1px solid var(--line-2); border-radius: 50%;
  background: linear-gradient(var(--line-2), var(--line-2)) center / 1px 7px no-repeat, linear-gradient(var(--line-2), var(--line-2)) center / 7px 1px no-repeat, var(--bg);
}

.top { display: flex; justify-content: space-between; align-items: center; gap: 24px; height: 76px; font-size: 14px }
.brand { color: var(--head); text-decoration: none; font-weight: 500; white-space: nowrap }
.top nav { display: flex; gap: clamp(16px, 3vw, 40px) }
.top nav a { text-decoration: none; transition: color .2s }
.top nav a:hover { color: var(--head) }

/* Первый экран */
.hero { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 80px); align-items: center; padding-block: clamp(16px, 3vw, 40px) var(--sec) }
.hero.solo { grid-template-columns: minmax(0, 1fr) }
.hero h1 { font-size: clamp(42px, 6.2vw, 92px); letter-spacing: -.045em; line-height: .96 }
.lead { margin-top: clamp(20px, 2.4vw, 32px); max-width: 36ch; font-size: clamp(18px, 1.5vw, 21px); line-height: 1.5 }
.theses { list-style: none; margin: clamp(32px, 4vw, 48px) 0 0; padding: 0; max-width: 560px; font-size: 15px }
.theses li { position: relative; padding: 12px 0 12px 30px; border-top: 1px solid var(--line) }
.theses li:last-child { border-bottom: 1px solid var(--line) }
.theses li::before { content: ''; position: absolute; left: 0; top: 24px; width: 14px; height: 1px; background: var(--accent) }
.facts { display: flex; flex-wrap: wrap; gap: 24px clamp(32px, 4vw, 64px); margin-top: clamp(32px, 4vw, 48px) }
.facts b { display: block; color: var(--head); font-size: clamp(30px, 3vw, 44px); font-weight: 400; line-height: 1; letter-spacing: -.035em; font-variant-numeric: tabular-nums; white-space: nowrap }
.facts span { display: block; margin-top: 10px; max-width: 20ch; font-size: 13px; line-height: 1.4; color: var(--dim) }
.hero-photo { margin: 0; width: 100%; aspect-ratio: 2 / 3; max-height: 86vh; justify-self: end }
/* фон фото растворяется в фоне страницы: lighten убирает тёмное, маска гасит края */
.hero-photo img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: lighten; -webkit-mask-image: radial-gradient(farthest-side at 50% 42%, #000 60%, transparent); mask-image: radial-gradient(farthest-side at 50% 42%, #000 60%, transparent) }
.hero-photo.empty { display: grid; place-items: center; border: 1px dashed var(--line-2) }

/* Услуги */
.svc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 56px 32px; margin-top: clamp(48px, 6vw, 88px) }
.svc { display: flex; flex-direction: column; align-items: center; text-align: center }
.ico { width: 44px; height: 44px; fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round }
.svc h3 { margin: 24px 0 10px; font-size: 18px; letter-spacing: -.01em }
.svc p { max-width: 28ch; font-size: 14px; line-height: 1.55 }

/* Проекты */
.works { padding-top: var(--sec) }
.works-head { padding-bottom: clamp(40px, 5vw, 72px) }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 28px 0 0 -10px }
.tag { padding: 8px 10px; border: 1px solid transparent; font: 13px/1 var(--mono); transition: color .2s, border-color .2s }
.tag sup { margin-left: 4px; font-size: 10px; color: var(--dim); vertical-align: 4px }
.tag:hover { color: var(--head) }
.tag.on { color: var(--head); border-color: var(--accent) }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: clamp(36px, 4vw, 56px) clamp(16px, 2vw, 28px); padding-bottom: var(--sec) }

.co-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 112px); align-items: center; padding-block: clamp(56px, 7vw, 112px) clamp(40px, 5vw, 72px) }
.co-head.flip .co-text { order: 2 }
.co-name { font-size: clamp(26px, 2.8vw, 40px); letter-spacing: -.03em }
.co-name::after { content: ''; display: block; width: 56px; height: 1px; margin-top: 24px; background: var(--accent) }
.co-meta { display: flex; flex-wrap: wrap; gap: 12px 40px; margin: 24px 0 0 }
.co-meta dt { font: 11px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim) }
.co-meta dd { margin: 4px 0 0; color: var(--head); font-size: 15px }
.co-text .rich { margin-top: 24px }
/* Логотип в рамке видоискателя: только уголки */
.co-logo {
  --c: var(--line-2); --s: 18px;
  position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9;
  background:
    linear-gradient(var(--c), var(--c)) 0 0 / var(--s) 1px, linear-gradient(var(--c), var(--c)) 0 0 / 1px var(--s),
    linear-gradient(var(--c), var(--c)) 100% 0 / var(--s) 1px, linear-gradient(var(--c), var(--c)) 100% 0 / 1px var(--s),
    linear-gradient(var(--c), var(--c)) 0 100% / var(--s) 1px, linear-gradient(var(--c), var(--c)) 0 100% / 1px var(--s),
    linear-gradient(var(--c), var(--c)) 100% 100% / var(--s) 1px, linear-gradient(var(--c), var(--c)) 100% 100% / 1px var(--s);
  background-repeat: no-repeat;
}
.co-logo img { position: absolute; inset: 20%; width: 60%; height: 60%; object-fit: contain }
.wordmark { padding-inline: 8%; color: var(--head); font-size: clamp(28px, 3.6vw, 56px); font-weight: 600; line-height: 1; letter-spacing: -.02em; text-transform: uppercase; text-align: center }

.rich { max-width: 62ch; font-size: 15px }
.rich p + p, .rich p + ul, .rich ul + p { margin-top: 12px }
.rich h4 { margin: 24px 0 8px; color: var(--head); font: 400 12px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase }
.rich h4:first-child { margin-top: 0 }
.rich ul { list-style: none; margin: 0; padding: 0 }
.rich li { position: relative; margin: 5px 0; padding-left: 22px }
.rich li::before { content: ''; position: absolute; left: 0; top: .8em; width: 10px; height: 1px; background: var(--accent) }

.car { padding-bottom: clamp(56px, 7vw, 112px) }
.car-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px }
.car-n, .card-co, .pm-co { font: 11px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim) }
.car-nav, .pm-nav { display: flex; gap: 8px }
.car.fits .car-nav, .car.fits .car-line { visibility: hidden }
.arr { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border: 1px solid var(--line-2); transition: border-color .2s, opacity .2s }
.arr svg { width: 18px; height: 18px; fill: none; stroke: var(--head); stroke-width: 1.5 }
.arr:hover:not(:disabled) { border-color: var(--accent) }
.arr:disabled { opacity: .25; cursor: default }
.car-track {
  --cw: clamp(260px, 27vw, 360px);
  display: flex; gap: clamp(16px, 2vw, 28px); overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none;
  padding-inline: max(var(--pad), calc((100% - var(--wrap)) / 2 + var(--pad)));
  scroll-padding-inline: max(var(--pad), calc((100% - var(--wrap)) / 2 + var(--pad)));
}
.car-track::-webkit-scrollbar { display: none }
.car-track .card { flex: 0 0 var(--cw); scroll-snap-align: start }
.car-line { height: 1px; margin-top: 28px; background: var(--line); overflow: hidden }
.car-line i { display: block; height: 100%; background: var(--text); transition: transform .1s linear }

.card-hit { display: block; width: 100%; text-align: left }
.card-img { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; overflow: hidden; background: radial-gradient(70% 65% at 50% 45%, var(--glow), var(--panel) 75%) }
.card-img img, .card-img video { position: absolute; inset: 0; width: 100%; height: 100%; padding: 9%; object-fit: contain; transition: transform .7s var(--ease) }
.card.fill .card-img img, .card.fill .card-img video { padding: 0; object-fit: cover }
.card-img::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease) }
.card-hit:hover .card-img::after, .card-hit:focus-visible .card-img::after { transform: scaleX(1) }
.card-hit:hover .card-img img, .card-hit:hover .card-img video { transform: scale(1.04) }
.card-cap { display: block; padding-top: 16px }
.card-co { display: block; margin-bottom: 6px }
.card-t { display: block; color: var(--head); font-size: 18px; font-weight: 500; line-height: 1.25; letter-spacing: -.01em }
.card-tags { display: block; margin-top: 8px; font: 12px/1.45 var(--mono); color: var(--dim) }
.noimg { font: 12px var(--mono); color: var(--dim) }

/* Партнёры */
.logos { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 32px clamp(32px, 5vw, 80px); margin-top: clamp(48px, 6vw, 80px) }
.logo { display: grid; place-items: center; height: 72px; min-width: 72px; opacity: .55; filter: grayscale(1); transition: opacity .3s, filter .3s }
button.logo:hover, button.logo:focus-visible { opacity: 1; filter: none }
.logo img { max-width: 180px; max-height: 64px; object-fit: contain }
.logo .wordmark { padding: 0; font-size: clamp(18px, 1.8vw, 24px); letter-spacing: .01em }

/* Контакты */
.contacts { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px clamp(32px, 6vw, 112px) }
.ct-phone { display: inline-block; color: var(--head); text-decoration: none; font-size: clamp(32px, 4.4vw, 64px); line-height: 1; letter-spacing: -.04em; white-space: nowrap; font-variant-numeric: tabular-nums; transition: color .2s }
.ct-phone:hover { color: var(--accent) }
.ct-mail { display: table; margin-top: 20px; color: var(--head); text-decoration: none; font-size: clamp(18px, 1.8vw, 24px); border-bottom: 1px solid var(--line-2); transition: border-color .2s }
.ct-mail:hover { border-color: var(--accent) }
.ct-links { list-style: none; margin: clamp(40px, 5vw, 64px) 0 0; padding: 0 }
.ct-links a { display: grid; grid-template-columns: minmax(96px, 180px) minmax(0, 1fr) 20px; gap: 16px; align-items: center; padding: 18px 0; border-top: 1px solid var(--line); text-decoration: none }
.ct-links li:last-child a { border-bottom: 1px solid var(--line) }
.ct-t { color: var(--head); font-size: 17px }
.ct-u { font: 13px/1.4 var(--mono); color: var(--dim); overflow-wrap: anywhere }
.ct-links svg { width: 18px; height: 18px; fill: none; stroke: var(--text); stroke-width: 1.5; transition: transform .25s var(--ease), stroke .2s }
.ct-links a:hover svg { transform: translate(3px, -3px); stroke: var(--accent) }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding: 28px 0 40px; border-top: 1px solid var(--line); font: 12px/1.5 var(--mono); color: var(--dim) }

/* Окно проекта: треть под медиа, две трети под описание */
.pm { width: min(1320px, calc(100vw - 48px)); height: min(820px, calc(100dvh - 48px)); max-width: none; max-height: none; padding: 0; overflow: hidden; border: 1px solid var(--line-2); background: var(--bg); color: var(--text) }
.pm[open] { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); animation: pm-in .3s var(--ease) }
.pm::backdrop { background: rgba(1, 5, 9, .86) }
@keyframes pm-in { from { opacity: 0; transform: translateY(12px) } }
.pm-media { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: radial-gradient(80% 60% at 50% 45%, var(--glow), var(--panel) 75%) }
.pm-main { position: relative; flex: 1; min-height: 0 }
.pm-main img, .pm-main video { position: absolute; inset: 24px; width: calc(100% - 48px); height: calc(100% - 48px); object-fit: contain }
.pm-thumbs { display: flex; gap: 8px; padding: 12px; overflow-x: auto; border-top: 1px solid var(--line); scrollbar-width: thin }
.pm-thumbs button { flex: none; width: 64px; height: 48px; padding: 4px; border: 1px solid var(--line); background: var(--bg); opacity: .55; transition: opacity .2s, border-color .2s }
.pm-thumbs button:hover { opacity: .85 }
.pm-thumbs button.on { opacity: 1; border-color: var(--accent) }
.pm-thumbs img, .pm-thumbs video { width: 100%; height: 100%; object-fit: contain }
.pm-body:focus { outline: none }
.pm-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 clamp(24px, 4vw, 64px) 56px }
.pm-bar { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: clamp(28px, 4vw, 48px); padding: 20px 0; border-bottom: 1px solid var(--line); background: var(--bg) }
.pm h2 { font-size: clamp(30px, 3.4vw, 52px); letter-spacing: -.035em; line-height: 1.02 }
.pm .lead { max-width: 52ch }
.pm .facts { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--line) }
.pm .rich { margin-top: 36px; font-size: 16px }
.pm-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 40px }
.pm-tags .tag { border-color: var(--line-2) }
.pm-tags .tag:hover { border-color: var(--accent) }

/* Правка (видна только после входа по ссылке) */
.adm { display: inline-block; padding: 7px 10px; border: 1px dashed rgba(0, 102, 255, .65); background: rgba(0, 102, 255, .07); color: #79A9FF; font: 12px/1 var(--mono); text-decoration: none; white-space: nowrap; cursor: pointer }
.adm:hover { background: rgba(0, 102, 255, .2); color: #fff }
.adm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 16px }
.adm-tail { padding-bottom: var(--sec) }
.adm-note, .adm-msg { font: 12px/1.4 var(--mono); color: var(--dim) }
.adm-msg:not(:empty) { color: #FF8A8A; padding-inline: 6px }
.admbar { position: fixed; z-index: 10; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; max-width: calc(100vw - 32px); padding: 8px; border: 1px solid var(--line-2); background: var(--panel) }
.admbar b { padding: 0 8px; color: var(--head); font: 400 12px var(--mono) }

.ed { width: min(680px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--line-2); background: var(--panel); color: var(--text) }
.ed::backdrop { background: rgba(1, 5, 9, .7) }
.ed-form { display: grid; gap: 18px; padding: 24px 28px 28px }
.ed-head { display: flex; justify-content: space-between; align-items: center; gap: 16px }
.ed-head h3 { font-size: 22px }
.f { display: grid; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0 }
.f > label, .f legend { padding: 0; margin-bottom: 6px; color: var(--head); font: 12px var(--mono) }
.f > label { margin: 0 }
.f small { color: var(--dim); font-size: 12px; line-height: 1.4 }
.f input:not([type]), .f textarea, .f select { width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 0; background: var(--bg); color: var(--head); font: 15px/1.5 var(--sans) }
.f textarea { resize: vertical; min-height: 90px }
.f input:not([type]):focus, .f textarea:focus, .f select:focus { outline: none; border-color: var(--accent) }
.f-check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer }
.f-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent) }
.up-list { display: flex; flex-wrap: wrap; gap: 8px }
.up-list:empty { display: none }
.up-it { position: relative; width: 104px; height: 78px; border: 1px solid var(--line); background: var(--bg) }
.up-it img, .up-it video { width: 100%; height: 100%; object-fit: contain }
.up-it button { position: absolute; top: 3px; right: 3px; display: grid; place-items: center; width: 22px; height: 22px; background: rgba(2, 11, 19, .85); color: var(--head); font-size: 13px }
.up-it button svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2 }
.up-it button[data-first] { right: auto; left: 3px }
.up-btn { position: relative; justify-self: start; margin-top: 2px }
.up-btn input { position: absolute; width: 1px; height: 1px; opacity: 0 }
.up-btn:focus-within { outline: 1px solid var(--accent); outline-offset: 2px }
.busy .up-btn::after { content: ' · загрузка…' }
.icons { display: flex; flex-wrap: wrap; gap: 6px }
.icons label { position: relative; cursor: pointer }
.icons input { position: absolute; opacity: 0 }
.icons .ico { width: 52px; height: 52px; padding: 8px; border: 1px solid var(--line); stroke: var(--text) }
.icons input:checked + .ico { border-color: var(--accent); stroke: var(--accent) }
.icons input:focus-visible + .ico { outline: 1px solid var(--accent); outline-offset: 2px }
.ed-err { color: #FF8A8A; font-size: 14px }
.ed-err:empty { display: none }
.ed-act { display: flex; align-items: center; gap: 8px }
.ed-act .sp { flex: 1 }
.ed-save { padding: 10px 20px; background: var(--accent); color: #fff; font-weight: 500; font-size: 14px }
.ed-save:disabled { opacity: .5; cursor: default }
.ed-del { border-color: rgba(255, 110, 110, .6); background: rgba(255, 110, 110, .06); color: #FF8A8A }

@media (max-width: 900px) {
  .hero, .co-head, .contacts { grid-template-columns: minmax(0, 1fr) }
  .hero-photo { order: -1; aspect-ratio: 4 / 5; max-height: 72vh; justify-self: stretch }
  .co-head .co-logo { order: -1; aspect-ratio: auto; height: clamp(140px, 36vw, 220px) }
  .co-head.flip .co-text { order: 0 }
  .pm { width: 100vw; height: 100dvh; border: 0 }
  .pm[open] { display: block; overflow-y: auto }
  .pm-media { height: 58vh; margin-top: 65px; border-right: 0; border-bottom: 1px solid var(--line) }
  .pm-body { overflow: visible; padding: 28px 16px 48px }
  .pm-bar { position: fixed; top: 0; left: 0; right: 0; height: 65px; margin: 0; padding: 10px 16px }
}
@media (max-width: 640px) {
  .top nav a:not(:last-child) { display: none }
  .car-track { --cw: 78vw }
  .ct-links a { grid-template-columns: minmax(0, 1fr) 20px }
  .ct-u { grid-row: 2; grid-column: 1 / -1; margin-top: -10px }
  .ed-form { padding: 20px 16px }
}
