/*
 * BOT — shared Pillar Delta design system (theme tokens + components).
 * Kept in sync with research/pd.css — edit both or extract to one source.
 */
:root {
	--bg:             #000000;
	--text:           #F5F5F7;
	--text-secondary: #86868B;
	--surface:        #0B0B0D;
	--surface-raised: #1D1D1F;
	--border:         #1D1D1F;
	--border-strong:  #333336;
	--accent:         #2997FF;
	--good:           #30D158;
	--bad:            #FF453A;

	--font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

	--space-1: 8px;
	--space-2: 16px;
	--space-3: 24px;
	--space-4: 32px;
	--space-6: 48px;
	--space-8: 64px;
	--space-12: 96px;
	--space-15: 120px;

	--radius-card: 18px;
	--radius-pill: 999px;

	--ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
	background: var(--bg);
	color: var(--text);
	font-family: var(--font-sans);
	font-size: 17px;
	line-height: 26px;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	min-height: 100vh;
	overflow-x: hidden;
}

::selection { background: var(--accent); color: #fff; }

.glow {
	position: absolute;
	top: -120px;
	left: 50%;
	transform: translateX(-50%);
	width: 800px;
	max-width: 100vw;
	height: 400px;
	background: rgba(29, 29, 31, 0.55);
	border-radius: 50%;
	filter: blur(120px);
	pointer-events: none;
	z-index: -2;
}

.container {
	max-width: 1104px;
	margin: 0 auto;
	padding-left: var(--space-3);
	padding-right: var(--space-3);
}

/* ---------- Navigation ---------- */
nav.pd-nav {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 50;
	background: rgba(0, 0, 0, 0.6);
	-webkit-backdrop-filter: blur(20px);
	backdrop-filter: blur(20px);
	border-bottom: 1px solid transparent;
	transition: border-color 0.5s ease, background-color 0.5s ease;
}
nav.pd-nav.scrolled {
	background: rgba(0, 0, 0, 0.75);
	border-bottom-color: var(--border);
}
.nav-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-2);
	min-height: 72px;
}
.nav-logo {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: var(--space-1) 0;
}
.nav-logo img { height: 16px; width: auto; display: block; }

/* ---------- Buttons ---------- */
.btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 12px 28px;
	border: none;
	border-radius: var(--radius-pill);
	font-family: var(--font-sans);
	font-size: 16px;
	line-height: 21px;
	font-weight: 600;
	text-decoration: none;
	text-align: center;
	cursor: pointer;
	overflow: hidden;
	transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.3s var(--ease-out), box-shadow 0.3s ease;
}
.btn:hover { transform: translateY(-1px) scale(1.02); }
.btn:active { transform: scale(0.97); }

.btn-primary {
	background: var(--text);
	color: #000;
	box-shadow: 0 0 30px rgba(255, 255, 255, 0.05);
}
.btn-primary:hover { background: #fff; box-shadow: 0 0 44px rgba(255, 255, 255, 0.14); }
.btn-primary::after {
	content: "";
	position: absolute;
	top: 0; bottom: 0;
	left: -80%;
	width: 50%;
	background: linear-gradient(105deg, transparent, rgba(0, 0, 0, 0.07), transparent);
	transform: skewX(-20deg);
	transition: left 0.7s var(--ease-out);
}
.btn-primary:hover::after { left: 130%; }

.btn-secondary {
	background: var(--surface-raised);
	color: var(--text);
	border: 1px solid var(--border-strong);
}
.btn-secondary:hover { background: #2D2D2F; border-color: #444448; }

.btn-nav {
	min-height: 44px;
	padding: 10px 24px;
	font-size: 15px;
	line-height: 20px;
}
.btn-sm {
	min-height: 44px;
	padding: 10px 20px;
	font-size: 15px;
	line-height: 20px;
}

a:focus-visible, .btn:focus-visible, button:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 3px;
	border-radius: 4px;
}
.btn:focus-visible { border-radius: var(--radius-pill); }

/* ---------- Segmented control ---------- */
.seg {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px;
	background: var(--surface);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-pill);
}
.seg button {
	min-height: 40px;
	padding: 8px 20px;
	border: none;
	border-radius: var(--radius-pill);
	background: transparent;
	color: var(--text-secondary);
	font-family: var(--font-sans);
	font-size: 15px;
	line-height: 20px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.3s ease, color 0.3s ease;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--text); color: #000; }

/* ---------- Type ---------- */
.eyebrow {
	font-family: var(--font-mono);
	font-size: 13px;
	line-height: 18px;
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--text-secondary);
	margin-bottom: var(--space-3);
}

.hero { padding-top: 136px; padding-bottom: var(--space-12); }
.hero h1 {
	font-size: clamp(40px, 6vw, 64px);
	line-height: 1.05;
	font-weight: 700;
	letter-spacing: -0.025em;
	max-width: 880px;
	margin-bottom: var(--space-4);
}
.hero h1 .muted { color: var(--text-secondary); }
.hero h1 .w {
	display: inline-block;
	overflow: hidden;
	vertical-align: bottom;
	padding-bottom: 0.12em;
	margin-bottom: -0.12em;
}
.hero h1 .wi {
	display: inline-block;
	transform: translateY(115%);
	transition: transform 0.9s var(--ease-out);
}
.hero h1.play .wi { transform: translateY(0); }
.hero .lede {
	font-size: 21px;
	line-height: 32px;
	font-weight: 500;
	color: var(--text-secondary);
	max-width: 720px;
	margin-bottom: var(--space-6);
}
.hero .lede:last-child { margin-bottom: 0; }
.hero-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-2);
}

section { padding-bottom: var(--space-15); }
.section-title {
	font-size: 28px;
	line-height: 34px;
	font-weight: 700;
	letter-spacing: -0.015em;
	margin-bottom: var(--space-6);
}

/* ---------- Cards ---------- */
.card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-card);
	padding: var(--space-4);
	transition: border-color 0.4s ease;
}
.card:hover { border-color: var(--border-strong); }
.card h3 {
	font-size: 22px;
	line-height: 28px;
	font-weight: 600;
	letter-spacing: -0.01em;
	margin-bottom: var(--space-2);
}
.card p {
	font-size: 17px;
	line-height: 26px;
	color: var(--text-secondary);
}
.card .eyebrow { margin-bottom: var(--space-2); }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); }

/* ---------- Cursor spotlight ---------- */
.card-fx { position: relative; overflow: hidden; }
.card-fx::before {
	content: "";
	position: absolute;
	inset: 0;
	opacity: 0;
	background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.06), transparent 65%);
	transition: opacity 0.45s ease;
	pointer-events: none;
}
.card-fx:hover::before { opacity: 1; }
.card-fx > * { position: relative; }

/* ---------- Viewer (visualization frame) ---------- */
.viewer {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-card);
	overflow: hidden;
}
.viewer-canvas-wrap { position: relative; background: #000; }
.viewer-canvas-wrap canvas { display: block; width: 100%; }
.viewer-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-2);
	padding: var(--space-2) var(--space-3);
	border-top: 1px solid var(--border);
}

/* ---------- HUD / stats ---------- */
.hud {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-1) var(--space-4);
	font-family: var(--font-mono);
	font-size: 13px;
	line-height: 18px;
	color: var(--text-secondary);
}
.hud span { color: var(--text); font-weight: 500; }

.stat-grid {
	display: grid;
	gap: 0;
	background: #000;
	border: 1px solid var(--border);
	border-radius: 12px;
	overflow: hidden;
}
.stat-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: var(--space-2);
	padding: 12px var(--space-2);
	border-bottom: 1px solid var(--border);
}
.stat-row:last-child { border-bottom: none; }
.stat-label {
	font-family: var(--font-mono);
	font-size: 12px;
	line-height: 16px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--text-secondary);
}
.stat-value {
	font-size: 15px;
	line-height: 20px;
	font-weight: 600;
	text-align: right;
}

.mono-chip {
	display: inline-block;
	font-family: var(--font-mono);
	font-size: 13px;
	line-height: 18px;
	color: var(--text);
	background: #000;
	border: 1px solid var(--border-strong);
	border-radius: 8px;
	padding: 8px 12px;
}

/* ---------- Dot nav ---------- */
.dots { display: flex; align-items: center; gap: 4px; }
.dots button {
	width: 28px;
	height: 44px;
	border: none;
	background: transparent;
	cursor: pointer;
	position: relative;
}
.dots button::after {
	content: "";
	position: absolute;
	top: 50%; left: 50%;
	transform: translate(-50%, -50%);
	width: 8px; height: 8px;
	border-radius: 50%;
	background: var(--border-strong);
	transition: background-color 0.3s ease, transform 0.3s ease;
}
.dots button:hover::after { background: var(--text-secondary); }
.dots button.on::after { background: var(--text); transform: translate(-50%, -50%) scale(1.4); }

/* ---------- Scroll reveals ---------- */
.sr-init {
	opacity: 0;
	transform: translateY(28px);
	transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
	transition-delay: var(--sr-delay, 0s);
}
.sr-in { opacity: 1; transform: translateY(0); }

/* ---------- Footer ---------- */
footer.pd-footer { padding: var(--space-6) 0; border-top: 1px solid var(--border); }
.footer-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-3);
	font-size: 15px;
	line-height: 20px;
	font-weight: 500;
	color: var(--text-secondary);
}
.footer-links { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); }
footer.pd-footer a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--text-secondary);
	text-decoration: none;
	transition: color 0.3s ease;
}
footer.pd-footer a:hover { color: var(--text); }
.linkedin-link { justify-content: center; min-width: 44px; }
.linkedin-link svg { display: block; fill: currentColor; }

/* ---------- Load-in motion ---------- */
.fade-in {
	animation: fadeIn 1.2s var(--ease-out) forwards;
	opacity: 0;
}
.delay-1 { animation-delay: 0.35s; }
.delay-2 { animation-delay: 0.55s; }
@keyframes fadeIn {
	from { opacity: 0; transform: translateY(16px); }
	to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.fade-in { animation: none; opacity: 1; }
	.btn, .btn-primary::after, .card, .dots button::after, .seg button, footer.pd-footer a, nav.pd-nav { transition: none; }
	.btn:hover { transform: none; }
	.sr-init { opacity: 1; transform: none; transition: none; }
	.card-fx::before { display: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
	.hero { padding-top: 96px; padding-bottom: var(--space-8); }
	section { padding-bottom: var(--space-12); }
	.grid-2, .grid-3 { grid-template-columns: 1fr; }
	.footer-inner {
		flex-direction: column-reverse;
		align-items: center;
		gap: var(--space-2);
		text-align: center;
	}
	.footer-links {
		width: 100%;
		justify-content: center;
		gap: var(--space-1) var(--space-3);
	}
	.footer-inner > div:first-child {
		width: 100%;
		padding-top: var(--space-2);
		border-top: 1px solid var(--border);
		font-size: 13px;
		line-height: 18px;
	}
}
