/*
Theme Name: Tutorial Tube
Theme URI: https://tutorialtube.local
Author: Danny
Description: Curated YouTube tutorial directory. Rendering only — domain logic lives in the tutorialtube-core plugin.
Version: 3.0.4
Requires PHP: 7.4
Text Domain: tutorialtube
*/

/* ═══ Tokens ═══════════════════════════════════════════════════════════════
   Every colour in this file comes from here. Light is the base; dark redefines
   only what changes, so a missing token is impossible rather than merely
   unlikely. Red is deliberately absent — the accent is blue. */
:root {
	--tt-bg: #ffffff;
	--tt-bg-raised: #ffffff;
	--tt-bg-sunken: #f2f2f2;
	--tt-bg-hover: #f2f2f2;
	--tt-border: #e5e5e5;
	--tt-border-input: #cccccc;

	--tt-text: #0f0f0f;
	--tt-text-muted: #606060;
	--tt-text-faint: #909090;

	--tt-accent: #065fd4;
	--tt-accent-hover: #0a53b8;
	--tt-accent-soft: #def1ff;
	--tt-on-accent: #ffffff;

	--tt-chip-bg: #f2f2f2;
	--tt-chip-active-bg: #0f0f0f;
	--tt-chip-active-text: #ffffff;
	--tt-skeleton: #e9e9e9;

	--tt-radius-sm: 8px;
	--tt-radius-md: 12px;
	--tt-radius-pill: 999px;

	--tt-tip-h: 40px;
	--tt-masthead-h: 56px;
	--tt-sidebar-w: 240px;

	--tt-font: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
	--tt-display: "Bricolage Grotesque", "Inter", Georgia, serif;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--tt-bg: #0f0f0f;
		--tt-bg-raised: #0f0f0f;
		--tt-bg-sunken: #272727;
		--tt-bg-hover: #272727;
		--tt-border: #303030;
		--tt-border-input: #303030;
		--tt-text: #f1f1f1;
		--tt-text-muted: #aaaaaa;
		--tt-text-faint: #717171;
		--tt-accent: #3ea6ff;
		--tt-accent-hover: #65b8ff;
		--tt-accent-soft: #263850;
		--tt-on-accent: #0f0f0f;
		--tt-chip-bg: #272727;
		--tt-chip-active-bg: #f1f1f1;
		--tt-chip-active-text: #0f0f0f;
		--tt-skeleton: #272727;
	}
}

:root[data-theme="dark"] {
	--tt-bg: #0f0f0f;
	--tt-bg-raised: #0f0f0f;
	--tt-bg-sunken: #272727;
	--tt-bg-hover: #272727;
	--tt-border: #303030;
	--tt-border-input: #303030;
	--tt-text: #f1f1f1;
	--tt-text-muted: #aaaaaa;
	--tt-text-faint: #717171;
	--tt-accent: #3ea6ff;
	--tt-accent-hover: #65b8ff;
	--tt-accent-soft: #263850;
	--tt-on-accent: #0f0f0f;
	--tt-chip-bg: #272727;
	--tt-chip-active-bg: #f1f1f1;
	--tt-chip-active-text: #0f0f0f;
	--tt-skeleton: #272727;
}

/* ═══ Base ═════════════════════════════════════════════════════════════════ */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	font-family: var(--tt-font);
	font-size: 14px;
	line-height: 1.4;
	color: var(--tt-text);
	background: var(--tt-bg);
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

button { font: inherit; color: inherit; }

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

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* Icon buttons — the 40px round hit area YouTube uses throughout the chrome. */
.tt-icon-btn {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	flex: none;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: none;
	cursor: pointer;
	color: var(--tt-text);
}
.tt-icon-btn:hover { background: var(--tt-bg-hover); }
.tt-icon-btn svg { width: 24px; height: 24px; }

/* ═══ Masthead ═════════════════════════════════════════════════════════════ */
.tt-masthead {
	position: fixed;
	top: var(--tt-tip-h);
	right: 0;
	left: 0;
	z-index: 60;
	display: flex;
	align-items: center;
	gap: 8px;
	height: var(--tt-masthead-h);
	padding: 0 16px;
	background: var(--tt-bg-raised);
	border-bottom: 1px solid transparent;
}
.tt-masthead.is-scrolled { border-bottom-color: var(--tt-border); }

.tt-masthead__start {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: none;
}
/* The slogan belongs to the wordmark, so it sits tight against it rather than
   at the masthead's own item spacing. */
.tt-masthead__start .tt-slogan { margin-left: 0; }

.tt-logo {
	font-family: var(--tt-display);
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 20px;
	font-weight: 700;
	letter-spacing: -0.4px;
	padding: 0 4px;
}
.tt-logo__mark { color: var(--tt-accent); }
.tt-logo__tail { color: var(--tt-text); }

/* The search block is centred in the space left over, capped at 640px — the
   single most recognisable piece of the layout. */
.tt-masthead__center {
	flex: 1 1 auto;
	display: flex;
	justify-content: center;
	min-width: 0;
	padding: 0 16px;
}

.tt-search {
	display: flex;
	width: 100%;
	max-width: 640px;
}
.tt-search__field {
	flex: 1 1 auto;
	min-width: 0;
	height: 40px;
	padding: 0 16px;
	font-size: 16px;
	color: var(--tt-text);
	background: var(--tt-bg);
	border: 1px solid var(--tt-border-input);
	border-right: 0;
	border-radius: var(--tt-radius-pill) 0 0 var(--tt-radius-pill);
}
.tt-search__field::placeholder { color: var(--tt-text-faint); }
.tt-search__field:focus {
	outline: none;
	border-color: var(--tt-accent);
	padding-left: 16px;
}
.tt-search__submit {
	flex: none;
	width: 64px;
	height: 40px;
	display: grid;
	place-items: center;
	border: 1px solid var(--tt-border-input);
	border-radius: 0 var(--tt-radius-pill) var(--tt-radius-pill) 0;
	background: var(--tt-bg-sunken);
	cursor: pointer;
}
.tt-search__submit svg { width: 24px; height: 24px; }

.tt-masthead__end {
	display: flex;
	align-items: center;
	gap: 4px;
	flex: none;
}

.tt-search-toggle { display: none; }

/* ═══ Sidebar ══════════════════════════════════════════════════════════════ */
.tt-sidebar {
	position: fixed;
	top: calc(var(--tt-masthead-h) + var(--tt-tip-h));
	bottom: 0;
	left: 0;
	z-index: 50;
	width: var(--tt-sidebar-w);
	padding: 12px;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--tt-bg);
	scrollbar-width: thin;
}
.tt-sidebar::-webkit-scrollbar { width: 8px; }
.tt-sidebar::-webkit-scrollbar-thumb { background: var(--tt-border); border-radius: 4px; }

.tt-sidebar__group { padding: 12px 0; }
.tt-sidebar__group + .tt-sidebar__group { border-top: 1px solid var(--tt-border); }
.tt-sidebar__heading {
	margin: 0 0 4px;
	padding: 8px 12px 4px;
	font-size: 16px;
	font-weight: 700;
}

.tt-navitem {
	display: flex;
	align-items: center;
	gap: 24px;
	height: 40px;
	padding: 0 12px;
	border-radius: 10px;
	color: var(--tt-text);
}
.tt-navitem:hover { background: var(--tt-bg-hover); }
.tt-navitem.is-active { background: var(--tt-bg-sunken); font-weight: 500; }
.tt-navitem__icon { flex: none; width: 24px; height: 24px; display: grid; place-items: center; }
.tt-navitem__icon svg { width: 24px; height: 24px; }
.tt-navitem__avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.tt-navitem__label {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.tt-navitem__count { flex: none; font-size: 12px; color: var(--tt-text-faint); }

/* Avatar placeholder: first letter on a tinted disc, so an empty channel
   picture never renders as a broken image. */
.tt-avatar-fallback {
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: var(--tt-accent-soft);
	color: var(--tt-accent);
	font-weight: 700;
	text-transform: uppercase;
	flex: none;
}

/* ── Mini rail ─────────────────────────────────────────────────────────────
   Icon over a 10px label, no pill. Groups that carry no icons are hidden
   outright rather than squashed. */
/* ═══ Content column ═══════════════════════════════════════════════════════ */
.tt-content {
	container-type: inline-size;
	container-name: main;
	margin-left: var(--tt-sidebar-w);
	padding-top: calc(var(--tt-masthead-h) + var(--tt-tip-h));
	min-height: 100vh;
}

.tt-page { padding: 24px; }

/* ═══ Chips ════════════════════════════════════════════════════════════════ */
.tt-chips {
	position: sticky;
	top: calc(var(--tt-masthead-h) + var(--tt-tip-h));
	z-index: 40;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 24px;
	background: var(--tt-bg);
}
.tt-chips__track {
	display: flex;
	gap: 12px;
	overflow-x: auto;
	scrollbar-width: none;
	scroll-behavior: smooth;
	/* Fade the cut edge instead of slicing a chip in half. */
	mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 32px), transparent 100%);
}
.tt-chips__track::-webkit-scrollbar { display: none; }
.tt-chips__track.is-start { mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 32px), transparent 100%); }
.tt-chips__track.is-end { mask-image: linear-gradient(to right, transparent 0, #000 32px, #000 100%); }
.tt-chips__track.is-middle { mask-image: linear-gradient(to right, transparent 0, #000 32px, #000 calc(100% - 32px), transparent 100%); }

.tt-chip {
	flex: none;
	display: inline-flex;
	align-items: center;
	height: 32px;
	padding: 0 12px;
	border: 0;
	border-radius: var(--tt-radius-sm);
	background: var(--tt-chip-bg);
	color: var(--tt-text);
	font-size: 14px;
	font-weight: 500;
	white-space: nowrap;
	cursor: pointer;
}
.tt-chip:hover { background: var(--tt-border); }
.tt-chip.is-active {
	background: var(--tt-chip-active-bg);
	color: var(--tt-chip-active-text);
}
.tt-chips__arrow { display: none; }

/* ═══ Video grid ═══════════════════════════════════════════════════════════ */
.tt-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	column-gap: 16px;
	row-gap: 40px;
	padding: 12px 24px 48px;
	margin: 0;
	list-style: none;
}

/* ═══ Video card ═══════════════════════════════════════════════════════════ */
.tt-card { position: relative; display: flex; flex-direction: column; }

.tt-card__thumb {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: var(--tt-radius-md);
	background: var(--tt-skeleton);
	transition: border-radius 150ms ease;
}
.tt-card:hover .tt-card__thumb { border-radius: 0; }
.tt-card__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.tt-card__duration {
	position: absolute;
	right: 4px;
	bottom: 4px;
	padding: 3px 4px;
	border-radius: 4px;
	background: rgba(0, 0, 0, 0.8);
	color: #fff;
	font-size: 12px;
	font-weight: 500;
	line-height: 12px;
	letter-spacing: 0.5px;
}

.tt-card__body {
	display: flex;
	gap: 12px;
	padding-top: 12px;
}
.tt-card__avatar,
.tt-card__body .tt-avatar-fallback {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	object-fit: cover;
	flex: none;
	font-size: 15px;
}
.tt-card__meta { min-width: 0; flex: 1 1 auto; }

.tt-card__title {
	margin: 0;
	font-size: 16px;
	font-weight: 500;
	line-height: 22px;
	color: var(--tt-text);
	/* Two lines, never three — a runaway title breaks the grid rhythm. */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
/* Stretched link: the whole card is clickable, but the channel link inside
   still wins because it is raised above the overlay. */
.tt-card__link::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}
.tt-card__channel,
.tt-card__facts {
	margin: 4px 0 0;
	font-size: 12px;
	line-height: 18px;
	color: var(--tt-text-muted);
}
.tt-card__channel { position: relative; z-index: 2; display: inline-block; }
.tt-card__channel:hover { color: var(--tt-text); }

.tt-card__badge {
	display: inline-block;
	margin-top: 6px;
	padding: 2px 8px;
	border-radius: var(--tt-radius-pill);
	background: var(--tt-accent-soft);
	color: var(--tt-accent);
	font-size: 11px;
	font-weight: 500;
}

/* ═══ Empty state ══════════════════════════════════════════════════════════ */
.tt-empty {
	padding: 64px 24px;
	text-align: center;
	color: var(--tt-text-muted);
}
.tt-empty h2 { margin: 0 0 8px; font-size: 20px; color: var(--tt-text); }
.tt-empty p { margin: 0 auto; max-width: 42ch; }

/* ═══ Buttons ══════════════════════════════════════════════════════════════ */
.tt-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 36px;
	padding: 0 16px;
	border: 0;
	border-radius: var(--tt-radius-pill);
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	background: var(--tt-bg-sunken);
	color: var(--tt-text);
}
.tt-btn--primary { background: var(--tt-accent); color: var(--tt-on-accent); }
.tt-btn--primary:hover { background: var(--tt-accent-hover); }

/* ═══ Footer ═══════════════════════════════════════════════════════════════ */
.tt-footer {
	padding: 24px;
	color: var(--tt-text-faint);
	font-size: 12px;
}

/* ═══ Responsive ═══════════════════════════════════════════════════════════
   1312px and 792px are YouTube's own breakpoints for the rail and the drawer. */
@media (max-width: 792px) {
	/* No toggle, so no drawer: below this width the sidebar steps out of the
	   way entirely. Every subject is still one tap away on the home page,
	   which is itself the subject picker. */
	.tt-sidebar { display: none; }
	.tt-content { margin-left: 0; }

	.tt-grid { grid-template-columns: 1fr; padding: 12px 16px 48px; row-gap: 24px; }
	.tt-card__thumb { border-radius: 0; margin: 0 -16px; }
	.tt-card__body { padding: 12px 0 0; }
	.tt-page { padding: 16px; }
}

@media (max-width: 656px) {
	/* Search collapses to an icon that expands into its own full-width row. */
	.tt-masthead__center {
		display: none;
		position: absolute;
		inset: 0;
		padding: 8px 12px;
		background: var(--tt-bg-raised);
		align-items: center;
	}
	body.tt-search-open .tt-masthead__center { display: flex; }
	body.tt-search-open .tt-masthead__start,
	body.tt-search-open .tt-masthead__end { visibility: hidden; }
	.tt-search-toggle { display: grid; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
	.tt-card:hover .tt-card__thumb { border-radius: var(--tt-radius-md); }
}

/* ═══ Topic identity ═══════════════════════════════════════════════════════
   Each topic carries its own colour via --tt-topic, set inline per element.
   The icon sits on a tint of that colour rather than the flat colour, so seven
   of them together read as a palette instead of a paint chart. */
.tt-topicon {
	display: grid;
	place-items: center;
	flex: none;
	border-radius: 50%;
	background: color-mix(in srgb, var(--tt-topic) 14%, transparent);
	color: var(--tt-topic);
}
.tt-topicon svg { width: 58%; height: 58%; }
/* In the sidebar there is no room for a disc — just the coloured glyph. */
.tt-topicon--flat { background: none; border-radius: 0; }
.tt-topicon--flat svg { width: 24px; height: 24px; }

/* ═══ Front page: pick a topic ═════════════════════════════════════════════ */
.tt-hero { max-width: 720px; margin: 24px 0 32px; }
.tt-hero__title { margin: 0 0 8px; font-size: 32px; font-weight: 700; letter-spacing: -0.5px; }
.tt-hero__sub { margin: 0; font-size: 16px; color: var(--tt-text-muted); }

.tt-topics {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 16px;
	margin: 0;
	padding: 0 0 48px;
	list-style: none;
}
.tt-topic-card {
	display: block;
	height: 100%;
	padding: 24px;
	border: 1px solid var(--tt-border);
	border-radius: var(--tt-radius-md);
	background: var(--tt-bg);
	transition: border-color 150ms ease, transform 150ms ease;
}
.tt-topic-card:hover {
	border-color: var(--tt-topic);
	transform: translateY(-2px);
}
.tt-topic-card__name { margin: 16px 0 4px; font-size: 18px; font-weight: 500; }
.tt-topic-card__count { margin: 0; font-size: 13px; color: var(--tt-text-muted); }
.tt-topic-card__desc {
	margin: 8px 0 0;
	font-size: 13px;
	color: var(--tt-text-muted);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ═══ Topic page header ════════════════════════════════════════════════════ */
.tt-page--tight { padding-bottom: 0; }
.tt-topichead { display: flex; align-items: center; gap: 20px; margin: 20px 0 8px; }
.tt-topichead__title {
	font-family: var(--tt-display);
	font-variation-settings: "opsz" 72;
	margin: 0;
	/* The subject is the loudest thing on its own page. */
	font-size: clamp(34px, 5.4cqw, 78px);
	font-weight: 700;
	line-height: 0.95;
	letter-spacing: -0.035em;
}
.tt-topichead__count { margin: 8px 0 0; font-size: 15px; color: var(--tt-text-muted); }
.tt-topichead__desc { margin: 10px 0 0; max-width: 64ch; font-size: 15px; color: var(--tt-text-muted); }

/* Coloured dot on a chip, so the chips row echoes the topic palette. */
.tt-chip__dot {
	width: 8px;
	height: 8px;
	margin-right: 8px;
	border-radius: 50%;
	background: var(--tt-topic, var(--tt-accent));
	flex: none;
}
.tt-chip.is-active .tt-chip__dot { background: var(--tt-chip-active-text); }

/* ═══ Watch page ═══════════════════════════════════════════════════════════ */
.tt-watch {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 402px;
	gap: 24px;
	padding: 24px;
	max-width: 1754px;
}
.tt-watch__main { min-width: 0; }

.tt-player {
	aspect-ratio: 16 / 9;
	border-radius: var(--tt-radius-md);
	overflow: hidden;
	background: #000;
}
.tt-player iframe { width: 100%; height: 100%; border: 0; display: block; }

.tt-watch__title {
	font-family: var(--tt-display);
	margin: 16px 0 0;
	font-size: 20px;
	font-weight: 700;
	line-height: 28px;
}

.tt-watch__bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin: 12px 0 16px;
}
.tt-watch__channel { display: flex; align-items: center; gap: 12px; }
.tt-watch__avatar,
.tt-watch__channel .tt-avatar-fallback { width: 40px; height: 40px; border-radius: 50%; flex: none; font-size: 17px; }
.tt-watch__channel strong { display: block; font-size: 15px; font-weight: 500; }
.tt-watch__channel small { display: block; font-size: 12px; color: var(--tt-text-muted); }
.tt-btn svg { width: 18px; height: 18px; }

/* The curator's note — the one thing here that a YouTube search cannot give
   you, so it is tinted and sits above the description, not below it. */
.tt-note {
	margin: 0 0 16px;
	padding: 14px 16px;
	border-left: 3px solid var(--tt-accent);
	border-radius: 0 var(--tt-radius-md) var(--tt-radius-md) 0;
	background: var(--tt-accent-soft);
}
.tt-note__label {
	margin: 0 0 4px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--tt-accent);
}
.tt-note p { margin: 0; font-size: 14px; line-height: 20px; color: var(--tt-text); }

.tt-desc {
	padding: 12px;
	border-radius: var(--tt-radius-md);
	background: var(--tt-bg-sunken);
	font-size: 14px;
	line-height: 20px;
}
.tt-desc__facts { margin: 0; font-weight: 500; }
.tt-desc__pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.tt-pill {
	display: inline-flex;
	align-items: center;
	padding: 3px 10px;
	border-radius: var(--tt-radius-pill);
	background: var(--tt-bg);
	color: var(--tt-text-muted);
	font-size: 12px;
	font-weight: 500;
}
.tt-pill--level { background: var(--tt-accent-soft); color: var(--tt-accent); }
.tt-pill--topic {
	background: color-mix(in srgb, var(--tt-topic) 16%, transparent);
	color: var(--tt-topic);
}
.tt-desc__body { margin: 12px 0 0; }
.tt-desc__body p { margin: 0 0 8px; }
.tt-desc__body.is-clamped {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.tt-desc__more {
	margin: 8px 0 0;
	padding: 0;
	border: 0;
	background: none;
	font-weight: 500;
	cursor: pointer;
}

/* ═══ Compact list — related + search ══════════════════════════════════════ */
.tt-side__heading { margin: 0 0 12px; font-size: 16px; font-weight: 700; }
.tt-sidelist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tt-sidelist--results { padding: 0 24px 48px; max-width: 900px; }
.tt-compact__link { display: flex; gap: 8px; border-radius: var(--tt-radius-sm); }
.tt-compact__link:hover { background: var(--tt-bg-hover); }
.tt-compact__thumb {
	position: relative;
	flex: none;
	width: 168px;
	aspect-ratio: 16 / 9;
	border-radius: var(--tt-radius-sm);
	overflow: hidden;
	background: var(--tt-skeleton);
}
.tt-compact__thumb img { width: 100%; height: 100%; object-fit: cover; }
.tt-compact__meta { min-width: 0; padding: 2px 4px 0 0; }
.tt-compact__title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: 14px;
	font-weight: 500;
	line-height: 20px;
}
.tt-compact__channel,
.tt-compact__facts { display: block; margin-top: 4px; font-size: 12px; color: var(--tt-text-muted); }

/* ═══ Channel page ═════════════════════════════════════════════════════════ */
.tt-chanhead {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 24px;
	margin: 8px 0 0;
}
.tt-chanhead__avatar,
.tt-chanhead .tt-avatar-fallback { width: 80px; height: 80px; border-radius: 50%; flex: none; font-size: 32px; }
.tt-chanhead__meta { flex: 1 1 260px; min-width: 0; }
.tt-chanhead__name { font-family: var(--tt-display); margin: 0; font-size: 24px; font-weight: 700; }
.tt-chanhead__facts { margin: 4px 0 0; font-size: 13px; color: var(--tt-text-muted); }
.tt-chanhead__about { margin: 8px 0 0; font-size: 14px; color: var(--tt-text-muted); max-width: 64ch; }
.tt-chanhead__cta { flex: none; }

.tt-results__title { margin: 8px 0 16px; font-size: 20px; font-weight: 700; }

/* ═══ Pagination ═══════════════════════════════════════════════════════════ */
.pagination { padding: 0 24px 48px; display: flex; gap: 8px; }
.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	height: 36px;
	padding: 0 14px;
	border-radius: var(--tt-radius-pill);
	background: var(--tt-bg-sunken);
	font-size: 14px;
	font-weight: 500;
}
.pagination .page-numbers.current { background: var(--tt-accent); color: var(--tt-on-accent); }

@media (max-width: 1000px) {
	.tt-watch { grid-template-columns: 1fr; }
}
@media (max-width: 792px) {
	.tt-watch { padding: 0 0 24px; gap: 16px; }
	.tt-player { border-radius: 0; }
	.tt-watch__title, .tt-watch__bar, .tt-note, .tt-desc { margin-left: 16px; margin-right: 16px; }
	.tt-watch__side { padding: 0 16px; }
	.tt-hero__title { font-size: 26px; }
	.tt-topics { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
	.tt-topic-card { padding: 16px; }
	.tt-sidelist--results { padding: 0 16px 48px; }
	.tt-compact__thumb { width: 140px; }
}

/* ═══ Pro tip bar ══════════════════════════════════════════════════════════
   Permanent, above the masthead. Everything fixed offsets by --tt-tip-h. */
.tt-tip {
	position: fixed;
	inset: 0 0 auto 0;
	z-index: 70;
	display: flex;
	align-items: center;
	gap: 12px;
	height: var(--tt-tip-h);
	padding: 0 16px;
	background: var(--tt-accent);
	color: var(--tt-on-accent);
	font-size: 13px;
}
.tt-tip__text {
	flex: 1 1 auto;
	margin: 0;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.tt-tip__text strong {
	margin-right: 8px;
	padding: 2px 7px;
	border-radius: var(--tt-radius-sm);
	background: color-mix(in srgb, var(--tt-on-accent) 22%, transparent);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
}
.tt-tip code {
	padding: 1px 5px;
	border-radius: 4px;
	background: color-mix(in srgb, var(--tt-on-accent) 16%, transparent);
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 12px;
}

/* ═══ Topic card previews ══════════════════════════════════════════════════ */
.tt-topic-card { display: flex; flex-direction: column; gap: 12px; }
.tt-topic-card__head { display: flex; align-items: center; gap: 12px; }
.tt-topic-card__name { margin: 0; font-size: 17px; font-weight: 500; }
.tt-topic-card__count { display: block; margin: 2px 0 0; font-size: 12px; color: var(--tt-text-muted); }

/* The preview pane: a still first frame that steps through the subject's
   videos while hovered — the same promise YouTube's hover preview makes. */
.tt-vpreview {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	border-radius: var(--tt-radius-sm);
	overflow: hidden;
	background: var(--tt-skeleton);
}
.tt-vpreview--empty {
	display: grid;
	place-items: center;
	background: color-mix(in srgb, var(--tt-topic) 6%, transparent);
	border: 1px dashed color-mix(in srgb, var(--tt-topic) 24%, transparent);
}
.tt-vpreview__ghost { background: none !important; opacity: 0.35; }
.tt-vpreview__frame {
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity 260ms ease;
}
.tt-vpreview__frame.is-on { opacity: 1; }
.tt-vpreview__frame img { width: 100%; height: 100%; object-fit: cover; }

/* Play glyph, the way a thumbnail says "this is a video". */
.tt-vpreview__play {
	position: absolute;
	inset: 50% auto auto 50%;
	translate: -50% -50%;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	opacity: 0;
	transition: opacity 180ms ease, scale 180ms ease;
	scale: 0.9;
}
.tt-vpreview__play svg { width: 20px; height: 20px; margin-left: 2px; }
.tt-topic-card:hover .tt-vpreview__play,
.tt-topic-card:focus-visible .tt-vpreview__play { opacity: 1; scale: 1; }
.tt-vpreview.is-playing .tt-vpreview__play { opacity: 0; }

.tt-vpreview__dur {
	position: absolute;
	right: 6px;
	bottom: 8px;
	padding: 2px 4px;
	border-radius: 4px;
	background: rgba(0, 0, 0, 0.8);
	color: #fff;
	font-size: 11px;
	font-weight: 500;
	line-height: 12px;
}

/* Segmented scrub line — one segment per video, filling as the reel advances. */
.tt-vpreview__bars {
	position: absolute;
	inset: auto 0 0 0;
	display: flex;
	gap: 2px;
	padding: 0 4px 4px;
	opacity: 0;
	transition: opacity 180ms ease;
}
.tt-vpreview.is-playing .tt-vpreview__bars,
.tt-topic-card:hover .tt-vpreview__bars { opacity: 1; }
.tt-vpreview__bar {
	flex: 1;
	height: 3px;
	border-radius: 2px;
	background: rgba(255, 255, 255, 0.35);
	transition: background 220ms ease;
}
.tt-vpreview__bar.is-on { background: #fff; }

.tt-preview__titles {
	display: block;
	font-size: 12px;
	line-height: 17px;
	color: var(--tt-text-muted);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.tt-preview__titles em { font-style: normal; color: var(--tt-text-faint); }
.tt-preview__none {
	display: block;
	padding: 14px 0;
	font-size: 12px;
	color: var(--tt-text-faint);
}
.tt-topic-card.is-empty { opacity: 0.72; }
.tt-topic-card.is-empty:hover { opacity: 1; }

@media (max-width: 792px) {
	:root { --tt-tip-h: 56px; }
	.tt-tip { align-items: flex-start; padding: 8px 12px; }
	.tt-tip__text { white-space: normal; font-size: 12px; line-height: 16px; max-height: 32px; }
}

/* ═══ Playlist collection ══════════════════════════════════════════════════ */
.tt-playlists {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(540px, 1fr));
	column-gap: 28px;
	row-gap: 40px;
	margin: 0;
	padding: 12px 24px 48px;
	list-style: none;
}
.tt-section {
	font-family: var(--tt-display);
	margin: 32px 24px 4px;
	font-size: clamp(18px, 1.9cqw, 26px);
	font-weight: 700;
	letter-spacing: -0.02em;
}

.tt-plcard { display: flex; flex-direction: column; gap: 12px; }

/* Two offset slivers behind the thumbnail — the visual shorthand for "a set,
   not a single video". */
.tt-plcard__stack { position: relative; display: block; padding-top: 8px; }
.tt-plcard__stack::before,
.tt-plcard__stack::after {
	content: "";
	position: absolute;
	top: 0;
	left: 8px;
	right: 8px;
	height: 8px;
	border-radius: var(--tt-radius-sm) var(--tt-radius-sm) 0 0;
	background: color-mix(in srgb, var(--tt-topic) 34%, var(--tt-bg));
}
.tt-plcard__stack::after {
	top: 4px;
	left: 4px;
	right: 4px;
	background: color-mix(in srgb, var(--tt-topic) 62%, var(--tt-bg));
}
.tt-plcard__stack .tt-vpreview { position: relative; z-index: 1; }

.tt-plcard__badge {
	position: absolute;
	right: 0;
	top: 0;
	bottom: 0;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	width: 78px;
	background: rgba(0, 0, 0, 0.72);
	color: #fff;
	font-size: 13px;
	font-weight: 500;
}
.tt-plcard__badge svg { width: 20px; height: 20px; }

.tt-plcard__title {
	margin: 0;
	font-size: 17px;
	font-weight: 500;
	line-height: 23px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.tt-plcard__facts { display: block; margin-top: 4px; font-size: 12px; color: var(--tt-text-muted); }
.tt-plcard.is-empty .tt-vpreview--empty svg { width: 40%; height: 40%; color: var(--tt-topic); opacity: 0.4; }
.tt-plcard.is-empty { opacity: 0.75; }

/* ═══ Playlist page ════════════════════════════════════════════════════════ */
.tt-plpage {
	display: grid;
	grid-template-columns: 360px minmax(0, 1fr);
	gap: 24px;
	padding: 24px;
	align-items: start;
}
.tt-plhero {
	position: sticky;
	top: calc(var(--tt-masthead-h) + var(--tt-tip-h) + 24px);
	padding: 20px;
	border-radius: var(--tt-radius-md);
	background: linear-gradient(160deg, color-mix(in srgb, var(--tt-topic) 22%, var(--tt-bg)), var(--tt-bg-sunken));
}
.tt-plhero__shot { display: block; border-radius: var(--tt-radius-sm); overflow: hidden; }
.tt-plhero__shot img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.tt-plhero__title { font-family: var(--tt-display); margin: 16px 0 4px; font-size: 22px; font-weight: 700; line-height: 28px; }
.tt-plhero__facts { margin: 0; font-size: 13px; color: var(--tt-text-muted); }
.tt-plhero__topics { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; }
.tt-plhero__about { margin: 12px 0 0; font-size: 13px; line-height: 19px; color: var(--tt-text-muted); }
.tt-plhero__cta { margin-top: 16px; }
.tt-plhero__cta svg { width: 16px; height: 16px; }

/* ═══ Queue ════════════════════════════════════════════════════════════════ */
.tt-queue { list-style: none; margin: 0; padding: 0; counter-reset: q; }
.tt-queue__link {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 6px 8px;
	border-radius: var(--tt-radius-sm);
}
.tt-queue__link:hover { background: var(--tt-bg-hover); }
.tt-queue__item.is-current .tt-queue__link { background: var(--tt-bg-sunken); }
.tt-queue__n {
	flex: none;
	width: 24px;
	text-align: center;
	font-size: 12px;
	color: var(--tt-text-faint);
}
.tt-queue__item.is-current .tt-queue__n { color: var(--tt-accent); }
.tt-queue__thumb {
	position: relative;
	flex: none;
	width: 160px;
	aspect-ratio: 16 / 9;
	border-radius: 6px;
	overflow: hidden;
	background: var(--tt-skeleton);
}
.tt-queue__thumb img { width: 100%; height: 100%; object-fit: cover; }
.tt-queue__meta { min-width: 0; }
.tt-queue__title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: 14px;
	font-weight: 500;
	line-height: 19px;
}
.tt-queue__channel { display: block; margin-top: 2px; font-size: 12px; color: var(--tt-text-muted); }

/* The same queue, docked beside the player. */
.tt-queuebox {
	margin: 0 0 20px;
	border: 1px solid var(--tt-border);
	border-radius: var(--tt-radius-md);
	overflow: hidden;
}
.tt-queuebox__head { padding: 12px 14px; background: var(--tt-bg-sunken); }
.tt-queuebox__title { font-size: 15px; font-weight: 700; }
.tt-queuebox__pos { margin: 2px 0 0; font-size: 12px; color: var(--tt-text-muted); }
.tt-queue--compact { max-height: 420px; overflow-y: auto; padding: 6px; }
.tt-queue--compact .tt-queue__thumb { width: 100px; }
.tt-queue--compact .tt-queue__title { font-size: 13px; line-height: 17px; }

@media (max-width: 1000px) {
	.tt-plpage { grid-template-columns: 1fr; }
	.tt-plhero { position: static; }
}
@media (max-width: 792px) {
	.tt-playlists { grid-template-columns: 1fr; padding: 12px 16px 48px; }
	.tt-plpage { padding: 16px; }
	.tt-queue__thumb { width: 120px; }
}

/* ═══ Sub-subjects ═════════════════════════════════════════════════════════
   The second decision, offered as a dense pill field rather than more cards:
   twenty-four areas as cards would bury the playlists underneath them. */
.tt-subs { padding: 4px 24px 8px; }
.tt-subs__heading {
	font-family: var(--tt-display);
	margin: 28px 0 14px;
	font-size: clamp(18px, 1.9cqw, 26px);
	font-weight: 700;
	letter-spacing: -0.02em;
}
.tt-subs__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.tt-sub {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 34px;
	padding: 0 14px;
	border: 1px solid var(--tt-border);
	border-radius: var(--tt-radius-pill);
	font-size: 13px;
	font-weight: 500;
	background: var(--tt-bg);
	transition: border-color 120ms ease, background 120ms ease;
}
.tt-sub:hover {
	border-color: var(--tt-topic);
	background: color-mix(in srgb, var(--tt-topic) 8%, transparent);
}
.tt-sub__n {
	min-width: 20px;
	padding: 1px 6px;
	border-radius: var(--tt-radius-pill);
	background: color-mix(in srgb, var(--tt-topic) 16%, transparent);
	color: var(--tt-topic);
	font-size: 11px;
	font-weight: 700;
	text-align: center;
}
/* An area with nothing in it stays visible — it says what the site intends to
   cover — but never competes with one that has something to watch. */
.tt-sub.is-bare { color: var(--tt-text-faint); border-style: dashed; }
.tt-sub.is-bare:hover { background: none; border-color: var(--tt-border-input); }

.tt-crumb { margin: 0 0 8px; font-size: 14px; }
.tt-crumb a { display: inline-flex; align-items: center; gap: 4px; color: var(--tt-text-muted); }
.tt-crumb a:hover { color: var(--tt-text); }
.tt-crumb svg { width: 16px; height: 16px; }

/* Sidebar branch, open only for the subject you are inside. */
.tt-subnav { margin: 2px 0 8px; padding: 0 0 0 12px; border-left: 2px solid var(--tt-border); }
.tt-subnav__item {
	display: flex;
	align-items: center;
	gap: 8px;
	height: 32px;
	padding: 0 10px;
	border-radius: 8px;
	font-size: 13px;
	color: var(--tt-text-muted);
}
.tt-subnav__item:hover { background: var(--tt-bg-hover); color: var(--tt-text); }
.tt-subnav__item.is-active { background: var(--tt-bg-sunken); color: var(--tt-text); font-weight: 500; }
.tt-subnav__label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 792px) { .tt-subs { padding: 4px 16px 8px; } }

/* Sub-subject glyphs — tinted with the parent subject's colour. */
.tt-sub__icon { display: grid; place-items: center; width: 16px; height: 16px; flex: none; color: var(--tt-topic); }
.tt-sub__icon svg { width: 16px; height: 16px; }
.tt-sub.is-bare .tt-sub__icon { color: var(--tt-text-faint); }
.tt-subnav__icon { display: grid; place-items: center; width: 16px; height: 16px; flex: none; opacity: 0.75; }
.tt-subnav__icon svg { width: 16px; height: 16px; }
.tt-subnav__item.is-active .tt-subnav__icon { opacity: 1; }

/* The selected area — filled in the subject's colour so the chooser reads as a
   filter you are inside, not a list you left behind. */
.tt-sub.is-on {
	background: var(--tt-topic);
	border-color: var(--tt-topic);
	color: #fff;
}
.tt-sub.is-on .tt-sub__icon { color: #fff; }
.tt-sub.is-on .tt-sub__n { background: rgba(255, 255, 255, 0.24); color: #fff; }
.tt-sub.is-on:hover { background: var(--tt-topic); }

/* ═══ Front page — editorial ═══════════════════════════════════════════════
   Big type carries the argument. The scale is fluid rather than stepped, so it
   fills a 27" display and still reads on a phone without a pile of overrides. */
.tt-page--home { padding: 0 40px 80px; max-width: 1680px; }

/* The headline owns the first screen: nothing else competes with it, and the
   argument begins only once you have read the claim. */
.tt-hero2 {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	min-height: calc(100vh - var(--tt-masthead-h) - var(--tt-tip-h));
	padding: 40px 0 56px;
	border-bottom: 1px solid var(--tt-border);
}

.tt-hero2__kicker {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 0;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--tt-accent);
}
.tt-hero2__kicker span {
	display: block;
	width: 56px;
	height: 2px;
	background: var(--tt-accent);
}

.tt-hero2__title {
	margin: 0;
	font-family: var(--tt-display);
	font-variation-settings: "opsz" 96;
	/* Sized against the content column, not the window — the sidebar takes
	   240px and a vw-based size overflows into a fourth line. The height bound
	   keeps three lines inside the fold on a short window. Longest line is
	   "YouTube is not" at roughly 7.3em, so ~13cqw fills the measure exactly. */
	font-size: min(11.6cqw, 21vh);
	font-weight: 700;
	line-height: 0.88;
	letter-spacing: -0.05em;
}
@supports not (font-size: 1cqw) {
	.tt-hero2__title { font-size: min(9.3vw, 21vh); }
}
.tt-hero2__line { display: block; white-space: nowrap; }
/* The turn of the sentence, marked rather than shouted. */
.tt-hero2__title em {
	font-style: normal;
	color: var(--tt-accent);
	position: relative;
}
.tt-hero2__title em::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0.1em;
	height: 0.055em;
	background: currentColor;
	opacity: 0.28;
}

.tt-hero2__foot {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 48px;
	align-items: end;
	margin-top: 0;
}
.tt-hero2__lede {
	margin: 0;
	max-width: 46ch;
	font-size: clamp(15px, 1.25vw, 20px);
	line-height: 1.55;
	color: var(--tt-text-muted);
}

.tt-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin: 0; }
.tt-stats dt {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--tt-text-faint);
}
.tt-stats dd {
	font-family: var(--tt-display);
	margin: 6px 0 0;
	font-size: clamp(28px, 3vw, 46px);
	font-weight: 700;
	line-height: 1;
	letter-spacing: -0.03em;
	font-variant-numeric: tabular-nums;
}

/* ── Comparison ─────────────────────────────────────────────────────────── */
.tt-vs {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0;
	padding: 64px 0;
	border-bottom: 1px solid var(--tt-border);
}
.tt-vs__col { padding: 0 48px; }
.tt-vs__col:first-child { padding-left: 0; border-right: 1px solid var(--tt-border); }
.tt-vs__col:last-child { padding-right: 0; }
.tt-vs__col h2 {
	font-family: var(--tt-display);
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 24px;
	font-size: clamp(17px, 1.6vw, 23px);
	font-weight: 700;
	letter-spacing: -0.02em;
}
.tt-vs__mark {
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	font-size: 15px;
	flex: none;
}
.tt-vs__col--bad .tt-vs__mark { background: color-mix(in srgb, #ef4444 16%, transparent); color: #ef4444; }
.tt-vs__col--good .tt-vs__mark { background: var(--tt-accent-soft); color: var(--tt-accent); }
.tt-vs__col ul { margin: 0; padding: 0; list-style: none; }
.tt-vs__col li {
	padding: 14px 0;
	border-top: 1px solid var(--tt-border);
	font-size: clamp(14px, 1.15vw, 17px);
	line-height: 1.45;
	color: var(--tt-text-muted);
}
.tt-vs__col li:first-child { border-top: 0; padding-top: 0; }

/* ── Section display type, shared ───────────────────────────────────────── */
.tt-display {
	margin: 0;
	font-family: var(--tt-display);
	font-variation-settings: "opsz" 72;
	font-size: clamp(30px, 5vw, 82px);
	font-weight: 700;
	line-height: 0.96;
	letter-spacing: -0.04em;
}
.tt-display em { font-style: normal; color: var(--tt-text-faint); }

/* ── The evidence, as a numbered index ──────────────────────────────────── */
.tt-science { padding: 80px 0 0; }
.tt-science__head {
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
	gap: 48px;
	align-items: end;
	margin-bottom: 56px;
}
.tt-science__lede { margin: 0; max-width: 44ch; font-size: 16px; line-height: 1.55; color: var(--tt-text-muted); }

.tt-sci-list { margin: 0; padding: 0; list-style: none; }
.tt-sci {
	display: grid;
	grid-template-columns: 120px minmax(0, 1.35fr) minmax(0, 1fr);
	gap: 40px;
	align-items: start;
	padding: 40px 0;
	border-top: 1px solid var(--tt-border);
}
.tt-sci:last-child { border-bottom: 1px solid var(--tt-border); }
.tt-sci__num {
	font-family: var(--tt-display);
	font-size: clamp(34px, 4.4vw, 66px);
	font-weight: 700;
	line-height: 0.85;
	letter-spacing: -0.05em;
	color: transparent;
	-webkit-text-stroke: 1.5px var(--tt-border-input);
	font-variant-numeric: tabular-nums;
	transition: -webkit-text-stroke-color 300ms ease, color 300ms ease;
}
.tt-sci:hover .tt-sci__num { -webkit-text-stroke-color: var(--tt-accent); }
.tt-sci h3 {
	font-family: var(--tt-display);
	margin: 0 0 14px;
	font-size: clamp(19px, 1.9vw, 27px);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.02em;
}
.tt-sci p { margin: 0 0 10px; font-size: 15px; line-height: 1.6; color: var(--tt-text-muted); }
.tt-sci strong { color: var(--tt-text); font-weight: 600; }
.tt-sci__cite { font-size: 12.5px !important; color: var(--tt-text-faint) !important; }
.tt-sci__do {
	margin: 0 !important;
	padding: 20px 22px;
	border-radius: var(--tt-radius-md);
	background: var(--tt-bg-sunken);
	color: var(--tt-text) !important;
	font-size: 15px !important;
	line-height: 1.5 !important;
}
.tt-sci__do span {
	display: block;
	margin-bottom: 6px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--tt-accent);
}
.tt-science__note {
	margin: 40px 0 0;
	max-width: 78ch;
	font-size: 15px;
	line-height: 1.6;
	color: var(--tt-text-muted);
}
.tt-science__note strong { color: var(--tt-text); }
.tt-science__note span { color: var(--tt-text-faint); }

/* ── Then the choice ────────────────────────────────────────────────────── */
.tt-pick { padding: 96px 0 32px; }
.tt-pick__sub { margin: 20px 0 0; font-size: 16px; color: var(--tt-text-muted); }

.tt-topics { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 0 0 40px; }

/* ── Reveal on scroll ───────────────────────────────────────────────────── */
[data-reveal] { opacity: 0; transform: translateY(22px); }
[data-reveal].is-in {
	opacity: 1;
	transform: none;
	transition: opacity 700ms cubic-bezier(.16,1,.3,1), transform 700ms cubic-bezier(.16,1,.3,1);
}
/* The headline lands line by line. */
.tt-hero2 .tt-hero2__line { opacity: 0; transform: translateY(0.14em); }
.tt-hero2.is-in .tt-hero2__line {
	opacity: 1;
	transform: none;
	transition: opacity 800ms cubic-bezier(.16,1,.3,1) calc(var(--i) * 90ms),
	            transform 800ms cubic-bezier(.16,1,.3,1) calc(var(--i) * 90ms);
}

@media (max-width: 1200px) {
	.tt-sci { grid-template-columns: 84px minmax(0, 1fr); }
	.tt-sci__do { grid-column: 2; }
}
@media (max-width: 900px) {
	.tt-page--home { padding: 0 20px 64px; }
	.tt-hero2 { padding: 56px 0 44px; }
	.tt-hero2__foot { grid-template-columns: 1fr; gap: 36px; margin-top: 40px; }
	.tt-stats { grid-template-columns: repeat(2, 1fr); gap: 20px 16px; }
	.tt-science__head { grid-template-columns: 1fr; gap: 20px; margin-bottom: 36px; }
	.tt-vs { grid-template-columns: 1fr; gap: 40px; padding: 48px 0; }
	.tt-vs__col { padding: 0 !important; border-right: 0 !important; }
	.tt-science { padding-top: 56px; }
	.tt-pick { padding: 64px 0 24px; }
	.tt-topics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}
@media (max-width: 620px) {
	.tt-sci { grid-template-columns: 1fr; gap: 18px; padding: 32px 0; }
	.tt-sci__do { grid-column: 1; }
	.tt-topics { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
	[data-reveal],
	.tt-hero2 .tt-hero2__line { opacity: 1 !important; transform: none !important; }
}

/* Down-cue: a hairline that travels, not an arrow that bounces. */
.tt-hero2__cue {
	position: absolute;
	right: 0;
	bottom: 56px;
	display: block;
	width: 1px;
	height: 56px;
	overflow: hidden;
	background: var(--tt-border);
}
.tt-hero2__cue span {
	position: absolute;
	inset: 0 0 auto 0;
	height: 40%;
	background: var(--tt-accent);
	animation: tt-cue 2.2s cubic-bezier(.6,0,.4,1) infinite;
}
@keyframes tt-cue {
	0%   { transform: translateY(-100%); }
	60%  { transform: translateY(250%); }
	100% { transform: translateY(250%); }
}

@media (max-width: 900px) {
	.tt-hero2 { min-height: calc(100svh - var(--tt-masthead-h) - var(--tt-tip-h)); padding: 28px 0 40px; }
	.tt-hero2__title { font-size: min(11.6cqw, 16vh); }
	.tt-hero2__cue { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	.tt-hero2__cue span { animation: none; top: 30%; }
}

/* ═══ Playlist row — watch-page sidebar ════════════════════════════════════ */
.tt-plrow__link { display: flex; gap: 12px; padding: 8px; border-radius: var(--tt-radius-sm); }
.tt-plrow__link:hover { background: var(--tt-bg-hover); }
/* Same offset-sliver trick as the big card, at row scale. */
.tt-plrow__stack { position: relative; flex: none; padding-top: 5px; }
.tt-plrow__stack::before,
.tt-plrow__stack::after {
	content: "";
	position: absolute;
	top: 0;
	left: 6px;
	right: 6px;
	height: 5px;
	border-radius: 4px 4px 0 0;
	background: color-mix(in srgb, var(--tt-topic) 34%, var(--tt-bg));
}
.tt-plrow__stack::after {
	top: 2.5px;
	left: 3px;
	right: 3px;
	background: color-mix(in srgb, var(--tt-topic) 62%, var(--tt-bg));
}
.tt-plrow__thumb {
	position: relative;
	display: block;
	width: 152px;
	aspect-ratio: 16 / 9;
	border-radius: 6px;
	overflow: hidden;
	background: var(--tt-skeleton);
}
.tt-plrow__thumb img { width: 100%; height: 100%; object-fit: cover; }
.tt-plrow__badge {
	position: absolute;
	right: 0;
	top: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	width: 46px;
	background: rgba(0, 0, 0, 0.72);
	color: #fff;
	font-size: 11px;
	font-weight: 500;
}
.tt-plrow__badge svg { width: 15px; height: 15px; }
.tt-plrow__meta { min-width: 0; padding-top: 6px; }
.tt-plrow__title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: 14px;
	font-weight: 500;
	line-height: 19px;
}
.tt-plrow__facts { display: block; margin-top: 4px; font-size: 12px; color: var(--tt-text-muted); }

/* Playlist card: author and area, the way a video card carries them. */
.tt-plcard__body { display: flex; gap: 12px; }
.tt-plcard__avatar,
.tt-plcard__body > .tt-avatar-fallback {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
	flex: none;
	font-size: 15px;
}
.tt-plcard__meta { min-width: 0; flex: 1 1 auto; }
.tt-plcard__channel,
.tt-plcard__facts { display: block; margin-top: 5px; font-size: 13px; color: var(--tt-text-muted); }
.tt-plcard__channel { color: var(--tt-text-muted); }
.tt-plcard__topic {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 10px;
	padding: 4px 11px 4px 8px;
	border-radius: var(--tt-radius-pill);
	background: color-mix(in srgb, var(--tt-topic) 14%, transparent);
	color: var(--tt-topic);
	font-size: 12px;
	font-weight: 500;
}
.tt-plcard__topic svg { width: 14px; height: 14px; }

/* ═══ Playlist contents, beside the preview ════════════════════════════════ */
.tt-plcard__top {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
	gap: 18px;
	align-items: start;
}
.tt-plcard__contents {
	display: flex;
	flex-direction: column;
	min-width: 0;
	padding-top: 8px;
}
.tt-toc { margin: 0; padding: 0; list-style: none; }
.tt-toc__item {
	display: grid;
	/* Episode numbers reach three digits on long courses. */
	grid-template-columns: minmax(18px, auto) minmax(0, 1fr) auto;
	gap: 8px;
	align-items: baseline;
	padding: 4px 0;
	font-size: 13.5px;
	line-height: 19px;
}
.tt-toc__n { color: var(--tt-text-faint); font-variant-numeric: tabular-nums; text-align: right; padding-right: 2px; }
.tt-toc__title {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--tt-text-muted);
}
.tt-plcard:hover .tt-toc__title { color: var(--tt-text); }
.tt-toc__dur {
	color: var(--tt-text-faint);
	font-size: 12.5px;
	font-variant-numeric: tabular-nums;
}
.tt-toc__more {
	margin-top: 8px;
	padding-left: 22px;
	font-size: 12.5px;
	font-weight: 500;
	color: var(--tt-topic);
}

@media (max-width: 900px) {
	.tt-playlists { grid-template-columns: 1fr; }
	.tt-plcard__top { grid-template-columns: 1fr; }
	.tt-plcard__contents { padding-top: 0; }
}

/* Search: the episodes that matched, and why. */
.tt-toc__label {
	display: block;
	margin-bottom: 6px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--tt-topic);
}
.tt-toc__item.is-match { align-items: center; }
.tt-toc__item.is-match .tt-toc__title { color: var(--tt-text); }
.tt-toc__item.is-match .tt-toc__title:hover { text-decoration: underline; }
.tt-toc__item.is-match .tt-toc__n {
	color: var(--tt-topic);
	font-weight: 700;
}
.tt-toc mark {
	padding: 0 2px;
	border-radius: 3px;
	background: color-mix(in srgb, var(--tt-topic) 24%, transparent);
	color: inherit;
	font-weight: 600;
}
.tt-results__sub { margin: 6px 0 0; color: var(--tt-text-muted); }
.tt-playlists--results { padding-top: 20px; }

/* ── Search results: one per row ────────────────────────────────────────────
   Two columns squeezed the matched episodes into a narrow gutter, so titles
   truncated and the playlist's own name ended up buried beneath its excerpt.
   One row per result. The card template drops its __top wrapper here and emits
   stack, body, contents as three direct children, so this is a plain grid —
   no display:contents, which fragmented the anchor instead of dissolving. */
.tt-playlists--results {
	grid-template-columns: 1fr;
	row-gap: 0;
}
.tt-playlists--results .tt-plitem {
	padding: 22px 0;
	border-top: 1px solid var(--tt-border);
}
.tt-playlists--results .tt-plitem:first-child { border-top: 0; padding-top: 4px; }

.tt-plcard--row {
	display: grid;
	grid-template-columns: 260px minmax(0, 1fr);
	column-gap: 20px;
	row-gap: 12px;
	align-items: start;
}
.tt-plcard--row .tt-plcard__stacklink { grid-column: 1; grid-row: 1 / span 2; display: block; }
.tt-plcard--row .tt-plcard__title a { color: inherit; text-decoration: none; }
.tt-plcard--row .tt-plcard__title a:hover { text-decoration: underline; }
.tt-plcard--row .tt-plcard__body  { grid-column: 2; grid-row: 1; }
.tt-plcard--row .tt-plcard__contents {
	grid-column: 2;
	grid-row: 2;
	padding-top: 12px;
	border-top: 1px solid var(--tt-border);
}
.tt-plcard--row .tt-plcard__title {
	-webkit-line-clamp: 2;
	font-size: 18px;
	line-height: 24px;
}
.tt-plcard--row .tt-toc__title { white-space: nowrap; }
.tt-plcard--row .tt-toc__item { font-size: 13px; padding: 3px 0; }
.tt-plcard--row .tt-plcard__snippet { margin-top: 8px; }

@media (max-width: 860px) {
	.tt-plcard--row { grid-template-columns: 1fr; }
	.tt-plcard--row .tt-plcard__stacklink { grid-column: 1; grid-row: 1; }
	.tt-plcard--row .tt-plcard__body  { grid-column: 1; grid-row: 2; }
	.tt-plcard--row .tt-plcard__contents { grid-column: 1; grid-row: 3; }
}

/* ═══ Favourites ═══════════════════════════════════════════════════════════ */
.tt-fav {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	border: 0;
	background: none;
	color: inherit;
	cursor: pointer;
	padding: 0;
}
.tt-fav svg { width: 20px; height: 20px; }
/* Outline by default, solid once saved — one glyph swapped for the other. */
.tt-fav svg:last-of-type { display: none; }
.tt-fav.is-on svg:first-of-type { display: none; }
.tt-fav.is-on svg:last-of-type { display: block; color: var(--tt-accent); }

/* On a card: a disc floating over the thumbnail, revealed on hover. */
.tt-fav--corner {
	position: absolute;
	top: 8px;
	left: 8px;
	z-index: 3;
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	opacity: 0;
	transition: opacity 140ms ease, background 140ms ease;
}
.tt-plcard:hover .tt-fav--corner,
.tt-fav--corner.is-on,
.tt-fav--corner:focus-visible { opacity: 1; }
.tt-fav--corner:hover { background: rgba(0, 0, 0, 0.8); }
.tt-fav--corner.is-on { background: #fff; }
.tt-fav--corner.is-on svg:last-of-type { color: var(--tt-accent); }
.tt-fav--corner .tt-fav__text { display: none; }

/* On a page: a proper button beside the primary action. */
.tt-fav--button {
	height: 36px;
	padding: 0 16px;
	border-radius: var(--tt-radius-pill);
	background: var(--tt-bg-sunken);
	font-size: 14px;
	font-weight: 500;
}
.tt-fav--button:hover { background: var(--tt-border); }
.tt-fav--button.is-on { background: var(--tt-accent-soft); color: var(--tt-accent); }

.tt-plhero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.tt-plhero__actions .tt-btn svg { width: 16px; height: 16px; }

/* ── The Saved page ─────────────────────────────────────────────────────── */
.tt-saved { margin-bottom: 40px; }
.tt-section--flush { margin-left: 0; margin-right: 0; }
.tt-saved__n {
	display: inline-block;
	margin-left: 8px;
	padding: 2px 9px;
	border-radius: var(--tt-radius-pill);
	background: var(--tt-bg-sunken);
	color: var(--tt-text-muted);
	font-size: 13px;
	font-weight: 600;
	vertical-align: middle;
}
.tt-saved__empty { margin: 8px 0 0; color: var(--tt-text-muted); font-size: 14px; }
.tt-savedlist {
	list-style: none;
	margin: 12px 0 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
	gap: 8px 20px;
}
.tt-favcard { display: flex; align-items: center; gap: 10px; }
.tt-favcard__link {
	display: flex;
	gap: 12px;
	flex: 1 1 auto;
	min-width: 0;
	padding: 8px;
	border-radius: var(--tt-radius-sm);
}
.tt-favcard__link:hover { background: var(--tt-bg-hover); }
.tt-favcard__thumb {
	position: relative;
	flex: none;
	width: 140px;
	aspect-ratio: 16 / 9;
	border-radius: 6px;
	overflow: hidden;
	background: var(--tt-skeleton);
}
.tt-favcard__thumb img { width: 100%; height: 100%; object-fit: cover; }
.tt-favcard__n {
	position: absolute;
	right: 0;
	top: 0;
	bottom: 0;
	display: grid;
	place-items: center;
	width: 40px;
	background: rgba(0, 0, 0, 0.72);
	color: #fff;
	font-size: 12px;
	font-weight: 500;
}
.tt-favcard__meta { min-width: 0; padding-top: 2px; }
.tt-favcard__title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: 14px;
	font-weight: 500;
	line-height: 19px;
}
.tt-favcard__sub,
.tt-favcard__facts { display: block; margin-top: 3px; font-size: 12px; color: var(--tt-text-muted); }
.tt-favcard__remove {
	flex: none;
	border: 0;
	background: none;
	color: var(--tt-text-faint);
	font-size: 12px;
	cursor: pointer;
	text-decoration: underline;
}
.tt-favcard__remove:hover { color: #ef4444; }


/* ═══ Progress ═════════════════════════════════════════════════════════════ */
.tt-bar {
	display: block;
	height: 4px;
	margin-top: 10px;
	border-radius: 999px;
	background: var(--tt-bg-sunken);
	overflow: hidden;
}
.tt-bar__fill {
	display: block;
	height: 100%;
	width: 0;
	border-radius: 999px;
	background: var(--tt-topic, var(--tt-accent));
	transition: width 260ms ease;
}
.tt-progress-label {
	display: block;
	margin-top: 5px;
	font-size: 12px;
	font-weight: 500;
	color: var(--tt-topic, var(--tt-accent));
}
.tt-progress-label.is-done { color: var(--tt-text-muted); }

.tt-plhero .tt-bar { margin-top: 14px; }
.tt-plhero .tt-progress-label { margin-bottom: 6px; }

/* The watched toggle, matching the Save button beside it. */
.tt-watched {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	height: 36px;
	padding: 0 16px;
	border: 0;
	border-radius: var(--tt-radius-pill);
	background: var(--tt-bg-sunken);
	color: inherit;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
}
.tt-watched svg { width: 18px; height: 18px; }
.tt-watched:hover { background: var(--tt-border); }
.tt-watched.is-on { background: #e6f4ea; color: #1b5e20; }
:root[data-theme="dark"] .tt-watched.is-on { background: #14351f; color: #7ee2a8; }

/* A watched episode recedes rather than disappears — you can still rewatch it. */
.tt-queue__item.is-watched .tt-queue__title,
.tt-queue__item.is-watched .tt-queue__channel { color: var(--tt-text-faint); }
.tt-queue__item.is-watched .tt-queue__thumb { opacity: 0.55; }
.tt-queue__item.is-watched .tt-queue__n {
	position: relative;
	color: transparent;
}
.tt-queue__item.is-watched .tt-queue__n::after {
	content: "\2713";
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	color: #2e7d32;
	font-weight: 700;
}
:root[data-theme="dark"] .tt-queue__item.is-watched .tt-queue__n::after { color: #7ee2a8; }
.tt-queue__item.is-watched.is-current .tt-queue__n::after { content: none; }

.tt-watch__actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* The slogan sits beside the wordmark, separated by a hairline rather than
   punctuation, and steps aside before it can crowd the search field. */
.tt-slogan {
	display: none;
	align-items: center;
	margin-left: 8px;
	padding-left: 8px;
	border-left: 1px solid var(--tt-border);
	font-size: 12.5px;
	line-height: 1.2;
	color: var(--tt-text-muted);
	white-space: nowrap;
}
@media (min-width: 1100px) { .tt-slogan { display: flex; } }


/* Why a playlist matched, when its title does not say so. */
.tt-plcard__snippet {
	display: block;
	margin-top: 8px;
	padding-left: 10px;
	border-left: 2px solid color-mix(in srgb, var(--tt-topic) 40%, transparent);
	font-size: 12.5px;
	line-height: 17px;
	color: var(--tt-text-muted);
}
.tt-plcard__snippet mark {
	padding: 0 2px;
	border-radius: 3px;
	background: color-mix(in srgb, var(--tt-topic) 24%, transparent);
	color: inherit;
	font-weight: 600;
}

/* YouTube's view count, labelled so it is never mistaken for this site's. */
.tt-watch__views { margin: 6px 0 0; font-size: 13px; color: var(--tt-text-muted); }


/* ═══ 404 ══════════════════════════════════════════════════════════════════
   Distinct from an empty collection on purpose: a big code, an explicit
   sentence, and two ways out. */
.tt-404 { padding: 64px 0 8px; max-width: 60ch; }
.tt-404__code {
	margin: 0;
	font-family: var(--tt-display), var(--tt-font), sans-serif;
	font-size: 88px;
	line-height: 1;
	font-weight: 800;
	letter-spacing: -0.04em;
	color: var(--tt-accent);
}
.tt-404__title {
	margin: 10px 0 0;
	font-family: var(--tt-display), var(--tt-font), sans-serif;
	font-size: 34px;
	line-height: 1.15;
	letter-spacing: -0.02em;
}
.tt-404__lede { margin: 14px 0 0; color: var(--tt-text-muted); line-height: 1.6; }
.tt-404__lede code {
	padding: 2px 6px;
	border-radius: 5px;
	background: var(--tt-surface-2, rgba(127, 127, 127, 0.14));
	font-size: 0.92em;
	word-break: break-all;
}
.tt-404__search { display: flex; gap: 10px; margin: 26px 0 0; }
.tt-404__search input[type="search"] {
	flex: 1 1 auto;
	min-width: 0;
	padding: 12px 16px;
	border: 1px solid var(--tt-border);
	border-radius: 999px;
	background: var(--tt-surface);
	color: var(--tt-text);
	font: inherit;
}
.tt-404__search input[type="search"]:focus {
	outline: none;
	border-color: var(--tt-accent);
}
.tt-404__search button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 20px;
	border: 0;
	border-radius: 999px;
	background: var(--tt-accent);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}
.tt-404__search button svg { width: 18px; height: 18px; }

.tt-404__or {
	margin: 48px 0 16px;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--tt-text-muted);
}
.tt-404__topics {
	list-style: none;
	margin: 0 0 64px;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 10px;
}
.tt-404__topic {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	border: 1px solid var(--tt-border);
	border-radius: 12px;
	color: inherit;
	text-decoration: none;
}
.tt-404__topic:hover { border-color: var(--tt-topic); background: color-mix(in srgb, var(--tt-topic) 8%, transparent); }
.tt-404__topic-name { flex: 1 1 auto; font-weight: 600; }
.tt-404__topic-n { color: var(--tt-text-muted); font-size: 13px; font-variant-numeric: tabular-nums; }

@media (max-width: 600px) {
	.tt-404 { padding-top: 36px; }
	.tt-404__code { font-size: 62px; }
	.tt-404__title { font-size: 26px; }
	.tt-404__search { flex-direction: column; }
	.tt-404__search button { justify-content: center; }
}
