:root {
	/* Core Colors */
	--color-white: #ffffff;
	--color-off-white: #fafafa;
	--color-black: #000000;
	--color-rich-black: #0a0a0a;
	--color-soft-black: #1a1a1a;
	--color-medium-gray: #666666;
	--color-light-gray: #e5e5e5;
	--color-ghost-white: #f8f8f8;
	--color-logo-accent: #009999;

	/* Accent Colors */
	--color-accent: #000000;
	--color-error: #dc2626;
	--color-success: #16a34a;

	/* Typography */
	--font-sans:
		-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Inter",
		system-ui, sans-serif;
	--font-mono:
		"SF Mono", "Cascadia Code", "Roboto Mono", "Fira Code", monospace;

	/* Fluid Type Scale */
	--text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
	--text-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
	--text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
	--text-lg: clamp(1.125rem, 1rem + 0.625vw, 1.25rem);
	--text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
	--text-2xl: clamp(1.5rem, 1.3rem + 1vw, 2rem);
	--text-3xl: clamp(2rem, 1.5rem + 2.5vw, 3rem);

	/* Spacing Scale */
	--space-xs: 0.5rem;
	--space-sm: 0.75rem;
	--space-md: 1rem;
	--space-lg: 1.5rem;
	--space-xl: 2rem;
	--space-2xl: 3rem;
	--space-3xl: 4rem;

	/* Border Radius */
	--radius-sm: 4px;
	--radius-md: 8px;
	--radius-lg: 12px;
	--radius-xl: 16px;
	--radius-full: 9999px;

	/* Transitions */
	--transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
	--transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
	--transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
	--transition-spring: 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);

	/* Shadows */
	--shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
	--shadow-md:
		0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
	--shadow-lg:
		0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
	--shadow-xl:
		0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
	--shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

	/* For backdrop-filter support */
	--color-bg-rgb: 255, 255, 255;
	--color-text-rgb: 0, 0, 0;
}

/* Light Theme */
html[data-theme="light"] {
	--color-bg: var(--color-white);
	--color-surface: var(--color-ghost-white);
	--color-surface-hover: var(--color-off-white);
	--color-text: var(--color-rich-black);
	--color-text-secondary: var(--color-medium-gray);
	--color-border: rgba(0, 0, 0, 0.08);
	--color-border-hover: rgba(0, 0, 0, 0.12);
	--shadow-color: rgba(0, 0, 0, 0.1);
	--gradient-surface: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
}

/* Dark Theme */
html[data-theme="dark"] {
	--color-bg: var(--color-black);
	--color-surface: var(--color-soft-black);
	--color-surface-hover: #242424;
	--color-text: var(--color-white);
	--color-text-secondary: #a3a3a3;
	--color-border: rgba(255, 255, 255, 0.08);
	--color-border-hover: rgba(255, 255, 255, 0.12);
	--shadow-color: rgba(0, 0, 0, 0.5);
	--gradient-surface: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
	--color-bg-rgb: 10, 10, 10;
	--color-text-rgb: 255, 255, 255;
}

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

html {
	font-size: 16px;
	scroll-behavior: smooth;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

/* Smooth theme transitions */
html.transition,
html.transition *,
html.transition *::before,
html.transition *::after {
	transition:
		background-color var(--transition-slow),
		color var(--transition-slow),
		border-color var(--transition-slow),
		box-shadow var(--transition-slow) !important;
}

body {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	font-family: var(--font-sans), sans-serif;
	font-size: var(--text-base);
	line-height: 1.6;
	color: var(--color-text);
	background: var(--color-bg);
	position: relative;
	overflow-x: hidden;
}

/* Subtle background pattern */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	background-image:
		radial-gradient(circle at 20% 50%, var(--color-border) 0%, transparent 50%),
		radial-gradient(circle at 80% 80%, var(--color-border) 0%, transparent 50%),
		radial-gradient(circle at 40% 20%, var(--color-border) 0%, transparent 50%);
	opacity: 0.1;
	pointer-events: none;
	z-index: 0;
}

main {
	flex: 1;
	position: relative;
	z-index: 1;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.02em;
}

/* Links */
a {
	color: var(--color-text);
	text-decoration: none;
	position: relative;
	transition: color var(--transition-base);
}

a::after {
	content: "";
	position: absolute;
	bottom: -2px;
	left: 0;
	width: 0;
	height: 1px;
	background: var(--color-text);
	transition: width var(--transition-base);
}

a:hover::after {
	width: 100%;
}

/* Focus States */
:focus-visible {
	outline: 2px solid var(--color-text);
	outline-offset: 4px;
	border-radius: var(--radius-sm);
}
/*── 1) DARKEN THE LOGO ACCENT IN LIGHT MODE ──*/
html[data-theme="light"] {
	/* override the cyan so it's a bit richer on white */
	--color-logo-accent: #29e6e6;
}

/*── 2) ACCENT LINE UNDER EACH BLURB ──*/
.ai-blurb-list li {
	position: relative;
	padding-bottom: var(--space-md);
	margin-bottom: var(--space-md);
}

.metric-fill {
	background: var(--color-logo-accent);
	opacity: 1;
	transition: width 1s ease-out;
}
a:hover,
a:focus-visible {
	color: var(--color-logo-accent);
}
input:focus,
textarea:focus {
	box-shadow: 0 0 0 3px rgba(51, 255, 255, 0.4);
	border-color: var(--color-logo-accent);
}

a:hover::after,
a:focus-visible::after {
	background: var(--color-logo-accent);
}

/* Selection */
::selection {
	background: var(--color-text);
	color: var(--color-bg);
}

/* Logo Accent */
.logo-accent {
	color: var(--color-logo-accent);
	/* text-shadow: 0 0 4px var(--color-logo-accent, #4ade80); */
}

.container {
	width: 100%;
	max-width: 1200px;
	margin-inline: auto;
	padding-inline: var(--space-lg);
	position: relative;
}

header {
	padding: var(--space-lg) 0;
	background: var(--color-bg);
	border-bottom: 1px solid var(--color-border);
	position: sticky;
	top: 0;
	z-index: 100;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}

.header-container {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.display-1 {
	font-size: var(--text-xl);
	font-weight: 700;
	letter-spacing: -0.02em;
}

/* Header Controls */
.header-controls {
	display: flex;
	align-items: center;
	gap: 0.375rem;
}

/* Language Selector */
.language-selector {
	position: relative;
	display: flex;
	align-items: center;
}

.language-select {
	appearance: none;
	padding: 0.25rem 1.25rem 0.25rem 0.5rem;
	min-width: auto;
	background: transparent;
	color: var(--color-text);
	border: 1px solid transparent;
	border-radius: var(--radius-md);
	font-weight: 500;
	font-size: 0.875rem;
	cursor: pointer;
	transition: all var(--transition-base);
}

/* Style the dropdown options */
.language-select option {
	background: var(--color-bg);
	color: var(--color-text);
	padding: 0.5rem;
}

.language-select:hover {
	background: rgba(var(--color-text-rgb), 0.05);
	border-color: rgba(var(--color-text-rgb), 0.1);
}

.language-select:focus {
	outline: none;
	border-color: var(--color-logo-accent);
	box-shadow: 0 0 0 2px rgba(0, 153, 153, 0.2);
}

/* Chevron icon */
.chevron-icon {
	position: absolute;
	right: 0.375rem;
	top: 50%;
	transform: translateY(-50%);
	width: 8px;
	height: 8px;
	pointer-events: none;
	opacity: 0.6;
	transition: transform var(--transition-base);
}

/* Rotate chevron on focus */
.language-select:focus ~ .chevron-icon {
	transform: translateY(-50%) rotate(180deg);
}

/* Theme Toggle */
.theme-switch {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	background: transparent;
	border: 1px solid transparent;
	border-radius: var(--radius-full);
	cursor: pointer;
	transition: all var(--transition-base);
}

/* Hide checkbox visually but keep it accessible */
.theme-switch input[type="checkbox"] {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border-width: 0;
}

/* Screen reader only utility class */
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border-width: 0;
}

.theme-switch:hover {
	background: rgba(var(--color-text-rgb), 0.05);
	border-color: rgba(var(--color-text-rgb), 0.1);
	transform: scale(1.1);
}

.theme-switch:active {
	transform: scale(0.95);
}

.theme-switch:focus-visible,
.theme-switch:has(input:focus-visible) {
	outline: none;
	border-color: var(--color-logo-accent);
	box-shadow: 0 0 0 2px rgba(0, 153, 153, 0.2);
}

.theme-switch .icon {
	width: 18px;
	height: 18px;
	fill: var(--color-text);
	opacity: 0.7;
	transition:
		transform var(--transition-spring),
		opacity var(--transition-base);
}

/* Icon visibility and animations */
.icon.sun,
.icon.moon {
	position: absolute;
	opacity: 0;
	transform: scale(0.8) rotate(-180deg);
	display: none;
}

/* Light mode: Show moon icon only */
[data-theme="light"] .icon.moon {
	display: block;
	opacity: 0.7;
	transform: scale(1) rotate(0deg);
}

[data-theme="light"] .icon.sun {
	display: none;
	opacity: 0;
}

/* Dark mode: Show sun icon only */
[data-theme="dark"] .icon.sun {
	display: block;
	opacity: 0.7;
	transform: scale(1) rotate(0deg);
}

[data-theme="dark"] .icon.moon {
	display: none;
	opacity: 0;
}

/* Hover effect on icons */
.theme-switch:hover .icon {
	opacity: 1;
	transform: scale(1.1) rotate(15deg);
}

.ai-console-integrated {
	position: relative;
	width: 100%;
	margin: 0;
	min-height: 600px;
	overflow: hidden;
	background: var(--gradient-surface);
	border-top: 1px solid var(--color-border);
	border-bottom: 1px solid var(--color-border);
}

/* Console Background Layer */
.console-backdrop {
	position: absolute;
	inset: 0;
	z-index: 1;
	opacity: 0.2;
	pointer-events: none;
	overflow: hidden;
}

html[data-theme="dark"] .console-backdrop {
	opacity: 0.3;
}

.console-backdrop .console {
	width: 100%;
	height: 100%;
	background: transparent;
	border: none;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2rem;
}

.console-backdrop code,
.console-backdrop #console-text {
	font-family: "Courier New", Courier, monospace !important;
	font-size: 8px !important;
	line-height: 1 !important;
	letter-spacing: 0.2em !important;
	font-weight: 700 !important;
	color: var(--color-text) !important;
	opacity: 1 !important;
	white-space: pre !important;
	display: block !important;
	text-align: center;
	transform: scaleX(1.2);
}

/* AI Content Layer */
.ai-content-layer {
	position: relative;
	z-index: 2;
	padding: 4rem 0;
}

.ai-blurb-technical {
	max-width: none;
	padding: 0 var(--space-lg);
	text-align: left;
}

.ai-blurb-heading {
	font-size: clamp(2rem, 4vw, 3.5rem);
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: -0.02em;
	margin-bottom: 1rem;
	color: var(--color-text);
}

.ai-blurb-subtitle {
	font-size: var(--text-lg);
	color: var(--color-text-secondary);
	font-family: var(--font-mono), monospace;
	font-weight: 500;
	opacity: 1;
	margin-bottom: 3rem;
}
.ai-blurb-list {
	display: grid;
	grid-template-columns: 1fr !important;
	gap: var(--space-lg) !important;
}

.ai-blurb-list li {
	position: relative;
	padding: 1.75rem;
	background: rgba(var(--color-bg-rgb), 0.9);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	transition: all var(--transition-base);
	font-family: var(--font-sans), sans-serif;
	font-size: 0.95rem;
	line-height: 1.7;
	color: var(--color-text-secondary);
	max-width: 450px; /* Prevent items from growing too wide */
}

/* With responsive fallback */
@media (max-width: 1200px) {
	.ai-blurb-list {
		grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
	}
}

/* Large screen specific adjustments */
@media (min-width: 1200px) {
	.ai-blurb-list {
		grid-template-columns: repeat(3, minmax(350px, 380px));
		gap: 2rem;
	}
}

/* Medium-large screens */
@media (min-width: 900px) and (max-width: 1199px) {
	.ai-blurb-list {
		grid-template-columns: repeat(2, minmax(350px, 400px));
		gap: 1.75rem;
	}
}

/* Keep existing mobile behavior */
@media (max-width: 768px) {
	.ai-blurb-list {
		grid-template-columns: 1fr;
		justify-content: stretch; /* Full width on mobile */
	}

	.ai-blurb-list li {
		max-width: none; /* Remove max-width constraint on mobile */
	}
}

.metric-bar {
	display: block;
	width: 100%;
	height: 4px;
	background: var(--color-border);
	border-radius: 2px;
	margin-top: 0.5rem;
	overflow: hidden;
}

/*──────────
  CONTACT FORM
──────────*/
.contact-section {
	padding: var(--space-xl) var(--space-xl);
	margin: var(--space-xl) auto;
	max-width: 800px;
	background: var(--gradient-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-xl);
	box-shadow: var(--shadow-lg);
}

.contact-section h3 {
	font-size: var(--text-2xl);
	font-weight: 700;
	margin-bottom: var(--space-xl);
	text-align: center;
	letter-spacing: -0.02em;
}

.form {
	display: grid;
	gap: var(--space-lg);
}

.form-group {
	display: grid;
	gap: var(--space-sm);
}

label {
	font-size: var(--text-sm);
	font-weight: 600;
	color: var(--color-text);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

input,
textarea {
	width: 100%;
	padding: var(--space-md);
	font-family: inherit;
	font-size: var(--text-base);
	color: var(--color-text);
	background: var(--color-bg);
	border: 2px solid var(--color-border);
	border-radius: var(--radius-md);
	transition: all var(--transition-base);
	resize: vertical;
}

input:hover,
textarea:hover {
	border-color: var(--color-border-hover);
}

input:focus,
textarea:focus {
	outline: none;
	border-color: var(--color-text);
	box-shadow: 0 0 0 3px rgba(var(--color-text-rgb), 0.1);
}

/* Button */
.btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: var(--space-md) var(--space-xl);
	font-size: var(--text-base);
	font-weight: 600;
	color: var(--color-bg);
	background: var(--color-text);
	border: 2px solid var(--color-text);
	border-radius: var(--radius-md);
	cursor: pointer;
	overflow: hidden;
	transition: all var(--transition-base);
}

.btn:hover {
	transform: translateY(-2px);
	box-shadow: var(--shadow-lg);
}

.btn:active {
	transform: translateY(0);
	box-shadow: var(--shadow-md);
}

/*──────────
  FOOTER
──────────*/
footer {
	margin-top: auto;
	padding: var(--space-2xl) 0;
	background: var(--gradient-surface);
	border-top: 1px solid var(--color-border);
}

.footer-grid {
	display: grid;
	gap: var(--space-xl);
	align-items: center;
}

footer address {
	font-style: normal;
	line-height: 1.8;
	color: var(--color-text-secondary);
}

footer a {
	color: var(--color-text);
	font-weight: 500;
	transition: color var(--transition-base);
}

footer a:hover {
	color: var(--color-text-secondary);
}

.small {
	font-size: var(--text-sm);
	color: var(--color-text-secondary);
	opacity: 0.8;
}

.text-center {
	text-align: center;
}
.text-balance {
	text-wrap: balance;
}

@media (min-width: 768px) {
	.footer-grid {
		grid-template-columns: 1fr auto;
	}
}

@media (max-width: 768px) {
	:root {
		--text-base: 0.9375rem;
	}

	.container {
		padding-inline: var(--space-md);
	}

	.header-controls {
		gap: 0.375rem;
	}

	.display-1 {
		font-size: var(--text-xl);
	}

	.ai-console-integrated {
		min-height: 100vh !important;
	}

	.ai-content-layer {
		padding: 3rem 0;
	}

	.ai-blurb-heading {
		font-size: clamp(1.75rem, 5vw, 2.5rem);
	}

	.ai-blurb-list {
		grid-template-columns: 1fr;
	}

	.contact-section {
		padding: 1.5rem 1.5rem;
		margin: 1.5rem auto;
	}

	.footer-grid {
		grid-template-columns: 1fr;
		text-align: center;
	}
}

@media (max-width: 480px) {
	.header-controls {
		gap: 0.375rem;
	}

	.language-select {
		min-width: auto;
		padding: 0.25rem 1rem 0.25rem 0.375rem;
		font-size: 0.8125rem;
	}

	.chevron-icon {
		width: 7px;
		height: 7px;
		right: 0.25rem;
	}

	.theme-switch {
		width: 28px;
		height: 28px;
	}

	.theme-switch .icon {
		width: 16px;
		height: 16px;
	}

	.ai-content-layer {
		padding: 2rem 0;
	}

	.ai-blurb-list li {
		padding: 1.25rem;
		font-size: 0.875rem;
	}

	.console-backdrop {
		opacity: 0.3;
	}

	.contact-section {
		padding: 1.5rem 1rem;
		margin: 1rem auto;
	}

	.contact-section h3 {
		font-size: 1.5rem;
		margin-bottom: 1.5rem;
	}

	.form {
		gap: 1rem;
	}

	input,
	textarea {
		padding: 0.75rem;
		font-size: 16px; /* Prevents iOS zoom */
	}

	.btn {
		padding: 0.75rem 1.5rem;
	}
}

@media (max-width: 360px) {
	.header-controls {
		gap: 0.25rem;
	}

	.language-select {
		min-width: auto;
		padding: 0.2rem 0.875rem 0.2rem 0.375rem;
		font-size: 0.75rem;
	}

	.chevron-icon {
		width: 6px;
		height: 6px;
		right: 0.2rem;
	}

	.theme-switch {
		width: 26px;
		height: 26px;
	}

	.theme-switch .icon {
		width: 14px;
		height: 14px;
	}

	.contact-section {
		padding: 1.25rem 0.75rem;
		margin: 0.5rem auto;
		border-left: none;
		border-right: none;
		border-radius: 0;
	}
}

@media (prefers-reduced-motion: no-preference) {
	.ai-blurb-technical {
		opacity: 0;
		transform: translateY(2rem);
		animation: fadeSlideIn 0.8s ease-out 0.2s forwards;
	}

	.ai-blurb-list li {
		opacity: 0;
		transform: translateY(1rem);
		animation: fadeSlideIn 0.6s ease-out forwards;
	}

	.ai-blurb-list li:nth-child(1) {
		animation-delay: 0.3s;
	}
	.ai-blurb-list li:nth-child(2) {
		animation-delay: 0.4s;
	}
	.ai-blurb-list li:nth-child(3) {
		animation-delay: 0.5s;
	}

	@keyframes fadeSlideIn {
		to {
			opacity: 1;
			transform: translateY(0);
		}
	}

	@keyframes gradientShift {
		0%,
		100% {
			background-position: 0 50%;
		}
		50% {
			background-position: 100% 50%;
		}
	}
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

/* Hover effects only on capable devices */
@media (hover: hover) {
	.hover-lift:hover {
		transform: translateY(-4px);
	}
}

/* Print styles */
@media print {
	* {
		background: white !important;
		color: black !important;
		box-shadow: none !important;
		text-shadow: none !important;
	}

	.header-controls,
	.console-backdrop {
		display: none !important;
	}
}

/*── 1) A slightly richer blue in light mode ──*/
html[data-theme="light"] {
	/* bump it a touch toward pure cyan */
	--color-logo-accent: #009999;
}

/*—— Light-mode: make the console ASCII darker ———*/
html[data-theme="light"] .console-backdrop {
	/* increase from 0.3 to something more visible */
	opacity: 0.6 !important;
}

html[data-theme="light"] .console-backdrop code,
html[data-theme="light"] .console-backdrop #console-text {
	/* go full-strength black and add a tiny glow for legibility */
	color: rgba(0, 0, 0, 0.85) !important;
	text-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
}

.notification {
	padding: 0.75rem 1rem;
	margin-bottom: 1rem;
	border-radius: 4px;
	font-weight: 500;
}
.notification.success {
	background: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}
.notification.error {
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}
