/* ============================================================
   FIN — root.css
   Global Design System · Shared across all pages
   ============================================================ */

/* ── TOKENS ──────────────────────────────────────────────── */
:root {
	/* Background */
	--bg: #f8f7f4;
	--bg-card: #ffffff;
	--bg-card-alt: #f4f3ef;
	--border: #e8e6e0;
	--border-light: #f0ede7;

	/* Text */
	--text-primary: #1a1916;
	--text-sec: #6b6860;
	--text-ter: #9b9890;

	/* Accent */
	--accent: #2563eb;
	--accent-light: #dbeafe;
	--accent-dark: #1d4ed8;

	/* Category hues */
	--needs-hue: 213;
	--wants-hue: 270;
	--savings-hue: 152;

	--needs: hsl(var(--needs-hue) 70% 52%);
	--needs-light: hsl(var(--needs-hue) 80% 95%);
	--needs-mid: hsl(var(--needs-hue) 65% 88%);
	--needs-dark: hsl(var(--needs-hue) 60% 38%);

	--wants: hsl(var(--wants-hue) 52% 60%);
	--wants-light: hsl(var(--wants-hue) 70% 96%);
	--wants-mid: hsl(var(--wants-hue) 50% 89%);
	--wants-dark: hsl(var(--wants-hue) 45% 42%);

	--savings: hsl(var(--savings-hue) 52% 46%);
	--savings-light: hsl(var(--savings-hue) 70% 95%);
	--savings-mid: hsl(var(--savings-hue) 55% 87%);
	--savings-dark: hsl(var(--savings-hue) 50% 30%);

	/* Typography */
	--font-sans: 'Inter', system-ui, sans-serif;
	--font-serif: 'DM Serif Display', Georgia, serif;

	--size-xs: 0.75rem;
	--size-sm: 0.875rem;
	--size-base: 1rem;
	--size-md: 1.125rem;
	--size-lg: 1.25rem;
	--size-xl: 1.5rem;
	--size-2xl: 2rem;
	--size-3xl: 2.75rem;
	--size-4xl: 3.75rem;
	--size-5xl: 5rem;

	/* Spacing */
	--space-1: 0.25rem;
	--space-2: 0.5rem;
	--space-3: 0.75rem;
	--space-4: 1rem;
	--space-5: 1.25rem;
	--space-6: 1.5rem;
	--space-8: 2rem;
	--space-10: 2.5rem;
	--space-12: 3rem;
	--space-16: 4rem;
	--space-20: 5rem;
	--space-24: 6rem;

	/* Radii */
	--radius-sm: 6px;
	--radius-md: 12px;
	--radius-lg: 20px;
	--radius-xl: 28px;
	--radius-full: 9999px;

	/* Shadows */
	--shadow-sm: 0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .04);
	--shadow-md: 0 4px 16px rgba(0, 0, 0, .07), 0 2px 6px rgba(0, 0, 0, .04);
	--shadow-lg: 0 12px 40px rgba(0, 0, 0, .10), 0 4px 12px rgba(0, 0, 0, .05);
	--shadow-card: 0 2px 12px rgba(0, 0, 0, .06), 0 1px 4px rgba(0, 0, 0, .04);

	/* Transitions */
	--ease-out: cubic-bezier(0.16, 1, 0.3, 1);
	--ease-io: cubic-bezier(0.4, 0, 0.2, 1);
	--dur-fast: 150ms;
	--dur-base: 220ms;
	--dur-slow: 400ms;
	--dur-x: 700ms;
}

/* ── DARK MODE ───────────────────────────────────────────── */
[data-theme="dark"] {
	--bg: #111110;
	--bg-card: #1c1c1a;
	--bg-card-alt: #242422;
	--border: #2e2e2b;
	--border-light: #252523;
	--text-primary: #f0ede6;
	--text-sec: #9b9890;
	--text-ter: #66635d;
	--accent: #3b82f6;
	--accent-light: #1e3a5f;
	--accent-dark: #60a5fa;

	--needs: hsl(var(--needs-hue) 65% 58%);
	--needs-light: hsl(var(--needs-hue) 30% 18%);
	--needs-mid: hsl(var(--needs-hue) 30% 22%);
	--needs-dark: hsl(var(--needs-hue) 65% 72%);

	--wants: hsl(var(--wants-hue) 48% 65%);
	--wants-light: hsl(var(--wants-hue) 25% 18%);
	--wants-mid: hsl(var(--wants-hue) 25% 22%);
	--wants-dark: hsl(var(--wants-hue) 55% 78%);

	--savings: hsl(var(--savings-hue) 52% 52%);
	--savings-light: hsl(var(--savings-hue) 25% 16%);
	--savings-mid: hsl(var(--savings-hue) 25% 21%);
	--savings-dark: hsl(var(--savings-hue) 55% 70%);

	--shadow-sm: 0 1px 3px rgba(0, 0, 0, .30);
	--shadow-md: 0 4px 16px rgba(0, 0, 0, .35);
	--shadow-lg: 0 12px 40px rgba(0, 0, 0, .45);
	--shadow-card: 0 2px 12px rgba(0, 0, 0, .30);
}

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

html {
	scroll-behavior: smooth;
	-webkit-font-smoothing: antialiased;
}

body {
	font-family: var(--font-sans);
	background: var(--bg);
	color: var(--text-primary);
	line-height: 1.6;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	transition:
		background var(--dur-slow) var(--ease-io),
		color var(--dur-slow) var(--ease-io);
}

main {
	flex: 1 0 auto;
}

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

button {
	cursor: pointer;
	border: none;
	background: none;
	font-family: inherit;
}

a {
	color: inherit;
	text-decoration: none;
}

input,
select,
textarea {
	font-family: inherit;
}

ul,
ol {
	list-style: none;
}

/* ── UTILITIES ───────────────────────────────────────────── */
.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;
}

/* ── LAYOUT ──────────────────────────────────────────────── */
.container {
	width: 100%;
	max-width: 1140px;
	margin-inline: auto;
	padding-inline: var(--space-6);
}

.section-gap {
	padding-block: var(--space-24);
}

/* ── TYPOGRAPHY SCALE ────────────────────────────────────── */
.section-label {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	font-size: var(--size-xs);
	font-weight: 600;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--accent);
	margin-bottom: var(--space-4);
}

.section-label::before {
	content: '';
	display: block;
	width: 20px;
	height: 1.5px;
	background: currentColor;
	border-radius: 2px;
}

.section-heading {
	font-family: var(--font-serif);
	font-size: clamp(var(--size-2xl), 4vw, var(--size-4xl));
	font-weight: 400;
	line-height: 1.15;
	letter-spacing: -.02em;
	color: var(--text-primary);
	margin-bottom: var(--space-4);
}

.section-sub {
	font-size: var(--size-md);
	color: var(--text-sec);
	max-width: 48ch;
	margin-bottom: var(--space-12);
}

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-2);
	padding: 0.75rem 1.625rem;
	border-radius: var(--radius-full);
	font-size: var(--size-sm);
	font-weight: 600;
	letter-spacing: .01em;
	transition: all var(--dur-base) var(--ease-out);
	white-space: nowrap;
}

.btn-primary {
	background: var(--accent);
	color: #fff;
	box-shadow: 0 2px 8px rgba(37, 99, 235, .28);
}

.btn-primary:hover {
	background: var(--accent-dark);
	box-shadow: 0 4px 18px rgba(37, 99, 235, .38);
	transform: translateY(-1px);
}

.btn-primary:active {
	transform: translateY(0);
}

.btn-ghost {
	color: var(--text-sec);
	background: transparent;
	border: 1.5px solid var(--border);
}

.btn-ghost:hover {
	color: var(--text-primary);
	border-color: var(--text-sec);
	background: var(--bg-card-alt);
}

.btn-sm {
	padding: 0.5rem 1.1rem;
	font-size: var(--size-xs);
}

.icon-btn {
	display: inline-flex;
	align-items: center;
	gap: var(--space-1);
	padding: 0.45rem 0.875rem;
	border-radius: var(--radius-full);
	font-size: var(--size-xs);
	font-weight: 500;
	color: var(--text-sec);
	border: 1.5px solid var(--border);
	background: var(--bg-card);
	transition: all var(--dur-base) var(--ease-out);
}

.icon-btn:hover {
	color: var(--text-primary);
	border-color: var(--text-sec);
	background: var(--bg-card-alt);
	transform: translateY(-1px);
	box-shadow: var(--shadow-sm);
}

/* ── HEADER (injected by root.js) ────────────────────────── */
.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: rgba(248, 247, 244, .88);
	-webkit-backdrop-filter: blur(20px);
	backdrop-filter: blur(20px);
	border-bottom: 1px solid var(--border-light);
	padding-block: var(--space-4);
	transition: background var(--dur-slow) var(--ease-io);
}

[data-theme="dark"] .site-header {
	background: rgba(17, 17, 16, .88);
}

.header-inner {
	display: flex;
	align-items: center;
	gap: var(--space-8);
}

.logo {
	display: flex;
	align-items: center;
	gap: var(--space-2);
	font-weight: 700;
	font-size: var(--size-base);
	flex-shrink: 0;
	color: var(--text-primary);
}

.logo-text {
	letter-spacing: -.02em;
}

.logo svg rect {
  fill: var(--accent);
}

.nav-links {
	display: flex;
	align-items: center;
	gap: var(--space-6);
	margin-left: auto;
}

.nav-links a {
	font-size: var(--size-sm);
	color: var(--text-sec);
	font-weight: 500;
	transition: color var(--dur-fast);
	position: relative;
}

.nav-links a:hover,
.nav-links a.active {
	color: var(--text-primary);
}

.nav-links a.active::after {
	content: '';
	position: absolute;
	bottom: -2px;
	left: 0;
	right: 0;
	height: 2px;
	background: var(--accent);
	border-radius: 2px;
}

.theme-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: var(--radius-full);
	background: var(--bg-card-alt);
	border: 1.5px solid var(--border);
	color: var(--text-sec);
	transition: all var(--dur-base) var(--ease-out);
	flex-shrink: 0;
	margin-left: var(--space-4);
}

.theme-toggle:hover {
	color: var(--text-primary);
	border-color: var(--text-sec);
}

.theme-icon {
	display: flex;
	align-items: center;
}

.dark-icon {
	display: none;
}

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

[data-theme="dark"] .dark-icon {
	display: flex;
}

/* ── FOOTER (injected by root.js) ────────────────────────── */
.site-footer {
	border-top: 1px solid var(--border-light);
	padding-block: var(--space-6);
	margin-top: var(--space-8);
}

.footer-inner {
	display: flex;
	flex-direction: column;
	gap: var(--space-4);
}

.footer-top-row {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: var(--space-8);
	flex-wrap: wrap;
}

.footer-logo {
	font-weight: 700;
	font-size: var(--size-base);
	letter-spacing: -.02em;
	color: var(--text-primary);
}

.footer-links-wrap {
	display: flex;
	align-items: flex-start;
	gap: var(--space-10);
	flex-wrap: wrap;
}

.footer-nav {
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
}

.footer-nav-title {
	font-size: .65rem;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--text-ter);
}

.footer-nav-links {
	display: flex;
	gap: var(--space-5);
	flex-wrap: wrap;
}

.footer-nav a {
	font-size: var(--size-xs);
	color: var(--text-ter);
	font-weight: 500;
	transition: color var(--dur-fast);
}

.footer-nav a:hover {
	color: var(--text-primary);
}

.footer-bottom-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-4);
	border-top: 1px solid var(--border-light);
	padding-top: var(--space-4);
}

.footer-copy {
	color: var(--text-ter);
	font-size: var(--size-xs);
}

.footer-top {
	font-size: var(--size-xs);
	font-weight: 500;
	color: var(--text-sec);
	transition: color var(--dur-fast);
}

.footer-top:hover {
	color: var(--text-primary);
}

/* ── GENERIC CARD ────────────────────────────────────────── */
.card {
	background: var(--bg-card);
	border: 1.5px solid var(--border);
	border-radius: var(--radius-xl);
	padding: var(--space-6);
	box-shadow: var(--shadow-card);
	transition:
		transform var(--dur-base) var(--ease-out),
		box-shadow var(--dur-base) var(--ease-out),
		background var(--dur-slow),
		border-color var(--dur-slow);
}

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

/* ── RELATED LINKS ───────────────────────────────────────── */
.related-links {
	margin-top: var(--space-6);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-3);
}

.related-label {
	font-size: var(--size-xs);
	font-weight: 600;
	color: var(--text-ter);
	text-transform: uppercase;
	letter-spacing: .06em;
}

.related-links a {
	display: inline-flex;
	align-items: center;
	padding: 0.35rem 0.7rem;
	border-radius: var(--radius-full);
	border: 1.5px solid var(--border);
	background: var(--bg-card);
	font-size: var(--size-xs);
	font-weight: 600;
	color: var(--text-sec);
	transition: border-color var(--dur-fast), color var(--dur-fast);
}

.related-links a:hover {
	border-color: var(--accent);
	color: var(--accent);
}

/* ── COMING SOON ─────────────────────────────────────────── */
.coming-soon-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 60vh;
	text-align: center;
	padding: var(--space-12);
}

.coming-soon-badge {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	padding: 0.35rem 0.875rem;
	border-radius: var(--radius-full);
	background: var(--bg-card-alt);
	border: 1.5px solid var(--border);
	color: var(--text-sec);
	font-size: var(--size-xs);
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	margin-bottom: var(--space-6);
}

.coming-soon-title {
	font-family: var(--font-serif);
	font-size: clamp(var(--size-2xl), 4vw, var(--size-4xl));
	font-weight: 400;
	letter-spacing: -.025em;
	line-height: 1.1;
	margin-bottom: var(--space-4);
}

.coming-soon-sub {
	font-size: var(--size-md);
	color: var(--text-sec);
	max-width: 44ch;
	margin-bottom: var(--space-8);
}

/* ── REVEAL ANIMATION ────────────────────────────────────── */
.reveal {
	opacity: 0;
	transform: translateY(24px);
	transition:
		opacity var(--dur-x) var(--ease-out),
		transform var(--dur-x) var(--ease-out);
}

.reveal.visible {
	opacity: 1;
	transform: translateY(0);
}

/* ── TOAST ───────────────────────────────────────────────── */
.toast {
	position: fixed;
	bottom: var(--space-6);
	left: 50%;
	transform: translateX(-50%) translateY(20px);
	background: var(--text-primary);
	color: var(--bg);
	padding: 0.7rem 1.4rem;
	border-radius: var(--radius-full);
	font-size: var(--size-sm);
	font-weight: 500;
	opacity: 0;
	pointer-events: none;
	z-index: 999;
	transition:
		opacity var(--dur-base) var(--ease-out),
		transform var(--dur-base) var(--ease-out);
	white-space: nowrap;
	box-shadow: var(--shadow-lg);
}

.toast.show {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

[data-theme="dark"] .toast {
	background: var(--bg-card-alt);
	color: var(--text-primary);
	border: 1px solid var(--border);
}

/* ── FOCUS VISIBLE ───────────────────────────────────────── */
:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 3px;
	border-radius: var(--radius-sm);
}

/* ── PRINT (global) ──────────────────────────────────────── */
@media print {

	.site-header,
	.theme-toggle,
	.nav-links,
	.site-footer,
	.toast {
		display: none !important;
	}

	body {
		background: #fff;
		color: #000;
	}
}

/* ── RESPONSIVE (global) ─────────────────────────────────── */
@media (max-width: 768px) {
	.container {
		padding-inline: var(--space-5);
	}

	.section-gap {
		padding-block: var(--space-16);
	}

	.theme-toggle {
		margin-left: auto;
	}

	.footer-top-row {
		gap: var(--space-4);
	}

	.footer-links-wrap {
		gap: var(--space-5);
	}

	.footer-nav-links {
		gap: var(--space-3);
	}

	.footer-bottom-row {
		width: 100%;
	}
}

@media (max-width: 560px) {
	.footer-top-row,
	.footer-bottom-row {
		flex-direction: column;
		align-items: flex-start;
	}

	.footer-links-wrap {
		width: 100%;
		justify-content: space-between;
	}
}

@media (max-width: 425px) {
	.nav-links {
		display: none;
	}
}

@media (max-width: 480px) {
	.container {
		padding-inline: var(--space-4);
	}
}
