/* Блог SHAI — в системе shai.pro: Manrope, бирюзовый бренд, тёмный #2c2b2f,
   кнопки-пилюли 48px. Одна сетка для всех страниц: .wrap — 1240px контента,
   поля по бокам 16 → 40px. */

:root {
  --ink: #2c2b2f;
  --text: #2c2b2f;
  --text-2: #5b6166;
  --line: #e2e6e6;
  --smoke: #f1f3f3;
  --white: #fff;
  --brand: #49a598;
  --brand-ink: #2a776c;
  --brand-dark: #123437;
  --brand-on-dark: #5cbfb0;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 24px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

p,
li,
figcaption {
  text-wrap: pretty;
}

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

a {
  color: var(--brand-ink);
}

::selection {
  background: rgba(73, 165, 152, 0.25);
}

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

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--brand-dark);
  color: #fff;
}
.skip:focus {
  top: 12px;
}

.wrap {
  width: 100%;
  max-width: calc(1240px + 2 * var(--gutter));
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 40px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.btn--primary {
  background: var(--brand-ink);
  color: #fff;
}
.btn--primary:hover {
  background: var(--brand-dark);
  color: #fff;
}
.btn--ghost {
  border-color: #d5dbdb;
  color: var(--text);
  background: transparent;
}
.btn--ghost:hover {
  border-color: var(--brand-ink);
  color: var(--brand-ink);
}
.btn--block {
  width: 100%;
}
.linklike {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

/* ---------- шапка ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  /* без backdrop-filter: он ломает position:fixed у мобильного меню */
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.header__bar {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 76px;
}
.header__logo {
  flex: none;
  display: block;
}
.header__logo img {
  width: 110px;
  height: 36px;
}
.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-right: auto;
}
.nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
}
.nav a:hover {
  color: var(--brand-ink);
}
.nav a[aria-current='page'] {
  color: var(--brand-ink);
  font-weight: 700;
}
.nav__cta {
  display: none;
}
.header__right {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: none;
}
.langs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  color: #9aa0a4;
}
.langs a {
  color: var(--text-2);
  text-decoration: none;
  padding: 10px 2px;
}
.langs a[aria-current='true'] {
  color: var(--brand-ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
}
.burger span {
  display: block;
  height: 2.5px;
  border-radius: 2px;
  background: var(--brand-dark);
  transition: transform 0.25s var(--ease), opacity 0.2s;
}
.menu-open .burger span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}
.menu-open .burger span:nth-child(2) {
  opacity: 0;
}
.menu-open .burger span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

@media (max-width: 1023px) {
  .header__bar {
    height: 64px;
    gap: 16px;
  }
  .header__logo {
    margin-right: auto;
  }
  .header__cta {
    display: none;
  }
  .burger {
    display: inline-flex;
  }
  .nav {
    position: fixed;
    top: 65px;
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 8px var(--gutter) 32px;
    background: #fff;
    overflow-y: auto;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s var(--ease), transform 0.25s var(--ease), visibility 0s linear 0.25s;
  }
  .menu-open .nav {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity 0.2s var(--ease), transform 0.25s var(--ease);
  }
  .menu-open {
    overflow: hidden;
  }
  .nav a {
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
    font-size: 18px;
    font-weight: 600;
  }
  .nav__cta {
    display: inline-flex;
    margin-top: 24px;
  }
}

/* ---------- типографика ---------- */
.eyebrow {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-ink);
}
.h1 {
  margin: 12px 0 0;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  text-wrap: balance;
}
.lead {
  margin: 16px 0 0;
  max-width: 62ch;
  font-size: clamp(17px, 1.6vw, 19px);
  line-height: 1.6;
  color: var(--text-2);
  text-wrap: pretty;
}

/* ---------- лента ---------- */
.page {
  padding-top: clamp(40px, 6vw, 72px);
  padding-bottom: clamp(64px, 8vw, 112px);
}
.page--narrow {
  min-height: 50vh;
}
.page__head {
  max-width: 760px;
}
.cards {
  list-style: none;
  margin: clamp(32px, 4vw, 48px) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
@media (max-width: 1023px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 639px) {
  .cards {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
  transition: border-color 0.2s var(--ease), box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}
.card:hover {
  border-color: #cfd8d7;
  box-shadow: 0 16px 32px -20px rgba(18, 52, 55, 0.25);
  transform: translateY(-2px);
}
.card:focus-within {
  border-color: var(--brand-ink);
}
.card__media {
  aspect-ratio: 16 / 9;
  background: var(--smoke);
  overflow: hidden;
}
.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
}
.card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 24px;
}
.card__meta,
.article__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin: 0;
  font-size: 14px;
  color: var(--text-2);
}
.card__source {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 20px;
  background: var(--smoke);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
.card__title {
  margin: 10px 0 0;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.card__title a {
  color: var(--text);
  text-decoration: none;
}
/* вся карточка кликабельна, ссылка одна — для скринридеров без дублей */
.card__title a::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}
.card__title a:focus-visible {
  outline: none;
}
.card__descr {
  margin: 10px 0 0;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-2);
  text-wrap: pretty;
}
.card__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 20px;
  font-size: 15px;
  font-weight: 700;
  color: var(--brand-ink);
}
.card__more svg {
  transition: transform 0.2s var(--ease);
}
.card:hover .card__more svg {
  transform: translateX(3px);
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 48px;
}
.pager__info {
  font-size: 15px;
  color: var(--text-2);
}

/* ---------- статья ---------- */
.article {
  padding-top: clamp(24px, 4vw, 40px);
  padding-bottom: clamp(64px, 8vw, 112px);
}
.article > * {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}
.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
  color: #9aa0a4;
}
.crumbs a {
  color: var(--text-2);
  text-decoration: none;
}
.crumbs a:hover {
  color: var(--brand-ink);
}
.article__head {
  margin-top: clamp(24px, 4vw, 40px);
}
.article__title {
  margin-top: 14px;
}
.article__lead {
  max-width: none;
}
.article__cover {
  max-width: 760px;
  margin-top: clamp(28px, 4vw, 40px);
  margin-bottom: 0;
  padding: 0;
  border-radius: var(--radius);
  background: var(--smoke);
  overflow: hidden;
}
/* обложка без искажений: вертикальные не растягиваются, а встают по центру */
.article__cover img {
  width: auto;
  max-width: 100%;
  max-height: 560px;
  margin: 0 auto;
  object-fit: contain;
}
.article__external {
  margin-top: 32px;
}

/* Тексты статей приходят из админки (часто из Word): приводим к одному стилю */
.prose {
  margin-top: clamp(28px, 4vw, 40px);
  font-size: 18px;
  line-height: 1.7;
  color: var(--text);
  overflow-wrap: anywhere;
}
.prose * {
  font-family: inherit !important;
  font-size: inherit !important;
  line-height: inherit !important;
  color: inherit !important;
  background: transparent !important;
  letter-spacing: normal !important;
}
.prose p,
.prose ul,
.prose ol,
.prose table,
.prose blockquote {
  margin: 0 0 20px;
}
.prose h2,
.prose h3 {
  margin: 40px 0 12px;
  line-height: 1.25 !important;
  font-weight: 800;
  letter-spacing: -0.01em !important;
  text-wrap: balance;
}
.prose h2 {
  font-size: clamp(22px, 2.4vw, 28px) !important;
}
.prose h3 {
  font-size: 21px !important;
}
.prose ul,
.prose ol {
  padding-left: 1.3em;
}
.prose li {
  margin: 0 0 10px;
  padding-left: 4px;
}
.prose li::marker {
  color: var(--brand-ink);
}
.prose a {
  color: var(--brand-ink) !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.prose img {
  border-radius: 16px;
  margin: 8px auto;
}
.prose table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 15px !important;
}
.prose td,
.prose th {
  padding: 10px 12px;
  border: 1px solid var(--line);
  vertical-align: top;
}
.prose blockquote {
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--brand);
  color: var(--text-2) !important;
}

.about {
  margin-top: 56px;
  padding: clamp(24px, 4vw, 40px);
  border-radius: var(--radius);
  background: var(--ink);
  color: #c9cdd0;
}
.about__title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
}
.about p {
  margin: 12px 0 0;
  line-height: 1.6;
  text-wrap: pretty;
}
.about__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}
.about .btn--primary {
  background: #fff;
  color: var(--brand-ink);
}
.about .btn--primary:hover {
  background: var(--smoke);
}
.about .btn--ghost {
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}
.about .btn--ghost:hover {
  border-color: var(--brand-on-dark);
  color: var(--brand-on-dark);
}
.article__back {
  margin-top: 32px;
}
.article__back a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-weight: 700;
  text-decoration: none;
}

/* ---------- подвал ---------- */
.footer {
  background: var(--ink);
  color: #c9cdd0;
  padding: clamp(48px, 6vw, 72px) 0 32px;
  font-size: 15px;
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
  gap: 40px;
}
@media (max-width: 1023px) {
  .footer__grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer__brand {
    grid-column: 1 / -1;
  }
}
@media (max-width: 479px) {
  .footer__grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}
.footer__logo img {
  filter: brightness(0) invert(1);
}
.footer__brand p {
  margin: 16px 0 0;
  max-width: 44ch;
  line-height: 1.6;
}
.footer__label {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
}
.footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.footer li a,
.footer .linklike {
  display: inline-block;
  padding: 6px 0;
  color: #c9cdd0;
  text-decoration: none;
}
.footer li a:hover,
.footer .linklike:hover {
  color: var(--brand-on-dark);
}
.footer__muted {
  padding: 6px 0;
  line-height: 1.5;
}
.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 14px;
  color: #a3a9ad;
}
.footer__hub {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.footer__hub img {
  height: 20px;
  width: auto;
}

/* ---------- форма ---------- */
.modal[hidden] {
  display: none;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 16px;
}
.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(18, 52, 55, 0.55);
}
.modal__box {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 32px;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 24px 64px -24px rgba(0, 0, 0, 0.4);
}
.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}
.modal__close:hover {
  background: var(--smoke);
}
.modal__title {
  margin: 0 40px 20px 0;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.25;
}
#forInvestorsText {
  margin: 0 0 16px;
  color: var(--text-2);
}
.field {
  display: block;
  margin-bottom: 16px;
}
.field span {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
}
.field input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid #d5dbdb;
  border-radius: 14px;
  font: inherit;
  font-size: 16px;
  color: var(--text);
}
.field input:focus {
  outline: none;
  border-color: var(--brand-ink);
  box-shadow: 0 0 0 3px rgba(42, 119, 108, 0.15);
}
.modal__success p {
  margin: 8px 0 0;
  color: var(--text-2);
}

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

/* ---------- плавающая кнопка WhatsApp (как на shai.pro) ---------- */
/* z-index ниже шапки (50) и окна формы (200) */
.wa-fab {
  position: fixed;
  z-index: 40;
  right: calc(16px + env(safe-area-inset-right, 0px));
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  width: 56px;
  height: 56px;
  border-radius: 50%;
  box-shadow:
    0 12px 30px -12px rgba(18, 52, 55, 0.18),
    0 4px 10px -6px rgba(18, 52, 55, 0.12);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.wa-fab:hover {
  transform: scale(1.06);
}
.wa-fab img {
  display: block;
  width: 100%;
  height: 100%;
}
@media (min-width: 761px) {
  .wa-fab {
    right: calc(64px + env(safe-area-inset-right, 0px));
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }
}
@media (prefers-reduced-motion: reduce) {
  .wa-fab {
    transition: none;
  }
}
