/*!
 * tutorials.in — one stylesheet, no framework.
 * Light is the default; dark follows [data-theme="dark"] set by the header.
 */

/* ---------- Fonts: self-hosted, latin subset, three files ---------- */

@font-face {
	font-family: "Plus Jakarta Sans";
	src: url("../fonts/plus-jakarta-sans.woff2") format("woff2");
	font-weight: 700 800;
	font-style: normal;
	font-display: swap;
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
	font-family: Inter;
	src: url("../fonts/inter.woff2") format("woff2");
	font-weight: 400 600;
	font-style: normal;
	font-display: swap;
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
	font-family: "JetBrains Mono";
	src: url("../fonts/jetbrains-mono.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Metric-matched fallbacks: text keeps the same footprint before webfonts load. */

@font-face {
	font-family: "Plus Jakarta Sans Fallback";
	src: local("Arial"), local("Helvetica Neue"), local("Liberation Sans");
	size-adjust: 105%;
	ascent-override: 96%;
	descent-override: 24%;
	line-gap-override: 0%;
}

@font-face {
	font-family: "Inter Fallback";
	src: local("Arial"), local("Helvetica Neue"), local("Liberation Sans");
	size-adjust: 107%;
	ascent-override: 90%;
	descent-override: 22%;
	line-gap-override: 0%;
}

@font-face {
	font-family: "JetBrains Mono Fallback";
	src: local("Courier New"), local("Liberation Mono");
	size-adjust: 100%;
	ascent-override: 88%;
	descent-override: 22%;
	line-gap-override: 0%;
}

/* ---------- Tokens ---------- */

:root {
	--bg: #ececee;
	--surface: #ffffff;
	--ink: #16162c;
	--ink-soft: #4b4d6b;
	--purple: #7a4bd2;
	--purple-deep: #5b33a6;
	--purple-band: #7347c2;
	--lavender: #b79ceb;
	--lavender-tint: #efe8fb;
	--code-bg: #1d1f34;
	--code-line: #3e3f75;
	--code-gutter: #8587b5;
	--run-green: #4c9f43;
	--run-green-ink: #2f7d32;
	--run-green-glow: #acd6a6;
	--caret-cyan: #2db4ee;
	--danger: #b42318;
	--line: #d9d9e0;
	--syntax-var: #f2a07b;
	--syntax-fn: #7db8f2;
	--syntax-str: #8fd6a0;
	--syntax-num: #f0c674;
	/* One step lighter than the brief's #7F83B5, which measures 4.48:1 on the
	   code panel. This is 4.7:1 and visually indistinguishable. */
	--syntax-com: #8488bb;
	--syntax-op: #c9ccf2;
	--syntax-text: #e3e5fa;
	--ad-bg: #e3e3ea;
	--ad-ink: #4b4d6b;
	--feedback-bad: #b42318;
	--focus: var(--purple-deep);
	--font-head: "Plus Jakarta Sans", "Plus Jakarta Sans Fallback", system-ui, sans-serif;
	--font-body: Inter, "Inter Fallback", system-ui, -apple-system, "Segoe UI", sans-serif;
	--font-mono: "JetBrains Mono", "JetBrains Mono Fallback", ui-monospace, monospace;
	--radius-card: 14px;
	--radius-btn: 10px;
	--radius-panel: 18px;
	--wrap: 1200px;
	--shadow-panel: 0 18px 40px -24px rgba(22, 22, 44, 0.45);
}

html[data-theme="dark"] {
	--bg: #12132a;
	--surface: #1b1d38;
	--ink: #ececf7;
	--ink-soft: #a9abcb;
	--purple: #a98bf0;
	--purple-deep: #c4adfa;
	--purple-band: #3b2478;
	--lavender-tint: #26214a;
	--code-bg: #0e0f22;
	--line: #2b2d52;
	--ad-bg: #232545;
	--ad-ink: #a9abcb;
	--feedback-bad: #ff9e92;
	--focus: #c4adfa;
	--shadow-panel: 0 20px 48px -26px rgba(0, 0, 0, 0.8);
}

/* ---------- Base ---------- */

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	background: var(--bg);
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: 17px;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

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

[hidden] {
	display: none !important;
}

h1,
h2,
h3,
h4 {
	margin: 0 0 0.6em;
	font-family: var(--font-head);
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -0.02em;
	color: var(--ink);
	text-wrap: balance;
}

h1 {
	font-size: clamp(2rem, 1.45rem + 2.4vw, 3.1rem);
}

h2 {
	font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
}

h3 {
	font-size: 1.2rem;
	font-weight: 700;
	line-height: 1.3;
}

p {
	margin: 0 0 1em;
}

a {
	color: var(--purple);
	text-underline-offset: 3px;
	text-decoration-thickness: 1px;
}

a:hover {
	color: var(--purple-deep);
}

ul,
ol {
	padding-left: 1.35em;
}

/* 44px targets and a visible ring on every control. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--focus);
	outline-offset: 2px;
	border-radius: 6px;
}

button {
	font: inherit;
}

.icon {
	width: 20px;
	height: 20px;
	flex: 0 0 auto;
}

.visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	left: 16px;
	top: -72px;
	z-index: 120;
	padding: 10px 16px;
	background: var(--ink);
	color: #fff;
	border-radius: 8px;
	text-decoration: none;
	transition: top 0.15s ease;
}

.skip-link:focus {
	top: 12px;
	color: #fff;
}

/* ---------- Layout ---------- */

.wrap {
	width: 100%;
	max-width: var(--wrap);
	margin: 0 auto;
	padding: 0 20px;
}

.wrap--article {
	max-width: 760px;
}

.site-main {
	display: block;
	min-height: 40vh;
}

.section {
	padding: 46px 0;
}

.section--tint {
	background: var(--surface);
	border-top: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
}

.section__head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 22px;
}

.section__title {
	margin: 0 0 6px;
	font-size: clamp(1.45rem, 1.2rem + 1vw, 1.9rem);
}

.section__lead {
	max-width: 62ch;
	margin: 0;
	color: var(--ink-soft);
	font-size: 0.98rem;
}

.text-link {
	font-weight: 600;
	color: var(--purple-deep);
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	min-height: 44px;
}

.text-link:hover {
	text-decoration: underline;
}

.empty-note {
	padding: 18px 20px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius-card);
	color: var(--ink-soft);
}

/* ---------- Buttons ---------- */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
	min-height: 44px;
	padding: 0.62em 1.15em;
	border: 1px solid transparent;
	border-radius: var(--radius-btn);
	font-family: var(--font-body);
	font-size: 0.98rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.btn--primary {
	background: var(--purple);
	color: #fff;
}

.btn--primary:hover {
	background: var(--purple-deep);
	color: #fff;
}

.btn--ghost {
	background: transparent;
	color: var(--purple-deep);
	border-color: var(--line);
}

.btn--ghost:hover {
	background: var(--lavender-tint);
	border-color: var(--purple);
	color: var(--purple-deep);
}

.btn--quiet {
	background: transparent;
	color: var(--ink-soft);
	padding-left: 0.5em;
	padding-right: 0.5em;
}

.btn--quiet:hover {
	color: var(--purple-deep);
	background: var(--lavender-tint);
}

/* ---------- Chips ---------- */

.chip-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-top: 18px;
}

.chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 40px;
	padding: 0 14px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--surface);
	color: var(--ink-soft);
	font-size: 0.85rem;
	font-weight: 500;
	text-decoration: none;
}

.chip:hover {
	border-color: var(--purple);
	background: var(--lavender-tint);
	color: var(--purple-deep);
}

.chip--label {
	background: transparent;
	border-color: transparent;
	padding-left: 0;
	font-weight: 600;
	color: var(--ink);
}

.chip__count {
	font-size: 0.75rem;
	color: var(--ink-soft);
}

/* ---------- Header ---------- */

.site-header {
	position: sticky;
	top: 0;
	z-index: 60;
	background: var(--surface);
	border-bottom: 1px solid var(--line);
}

.site-header__inner {
	display: flex;
	align-items: center;
	gap: 20px;
	min-height: 68px;
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-family: var(--font-head);
	font-size: 1.15rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	color: var(--ink);
	text-decoration: none;
}

.brand:hover {
	color: var(--ink);
}

.brand__mark {
	display: inline-flex;
	color: var(--purple);
}

.brand__dot {
	color: var(--purple);
}

.primary-nav {
	margin-left: auto;
}

.primary-nav .menu {
	display: flex;
	gap: 2px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.primary-nav a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 12px;
	border-radius: var(--radius-btn);
	color: var(--ink-soft);
	font-size: 0.95rem;
	font-weight: 500;
	text-decoration: none;
}

.primary-nav a:hover {
	background: var(--lavender-tint);
	color: var(--purple-deep);
}

.primary-nav .current-menu-item > a {
	color: var(--purple-deep);
	font-weight: 600;
}

.header-tools {
	display: flex;
	align-items: center;
	gap: 2px;
}

.icon-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: var(--radius-btn);
	background: transparent;
	color: var(--ink);
	cursor: pointer;
}

.icon-button:hover {
	background: var(--lavender-tint);
	color: var(--purple-deep);
}

.theme-toggle__moon {
	display: none;
}

html[data-theme="dark"] .theme-toggle__sun {
	display: none;
}

html[data-theme="dark"] .theme-toggle__moon {
	display: inline-flex;
}

.nav-toggle {
	display: none;
}

.nav-toggle__close {
	display: none;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__open {
	display: none;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__close {
	display: inline-flex;
}

.site-search {
	border-top: 1px solid var(--line);
	background: var(--surface);
}

.site-search__inner {
	padding: 16px 0 20px;
}

.search-form__label {
	display: block;
	margin-bottom: 8px;
	color: var(--ink-soft);
	font-size: 0.85rem;
}

.search-form__row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.search-form__input {
	flex: 1 1 220px;
	min-height: 48px;
	padding: 0 14px;
	border: 1px solid var(--line);
	border-radius: var(--radius-btn);
	background: var(--surface);
	color: var(--ink);
	font: inherit;
}

.search-form__input::placeholder {
	color: var(--ink-soft);
	opacity: 0.75;
}

.search-results {
	margin-top: 10px;
	border: 1px solid var(--line);
	border-radius: 12px;
	overflow: hidden;
	background: var(--surface);
}

.search-results__item {
	display: block;
	padding: 11px 14px;
	border-bottom: 1px solid var(--line);
	color: var(--ink);
	text-decoration: none;
	font-size: 0.92rem;
}

.search-results__item:last-child {
	border-bottom: 0;
}

.search-results__item:hover {
	background: var(--lavender-tint);
	color: var(--purple-deep);
}

.search-results__type {
	display: block;
	color: var(--ink-soft);
	font-size: 0.72rem;
}

.search-results__empty {
	margin: 0;
	padding: 12px 14px;
	color: var(--ink-soft);
	font-size: 0.9rem;
}

/* ---------- Hero ---------- */

.hero {
	padding: 40px 0 10px;
}

.hero-card {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
	gap: clamp(26px, 4vw, 54px);
	align-items: center;
	padding: clamp(24px, 4vw, 54px);
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius-card);
}

/* The lavender tab on the top edge. */
.hero-card::before {
	content: "";
	position: absolute;
	top: -15px;
	left: 40px;
	width: 112px;
	height: 16px;
	border-radius: 8px 8px 0 0;
	background: var(--lavender);
}

.hero__title {
	margin: 0 0 18px;
	font-size: clamp(2.05rem, 1.25rem + 3.2vw, 3.4rem);
	line-height: 1.06;
}

.hero__line {
	display: block;
}

.hero__line--accent {
	color: var(--purple);
}

.hero__lead {
	max-width: 46ch;
	margin: 0 0 24px;
	color: var(--ink-soft);
	font-size: 1.03rem;
}

.hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.hero__note {
	margin: 16px 0 0;
	color: var(--ink-soft);
	font-size: 0.83rem;
}

.hero__panel {
	min-width: 0;
}

/* ---------- Code panel and runner ---------- */

.code-panel {
	position: relative;
	background: var(--code-bg);
	color: var(--syntax-text);
	border-radius: var(--radius-panel);
	box-shadow: var(--shadow-panel);
	font-family: var(--font-mono);
	margin-bottom: 30px;
}

.runner__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 11px 18px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	color: var(--code-gutter);
	font-size: 0.74rem;
}

.runner__lang {
	color: var(--syntax-text);
	font-weight: 400;
}

.runner__hint {
	font-family: var(--font-body);
	font-size: 0.72rem;
	text-align: right;
}

.runner__body {
	display: flex;
	align-items: stretch;
	min-height: 230px;
	max-height: 420px;
	padding: 14px 0;
	overflow: hidden;
}

.runner__gutter {
	flex: 0 0 44px;
	padding-right: 10px;
	text-align: right;
	color: var(--code-gutter);
	font-size: 0.82rem;
	line-height: 1.75;
	user-select: none;
	overflow: hidden;
}

.runner__gutter span {
	display: block;
}

.runner__editor {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	min-height: 230px;
}

.runner__highlight,
.runner__code {
	margin: 0;
	padding: 0 18px 0 4px;
	border: 0;
	background: transparent;
	font-family: var(--font-mono);
	font-size: 0.82rem;
	line-height: 1.75;
	white-space: pre;
	tab-size: 4;
	overflow: auto;
}

.runner__highlight {
	position: absolute;
	inset: 0;
	color: var(--syntax-text);
	pointer-events: none;
}

.runner__code {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	min-height: 230px;
	max-height: 392px;
	color: transparent;
	caret-color: var(--caret-cyan);
	resize: none;
	outline: none;
}

.runner__code::selection {
	background: rgba(122, 75, 210, 0.4);
}

.runner__code:focus-visible {
	outline: 3px solid var(--run-green-glow);
	outline-offset: 2px;
}

.runner__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding: 0 18px 18px;
}

.runner__run {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 18px;
	border: 0;
	border-radius: var(--radius-btn);
	background: var(--run-green-ink);
	color: #fff;
	font-family: var(--font-body);
	font-size: 0.92rem;
	font-weight: 600;
	cursor: pointer;
}

.runner__run:hover {
	background: #266a28;
	box-shadow: 0 0 0 3px var(--run-green-glow);
}

.runner__run .icon {
	width: 16px;
	height: 16px;
}

.runner__btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	padding: 0 12px;
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: var(--radius-btn);
	background: transparent;
	color: var(--syntax-op);
	font-family: var(--font-body);
	font-size: 0.82rem;
	font-weight: 500;
	cursor: pointer;
}

.runner__btn:hover {
	border-color: var(--lavender);
	color: #fff;
}

.runner__btn .icon {
	width: 15px;
	height: 15px;
}

.runner__key {
	margin-left: auto;
	color: var(--code-gutter);
	font-size: 0.7rem;
}

.runner__out {
	min-height: 52px;
	max-height: 220px;
	padding: 12px 18px 16px;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	font-family: var(--font-mono);
	font-size: 0.79rem;
	line-height: 1.7;
	white-space: pre-wrap;
	overflow: auto;
}

.runner__idle {
	margin: 0;
	color: var(--code-gutter);
	font-family: var(--font-body);
	font-size: 0.84rem;
}

.runner__out .out-error {
	color: #ffb4a8;
}

.runner__out .out-note {
	color: var(--code-gutter);
}

/* The hero's Run button overlaps the panel corner. */
.hero__panel .code-panel {
	padding-bottom: 10px;
}

.hero__panel .runner__foot {
	position: absolute;
	right: 22px;
	bottom: -20px;
	padding: 0;
}

.hero__panel .runner__foot .runner__btn,
.hero__panel .runner__foot .runner__key {
	display: none;
}

.hero__panel .runner__run {
	box-shadow: 0 12px 26px -14px rgba(47, 125, 50, 0.9);
}

.hero__panel .runner__out {
	padding-bottom: 18px;
	padding-right: 120px;
}

.runner__frame {
	display: block;
	width: 100%;
	height: 260px;
	margin-top: 12px;
	border: 0;
	border-radius: 8px;
	background: #fff;
}

.tok-var {
	color: var(--syntax-var);
}

.tok-fn {
	color: var(--syntax-fn);
}

.tok-str {
	color: var(--syntax-str);
}

.tok-num {
	color: var(--syntax-num);
}

.tok-com {
	color: var(--syntax-com);
}

.tok-op {
	color: var(--syntax-op);
}

/* ---------- Continue card ---------- */

.continue-band {
	padding: 6px 0 0;
}

.continue-card {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 20px;
	background: var(--surface);
	border: 1px solid var(--purple);
	border-left-width: 4px;
	border-radius: 12px;
}

.continue-card__label {
	margin: 0;
	color: var(--ink-soft);
	font-size: 0.78rem;
}

.continue-card__title {
	margin: 0;
	font-family: var(--font-head);
	font-size: 1.02rem;
	font-weight: 700;
}

.continue-card__meta {
	margin: 0;
	color: var(--ink-soft);
	font-size: 0.8rem;
}

/* ---------- Cards ---------- */

.card-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px;
}

.course-card {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius-card);
	transition: border-color 0.18s ease;
}

.course-card:hover {
	border-color: var(--purple);
}

.course-card__cover {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 16 / 7;
	overflow: hidden;
	background: linear-gradient(135deg, var(--lavender-tint), #ddd2f6);
	color: var(--purple-deep);
}

html[data-theme="dark"] .course-card__cover {
	background: linear-gradient(135deg, #26214a, #1f2340);
	color: var(--lavender);
}

.course-card__glyph {
	position: relative;
	z-index: 1;
	display: inline-flex;
	padding: 10px;
	border-radius: 12px;
	background: var(--surface);
}

.course-card__glyph .icon {
	width: 26px;
	height: 26px;
}

.course-card__initial {
	position: absolute;
	right: -4px;
	bottom: -34px;
	font-family: var(--font-head);
	font-size: 6.5rem;
	font-weight: 800;
	line-height: 1;
	color: rgba(122, 75, 210, 0.18);
}

html[data-theme="dark"] .course-card__initial {
	color: rgba(183, 156, 235, 0.16);
}

.course-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 7px;
	padding: 18px 20px 20px;
}

.course-card__level {
	align-self: flex-start;
	margin: 0;
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--lavender-tint);
	color: var(--purple-deep);
	font-size: 0.75rem;
	font-weight: 600;
}

.course-card__title {
	margin: 0;
	font-size: 1.18rem;
}

.course-card__title a {
	color: var(--ink);
	text-decoration: none;
}

.course-card__title a:hover {
	color: var(--purple-deep);
}

.course-card__title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.course-card__desc {
	margin: 0;
	color: var(--ink-soft);
	font-size: 0.92rem;
	line-height: 1.6;
}

.course-card__stats {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	margin: auto 0 0;
	padding: 10px 0 0;
	border-top: 1px solid var(--line);
	list-style: none;
	color: var(--ink-soft);
	font-size: 0.79rem;
}

.course-card__stats li {
	margin: 0;
}

.guide-card,
.quiz-card {
	display: flex;
	flex-direction: column;
	gap: 7px;
	padding: 20px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius-card);
}

.guide-card__cat,
.quiz-card__lang {
	margin: 0;
	color: var(--purple-deep);
	font-size: 0.76rem;
	font-weight: 600;
}

.guide-card__title,
.quiz-card__title {
	margin: 0;
	font-size: 1.1rem;
}

.guide-card__title a,
.quiz-card__title a {
	color: var(--ink);
	text-decoration: none;
}

.guide-card__title a:hover,
.quiz-card__title a:hover {
	color: var(--purple-deep);
}

.guide-card__desc {
	margin: 0;
	color: var(--ink-soft);
	font-size: 0.92rem;
}

.guide-card__price,
.quiz-card__meta {
	margin: auto 0 0;
	padding-top: 10px;
	border-top: 1px solid var(--line);
	color: var(--ink-soft);
	font-size: 0.79rem;
}

/* Certification rows */

.cert-list {
	margin: 0;
	padding: 0;
	border-top: 1px solid var(--line);
	list-style: none;
}

.cert-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 18px 0;
	border-bottom: 1px solid var(--line);
}

.cert-row__provider {
	color: var(--purple-deep);
	font-size: 0.76rem;
	font-weight: 600;
}

.cert-row__title {
	margin: 2px 0 0;
	font-size: 1.08rem;
}

.cert-row__title a {
	color: var(--ink);
	text-decoration: none;
}

.cert-row__title a:hover {
	color: var(--purple-deep);
}

.cert-row__desc {
	margin: 4px 0 0;
	color: var(--ink-soft);
	font-size: 0.88rem;
	max-width: 60ch;
}

.cert-row__facts,
.cert-row__details {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	margin: 0;
	color: var(--ink-soft);
	font-family: var(--font-mono);
	font-size: 0.8rem;
	text-align: right;
}

.cert-row__details div {
	text-align: right;
}

.cert-row__details dt {
	font-family: var(--font-body);
	font-size: 0.7rem;
	color: var(--ink-soft);
}

.cert-row__details dd {
	margin: 0;
	color: var(--ink);
}

/* ---------- Lesson layout ---------- */

.reading-progress {
	position: fixed;
	inset: 0 0 auto 0;
	z-index: 70;
	height: 3px;
	pointer-events: none;
}

.reading-progress span {
	display: block;
	width: 0;
	height: 100%;
	background: var(--purple);
}

.lesson {
	padding: 26px 0 56px;
}

.lesson-layout {
	display: grid;
	grid-template-columns: 264px minmax(0, 1fr);
	gap: 40px;
	align-items: start;
}

.lesson-rail {
	position: sticky;
	top: 92px;
	max-height: calc(100vh - 120px);
	overflow: auto;
	padding-right: 4px;
}

.lesson-main {
	min-width: 0;
	max-width: 720px;
}

.lesson-sidebar-wrap {
	display: none;
}

/* Mobile progress meter, reserved height, no shift. */
.lesson-meter {
	display: none;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 10px;
	min-height: 46px;
	margin: 0 0 18px;
	padding: 8px 12px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius-btn);
	font-size: 0.8rem;
}

.lesson-meter__text {
	margin: 0;
	font-weight: 600;
}

.lesson-meter__state {
	margin: 0 0 0 auto;
	color: var(--ink-soft);
}

.lesson-meter__track {
	flex: 1 1 100%;
	height: 6px;
	margin-top: 2px;
	overflow: hidden;
	border-radius: 999px;
	background: var(--lavender);
}

.lesson-meter__track span {
	display: block;
	width: 0;
	height: 100%;
	background: var(--run-green-ink);
	transition: width 0.25s ease;
}

/* Syllabus rail */

.syllabus-rail {
	font-size: 0.9rem;
}

.rail-track {
	margin: 0;
	color: var(--ink-soft);
	font-size: 0.78rem;
}

.rail-track a {
	color: var(--purple-deep);
	font-weight: 600;
	text-decoration: none;
}

.rail-title {
	margin: 2px 0 4px;
	font-size: 1.08rem;
}

.rail-count {
	margin: 0;
	color: var(--ink-soft);
	font-size: 0.78rem;
}

.rail-meter {
	height: 6px;
	margin: 10px 0 14px;
	overflow: hidden;
	border-radius: 999px;
	background: var(--lavender);
}

.rail-meter span {
	display: block;
	width: 0;
	height: 100%;
	background: var(--run-green-ink);
	transition: width 0.25s ease;
}

.rail-list {
	position: relative;
	margin: 0;
	padding: 0;
	list-style: none;
}

.rail-list::before {
	content: "";
	position: absolute;
	top: 10px;
	bottom: 10px;
	left: 13px;
	width: 2px;
	background: var(--line);
}

.rail-module {
	position: relative;
	padding: 16px 0 6px 40px;
	color: var(--ink-soft);
	font-size: 0.72rem;
}

.rail-module__label {
	display: block;
	font-weight: 600;
}

.rail-module__title {
	display: block;
	margin-top: 2px;
	color: var(--ink);
	font-size: 0.82rem;
}

.rail-item {
	position: relative;
}

.rail-item > a {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	min-height: 44px;
	padding: 8px 8px 8px 0;
	border-radius: 8px;
	color: var(--ink-soft);
	text-decoration: none;
}

.rail-item > a:hover {
	background: var(--lavender-tint);
	color: var(--purple-deep);
}

.rail-node {
	position: relative;
	z-index: 1;
	display: inline-flex;
	flex: 0 0 28px;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border: 2px solid var(--line);
	border-radius: 50%;
	background: var(--surface);
	color: var(--ink-soft);
	font-size: 0.72rem;
	font-weight: 600;
}

.rail-node .icon {
	width: 14px;
	height: 14px;
	stroke-width: 2.6;
}

.rail-item.is-current > a {
	color: var(--ink);
	font-weight: 600;
}

.rail-item.is-current .rail-node {
	border-color: var(--purple);
	background: var(--purple);
	color: #fff;
}

.rail-item.is-complete .rail-node {
	border-color: var(--run-green-ink);
	background: var(--run-green-ink);
	color: #fff;
}

.rail-label {
	flex: 1;
	padding-top: 3px;
	line-height: 1.4;
}

.rail-time {
	padding-top: 6px;
	color: var(--ink-soft);
	font-size: 0.7rem;
}

/* Lesson head and prose */

.breadcrumbs {
	margin: 0 0 14px;
	font-size: 0.8rem;
	color: var(--ink-soft);
}

.breadcrumbs ol {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.breadcrumbs li + li::before {
	content: "/";
	margin-right: 6px;
	color: var(--line);
}

.breadcrumbs a {
	color: var(--ink-soft);
	text-decoration: none;
}

.breadcrumbs a:hover {
	color: var(--purple-deep);
	text-decoration: underline;
}

.lesson-kicker,
.kicker {
	margin: 0 0 8px;
	color: var(--purple-deep);
	font-size: 0.82rem;
	font-weight: 600;
}

.lesson-kicker a,
.kicker a {
	color: var(--purple-deep);
	text-decoration: none;
}

.lesson-title {
	margin: 0 0 12px;
	max-width: 24ch;
	font-size: clamp(1.85rem, 1.4rem + 1.6vw, 2.6rem);
}

.lesson-deck,
.post-deck {
	max-width: 58ch;
	margin: 0 0 16px;
	color: var(--ink-soft);
	font-size: 1.06rem;
}

.meta-list {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 18px;
	margin: 0 0 18px;
	padding: 0;
	list-style: none;
	color: var(--ink-soft);
	font-size: 0.8rem;
}

.meta-list__item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.meta-list .icon {
	width: 15px;
	height: 15px;
	opacity: 0.85;
}

.meta-list a {
	color: var(--ink-soft);
	text-decoration: none;
}

.meta-list a:hover {
	color: var(--purple-deep);
	text-decoration: underline;
}

.lesson-media,
.post-media {
	margin: 22px 0;
	overflow: hidden;
	border-radius: var(--radius-card);
}

.lesson-media img,
.post-media img {
	width: 100%;
}

.prose {
	max-width: 68ch;
	font-size: 1.0625rem;
}

.prose > * + * {
	margin-top: 1.05em;
}

.prose h2 {
	margin-top: 2em;
	font-size: clamp(1.35rem, 1.15rem + 0.7vw, 1.6rem);
}

.prose h3 {
	margin-top: 1.6em;
}

.prose h2 + p,
.prose h3 + p {
	margin-top: 0.5em;
}

.prose ul,
.prose ol {
	margin-bottom: 1.2em;
}

.prose li + li {
	margin-top: 0.35em;
}

.prose code {
	padding: 0.12em 0.38em;
	border-radius: 6px;
	background: var(--lavender-tint);
	color: var(--purple-deep);
	font-family: var(--font-mono);
	font-size: 0.88em;
	overflow-wrap: anywhere;
}

.prose pre {
	position: relative;
	max-width: 100%;
	margin: 1.5em 0;
	padding: 18px 20px;
	overflow: auto;
	border-radius: 14px;
	background: var(--code-bg);
	color: var(--syntax-text);
	font-family: var(--font-mono);
	font-size: 0.84rem;
	line-height: 1.7;
}

.prose pre code {
	padding: 0;
	background: none;
	color: inherit;
	font-size: inherit;
}

.copy-button {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 2;
	min-height: 34px;
	padding: 0 10px;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 8px;
	background: rgba(29, 31, 52, 0.92);
	color: var(--syntax-op);
	font-family: var(--font-body);
	font-size: 0.72rem;
	cursor: pointer;
}

.copy-button:hover {
	border-color: var(--lavender);
	color: #fff;
}

.prose figure {
	margin: 1.6em 0;
}

.prose figcaption {
	margin-top: 8px;
	color: var(--ink-soft);
	font-size: 0.82rem;
}

.prose table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.92rem;
}

.prose th,
.prose td {
	padding: 10px 12px;
	border: 1px solid var(--line);
	text-align: left;
}

.prose th {
	background: var(--lavender-tint);
}

.prose blockquote {
	margin: 1.5em 0;
	padding: 4px 0 4px 18px;
	border-left: 3px solid var(--lavender);
	color: var(--ink-soft);
}

.prose hr {
	margin: 2em 0;
	border: 0;
	border-top: 1px solid var(--line);
}

/* Callouts */

.callout {
	max-width: 68ch;
	margin: 1.6em 0;
	padding: 16px 18px;
	border-left: 3px solid var(--purple);
	border-radius: 0 12px 12px 0;
	background: var(--lavender-tint);
}

.callout > :last-child {
	margin-bottom: 0;
}

.callout--tip {
	border-color: var(--purple);
}

.callout--try {
	border-color: var(--lavender);
}

.callout--mistake {
	border-color: var(--danger);
	background: rgba(180, 35, 24, 0.07);
}

html[data-theme="dark"] .callout--mistake {
	background: rgba(255, 158, 146, 0.1);
	border-color: var(--feedback-bad);
}

.callout strong:first-child {
	display: block;
}

/* Exercise solutions */

.solution {
	max-width: 68ch;
	margin: 1.2em 0;
	padding: 0 16px;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--surface);
}

.solution__summary {
	display: flex;
	align-items: center;
	min-height: 44px;
	padding: 10px 0;
	color: var(--purple-deep);
	font-weight: 600;
	cursor: pointer;
}

.solution__summary:hover {
	color: var(--purple);
}

.solution__body {
	padding-bottom: 16px;
}

.solution__body > :last-child {
	margin-bottom: 0;
}

/* Table of contents */

.toc-wrap {
	margin: 0 0 22px;
}

.toc {
	max-width: 68ch;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--surface);
}

.toc__summary {
	display: flex;
	align-items: center;
	min-height: 44px;
	padding: 10px 16px;
	color: var(--ink);
	font-weight: 600;
	cursor: pointer;
}

.toc__list {
	margin: 0;
	padding: 0 16px 12px;
	list-style: none;
	font-size: 0.9rem;
}

.toc__item a {
	display: block;
	padding: 5px 0;
	color: var(--ink-soft);
	text-decoration: none;
}

.toc__item a:hover {
	color: var(--purple-deep);
	text-decoration: underline;
}

.toc__item--h3 {
	padding-left: 16px;
}

/* Lesson actions, author, navigation */

.lesson-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 36px 0 6px;
	padding-top: 24px;
	border-top: 1px solid var(--line);
}

.complete-toggle.is-complete {
	background: var(--run-green-ink);
	color: #fff;
}

.complete-toggle.is-complete:hover {
	background: #266a28;
}

.complete-toggle__icon {
	display: inline-flex;
}

.complete-toggle .icon {
	width: 17px;
	height: 17px;
}

.lesson-actions__note {
	margin: 0 0 28px;
	color: var(--ink-soft);
	font-size: 0.8rem;
}

.author-box {
	display: flex;
	gap: 16px;
	margin: 30px 0;
	padding: 20px;
	border: 1px solid var(--line);
	border-radius: var(--radius-card);
	background: var(--surface);
}

.author-box__avatar img {
	width: 56px;
	height: 56px;
	border-radius: 50%;
}

.author-box__title {
	margin: 0 0 4px;
	color: var(--ink-soft);
	font-family: var(--font-body);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.01em;
}

.author-box__name {
	margin: 0;
	font-family: var(--font-head);
	font-size: 1.05rem;
	font-weight: 700;
}

.author-box__name a {
	color: var(--ink);
	text-decoration: none;
}

.author-box__name a:hover {
	color: var(--purple-deep);
}

.author-box__role {
	margin: 2px 0 8px;
	color: var(--ink-soft);
	font-size: 0.8rem;
}

.author-box__bio {
	margin: 0 0 8px;
	font-size: 0.9rem;
}

.author-box__review {
	margin: 0;
	color: var(--ink-soft);
	font-size: 0.78rem;
}

.author-box__updated {
	display: block;
}

.lesson-nav {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin: 32px 0;
}

.lesson-nav__link {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-height: 84px;
	padding: 16px;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--surface);
	text-decoration: none;
}

.lesson-nav__link:hover {
	border-color: var(--purple);
	background: var(--lavender-tint);
}

.lesson-nav__label {
	color: var(--ink-soft);
	font-size: 0.76rem;
}

.lesson-nav__title {
	color: var(--ink);
	font-weight: 600;
}

.lesson-nav__link--next {
	text-align: right;
}

.related {
	margin: 34px 0;
	padding-top: 22px;
	border-top: 1px solid var(--line);
}

.related__title {
	margin: 0 0 12px;
	font-size: 1.25rem;
}

.related__list {
	display: grid;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.related__item {
	padding: 10px 0;
	border-bottom: 1px solid var(--line);
}

.related__item a {
	color: var(--ink);
	font-weight: 500;
	text-decoration: none;
}

.related__item a:hover {
	color: var(--purple-deep);
	text-decoration: underline;
}

.related__note {
	display: block;
	color: var(--ink-soft);
	font-size: 0.76rem;
}

/* ---------- Ads ---------- */

.tin-ad {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 280px;
	margin: 44px 0;
	padding: 16px;
	overflow: hidden;
	border-radius: 10px;
	background: var(--ad-bg);
	color: var(--ad-ink);
	text-align: center;
}

.tin-ad__label {
	font-family: var(--font-body);
	font-size: 0.68rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ad-ink);
}

.tin-ad__frame {
	display: block;
	width: 100%;
	height: 250px;
}

.tin-ad__placeholder {
	color: var(--ad-ink);
	font-size: 0.78rem;
	line-height: 1.5;
}

.tin-ad__placeholder code {
	font-family: var(--font-mono);
	font-size: 0.72rem;
}

.tin-ad--sidebar {
	min-height: 600px;
	margin: 0 0 20px;
}

.tin-ad--sidebar .tin-ad__frame {
	height: 570px;
}

.tin-ad--end-article {
	min-height: 280px;
}

/* ---------- Sidebar and widgets ---------- */

.sidebar-note {
	padding: 18px;
	border: 1px solid var(--line);
	border-radius: var(--radius-card);
	background: var(--surface);
}

.sidebar-note__title {
	margin: 0 0 8px;
	font-size: 1rem;
}

.sidebar-note p {
	margin: 0 0 8px;
	color: var(--ink-soft);
	font-size: 0.85rem;
}

.widget {
	margin-bottom: 20px;
	padding: 18px;
	border: 1px solid var(--line);
	border-radius: var(--radius-card);
	background: var(--surface);
}

.widget-title {
	margin: 0 0 10px;
	font-size: 1rem;
}

.widget ul {
	margin: 0;
	padding-left: 1.1em;
	font-size: 0.9rem;
}

/* ---------- Archive and search ---------- */

.archive-head {
	margin: 26px 0 28px;
}

.archive-title {
	margin: 0 0 8px;
}

.archive-desc {
	max-width: 68ch;
	margin: 0;
	color: var(--ink-soft);
}

.search-form {
	max-width: 640px;
	margin: 18px 0;
}

.post-list,
.search-list {
	display: grid;
	gap: 0;
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--line);
}

.post-item,
.search-item {
	padding: 20px 0;
	border-bottom: 1px solid var(--line);
}

.post-item__date,
.search-item__type {
	margin: 0 0 4px;
	color: var(--ink-soft);
	font-size: 0.75rem;
}

.post-item__title,
.search-item__title {
	margin: 0 0 6px;
	font-size: 1.2rem;
}

.post-item__title a,
.search-item__title a {
	color: var(--ink);
	text-decoration: none;
}

.post-item__title a:hover,
.search-item__title a:hover {
	color: var(--purple-deep);
}

.post-item__excerpt,
.search-item__excerpt {
	margin: 0;
	color: var(--ink-soft);
	font-size: 0.93rem;
	max-width: 68ch;
}

.empty-state {
	padding: 24px;
	border: 1px solid var(--line);
	border-radius: var(--radius-card);
	background: var(--surface);
}

.link-list {
	display: grid;
	gap: 2px;
	margin: 12px 0 0;
	padding: 0;
	list-style: none;
}

.link-list--two {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.link-list a {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	color: var(--purple-deep);
	font-weight: 500;
}

.page-links {
	margin: 24px 0;
	font-size: 0.9rem;
}

.pagination,
.nav-links {
	margin: 28px 0;
}

.nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 10px;
	border: 1px solid var(--line);
	border-radius: 10px;
	color: var(--ink-soft);
	text-decoration: none;
}

.page-numbers.current {
	background: var(--purple);
	border-color: var(--purple);
	color: #fff;
}

/* ---------- Quiz ---------- */

.quiz {
	margin: 26px 0;
	padding: clamp(18px, 3vw, 30px);
	border: 1px solid var(--line);
	border-radius: var(--radius-card);
	background: var(--surface);
}

.quiz__title {
	margin: 0 0 6px;
	font-size: 1.4rem;
}

.quiz__kicker {
	margin: 0 0 4px;
	color: var(--purple-deep);
	font-size: 0.76rem;
	font-weight: 600;
}

.quiz__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	margin: 0 0 18px;
	color: var(--ink-soft);
	font-size: 0.79rem;
}

.quiz__q {
	margin: 0;
	padding: 20px 0 4px;
	border: 0;
	border-top: 1px solid var(--line);
}

.quiz__q:first-of-type {
	border-top: 0;
	padding-top: 0;
}

.quiz__legend {
	display: block;
	margin: 0 0 12px;
	padding: 0;
}

.quiz__number {
	display: block;
	margin-bottom: 4px;
	color: var(--ink-soft);
	font-size: 0.76rem;
}

.quiz__question {
	display: block;
	font-family: var(--font-head);
	font-size: 1.04rem;
	font-weight: 700;
	line-height: 1.35;
}

.quiz__options {
	display: grid;
	gap: 8px;
	margin-bottom: 8px;
}

.quiz-option {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	min-height: 44px;
	padding: 10px 12px;
	border: 1px solid var(--line);
	border-radius: var(--radius-btn);
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.quiz-option:hover {
	background: var(--lavender-tint);
}

.quiz-option input {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin-top: 4px;
	accent-color: var(--purple);
}

.quiz-option__key {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border: 1px solid var(--line);
	border-radius: 6px;
	color: var(--ink-soft);
	font-family: var(--font-mono);
	font-size: 0.72rem;
}

.quiz-option.is-correct {
	border-color: var(--run-green-ink);
	background: rgba(76, 159, 67, 0.1);
}

.quiz-option.is-wrong {
	border-color: var(--feedback-bad);
	background: rgba(180, 35, 24, 0.08);
}

.quiz-option.is-correct .quiz-option__key {
	border-color: var(--run-green-ink);
	color: var(--run-green-ink);
}

.quiz__feedback {
	min-height: 1.4em;
	margin: 6px 0 0;
	font-size: 0.87rem;
}

.quiz__feedback.is-correct {
	color: var(--run-green-ink);
}

html[data-theme="dark"] .quiz__feedback.is-correct {
	color: var(--run-green-glow);
}

.quiz__feedback.is-wrong {
	color: var(--feedback-bad);
}

.quiz__explain {
	margin: 6px 0 0;
	color: var(--ink-soft);
	font-size: 0.87rem;
}

.quiz__actions {
	margin-top: 22px;
	padding-top: 18px;
	border-top: 1px solid var(--line);
}

.quiz__actions .btn + .btn {
	margin-left: 8px;
}

.quiz__note {
	margin: 10px 0 0;
	color: var(--ink-soft);
	font-size: 0.78rem;
}

.quiz__result {
	margin-top: 18px;
	padding: 16px 18px;
	border-radius: 12px;
	background: var(--lavender-tint);
	font-size: 0.95rem;
}

.quiz__result strong {
	font-family: var(--font-head);
	font-size: 1.15rem;
}

/* ---------- Tool and exam facts ---------- */

.tool-facts,
.exam-facts {
	display: grid;
	gap: 16px;
	margin: 0 0 22px;
	padding: 18px 20px;
	border: 1px solid var(--line);
	border-radius: var(--radius-card);
	background: var(--surface);
}

.tool-facts {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tool-facts__label {
	margin: 0 0 4px;
	color: var(--ink-soft);
	font-family: var(--font-body);
	font-size: 0.74rem;
	font-weight: 600;
	letter-spacing: 0.01em;
}

.tool-facts__value {
	margin: 0;
	font-weight: 500;
}

.tool-facts__note,
.exam-facts__note {
	margin: 8px 0 0;
	color: var(--ink-soft);
	font-size: 0.78rem;
}

.exam-facts__list {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
	margin: 0;
}

.exam-facts__item dt {
	color: var(--ink-soft);
	font-size: 0.74rem;
	font-weight: 600;
}

.exam-facts__item dd {
	margin: 2px 0 0;
	font-weight: 500;
}

/* ---------- Course CTA ---------- */

.course-cta {
	margin: 40px 0;
}

.course-cta__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	padding: 24px 26px;
	border-radius: var(--radius-card);
	background: var(--lavender-tint);
	border: 1px solid var(--lavender);
}

.course-cta__title {
	margin: 0 0 6px;
	font-size: 1.25rem;
}

.course-cta__inner p {
	margin: 0;
	max-width: 60ch;
	color: var(--ink-soft);
	font-size: 0.92rem;
}

/* ---------- Syllabus page ---------- */

.syllabus-head {
	padding: 26px 0 30px;
	background: var(--surface);
	border-bottom: 1px solid var(--line);
}

.syllabus-title {
	margin: 0 0 10px;
}

.syllabus-deck {
	max-width: 68ch;
	margin: 0 0 16px;
	color: var(--ink-soft);
	font-size: 1.02rem;
}

.syllabus-stats {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 22px;
	margin: 0 0 20px;
	padding: 0;
	list-style: none;
	color: var(--ink-soft);
	font-size: 0.83rem;
}

.syllabus-stats li {
	display: inline-flex;
	align-items: center;
}

.syllabus-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.module-list {
	margin: 30px 0;
	padding: 0;
	list-style: none;
	counter-reset: module;
}

.module {
	margin-bottom: 22px;
	padding: 20px 22px 8px;
	border: 1px solid var(--line);
	border-radius: var(--radius-card);
	background: var(--surface);
}

.module__num {
	margin: 0;
	color: var(--purple-deep);
	font-size: 0.76rem;
	font-weight: 600;
}

.module__title {
	margin: 2px 0 6px;
	font-size: 1.18rem;
}

.module__summary {
	margin: 0 0 6px;
	color: var(--ink-soft);
	font-size: 0.92rem;
	max-width: 68ch;
}

.module__meta {
	margin: 0 0 12px;
	color: var(--ink-soft);
	font-size: 0.77rem;
}

.module__lessons {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--line);
}

.module__lesson a {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 48px;
	padding: 8px 0;
	border-bottom: 1px solid var(--line);
	color: var(--ink);
	text-decoration: none;
}

.module__lesson:last-child a {
	border-bottom: 0;
}

.module__lesson a:hover {
	color: var(--purple-deep);
}

.module__index {
	flex: 0 0 28px;
	color: var(--ink-soft);
	font-family: var(--font-mono);
	font-size: 0.76rem;
}

.module__lesson-title {
	flex: 1;
	font-size: 0.95rem;
}

.module__lesson-time {
	color: var(--ink-soft);
	font-size: 0.75rem;
}

.lesson-list {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--line);
}

.lesson-list__item a {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	min-height: 52px;
	padding: 10px 0;
	border-bottom: 1px solid var(--line);
	color: var(--ink);
	text-decoration: none;
}

.lesson-list__item a:hover {
	color: var(--purple-deep);
}

.lesson-list__meta {
	display: flex;
	gap: 14px;
	color: var(--ink-soft);
	font-size: 0.76rem;
}

/* ---------- Pillars and misc ---------- */

.pillars {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px;
	margin: 18px 0 0;
	padding: 0;
	list-style: none;
}

.pillar {
	padding: 20px;
	border: 1px solid var(--line);
	border-radius: var(--radius-card);
	background: var(--surface);
}

.pillar__icon {
	display: inline-flex;
	margin-bottom: 10px;
	color: var(--purple);
}

.pillar__title {
	margin: 0 0 6px;
	font-size: 1.02rem;
}

.pillar p {
	margin: 0;
	color: var(--ink-soft);
	font-size: 0.9rem;
}

.editorial-links {
	margin: 26px 0;
	padding-top: 16px;
	border-top: 1px solid var(--line);
	font-size: 0.85rem;
}

.editorial-links ul {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 18px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.error-page {
	padding: 40px 20px 20px;
}

.error-page__code {
	margin: 0;
	color: var(--purple);
	font-family: var(--font-head);
	font-size: 3rem;
	font-weight: 800;
	line-height: 1;
}

.error-page__heading {
	margin: 32px 0 6px;
	font-size: 1.15rem;
}

/* ---------- Dashboard ---------- */

.dashboard-status {
	color: var(--ink-soft);
	font-size: 0.88rem;
}

.dashboard-tracks {
	display: grid;
	gap: 14px;
	margin: 18px 0 26px;
}

.dash-track {
	padding: 18px 20px;
	border: 1px solid var(--line);
	border-radius: var(--radius-card);
	background: var(--surface);
}

.dash-track__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
}

.dash-track__title {
	margin: 0;
	font-size: 1.08rem;
}

.dash-track__title a {
	color: var(--ink);
	text-decoration: none;
}

.dash-track__title a:hover {
	color: var(--purple-deep);
}

.dash-track__count {
	margin: 0;
	color: var(--ink-soft);
	font-size: 0.79rem;
}

.dash-track__bar {
	height: 8px;
	margin: 12px 0;
	overflow: hidden;
	border-radius: 999px;
	background: var(--lavender);
}

.dash-track__bar span {
	display: block;
	height: 100%;
	background: var(--run-green-ink);
	border-radius: 999px;
	transition: width 0.25s ease;
}

.dash-track__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
}

.dash-track__cert {
	font-size: 0.82rem;
}

.dash-track__cert[aria-disabled="true"] {
	color: var(--ink-soft);
	text-decoration: none;
	cursor: default;
}

.dashboard-note {
	margin: 30px 0;
	padding-top: 20px;
	border-top: 1px solid var(--line);
}

.dashboard-note__title {
	font-size: 1.1rem;
}

.dashboard-note p {
	color: var(--ink-soft);
	font-size: 0.9rem;
	max-width: 68ch;
}

/* ---------- Certificate ---------- */

.certificate-controls {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
	gap: 14px;
	align-items: end;
	margin: 24px 0 10px;
}

.field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.field label {
	color: var(--ink);
	font-size: 0.84rem;
	font-weight: 600;
}

.field input,
.field select {
	min-height: 46px;
	padding: 0 12px;
	border: 1px solid var(--line);
	border-radius: var(--radius-btn);
	background: var(--surface);
	color: var(--ink);
	font: inherit;
}

.certificate-status {
	min-height: 1.6em;
	color: var(--ink-soft);
	font-size: 0.86rem;
}

.certificate {
	margin: 24px 0;
}

.certificate__card {
	max-width: 820px;
	padding: clamp(22px, 5vw, 60px);
	border: 2px solid var(--purple-band);
	border-radius: 18px;
	background: var(--surface);
	text-align: center;
}

.certificate__brand {
	margin: 0 0 22px;
	color: var(--purple);
	font-family: var(--font-head);
	font-size: 1.05rem;
	font-weight: 800;
}

.certificate__heading {
	margin: 0 0 22px;
	font-size: clamp(1.5rem, 3vw, 2.1rem);
}

.certificate__presented {
	margin: 0;
	color: var(--ink-soft);
	font-size: 0.9rem;
}

.certificate__name {
	display: inline-block;
	min-width: 60%;
	margin: 4px 0 16px;
	padding-bottom: 6px;
	border-bottom: 1px solid var(--line);
	font-family: var(--font-head);
	font-size: clamp(1.5rem, 4vw, 2.6rem);
	font-weight: 800;
	line-height: 1.2;
}

.certificate__text {
	max-width: 52ch;
	margin: 0 auto 18px;
}

.certificate__meta {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px 24px;
	margin: 0 0 22px;
	color: var(--ink-soft);
	font-size: 0.83rem;
}

.certificate__sign {
	margin: 0;
	font-weight: 600;
}

.certificate__note {
	margin: 16px 0 0;
	color: var(--ink-soft);
	font-size: 0.72rem;
}

.certificate-page__back {
	margin: 24px 0;
}

/* ---------- Footer ---------- */

.site-footer {
	margin-top: 56px;
	padding: 44px 0 22px;
	background: var(--purple-band);
	color: #fff;
}

.footer-grid {
	display: grid;
	grid-template-columns: 1.6fr repeat(3, minmax(0, 1fr));
	gap: 30px;
}

.brand--footer,
.brand--footer:hover {
	color: #fff;
}

.footer-brand__line {
	max-width: 36ch;
	margin: 12px 0 0;
	color: #fff;
	opacity: 0.92;
	font-size: 0.88rem;
}

.footer-nav__title {
	margin: 0 0 8px;
	color: #fff;
	font-family: var(--font-body);
	font-size: 0.82rem;
	font-weight: 700;
	letter-spacing: 0.01em;
}

.footer-nav .menu {
	display: grid;
	gap: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.footer-nav a {
	display: inline-flex;
	align-items: center;
	min-height: 38px;
	color: #fff;
	opacity: 0.94;
	font-size: 0.88rem;
	text-decoration: none;
}

.footer-nav a:hover {
	opacity: 1;
	text-decoration: underline;
	color: #fff;
}

.footer-bottom {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 8px 20px;
	margin-top: 28px;
	padding-top: 16px;
	border-top: 1px solid rgba(255, 255, 255, 0.28);
	color: #fff;
	opacity: 0.9;
	font-size: 0.78rem;
}

.footer-bottom p {
	margin: 0;
}

/* Dark theme: primary buttons need dark ink on light purple for AA. */
html[data-theme="dark"] .btn--primary {
	color: #12132a;
}

html[data-theme="dark"] .btn--primary:hover {
	background: var(--purple-deep);
	color: #12132a;
}

html[data-theme="dark"] .rail-item.is-current .rail-node {
	color: #12132a;
}

html[data-theme="dark"] .page-numbers.current {
	color: #12132a;
}

html[data-theme="dark"] .skip-link {
	background: #ececf7;
	color: #12132a;
}

/* ---------- Responsive ---------- */

@media (min-width: 1200px) {
	.lesson-layout {
		grid-template-columns: 258px minmax(0, 720px) 300px;
		justify-content: center;
		gap: 34px;
	}

	.lesson-sidebar-wrap {
		display: block;
		position: sticky;
		top: 92px;
		align-self: start;
	}

	.lesson-main {
		max-width: none;
	}
}

@media (max-width: 1040px) {
	.card-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.pillars {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.footer-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.certificate-controls {
		grid-template-columns: 1fr 1fr;
	}

	.certificate-controls .btn {
		grid-column: 1 / -1;
		justify-self: start;
	}
}

@media (max-width: 980px) {
	.hero {
		padding-top: 26px;
	}

	.hero-card {
		grid-template-columns: minmax(0, 1fr);
	}

	.hero__panel {
		margin-bottom: 6px;
	}
}

@media (max-width: 900px) {
	.site-header__inner {
		min-height: 62px;
	}

	.nav-toggle {
		display: inline-flex;
	}

	.primary-nav {
		position: absolute;
		left: 0;
		right: 0;
		top: 100%;
		display: none;
		margin: 0;
		padding: 8px 20px 16px;
		border-bottom: 1px solid var(--line);
		background: var(--surface);
		box-shadow: 0 16px 30px -24px rgba(0, 0, 0, 0.45);
	}

	.primary-nav.is-open {
		display: block;
	}

	.primary-nav .menu {
		flex-direction: column;
	}

	.primary-nav a {
		width: 100%;
		min-height: 48px;
	}

	.lesson-layout {
		display: flex;
		flex-direction: column;
		gap: 26px;
	}

	.lesson-main {
		order: 1;
		width: 100%;
		max-width: none;
	}

	.lesson-rail {
		order: 2;
		position: static;
		width: 100%;
		max-height: none;
		padding-top: 22px;
		border-top: 1px solid var(--line);
	}

	.lesson-sidebar-wrap {
		order: 3;
	}

	.lesson-meter {
		display: flex;
	}

	.lesson-nav {
		grid-template-columns: 1fr;
	}

	.lesson-nav__link--next {
		text-align: left;
	}

	.tool-facts,
	.exam-facts__list {
		grid-template-columns: 1fr;
	}

	.exam-facts__list {
		gap: 12px;
	}

	.quiz__actions .btn {
		width: 100%;
		margin: 0 0 8px;
	}

	.author-box {
		flex-direction: column;
	}
}

@media (max-width: 720px) {
	body {
		font-size: 16.5px;
	}

	.card-grid,
	.card-grid--guides,
	.card-grid--quizzes,
	.pillars,
	.footer-grid,
	.link-list--two {
		grid-template-columns: minmax(0, 1fr);
	}

	.certificate-controls {
		grid-template-columns: 1fr;
	}

	.tin-ad {
		min-height: 250px;
		margin: 34px 0;
	}

	.module__lesson-time {
		display: none;
	}

	.section {
		padding: 34px 0;
	}

	.hero__panel .runner__foot {
		right: 14px;
	}

	.runner__key {
		display: none;
	}

	.footer-bottom {
		flex-direction: column;
	}
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
	}
}

/* ---------- Print ---------- */

@media print {
	:root {
		--bg: #fff;
		--surface: #fff;
		--ink: #000;
		--ink-soft: #333;
		--line: #999;
	}

	body {
		background: #fff;
		color: #000;
		font-size: 11pt;
	}

	.site-header,
	.site-footer,
	.lesson-rail,
	.lesson-sidebar-wrap,
	.lesson-actions,
	.lesson-actions__note,
	.lesson-nav,
	.related,
	.comments,
	.tin-ad,
	.reading-progress,
	.dashboard,
	.toc-wrap,
	.author-box,
	.lesson-meter,
	.breadcrumbs,
	.certificate-controls,
	.certificate-status,
	.certificate-page__head,
	.certificate-page__back,
	.editorial-links,
	.copy-button {
		display: none !important;
	}

	.wrap {
		max-width: none;
		padding: 0;
	}

	a {
		color: #000;
		text-decoration: underline;
	}

	.prose {
		max-width: none;
	}

	.prose pre,
	.code-panel {
		border: 1px solid #999;
		background: #fff;
		color: #000;
		box-shadow: none;
	}

	.prose pre code,
	.runner__code,
	.runner__highlight {
		color: #000;
	}

	.certificate {
		display: block !important;
	}

	.certificate__card {
		max-width: none;
		border-color: #5b33a6;
	}
}
