/* Токены — из дизайн-системы Backboost (backboost-docs/frontend/src/styles/global.css).
   Второго набора цветов не заводим: тема одна, светлая, как во всей платформе. */
:root {
	--bg: #f4f5fa;
	--surface: #fff;
	--surface-2: #eceef6;
	--ink: #1a1b26;
	--ink-2: #4c5063;
	--muted: #6b6f80;
	--muted-2: #9195a8;
	--border: #e6e8f2;
	--border-2: #d9dbe8;
	--accent: #4f46e5;
	--accent-hover: #4338ca;
	--accent-soft: #dce0f7;
	--dark: #1a1b26;
	--dark-2: #23252f;
	--on-dark: #f5f6fc;

	--font: Manrope, 'Helvetica Neue', system-ui, sans-serif;
	--font-display: 'Space Grotesk', Manrope, sans-serif;
	--font-mono: 'JetBrains Mono', ui-monospace, monospace;

	--radius: 14px;
	--radius-sm: 10px;
}

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

html {
	scroll-padding-top: 84px;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
	font-family: var(--font-display);
	letter-spacing: -0.02em;
	margin: 0;
	overflow-wrap: break-word;
	text-wrap: balance;
}

p {
	margin: 0;
}

a {
	color: var(--accent);
	text-decoration: none;
}
a:hover {
	color: var(--accent-hover);
	text-decoration: underline;
}

button {
	font-family: inherit;
	font-size: inherit;
	cursor: pointer;
}

:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

::selection {
	background: var(--accent-soft);
}

.wrap {
	max-width: 1080px;
	margin: 0 auto;
	padding: 0 32px;
}

/* --- шапка --- */

.topbar {
	background: var(--surface);
	border-bottom: 1px solid var(--border);
	position: sticky;
	top: 0;
	z-index: 10;
}

.topbar-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 64px;
	flex-wrap: wrap;
	padding-top: 8px;
	padding-bottom: 8px;
}

/* Лого — как в шапке LMS (backboost-docs): индиго-квадрат + Manrope 800. */
.logo {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 800;
	font-size: 17px;
	color: var(--ink);
	letter-spacing: -0.01em;
}
.logo:hover {
	color: var(--ink);
	text-decoration: none;
}
.logo__mark {
	width: 22px;
	height: 22px;
	border-radius: 6px;
	background: var(--accent);
}

.brand-badge {
	font-family: var(--font-mono);
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--accent);
	background: var(--accent-soft);
	border-radius: 999px;
	padding: 3px 9px;
}

/* Вкладки курсов — в стиле навигации LMS: тихие текстовые ссылки,
   активная — цветом текста, без пилюль. */
.tabs {
	display: flex;
	align-items: center;
	gap: 22px;
	flex-wrap: wrap;
}

.tab {
	border: none;
	background: none;
	color: var(--muted);
	font-weight: 500;
	font-size: 14px;
	padding: 0;
	min-height: 32px;
}
.tab:hover {
	color: var(--ink);
}
.tab[aria-current='true'] {
	color: var(--ink);
	font-weight: 600;
}

/* --- герой курса --- */

.hero {
	padding: 56px 0 8px;
}

.hero h1 {
	font-size: clamp(30px, 4.5vw, 44px);
	line-height: 1.12;
	max-width: 18em;
}

.hero-blurb {
	margin-top: 14px;
	max-width: 62ch;
	font-size: 17px;
	color: var(--ink-2);
}

.facts {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 22px;
	padding: 0;
	list-style: none;
}

.fact {
	font-family: var(--font-mono);
	font-size: 12.5px;
	color: var(--ink-2);
	background: var(--surface);
	border: 1px solid var(--border-2);
	border-radius: 999px;
	padding: 5px 12px;
	white-space: nowrap;
}

.hero-actions {
	margin-top: 20px;
}

.btn {
	display: inline-block;
	background: var(--accent);
	color: #fff;
	font-weight: 600;
	font-size: 14.5px;
	padding: 10px 18px;
	border-radius: var(--radius-sm);
	border: none;
}
.btn:hover {
	background: var(--accent-hover);
	color: #fff;
	text-decoration: none;
}

.btn-ghost {
	background: none;
	color: var(--accent);
	border: 1px solid var(--border-2);
}
.btn-ghost:hover {
	background: var(--surface);
	color: var(--accent-hover);
}

/* --- секции --- */

.section {
	padding: 48px 0 8px;
}

.section h2,
.band h2 {
	font-size: 26px;
}

.section-lead {
	margin-top: 8px;
	color: var(--muted);
	max-width: 62ch;
}

/* --- разбалловка --- */

.score-bar {
	display: flex;
	width: 100%;
	height: 56px;
	border-radius: var(--radius-sm);
	overflow: hidden;
	margin-top: 24px;
	border: 1px solid var(--border-2);
}

.score-seg {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 0 14px;
	min-width: 0;
}
.score-seg .seg-name {
	font-weight: 600;
	font-size: 13px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.score-seg .seg-pts {
	font-family: var(--font-mono);
	font-size: 12px;
	opacity: 0.85;
}

.tone-accent {
	background: var(--accent);
	color: #fff;
}
.tone-soft {
	background: var(--accent-soft);
	color: var(--ink);
}
.tone-dark {
	background: var(--dark);
	color: var(--on-dark);
}

.grading-group {
	margin-top: 36px;
}

.group-head {
	display: flex;
	align-items: baseline;
	gap: 12px;
}
.group-head h3 {
	font-size: 19px;
}
.group-pts {
	font-family: var(--font-mono);
	font-size: 13px;
	color: var(--muted);
}

.group-lead {
	margin-top: 6px;
	color: var(--muted);
	max-width: 62ch;
	font-size: 14.5px;
}

.cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 12px;
	margin-top: 16px;
}

.card {
	text-align: left;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 16px 18px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	transition: border-color 0.15s, box-shadow 0.15s;
}
.card:hover {
	border-color: var(--accent);
	box-shadow: 0 4px 16px rgba(79, 70, 229, 0.08);
}

.card-pts {
	font-family: var(--font-mono);
	font-size: 12px;
	font-weight: 600;
	color: var(--accent);
}

.card-name {
	font-weight: 700;
	font-family: var(--font-display);
	letter-spacing: -0.01em;
	font-size: 16px;
}

.card-hint {
	font-size: 13px;
	color: var(--muted-2);
	margin-top: auto;
	padding-top: 4px;
}

/* Кнопка общих правил группы (guide) под карточками. */
.group-guide {
	margin-top: 14px;
}

/* --- уведомление (курс без разбалловки) --- */

.notice {
	margin-top: 24px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-left: 3px solid var(--accent);
	border-radius: var(--radius-sm);
	padding: 14px 18px;
	color: var(--ink-2);
	max-width: 70ch;
}

/* --- программа: аккордеон модулей --- */

.program {
	margin-top: 20px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.module {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
}
.module[open] {
	border-color: var(--border-2);
}

.module summary {
	list-style: none;
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 15px 20px;
	cursor: pointer;
	border-radius: var(--radius);
}
.module summary::-webkit-details-marker {
	display: none;
}
.module summary:hover {
	background: var(--surface-2);
}

.module-index {
	font-family: var(--font-mono);
	font-size: 12px;
	font-weight: 600;
	color: var(--accent);
	min-width: 2ch;
}

.module-title {
	font-family: var(--font-display);
	font-weight: 700;
	letter-spacing: -0.01em;
	font-size: 16px;
	flex: 1;
}

.module-count {
	font-family: var(--font-mono);
	font-size: 12px;
	color: var(--muted-2);
	white-space: nowrap;
}

.module-caret {
	color: var(--muted-2);
	transition: transform 0.15s;
	flex-shrink: 0;
}
.module[open] .module-caret {
	transform: rotate(90deg);
}

.lessons {
	margin: 0;
	padding: 4px 20px 18px 20px;
	list-style: none;
	columns: 2;
	column-gap: 32px;
}
.lessons li {
	break-inside: avoid;
	padding: 5px 0 5px 16px;
	position: relative;
	font-size: 14.5px;
	color: var(--ink-2);
}
.lessons li::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0.95em;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--accent-soft);
	border: 1px solid var(--accent);
}

/* --- «как устроено обучение» --- */

.band {
	background: var(--surface);
	border-top: 1px solid var(--border);
	border-bottom: 1px solid var(--border);
	padding: 48px 0 52px;
	margin-top: 56px;
}

.infra-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
	gap: 14px;
	margin-top: 24px;
}

.infra-card {
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 20px 22px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.infra-eyebrow {
	font-family: var(--font-mono);
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.09em;
	color: var(--accent);
}

.infra-card h3 {
	font-size: 18px;
}

.infra-card p {
	font-size: 14.5px;
	color: var(--ink-2);
}

.infra-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: auto;
	padding-top: 6px;
}

.chip {
	font-family: var(--font-mono);
	font-size: 11.5px;
	color: var(--ink-2);
	background: var(--surface);
	border: 1px solid var(--border-2);
	border-radius: 999px;
	padding: 3px 10px;
}

.infra-note {
	font-size: 13px;
	color: var(--muted-2);
}

.infra-link {
	font-size: 14px;
	font-weight: 600;
}

/* --- дополнительные курсы --- */

.extra-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 14px;
	margin-top: 24px;
}

.extra-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 20px 22px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.extra-tag {
	align-self: flex-start;
	font-family: var(--font-mono);
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--accent);
	background: var(--accent-soft);
	border-radius: 999px;
	padding: 3px 9px;
}

.extra-card h3 {
	font-size: 18px;
}

.extra-card p {
	font-size: 14.5px;
	color: var(--ink-2);
}

.extra-meta {
	font-family: var(--font-mono);
	font-size: 12px;
	color: var(--muted-2);
}

.extra-actions {
	display: flex;
	gap: 14px;
	margin-top: auto;
	padding-top: 8px;
	font-size: 14px;
	font-weight: 600;
}
.extra-actions button {
	background: none;
	border: none;
	padding: 0;
	color: var(--accent);
	font-weight: 600;
}
.extra-actions button:hover {
	color: var(--accent-hover);
	text-decoration: underline;
}

/* --- подвал --- */

.footer {
	margin-top: 56px;
	border-top: 1px solid var(--border);
	background: var(--surface);
}

.footer-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	padding-top: 22px;
	padding-bottom: 22px;
	font-size: 13.5px;
	color: var(--muted);
}

.footer-links {
	display: flex;
	gap: 18px;
}

/* --- модалка --- */

dialog {
	border: none;
	border-radius: var(--radius);
	background: var(--surface);
	color: var(--ink);
	width: min(560px, calc(100vw - 40px));
	max-height: calc(100vh - 80px);
	padding: 0;
	box-shadow: 0 24px 64px rgba(26, 27, 38, 0.25);
}
dialog::backdrop {
	background: rgba(26, 27, 38, 0.5);
}

.modal-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	padding: 22px 24px 0;
}
.modal-head h3 {
	font-size: 20px;
}

.modal-close {
	background: none;
	border: none;
	color: var(--muted);
	font-size: 26px;
	line-height: 1;
	padding: 0 2px;
	border-radius: 6px;
	flex-shrink: 0;
}
.modal-close:hover {
	color: var(--ink);
	background: var(--surface-2);
}

.modal-body {
	padding: 10px 24px 24px;
}

.modal-pts {
	display: inline-block;
	font-family: var(--font-mono);
	font-size: 12px;
	font-weight: 600;
	color: var(--accent);
	background: var(--accent-soft);
	border-radius: 999px;
	padding: 3px 10px;
	margin-bottom: 12px;
}

.modal-body p {
	color: var(--ink-2);
	font-size: 14.5px;
}

.modal-body h4 {
	font-size: 13px;
	font-family: var(--font-mono);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	color: var(--muted-2);
	margin-top: 18px;
}

.modal-body ul {
	margin: 8px 0 0;
	padding: 0;
	list-style: none;
}
.modal-body li {
	padding: 4px 0 4px 16px;
	position: relative;
	font-size: 14.5px;
	color: var(--ink-2);
}
.modal-body li::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0.9em;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--accent-soft);
	border: 1px solid var(--accent);
}

/* --- мелкие экраны и доступность --- */

@media (max-width: 640px) {
	.wrap {
		padding: 0 20px;
	}
	.hero {
		padding-top: 36px;
	}
	.lessons {
		columns: 1;
	}
	.score-bar {
		height: auto;
		flex-direction: column;
	}
	.score-seg {
		width: 100% !important;
		padding: 10px 14px;
	}
}

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