/* ═══════════════════════════════════════════════════════════
   GentlePod Design System — CSS Custom Properties & Base Styles
   Source of truth for hex values: CilTheme.cs → MudBlazor Palette
   Spec: 08-style/Design-System.md
   ═══════════════════════════════════════════════════════════ */

:root {
	/* ── Colors (aliased from MudBlazor palette set by CilTheme.CreateLight()) ── */
	--gp-warmwhite: var(--mud-palette-background);
	--gp-anthracite: var(--mud-palette-text-primary);
	--gp-accent: var(--mud-palette-primary);
	--gp-accent-hover: var(--mud-palette-primary-lighten);
	--gp-accent-subtle: #F3EFF6;  /* no MudBlazor equivalent */
	--gp-grey-100: #F5F5F2;       /* no MudBlazor equivalent */
	--gp-grey-300: var(--mud-palette-divider);
	--gp-grey-500: var(--mud-palette-text-disabled);
	--gp-grey-700: var(--mud-palette-text-secondary);
	--gp-white: var(--mud-palette-surface);
	--gp-success: var(--mud-palette-success);
	--gp-warning: var(--mud-palette-warning);

	/* ── Typography ── */
	--gp-font-serif: 'Source Serif 4', Georgia, serif;
	--gp-font-sans: 'Inter', system-ui, sans-serif;
	--gp-font-mono: 'JetBrains Mono', 'Cascadia Code', monospace;

	/* ── Layout ── */
	--gp-max-width: 1120px;
	--gp-max-text: 680px;
	--gp-section-gap: 140px;
	--gp-nav-height: 64px;
	--gp-card-radius: 8px;
	--gp-btn-radius: 6px;
}

/* ── Base ── */
html {
	background: var(--gp-warmwhite);
	color: var(--gp-anthracite);
	font-family: var(--gp-font-sans);
	font-size: 17px;
	line-height: 1.6;
}

body {
	margin: 0;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* ── Typography Overrides ── */
h1, h2, .gp-serif {
	font-family: var(--gp-font-serif);
	color: var(--gp-anthracite);
}

h1 {
	font-size: 3rem;
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: -0.02em;
}

h2 {
	font-size: 2rem;
	font-weight: 600;
	line-height: 1.2;
}

h3 {
	font-family: var(--gp-font-sans);
	font-size: 1.25rem;
	font-weight: 600;
	line-height: 1.3;
	color: var(--gp-anthracite);
}

/* ── Section Layout ── */
.gp-section {
	padding: var(--gp-section-gap) 24px;
}

.gp-section--alt {
	background: var(--gp-grey-100);
}

.gp-section--dark {
	background: var(--gp-anthracite);
	color: var(--gp-warmwhite);
}

.gp-container {
	max-width: var(--gp-max-width);
	margin: 0 auto;
}

.gp-text {
	max-width: var(--gp-max-text);
}

.gp-text--center {
	max-width: var(--gp-max-text);
	margin-left: auto;
	margin-right: auto;
	text-align: center;
}

/* ── Buttons ── */
.gp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 160px;
	padding: 14px 28px;
	border-radius: var(--gp-btn-radius);
	font-family: var(--gp-font-sans);
	font-size: 15px;
	font-weight: 500;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
	border: none;
}

.gp-btn--primary {
	background: var(--gp-accent);
	color: var(--gp-white);
}
.gp-btn--primary:hover {
	background: var(--gp-accent-hover);
}

.gp-btn--secondary {
	background: transparent;
	color: var(--gp-accent);
	border: 1.5px solid var(--gp-accent);
}
.gp-btn--secondary:hover {
	background: var(--gp-accent-subtle);
}

.gp-btn--sm {
	padding: 12px 20px;
}

/* Inverted buttons (on dark backgrounds) */
.gp-btn--primary-inv {
	background: var(--gp-warmwhite);
	color: var(--gp-anthracite);
}
.gp-btn--primary-inv:hover {
	background: var(--gp-white);
}

.gp-btn--secondary-inv {
	background: transparent;
	color: var(--gp-warmwhite);
	border: 1.5px solid var(--gp-warmwhite);
}
.gp-btn--secondary-inv:hover {
	background: rgba(255, 255, 255, 0.1);
}

/* ── Cards ── */
.gp-card {
	background: var(--gp-white);
	border: 1px solid var(--gp-grey-300);
	border-radius: var(--gp-card-radius);
	padding: 32px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	transition: box-shadow 200ms ease;
}
.gp-card:hover {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ── Blockquotes ── */
blockquote, .gp-quote {
	font-family: var(--gp-font-serif);
	font-size: 22px;
	font-weight: 400;
	font-style: italic;
	color: var(--gp-grey-700);
	border-left: 3px solid var(--gp-accent);
	padding-left: 24px;
	margin: 32px 0;
}

/* ── Navigation ── */
.gp-nav {
	position: sticky;
	top: 0;
	z-index: 1100;
	height: var(--gp-nav-height);
	background: rgba(250, 250, 247, 0.85); /* Warmwhite with transparency — cannot derive from variable */
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	display: flex;
	align-items: center;
	padding: 0 24px;
}

.gp-nav__inner {
	max-width: var(--gp-max-width);
	margin: 0 auto;
	width: 100%;
	display: flex;
	align-items: center;
	gap: 8px;
}

.gp-nav__logo {
	font-family: var(--gp-font-serif);
	font-size: 20px;
	font-weight: 600;
	color: var(--gp-anthracite);
	text-decoration: none;
	margin-right: auto;
}

.gp-nav__link {
	font-size: 14px;
	font-weight: 500;
	color: var(--gp-anthracite);
	text-decoration: none;
	padding: 8px 12px;
	transition: color 200ms ease;
}
.gp-nav__link:hover {
	color: var(--gp-accent);
}

/* ── Footer ── */
.gp-footer {
	background: var(--gp-anthracite);
	color: var(--gp-grey-300);
	padding: 64px 24px;
}

.gp-footer__inner {
	max-width: var(--gp-max-width);
	margin: 0 auto;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 48px;
}

.gp-footer__heading {
	font-size: 14px;
	font-weight: 600;
	color: var(--gp-warmwhite);
	margin-bottom: 16px;
}

.gp-footer a {
	color: var(--gp-grey-300);
	text-decoration: none;
	font-size: 15px;
	transition: color 200ms ease;
}
.gp-footer a:hover {
	color: var(--gp-white);
}

.gp-footer__bottom {
	max-width: var(--gp-max-width);
	margin: 48px auto 0;
	padding-top: 24px;
	border-top: 1px solid var(--gp-grey-700);
	font-size: 14px;
}

/* ── Culture Toggle ── */
.culture-toggle {
	display: inline-flex;
	align-items: center;
	border: 1.5px solid var(--gp-grey-300);
	border-radius: 6px;
	overflow: hidden;
	height: 32px;
}

.culture-toggle-btn {
	background: transparent;
	border: none;
	color: var(--gp-grey-500);
	font-family: var(--gp-font-sans);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.05em;
	padding: 0 12px;
	height: 100%;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
	line-height: 1;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
}

.culture-toggle-btn:hover:not(.active) {
	background: var(--gp-accent-subtle);
	color: var(--gp-accent);
}

.culture-toggle-btn.active {
	background: var(--gp-accent);
	color: var(--gp-warmwhite);
	cursor: default;
	pointer-events: none;
}

.culture-toggle-btn + .culture-toggle-btn {
	border-left: 1.5px solid var(--gp-grey-300);
}

/* ── Engine Deck: Channel Selector ── */
.engine-channels {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 24px;
}

.engine-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 12px 16px;
	min-width: 80px;
	background: var(--gp-white);
	border: 1.5px solid var(--gp-grey-300);
	border-radius: var(--gp-card-radius);
	cursor: pointer;
	transition: border-color 200ms ease, background 200ms ease, box-shadow 200ms ease;
	user-select: none;
}

.engine-card:hover {
	border-color: var(--gp-accent);
	background: var(--gp-accent-subtle);
}

.engine-card--active {
	border-color: var(--gp-accent);
	background: var(--gp-accent-subtle);
	box-shadow: 0 0 0 2px var(--gp-accent);
}

.engine-card__icon {
	color: var(--gp-grey-500);
	transition: color 200ms ease;
}

.engine-card--active .engine-card__icon {
	color: var(--gp-accent);
}

.engine-card__label {

	/* ── Auth pages — centered card ────────────────────────────────── */

	.gp-auth-card {
		border-radius: 16px;
		width: 100%;
		max-width: 400px;
	}
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--gp-anthracite);
	line-height: 1;
}

.engine-card__summary {
	font-size: 0.65rem;
	color: var(--gp-grey-500);
	line-height: 1;
	font-family: var(--gp-font-mono);
}

.engine-content {
	min-height: 120px;
	padding: 16px 0;
}

/* ── Accessibility ── */
:focus-visible {
	outline: 2px solid var(--gp-accent);
	outline-offset: 2px;
}

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

/* ── Responsive ── */
@media (max-width: 1023px) {
	.gp-footer__inner {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 767px) {
	:root {
		--gp-section-gap: 80px;
	}

	h1 { font-size: 2rem; }
	h2 { font-size: 1.5rem; }

	.gp-section {
		padding-left: 16px;
		padding-right: 16px;
	}

	.gp-footer__inner {
		grid-template-columns: 1fr;
	}

	.gp-nav {
		padding: 0 16px;
	}
}
