/* ============================================================
   «Как выглядит учёба изнутри» — секция главной сразу после
   первого экрана (заменила сетку карточек «Закрытое комьюнити»).

   Слева список из шести пунктов, справа «экран», на котором
   проигрывается короткая сцена-пример. Пункты переключаются сами
   (полоска под активным пунктом — таймер), после нажатия
   переключение только вручную. Логика — js/inside-course.js.

   Сцены — учебные иллюстрации, не платный материал. Цифры под
   сценами только проверенные (источники — в комментарии у секции
   в index.html).

   Цвета — свои токены --ic-*: тёмные на :root, светлые на
   :root[data-theme="light"]; генератор светлой темы этот файл не
   обходит. Глобальные p/h3 из css/main.css идут с !important,
   поэтому внутри сцен абзацев и h3 нет — только div/span/b.
   ============================================================ */

:root {
  --ic-t1: #ffffff;
  --ic-t2: #dbe3ee;
  --ic-t3: #9aa7b9;
  --ic-panel: linear-gradient(160deg, rgba(18, 24, 40, .88), rgba(8, 11, 20, .94));
  --ic-tab: rgba(255, 255, 255, .03);
  --ic-tab-on: rgba(255, 255, 255, .07);
  --ic-line: rgba(255, 255, 255, .08);
  --ic-line-2: rgba(255, 255, 255, .15);
  --ic-bubble: rgba(255, 255, 255, .07);
  --ic-shadow: 0 24px 60px rgba(0, 0, 0, .35);
  --ic-ok: #34d399;
  --ic-warn: #fbbf24;
  --ic-bad: #f87171;
}
:root[data-theme="light"] {
  --ic-t1: #0f172a;
  --ic-t2: #334155;
  --ic-t3: #5a6675;
  --ic-panel: #ffffff;
  --ic-tab: rgba(15, 23, 42, .03);
  --ic-tab-on: #ffffff;
  --ic-line: rgba(15, 23, 42, .10);
  --ic-line-2: rgba(15, 23, 42, .18);
  --ic-bubble: rgba(15, 23, 42, .05);
  --ic-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 14px 36px rgba(15, 23, 42, .10);
  --ic-ok: #047857;
  --ic-warn: #b45309;
  --ic-bad: #b91c1c;
}

.ic-section { padding: clamp(40px, 5vw, 64px) 0; }
.ic-section .container { max-width: 1120px; }
.ic-section .section-header { margin-bottom: 32px; }

/* ── Раскладка ───────────────────────────────────────────── */
.ic {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 20px;
  align-items: stretch;
}

/* ── Список пунктов ──────────────────────────────────────── */
.ic-list { display: flex; flex-direction: column; gap: 8px; }

.ic-tab {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  width: 100%;
  padding: 14px 16px 16px;
  text-align: left;
  font: inherit;
  color: var(--ic-t1);
  background: var(--ic-tab);
  border: 1px solid var(--ic-line);
  border-radius: 14px;
  cursor: pointer;
  overflow: hidden;
  transition: background .25s, border-color .25s, transform .25s;
}
.ic-tab:hover { border-color: var(--ic-line-2); }
.ic-tab[aria-selected="true"] {
  background: var(--ic-tab-on);
  border-color: rgba(var(--acc-s), .45);
  box-shadow: 0 0 0 1px rgba(var(--acc-s), .12), 0 10px 28px rgba(var(--acc-s), .10);
}
.ic-tab:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

.ic-n {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  color: var(--acc);
  background: rgba(var(--acc-s), .12);
  border: 1px solid rgba(var(--acc-s), .28);
  font-variant-numeric: tabular-nums;
}
.ic-tx { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ic-tx b { font-size: 16px; font-weight: 800; line-height: 1.3; color: var(--ic-t1); }
.ic-tx i { font-style: normal; font-size: 13.5px; line-height: 1.45; color: var(--ic-t3); }
.ic-tab[aria-selected="true"] .ic-tx i { color: var(--ic-t2); }

/* Таймер автопереключения: полоска внизу активного пункта */
.ic-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: var(--acc);
  transform: scaleX(0);
  transform-origin: left;
  opacity: 0;
}
.ic.is-auto .ic-tab[aria-selected="true"] .ic-bar {
  opacity: .9;
  animation: ic-fill var(--ic-dur, 9s) linear forwards;
}
.ic.is-paused .ic-tab[aria-selected="true"] .ic-bar { animation-play-state: paused; }
@keyframes ic-fill { to { transform: scaleX(1); } }

/* ── Экран ───────────────────────────────────────────────── */
.ic-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 480px;
  background: var(--ic-panel);
  border: 1px solid var(--ic-line);
  border-radius: 18px;
  box-shadow: var(--ic-shadow);
  overflow: hidden;
}
.ic-scene::before { /* мягкий свет цвета текущей сцены */
  content: '';
  position: absolute;
  inset: -40% -20% auto auto;
  width: 70%;
  height: 80%;
  background: radial-gradient(closest-side, rgba(var(--acc-s), .16), transparent);
  pointer-events: none;
  z-index: -1;
}
:root[data-theme="light"] .ic-scene::before { background: radial-gradient(closest-side, rgba(var(--acc-s), .08), transparent); }

/* Высоту экрана задаёт min-height и строка сетки (высота списка слева). Лента
   переписки — flex-basis 0: в высоту экрана она не вкладывается, а занимает
   свободное место, старые сообщения уходят вверх под маску. Остальные сцены
   своей высоты не теряют: если не влезут, экран просто станет выше. */
.ic-scene { display: none; position: relative; isolation: isolate; flex: 1 0 auto; flex-direction: column; padding: 18px 20px 16px; }
.ic-scene.is-on { display: flex; }

.ic-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--ic-line);
  font-size: 13px;
  font-weight: 700;
  color: var(--ic-t2);
}
.ic-top svg { width: 18px; height: 18px; color: var(--acc); flex: none; }
.ic-tag {
  margin-left: auto;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--ic-t3);
  border: 1px solid var(--ic-line-2);
  white-space: nowrap;
}
.ic-body { flex: 1 0 auto; display: flex; flex-direction: column; }

.ic-fact {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--ic-line);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 600;
  color: var(--ic-t2);
}
.ic-fact svg { width: 16px; height: 16px; flex: none; margin-top: 1px; color: var(--acc); }

/* Появление элементов сцены: --i — порядковый номер, шаг задаёт сцена */
.ic-scene.is-on .ic-in {
  animation: ic-in .45s cubic-bezier(.2, .7, .2, 1) both;
  animation-delay: calc(var(--i, 0) * var(--step, .9s) + .2s);
}
@keyframes ic-in { from { opacity: 0; transform: translateY(8px); } }

/* ── 1. Звонок брокеру ───────────────────────────────────── */
.ic-chat {
  --step: 1s;
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 32px);
  mask-image: linear-gradient(to bottom, transparent 0, #000 32px);
}
.ic-msg {
  max-width: 82%;
  padding: 9px 13px;
  border-radius: 14px 14px 14px 4px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ic-t1);
  background: var(--ic-bubble);
  border: 1px solid var(--ic-line);
}
.ic-msg small { display: block; margin-bottom: 2px; font-size: 11px; font-weight: 700; color: var(--ic-t3); }
.ic-msg.me {
  align-self: flex-end;
  border-radius: 14px 14px 4px 14px;
  background: rgba(var(--acc-s), .14);
  border-color: rgba(var(--acc-s), .30);
}
/* сообщения «вырастают» и подталкивают ленту вверх, как в мессенджере */
.ic-scene.is-on .ic-msg {
  animation: ic-grow .5s cubic-bezier(.2, .7, .2, 1) both;
  animation-delay: calc(var(--i, 0) * var(--step, 1s) + .2s);
}
@keyframes ic-grow {
  from { opacity: 0; max-height: 0; padding-block: 0; margin-top: -8px; transform: translateY(10px); }
  to { opacity: 1; max-height: 140px; }
}
.ic-result { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ic-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ic-t1);
  background: var(--ic-bubble);
  border: 1px solid var(--ic-line-2);
}
.ic-chip s { color: var(--ic-t3); font-weight: 600; }
.ic-chip.ok { color: var(--ic-ok); border-color: currentColor; background: transparent; }

/* ── 2. Документ ─────────────────────────────────────────── */
.ic-doc {
  --step: 1.3s;
  border: 1px solid var(--ic-line-2);
  border-radius: 12px;
  overflow: hidden;
  font-size: 13.5px;
}
.ic-doc-h {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--ic-t2);
  background: var(--ic-bubble);
  border-bottom: 1px solid var(--ic-line);
}
.ic-doc-h span { font-weight: 600; letter-spacing: 0; color: var(--ic-t3); }
.ic-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--ic-line);
  color: var(--ic-t1);
  transition: background .3s;
}
.ic-row:last-child { border-bottom: 0; }
.ic-row > span:first-child { color: var(--ic-t3); font-weight: 600; }
.ic-scene.is-on .ic-row[data-mark] { animation: ic-mark .5s ease both; animation-delay: calc(var(--i) * var(--step) + .3s); }
.ic-row[data-mark="ok"] { --mk: var(--ic-ok); }
.ic-row[data-mark="warn"] { --mk: var(--ic-warn); }
.ic-row[data-mark="bad"] { --mk: var(--ic-bad); }
@keyframes ic-mark {
  from { box-shadow: inset 3px 0 0 transparent; }
  to { box-shadow: inset 3px 0 0 var(--mk); background: color-mix(in srgb, var(--mk) 10%, transparent); }
}
.ic-notes { --step: 1.3s; display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.ic-note { display: flex; gap: 8px; font-size: 13px; line-height: 1.45; color: var(--ic-t2); }
.ic-note::before { content: ''; flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--mk); }
.ic-note b { color: var(--ic-t1); }
.ic-note.ok { --mk: var(--ic-ok); }
.ic-note.warn { --mk: var(--ic-warn); }
.ic-note.bad { --mk: var(--ic-bad); }
.ic-scene.is-on .ic-note { animation: ic-in .45s ease both; animation-delay: calc(var(--i) * var(--step) + .5s); }

/* ── 4. Карьера ──────────────────────────────────────────── */
.ic-steps { --step: .7s; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ic-step {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--ic-bubble);
  border: 1px solid var(--ic-line);
  font-size: 14px;
  line-height: 1.4;
  color: var(--ic-t1);
}
.ic-step small { display: block; font-size: 12px; color: var(--ic-t3); }
.ic-check {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--ic-line-2);
  color: transparent;
}
.ic-check svg { width: 14px; height: 14px; }
.ic-scene.is-on .ic-check { animation: ic-tick .35s ease both; animation-delay: calc(var(--i) * var(--step) + .5s); }
@keyframes ic-tick { to { color: #fff; background: var(--acc); border-color: var(--acc); } }
.ic-step.pro .ic-check { border-style: dashed; }

/* ── 5. Аудио ────────────────────────────────────────────── */
.ic-player {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: 14px;
  background: var(--ic-bubble);
  border: 1px solid var(--ic-line);
}
.ic-cover {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
}
.ic-cover svg { width: 30px; height: 30px; }
.ic-pl-t { font-size: 15px; font-weight: 800; color: var(--ic-t1); line-height: 1.3; }
.ic-pl-s { font-size: 12.5px; color: var(--ic-t3); }
.ic-wave { display: flex; align-items: center; gap: 3px; height: 38px; margin: 16px 2px 8px; }
.ic-wave i {
  flex: 1;
  height: var(--h, 40%);
  border-radius: 2px;
  background: var(--ic-line-2);
}
.ic-scene.is-on .ic-wave i {
  background: var(--acc);
  animation: ic-wave 1.1s ease-in-out infinite alternate;
  animation-delay: calc(var(--k, 0) * -.13s);
}
@keyframes ic-wave { from { transform: scaleY(.35); } to { transform: scaleY(1); } }
.ic-prog { position: relative; height: 4px; border-radius: 4px; background: var(--ic-line-2); overflow: hidden; }
.ic-prog::after { content: ''; position: absolute; inset: 0; width: 18%; background: var(--acc); border-radius: inherit; }
.ic-scene.is-on .ic-prog::after { animation: ic-prog 9s linear both; }
@keyframes ic-prog { to { width: 46%; } }
.ic-time { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--ic-t3); font-variant-numeric: tabular-nums; }
.ic-tracks { --step: .35s; list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; }
.ic-track {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 10px;
  padding: 8px 4px;
  border-top: 1px solid var(--ic-line);
  font-size: 13.5px;
  color: var(--ic-t2);
}
.ic-track span:first-child { color: var(--ic-t3); font-variant-numeric: tabular-nums; }
.ic-track span:last-child { color: var(--ic-t3); font-variant-numeric: tabular-nums; }
.ic-track.on { color: var(--ic-t1); font-weight: 700; }
.ic-track.on span:first-child { color: var(--acc); }

/* ── 6. Курс растёт ──────────────────────────────────────── */
.ic-news { --step: .6s; list-style: none; margin: 0; padding: 0 0 0 18px; position: relative; display: flex; flex-direction: column; gap: 12px; }
.ic-news::before { content: ''; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 2px; background: var(--ic-line-2); border-radius: 2px; }
.ic-new { position: relative; font-size: 14px; line-height: 1.45; color: var(--ic-t2); }
.ic-new::before {
  content: '';
  position: absolute;
  left: -18px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--acc);
  box-shadow: 0 0 0 4px rgba(var(--acc-s), .18);
}
.ic-new b { display: block; font-size: 15px; color: var(--ic-t1); }

/* Светлая тема: акцентные цвета (жёлтый, голубой) на белом как текст не читаются */
:root[data-theme="light"] .ic-n,
:root[data-theme="light"] .ic-top svg,
:root[data-theme="light"] .ic-fact svg,
:root[data-theme="light"] .ic-track.on span:first-child { color: color-mix(in srgb, var(--acc) 55%, #0f172a); }

/* ── Призыв под секцией ──────────────────────────────────── */
.ic-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 18px;
  margin-top: 24px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ic-t2);
  text-align: center;
}
.ic-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 14.5px;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, #06b6d4, #8b5cf6);
  box-shadow: 0 8px 22px rgba(6, 182, 212, .25);
  transition: transform .2s, box-shadow .2s;
}
.ic-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(6, 182, 212, .35); }

/* ── Планшет и телефон: пункты лентой над экраном ─────────── */
@media (max-width: 880px) {
  .ic { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .ic-list {
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    margin: 0 calc(-1 * clamp(12px, 3vw, 32px));
    padding: 2px clamp(12px, 3vw, 32px) 4px;
  }
  .ic-list::-webkit-scrollbar { display: none; }
  .ic-tab {
    flex: none;
    width: auto;
    max-width: 240px;
    grid-template-columns: auto auto;
    align-items: center;
    gap: 10px;
    padding: 10px 14px 12px 10px;
    scroll-snap-align: start;
  }
  .ic-n { width: 28px; height: 28px; font-size: 12px; border-radius: 8px; }
  .ic-tx b { font-size: 14px; white-space: nowrap; }
  .ic-tx i { display: none; }
  .ic-stage { min-height: 480px; }
}
@media (max-width: 480px) {
  .ic-scene { padding: 14px 14px 12px; }
  .ic-msg { max-width: 90%; font-size: 13.5px; }
  .ic-row { grid-template-columns: 80px 1fr; padding: 7px 12px; font-size: 13px; }
  .ic-stage { min-height: 520px; }
  .ic-steps { gap: 6px; }
  .ic-step { padding: 8px 10px; gap: 10px; }
}

/* Без анимаций: сцены сразу в конечном виде, без автопереключения */
@media (prefers-reduced-motion: reduce) {
  .ic-scene.is-on *, .ic-scene.is-on .ic-msg, .ic-scene.is-on .ic-in { animation: none !important; }
  .ic-scene.is-on .ic-row[data-mark] { box-shadow: inset 3px 0 0 var(--mk); background: color-mix(in srgb, var(--mk) 10%, transparent); }
  .ic-scene.is-on .ic-check { color: #fff; background: var(--acc); border-color: var(--acc); }
  .ic-prog::after { width: 46%; }
  .ic-bar { display: none; }
}
