/* =====================================================================
   ДОТОШНО. Студия продуманных решений
   Основные стили сайта.

   Как устроен файл:
   1. Цвета, шрифты и размеры (переменные). Поменяли здесь, поменялось везде.
   2. Базовые правила для текста.
   3. Шапка и меню.
   4. Общие блоки: кнопки, секции, иллюстрации.
   5. Главная страница.
   6. Страницы проектов.
   7. Страница «О студии».
   8. Подвал, галерея, увеличение картинок.
   9. Адаптация под телефоны и планшеты.
   ===================================================================== */

/* ---------- 1. Переменные ---------- */
@font-face {
  font-family: "Cormorant";
  src: url("../fonts/cormorant.woff") format("woff");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant";
  src: url("../fonts/cormorant-italic.woff") format("woff");
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Golos Text";
  src: url("../fonts/golos-text.woff") format("woff");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Фирменные цвета */
  --paper: #F8F7F2;      /* молочно-кремовый фон */
  --ink: #202020;        /* почти чёрная тушь */
  --accent: #B94724;     /* терракотовый, только для точек и линий */
  --sea: #B1C0C3;        /* приглушённый серо-голубой */
  --graphite: #6A6966;   /* мягкий графит, второстепенный текст */
  --line: rgba(32, 32, 32, 0.16);
  --paper-deep: #EFEDE5; /* чуть темнее фона, для подложек */

  /* Шрифты */
  --serif: "Cormorant", "Times New Roman", Georgia, serif;
  --sans: "Golos Text", "Segoe UI", Roboto, Arial, sans-serif;

  /* Размеры текста (сами подстраиваются под ширину экрана) */
  --fs-small: 0.875rem;
  --fs-body: 1.0625rem;
  --fs-lead: clamp(1.125rem, 1.02rem + 0.45vw, 1.3125rem);
  --fs-h3: clamp(1.5rem, 1.3rem + 0.8vw, 1.875rem);
  --fs-h2: clamp(2.125rem, 1.6rem + 2.2vw, 3.375rem);
  --fs-h1: clamp(2.625rem, 1.7rem + 4.2vw, 5.25rem);

  /* Поля и отступы */
  --gutter: clamp(16px, 4vw, 56px);
  --maxw: 1320px;
  --section: clamp(72px, 9vw, 152px);
  --radius: 3px;
}

/* ---------- 2. Базовые правила ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.62;
  font-weight: 400;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
  overflow-wrap: break-word;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: 600; line-height: 1.15; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { text-decoration-color: var(--accent); }

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

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

.wrap {
  width: 100%;
  max-width: calc(var(--maxw) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.lead { font-size: var(--fs-lead); line-height: 1.55; max-width: 36em; }
.muted { color: var(--graphite); }
.small { font-size: var(--fs-small); line-height: 1.5; }
.dot { color: var(--accent); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 10px 16px; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- 3. Шапка и меню ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(248, 247, 242, 0.96);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.header-in {
  display: flex; align-items: center; gap: 24px;
  min-height: 72px;
}

.logo {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: 0.09em;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}
.logo .dot { margin-left: -0.06em; }

.nav { margin-left: auto; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: clamp(16px, 2.2vw, 36px); }
.nav a {
  text-decoration: none; font-size: 0.96rem; padding: 6px 0; position: relative;
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform .25s;
}
.nav a:hover::after { transform: scaleX(1); }
.nav a[aria-current="page"]::before {
  content: ""; position: absolute; left: 50%; top: -8px; width: 5px; height: 5px;
  margin-left: -2.5px; border-radius: 50%; background: var(--accent);
}

.menu-toggle {
  display: none;
  margin-left: auto;
  font: inherit; font-size: 0.95rem;
  background: none; border: 1px solid var(--ink); color: var(--ink);
  min-height: 44px; padding: 0 16px; border-radius: var(--radius); cursor: pointer;
}
.menu-toggle[aria-expanded="true"] .bars { display: none; }
.menu-toggle .bars { display: inline-block; width: 16px; height: 9px; margin-right: 10px; vertical-align: 1px;
  border-top: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; }

.mobile-menu {
  position: fixed; inset: 72px 0 0 0; z-index: 49;
  background: var(--paper);
  padding: 24px var(--gutter) 40px;
  overflow-y: auto;
  display: flex; flex-direction: column;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu ul { list-style: none; margin: 0 0 32px; padding: 0; }
.mobile-menu li { border-bottom: 1px solid var(--line); }
.mobile-menu li a {
  display: block; padding: 14px 0;
  font-family: var(--serif); font-size: 2rem; font-weight: 500; text-decoration: none; line-height: 1.1;
}
.mobile-menu .mobile-mail { margin-top: auto; }
.mobile-menu .mobile-mail p { color: var(--graphite); font-size: var(--fs-small); }
body.menu-open { overflow: hidden; }

/* ---------- 4. Общие блоки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 26px;
  font: inherit; font-size: 1rem; font-weight: 500; line-height: 1.2;
  text-decoration: none; text-align: center;
  border-radius: var(--radius);
  border: 1px solid var(--ink);
  background: var(--ink); color: var(--paper);
  cursor: pointer;
  transition: background-color .2s, color .2s;
}
.btn:hover { background: #000; }
.btn::after {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  flex: none;
}
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-ghost::after { display: none; }
.btn-small { min-height: 42px; padding: 0 18px; font-size: 0.94rem; }

.link-more {
  display: inline-block; font-weight: 500; text-decoration: underline;
  text-decoration-color: var(--accent); text-decoration-thickness: 1.5px;
}
.link-more:hover { text-decoration-color: var(--ink); }

.section { padding-block: var(--section); }
.section-tight { padding-block: calc(var(--section) * 0.6); }

.section-head { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 32px; margin-bottom: clamp(40px, 5vw, 72px); }
.section-head h2 { grid-column: 1 / 7; }
.section-head .section-intro { grid-column: 7 / 12; align-self: end; color: var(--graphite); font-size: var(--fs-lead); line-height: 1.5; }

.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* Иллюстрации стоят прямо на «бумаге» страницы, без рамок */
.illus { display: block; margin: 0; }
.illus img { width: 100%; }
/* Края иллюстраций мягко уходят в бумагу, без жёсткой рамки */
.illus picture, .contact-image picture {
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 7%, #000 93%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 7%, #000 93%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 0, #000 7%, #000 93%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 7%, #000 93%, transparent 100%);
  mask-composite: intersect;
}
.book-grid .illus picture { -webkit-mask-image: none; mask-image: none; }
.illus figcaption { margin-top: 12px; font-size: var(--fs-small); color: var(--graphite); }

/* ---------- 5. Главная страница ---------- */
.hero { padding-top: clamp(20px, 4vw, 56px); padding-bottom: clamp(40px, 6vw, 88px); }
.hero-grid {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 32px; align-items: center;
}
.hero-text { grid-column: 1 / 7; padding-top: clamp(8px, 3vw, 40px); }
.hero-kicker {
  font-family: var(--serif); font-style: italic; font-size: 1.375rem; color: var(--graphite);
  margin-bottom: 18px;
}
.hero h1 { margin-bottom: 28px; max-width: 9.5em; }
.hero .lead { margin-bottom: 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 40px; }
.hero-image { grid-column: 7 / 13; margin-right: calc(var(--gutter) * -1); }
.hero-image img { width: 100%; max-height: 82vh; object-fit: contain; object-position: right bottom; }
/* Край рисунка мягко растворяется в бумаге, как размытая тушь */
.hero-image picture {
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 20%), linear-gradient(to top, transparent 0, #000 12%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 0, #000 20%), linear-gradient(to top, transparent 0, #000 12%);
  mask-composite: intersect;
}

.hero-index { border-top: 1px solid var(--line); padding-top: 18px; max-width: 34em; }
.hero-index p { font-size: var(--fs-small); color: var(--graphite); margin-bottom: 10px; }
.hero-index ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 28px; }
.hero-index li { break-inside: avoid; padding: 3px 0; }
.hero-index a { text-decoration: none; border-bottom: 1px solid var(--line); }
.hero-index a:hover { border-bottom-color: var(--accent); }

/* Первое появление: только заголовок и яблоня, один раз */
@media (prefers-reduced-motion: no-preference) {
  .hero-text > * { animation: rise .9s cubic-bezier(.2,.7,.2,1) both; }
  .hero-text > *:nth-child(2) { animation-delay: .08s; }
  .hero-text > *:nth-child(3) { animation-delay: .16s; }
  .hero-text > *:nth-child(4) { animation-delay: .24s; }
  .hero-text > *:nth-child(5) { animation-delay: .32s; }
  .hero-image { animation: appear 1.4s ease .2s both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }

/* Услуги: разворот с шестью направлениями, без карточек */
.services { border-top: 1px solid var(--line); }
.service-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 clamp(28px, 4vw, 64px);
}
.service {
  padding: 28px 0 40px;
  border-top: 1px solid var(--ink);
}
.service:nth-child(n+4) { margin-top: 8px; }
.service h3 { margin-bottom: 14px; }
.service > p { color: var(--ink); }
.service .eg { margin-top: 16px; font-size: var(--fs-small); color: var(--graphite); }
.service .eg span { display: block; font-family: var(--serif); font-style: italic; font-size: 1.125rem; color: var(--ink); margin-bottom: 4px; }
.service .eg ul { margin: 0; padding: 0; list-style: none; }
.service .eg li { padding: 3px 0 3px 16px; position: relative; }
.service .eg li::before { content: ""; position: absolute; left: 0; top: 0.85em; width: 7px; height: 1px; background: var(--graphite); }
.service-note {
  margin-top: 24px; display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 32px;
}
.service-note p { grid-column: 1 / 8; color: var(--graphite); font-size: var(--fs-small); }

/* Проекты на главной: у каждого своя композиция */
.projects-home { padding-top: var(--section); }
.project-teaser { margin-bottom: clamp(88px, 11vw, 168px); }
.project-teaser:last-of-type { margin-bottom: clamp(56px, 6vw, 88px); }
.project-teaser .meta { color: var(--graphite); font-size: var(--fs-small); margin-bottom: 14px; }
.project-teaser h3 { font-size: clamp(2rem, 1.5rem + 2vw, 3.25rem); font-weight: 500; margin-bottom: 20px; }
.project-teaser h3 a { text-decoration: none; }
.project-teaser h3 a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.did { list-style: none; margin: 20px 0 26px; padding: 0; }
.did li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.did li:first-child { border-top: 1px solid var(--line); }

/* «Нам Светло»: панорама во всю ширину, текст под ней */
.pt-light .illus { margin-inline: calc(var(--gutter) * -1); }
.pt-light .illus img { width: 100%; }
.pt-light-body { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 32px; margin-top: clamp(24px, 3vw, 40px); }
.pt-light-body .col-a { grid-column: 1 / 6; }
.pt-light-body .col-b { grid-column: 7 / 12; }
.concept-name { font-family: var(--serif); font-style: italic; font-size: clamp(1.5rem, 1.2rem + 1vw, 2.125rem); line-height: 1.2; margin-top: 4px; }

/* «Морские практики»: текст слева, верфь справа до края */
.pt-sea { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 32px; align-items: center; }
.pt-sea .text { grid-column: 1 / 6; }
.pt-sea .illus { grid-column: 6 / 13; margin-right: calc(var(--gutter) * -1); }
.three-words { display: flex; flex-wrap: wrap; gap: 6px 22px; font-family: var(--serif); font-size: 1.5rem; font-style: italic; margin: 6px 0 22px; }

/* КИТ: Таймыр слева, справа путь клиента по каталогу */
.pt-kit { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 32px; align-items: start; }
.pt-kit .illus { grid-column: 1 / 8; margin-left: calc(var(--gutter) * -1); }
.pt-kit .text { grid-column: 8 / 13; padding-top: 12px; }

/* Маршрут: линия с точками, как на иллюстрациях */
.path-list { list-style: none; margin: 22px 0 26px; padding: 0; position: relative; }
.path-list::before {
  content: ""; position: absolute; left: 6px; top: 12px; bottom: 12px; width: 1.5px; background: var(--accent);
}
.path-list li { position: relative; padding: 0 0 18px 34px; }
.path-list li:last-child { padding-bottom: 0; }
.path-list li::before {
  content: ""; position: absolute; left: 0; top: 0.42em; width: 13px; height: 13px; border-radius: 50%;
  border: 1.5px solid var(--accent); background: var(--paper); box-sizing: border-box;
}
.path-list li:first-child::before { background: var(--accent); }

.all-projects { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; padding-top: 32px; border-top: 1px solid var(--line); }

/* Как работаем */
.how { background: var(--paper-deep); }
.route { position: relative; margin-top: 8px; }
.route-line { position: absolute; left: 0; top: 0; height: 64px; width: 100%; overflow: visible; pointer-events: none; }
.route-line path { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.route-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0 28px; position: relative; }
.route-steps li { padding-top: 64px; position: relative; }
.route-steps li::before {
  content: ""; position: absolute; left: 0; top: 25px; width: 15px; height: 15px; border-radius: 50%;
  border: 1.5px solid var(--accent); background: var(--paper-deep); box-sizing: border-box;
}
.route-steps li:first-child::before { background: var(--accent); }
.route-steps .num { font-family: var(--serif); font-size: 1.125rem; color: var(--graphite); display: block; margin-bottom: 4px; }
.route-steps h3 { font-size: 1.625rem; margin-bottom: 10px; }
.route-steps p { font-size: 0.97rem; color: var(--ink); }
.how-terms {
  margin-top: clamp(48px, 6vw, 80px); display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px 32px;
  border-top: 1px solid var(--line); padding-top: 32px;
}
.how-terms .term { grid-column: span 4; }
.how-terms .term strong { display: block; font-family: var(--serif); font-size: 1.5rem; font-weight: 600; line-height: 1.2; margin-bottom: 6px; }
.how-terms .term p { color: var(--graphite); }
.how-quote { grid-column: 1 / -1; margin: 24px 0 0; max-width: 46em; }
.how-quote p { font-family: var(--serif); font-size: clamp(1.5rem, 1.2rem + 1.1vw, 2.25rem); line-height: 1.25; font-style: italic; }

@media (prefers-reduced-motion: no-preference) {
  .route-line.is-drawing path { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); transition: stroke-dashoffset 2.2s cubic-bezier(.4,.1,.2,1); }
  .route-line.is-drawn path { stroke-dashoffset: 0; }
}

/* О студии на главной */
.studio-teaser { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 32px; align-items: end; }
.studio-teaser .portrait { grid-column: 2 / 5; }
.studio-teaser .portrait img { max-height: 640px; width: auto; margin-inline: auto; }
.studio-teaser .text { grid-column: 6 / 12; padding-bottom: clamp(16px, 4vw, 64px); }
.studio-teaser h2 { margin-bottom: 26px; }

/* Финальный блок с контактом */
.contact { border-top: 1px solid var(--line); }
.contact-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 32px; align-items: center; }
.contact-text { grid-column: 1 / 7; }
.contact-text h2 { margin-bottom: 24px; }
.contact-image { grid-column: 7 / 13; margin-right: calc(var(--gutter) * -1); }
.contact-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 30px 0 28px; }
.email-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.email-line a { font-family: var(--serif); font-size: clamp(1.375rem, 1.1rem + 1vw, 1.875rem); font-weight: 500; text-decoration: none; border-bottom: 1px solid var(--accent); line-height: 1.2; word-break: break-word; }
.copy-btn {
  font: inherit; font-size: var(--fs-small); background: none; border: 1px solid var(--line); color: var(--ink);
  min-height: 40px; padding: 0 14px; border-radius: var(--radius); cursor: pointer;
}
.copy-btn:hover { border-color: var(--ink); }
.copy-btn[data-done] { border-color: var(--accent); }
.write-hints { margin-top: 8px; color: var(--graphite); font-size: var(--fs-small); max-width: 34em; }

/* Компактный контакт на внутренних страницах */
.contact-compact { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px 32px; align-items: end; }
.contact-compact .text { grid-column: 1 / 8; }
.contact-compact .act { grid-column: 8 / 13; justify-self: end; text-align: right; }
.contact-compact h2 { margin-bottom: 18px; }

/* ---------- 6. Страницы проектов ---------- */
.crumbs { font-size: var(--fs-small); color: var(--graphite); padding-top: clamp(20px, 3vw, 36px); }
.crumbs a { color: var(--graphite); }
.crumbs span[aria-hidden] { margin: 0 8px; }

.case-head { padding-top: clamp(24px, 4vw, 56px); padding-bottom: clamp(28px, 4vw, 56px); }
.client { font-family: var(--serif); font-style: italic; font-size: clamp(1.375rem, 1.1rem + 1vw, 1.875rem); color: var(--graphite); margin-top: 14px; line-height: 1.25; }

.passport { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 32px; margin: 0; border-top: 1px solid var(--ink); }
.passport > div { padding: 16px 0 20px; }
.passport dt { font-size: var(--fs-small); color: var(--graphite); margin-bottom: 4px; }
.passport dd { margin: 0; }

.case-section { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 32px; padding-block: clamp(48px, 6vw, 96px); }
.case-section > h2 { grid-column: 1 / 5; font-size: clamp(1.875rem, 1.5rem + 1.5vw, 2.75rem); }
.case-section > .body { grid-column: 6 / 12; }
.case-section + .case-section { border-top: 1px solid var(--line); }
.case-section .body > p { font-size: 1.125rem; }
.case-section .body > p.lead { font-size: var(--fs-lead); }
.case-section .body > p.note { font-size: var(--fs-small); }
/* Секция во всю ширину: заголовок сверху, содержимое под ним */
.case-section.case-wide > h2 { grid-column: 1 / -1; margin-bottom: 18px; }
.case-section.case-wide > .body { grid-column: 1 / -1; }
.case-wide .journey { margin-top: 36px; }

/* «Нам Светло»: шаги работы стоят на линии маршрута, как огни на «Световой карте» */
.step-list.route-steps-v > li { padding-left: 44px; border-top: 0; }
.step-list.route-steps-v > li:last-child { border-bottom: 0; }
.step-list.route-steps-v > li::before {
  content: ""; left: 0; top: 24px; width: 15px; height: 15px; border-radius: 50%;
  border: 1.5px solid var(--accent); background: var(--paper); box-sizing: border-box; font-size: 0;
}
.step-list.route-steps-v > li:first-child::before { background: var(--accent); }
.step-list.route-steps-v > li::after { content: ""; position: absolute; left: 6.5px; top: 40px; bottom: -24px; width: 1.5px; background: var(--accent); }
.step-list.route-steps-v > li:last-child::after { display: none; }

.step-list { list-style: none; counter-reset: s; margin: 0; padding: 0; }
.step-list > li { counter-increment: s; padding: 18px 0 18px 56px; position: relative; border-top: 1px solid var(--line); }
.step-list > li:last-child { border-bottom: 1px solid var(--line); }
.step-list > li::before {
  content: counter(s); position: absolute; left: 0; top: 12px;
  font-family: var(--serif); font-size: 2rem; line-height: 1; color: var(--graphite);
}
.step-list h3 { font-size: 1.5rem; margin-bottom: 6px; }

.note {
  border-left: 2px solid var(--accent); padding: 4px 0 4px 18px; color: var(--graphite); font-size: var(--fs-small); margin-top: 28px;
}

.lead-after-title { margin-top: 24px; }
.projects-list-section { padding-bottom: calc(var(--section) * 0.6); }

/* «Нам Светло»: панорама под заголовком */
.case-light .panorama { margin-inline: calc(var(--gutter) * -1); margin-bottom: clamp(32px, 4vw, 56px); }

/* «Морские практики»: верфь рядом с заголовком */
.case-sea-head { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 32px; align-items: end; padding-top: clamp(24px, 4vw, 56px); padding-bottom: clamp(32px, 4vw, 56px); }
.case-sea-head .title { grid-column: 1 / 6; padding-bottom: clamp(0px, 2vw, 32px); }
.case-sea-head .illus { grid-column: 6 / 13; margin-right: calc(var(--gutter) * -1); }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 28px; margin-top: 26px; }
.trio > div { border-top: 1px solid var(--ink); padding-top: 14px; }
.trio strong { display: block; font-family: var(--serif); font-size: 1.625rem; font-weight: 600; font-style: italic; margin-bottom: 4px; }
.trio p { font-size: 0.97rem; color: var(--graphite); }

/* КИТ: путь клиента по каталогу */
.journey { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 24px; position: relative; }
.journey::before { content: ""; position: absolute; left: 7px; right: 0; top: 7px; height: 1.5px; background: var(--accent); }
.journey li { position: relative; padding-top: 34px; }
.journey li::before {
  content: ""; position: absolute; left: 0; top: 0; width: 15px; height: 15px; border-radius: 50%;
  border: 1.5px solid var(--accent); background: var(--paper); box-sizing: border-box;
}
.journey li:first-child::before { background: var(--accent); }
.journey strong { display: block; font-family: var(--serif); font-size: 1.375rem; font-weight: 600; line-height: 1.2; margin-bottom: 6px; }
.journey p { font-size: 0.97rem; color: var(--graphite); }
.case-kit .wide-illus { margin-bottom: clamp(32px, 4vw, 56px); }

/* Список проектов */
.project-rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.project-row { border-bottom: 1px solid var(--line); }
.project-row a {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px 32px; align-items: center;
  padding: clamp(24px, 3vw, 40px) 0; text-decoration: none;
}
.project-row .pr-text { grid-column: 1 / 7; }
.project-row .pr-img { grid-column: 8 / 13; }
.project-row .pr-img img { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; }
.project-row h2 { font-size: clamp(2rem, 1.6rem + 1.8vw, 3rem); margin-bottom: 10px; }
.project-row .pr-client { color: var(--graphite); margin-bottom: 14px; }
.project-row .pr-did { font-size: var(--fs-small); }
.project-row .pr-go { display: inline-block; margin-top: 16px; font-weight: 500; border-bottom: 1.5px solid var(--accent); }
.project-row a:hover h2 { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 0.12em; }

.next-case { border-top: 1px solid var(--line); padding-block: clamp(40px, 5vw, 72px); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; align-items: baseline; }
.next-case a.big { font-family: var(--serif); font-size: clamp(1.75rem, 1.4rem + 1.5vw, 2.75rem); text-decoration: none; border-bottom: 1px solid var(--accent); line-height: 1.2; }

/* ---------- 7. О студии ---------- */
.about-head { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 32px; padding-top: clamp(24px, 4vw, 56px); padding-bottom: clamp(40px, 5vw, 80px); }
.about-head h1 { grid-column: 1 / 8; margin-bottom: 28px; }
.about-head .lead { grid-column: 1 / 8; }
.about-head .who { grid-column: 9 / 13; align-self: end; font-size: var(--fs-small); color: var(--graphite); }
.about-head .who ul { list-style: none; padding: 0; margin: 8px 0 0; }
.about-head .who li { padding: 6px 0; border-bottom: 1px solid var(--line); color: var(--ink); font-size: var(--fs-body); }

.principles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 clamp(32px, 5vw, 80px); }
.principles li { border-top: 1px solid var(--ink); padding: 22px 0 36px; }
.principles h3 { margin-bottom: 10px; }

.person { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 32px; align-items: start; }
.person .portrait { grid-column: 1 / 5; position: sticky; top: 96px; }
.person .portrait img { max-height: 78vh; width: auto; margin-inline: auto; }
.person .text { grid-column: 6 / 12; }
.person h2 { margin-bottom: 28px; }
.person .text p { font-size: var(--fs-lead); line-height: 1.6; }
.person .text .loves { font-family: var(--serif); font-style: italic; font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); line-height: 1.3; margin: 32px 0; }

/* Книга: маленькое самостоятельное отступление */
.book { background: var(--paper-deep); }
.book-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 32px; align-items: center; }
.book-grid .illus { grid-column: 1 / 8; }
.book-grid .text { grid-column: 8 / 13; padding-left: clamp(0px, 2vw, 32px); }
.book-grid .text p { font-size: var(--fs-lead); line-height: 1.55; }
.book-grid .text .book-author { font-size: var(--fs-body); }
.book-grid .text .book-title { font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.5rem); line-height: 1.1; }
.book-grid h2 { font-style: italic; font-weight: 500; margin-bottom: 24px; }
.book-title { font-family: var(--serif); font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.5rem); font-weight: 600; line-height: 1.1; margin-bottom: 6px; }
.book-author { color: var(--graphite); margin-bottom: 24px; }

.place { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 32px; align-items: center; }
.place .text { grid-column: 1 / 5; }
.place h2 { margin-bottom: 24px; }
.place .illus { grid-column: 6 / 13; margin-right: calc(var(--gutter) * -1); }

/* ---------- 8. Подвал, галерея, увеличение ---------- */
.site-footer { border-top: 1px solid var(--ink); padding-top: clamp(48px, 6vw, 88px); padding-bottom: 32px; }
.footer-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 32px; }
.footer-mark {
  grid-column: 1 / 4; margin: 0;
  font-family: var(--serif); font-weight: 600; font-size: clamp(3rem, 2rem + 3vw, 5rem); line-height: 0.92; letter-spacing: 0.06em;
}
.footer-contact { grid-column: 5 / 9; }
.footer-sign { font-family: var(--serif); font-style: italic; font-size: 1.5rem; line-height: 1.25; margin-bottom: 18px; }
.footer-contact a { font-weight: 500; }
.footer-contact .small { margin-top: 10px; color: var(--graphite); }
.footer-nav { grid-column: 10 / 13; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; }
.footer-nav li { padding: 4px 0; }
.footer-nav a { text-decoration: none; }
.footer-nav a:hover { text-decoration: underline; }
.footer-bottom { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; border-top: 1px solid var(--line); padding-top: 18px; font-size: var(--fs-small); color: var(--graphite); }

/* Галерея материалов проекта */
.gallery[hidden] { display: none; }
.gallery-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(20px, 3vw, 40px) 32px; }
.slot { margin: 0; grid-column: span 6; }
.slot.wide { grid-column: 1 / -1; }
.slot.third { grid-column: span 4; }
.slot[hidden] { display: none; }
.slot button {
  display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; text-align: left;
}
.slot img { width: 100%; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.slot figcaption { margin-top: 10px; font-size: var(--fs-small); color: var(--graphite); }
.slot .placeholder {
  display: flex; flex-direction: column; justify-content: center; gap: 8px;
  aspect-ratio: 16 / 10; padding: 20px; border: 1px dashed var(--graphite); color: var(--graphite); font-size: var(--fs-small);
}
.slot .placeholder code { font-size: 0.8rem; color: var(--ink); word-break: break-all; }

.lightbox {
  border: 0; padding: 0; margin: 0; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh;
  background: var(--paper); color: var(--ink);
}
.lightbox::backdrop { background: rgba(32, 32, 32, 0.4); }
.lightbox-inner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 64px 16px 24px; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 150px); width: auto; height: auto; object-fit: contain; box-shadow: 0 0 0 1px var(--line); background: #fff; }
.lightbox p { margin: 14px 0 0; font-size: var(--fs-small); color: var(--graphite); text-align: center; max-width: 50em; }
.lb-btn {
  position: absolute; font: inherit; font-size: 0.95rem; background: var(--paper); color: var(--ink);
  border: 1px solid var(--ink); border-radius: var(--radius); min-height: 44px; min-width: 44px; padding: 0 14px; cursor: pointer;
}
.lb-close { top: 12px; right: 12px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lb-btn[hidden] { display: none; }

.to-top {
  position: fixed; right: 18px; bottom: 18px; z-index: 40;
  width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid var(--ink); background: var(--paper); color: var(--ink);
  font: inherit; font-size: 1.25rem; line-height: 1; cursor: pointer;
  opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
}
.to-top.is-visible { opacity: 1; visibility: visible; }

/* 404 */
.notfound { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 32px; align-items: center; min-height: 70vh; }
.notfound .text { grid-column: 1 / 6; }
.notfound .illus { grid-column: 6 / 13; }
.notfound h1 { margin-bottom: 24px; }
.notfound ul { list-style: none; padding: 0; margin: 24px 0 0; }
.notfound li { padding: 8px 0; border-bottom: 1px solid var(--line); }

/* ---------- 9. Адаптация ---------- */
@media (max-width: 1100px) {
  .service-list { grid-template-columns: repeat(2, 1fr); }
  .service:nth-child(n+3) { margin-top: 8px; }
  .route-steps { grid-template-columns: repeat(5, 1fr); gap: 0 18px; }
  .route-steps h3 { font-size: 1.375rem; }
  .pt-sea .text { grid-column: 1 / 6; }
  .pt-sea .illus { grid-column: 6 / 13; }
  .pt-kit .illus { grid-column: 1 / 7; }
  .pt-kit .text { grid-column: 7 / 13; }
}

@media (max-width: 960px) {
  .nav, .site-header .btn-small { display: none; }
  .menu-toggle { display: inline-flex; align-items: center; }

  .hero-grid, .pt-sea, .pt-kit, .studio-teaser, .contact-grid, .about-head, .person, .book-grid, .place, .case-sea-head, .notfound, .contact-compact { display: block; }
  .section-head { display: block; }
  .section-head h2 { margin-bottom: 18px; }
  .hero-image { margin: 36px calc(var(--gutter) * -1) 0; }
  .hero-image img { max-height: none; }
  .hero-image picture { max-width: 620px; margin-left: auto; }
  .hero-image picture { -webkit-mask-image: linear-gradient(to top, transparent 0, #000 10%); mask-image: linear-gradient(to top, transparent 0, #000 10%); }

  .pt-light-body { display: block; }
  .pt-light-body .col-b { margin-top: 20px; }
  .pt-sea .illus { margin: 28px calc(var(--gutter) * -1) 0; }
  .pt-sea .text { max-width: 40em; }
  .pt-kit { display: flex; flex-direction: column; }
  .pt-kit .illus { order: 2; margin: 28px calc(var(--gutter) * -1) 0; }

  .route-line { display: none; }
  .route-steps { grid-template-columns: 1fr; max-width: 36em; }
  .route-steps li { padding: 0 0 26px 40px; }
  .route-steps li::before { top: 6px; background: var(--paper-deep); }
  .route-steps li::after { content: ""; position: absolute; left: 6.5px; top: 22px; bottom: -6px; width: 1.5px; background: var(--accent); }
  .route-steps li:last-child::after { display: none; }
  .how-terms { display: block; }
  .how-terms .term { margin-bottom: 22px; }

  .studio-teaser .portrait img { max-height: 420px; margin: 0; }
  .studio-teaser .text { padding-top: 28px; }
  .contact-image { margin: 36px calc(var(--gutter) * -1) 0; }
  .contact-compact .act { text-align: left; margin-top: 24px; justify-self: auto; }

  .about-head .who { margin-top: 32px; }
  .principles { grid-template-columns: 1fr; }
  .person .portrait { position: static; margin-bottom: 28px; }
  .person .portrait img { max-height: 460px; margin: 0; }
  .book-grid .illus { margin: 0 calc(var(--gutter) * -1) 28px; }
  .place .illus { margin: 28px calc(var(--gutter) * -1) 0; }

  .case-sea-head .illus { margin: 28px calc(var(--gutter) * -1) 0; }
  .case-section { display: block; }
  .case-section > h2 { margin-bottom: 22px; }
  .passport { grid-template-columns: repeat(2, 1fr); }
  .journey { grid-template-columns: 1fr; gap: 0; max-width: 36em; }
  .journey::before { display: none; }
  .journey li { padding: 0 0 22px 36px; }
  .journey li::before { top: 4px; }
  .journey li::after { content: ""; position: absolute; left: 6.5px; top: 19px; bottom: -4px; width: 1.5px; background: var(--accent); }
  .journey li:last-child::after { display: none; }
  .project-row a { display: block; }
  .project-row .pr-img { margin-top: 20px; }
  .notfound .illus { margin-top: 32px; }

  .footer-grid { display: block; }
  .footer-mark { margin-bottom: 28px; }
  .footer-contact, .footer-nav { margin-bottom: 28px; }
  .slot, .slot.third { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  body { font-size: 1rem; }
  p, li { hyphens: auto; -webkit-hyphens: auto; }
  .lead, .section-intro, .hero-index li, .loves, .how-quote p { hyphens: manual; -webkit-hyphens: manual; }
  .logo { font-size: 1.3rem; }
  .header-in { min-height: 64px; }
  .mobile-menu { inset: 64px 0 0 0; }
  html { scroll-padding-top: 76px; }
  .hero h1 { max-width: none; }
  .hero-actions .btn { flex: 1 1 100%; }
  .hero-index ul { columns: 1; }
  .service-list { grid-template-columns: 1fr; }
  .service { padding-bottom: 28px; }
  .service:nth-child(n+2) { margin-top: 4px; }
  .trio { grid-template-columns: 1fr; gap: 18px; }
  .passport { grid-template-columns: 1fr; }
  .passport > div { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .contact-actions .btn, .contact-compact .act .btn { flex: 1 1 100%; width: 100%; }
  .step-list > li { padding-left: 44px; }
  .lb-prev, .lb-next { top: auto; bottom: 14px; transform: none; }
  .lightbox img { max-height: calc(100vh - 190px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  .site-header, .to-top, .mobile-menu, .menu-toggle { display: none !important; }
  body { background: #fff; }
}
