/**
 * HealthOS Academy public site.
 * Design system mirrors the HealthOS site family (header grid, full-bleed hero,
 * large type, dark gradient footer). The palette is the family's indigo
 * (shared with HealthOS ICU) — kin to, but distinct from, the Semantics teal.
 */

:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --surface: #fff;
  --surface-soft: #eef1f8;
  --ink: #151827;
  --muted: #5f677a;
  --line: #cdd3e2;
  --accent: #4338ca;
  --accent-dark: #312e81;
  --accent-soft: rgba(67, 56, 202, .08);
  --warn: #a66a16;
  --good: #20744e;
  --shadow: 0 18px 50px rgba(24, 27, 55, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.62;
  letter-spacing: 0;
}
a { color: var(--accent-dark); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

.skip-link { position: absolute; left: 1rem; top: -4rem; background: var(--ink); color: white; padding: .65rem .9rem; border-radius: 6px; z-index: 10; }
.skip-link:focus { top: 1rem; }

/* ── Header ───────────────────────────────────── */

.site-header { position: sticky; top: 0; z-index: 5; background: rgba(247, 248, 251, .93); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.site-header__inner { max-width: 1493px; margin: 0 auto; padding: .75rem clamp(.55rem, 2vw, 1rem); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .75rem; }
.brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--ink); text-decoration: none; font-weight: 750; white-space: nowrap; }
.brand img { width: 34px; height: 34px; border-radius: 6px; object-fit: contain; background: white; padding: 2px; }
.site-nav { display: flex; gap: .65rem; justify-content: center; flex-wrap: wrap; font-size: .92rem; }
.site-nav a { color: var(--muted); text-decoration: none; padding: .35rem .1rem; }
.site-nav a:hover { color: var(--ink); }
.site-nav a.active { color: var(--ink); font-weight: 700; }
.header-actions { display: flex; align-items: center; gap: .6rem; justify-self: end; }
.beta-badge { display: inline-flex; align-items: center; justify-content: center; min-height: 31px; padding: .32rem .62rem; border-radius: 999px; background: var(--accent); color: white; font-size: .74rem; font-weight: 820; line-height: 1; letter-spacing: .04em; white-space: nowrap; }
.lang-switcher { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: white; }
.lang-switcher a { padding: .32rem .55rem; text-decoration: none; font-size: .82rem; color: var(--muted); }
.lang-switcher a.active { background: var(--ink); color: white; }

/* ── Layout ───────────────────────────────────── */

.container { max-width: 1417px; margin: 0 auto; padding: clamp(1.2rem, 5vw, 3.5rem) clamp(1rem, 4vw, 2rem); }

main h1:not(.hero h1), main h2 { margin-top: 2.4rem; line-height: 1.15; }
main h1:not(.hero h1) { font-size: clamp(2rem, 4vw, 3.2rem); }
main h2 { font-size: clamp(1.65rem, 3vw, 2.4rem); }
main h3 { line-height: 1.2; }
main p, main li { color: #363c4f; }

/* ── Hero (full-bleed band, no photo) ─────────── */

.hero {
  width: 100vw;
  margin: calc(-1 * clamp(1.2rem, 5vw, 3.5rem)) calc(50% - 50vw) 0;
  padding: clamp(2.6rem, 7vw, 4.6rem) max(clamp(1rem, 4vw, 2rem), calc((100vw - 1417px) / 2 + 2rem)) clamp(1.6rem, 4vw, 2.6rem);
  background:
    radial-gradient(1100px 420px at 85% -10%, rgba(67, 56, 202, .14), transparent 60%),
    linear-gradient(160deg, #ffffff 0%, var(--surface-soft) 100%);
  border-bottom: 1px solid var(--line);
}
.hero__copy, .hero > * { max-width: 945px; }
.eyebrow { margin: 0 0 .8rem; text-transform: uppercase; font-size: .78rem; color: var(--accent-dark); font-weight: 800; letter-spacing: .06em; }
.hero h1 { margin: 0; font-size: clamp(2rem, 5.2vw, 4rem); line-height: 1.02; letter-spacing: -.01em; }
.lead { max-width: 820px; font-size: clamp(1.08rem, 2vw, 1.3rem); color: #363c4f; }
.hero-ctas { margin-top: 1.2rem; display: flex; flex-wrap: wrap; gap: .75rem; }
.hero-microcopy { margin-top: 1rem; max-width: 760px; color: var(--muted); font-size: .95rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: .65rem .95rem; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 720; max-width: 100%; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: white; }
.btn:hover { border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-dark); }

/* ── Stats ────────────────────────────────────── */

.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem; margin: 1rem 0 .4rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 1rem; }
.stat .stat-value { display: block; font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 800; color: var(--accent-dark); letter-spacing: -.01em; }
.stat .stat-label { font-size: .9rem; color: var(--muted); }
.stat-footnote { font-size: .85rem; color: var(--muted); margin-bottom: 1.4rem; }

/* ── Misc content blocks ──────────────────────── */

.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: .9rem; margin: 1rem 0 1.3rem; }
.two-col > div { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 1rem; }
.two-col h3 { margin-top: 0; }

.cta-band { margin-top: 3rem; padding: clamp(1.5rem, 4vw, 2.4rem); background: var(--ink); color: white; border-radius: 8px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.cta-band p { margin: 0; font-weight: 700; color: white; font-size: 1.08rem; }
.cta-band .btn:not(.primary) { background: rgba(255, 255, 255, .92); }

blockquote { margin: 1rem 0; padding: .8rem 1rem; border-left: 4px solid var(--accent); background: var(--surface); border-radius: 0 8px 8px 0; color: var(--muted); }

table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
th, td { text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); padding: .75rem .85rem; }
th { background: var(--surface-soft); color: var(--ink); }
td { color: #363c4f; }

pre { overflow: auto; border-radius: 8px; border: 1px solid var(--line); padding: 1rem; background: #eef1f8; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; background: var(--surface-soft); border-radius: 4px; padding: .08em .32em; }
pre code { background: none; padding: 0; }

figure { margin: 1.2rem 0; text-align: center; }
figure img { max-width: 100%; height: auto; border-radius: 8px; }

/* Схемы курсов — авторская SVG-графика (решение владельца В-75), форма взята с
   /ru/chain/ сайта HealthOS Semantics. Ширина задаётся процентом, а не пикселями:
   у схемы есть viewBox, поэтому она ужимается вместе с колонкой и горизонтальной
   прокрутки на узком экране не появляется.
   Фон и рамка нарисованы ЗДЕСЬ, а не внутри схемы: страница объявляет
   color-scheme: light, но браузер в тёмной теме может подложить свой фон под
   прозрачный SVG, и тёмный текст лёг бы на тёмное. Явная белая подложка снимает
   зависимость от темы читателя. */
figure.diagram { margin: 1.4rem 0 1.8rem; text-align: center; }
figure.diagram svg { display: block; width: 100%; height: auto; max-width: 760px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; }

.mermaid, pre.mermaid { display: flex; justify-content: center; background: white; border: 1px solid var(--line); border-radius: 8px; padding: 1rem; overflow-x: auto; }
.mermaid svg { display: block; max-width: 100%; height: auto; margin: 0 auto; }

/* ── Disclaimer + footer ──────────────────────── */

.disclaimer-band { max-width: 1417px; margin: 0 auto; padding: .9rem clamp(1rem, 4vw, 2rem); font-size: .82rem; color: var(--muted); }

.site-footer {
  border-top: 1px solid rgba(255, 255, 255, .08);
  padding: 1.2rem clamp(1rem, 4vw, 2rem);
  background: linear-gradient(90deg, rgba(13, 14, 33, .98) 0%, rgba(24, 26, 55, .98) 52%, rgba(67, 56, 202, .95) 100%);
  color: rgba(236, 238, 248, .84);
}
.site-footer__inner { max-width: 1417px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem 1.25rem; flex-wrap: wrap; font-size: .88rem; }
.site-footer a { color: rgba(255, 255, 255, .92); }
.site-footer a:hover { color: #c7d2fe; }

/* ── Responsive ───────────────────────────────── */

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

@media (max-width: 900px) {
  .site-header__inner { grid-template-columns: 1fr; justify-items: start; }
  .site-nav { justify-content: flex-start; }
  .header-actions { flex-wrap: wrap; justify-self: start; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer__inner { flex-direction: column; text-align: center; }
}

@media (max-width: 560px) {
  .hero h1 { font-size: clamp(1.7rem, 9vw, 2.6rem); }
  .hero-ctas { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; }
  .stat-row { grid-template-columns: 1fr; }
}

/* ── Academy (course cards + wizard microfrontend) ───────────── */

.academy-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: clamp(1.2rem, 3vw, 2rem); box-shadow: var(--shadow); margin: 2rem 0; }
.academy-card__eyebrow { margin: 0; color: var(--accent-dark); font-size: .82rem; font-weight: 780; letter-spacing: .06em; text-transform: uppercase; }
.academy-card h2 { margin-top: .6rem; }
.academy-card h3 { margin: .6rem 0 .4rem; font-size: clamp(1.25rem, 2.2vw, 1.6rem); }
.academy-card__meta { margin: .1rem 0 .8rem; color: var(--muted); font-size: .92rem; }
.academy-facts { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .5rem; }
.academy-facts li { padding: .55rem .8rem; background: var(--surface-soft); border-radius: 8px; }
.academy-card__cta { margin: 1.2rem 0 0; }

/* Правила мастера прохождения сняты в З-18 вместе с мастером: разметку .academy-wizard,
   .academy-part/-lesson/-quiz/-test/-option/-progressbar порождал только он, и на витрине
   её не осталось ни на одной странице (замер: 0 вхождений в docs/landings/academy/{ru,en}
   и в templates/). Ниже — то, что мастеру не принадлежит: шапка с кнопкой на странице
   «Вход» (замер: 2 вхождения .academy-head__actions). */
.academy-head__actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; align-items: center; }

@media (max-width: 640px) {
  .academy-head__actions .btn { width: auto; }
}

/* ── Сводка курса рядом со схемой (образец § 3 плана доработки) ── */

.course-brief { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.course-brief__text { min-width: 0; }
.course-brief__figure { min-width: 0; overflow-x: auto; }
.course-brief__figure svg { max-width: 100%; height: auto; }
.course-brief__figure pre { white-space: pre; overflow-x: auto; }

@media (max-width: 860px) {
  .course-brief { grid-template-columns: 1fr; }
}
