/*
 * StretchLearn Free — components.
 * The theme owns the chrome (nav, hero, marketing sections, footer, sign-in)
 * and the interior page shells. The dynamic LMS surfaces (catalog, course,
 * lesson, dashboard) are rendered by the swp-learn connector inside a
 * self-contained `.swpl-root`; the bridge at the end keeps that connector
 * output in sync with this theme's light/dark toggle.
 */

/* ---- Skip link ------------------------------------------------------- */
.c-skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 100;
	padding: 0.6rem 1rem;
	background: var(--c-brand-600);
	color: #fff;
	border-radius: 0 0 var(--radius-card) 0;
}
.c-skip-link:focus { left: 0; color: #fff; }

/* ---- Brand lockup ---------------------------------------------------- */
.c-brand {
	display: inline-flex;
	align-items: center;
	gap: 0.65rem;
	font-family: var(--font-display);
	font-weight: 600;
	letter-spacing: -0.01em;
	color: var(--c-ink);
	text-decoration: none;
}
.c-brand:hover { color: var(--c-ink); }
.c-brand__tile {
	position: relative;
	width: 36px;
	height: 36px;
	border-radius: 11px;
	display: grid;
	place-items: center;
	background: var(--brand-tile);
	box-shadow: var(--shadow-card);
	color: #fff;
	font-weight: 800;
	font-size: 18px;
	text-transform: uppercase;
}
.c-brand__tile::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 11px;
	box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.22);
}
.c-brand__name { font-size: 1.3rem; }
.c-brand .c-logo img { display: block; }

/* ---- Site header (glass nav) ----------------------------------------- */
.c-site-header {
	position: sticky;
	top: 0;
	z-index: 40;
	border-bottom: 1px solid var(--c-border);
	background: var(--c-glass);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
}
.c-site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	min-height: 64px;
	padding-block: 0.5rem;
}
.c-site-header__lead { display: flex; align-items: center; gap: 2rem; min-width: 0; }

.c-desktop-nav { display: none; }
@media (min-width: 900px) { .c-desktop-nav { display: block; } }
.c-desktop-nav ul {
	display: flex;
	align-items: center;
	gap: 0.15rem;
	list-style: none;
	margin: 0;
	padding: 0;
}
.c-desktop-nav a {
	display: inline-block;
	padding: 0.5rem 0.75rem;
	border-radius: 8px;
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--c-ink-muted);
	transition: color var(--dur-fast) ease, background var(--dur-fast) ease;
}
.c-desktop-nav a:hover,
.c-desktop-nav .current-menu-item > a {
	color: var(--c-ink);
	background: var(--c-surface);
}

.c-site-header__actions { display: flex; align-items: center; gap: 0.5rem; }
.c-site-header__cta { display: none; }
@media (min-width: 720px) { .c-site-header__cta { display: inline-flex; } }

/* ---- Theme toggle ---------------------------------------------------- */
.c-theme-toggle {
	width: 38px;
	height: 38px;
	flex: none;
	border-radius: 9px;
	border: 1px solid var(--c-border);
	background: var(--c-surface);
	color: var(--c-ink-muted);
	display: grid;
	place-items: center;
	cursor: pointer;
	transition: color var(--dur) ease, border-color var(--dur) ease;
}
.c-theme-toggle:hover { color: var(--c-ink); border-color: var(--c-border-strong); }
.c-theme-toggle .c-icon-moon { display: block; }
.c-theme-toggle .c-icon-sun { display: none; }
.dark .c-theme-toggle .c-icon-moon { display: none; }
.dark .c-theme-toggle .c-icon-sun { display: block; }

/* ---- Nav toggle + mobile drawer -------------------------------------- */
.c-nav-toggle {
	display: inline-grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border: 1px solid var(--c-border);
	border-radius: 9px;
	background: var(--c-surface);
	color: var(--c-ink);
	cursor: pointer;
}
@media (min-width: 900px) { .c-nav-toggle { display: none; } }

.c-mobile-nav { position: fixed; inset: 0; z-index: 60; }
.c-mobile-nav[hidden] { display: none; }
.c-mobile-nav__backdrop {
	position: absolute;
	inset: 0;
	border: 0;
	background: rgb(8 10 18 / 0.45);
	backdrop-filter: blur(4px);
	cursor: pointer;
}
.c-mobile-nav__panel {
	position: absolute;
	inset: 0 0 0 auto;
	width: min(88vw, 340px);
	background: var(--c-surface);
	border-left: 1px solid var(--c-border);
	box-shadow: var(--shadow-overlay);
	padding: 1.25rem;
	display: flex;
	flex-direction: column;
	gap: 1rem;
	overflow-y: auto;
}
.c-mobile-nav__head { display: flex; align-items: center; justify-content: space-between; }
.c-mobile-nav__title { font-weight: 700; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--c-ink-subtle); }
.c-mobile-nav__close {
	width: 36px; height: 36px;
	display: grid; place-items: center;
	border: 1px solid var(--c-border); border-radius: 9px;
	background: var(--c-surface); color: var(--c-ink-muted); cursor: pointer;
}
.c-mobile-nav__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.c-mobile-nav__list a {
	display: block;
	padding: 0.7rem 0.6rem;
	border-radius: 8px;
	font-size: 1rem;
	font-weight: 500;
	color: var(--c-ink);
}
.c-mobile-nav__list a:hover { background: var(--c-bg); }
.c-mobile-nav__actions { display: flex; flex-direction: column; gap: 0.6rem; margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--c-border); }

/* ---- Buttons --------------------------------------------------------- */
.c-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	height: 44px;
	padding: 0 1.25rem;
	border-radius: 12px;
	border: 1px solid transparent;
	font-family: var(--font-sans);
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	text-decoration: none;
	white-space: nowrap;
	transition: background var(--dur) var(--ease-spring), border-color var(--dur) var(--ease-spring),
		color var(--dur) var(--ease-spring), transform var(--dur) var(--ease-spring);
}
.c-button:active { transform: scale(0.99); }
.c-button--sm { height: 36px; padding: 0 0.875rem; font-size: 0.85rem; }
.c-button--lg { height: 48px; padding: 0 1.5rem; font-size: 1rem; }
.c-button--full { width: 100%; }

.c-button--primary {
	background: var(--c-brand-600);
	color: #fff;
	box-shadow: var(--shadow-glow);
}
.c-button--primary:hover { background: var(--c-brand-700); color: #fff; }

.c-button--secondary {
	background: var(--c-surface);
	color: var(--c-ink);
	border-color: var(--c-border-strong);
	box-shadow: var(--shadow-card);
}
.c-button--secondary:hover { border-color: rgb(var(--brand-500) / 0.4); background: var(--c-bg); }

.c-button--outline { background: transparent; color: var(--c-ink); border-color: var(--c-border-strong); }
.c-button--outline:hover { color: var(--c-brand-700); border-color: rgb(var(--brand-500) / 0.5); }

.c-button--ghost { background: transparent; color: var(--c-ink-muted); }
.c-button--ghost:hover { color: var(--c-ink); background: var(--c-bg); }

.c-button__icon { flex: none; }

/* ---- Eyebrow / badges / chips ---------------------------------------- */
.c-eyebrow {
	display: inline-block;
	font-size: var(--eyebrow);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--c-brand-600);
	margin-bottom: 0.4rem;
}
.c-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	border-radius: 999px;
	border: 1px solid var(--c-soft-bd);
	background: var(--c-soft);
	color: var(--c-soft-fg);
	padding: 0.2rem 0.65rem;
	font-size: 0.75rem;
	font-weight: 600;
}
.c-badge__dot { width: 6px; height: 6px; border-radius: 999px; background: var(--c-brand-500); }
.c-badge--neutral { background: var(--c-surface); color: var(--c-ink); border-color: var(--c-border); }

/* ---- Gradient text --------------------------------------------------- */
.gradient-text {
	background: linear-gradient(96deg, var(--c-ink) 10%, var(--c-brand-600) 55%, var(--c-accent) 92%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

/* ---- Sections -------------------------------------------------------- */
.c-section { padding-block: clamp(3rem, 2.3rem + 2.5vw, 5rem); }
.c-section--tight { padding-block: clamp(2rem, 1.6rem + 1.5vw, 3rem); }
.c-section--alt { background: var(--c-surface); border-block: 1px solid var(--c-border); }
.c-section-head { max-width: 44rem; margin-bottom: 2rem; }
.c-section-head--center { margin-inline: auto; text-align: center; }
.c-section-head__title { font-size: var(--display-sm); }
.c-lead { font-size: var(--text-lg); color: var(--c-ink-muted); line-height: 1.6; }

/* ---- Hero ------------------------------------------------------------ */
.c-hero { position: relative; overflow: hidden; }
.c-hero__wash,
.c-hero__grid {
	position: absolute;
	inset: 0 0 auto 0;
	height: 620px;
	z-index: 0;
	pointer-events: none;
}
.c-hero__wash { background: var(--brand-mesh); opacity: 0.9; }
.c-hero__grid {
	background: var(--grid-faint);
	background-size: var(--grid-size);
	-webkit-mask-image: radial-gradient(70% 60% at 50% 0%, #000, transparent);
	mask-image: radial-gradient(70% 60% at 50% 0%, #000, transparent);
}
.c-hero__inner {
	position: relative;
	z-index: 1;
	padding-block: clamp(3.5rem, 2.5rem + 4vw, 4.5rem);
	text-align: center;
}
.c-hero__title {
	font-size: var(--display-xl);
	line-height: 1.05;
	letter-spacing: -0.015em;
	max-width: 52rem;
	margin-inline: auto;
}
.c-hero__lead { margin: 1.4rem auto 0; max-width: 38rem; }
.c-hero__actions { margin-top: 2rem; display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.c-hero__note { margin-top: 1.1rem; font-size: 0.75rem; color: var(--c-ink-subtle); }
.c-hero__strip {
	margin-top: 2.5rem;
	display: flex;
	gap: 1.75rem;
	justify-content: center;
	flex-wrap: wrap;
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--c-ink-subtle);
}
.c-hero__strip span:nth-child(even) { color: var(--c-border-strong); }

/* ---- Lane tiles / curriculum lanes ----------------------------------- */
.c-lanes {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
	gap: 1rem;
}
.c-lane {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	padding: 1rem 1.1rem;
	background: var(--c-surface);
	border: 1px solid var(--c-border);
	border-radius: var(--radius-marketing);
	box-shadow: var(--shadow-card);
	text-decoration: none;
	color: var(--c-ink);
	transition: border-color var(--dur) var(--ease-spring), box-shadow var(--dur) var(--ease-spring), transform var(--dur) var(--ease-spring);
}
.c-lane:hover {
	color: var(--c-ink);
	border-color: rgb(var(--brand-500) / 0.4);
	box-shadow: var(--shadow-panel);
	transform: translateY(-2px);
}
.c-lane__tile {
	position: relative;
	width: 46px;
	height: 46px;
	flex: none;
	border-radius: 12px;
	display: grid;
	place-items: center;
	color: #fff;
	box-shadow: var(--shadow-card);
	background: var(--brand-tile);
}
.c-lane__tile::after { content: ""; position: absolute; inset: 0; border-radius: 12px; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.18); }
.c-lane__tile svg { width: 22px; height: 22px; }
.c-lane__name { font-weight: 600; font-size: 0.95rem; }
.c-lane__count { font-size: 0.75rem; color: var(--c-ink-subtle); }

/* ---- Journey / how-it-works ------------------------------------------ */
.c-journey { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 1.25rem; list-style: none; margin: 0; padding: 0; }
.c-journey__step { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-panel); padding: 1.4rem; box-shadow: var(--shadow-card); }
.c-journey__num { font-family: var(--font-mono); font-size: 0.8rem; color: var(--c-brand-600); font-weight: 600; }
.c-journey__title { font-size: 1.05rem; margin: 0.6rem 0 0.35rem; }
.c-journey__body { font-size: 0.9rem; color: var(--c-ink-muted); margin: 0; }

/* ---- Proof / metrics row --------------------------------------------- */
.c-proof { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: 1.25rem; list-style: none; margin: 0; padding: 0; }
.c-proof__item { text-align: center; }
.c-proof__value { font-family: var(--font-display); font-size: var(--display-sm); font-weight: 640; color: var(--c-ink); }
.c-proof__label { font-size: 0.85rem; color: var(--c-ink-muted); }

/* ---- Connector embeds ------------------------------------------------ */
.c-connector { padding-block: clamp(2rem, 1.6rem + 1.5vw, 3rem); }
.c-connector--flush { padding-top: 0; }

/* ---- Page hero (interior) -------------------------------------------- */
.c-page-hero { position: relative; overflow: hidden; padding-block: clamp(2.5rem, 2rem + 2vw, 3.5rem); border-bottom: 1px solid var(--c-border); }
.c-page-hero__wash { position: absolute; inset: 0; z-index: 0; background: var(--brand-mesh); opacity: 0.5; pointer-events: none; }
.c-page-hero__inner { position: relative; z-index: 1; }
.c-page-hero__title { font-size: var(--display-md); max-width: 44rem; }
.c-page-hero__lead { margin-top: 0.75rem; max-width: 40rem; }

/* ---- Sign-in / register card ----------------------------------------- */
.c-auth { padding-block: clamp(2.5rem, 2rem + 3vw, 4.5rem); }
.c-auth__card {
	max-width: 30rem;
	margin-inline: auto;
	background: var(--c-surface);
	border: 1px solid var(--c-border);
	border-radius: var(--radius-marketing);
	box-shadow: var(--shadow-panel);
	padding: 1.75rem;
}
.c-auth__title { font-size: var(--display-sm); margin: 1rem 0 0.25rem; }
.c-auth__note { font-size: 0.9rem; color: var(--c-ink-muted); }
.c-auth__foot { text-align: center; font-size: 0.8rem; color: var(--c-ink-subtle); margin-top: 1rem; }
.c-auth__hooknote {
	margin-top: 1.25rem;
	padding: 0.9rem 1rem;
	border: 1px dashed var(--c-border-strong);
	border-radius: var(--radius-card);
	background: var(--c-bg);
	font-size: 0.8rem;
	color: var(--c-ink-subtle);
}

/* ---- Final CTA ------------------------------------------------------- */
.c-final-cta { position: relative; overflow: hidden; padding-block: clamp(3rem, 2.4rem + 3vw, 5rem); background: var(--c-surface); border-block: 1px solid var(--c-border); }
.c-final-cta__wash { position: absolute; inset: 0; z-index: 0; background: var(--brand-glow); pointer-events: none; }
.c-final-cta__inner { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; justify-content: space-between; }
.c-final-cta__title { font-size: var(--display-sm); max-width: 34rem; }
.c-final-cta__actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* ---- Prose ----------------------------------------------------------- */
.c-prose { color: var(--c-ink-muted); }
.c-prose > * + * { margin-top: 1.1rem; }
.c-prose h2, .c-prose h3, .c-prose h4 { color: var(--c-ink); margin-top: 2rem; }
.c-prose a { text-decoration: underline; }
.c-prose ul, .c-prose ol { padding-left: 1.25rem; }
.c-prose img { border-radius: var(--radius-card); }
.c-prose code { font-family: var(--font-mono); font-size: 0.85em; background: var(--c-brand-50); color: var(--c-brand-700); padding: 0.125em 0.375em; border-radius: 6px; }

/* ---- Cards (generic marketing / archive) ----------------------------- */
.c-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: 1.25rem; }
.c-card {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: 1.25rem;
	background: var(--c-surface);
	border: 1px solid var(--c-border);
	border-radius: var(--radius-marketing);
	box-shadow: var(--shadow-card);
	text-decoration: none;
	color: var(--c-ink);
	transition: border-color var(--dur) var(--ease-spring), box-shadow var(--dur) var(--ease-spring), transform var(--dur) var(--ease-spring);
}
.c-card:hover { color: var(--c-ink); border-color: rgb(var(--brand-500) / 0.4); box-shadow: var(--shadow-panel); transform: translateY(-2px); }
.c-card__title { font-size: 1.05rem; }
.c-card__summary { font-size: 0.9rem; color: var(--c-ink-muted); }
.c-card__meta { font-size: 0.75rem; color: var(--c-ink-subtle); }
.c-card__more { margin-top: auto; font-weight: 600; color: var(--c-soft-fg); font-size: 0.85rem; }

/* ---- Notice / empty -------------------------------------------------- */
.c-notice { padding: 1.4rem 1.5rem; border: 1px solid var(--c-border); border-radius: var(--radius-panel); background: var(--c-surface); color: var(--c-ink-muted); }
.c-empty-state { text-align: center; padding: 3rem 1rem; color: var(--c-ink-subtle); }
.c-note { font-size: 0.85rem; color: var(--c-ink-subtle); }

/* ---- Pagination + search --------------------------------------------- */
.c-pagination { margin-top: 2rem; }
.c-pagination .page-numbers {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 40px; height: 40px; padding: 0 0.6rem; margin: 0 0.15rem;
	border: 1px solid var(--c-border); border-radius: var(--radius-card);
	background: var(--c-surface); color: var(--c-ink); text-decoration: none; font-weight: 600; font-size: 0.85rem;
}
.c-pagination .page-numbers.current { background: var(--c-brand-600); border-color: var(--c-brand-600); color: #fff; }
.c-search-form { display: flex; gap: 0.5rem; }
.c-search-form input[type="search"] {
	flex: 1; height: 44px; padding: 0 0.9rem;
	border: 1px solid var(--c-border-strong); border-radius: var(--radius-card);
	background: var(--c-surface); color: var(--c-ink); font: inherit; font-size: 0.9rem;
}

/* ---- Site footer ----------------------------------------------------- */
.c-site-footer { border-top: 1px solid var(--c-border); background: var(--c-surface); }
.c-site-footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2.5rem; padding-block: 3rem 2rem; }
@media (max-width: 780px) { .c-site-footer__grid { grid-template-columns: 1fr 1fr; gap: 1.75rem; } }
@media (max-width: 480px) { .c-site-footer__grid { grid-template-columns: 1fr; } }
.c-site-footer__summary { margin-top: 1rem; max-width: 18rem; font-size: 0.875rem; color: var(--c-ink-muted); }
.c-site-footer__heading { font-family: var(--font-sans); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--c-ink-subtle); margin: 0 0 0.9rem; }
.c-site-footer__col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.65rem; }
.c-site-footer__col a { font-size: 0.875rem; color: var(--c-ink-muted); }
.c-site-footer__col a:hover { color: var(--c-ink); }
.c-site-footer__legal { border-top: 1px solid var(--c-border); padding-block: 1.15rem; display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; align-items: center; justify-content: space-between; }
.c-site-footer__legal-nav { display: flex; gap: 1.1rem; list-style: none; margin: 0; padding: 0; }
.c-site-footer__legal-nav a { font-size: 0.75rem; color: var(--c-ink-subtle); }
.c-site-footer__copy { font-size: 0.75rem; color: var(--c-ink-subtle); margin: 0; }

/* ---- Connector (swpl-root) dark-mode bridge --------------------------
   The connector ships its own light tokens and only goes dark on the OS
   preference or an explicit `.swpl-dark` class. The theme's toggle sets
   `.dark`/`.light` on <html>; re-declare the connector's dark tokens under
   `html.dark` (and re-assert light under `html.light`) so a manual toggle
   moves the connector output with the rest of the page. */
html.dark .swpl-root {
	--swpl-bg: #080a12;
	--swpl-surface: #10131e;
	--swpl-border: #212940;
	--swpl-border-strong: #323d56;
	--swpl-ink: #ebf0fc;
	--swpl-ink-muted: #a7b2c9;
	--swpl-ink-subtle: #7a869c;
	--swpl-brand-50: #241046;
	--swpl-brand-100: #2d165c;
	--swpl-brand-200: #5b3fa0;
	--swpl-brand-500: #a06cf5;
	--swpl-brand-600: #8e4ff0;
	--swpl-brand-700: #a574f7;
	--swpl-accent: #38bdf8;
	--swpl-soft: rgb(142 79 240 / 0.18);
	--swpl-soft-fg: #cbb6ff;
	--swpl-track: rgb(255 255 255 / 0.10);
	--swpl-mute-bg: rgb(255 255 255 / 0.06);
	--swpl-mute-fg: #94a3b8;
	--swpl-shadow-card: 0 1px 0 0 rgb(0 0 0 / 0.30), 0 1px 3px 0 rgb(0 0 0 / 0.40);
	--swpl-shadow-panel: 0 1px 0 0 rgb(0 0 0 / 0.30), 0 14px 34px -14px rgb(0 0 0 / 0.62);
}
html.light .swpl-root {
	--swpl-bg: #fafbfd;
	--swpl-surface: #ffffff;
	--swpl-border: #e2e8f0;
	--swpl-border-strong: #cbd5e1;
	--swpl-ink: #0d111c;
	--swpl-ink-muted: #475569;
	--swpl-ink-subtle: #758195;
	--swpl-brand-50: #f5f2fe;
	--swpl-brand-100: #ebe4fe;
	--swpl-brand-200: #d8c9fc;
	--swpl-brand-500: #8e4ff0;
	--swpl-brand-600: #7a2fe0;
	--swpl-brand-700: #6321c9;
	--swpl-accent: #0ea5e9;
}
