/* Designlogic — прототип сайта, премиальная версия
   Материалы: малахит, известняк, матовая латунь */

:root {
  /* Весь сайт тёмный: фон — малахит, текст — светлый известняк */
  --paper: #14201B;      /* фон страниц */
  --white: #1D2C26;      /* панели: калькулятор, формы, таблицы */
  --ink: #ECE8E0;        /* основной текст */
  --stone: #98A39D;      /* второстепенный текст */
  --line: #2E3E37;       /* тонкие линии */
  --plaster: #1D2C26;    /* подложка под фото */

  --deep: #14201B;       /* малахит */
  --deep-2: #1D2C26;
  --on-deep: #ECE8E0;
  --on-deep-muted: #98A39D;
  --deep-line: #2E3E37;

  --brass: #A88A5C;      /* латунь: заливки и линии */
  --brass-light: #C2A473;/* латунь на тёмном */
  --brass-ink: #C2A473;  /* латунь для текста */

  --f-display: "Prata", "Didot", "Bodoni 72", Georgia, serif;
  --f-text: "Manrope", "Segoe UI", system-ui, sans-serif;

  --gutter: clamp(16px, 4vw, 56px);
  --max: 1360px;
  --section: clamp(88px, 12vw, 168px);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-text);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; }

:focus-visible { outline: 1px solid var(--brass); outline-offset: 4px; }

::selection { background: var(--brass); color: var(--deep); }

/* ---------- Типографика ---------- */

h1, h2, h3, .display {
  font-family: var(--f-display);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0;
}

h1 { font-size: clamp(40px, 6vw, 88px); }
h2 { font-size: clamp(32px, 4.2vw, 56px); }
h3 { font-size: clamp(21px, 1.8vw, 25px); line-height: 1.25; letter-spacing: 0; }

p { margin: 0 0 1em; max-width: 62ch; }

.lead { font-size: clamp(18px, 1.4vw, 20px); font-weight: 300; line-height: 1.65; max-width: 44ch; }
.muted { color: var(--stone); }
.small { font-size: 14px; line-height: 1.55; }

/* ---------- Каркас ---------- */

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

.section { padding: var(--section) 0; }
.section + .section { padding-top: 0; }
.section--rule { border-top: 1px solid var(--line); padding-top: var(--section); }
.section + .section--rule { padding-top: var(--section); }

.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(16px, 2.4vw, 32px); }

.head { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; margin-bottom: clamp(48px, 7vw, 96px); align-items: end; }
.head h2 { grid-column: 1 / span 7; }
.head p { grid-column: 9 / -1; margin: 0; color: var(--stone); }

/* Тёмные поверхности: шапка, главный экран, призыв, подвал */
.dark { background: var(--deep); color: var(--on-deep); }
.dark .muted, .dark .lead { color: var(--on-deep-muted); }
.dark .lead { color: #C9CFCB; }

/* ---------- Шапка ---------- */

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--deep); color: var(--on-deep);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--deep-line); }

/* Плавный переход между страницами: шапка стоит на месте, содержимое мягко сменяется.
   Работает в Chrome, Edge и Safari 18+; в остальных браузерах страницы открываются как обычно. */
@view-transition { navigation: auto; }
.site-header { view-transition-name: site-header; }
::view-transition-group(site-header) { animation: none; }
::view-transition-old(root) { animation: page-out .22s ease both; }
::view-transition-new(root) { animation: page-in .45s cubic-bezier(.2,.7,.2,1) .08s both; }
@keyframes page-out { to { opacity: 0; } }
@keyframes page-in { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 84px; gap: 24px; }

.logo { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.logo svg { width: 30px; height: 30px; }
.logo .m-wall { stroke: currentColor; }
.logo .m-room { fill: var(--brass-light); }
.logo span { font-family: var(--f-display); font-size: 22px; letter-spacing: 0.02em; }

.nav { display: flex; gap: clamp(18px, 2.4vw, 36px); align-items: center; }
.nav a { text-decoration: none; font-size: 15px; letter-spacing: 0.02em; color: var(--on-deep); padding: 6px 0; border-bottom: 1px solid transparent; }
.nav a:hover { border-bottom-color: var(--on-deep-muted); }
.nav a[aria-current="page"] { border-bottom-color: var(--brass-light); color: var(--brass-light); }
.nav a.btn, .nav a.btn[aria-current="page"] { color: var(--deep); padding: 13px 22px; border: 1px solid var(--brass-light); background: var(--brass-light); }
.nav a.btn:hover { background: var(--on-deep); border-color: var(--on-deep); }

.nav-toggle { display: none; background: none; border: 0; padding: 10px; margin-right: -10px; cursor: pointer; }
.nav-toggle span { display: block; width: 26px; height: 1px; background: var(--on-deep); margin: 7px 0; transition: transform .2s; }

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 500 15px/1 var(--f-text); letter-spacing: 0.04em;
  padding: 20px 32px; border: 1px solid var(--ink);
  background: var(--brass-light); color: var(--deep); border-color: var(--brass-light);
  text-decoration: none; cursor: pointer; border-radius: 0;
  transition: background .2s, border-color .2s, color .2s;
}
.btn:hover { background: var(--on-deep); border-color: var(--on-deep); }
.btn--accent { background: var(--brass); border-color: var(--brass); color: var(--deep); }
.btn--accent:hover { background: var(--on-deep); border-color: var(--on-deep); color: var(--deep); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--deep-line); }
.btn--ghost:hover { background: transparent; color: var(--brass-light); border-color: var(--brass-light); }
.btn--sm { padding: 13px 20px; font-size: 14px; }

.dark .btn--accent { background: var(--brass-light); border-color: var(--brass-light); }
.dark .btn--accent:hover { background: var(--on-deep); border-color: var(--on-deep); color: var(--deep); }
.dark .btn--ghost { color: var(--on-deep); border-color: var(--deep-line); }
.dark .btn--ghost:hover { background: transparent; border-color: var(--brass-light); color: var(--brass-light); }

.link { color: var(--brass-ink); text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 1px; }
.link:hover { color: var(--ink); }

/* ---------- Главный экран: план латунью на малахите ---------- */

.hero { padding: clamp(40px, 6vw, 88px) 0 var(--section); }
.hero.dark { padding-bottom: clamp(64px, 8vw, 120px); }
.hero .grid { align-items: center; }
.hero-text { grid-column: 1 / span 5; }
.hero-text h1 { margin-bottom: 36px; }
.hero-text .lead { margin-bottom: 44px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-plan { grid-column: 7 / -1; }
.hero-plan figcaption { margin-top: 20px; display: flex; justify-content: space-between; gap: 16px; }

/* Главный экран с фото на всю площадь */
.hero.hero--photo { position: relative; isolation: isolate; overflow: hidden; min-height: calc(100svh - 84px); display: flex; align-items: center; padding: clamp(56px, 8vw, 120px) 0; }
.hero--photo > .wrap { width: 100%; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero--photo::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(20,32,27,.88) 0%, rgba(20,32,27,.6) 50%, rgba(20,32,27,.38) 100%);
}
.hero--photo .hero-text { grid-column: 1 / span 6; }
.hero--photo .hero-plan { grid-column: 8 / -1; }
.hero--photo .hero-plan figcaption { color: var(--on-deep-muted); }

.hero--photo h1 { font-size: clamp(38px, 4.8vw, 72px); max-width: 13ch; margin-bottom: 28px; }
.hero--photo .lead { margin-bottom: 40px; }
.hero-kicker { color: var(--brass-light); font-size: 15px; letter-spacing: 0.02em; margin: 0 0 20px; }

/* Цитата — второстепенная, под кнопками */
.quote { margin: 56px 0 0; max-width: 30em; }
.quote p { font-family: var(--f-display); font-size: clamp(17px, 1.4vw, 20px); line-height: 1.45; color: var(--on-deep); margin: 0; }
.quote footer { margin-top: 12px; text-align: right; color: var(--on-deep-muted); font-size: 13px; line-height: 1.6; }
.quote cite { font-style: normal; font-family: var(--f-display); font-size: 16px; color: var(--brass-light); }

.photo-credit { position: absolute; right: var(--gutter); bottom: 12px; margin: 0; font-size: 12px; color: rgba(236,232,224,.55); }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.plan { width: 100%; height: auto; color: var(--brass-ink); --plan-bg: var(--paper); --plan-text: var(--ink); --plan-muted: var(--stone); }
.dark .plan { color: var(--brass-light); --plan-bg: var(--deep); --plan-text: var(--on-deep); --plan-muted: var(--on-deep-muted); }
.plan .wall { stroke: currentColor; stroke-width: 4; fill: none; stroke-linecap: square; }
.plan .thin { stroke: currentColor; stroke-width: .8; fill: none; }
.plan .leaf { stroke: currentColor; stroke-width: 1.5; fill: none; }
.plan .win { stroke: currentColor; stroke-width: .8; fill: var(--plan-bg); }
.plan .dim { stroke: var(--plan-muted); stroke-width: .6; fill: none; }
.plan .furn { stroke: var(--plan-muted); stroke-width: .6; fill: none; }
.plan text { font-family: var(--f-text); fill: var(--plan-text); }
.plan .room-name { font-size: 12px; font-family: var(--f-display); }
.plan .room-area { font-size: 10.5px; fill: var(--plan-muted); }
.plan .dim-text { font-size: 10px; fill: var(--plan-muted); }

.plan.is-drawing .draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw var(--dur, 2.8s) cubic-bezier(.6,.05,.3,1) both; animation-delay: var(--d, 0s); }
.plan.is-drawing .fade { opacity: 0; animation: fade 1s ease forwards; animation-delay: var(--fade-d, 2.3s); }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }

/* ---------- Портфолио ---------- */

.ph {
  position: relative; background: var(--plaster); overflow: hidden;
  display: flex; align-items: flex-end; padding: 18px; color: var(--stone); font-size: 13px;
}
.ph::before {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(120deg, transparent 0 58%, rgba(255,255,255,.35) 58% 58.6%, transparent 58.6%),
    linear-gradient(180deg, transparent 0 72%, rgba(27,36,32,.05) 72%);
}
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ph span { position: relative; }
.ph--tall { aspect-ratio: 4 / 5; }
.ph--wide { aspect-ratio: 16 / 10; }
.ph--pano { aspect-ratio: 21 / 9; }
.ph--sq { aspect-ratio: 1; }

.work { text-decoration: none; display: block; }
.work .ph { transition: opacity .3s; }
.work:hover .ph { opacity: .9; }
.work:hover h3 { color: var(--brass-ink); }

/* Этикетка под работой, как в галерее */
.label { margin-top: 20px; display: grid; gap: 4px; }
.label h3 { transition: color .2s; }
.label p { margin: 0; color: var(--stone); font-size: 15px; }

.works { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(24px, 3vw, 48px); row-gap: clamp(64px, 8vw, 112px); }
.works .w1 { grid-column: 1 / span 7; }
.works .w2 { grid-column: 9 / -1; margin-top: clamp(80px, 14vw, 200px); }
.works .w3 { grid-column: 3 / span 8; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 56px; }
.chip {
  font: 15px/1 var(--f-text); letter-spacing: 0.02em; padding: 12px 20px; border: 1px solid var(--line);
  background: transparent; color: var(--ink); cursor: pointer; border-radius: 0;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--deep); border-color: var(--ink); }

.catalog { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(24px, 3vw, 48px); row-gap: 80px; }
.catalog .work[hidden] { display: none; }

/* ---------- Страница проекта ---------- */

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); border-top: 1px solid var(--brass); }
.facts div { padding: 22px 24px 0 0; }
.facts dt { color: var(--stone); font-size: 14px; }
.facts dd { margin: 6px 0 0; font-family: var(--f-display); font-size: 24px; }

.gallery { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(16px, 2vw, 28px); }
.gallery .g-full { grid-column: 1 / -1; }
.gallery .g-l { grid-column: 1 / span 7; }
.gallery .g-r { grid-column: 8 / -1; }
.gallery .g-text { grid-column: 2 / span 5; align-self: center; padding: 56px 0; }

/* Галерея проекта: кадры целиком, без обрезки, по помещениям */
.h3 { font-family: var(--f-display); font-weight: 400; font-size: clamp(21px, 1.8vw, 25px); line-height: 1.25; letter-spacing: 0; }
.project-photos { padding-top: 0; }
.shot { display: block; width: 100%; padding: 0; border: 0; background: var(--plaster); cursor: zoom-in; }
.shot img { width: 100%; height: auto; display: block; transition: opacity .3s; }
.shot--lead img { max-height: 82vh; object-fit: cover; }
.shot:hover img { opacity: .9; }
.project-text { margin: clamp(48px, 6vw, 88px) 0 0; max-width: 52ch; }
.room { margin-top: clamp(72px, 9vw, 128px); }
.room-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; border-top: 1px solid var(--brass); padding-top: 20px; margin-bottom: 28px; }
.masonry { columns: 3; column-gap: clamp(12px, 1.6vw, 24px); }
.masonry .shot { margin-bottom: clamp(12px, 1.6vw, 24px); break-inside: avoid; }

/* Просмотр фото крупно */
.lightbox { padding: 0; border: 0; margin: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; background: rgba(20,32,27,.97); color: var(--on-deep); }
.lightbox[open] { display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.lightbox::backdrop { background: transparent; }
.lb-stage { display: grid; place-items: center; min-height: 0; padding: 24px; }
.lb-stage img { max-width: calc(100vw - 48px); max-height: calc(100vh - 140px); width: auto; height: auto; object-fit: contain; }
.lb-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px var(--gutter) 20px; }
.lb-caption { color: var(--on-deep-muted); font-size: 14px; }
.lb-nav { display: flex; gap: 8px; }
.lb-btn { width: 48px; height: 48px; border: 1px solid var(--deep-line); background: transparent; color: var(--on-deep); font: 24px/1 var(--f-text); cursor: pointer; }
.lb-btn:hover { border-color: var(--brass-light); color: var(--brass-light); }

@media (max-width: 980px) { .masonry { columns: 2; } }

/* ---------- Цена и калькулятор ---------- */

.price-big { font-family: var(--f-display); font-size: clamp(24px, 2.2vw, 30px); line-height: 1.2; letter-spacing: 0; color: var(--stone); }
.price-big small { font-family: var(--f-text); font-size: 15px; letter-spacing: 0.02em; color: var(--stone); margin-left: 8px; }

.price .grid { align-items: start; }
.price-main { grid-column: 1 / span 6; }
.price-list { grid-column: 8 / -1; }

.includes { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--brass); }
.includes li { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.includes li span:last-child { color: var(--stone); font-size: 15px; text-align: right; }

.calc { background: var(--white); padding: clamp(28px, 5vw, 72px); display: grid; grid-template-columns: repeat(12, 1fr); gap: 32px; align-items: end; border-top: 1px solid var(--brass); }
.calc-inputs { grid-column: 1 / span 7; display: grid; gap: 36px; }
.calc-out { grid-column: 8 / -1; border-left: 1px solid var(--line); padding-left: 36px; }
.calc-out .sum { font-family: var(--f-display); font-size: clamp(42px, 4.8vw, 64px); line-height: 1; letter-spacing: -0.01em; color: var(--ink); margin: 10px 0 14px; font-variant-numeric: lining-nums tabular-nums; }

.field { display: grid; gap: 10px; }
.field > label, .field > .field-label { font-size: 15px; color: var(--stone); }
.area-row { display: flex; align-items: center; gap: 28px; }
.area-num { display: flex; align-items: baseline; gap: 6px; border-bottom: 1px solid var(--ink); }
.area-num input { width: 4.2ch; border: 0; background: transparent; font: 40px/1.15 var(--f-display); color: var(--ink); padding: 0; -moz-appearance: textfield; }
.area-num input::-webkit-inner-spin-button, .area-num input::-webkit-outer-spin-button { -webkit-appearance: none; }
.area-num span { font-size: 17px; color: var(--stone); }

input[type="range"] { flex: 1; accent-color: var(--brass); height: 24px; }

.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { font-size: 15px; padding: 12px 20px; border: 1px solid var(--line); cursor: pointer; }
.seg input:checked + label { background: var(--ink); color: var(--deep); border-color: var(--ink); }
.seg input:focus-visible + label { outline: 1px solid var(--brass); outline-offset: 3px; }

/* ---------- Этапы (настоящая последовательность — нумеруем) ---------- */

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 1fr 4fr 6fr; gap: 24px; padding: 36px 0; border-top: 1px solid var(--line); }
.steps li:last-child { border-bottom: 1px solid var(--line); }
.steps li::before { content: counter(step); font-family: var(--f-display); font-size: 44px; line-height: 1; color: var(--brass-ink); }
.steps h3 { margin-top: 6px; }
.steps p { margin: 6px 0 0; color: var(--stone); }

/* ---------- Студия, отзывы ---------- */

.person { grid-column: 1 / span 5; }
.portrait { width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; background: var(--deep); }
.person-text { grid-column: 7 / -1; align-self: end; }
.person-text blockquote { margin: 0 0 36px; font-family: var(--f-display); font-size: clamp(25px, 2.6vw, 36px); line-height: 1.35; }

.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 3vw, 56px); }
.principles > div { border-top: 1px solid var(--brass); padding-top: 28px; }
.principles h3 { margin-bottom: 14px; }
.principles p { color: var(--stone); margin: 0; }

.reviews { display: grid; grid-template-columns: 1fr; gap: clamp(32px, 4vw, 56px); max-width: 760px; }
.review { border-top: 1px solid var(--brass); padding-top: 32px; }
.review blockquote { margin: 0 0 24px; font-family: var(--f-display); font-size: 21px; line-height: 1.55; }
.review blockquote p { margin: 0 0 .7em; }
.review blockquote p:last-child { margin-bottom: 0; }
.review footer { color: var(--stone); font-size: 15px; }

/* ---------- Призыв к анкете ---------- */

.brief-cta { background: var(--deep-2); color: var(--on-deep); }
.section.brief-cta { padding-top: var(--section); }
.brief-cta .grid { align-items: end; }
.brief-cta h2 { grid-column: 1 / span 7; }
.brief-cta .side { grid-column: 9 / -1; }
.brief-cta p { color: var(--on-deep-muted); }
.brief-cta .btn { background: var(--brass-light); color: var(--deep); border-color: var(--brass-light); }
.brief-cta .btn:hover { background: var(--on-deep); border-color: var(--on-deep); }

/* Закреплённое фото: стоит под шапкой, пока над ним прокручиваются главный экран
   и проекты; раздел «Как я работаю» наезжает на него снизу */
.pinned { position: relative; isolation: isolate; clip-path: inset(0); }
.pinned-bg { position: sticky; top: 84px; height: calc(100vh - 84px); margin-bottom: calc(84px - 100vh); z-index: -1; overflow: hidden; }
.pinned-bg img { width: 100%; height: 100%; object-fit: cover; }
.pinned .hero--photo { background: none; }
.pinned > .section { background: rgba(20,32,27,.86); }

/* ---------- Анимации главной ---------- */

/* Фото в карточках проектов чуть приближается при наведении (на всём сайте) */
.work .ph img { transition: transform 1.2s cubic-bezier(.2,.7,.2,1); }
.work:hover .ph img { transform: scale(1.04); }

/* Класс js-anim ставит скрипт, только если посетитель не просил уменьшить движение */
@media (prefers-reduced-motion: no-preference) {
  /* Главный экран: фото медленно «оседает», текст поднимается по очереди */
  .js-anim .pinned-bg img { animation: settle 9s cubic-bezier(.2,.6,.2,1) both; }
  .js-anim .hero-text > * { opacity: 0; animation: rise 1s cubic-bezier(.2,.7,.2,1) forwards; }
  .js-anim .hero-text > :nth-child(1) { animation-delay: .15s; }
  .js-anim .hero-text > :nth-child(2) { animation-delay: .3s; }
  .js-anim .hero-text > :nth-child(3) { animation-delay: .5s; }
  .js-anim .hero-text > :nth-child(4) { animation-delay: .7s; }
  .js-anim .hero-text > :nth-child(5) { animation-delay: 1s; }
  .js-anim .hero-plan figcaption { opacity: 0; animation: fade 1s ease 2.6s forwards; }

  /* Блоки появляются при прокрутке: всплывают снизу, с задержкой --rd */
  .js-anim [data-reveal] {
    opacity: 0; transform: translateY(36px);
    transition: opacity 1s ease, transform 1.1s cubic-bezier(.2,.7,.2,1);
    transition-delay: var(--rd, 0s);
  }
  .js-anim [data-reveal].is-in { opacity: 1; transform: none; }

  /* Фото проекта открывается шторкой снизу вверх и слегка отдаляется */
  .js-anim .work[data-reveal] { transform: none; }
  .js-anim .work[data-reveal] .ph { clip-path: inset(100% 0 0 0); transition: clip-path 1.3s cubic-bezier(.7,0,.2,1) var(--rd, 0s), opacity .3s; }
  .js-anim .work[data-reveal].is-in .ph { clip-path: inset(0); }
  .js-anim .work[data-reveal] .ph img { transform: scale(1.15); transition: transform 1.8s cubic-bezier(.2,.7,.2,1) var(--rd, 0s); }
  .js-anim .work[data-reveal].is-in .ph img { transform: none; transition-delay: 0s; transition-duration: 1.2s; }
  .js-anim .work[data-reveal].is-in:hover .ph img { transform: scale(1.04); }
  .js-anim .work[data-reveal] .label { opacity: 0; transform: translateY(16px); transition: opacity .8s ease, transform .8s ease; transition-delay: calc(var(--rd, 0s) + .6s); }
  .js-anim .work[data-reveal].is-in .label { opacity: 1; transform: none; }

  /* Латунные линии над принципами и в списке цены прочерчиваются слева направо */
  .js-anim .principles > [data-reveal],
  .js-anim .includes > [data-reveal] { position: relative; }
  .js-anim .principles > [data-reveal] { border-top-color: transparent; }
  .js-anim .principles > [data-reveal]::before,
  .js-anim .includes > [data-reveal]::after {
    content: ""; position: absolute; left: 0; right: 0; height: 1px;
    transform: scaleX(0); transform-origin: left;
    transition: transform 1.4s cubic-bezier(.7,0,.2,1) calc(var(--rd, 0s) + .1s);
  }
  .js-anim .principles > [data-reveal]::before { top: -1px; background: var(--brass); }
  .js-anim .includes > [data-reveal] { border-bottom-color: transparent; }
  .js-anim .includes > [data-reveal]::after { bottom: -1px; background: var(--line); }
  .js-anim [data-reveal].is-in::before,
  .js-anim [data-reveal].is-in::after { transform: scaleX(1); }
}

@keyframes rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes settle { from { transform: scale(1.12); } to { transform: scale(1); } }

/* ---------- Контакты ---------- */

.contacts .grid { align-items: start; }
.contacts-info { grid-column: 1 / span 5; }
.contacts-form { grid-column: 7 / -1; }
.contact-line { padding: 24px 0; border-top: 1px solid var(--line); }
.contact-line:last-child { border-bottom: 1px solid var(--line); }
.contact-line dt { color: var(--stone); font-size: 14px; }
.contact-line dd { margin: 6px 0 0; font-size: 22px; font-family: var(--f-display); }
.contact-line dd a { text-decoration: none; }
.contact-line dd a:hover { color: var(--brass-ink); }

.form { display: grid; gap: 24px; }
.input {
  width: 100%; font: 17px/1.4 var(--f-text); color: var(--ink);
  padding: 14px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; border-radius: 0;
}
.input:focus { outline: none; border-bottom-color: var(--brass); }
textarea.input { resize: vertical; min-height: 96px; }

.map { aspect-ratio: 16/7; background: var(--plaster); margin-top: var(--section); display: grid; place-items: center; color: var(--stone); }

/* ---------- Подвал ---------- */

.site-footer { background: var(--deep); color: var(--on-deep); padding: 72px 0 40px; font-size: 15px; border-top: 1px solid var(--deep-line); }
.site-footer .grid { row-gap: 32px; }
.site-footer .f-brand { grid-column: 1 / span 4; }
.site-footer .f-brand p { color: var(--on-deep-muted); }
.site-footer .f-nav { grid-column: 6 / span 3; display: grid; gap: 10px; align-content: start; }
.site-footer .f-contacts { grid-column: 10 / -1; display: grid; gap: 10px; align-content: start; }
.site-footer .muted { color: var(--on-deep-muted); }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--brass-light); }
.site-footer .f-bottom { grid-column: 1 / -1; color: var(--on-deep-muted); font-size: 14px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 28px; border-top: 1px solid var(--deep-line); }

/* ---------- Анкета: вводный экран ---------- */

.brief-intro .grid { align-items: start; }
.brief-intro .left { grid-column: 1 / span 5; position: sticky; top: 128px; }
.brief-intro .right { grid-column: 7 / -1; }
.brief-steps { list-style: none; margin: 0 0 40px; padding: 0; counter-reset: b; }
.brief-steps li { counter-increment: b; display: grid; grid-template-columns: 56px 1fr; padding: 20px 0; border-top: 1px solid var(--line); }
.brief-steps li::before { content: counter(b); color: var(--brass-ink); font-family: var(--f-display); font-size: 22px; }
.brief-steps li span { display: block; color: var(--stone); font-size: 15px; }
.notice { background: var(--white); padding: 20px 24px; border-left: 1px solid var(--brass); font-size: 15px; }

/* ---------- Кабинет студии ---------- */

.tabs { display: flex; gap: 36px; border-bottom: 1px solid var(--line); margin-bottom: 40px; overflow-x: auto; }
.tabs [role=tab] { font: 16px/1 var(--f-text); background: none; border: 0; padding: 14px 0; margin-bottom: -1px; border-bottom: 1px solid transparent; color: var(--stone); cursor: pointer; white-space: nowrap; }
.tabs [role=tab][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--brass); }
.tabs .count { display: inline-block; min-width: 22px; padding: 3px 6px; margin-left: 6px; background: var(--brass); color: var(--deep); border-radius: 999px; font-size: 12px; text-align: center; }

.table { width: 100%; border-collapse: collapse; background: var(--white); font-size: 15px; }
.table th { text-align: left; font-weight: 400; color: var(--stone); padding: 14px 20px; border-bottom: 1px solid var(--line); }
.table td { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.table tr[data-open-brief] { cursor: pointer; }
.table tr[data-open-brief]:hover td { background: var(--paper); }
.table .is-draft td { color: var(--stone); }
.status { font-size: 13px; padding: 5px 10px; border-radius: 999px; background: var(--plaster); white-space: nowrap; }
.status--new { background: var(--brass); color: var(--deep); }
.status--draft { background: transparent; border: 1px dashed var(--stone); }

.brief-doc { background: var(--white); margin-top: 32px; padding: clamp(24px, 4vw, 56px); }
.brief-doc-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; padding-bottom: 32px; border-bottom: 1px solid var(--brass); }
.brief-sec { display: grid; grid-template-columns: 220px 1fr; gap: 10px 32px; margin: 0; padding: 28px 0; border-bottom: 1px solid var(--line); }
.brief-sec h3 { grid-column: 1 / -1; margin-bottom: 8px; }
.brief-sec dt { color: var(--stone); }
.brief-sec dd { margin: 0; }

.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 40px; }

/* Вход для студии */
.login { min-height: calc(100svh - 84px - 260px); display: flex; align-items: center; }
.login .wrap { width: 100%; }
.login-form { max-width: 420px; }
.login-form h1 { font-size: clamp(36px, 4.6vw, 56px); }
.login-form > p { margin: 0; }
.login-error { color: #E0A08A; font-size: 15px; margin: 0; }

.admin-works { list-style: none; margin: 0; padding: 0; background: var(--white); }
.admin-works li { display: grid; grid-template-columns: 72px 1fr auto; gap: 20px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }

@media (max-width: 640px) {
  .table thead { display: none; }
  .table tr { display: grid; grid-template-columns: 1fr 1fr; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .table td { padding: 4px 0; border: 0; }
  .brief-sec { grid-template-columns: 1fr; gap: 2px; }
  .brief-sec dd { margin-bottom: 12px; }
  .admin-works li { grid-template-columns: 56px 1fr; }
  .admin-works li .btn { grid-column: 1 / -1; }
}

/* ---------- Адаптив ---------- */

@media (max-width: 980px) {
  .nav-toggle { display: block; }
  .nav {
    position: fixed; inset: 84px 0 0 0; background: var(--deep);
    flex-direction: column; align-items: flex-start; gap: 6px; padding: 24px var(--gutter);
    transform: translateY(-8px); opacity: 0; visibility: hidden; transition: opacity .2s, transform .2s, visibility .2s;
  }
  .nav a { font-family: var(--f-display); font-size: 30px; letter-spacing: 0; }
  .nav a.btn { font-family: var(--f-text); font-size: 15px; margin-top: 16px; }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

  .grid, .head, .calc, .works, .gallery { grid-template-columns: minmax(0, 1fr); }

  .hero-text, .hero-plan,
  .head h2, .head p,
  .price-main, .price-list,
  .calc-inputs, .calc-out,
  .person, .person-text,
  .brief-cta h2, .brief-cta .side,
  .contacts-info, .contacts-form,
  .brief-intro .left, .brief-intro .right,
  .gallery > *,
  .works > * { grid-column: 1 / -1; }

  .hero-plan { margin-top: 32px; }
  .hero--photo .hero-text, .hero--photo .hero-plan { grid-column: 1 / -1; }
  .hero--photo .hero-plan { max-width: 520px; }
  .hero.hero--photo { min-height: 0; padding-bottom: 72px; }
  .hero--photo::before { background: rgba(20,32,27,.78); }
  .quote footer { text-align: left; }
  .works .w2 { margin-top: 0; }
  .calc-out { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 24px; }
  .brief-intro .left { position: static; }
  .site-footer .f-brand { grid-column: 1 / -1; }
  .site-footer .f-nav, .site-footer .f-contacts { grid-column: span 6; }
  .principles { grid-template-columns: 1fr; }
  .facts { grid-template-columns: repeat(2, 1fr); row-gap: 20px; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .catalog, .reviews { grid-template-columns: 1fr; }
  .steps li { grid-template-columns: 1fr; gap: 8px; }
  .includes li { grid-template-columns: 1fr; gap: 2px; }
  .includes li span:last-child { text-align: left; }
  .site-footer .f-nav, .site-footer .f-contacts { grid-column: 1 / -1; }
  .hero-plan figcaption { flex-direction: column; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .plan.is-drawing .draw, .plan.is-drawing .fade { animation: none; stroke-dasharray: none; stroke-dashoffset: 0; opacity: 1; }
  * { transition: none !important; }
}
