/* ============================================================
   Главная 2026 — новые блоки ПОВЕРХ прежней главной.
   Прежняя главная целиком лежит в index-classic.html со своими
   стилями; этот файл её не трогает и подключается только на новой.

   Что здесь: вводный урок (hv-), своя TMS с живыми экранами (ws-/wt-),
   карточка «Звонок брокеру» в тренажёрах (bc-), вопросы и ответы
   (fq-) и несколько мелких правок первого экрана.

   Цвета — свои токены --hn-*: тёмные на :root, светлые на
   :root[data-theme="light"] (тот же атрибут ставит theme-boot).
   Генератор светлой темы (tools/light-theme) этот файл не обходит,
   поэтому обе темы заданы руками.

   Глобальные правила css/main.css ставят p { 18px; белый } и
   h1–h3 { 1.4; -0.5px } через !important — поэтому у абзацев и
   заголовков ниже свои !important, иначе их не перебить.
   ============================================================ */

:root {
  --hn-t1: #ffffff;
  --hn-t2: #e2e8f0;
  --hn-t3: #a3aec0;
  --hn-card: linear-gradient(160deg, rgba(18, 24, 40, .85), rgba(9, 12, 22, .92));
  --hn-line: rgba(255, 255, 255, .08);
  --hn-line-2: rgba(255, 255, 255, .14);
  --hn-accent: #22d3ee;
  --hn-accent-rgb: 6, 182, 212;
  --hn-shadow: 0 20px 60px rgba(0, 0, 0, .3);
  --hn-tag-bg: rgba(255, 255, 255, .05);
  --hn-free: #4ade80;
  --hn-pro: #fbbf24;
}
:root[data-theme="light"] {
  --hn-t1: #0f172a;
  --hn-t2: #334155;
  --hn-t3: #5a6675;
  --hn-card: #ffffff;
  --hn-line: rgba(15, 23, 42, .10);
  --hn-line-2: rgba(15, 23, 42, .18);
  --hn-accent: #0b5c74;
  --hn-accent-rgb: 8, 145, 178;
  --hn-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 12px 32px rgba(15, 23, 42, .10);
  --hn-tag-bg: rgba(15, 23, 42, .04);
  --hn-free: #047857;
  --hn-pro: #b45309;
}

/* ── Первый экран: флаги и звёзды рисуются SVG, а не эмодзи ──
   Эмодзи-флаги в Windows показываются буквами «RU»/«US», звёзды —
   разным цветом в разных системах. */
.hlt-flag { width: 18px; height: 12px; border-radius: 2px; flex: none; box-shadow: 0 0 0 1px rgba(255, 255, 255, .22); }
.stars { display: inline-flex; gap: 2px; letter-spacing: 0; }
.stars svg { width: 14px; height: 14px; fill: currentColor; }

/* ── Общее для новых секций ──────────────────────────────── */
.hn-section {
  position: relative;
  z-index: 1;
  padding: clamp(40px, 5vw, 72px) 0;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.hn-eyebrow {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--hn-accent);
  background: rgba(var(--hn-accent-rgb), .10);
  border: 1px solid rgba(var(--hn-accent-rgb), .35);
}
.hn-title {
  margin: 14px 0 10px;
  font-size: clamp(24px, 3.2vw, 34px);
  line-height: 1.15 !important;
  letter-spacing: -.5px !important;
}
.hn-sub {
  margin: 0 0 20px !important;
  font-size: 15px !important;
  line-height: 1.55 !important;
  font-weight: 500;
  color: var(--hn-t2) !important;
}

/* Кнопка — как у тренажёров (map-trainer-btn): тёмный текст на бирюзе,
   читается в обеих темах. */
.hn-btn, .wt-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: 0;
  border-radius: 100px;
  font: 800 14px/1.2 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #06283a;
  text-decoration: none;
  background: linear-gradient(135deg, #22d3ee, #06b6d4);
  box-shadow: 0 8px 22px rgba(6, 182, 212, .3);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .25s ease;
}
.hn-btn:hover, .wt-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(6, 182, 212, .42); }
.hn-btn:active, .wt-btn:active { transform: translateY(0); }
.hn-btn svg { width: 16px; height: 16px; fill: currentColor; }

/* Появление при прокрутке — только с JS и когда движение разрешено */
.hn-js .hn-rise { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.hn-js .hn-rise.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .hn-js .hn-rise { opacity: 1; transform: none; transition: none; }
}

/* ── Вводный урок ─────────────────────────────────────────── */
.hv-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
  gap: clamp(18px, 3vw, 36px);
  align-items: center;
  padding: clamp(16px, 2.4vw, 28px);
  border-radius: 20px;
  background: var(--hn-card);
  border: 1px solid var(--hn-line);
  box-shadow: var(--hn-shadow);
}
.hv-text .hn-title { margin-top: 14px; }
.hv-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 1px solid rgba(var(--hn-accent-rgb), .3);
  border-radius: 14px;
  overflow: hidden;
  background: #080d18;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .3);
  cursor: pointer;
}
.hv-thumb img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}
.hv-thumb:hover img { transform: scale(1.03); }
.hv-thumb::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8, 13, 24, 0) 40%, rgba(8, 13, 24, .55));
  transition: background .2s;
}
.hv-thumb:hover::after { background: rgba(8, 13, 24, .25); }
.hv-thumb:focus-visible { outline: 3px solid var(--hn-accent); outline-offset: 3px; }
.hv-play {
  position: absolute; left: 50%; top: 50%; z-index: 2;
  width: 64px; height: 64px; margin: -32px 0 0 -32px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #06b6d4, #0ea5e9);
  box-shadow: 0 8px 26px rgba(6, 182, 212, .45);
  transition: transform .2s;
}
.hv-play svg { width: 26px; height: 26px; fill: #fff; margin-left: 3px; }
.hv-thumb:hover .hv-play { transform: scale(1.08); }
.hv-dur {
  position: absolute; right: 10px; bottom: 10px; z-index: 2;
  padding: 3px 8px;
  border-radius: 6px;
  font: 700 12px/1.2 'Montserrat', sans-serif;
  color: #fff;
  background: rgba(0, 0, 0, .65);
}
@media (max-width: 760px) {
  .hv-card { grid-template-columns: 1fr; text-align: center; }
  .hv-thumb { order: -1; }
}

/* Окно с уроком поверх страницы: фрейм создаётся при открытии и убирается
   при закрытии, поэтому звук останавливается. Ширина ограничена и высотой
   экрана — на ноутбуке и на телефоне боком окно 16:9 иначе выше экрана. */
.hv-modal {
  position: fixed; inset: 0; z-index: 10050;
  display: flex; align-items: center; justify-content: center;
  padding: 56px 16px 16px;
  background: rgba(3, 6, 12, .86);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.hv-modal[hidden] { display: none; }
.hv-modal-box {
  position: relative;
  width: min(1180px, 100%, calc((100vh - 96px) * 16 / 9));
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  background: #080d18;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  animation: hvIn .22s ease both;
}
@supports (height: 100dvh) {
  .hv-modal-box { width: min(1180px, 100%, calc((100dvh - 96px) * 16 / 9)); }
}
.hv-modal-frame, .hv-modal-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.hv-close {
  position: fixed; top: 12px; right: 12px; z-index: 2;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .3);
  background: rgba(4, 6, 9, .9);
  color: #fff;
  font-size: 26px; line-height: 1;
  cursor: pointer;
}
.hv-close:hover { border-color: #fff; }
html.hv-lock, html.hv-lock body { overflow: hidden; }
@keyframes hvIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .hv-modal-box { animation: none; } }

/* ── Рабочие инструменты: TMS с живыми экранами ───────────── */
/* Карточка: первый ряд — текст слева, экраны справа (текст короткий, поэтому
   выровнен по центру экранов); второй ряд — возможности полосой на всю ширину.
   Список в левой колонке делал её вдвое выше экранов, справа под ними
   оставалась пустота. */
.ws-tms {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: clamp(20px, 3vw, 40px);
  align-items: center;
  padding: clamp(18px, 2.4vw, 28px);
  border-radius: 20px;
  background: var(--hn-card);
  border: 1px solid var(--hn-line);
  box-shadow: var(--hn-shadow);
}
.ws-tms-text { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ws-feats {
  grid-column: 1 / -1;
  list-style: none;
  margin: 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--hn-line);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}
.ws-feats li { font-size: 13px; line-height: 1.45; color: var(--hn-t2); min-width: 0; }
.ws-feats b { display: block; margin-bottom: 4px; font-size: 13.5px; line-height: 1.3; font-weight: 800; color: var(--hn-t1); }
.ws-feats svg { display: block; width: 20px; height: 20px; margin-bottom: 8px; color: var(--hn-accent); }
.ws-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 6px; }
.ws-note { font-size: 12.5px; line-height: 1.4; color: var(--hn-t3); }
@media (max-width: 1000px) { .ws-feats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 680px) { .ws-feats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 440px) { .ws-feats { grid-template-columns: 1fr; gap: 12px; } .ws-feats svg { margin-bottom: 6px; } }

.ws-shots { margin: 0; min-width: 0; }
.ws-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ws-tab {
  font: 700 12.5px/1.2 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--hn-t2);
  background: var(--hn-tag-bg);
  border: 1px solid var(--hn-line-2);
  border-radius: 20px;
  padding: 7px 14px;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.ws-tab:hover { color: var(--hn-t1); border-color: rgba(var(--hn-accent-rgb), .5); }
.ws-tab[aria-selected="true"] {
  background: linear-gradient(135deg, rgba(6, 182, 212, .25), rgba(14, 165, 233, .18));
  border-color: rgba(var(--hn-accent-rgb), .5);
  color: var(--hn-t1);
}
:root[data-theme="light"] .ws-tab[aria-selected="true"] { background: rgba(8, 145, 178, .12); }

/* «Окно браузера» — тёмная рамка в обеих темах, как кадр видео */
.ws-browser {
  border: 1px solid var(--hn-line-2);
  border-radius: 12px;
  overflow: hidden;
  background: #eef0f5;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .3);
}
.ws-bar {
  display: flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 10px;
  background: #111a2c;
  border-bottom: 1px solid #1e293b;
}
.ws-bar i { width: 8px; height: 8px; border-radius: 50%; background: #334155; }
.ws-url {
  flex: 1; min-width: 0; margin-left: 6px;
  padding: 5px 10px;
  border-radius: 5px;
  font: 500 11px/1.2 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-style: normal;
  color: #94a3b8;
  background: #0b1220;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ws-view { position: relative; aspect-ratio: 1004 / 560; overflow: hidden; background: #eef0f5; }
.ws-view img {
  position: absolute; top: 0; left: 0;
  width: 100%; height: auto; max-width: none;
  display: block;
  opacity: 0;
  transition: opacity .35s ease;
}
.ws-view img.is-on { opacity: 1; }
.ws-cap { margin: 10px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--hn-t3); min-height: 2.9em; }

@media (max-width: 900px) {
  .ws-tms { grid-template-columns: 1fr; }
  .ws-shots { order: -1; }
}

/* Плашки, заголовок и описание карточки TMS */
.wt-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.wt-tag {
  font-size: 11.5px; font-weight: 800; letter-spacing: .02em;
  padding: 4px 10px;
  border-radius: 100px;
  color: var(--hn-t2);
  background: var(--hn-tag-bg);
  border: 1px solid var(--hn-line-2);
}
.wt-tag.pro { color: var(--hn-pro); border-color: currentColor; background: transparent; }
.wt-name { margin: 0; font-size: 21px; line-height: 1.2 !important; letter-spacing: -.3px !important; }
.wt-desc {
  margin: 0 !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  font-weight: 500;
  color: var(--hn-t2) !important;
}

/* ── Тренажёры: три карточки в ряд ───────────────────────────
   В css/map-trainer-banner.css сетка auto-fit с минимумом 320px —
   при трёх карточках третья уходила одна на вторую строку. */
.tools-section > .container { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1000px) {
  .tools-section > .container { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tools-section .map-trainer-card:nth-child(4) { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  .tools-section > .container { grid-template-columns: 1fr; }
  .tools-section .map-trainer-card:nth-child(4) { grid-column: auto; }
}

/* Карточка «Звонок брокеру»: визуал звонка вместо картинки */
.bc-visual {
  width: 100%; max-width: 360px; height: 150px;
  border-radius: 14px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 0%, rgba(6, 182, 212, .25), transparent 60%), #0b1220;
  border: 1px solid #1e293b;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: #e2e8f0;
  font: 600 12px/1.3 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.bc-who { display: flex; align-items: center; gap: 8px; }
.bc-ava { width: 34px; height: 34px; flex: none; border-radius: 50%; background: linear-gradient(135deg, #f59e0b, #ef4444); display: grid; place-items: center; }
.bc-ava svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bc-who small { display: block; color: #94a3b8; font-weight: 500; }
.bc-wave { display: flex; align-items: center; gap: 3px; height: 28px; }
.bc-wave i { width: 4px; border-radius: 2px; background: #22d3ee; animation: bcWave 1.1s ease-in-out infinite; }
.bc-wave i:nth-child(odd) { animation-delay: -.4s; }
.bc-wave i:nth-child(3n) { animation-delay: -.7s; background: #0ea5e9; }
@keyframes bcWave { 0%, 100% { height: 6px; } 50% { height: 26px; } }
.bc-line { color: #cbd5e1; font-weight: 500; font-style: italic; }
@media (prefers-reduced-motion: reduce) { .bc-wave i { animation: none; height: 14px; } }

/* ── Вопросы и ответы ─────────────────────────────────────── */
.fq-section .section-description a {
  color: var(--hn-accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.fq-list { display: flex; flex-direction: column; gap: 10px; }
.fq-item {
  border-radius: 14px;
  background: var(--hn-card);
  border: 1px solid var(--hn-line);
  box-shadow: var(--hn-shadow);
  overflow: hidden;
  transition: border-color .2s ease;
}
.fq-item[open] { border-color: rgba(var(--hn-accent-rgb), .45); }
.fq-item summary {
  list-style: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 20px;
  font: 700 16px/1.35 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--hn-t1);
}
.fq-item summary::-webkit-details-marker { display: none; }
.fq-ic {
  position: relative; flex: none;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid var(--hn-line-2);
  transition: transform .25s ease, border-color .2s ease;
}
.fq-ic::before, .fq-ic::after {
  content: "";
  position: absolute; left: 50%; top: 50%;
  background: var(--hn-accent);
  transform: translate(-50%, -50%);
}
.fq-ic::before { width: 12px; height: 2px; }
.fq-ic::after { width: 2px; height: 12px; }
.fq-item[open] .fq-ic { transform: rotate(45deg); border-color: rgba(var(--hn-accent-rgb), .5); }
.fq-body { padding: 0 20px 18px; }
.fq-body p {
  margin: 0 !important;
  font-size: 14.5px !important;
  line-height: 1.6 !important;
  font-weight: 500;
  color: var(--hn-t2) !important;
}
@media (max-width: 480px) {
  .fq-item summary { padding: 14px 16px; font-size: 15px; }
  .fq-body { padding: 0 16px 16px; }
}

/* ── «Как это работает» (2026): шаги описаны абзацами, а не короткими
   строками, как раньше. В css/how-it-works.css раскрытый шаг на десктопе —
   две колонки в панели ~400px (текст ужимается в столбик 170px) и
   max-height 420/500px, которые режут абзацы. Здесь: одна колонка, панель
   пошире, запас по высоте — раскрытие через max-height остаётся прежним. */
@media (min-width: 769px) {
  .how-it-works-section .timeline-node.active { flex: 3.5 1 0%; }
  .how-it-works-section .timeline-node.active .node-content { max-height: 1000px; }
  .how-it-works-section .timeline-node.active .node-details {
    column-count: 1;
    max-height: 800px;
  }
}
@media (max-width: 768px) {
  .how-it-works-section .timeline-node.active .node-content { max-height: 1600px; }
  .how-it-works-section .timeline-node.active .node-details { max-height: 1200px; }
}

/* ── Кадр вводного урока на английской главной рисует сам плеер во фрейме
   (embed/course-intro.en.html?preview=1): статичной английской картинки нет.
   Фрейм не ловит события, поверх него прозрачная кнопка с «play». ─────── */
.hv-thumb-live { cursor: pointer; }
.hv-thumb-live .hv-live {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
  pointer-events: none;
  background: #080d18;
}
.hv-thumb-live::after { z-index: 1; pointer-events: none; }
.hv-thumb-btn {
  position: absolute; inset: 0; z-index: 2;
  width: 100%; height: 100%;
  padding: 0; border: 0;
  background: transparent;
  cursor: pointer;
}
.hv-thumb-btn:focus-visible { outline: 3px solid var(--hn-accent); outline-offset: 3px; }
.hv-thumb-live:hover .hv-play { transform: scale(1.08); }
