:root {
	--bg: #0b0e14;
	--bg-soft: #121724;
	--surface: #171d2c;
	--surface-2: #1e2537;
	--border: #2a3349;
	--ink: #eef1f8;
	--ink-soft: #a8b1c7;
	--ink-muted: #6c7591;
	--accent: #5b8def;
	--accent-soft: rgba(91, 141, 239, 0.14);
	--green: #34d399;
	--green-soft: rgba(52, 211, 153, 0.12);
	--amber: #fbbf24;
	--amber-soft: rgba(251, 191, 36, 0.12);
	--blue: #60a5fa;
	--blue-soft: rgba(96, 165, 250, 0.12);
	--mono: 'JetBrains Mono', ui-monospace, monospace;
	font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	height: 100%;
	background: var(--bg);
	color: var(--ink);
	overflow: hidden;
}

/* Language toggle: hide the inactive language */
html[data-lang='pt'] [data-lang='en'] {
	display: none !important;
}

html[data-lang='en'] [data-lang='pt'] {
	display: none !important;
}

/* ---------- Topbar ---------- */

.topbar {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 30;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.85rem 1.5rem;
	pointer-events: none;
}

.topbar > * {
	pointer-events: auto;
}

.wordmark {
	font-weight: 700;
	font-size: 0.9375rem;
	letter-spacing: -0.01em;
	color: var(--ink-soft);
}

.topbar-right {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.lang-toggle {
	display: inline-flex;
	border: 1px solid var(--border);
	border-radius: 999px;
	overflow: hidden;
	background: var(--bg-soft);
}

.lang-toggle button {
	appearance: none;
	border: none;
	background: transparent;
	color: var(--ink-muted);
	font: inherit;
	font-size: 0.75rem;
	font-weight: 600;
	padding: 0.3rem 0.75rem;
	cursor: pointer;
}

.lang-toggle button.active {
	background: var(--accent);
	color: #fff;
}

.counter {
	font-family: var(--mono);
	font-size: 0.75rem;
	color: var(--ink-muted);
}

/* ---------- Deck & slides ---------- */

.deck {
	position: fixed;
	inset: 0;
}

.slide {
	position: absolute;
	inset: 0;
	padding: 5.5rem clamp(1.25rem, 5vw, 4rem) 4rem;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	overflow-y: auto;
	opacity: 0;
	visibility: hidden;
	transform: translateY(14px);
	transition:
		opacity 0.35s ease,
		transform 0.35s ease,
		visibility 0.35s;
}

.slide.active {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	z-index: 10;
}

.slide > * {
	width: 100%;
	max-width: 980px;
}

.slide-wide > * {
	max-width: 1120px;
}

/* ---------- Typography ---------- */

.kicker {
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--accent);
	margin: 0 0 0.75rem;
}

h1 {
	font-size: clamp(2.5rem, 6vw, 4.25rem);
	font-weight: 800;
	letter-spacing: -0.03em;
	margin: 0 0 1rem;
	line-height: 1.05;
}

h2 {
	font-size: clamp(1.5rem, 3.4vw, 2.35rem);
	font-weight: 700;
	letter-spacing: -0.02em;
	margin: 0 0 1.25rem;
	line-height: 1.15;
}

h3 {
	font-size: 1rem;
	font-weight: 600;
	margin: 0 0 0.5rem;
}

p {
	margin: 0;
}

code {
	font-family: var(--mono);
	font-size: 0.85em;
	background: var(--accent-soft);
	color: var(--blue);
	padding: 0.1em 0.4em;
	border-radius: 6px;
}

em {
	color: var(--ink);
}

.lead {
	font-size: clamp(1rem, 1.7vw, 1.2rem);
	color: var(--ink-soft);
	line-height: 1.6;
	margin-bottom: 1.75rem;
	/* keep the left edge aligned with headings (flex centers narrower blocks) */
	padding-right: clamp(0rem, 10vw, 9rem);
}

.lead strong {
	color: var(--ink);
}

.lead.centered {
	max-width: 56rem;
	padding-right: 0;
	margin-left: auto;
	margin-right: auto;
	text-align: center;
}

.takeaway {
	margin-top: 1.75rem;
	padding: 0.85rem 1.1rem;
	border-left: 3px solid var(--accent);
	background: var(--accent-soft);
	border-radius: 0 10px 10px 0;
	font-size: 0.9375rem;
	color: var(--ink-soft);
	line-height: 1.55;
}

.hint {
	margin-top: 3rem;
	font-size: 0.8125rem;
	color: var(--ink-muted);
}

/* ---------- Cover ---------- */

.slide-cover {
	text-align: center;
}

.slide-cover .kicker {
	margin-bottom: 1.25rem;
}

.tagline {
	font-size: clamp(1.15rem, 2.4vw, 1.6rem);
	font-weight: 500;
	color: var(--ink-soft);
	margin-bottom: 1.5rem;
}

.tagline.small {
	font-size: 1rem;
	margin-top: 2.5rem;
	color: var(--ink-muted);
}

.cover-sub {
	font-size: 1rem;
	color: var(--ink-muted);
	max-width: 34rem;
	margin: 0 auto;
	line-height: 1.6;
}

.closing-title {
	text-align: center;
}

.closing-points {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 1rem;
	max-width: 46rem;
	margin: 1.5rem auto 0;
	text-align: left;
}

.closing-point {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 14px;
	padding: 1.1rem 1.25rem;
}

.closing-point strong {
	display: block;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--accent);
	margin-bottom: 0.5rem;
}

.closing-point p {
	font-size: 0.9rem;
	color: var(--ink-soft);
	line-height: 1.55;
}

.thanks-emoji {
	font-size: 3rem;
	margin-bottom: 1.25rem;
}

.thanks-title {
	margin-bottom: 1.25rem;
}

.wordmark-footer {
	margin-top: 3.5rem;
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ink-muted);
}

/* ---------- Cards & grids ---------- */

.cards-3 {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 1rem;
}

.card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 14px;
	padding: 1.25rem 1.35rem;
}

.card-emoji {
	font-size: 1.6rem;
	margin-bottom: 0.6rem;
}

.card p {
	font-size: 0.9rem;
	color: var(--ink-soft);
	line-height: 1.55;
}

.type-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 0.85rem;
}

.type-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: 1rem 1.15rem;
}

.type-head {
	font-weight: 600;
	margin-bottom: 0.5rem;
	font-size: 0.95rem;
}

.type-card p {
	font-size: 0.85rem;
	color: var(--ink-soft);
	line-height: 1.5;
}

/* ---------- Flow (3 steps) ---------- */

.flow-3 {
	display: flex;
	align-items: stretch;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.flow-step {
	flex: 1 1 220px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 14px;
	padding: 1.15rem 1.25rem;
}

.flow-num {
	width: 1.75rem;
	height: 1.75rem;
	border-radius: 50%;
	background: var(--accent);
	color: #fff;
	font-weight: 700;
	font-size: 0.85rem;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 0.75rem;
}

.flow-step p {
	font-size: 0.875rem;
	color: var(--ink-soft);
	line-height: 1.55;
}

.flow-arrow {
	align-self: center;
	color: var(--ink-muted);
	font-size: 1.5rem;
	flex: 0 0 auto;
}

/* ---------- Split (2 columns) ---------- */

.split {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 1rem;
}

.split-col {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 14px;
	padding: 1.25rem 1.4rem;
}

.split-col h3 {
	margin-bottom: 0.85rem;
}

.split-col ul {
	margin: 0;
	padding-left: 1.1rem;
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
}

.split-col li,
.split-col p {
	font-size: 0.9rem;
	color: var(--ink-soft);
	line-height: 1.55;
}

.split-col li strong {
	color: var(--ink);
}

.split-col p + p {
	margin-top: 0.75rem;
}

.model-fast {
	border-color: rgba(52, 211, 153, 0.35);
}

.model-strong {
	border-color: rgba(91, 141, 239, 0.45);
}

ul.compact {
	margin: 1.25rem 0 0;
	padding-left: 1.1rem;
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
}

ul.compact li {
	font-size: 0.9rem;
	color: var(--ink-soft);
	line-height: 1.55;
}

/* ---------- Flow diagrams (hand-rolled, deck-themed) ---------- */

.flowviz {
	display: flex;
	align-items: stretch;
	justify-content: center;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.flowviz + .flowviz {
	margin-top: 0.75rem;
}

.fv-node {
	flex: 1 1 130px;
	max-width: 240px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.3rem;
	text-align: center;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 14px;
	padding: 0.9rem 0.8rem;
}

.fv-icon {
	font-size: 1.35rem;
	line-height: 1;
}

.fv-title {
	font-weight: 600;
	font-size: 0.875rem;
}

.fv-sub {
	font-size: 0.72rem;
	color: var(--ink-muted);
	line-height: 1.45;
}

.fv-arrow {
	align-self: center;
	color: var(--accent);
	font-size: 1.25rem;
	flex: 0 0 auto;
}

.fv-arrow.fv-dashed {
	color: var(--ink-muted);
}

.fv-stack {
	flex: 1 1 170px;
	max-width: 240px;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.fv-stack .fv-node {
	flex: 1;
	max-width: none;
}

.fv-wide {
	flex: 2 1 260px;
	max-width: 360px;
}

.fv-green {
	border-color: rgba(52, 211, 153, 0.45);
	background: var(--green-soft);
}

.fv-blue {
	border-color: rgba(96, 165, 250, 0.45);
	background: var(--blue-soft);
}

.fv-accent {
	border-color: rgba(91, 141, 239, 0.55);
	background: var(--accent-soft);
}

.fv-ghost {
	border-style: dashed;
	background: transparent;
}

/* Hybrid search branches */

.router-branches {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 0.75rem;
	margin-top: 0.75rem;
}

.branch {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 0.9rem;
	border-radius: 14px;
	border: 1px solid var(--border);
	padding: 0.85rem 1.1rem;
}

.branch-fast {
	border-color: rgba(52, 211, 153, 0.4);
	background: var(--green-soft);
}

.branch-deep {
	border-color: rgba(96, 165, 250, 0.4);
	background: var(--blue-soft);
}

.branch-label {
	flex: 0 0 100%;
	font-size: 0.6875rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--ink-muted);
}

.branch-flow {
	font-family: var(--mono);
	font-size: 0.8rem;
	color: var(--ink-soft);
}

.bf-sep {
	margin: 0 0.4em;
	color: var(--ink-muted);
}

.branch-latency {
	margin-left: auto;
	font-family: var(--mono);
	font-size: 0.75rem;
	font-weight: 600;
	padding: 0.15rem 0.55rem;
	border-radius: 999px;
	border: 1px solid var(--border);
	background: var(--bg-soft);
}

.branch-fast .branch-latency {
	color: var(--green);
}

.branch-deep .branch-latency {
	color: var(--blue);
}

/* Architecture groups */

.arch {
	display: flex;
	align-items: stretch;
	justify-content: center;
	gap: 0.6rem;
	flex-wrap: wrap;
}

.arch-group {
	flex: 1 1 220px;
	background: var(--bg-soft);
	border: 1px solid var(--border);
	border-radius: 16px;
	padding: 0.9rem;
}

.arch-label {
	font-size: 0.6875rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--accent);
	text-align: center;
	margin-bottom: 0.65rem;
}

.arch-chips {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.arch-chip {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 0.55rem 0.75rem;
}

.ac-name {
	font-weight: 600;
	font-size: 0.8125rem;
}

.ac-sub {
	font-size: 0.7rem;
	color: var(--ink-muted);
	margin-top: 0.15rem;
}

.legend {
	margin-top: 1.1rem;
}

.legend p {
	font-size: 0.875rem;
	color: var(--ink-soft);
	line-height: 1.6;
}

.legend strong {
	color: var(--ink);
}

/* ---------- Redaction demo ---------- */

.redact-demo {
	display: flex;
	align-items: stretch;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.redact-before,
.redact-after {
	flex: 1 1 300px;
	border-radius: 14px;
	padding: 1.1rem 1.25rem;
	font-size: 0.9375rem;
	line-height: 1.7;
}

.redact-before {
	background: var(--surface);
	border: 1px solid var(--border);
}

.redact-after {
	background: var(--green-soft);
	border: 1px solid rgba(52, 211, 153, 0.35);
}

.redact-arrow {
	align-self: center;
	color: var(--ink-muted);
	font-size: 1.5rem;
}

.redact-label {
	font-size: 0.6875rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--ink-muted);
	margin-bottom: 0.6rem;
}

.redact-before mark {
	background: var(--ink);
	color: var(--ink);
	border-radius: 4px;
	padding: 0 0.3em;
}

/* ---------- Triage lanes ---------- */

.lanes {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 1rem;
}

.lane {
	border-radius: 14px;
	padding: 1.2rem 1.3rem;
	border: 1px solid var(--border);
	background: var(--surface);
}

.lane-range {
	font-family: var(--mono);
	font-size: 0.8125rem;
	font-weight: 600;
	margin-bottom: 0.6rem;
}

.lane p {
	font-size: 0.875rem;
	color: var(--ink-soft);
	line-height: 1.55;
}

.lane-green {
	border-color: rgba(52, 211, 153, 0.4);
	background: var(--green-soft);
}

.lane-green .lane-range {
	color: var(--green);
}

.lane-amber {
	border-color: rgba(251, 191, 36, 0.4);
	background: var(--amber-soft);
}

.lane-amber .lane-range {
	color: var(--amber);
}

.lane-blue {
	border-color: rgba(96, 165, 250, 0.4);
	background: var(--blue-soft);
}

.lane-blue .lane-range {
	color: var(--blue);
}

/* ---------- Embedding map ---------- */

.embed-map {
	position: relative;
	height: clamp(220px, 32vh, 320px);
	background:
		radial-gradient(circle at 26% 42%, rgba(91, 141, 239, 0.12), transparent 34%),
		radial-gradient(circle at 78% 40%, rgba(52, 211, 153, 0.1), transparent 30%),
		var(--bg-soft);
	border: 1px solid var(--border);
	border-radius: 14px;
	background-image:
		linear-gradient(var(--border) 1px, transparent 1px),
		linear-gradient(90deg, var(--border) 1px, transparent 1px);
	background-size: 48px 48px;
	overflow: hidden;
}

.dot {
	position: absolute;
	transform: translate(-50%, -50%);
	font-size: 0.78rem;
	white-space: nowrap;
	padding: 0.35rem 0.7rem 0.35rem 1.4rem;
	border-radius: 999px;
	border: 1px solid;
}

.dot::before {
	content: '';
	position: absolute;
	left: 0.55rem;
	top: 50%;
	transform: translateY(-50%);
	width: 0.5rem;
	height: 0.5rem;
	border-radius: 50%;
	background: currentColor;
}

.dot-a {
	color: var(--blue);
	border-color: rgba(96, 165, 250, 0.5);
	background: rgba(96, 165, 250, 0.12);
}

.dot-b {
	color: var(--green);
	border-color: rgba(52, 211, 153, 0.5);
	background: rgba(52, 211, 153, 0.1);
}

.dot-c {
	color: var(--amber);
	border-color: rgba(251, 191, 36, 0.5);
	background: rgba(251, 191, 36, 0.1);
}

.dot span {
	color: var(--ink-soft);
}

/* ---------- Recency ---------- */

.formula {
	font-family: var(--mono);
	font-size: clamp(0.9rem, 1.8vw, 1.15rem);
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: 0.9rem 1.2rem;
	text-align: center;
	margin-bottom: 1.25rem;
	color: var(--blue);
}

.halflife-table {
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
}

.hl-row {
	display: grid;
	grid-template-columns: minmax(150px, 240px) 1fr 70px;
	align-items: center;
	gap: 0.9rem;
	font-size: 0.875rem;
}

.hl-type {
	color: var(--ink-soft);
}

.hl-bar {
	height: 0.6rem;
	background: var(--bg-soft);
	border: 1px solid var(--border);
	border-radius: 999px;
	overflow: hidden;
}

.hl-fill {
	height: 100%;
	background: linear-gradient(90deg, var(--accent), var(--blue));
	border-radius: 999px;
}

.hl-days {
	font-family: var(--mono);
	font-size: 0.78rem;
	color: var(--ink-muted);
	text-align: right;
}

/* ---------- Progress & nav ---------- */

.progress {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: var(--bg-soft);
	z-index: 30;
}

.progress-fill {
	height: 100%;
	width: 0;
	background: var(--accent);
	transition: width 0.3s ease;
}

.nav-btn {
	position: fixed;
	bottom: 1.25rem;
	z-index: 30;
	width: 2.6rem;
	height: 2.6rem;
	border-radius: 50%;
	border: 1px solid var(--border);
	background: var(--surface);
	color: var(--ink-soft);
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s ease;
}

.nav-btn:hover {
	background: var(--surface-2);
	color: var(--ink);
}

.nav-prev {
	right: 4.5rem;
}

.nav-next {
	right: 1.25rem;
}

/* ---------- Small screens ---------- */

@media (max-width: 640px) {
	.slide {
		justify-content: flex-start;
		padding-top: 4.5rem;
	}

	.flow-arrow,
	.redact-arrow {
		display: none;
	}

	.hl-row {
		grid-template-columns: 1fr 60px;
	}

	.hl-bar {
		display: none;
	}
}
