/* Smart Portal — сайт продукта. Чертёжная тема: белый лист, графит, синяя линия плана.
   Цвета устройств — как значки фирменных трафаретов (только в чертеже на первом экране). */
@font-face { font-family: "Onest"; src: url("fonts/onest.woff") format("woff"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/jbmono.woff") format("woff"); font-weight: 100 800; font-display: swap; }

:root {
  --paper: #ffffff;
  --plate: #f1f3f5;
  --ink: #1e2226;
  --muted: #5e6670;
  --line: #2b59c3;
  --rule: #dadfe5;
  --focus: #2b59c3;
  --wrap: 1160px;
  --gutter: 24px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 18px/1.6 "Onest", system-ui, sans-serif; font-feature-settings: "tnum" 0; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: color-mix(in srgb, var(--line) 55%, transparent); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:hover { color: var(--line); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 6px; z-index: 10; }
.skip:focus { left: 8px; }

/* Шапка */
.top { border-bottom: 1px solid var(--rule); background: var(--paper); position: sticky; top: 0; z-index: 5; }
.top .wrap { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; letter-spacing: -0.01em; text-decoration: none; }
.brand svg { flex: none; }
.nav { display: flex; gap: 22px; margin-left: auto; align-items: center; font-size: 16px; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav .btn { color: #fff; }
.menu-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--rule); border-radius: 8px; padding: 8px 12px; font: inherit; font-size: 15px; color: var(--ink); }

/* Кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 22px; border-radius: 10px; background: var(--ink); color: #fff; font-weight: 600; font-size: 16px; text-decoration: none; border: 1.5px solid var(--ink); line-height: 1.2; }
.btn:hover { background: var(--line); border-color: var(--line); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--plate); color: var(--ink); border-color: var(--ink); }
.btn.small { padding: 9px 16px; font-size: 15px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* Типографика */
h1, h2, h3 { line-height: 1.12; letter-spacing: -0.022em; margin: 0; font-weight: 700; }
h1 { font-size: clamp(2.3rem, 4.6vw, 3.9rem); font-weight: 750; max-width: 15ch; }
h1.long { max-width: 20ch; }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); max-width: 24ch; }
h3 { font-size: 1.22rem; letter-spacing: -0.012em; }
p { margin: 0 0 1em; max-width: 68ch; }
.lead { font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: #3b4249; max-width: 56ch; margin-top: 22px; }
.muted { color: var(--muted); }
.small { font-size: 15px; }
code, .code { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.86em; }

section { padding: 88px 0; }
section + section { border-top: 1px solid var(--rule); }
.section-head { margin-bottom: 40px; }
.section-head p { margin-top: 16px; color: var(--muted); }

/* Первый экран */
.hero { padding: 64px 0 80px; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(2.2rem, 3.5vw, 3.25rem); max-width: 17ch; }
.hero-note { margin-top: 18px; font-size: 15px; color: var(--muted); }
.page-hero { padding: 56px 0 64px; }
.crumbs { font-size: 15px; color: var(--muted); margin-bottom: 22px; }
.crumbs a { color: var(--muted); }

/* Чертёж */
.drawing { position: relative; }
.drawing svg { width: 100%; height: auto; display: block; }
.drawing .room { fill: #f6f8fd; stroke: var(--line); stroke-width: 2; }
.drawing .wall { fill: none; stroke: var(--ink); stroke-width: 6; }
.drawing .room-name { font: 500 13px "Onest", sans-serif; fill: var(--line); }
.drawing .tag { font: 600 12px "JetBrains Mono", monospace; fill: var(--ink); }
.drawing .trace { fill: none; stroke: #8a94a3; stroke-width: 1.3; stroke-dasharray: 4 4; }
.drawing .rack { fill: #b42318; }
.outputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 22px; margin: 18px 0 0; padding: 0; list-style: none; font-size: 15px; }
.outputs li { padding-top: 10px; border-top: 1px solid var(--rule); color: var(--muted); }
.outputs b { display: block; font-weight: 600; color: var(--ink); }
@media (prefers-reduced-motion: no-preference) {
  .drawing .pt { opacity: 0; transform-box: fill-box; transform-origin: center; animation: pop .45s cubic-bezier(.2,.8,.3,1.3) forwards; }
  .drawing .trace { stroke-dashoffset: 400; animation: draw 1.4s ease-out 1.2s forwards; opacity: 0; }
  .outputs li { opacity: 0; animation: fade .5s ease-out forwards; }
  @keyframes pop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }
  @keyframes draw { from { opacity: 1; stroke-dashoffset: 400; } to { opacity: 1; stroke-dashoffset: 0; } }
  @keyframes fade { to { opacity: 1; } }
}

/* Боль */
.pains { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 56px; margin: 0; padding: 0; list-style: none; }
.pains li { padding: 22px 0; border-top: 1px solid var(--rule); }
.pains h3 { margin-bottom: 8px; }
.pains p { color: var(--muted); margin: 0; }

/* Ход проекта — последовательность этапов */
.journey { list-style: none; margin: 0; padding: 0; counter-reset: stage; }
.journey li { counter-increment: stage; display: grid; grid-template-columns: 56px 260px minmax(0, 1fr); gap: 0 32px; padding: 26px 0; border-top: 1px solid var(--rule); align-items: start; }
.journey li::before { content: counter(stage); width: 36px; height: 36px; border: 2px solid var(--line); color: var(--line); border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 16px; }
.journey p { margin: 0; color: #3b4249; }
.journey .more { display: inline-block; margin-top: 10px; font-weight: 600; font-size: 16px; }

/* Экраны */
.shot { margin: 0; }
.shot .frame { background: var(--plate); border: 1px solid var(--rule); border-radius: 14px; padding: 14px; }
.shot img { border-radius: 8px; border: 1px solid var(--rule); background: #fff; }
.shot.narrow { max-width: 340px; }
.shot figcaption { margin-top: 14px; font-size: 15px; color: var(--muted); max-width: 64ch; }
.shot figcaption b { color: var(--ink); font-weight: 600; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.split.wide-left { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.split.phone { grid-template-columns: minmax(0, 1fr) 300px; }
.stack-lg > * + * { margin-top: 72px; }

/* Текстовые блоки входных страниц */
.feature { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: start; padding: 44px 0; border-top: 1px solid var(--rule); }
.feature:first-child { border-top: 0; padding-top: 0; }
.feature h2, .feature h3 { font-size: clamp(1.35rem, 2.2vw, 1.75rem); }
.feature ul { margin: 0; padding-left: 1.1em; }
.feature li { margin: 0 0 10px; max-width: 62ch; }
.feature li::marker { color: var(--line); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 32px; margin-top: 8px; }
.facts div { border-top: 2px solid var(--ink); padding-top: 12px; }
.facts b { display: block; font-size: 1.05rem; margin-bottom: 4px; }
.facts span { color: var(--muted); font-size: 15px; }

/* Методика */
.principles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 56px; list-style: none; margin: 0; padding: 0; }
.principles li { padding: 22px 0; border-top: 1px solid var(--rule); }
.principles h3 { margin-bottom: 8px; }
.principles p { margin: 0; color: var(--muted); }
.levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 28px 0 8px; }
.levels div { border: 1.5px solid var(--rule); border-radius: 12px; padding: 18px; }
.levels div.main { border-color: var(--ink); }
.levels b { display: block; font-size: 1.1rem; }
.levels span { display: block; color: var(--muted); font-size: 15px; margin-top: 6px; }

/* Вопросы */
.faq { max-width: 820px; }
.faq details { border-top: 1px solid var(--rule); padding: 18px 0; }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; font-weight: 600; font-size: 1.08rem; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--line); font-weight: 700; font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 12px 0 0; color: #3b4249; }

/* Связанные страницы */
.related { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 32px; list-style: none; margin: 0; padding: 0; }
.related li { border-top: 1px solid var(--rule); padding: 16px 0; }
.related a { font-weight: 600; text-decoration: none; }
.related a:hover { text-decoration: underline; }
.related span { display: block; color: var(--muted); font-size: 15px; margin-top: 4px; }

/* Призыв */
.cta { background: var(--ink); color: #fff; }
.cta h2 { color: #fff; max-width: 22ch; }
.cta p { color: #c9ced4; }
.cta .btn { background: #fff; color: var(--ink); border-color: #fff; }
.cta .btn:hover { background: var(--line); color: #fff; border-color: var(--line); }
.cta .btn.ghost { background: transparent; color: #fff; border-color: #6b737d; }
.cta .btn.ghost:hover { border-color: #fff; background: transparent; }
.cta a:not(.btn) { color: #fff; }
.contacts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 32px; margin-top: 36px; }
.contacts div { border-top: 1px solid #444b53; padding-top: 14px; }
.contacts span { display: block; color: #aab1b9; font-size: 15px; }
.contacts a { font-size: 1.15rem; font-weight: 600; text-decoration: none; }

/* Подвал */
.foot { padding: 48px 0 56px; font-size: 15px; color: var(--muted); }
.foot .wrap { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li { margin-bottom: 6px; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--ink); }
.foot .brand { color: var(--ink); margin-bottom: 10px; }

/* Документ (политика) */
.doc { max-width: 760px; }
.doc h2 { font-size: 1.4rem; margin: 36px 0 12px; }

/* Телефон */
@media (max-width: 960px) {
  .hero .wrap, .split, .split.wide-left, .feature { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .split.phone { grid-template-columns: minmax(0, 1fr); }
  .split.phone .shot { max-width: 320px; }
  .journey li { grid-template-columns: 48px minmax(0, 1fr); }
  .journey li > div:last-child { grid-column: 2; margin-top: 8px; }
  .related, .contacts, .facts { grid-template-columns: minmax(0, 1fr); }
  .foot .wrap { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  body { font-size: 17px; }
  :root { --gutter: 16px; }
  section { padding: 60px 0; }
  .menu-toggle { display: block; }
  .nav { display: none; position: absolute; top: 68px; left: 0; right: 0; background: var(--paper); border-bottom: 1px solid var(--rule); flex-direction: column; align-items: flex-start; padding: 16px var(--gutter) 22px; gap: 14px; }
  .nav.open { display: flex; }
  .pains, .principles, .levels, .outputs { grid-template-columns: minmax(0, 1fr); }
  .hero { padding: 40px 0 56px; }
}
