/* ===== Шрифт =====
   Сайт не зависит от внешних сервисов: используется Golos Text, если он установлен,
   иначе системный шрифт (Segoe UI / Roboto / Arial).
   Чтобы хранить Golos Text вместе с сайтом, положите файлы в portfolio-assets/fonts/
   и раскомментируйте блок ниже (шрифт распространяется по лицензии SIL OFL). */
/*
@font-face { font-family: "Golos Text"; src: url("fonts/GolosText-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Golos Text"; src: url("fonts/GolosText-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Golos Text"; src: url("fonts/GolosText-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Golos Text"; src: url("fonts/GolosText-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
*/

/* ===== Tokens ===== */
:root {
  --paper: #F4F7F4;
  --surface: #FFFFFF;
  --sunk: #EBF2ED;
  --line: #D8E2DB;
  --ink: #17221C;
  --muted: #5B6B62;
  --moss: #1F6B47;
  --moss-strong: #17573A;
  --moss-tint: #E0EEE5;
  --amber: #8F5513;
  --amber-tint: #F5E9D9;
  --on-moss: #FFFFFF;
  --r-block: 20px;
  --r-item: 14px;
  --r-ctl: 12px;
  --header-h: 68px;
  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
:root[data-theme="dark"] {
  --paper: #0F1512;
  --surface: #161F1A;
  --sunk: #1C2721;
  --line: #2A3830;
  --ink: #E7EEE9;
  --muted: #9CACA3;
  --moss: #86D1A6;
  --moss-strong: #A7E2C0;
  --moss-tint: #1E3428;
  --amber: #E8B36E;
  --amber-tint: #33281A;
  --on-moss: #0F1512;
  color-scheme: dark;
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: inherit; }
html { scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: "Golos Text", "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
  font-size: 16.5px; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden;
  font-variant-numeric: tabular-nums;
}
img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
a { color: var(--moss); text-underline-offset: 3px; }
a:hover { color: var(--moss-strong); }
h1, h2, h3 { margin: 0; color: var(--ink); letter-spacing: -0.015em; }
h1 { font-size: clamp(32px, 4.4vw, 52px); line-height: 1.08; font-weight: 700; letter-spacing: -0.025em; }
h2 { font-size: clamp(24px, 2.6vw, 30px); line-height: 1.2; font-weight: 700; }
h3, .card-title { font-size: 19px; line-height: 1.3; font-weight: 600; }
p { margin: 0; }
ul { margin: 0; padding: 0; }
:focus-visible { outline: 3px solid var(--moss); outline-offset: 3px; border-radius: 6px; }
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  -webkit-backdrop-filter: saturate(140%) blur(12px); backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-in { display: flex; align-items: center; gap: 20px; min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 17px; white-space: nowrap; }
.brand:hover { color: var(--ink); }
.brand-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.brand-mark { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 9px; background: var(--moss); color: var(--on-moss); display: grid; place-items: center; font-size: 16px; }
.site-nav { flex: 1; display: flex; justify-content: center; gap: 2px; min-width: 0; }
.site-nav a {
  color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500;
  padding: 8px 13px; border-radius: 10px; white-space: nowrap; transition: background .15s, color .15s;
}
.site-nav a:hover { color: var(--ink); background: var(--sunk); }
.site-nav a[aria-current="page"] { color: var(--moss); background: var(--moss-tint); }
.site-nav .nav-sep { width: 1px; background: var(--line); margin: 8px 6px; flex: 0 0 1px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  appearance: none; width: 40px; height: 40px; border-radius: var(--r-ctl); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); cursor: pointer; display: grid; place-items: center;
}
.icon-btn svg { width: 18px; height: 18px; }

/* ===== Buttons, tags, status ===== */
.btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: var(--r-ctl); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; font-weight: 600;
  text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, color .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--moss); color: var(--ink); }
.btn-primary { background: var(--moss); border-color: var(--moss); color: var(--on-moss); }
.btn-primary:hover { background: var(--moss-strong); border-color: var(--moss-strong); color: var(--on-moss); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn-quiet { border-color: transparent; background: transparent; color: var(--moss); padding: 0 6px; }
.btn-quiet:hover { border-color: transparent; color: var(--moss-strong); text-decoration: underline; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.text-link { font-weight: 600; font-size: 15px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-size: 13.5px; font-weight: 500; padding: 6px 12px; border-radius: 8px; background: var(--sunk); border: 1px solid var(--line); color: var(--ink); }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; padding: 5px 11px; border-radius: 8px; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.done { background: var(--moss-tint); color: var(--moss); }
.status.wip { background: var(--amber-tint); color: var(--amber); }
.label { font-size: 14px; font-weight: 600; color: var(--moss); }

/* ===== Layout ===== */
main.wrap { padding-top: 28px; padding-bottom: 72px; }
.stack-lg { display: grid; gap: 20px; }
.block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-block); padding: 36px; min-width: 0; }
.block-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 24px; }
.block-head .lead { margin-top: 8px; max-width: 62ch; }
.lead { color: var(--muted); font-size: 17px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.page-head { padding: 12px 0 8px; max-width: 760px; }
.page-head h1 { margin: 8px 0 14px; }

/* ===== Hero ===== */
.hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.hero-main { display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 44px; }
.hero-main h1 { margin: 12px 0 18px; max-width: 18ch; font-size: clamp(32px, 4vw, 48px); }
.nowrap { white-space: nowrap; }
h1 { overflow-wrap: break-word; }
.hero-main .lead { max-width: 46ch; }
.hero-main .tags { margin-top: 22px; }
.hero-actions { display: grid; gap: 14px; }
.hero-side { background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-block); padding: 32px; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.hero-side h2 { font-size: 22px; }
.hero-side > .text-link { margin-top: auto; }
.hero-side.center { justify-content: center; }
.hero-photo { padding: 0; overflow: hidden; position: relative; min-height: 420px; }
.hero-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-photo figcaption { position: absolute; left: 16px; bottom: 16px; font-size: 13px; color: #fff; background: rgba(10,15,12,.62); padding: 6px 12px; border-radius: 8px; }

/* Flow (process diagram) */
.flow { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; position: relative; }
.flow::before { content: ""; position: absolute; left: 21px; top: 24px; bottom: 24px; width: 2px; background: var(--line); }
.flow li { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-item); padding: 14px 16px 14px 0; }
.flow .n { width: 44px; display: grid; place-items: center; position: relative; z-index: 1; }
.flow .n span { width: 30px; height: 30px; border-radius: 50%; background: var(--moss); color: var(--on-moss); font-size: 14px; font-weight: 700; display: grid; place-items: center; }
.flow b { display: block; font-size: 16px; }
.flow small { display: block; color: var(--muted); font-size: 14px; line-height: 1.45; }
.flow-wide { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.flow-wide::before { left: 24px; right: 24px; top: 29px; bottom: auto; width: auto; height: 2px; }
.flow-wide li { grid-template-columns: 1fr; align-items: start; padding: 0 16px 16px; gap: 8px; }
.flow-wide .n { width: auto; justify-content: start; padding-top: 14px; }

/* ===== Tiles (services, cases) ===== */
.tile { background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-item); padding: 22px; display: flex; flex-direction: column; gap: 8px; min-width: 0; color: inherit; text-decoration: none; }
a.tile:hover { border-color: var(--moss); color: inherit; }
.tile p { color: var(--muted); font-size: 15px; }
.tile .price { margin-top: auto; padding-top: 12px; }
.price { font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.price small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }

.service { display: flex; flex-direction: column; gap: 14px; }
.service ul { list-style: none; display: grid; gap: 8px; color: var(--muted); font-size: 15px; }
.service li { position: relative; padding-left: 18px; }
.service li::before { content: ""; position: absolute; left: 0; top: 10px; width: 7px; height: 7px; border-radius: 2px; background: var(--moss); opacity: .55; }
.service-foot { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); display: grid; gap: 14px; justify-items: start; }
.service-foot .btn-row { width: 100%; }
.note { font-size: 14px; color: var(--muted); margin-top: 16px; }
/* Secondary directions: lower visual weight than the main four */
.sec-wrap { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.sec-title { font-size: 16px; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
.sec-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 28px; }
.sec-item { display: flex; flex-direction: column; gap: 4px; padding: 6px 0; min-width: 0; }
.sec-top { display: grid; gap: 1px; margin-bottom: 4px; }
.sec-top b { font-size: 16px; }
.sec-price { font-size: 14px; color: var(--muted); }
.sec-item p { font-size: 14.5px; color: var(--muted); line-height: 1.5; }
.sec-item .text-link { font-size: 14.5px; margin-top: 2px; align-self: flex-start; }

/* Case cards */
.case-teasers { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; }
.case-teasers .side { display: grid; gap: 16px; }
.shot { border-radius: 10px; border: 1px solid var(--line); overflow: hidden; background: #0B110D; }
.shot img { width: 100%; }
.case { display: flex; flex-direction: column; gap: 16px; }
.case-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.case-kind { font-size: 14px; color: var(--muted); font-weight: 500; }
.case-wide { grid-column: 1 / -1; }
.case > h2 { font-size: clamp(22px, 2.2vw, 26px); }
.case-wide > h2 { font-size: clamp(22px, 2.5vw, 28px); max-width: 30ch; }
.case:not(.case-wide) .facts { grid-template-columns: 120px minmax(0, 1fr); }
.case-wide .facts { margin-top: 8px; }

/* Facts list */
.facts { display: grid; grid-template-columns: 200px minmax(0, 1fr); margin: 0; }
.facts dt { color: var(--muted); font-size: 14.5px; font-weight: 500; padding: 13px 16px 13px 0; border-top: 1px solid var(--line); }
.facts dd { margin: 0; padding: 13px 0; border-top: 1px solid var(--line); }
.facts dt:first-of-type, .facts dt:first-of-type + dd { border-top: 0; padding-top: 0; }
.facts-compact { grid-template-columns: 130px minmax(0, 1fr); }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { counter-increment: step; background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-item); padding: 20px; }
.steps li::before { content: counter(step, decimal-leading-zero); display: block; font-size: 14px; font-weight: 700; color: var(--moss); margin-bottom: 8px; }
.steps b { display: block; margin-bottom: 4px; }
.steps span { color: var(--muted); font-size: 15px; }

.bullets { list-style: none; display: grid; gap: 8px; }
.bullets li { position: relative; padding-left: 18px; }
.bullets li::before { content: ""; position: absolute; left: 0; top: 10px; width: 7px; height: 7px; border-radius: 2px; background: var(--moss); opacity: .55; }

/* ===== Panels (index tabs) ===== */
.panel[hidden] { display: none !important; }
.panel.is-entering { animation: panel-in .25s ease-out; }
@keyframes panel-in { from { opacity: 0; } to { opacity: 1; } }

/* ===== Gallery ===== */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.filter { appearance: none; font: inherit; font-size: 14.5px; font-weight: 500; min-height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; }
.filter:hover { color: var(--ink); }
.filter[aria-pressed="true"] { background: var(--moss-tint); border-color: transparent; color: var(--moss); }
.gallery { columns: 3 280px; column-gap: 14px; }
.ph { break-inside: avoid; margin: 0 0 16px; position: relative; }
.ph button { border-radius: var(--r-item); overflow: hidden; background: var(--sunk); }
.ph button { appearance: none; display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.ph img { width: 100%; transition: transform .4s ease; }
.ph button:hover img { transform: scale(1.03); }
.ph figcaption { padding: 8px 2px 0; font-size: 14px; color: var(--muted); }
.ph.hide { display: none; }
.lightbox { border: 0; padding: 0; max-width: none; max-height: none; width: 100vw; height: 100vh; margin: 0; background: rgba(8,12,10,.94); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: rgba(8,12,10,.8); }
.lightbox img { max-width: calc(100vw - 48px); max-height: calc(100vh - 120px); border-radius: 10px; }
.lightbox p { color: #E7EEE9; font-size: 15px; text-align: center; margin-top: 12px; }
.lb-close { position: fixed; top: calc(16px + env(safe-area-inset-top, 0px)); right: 16px; }

/* ===== Contact & form ===== */
.contact-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 20px; align-items: start; }
.contact-list { display: grid; gap: 10px; margin-top: 22px; }
.contact-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 12px; padding: 14px 16px; border-radius: var(--r-item); background: var(--sunk); border: 1px solid var(--line); }
.contact-row .k, .contact-row .v { grid-column: 1; }
.contact-row .btn { grid-column: 2; grid-row: 1 / span 2; }
.contact-row .k { font-size: 14px; color: var(--muted); }
.contact-row .v { font-weight: 600; overflow-wrap: anywhere; color: var(--ink); text-decoration: none; }
.contact-row .v:hover { color: var(--moss); }
.form { display: grid; gap: 16px; margin-top: 20px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; }
.field input, .field select, .field textarea {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-ctl); padding: 12px 14px; width: 100%; min-width: 0;
}
.field select { appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 52%, calc(100% - 14px) 52%; background-size: 6px 6px; background-repeat: no-repeat; }
.field textarea { min-height: 128px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--moss); outline-offset: 1px; border-color: transparent; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-note { font-size: 14px; color: var(--muted); }
details.privacy { margin-top: 20px; font-size: 14.5px; color: var(--muted); }
details.privacy summary { cursor: pointer; font-weight: 600; color: var(--ink); }
details.privacy p { margin-top: 10px; max-width: 80ch; }

/* ===== Footer ===== */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 14.5px; color: var(--muted); }
.footer-in { display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }

/* ===== English: mini lesson ===== */
.lesson { display: grid; gap: 10px; }
.lesson .ex { font-size: 17px; }
.lesson details summary { cursor: pointer; color: var(--moss); font-weight: 600; font-size: 15px; }
.lesson details p { margin-top: 8px; }

/* ===== Responsive ===== */
@media (max-width: 1080px) {
  .site-nav a { padding: 8px 10px; font-size: 14.5px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow-wide::before { display: none; }
}
@media (max-width: 960px) {
  :root { --header-h: 60px; }
  .header-in { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand actions" "nav nav"; gap: 0 12px; min-height: 0; }
  .site-header .header-in { padding-top: 12px; }
  .brand { grid-area: brand; min-width: 0; }
  .header-actions { grid-area: actions; }
  .site-nav { grid-area: nav; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; padding: 8px 24px 10px; margin: 0 -24px; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
  .site-nav::-webkit-scrollbar { display: none; }
  html { scroll-padding-top: 130px; }
  .hero { grid-template-columns: 1fr; }
  .hero-photo { min-height: 320px; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sec-list { grid-template-columns: 1fr; gap: 14px; }
  .case-teasers { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .site-nav { margin: 0 -16px; padding: 8px 16px 10px; }
  .site-nav a { padding: 7px 10px; font-size: 14.5px; }
  main.wrap { padding-top: 20px; padding-bottom: 56px; }
  .block { padding: 24px 20px; border-radius: 18px; }
  .hero-main { padding: 28px 22px; gap: 26px; }
  .hero-side { padding: 22px; }
  .grid-2, .grid-3, .grid-4, .flow-wide, .field-row { grid-template-columns: 1fr; }
  .facts, .case:not(.case-wide) .facts, .facts-compact { grid-template-columns: 1fr; }
  .facts dt { padding: 12px 0 2px; }
  .facts dd { border-top: 0; padding: 0 0 12px; }
  .facts dt:first-of-type { padding-top: 0; }
  .btn-row .btn { flex: 1 1 auto; }
  .header-actions .btn { min-height: 38px; padding: 0 12px; font-size: 14px; }
  .icon-btn { width: 38px; height: 38px; }
  .gallery { columns: 2 150px; column-gap: 10px; }
  .ph { margin-bottom: 10px; }
}
@media (max-width: 420px) {
  .nowrap { white-space: normal; }
  .brand { font-size: 15.5px; gap: 8px; }
  .header-actions { gap: 6px; }
  .header-actions .btn { padding: 0 10px; }
  .hero-main h1 { font-size: clamp(27px, 8.4vw, 34px); }
}
@media (max-width: 345px) {
  .brand-mark { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer, .filters, .lightbox { display: none !important; }
  .panel[hidden] { display: block !important; }
  .block { break-inside: avoid; }
}
