/* Layout: шапка-навигация, колонка 1080px; карточки кейсов → страницы кейсов по схеме задача/роль/решение/результат */
:root {
  --bg: #f4f2f6; --surface: #ffffff; --ink: #241b2b; --muted: #6c6274; --line: #e2dde7;
  --accent: #a8285a; --accent-soft: #f6e3ea; --frame: #dcd6e2; --on-accent: #ffffff;
  --display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --body: "Onest", "Helvetica Neue", Arial, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #17121b; --surface: #211a27; --ink: #f1ecf4; --muted: #a99fb1; --line: #342b3b;
  --accent: #e3729c; --accent-soft: #3a2230; --frame: #2d2533; --on-accent: #17121b; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #17121b; --surface: #211a27; --ink: #f1ecf4; --muted: #a99fb1; --line: #342b3b;
  --accent: #e3729c; --accent-soft: #3a2230; --frame: #2d2533; --on-accent: #17121b; color-scheme: dark; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--body); }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; text-wrap: balance; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, .site-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.label { font: 500 12px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hint { font-size: 14px; color: var(--muted); }

body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.top-in { max-width: 1080px; margin: 0 auto; display: flex; align-items: center; gap: 24px; padding-block: 12px; }
.brand { font: 600 15px var(--display); color: var(--ink); text-decoration: none; white-space: nowrap; }
.top nav { display: flex; gap: 18px; margin-left: auto; flex-wrap: wrap; }
.top nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
.top nav a:hover { color: var(--ink); }
.btn { display: inline-block; background: var(--accent); color: var(--on-accent); text-decoration: none; font-weight: 600; border-radius: 10px; padding: 12px 20px; }
.btn-sm { padding: 8px 14px; font-size: 14px; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
@media (max-width: 720px) { .top nav { display: none; } .top-in { justify-content: space-between; } }

.wrap { max-width: 1080px; margin: 0 auto; padding-block: 48px 64px; display: grid; gap: 88px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.sec { display: grid; gap: 28px; }
.sec-h { display: grid; gap: 8px; }
.sec-h h2 { font-size: clamp(22px, 3vw, 30px); }
.h-page { font-size: clamp(28px, 4.4vw, 46px); line-height: 1.1; }
.back { font-size: 14px; text-decoration: none; }
.lead { font-size: clamp(17px, 2vw, 20px); max-width: 44em; }

.hero { display: grid; gap: 18px; padding-top: 16px; }
.hero h1 { font-size: clamp(36px, 6.4vw, 68px); line-height: 1.02; }
.hero-role { font: 600 clamp(18px, 2.4vw, 24px)/1.3 var(--body); color: var(--accent); }
.hero-btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.facts span { border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 14px; color: var(--muted); background: var(--surface); }
.facts b { color: var(--ink); font-weight: 600; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.card { display: grid; grid-template-rows: auto 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; color: inherit; text-decoration: none; transition: transform .2s, border-color .2s; }
.card:hover { transform: translateY(-2px); border-color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .card { transition: none; } .card:hover { transform: none; } }
.card-img { aspect-ratio: 16 / 10; overflow: hidden; background: var(--frame); max-width: 100%; }
.card-img img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.card-noimg { display: grid; place-items: center; }
.card-noimg span { font: 600 20px var(--display); color: var(--muted); }
.card-txt { padding: 18px 20px 20px; display: grid; gap: 8px; align-content: start; }
.card-txt h3 { font-size: 19px; line-height: 1.25; }
.card-txt p { color: var(--muted); font-size: 15px; }
.more { color: var(--accent); font-weight: 600; font-size: 14px; margin-top: 4px; }

.dirs { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.dir { display: grid; gap: 10px; align-content: start; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 14px; padding: 22px; color: inherit; text-decoration: none; }
.dir:hover { border-color: var(--accent); }
.dir h3 { font-size: 19px; }
.dir p { color: var(--muted); font-size: 15px; }
.dir ul { margin: 0; padding-left: 18px; display: grid; gap: 3px; font-size: 15px; }

.timeline { border-top: 1px solid var(--line); }
.tl { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.tl .when { font: 500 13px var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.tl h3 { font: 600 17px/1.3 var(--body); letter-spacing: 0; }
.tl p { color: var(--muted); font-size: 15px; }
.tl-own h3::after { content: " — свой проект"; color: var(--accent); font-weight: 500; }
@media (max-width: 640px) { .tl { grid-template-columns: minmax(0, 1fr); gap: 4px; } }

.about { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.about div { display: grid; gap: 6px; align-content: start; }
.about h3 { font-size: 17px; }
.about p { color: var(--muted); }
.about-meta { display: grid; gap: 8px; font-size: 15px; color: var(--muted); max-width: 52em; }
.about-meta b { color: var(--ink); }

.case-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cb { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; display: grid; gap: 8px; align-content: start; min-width: 0; }
.cb-wide { grid-column: 1 / -1; }
.cb-res { border-left: 3px solid var(--accent); }
.cb ul { margin: 0; padding-left: 18px; display: grid; gap: 5px; }
@media (max-width: 640px) { .case-grid { grid-template-columns: minmax(0, 1fr); } }
.materials { display: grid; gap: 16px; }
.h-sub { font-size: 18px; margin-top: 8px; }

.sites { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.site { margin: 0; border: 1px solid var(--frame); border-radius: 12px; overflow: hidden; background: var(--surface); min-width: 0; }
.site-bar { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--frame); }
.dots { display: flex; gap: 5px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); opacity: .45; }
.url { font: 500 12px var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-scroll { height: 620px; overflow-y: auto; overscroll-behavior: contain; }
.site-scroll img { display: block; width: 100%; height: auto; }
.site figcaption { padding: 10px 14px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
@media (max-width: 640px) { .site-scroll { height: 520px; } }

.strip { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 10px; scrollbar-width: thin; }
.strip button { flex: 0 0 auto; padding: 0; border: 0; background: none; cursor: zoom-in; scroll-snap-align: start; border-radius: 10px; overflow: hidden; }
.strip img { display: block; height: 320px; width: auto; max-width: none; border-radius: 10px; border: 1px solid var(--line); }
.strip.screens img { height: 280px; } .strip.square img { height: 260px; } .strip.tall img { height: 400px; }
@media (max-width: 640px) { .strip img { height: 260px; } .strip.tall img { height: 340px; } .strip.screens img { height: 200px; } }

.contact { background: var(--ink); color: var(--bg); border-radius: 20px; padding: clamp(24px, 5vw, 48px); display: grid; gap: 18px; }
.contact h2 { font-size: clamp(22px, 3vw, 30px); }
.contact p { opacity: .8; max-width: 38em; }
.c-row { display: flex; flex-wrap: wrap; gap: 12px; }
.c-item { display: flex; align-items: center; gap: 10px; background: color-mix(in srgb, var(--bg) 12%, transparent); border-radius: 12px; padding: 10px 10px 10px 16px; min-width: 0; }
.c-item span, .c-item a { font: 500 16px var(--mono); color: var(--bg); text-decoration: none; overflow-wrap: anywhere; }
.c-item a { padding-right: 6px; }
.c-item button { font: 500 13px var(--body); border: 0; border-radius: 8px; padding: 7px 12px; background: var(--accent); color: var(--on-accent); cursor: pointer; flex: 0 0 auto; }
.foot { max-width: 1080px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-left, 0px)) 40px; font-size: 14px; color: var(--muted); }
.foot a { color: var(--muted); }

dialog { border: 0; padding: 0; background: transparent; max-width: 94vw; max-height: 92vh; }
dialog::backdrop { background: rgba(15, 10, 18, .86); }
dialog img { display: block; max-width: 94vw; max-height: 86vh; border-radius: 10px; }
dialog button { margin: 10px auto 0; display: block; font: 500 14px var(--body); background: #fff; color: #241b2b; border: 0; border-radius: 8px; padding: 8px 18px; cursor: pointer; }
