/* Onest: та же гарнитура и те же подмножества, что у портала (apps/web-app/src/styles/index.css). */
@font-face { font-family: "Onest"; font-style: normal; font-weight: 300 900; font-display: swap; src: url("/fonts/onest-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 300 900; font-display: swap; src: url("/fonts/onest-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 300 900; font-display: swap; src: url("/fonts/onest-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20BC, U+20BE-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 300 900; font-display: swap; src: url("/fonts/onest-ruble.woff2") format("woff2"); unicode-range: U+20BD; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 300 900; font-display: swap; src: url("/fonts/onest-cyrillicext.woff2") format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
/* Блог banan.it.com, вариант A «Витрина»: статья читается как посадочная.
   Герой в фиолетовой ночи несёт заголовок и первую пару «до/после», дальше белый лист
   текста, кнопка «Сделать так же» всегда под рукой: внизу экрана на телефоне, в шапке на компьютере. */
:root {
  color-scheme: light;
  --ink: #1a1916;
  --ink-2: #57554f;
  --ink-3: #66645e;
  --paper: #ffffff;
  --sand: #f6f5f1;
  --line: rgba(26, 25, 22, 0.12);
  --violet: #5f44df;
  --violet-2: #4a30c0;
  --tint: #efebff;
  --night: #1d1740;
  --on-night: #ffffff;
  --on-night-2: #d9d4f2;
  --radius: 14px;
  --col: 680px;
  --wide: 872px; /* две картинки по 384 px: файл 768 px без растяжения на экране 2x */
  --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.62 var(--font); font-feature-settings: "kern", "liga"; -webkit-font-smoothing: antialiased; overflow-x: clip; }
img { max-width: 100%; }
a { color: var(--violet-2); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--violet); }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; border-radius: 6px; }
.hero :focus-visible { outline-color: #ffffff; }

/* Шапка */
.top { position: relative; z-index: 20; background: rgba(255, 255, 255, 0.94); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1160px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; min-height: 56px; }
.home { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 650; font-size: 15px; text-decoration: none; }
.home img { width: 28px; height: 28px; border-radius: 8px; }
.top .go { margin-left: auto; display: none; }

/* Кнопка действия: единственный фиолетовый на странице */
.btn, .go, .dock a { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 12px; background: linear-gradient(180deg, var(--violet) 0%, var(--violet-2) 100%); color: #ffffff; font: 650 16px/1.2 var(--font); text-decoration: none; box-shadow: 0 10px 24px -14px rgba(74, 48, 192, 0.7); }
.btn:hover, .go:hover, .dock a:hover { color: #ffffff; background: linear-gradient(180deg, #6c53e8 0%, var(--violet-2) 100%); }

/* Герой */
.hero { background: var(--night); color: var(--on-night); }
.hero-in { max-width: 1160px; margin: 0 auto; padding: 26px 16px 30px; display: flex; flex-direction: column; }
.hero h1 { order: 1; margin: 0; font-weight: 760; font-size: 29px; line-height: 1.12; letter-spacing: -0.02em; text-wrap: balance; }
.hero .hero-media { order: 2; margin: 20px 0 0; }
.hero .meta, .hero .muted { order: 3; margin: 18px 0 0; color: var(--on-night-2); font-size: 14px; line-height: 1.5; }
.hero .answer { order: 4; margin: 10px 0 0; font-size: 17px; line-height: 1.6; color: #f3f1fb; max-width: 62ch; }
.hero .banner { display: block; width: 100%; height: auto; border-radius: var(--radius); }

/* Пары «до/после» */
.pair { margin: 22px 0 8px; }
.pair-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pair-grid.four { grid-template-columns: 1fr 1fr; }
.cell { margin: 0; min-width: 0; display: flex; flex-direction: column-reverse; }
.shot { margin: 0; border-radius: var(--radius); overflow: hidden; background: #ece9e2; aspect-ratio: 3 / 4; }
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tag { align-self: flex-start; margin: 0 0 8px; padding: 3px 10px; border-radius: 999px; background: var(--sand); color: var(--ink); font-size: 14px; font-weight: 650; line-height: 1.4; }
.tag.after { background: var(--violet-2); color: #ffffff; }
.hero .tag:not(.after) { background: rgba(255, 255, 255, 0.14); color: #ffffff; }
.pair figcaption { color: var(--ink-2); font-size: 15px; line-height: 1.5; margin-top: 10px; }
/* На телефоне результаты в листе идут от края до края экрана */
@media (max-width: 759px) {
  .sheet .pair { margin-left: -16px; margin-right: -16px; }
  .sheet .pair-grid { gap: 3px; }
  .sheet .shot { border-radius: 0; }
  .sheet .pair-grid > .cell:nth-child(odd) .tag { margin-left: 16px; }
  .sheet .pair figcaption { padding: 0 16px; }
}
.hero .pair { margin: 0; }
.hero .pair figcaption { color: var(--on-night-2); }
.gallery { display: grid; grid-template-columns: 1fr; gap: 18px; }
.gallery .pair { margin: 0; }
.video { margin: 22px 0 8px; max-width: 360px; }
.video video { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; border-radius: var(--radius); background: #ece9e2; }
.video figcaption { color: var(--ink-2); font-size: 15px; margin-top: 10px; }

/* Лист статьи */
.sheet { max-width: var(--col); margin: 0 auto; padding: 26px 16px 40px; }
.sheet > p, .sheet > ul, .sheet > ol { margin: 0 0 14px; }
.sheet li { margin: 6px 0; }
h2 { margin: 44px 0 12px; font-weight: 720; font-size: 23px; line-height: 1.22; letter-spacing: -0.015em; text-wrap: balance; }
h3 { margin: 28px 0 8px; font-weight: 680; font-size: 19px; line-height: 1.3; }
.meta, .muted { color: var(--ink-3); font-size: 14px; }

/* «Коротко» */
.short, .capsule { margin: 0 0 22px; padding: 18px 18px 16px; border-radius: var(--radius); background: var(--sand); }
.short strong { display: block; font-size: 15px; font-weight: 720; margin-bottom: 6px; }
.short ul { list-style: none; margin: 0; padding: 0; }
.short li { position: relative; margin: 8px 0 0; padding-left: 28px; }
.short li::before { content: ""; position: absolute; left: 2px; top: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--violet-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2l2.2 2.2 4.8-4.8' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat; }

/* Таблица */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 8px 0 8px; font-size: 16px; line-height: 1.45; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
caption { caption-side: top; text-align: left; font-weight: 720; font-size: 17px; padding: 0 0 10px; }
th, td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { background: var(--sand); font-weight: 650; font-size: 14px; color: var(--ink-2); }
tbody tr:last-child td { border-bottom: 0; }
tbody td:first-child { font-weight: 620; }
.src { color: var(--ink-3); font-size: 14px; line-height: 1.5; margin: 6px 0 0; }
.tpl { margin: 10px 0 16px; padding: 14px 16px; border-radius: 12px; background: var(--sand); border: 1px dashed rgba(26, 25, 22, 0.24); white-space: pre-wrap; font: inherit; font-size: 16px; line-height: 1.6; }
.sheet .muted { margin: 0 0 14px; }

/* Вопросы */
details { border-bottom: 1px solid var(--line); }
details:first-of-type { border-top: 1px solid var(--line); }
details summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 14px; padding: 16px 0; font-weight: 650; font-size: 17px; line-height: 1.4; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: ""; flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; background: var(--tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M11 6v10M6 11h10' stroke='%234a30c0' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / 22px no-repeat; transition: transform 0.2s ease; }
details[open] summary::after { transform: rotate(45deg); }
details p { margin: 0 0 16px; color: var(--ink); }

/* Финальный призыв */
.cta { margin: 44px 0 8px; padding: 26px 20px 22px; border-radius: 18px; background: var(--night); color: var(--on-night); text-align: center; }
.cta a.btn, .cta > p > a { width: 100%; max-width: 420px; min-height: 54px; font-size: 17px; }
.cta > p > a { display: inline-flex; align-items: center; justify-content: center; padding: 12px 20px; font-weight: 650; border-radius: 12px; background: linear-gradient(180deg, var(--violet) 0%, var(--violet-2) 100%); color: #ffffff; text-decoration: none; line-height: 1.35; }
.cta p { margin: 12px 0 0; color: var(--on-night-2); font-size: 14px; }
.cta > p:first-child { margin-top: 0; }
.cta :focus-visible { outline-color: #ffffff; }
.related { max-width: var(--col); margin: 0 auto; padding: 0 16px 40px; color: var(--ink-2); font-size: 15px; line-height: 1.7; }

/* Нижняя плашка на телефоне */
.dock { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 12px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); transition: transform 0.25s ease; }
.dock img { flex: none; width: 44px; height: 44px; border-radius: 10px; object-fit: cover; }
.dock a { flex: 1; }
.dock.is-off { transform: translateY(110%); }
body:has(.dock) { padding-bottom: 76px; }

@media (min-width: 760px) {
  .top .go { display: inline-flex; min-height: 42px; padding: 0 18px; font-size: 15px; }
  .dock { display: none; }
  body:has(.dock) { padding-bottom: 0; }
  .top { position: sticky; top: 0; }
  .hero-in { padding: 56px 24px 60px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: 1fr auto auto auto 1fr; column-gap: 56px; }
  .hero h1 { grid-column: 1; grid-row: 2; font-size: 44px; line-height: 1.08; }
  .hero .meta, .hero .muted { grid-column: 1; grid-row: 3; }
  .hero .answer { grid-column: 1; grid-row: 4; font-size: 18px; }
  .hero .hero-media { grid-column: 2; grid-row: 1 / span 5; margin: 0; align-self: center; }
  .hero .pair:has(.four) { max-width: 400px; margin-left: auto; }
  .sheet { padding: 44px 24px 56px; font-size: 18px; }
  .sheet .pair, .sheet .gallery { margin-left: calc((var(--col) - var(--wide)) / 2 + 24px); margin-right: calc((var(--col) - var(--wide)) / 2 + 24px); }
  .pair-grid.four { grid-template-columns: repeat(4, 1fr); }
  .hero .pair-grid.four { grid-template-columns: 1fr 1fr; }
  .gallery { grid-template-columns: 1fr 1fr; gap: 26px 20px; }
  h2 { font-size: 28px; margin-top: 56px; }
  .cta { padding: 36px 32px 30px; }
  .related { padding-left: 24px; padding-right: 24px; }
}
@media (max-width: 759px) {
  th, td { padding: 10px 12px; }
  table.stack:has(thead th:nth-child(3)), table.stack:has(thead th:nth-child(3)) tbody, table.stack:has(thead th:nth-child(3)) tr, table.stack:has(thead th:nth-child(3)) td { display: block; width: 100%; }
  table.stack:has(thead th:nth-child(3)) { border: 0; border-radius: 0; overflow: visible; }
  table.stack:has(thead th:nth-child(3)) caption { display: block; width: 100%; }
  table.stack:has(thead th:nth-child(3)) thead { display: none; }
  table.stack:has(thead th:nth-child(3)) tr { border: 1px solid var(--line); border-radius: 12px; margin: 0 0 10px; overflow: hidden; }
  table.stack:has(thead th:nth-child(3)) td { border: 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 38% 1fr; gap: 10px; }
  table.stack:has(thead th:nth-child(3)) td:first-child { display: block; border-top: 0; background: var(--sand); font-weight: 680; }
  table.stack:has(thead th:nth-child(3)) td[data-label]::before { content: attr(data-label); color: var(--ink-3); font-size: 14px; font-weight: 600; line-height: 1.45; }
}
/* Индекс блога */
.blog-hero .hero-in { display: block; padding-bottom: 34px; }
.blog-hero h1 { font-size: 34px; }
.blog-hero p { max-width: 62ch; margin: 14px 0 0; color: #f3f1fb; font-size: 17px; line-height: 1.6; }
.blog-hero p.muted { color: var(--on-night-2); font-size: 14px; }
.posts { max-width: 1160px; margin: 0 auto; padding: 28px 16px 40px; display: grid; gap: 34px; }
.post { margin: 0; min-width: 0; }
.post .thumb { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: var(--radius); background: #ece9e2; }
.post h2 { margin: 14px 0 6px; font-size: 20px; line-height: 1.25; }
.post h2 a { color: var(--ink); text-decoration: none; }
.post h2 a:hover { color: var(--violet-2); text-decoration: underline; }
.post p { margin: 0 0 6px; color: var(--ink-2); font-size: 16px; line-height: 1.5; }
.post p.muted { color: var(--ink-3); font-size: 14px; }
.index-foot { max-width: 1160px; margin: 0 auto; padding: 0 16px 48px; color: var(--ink-2); font-size: 15px; }
@media (min-width: 760px) {
  .blog-hero .hero-in { padding: 56px 24px 52px; }
  .blog-hero h1 { font-size: 52px; }
  .posts { grid-template-columns: 1fr 1fr; gap: 44px 28px; padding: 48px 24px 56px; }
  .index-foot { padding: 0 24px 56px; }
}
@media (min-width: 1100px) { .posts { grid-template-columns: repeat(3, 1fr); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
