/* ==========================================================================
   Codebay marketing site — reuses the app's light-mode design tokens
   verbatim from src/shell.html (light side of every light-dark() pair).
   ========================================================================== */

@font-face {
	font-family: 'Doto Variable';
	font-style: normal;
	font-display: swap;
	font-weight: 100 900;
	src: url('./assets/fonts/doto-latin-wght-normal.woff2') format('woff2-variations');
}
@font-face {
	font-family: 'JetBrains Mono Variable';
	font-style: normal;
	font-display: swap;
	font-weight: 100 800;
	src: url('./assets/fonts/jetbrains-mono-latin-wght-normal.woff2') format('woff2-variations');
}

:root {
	--bg: #d7d8d2;
	--bg-card: #e7e8e2;
	--ink: #14150f;
	--ink-soft: #45463e;
	--ink-faint: #7d7e74;
	--rule: #20211a;
	--rule-soft: #b9bab2;
	--warn-bg: #e4d98f;
	--warn-line: #9c8729;
	--warn-ink: #463b08;
	--ok-bg: #8fbf6e;
	--ok-line: #4c7a2e;
	--ok-ink: #1c3110;
	--danger: #b23a2e;
	--danger-soft: #e3c6c1;
	--info: #388bfd;
	--attn-done: #22c55e;
	--attn-waiting: #f59e0b;
	--grid-line: rgba(0, 0, 0, 0.035);
	--font-display: 'Doto Variable', 'JetBrains Mono Variable', monospace;
	--font-mono: 'JetBrains Mono Variable', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
	box-sizing: border-box;
}
/* The app's theme bans rounded corners globally — carried over verbatim. */
* {
	border-radius: 0 !important;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	font-family: var(--font-mono);
	background:
		repeating-linear-gradient(0deg, var(--grid-line) 0 1px, transparent 1px 3px),
		repeating-linear-gradient(90deg, var(--grid-line) 0 1px, transparent 1px 3px), var(--bg);
	color: var(--ink);
	font-size: 15px;
	line-height: 1.6;
	min-height: 100vh;
	-webkit-font-smoothing: antialiased;
}

a {
	color: inherit;
}

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

.stage {
	max-width: 1080px;
	margin: 0 auto;
	padding: 0 24px;
}

/* ---- shared "panel" chrome, ported from src/shell.html ---- */
.panel {
	border: 1px solid var(--ink);
	box-shadow: 4px 4px 0 var(--ink);
	background: var(--bg-card);
}
.panel-bar {
	padding: 9px 14px;
	background: var(--ink);
	color: var(--bg);
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}
.panel-bar-dots {
	display: inline-flex;
	gap: 5px;
}
.panel-bar-dots span {
	width: 7px;
	height: 7px;
	background: var(--bg);
	opacity: 0.55;
}
.panel-bar-dots.spacer {
	visibility: hidden;
}

/* ---- buttons, ported from src/components/Button.svelte ---- */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font-family: var(--font-mono);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	border: 1px solid var(--ink);
	background: var(--bg-card);
	color: var(--ink);
	cursor: pointer;
	text-decoration: none;
	padding: 10px 18px;
	font-size: 13px;
}
.btn svg {
	width: 15px;
	height: 15px;
	flex: none;
}
.btn:hover {
	background: var(--ink);
	color: var(--bg);
}
.btn.primary {
	font-weight: 700;
	background: var(--ink);
	color: var(--bg);
}
.btn.primary:hover {
	background: var(--bg-card);
	color: var(--ink);
}
.btn.ghost {
	background: transparent;
	border-style: dashed;
}
.btn.ghost:hover {
	background: var(--ink);
	color: var(--bg);
	border-style: solid;
}
.btn.lg {
	padding: 13px 24px;
	font-size: 15px;
}

/* ---- icon badge used in feature cards / steps ---- */
.icon-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border: 1px solid var(--ink);
	background: var(--bg);
	flex: none;
}
.icon-badge svg {
	width: 18px;
	height: 18px;
}

/* ==========================================================================
   Nav
   ========================================================================== */
.site-header {
	background: var(--bg);
	border-bottom: 1px solid var(--rule);
}
.site-header .stage {
	padding: 16px 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}
.brand {
	display: inline-flex;
	align-items: baseline;
	gap: 11px;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 21px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: inherit;
	text-decoration: none;
}
.brand .logo {
	display: inline-flex;
	align-items: center;
	align-self: center;
}
.brand .logo svg {
	width: 22px;
	height: 22px;
}
.brand .tagline {
	font-family: var(--font-mono);
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.08em;
	color: var(--ink-soft);
}
.brand.brand-sm {
	font-size: 16px;
}
.nav-actions {
	display: flex;
	align-items: center;
	gap: 10px;
}
.nav-actions .btn {
	white-space: nowrap;
}
.label-short {
	display: none;
}
@media (max-width: 640px) {
	.brand .tagline {
		display: none;
	}
	.label-full {
		display: none;
	}
	.label-short {
		display: inline;
	}
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
	padding: 56px 0 40px;
	text-align: center;
	border-top: none;
}
.eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	border: 1px solid var(--ink-faint);
	padding: 4px 10px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--ink-soft);
	margin-bottom: 22px;
}
.eyebrow .dot {
	width: 6px;
	height: 6px;
	background: var(--attn-done);
}
h1.headline {
	font-family: var(--font-display);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.01em;
	font-size: clamp(30px, 5.4vw, 54px);
	line-height: 1.12;
	margin: 0 auto 18px;
	max-width: 900px;
}
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
.word-rotator {
	position: relative;
	display: inline-grid;
	vertical-align: baseline;
	text-align: center;
}
.word-rotator .word {
	grid-area: 1 / 1;
	position: relative;
	justify-self: center;
	white-space: nowrap;
	opacity: 0;
	animation: word-cycle 6s ease-in-out infinite;
}
.word-rotator .word:nth-child(1) {
	animation-delay: 0s;
}
.word-rotator .word:nth-child(2) {
	animation-delay: 3s;
}
.hero-rotator .word:nth-child(1) {
	color: #c2410c;
}
.hero-rotator .word:nth-child(2) {
	color: var(--ok-line);
}
.soon-badge {
	position: absolute;
	top: 0;
	right: 0;
	transform: translate(35%, -20%);
	font-family: var(--font-mono);
	font-size: 9px;
	font-weight: 700;
	letter-spacing: 0.04em;
	background: var(--warn-bg);
	border: 1px solid var(--warn-line);
	color: var(--warn-ink);
	padding: 2px 5px;
	white-space: nowrap;
}
@keyframes word-cycle {
	0%,
	4% {
		opacity: 0;
		transform: translateY(0.2em) rotate(-3deg);
	}
	10%,
	42% {
		opacity: 1;
		transform: translateY(0) rotate(0deg);
	}
	48%,
	100% {
		opacity: 0;
		transform: translateY(-0.2em) rotate(3deg);
	}
}
.word-rotator.triple .word {
	animation-name: word-cycle-3;
	animation-duration: 9s;
}
.word-rotator.triple .word:nth-child(1) {
	animation-delay: 0s;
}
.word-rotator.triple .word:nth-child(2) {
	animation-delay: 3s;
}
.word-rotator.triple .word:nth-child(3) {
	animation-delay: 6s;
}
@keyframes word-cycle-3 {
	0%,
	3% {
		opacity: 0;
		transform: translateY(0.2em) rotate(-3deg);
	}
	8%,
	28% {
		opacity: 1;
		transform: translateY(0) rotate(0deg);
	}
	33%,
	100% {
		opacity: 0;
		transform: translateY(-0.2em) rotate(3deg);
	}
}
@media (prefers-reduced-motion: reduce) {
	.word-rotator .word {
		animation: none;
		opacity: 1;
	}
	.word-rotator .word:not(:first-child) {
		display: none;
	}
}
.subhead {
	font-size: 16px;
	color: var(--ink-soft);
	max-width: 620px;
	margin: 0 auto 30px;
	line-height: 1.65;
}

/* ---- 16:9 demo video panel ---- */
.demo-frame {
	max-width: 920px;
	margin: 0 auto 30px;
	text-align: left;
}
.demo-screen {
	position: relative;
	aspect-ratio: 16 / 9;
	background: #0d0e0a center / cover no-repeat url('./assets/demo-poster.svg');
	overflow: hidden;
}
.demo-screen video,
.demo-screen iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border: 0;
}

.cta-row {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	margin-top: 30px;
}
.code-chip {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	border: 1px solid var(--ink);
	background: var(--ink);
	color: var(--bg);
	padding: 10px 8px 10px 16px;
	font-family: var(--font-mono);
	font-size: 14px;
	font-weight: 600;
}
.code-chip.lg {
	padding: 16px 12px 16px 22px;
	font-size: clamp(14px, 4.2vw, 19px);
	gap: 18px;
	max-width: 100%;
}
.code-chip.lg button {
	font-size: 12px;
	padding: 9px 13px;
}
.code-chip.lg button svg {
	width: 15px;
	height: 15px;
}
.code-chip .prompt {
	color: var(--attn-done);
}
.code-chip button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: transparent;
	border: 1px solid var(--bg);
	color: var(--bg);
	font-family: var(--font-mono);
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	padding: 6px 9px;
	cursor: pointer;
}
.code-chip button svg {
	width: 13px;
	height: 13px;
}
.code-chip button:hover {
	background: var(--bg);
	color: var(--ink);
}

/* ==========================================================================
   Section scaffolding
   ========================================================================== */
section {
	padding: 56px 0;
	border-top: 1px solid var(--rule-soft);
}
.section-head {
	text-align: center;
	max-width: 640px;
	margin: 0 auto 36px;
}
.section-head h2 {
	font-family: var(--font-display);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	font-size: clamp(22px, 3vw, 30px);
	margin: 0 0 12px;
}
.section-head p {
	color: var(--ink-soft);
	margin: 0;
	line-height: 1.6;
}

/* ---- manual / autonomous balance scale ---- */
.scale {
	max-width: 560px;
	margin: 44px auto 0;
}
.scale-track {
	position: relative;
	height: 2px;
	background: var(--ink);
	margin: 0 1px;
}
.scale-track .tick {
	position: absolute;
	top: 50%;
	width: 2px;
	height: 14px;
	background: var(--ink);
	transform: translate(-50%, -50%);
}
.scale-track .tick.start {
	left: 0%;
}
.scale-track .tick.mid {
	left: 50%;
	width: 3px;
	height: 22px;
}
.scale-track .tick.end {
	left: 100%;
}
.scale-marker {
	position: absolute;
	left: 50%;
	bottom: 100%;
	transform: translateX(-50%);
	margin-bottom: 3px;
	display: flex;
	flex-direction: column;
	align-items: center;
}
.scale-marker-label {
	background: var(--ink);
	color: var(--bg);
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	padding: 5px 10px;
	white-space: nowrap;
}
.scale-marker-arrow {
	width: 0;
	height: 0;
	border-left: 6px solid transparent;
	border-right: 6px solid transparent;
	border-top: 7px solid var(--ink);
}
.scale-labels {
	display: flex;
	justify-content: space-between;
	margin-top: 16px;
	font-family: var(--font-mono);
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--ink-soft);
}

/* ---- control pane screenshot ---- */
.dashboard-frame {
	max-width: 1000px;
	margin: 0 auto;
	text-align: left;
}
.dashboard-screen {
	overflow: hidden;
}
.dashboard-screen img {
	width: 100%;
	height: auto;
}

/* ---- what makes Codebay different ---- */
.diff-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 20px;
}
.diff-card {
	padding: 26px 26px 28px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.diff-card h3 {
	font-family: var(--font-display);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	font-size: 17px;
	margin: 0;
}
.diff-card p {
	color: var(--ink-soft);
	font-size: 14px;
	line-height: 1.7;
	margin: 0;
}
.icon-badge.lg {
	width: 44px;
	height: 44px;
	background: var(--ink);
	color: var(--bg);
}
.icon-badge.lg svg {
	width: 22px;
	height: 22px;
}
@media (max-width: 720px) {
	.diff-grid {
		grid-template-columns: 1fr;
	}
}

/* ---- feature grid ---- */
.feature-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 18px;
}
.feature-card {
	padding: 20px 20px 22px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	transition: transform 0.08s steps(2);
}
.feature-card:hover {
	transform: translate(-1px, -1px);
	box-shadow: 6px 6px 0 var(--ink);
}
.feature-card h3 {
	font-family: var(--font-display);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	font-size: 14px;
	margin: 0;
}
.feature-card p {
	color: var(--ink-soft);
	font-size: 13px;
	line-height: 1.65;
	margin: 0;
}

/* ---- how it works ---- */
.steps {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 18px;
	counter-reset: step;
}
.step {
	padding: 18px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.step-num {
	width: 30px;
	height: 30px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--ink);
	color: var(--bg);
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 14px;
}
.step h3 {
	font-family: var(--font-display);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	font-size: 13px;
	margin: 0;
}
.step p {
	color: var(--ink-soft);
	font-size: 13px;
	line-height: 1.6;
	margin: 0;
}
@media (max-width: 860px) {
	.steps {
		grid-template-columns: repeat(2, 1fr);
	}
}
@media (max-width: 520px) {
	.steps {
		grid-template-columns: 1fr;
	}
}

/* ---- avatar showcase ---- */
.avatar-carousel {
	overflow: hidden;
	mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
	-webkit-mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
}
.avatar-track {
	display: flex;
	gap: 12px;
	width: max-content;
	animation: avatar-scroll 32s linear infinite;
}
.avatar-carousel:hover .avatar-track {
	animation-play-state: paused;
}
@keyframes avatar-scroll {
	from {
		transform: translateX(0);
	}
	to {
		transform: translateX(-50%);
	}
}
@media (prefers-reduced-motion: reduce) {
	.avatar-track {
		animation: none;
	}
}
.avatar-tile {
	flex: 0 0 auto;
	width: 84px;
	margin: 0;
	padding: 14px 8px 10px;
	border: 1px solid var(--ink);
	background: var(--bg-card);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	text-align: center;
}
.avatar-tile .sprite {
	width: 36px;
	height: 36px;
	fill: var(--ink);
}
.avatar-tile figcaption {
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--ink-faint);
}

/* ---- install ---- */
.install-panel {
	max-width: 640px;
	margin: 0 auto;
	padding: 22px 24px 24px;
}
.install-panel .code-chip {
	width: 100%;
	justify-content: space-between;
	margin-bottom: 18px;
}
.requirements-label {
	font-family: var(--font-display);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-size: 12px;
	font-weight: 700;
	color: var(--ink-soft);
	margin: 0 0 10px;
}
.requirements {
	list-style: none;
	margin: 0 0 18px;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
	font-size: 13px;
	color: var(--ink-soft);
}
.requirements li {
	display: flex;
	align-items: baseline;
	gap: 8px;
}
.requirements li::before {
	content: '›';
	color: var(--ink-faint);
	font-weight: 700;
}
.install-panel .doc-link {
	font-size: 13px;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
	border-top: 1px solid var(--rule);
	padding: 26px 0 40px;
}
footer .stage {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
}
.footer-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 18px;
	font-size: 12px;
	color: var(--ink-faint);
}
.footer-meta a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--ink-soft);
	text-decoration: none;
}
.footer-meta a:hover {
	color: var(--ink);
}
.footer-meta svg {
	width: 14px;
	height: 14px;
}
.footer-meta a.inline-link {
	display: inline;
	text-decoration: underline;
	text-underline-offset: 2px;
}

@media (max-width: 640px) {
	.hero {
		padding: 40px 0 28px;
	}
	section {
		padding: 44px 0;
	}
}
