/**
 * Sage Design System - Base
 * Design tokens, reset, and shared component styles.
 * Imported by all pages.
 */

/* ============================================
   DESIGN TOKENS
   Canonical source: .studio/design.md
   Brand-identity values (palette, body type, radii) are spec'd there.
   If these ever drift, design.md wins. Gray scale, platform colors,
   and info/info-hover are derivative and live here only.
   ============================================ */
:root {
	/* Core palette */
	--sage-canvas: #f8f7f4;
	--sage-ink: #1a1a24;
	--sage-botanical: #4a7c59;
	--sage-botanical-dark: #3d6a4b;
	--sage-botanical-light: #e8f0eb;

	/* Semantic */
	--sage-bg-primary: var(--sage-canvas);
	--sage-text-primary: var(--sage-ink);
	--sage-text-secondary: #6b7280;
	--sage-text-muted: #9ca3af;
	--sage-accent: var(--sage-botanical);
	--sage-accent-hover: var(--sage-botanical-dark);
	--sage-surface: #ffffff;
	--sage-border: #e5e5e0;
	--sage-border-subtle: #e2e8f0;

	/* Status */
	--sage-success: #10b981;
	--sage-success-bg: #dcfce7;
	--sage-success-fg: #166534;
	--sage-error: #dc2626;
	--sage-warning: #f59e0b;
	--sage-info: #3b82f6;
	--sage-info-bg: #e0f2fe;
	--sage-info-hover: #2563eb;

	/* Gray scale */
	--sage-gray-50: #f8fafc;
	--sage-gray-100: #f1f5f9;
	--sage-gray-200: #e5e7eb;
	--sage-gray-300: #d1d5db;
	--sage-gray-400: #9ca3af;
	--sage-gray-500: #6b7280;
	--sage-gray-600: #475569;
	--sage-gray-700: #374151;
	--sage-gray-800: #1e293b;

	/* Platform */
	--sage-platform-linkedin: #0a66c2;
	--sage-platform-twitter: #e1e8ed;
	--sage-platform-substack: #ff6719;

	/* Warnings */
	--sage-warning-light: #fef3c7;

	/* Typography */
	--sage-font-primary:
		"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	--sage-font-base: 14px;

	/* Radius */
	--sage-radius-sm: 6px;
	--sage-radius-md: 8px;
	--sage-radius-lg: 12px;
}

/* ============================================
   RESET
   ============================================ */
*,
*::before,
*::after {
	box-sizing: border-box;
}

body {
	font-family: var(--sage-font-primary);
	background: var(--sage-bg-primary);
	margin: 0;
	padding: 0;
	color: var(--sage-text-primary);
	line-height: 1.6;
}

/* ============================================
   NAV COMPONENT
   Shared across landing, pricing, and other pages.
   ============================================ */
.nav {
	background: var(--sage-surface);
	border-bottom: 1px solid var(--sage-border);
	padding: 1rem 2rem;
	position: sticky;
	top: 0;
	z-index: 100;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.nav-container {
	max-width: 1200px;
	margin: 0 auto;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.nav-brand {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	text-decoration: none;
	color: var(--sage-ink);
	font-weight: 600;
	font-size: 1.25rem;
}

.nav-brand img {
	width: 32px;
	height: 32px;
}

.nav-links {
	display: flex;
	gap: 2rem;
	align-items: center;
}

.nav-link {
	text-decoration: none;
	color: var(--sage-text-secondary);
	font-weight: 500;
	transition: color 0.2s;
}

.nav-link:hover {
	color: var(--sage-accent);
}

.nav-link.active {
	color: var(--sage-accent);
	font-weight: 600;
}

/* ============================================
   SHARED COMPONENTS
   ============================================ */

/* Loader / spinner */
@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

.loader {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-radius: 50%;
	border-top-color: white;
	animation: spin 1s ease-in-out infinite;
}

/* Bottom CTA section (shared between landing and pricing) */
.bottom-cta {
	text-align: center;
	padding: 4rem 2rem;
	max-width: 600px;
	margin: 0 auto;
}

.bottom-cta h2 {
	font-size: 2rem;
	font-weight: 700;
	color: var(--sage-ink);
	margin-bottom: 0.75rem;
}

.bottom-cta p {
	color: var(--sage-text-secondary);
	font-size: 1.1rem;
	margin-bottom: 2rem;
}

/* Muted helper text */
.text-secondary {
	color: var(--sage-text-secondary);
}

.text-muted {
	color: var(--sage-text-muted);
}

/* ============================================
   RESPONSIVE - NAV
   ============================================ */
@media (max-width: 768px) {
	.nav-links {
		gap: 1rem;
	}

	.nav-link {
		font-size: 0.875rem;
	}
}

@media (max-width: 480px) {
	.nav {
		padding: 1rem;
	}

	.nav-brand {
		font-size: 1rem;
	}

	.nav-brand img {
		width: 24px;
		height: 24px;
	}
}

/* ============================================
   App Page Header (shared chrome)
   Used by Dashboard, Settings, and Admin pages.
   Marketing pages use .nav instead.
   ============================================ */

.header {
	padding: 8px 4px 0;
	margin-bottom: 8px;
	display: flex;
	justify-content: flex-end;
	align-items: center;
}

.header-left {
	display: flex;
	align-items: center;
}

.header-right {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-left: auto;
}

/* Connection status dots */
.connection-dots {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-right: 12px;
}

.connection-dot {
	position: relative;
	width: 20px;
	height: 20px;
	cursor: pointer;
}

.connection-dot img {
	opacity: 0.3;
	display: block;
	margin: 2px;
	transition: opacity 0.2s ease;
}

.connection-dot[data-connected="true"] img {
	opacity: 1;
}

/* Header menu button */
.header-menu-btn {
	width: 32px;
	height: 32px;
	border: none;
	background: transparent;
	border-radius: 50%;
	cursor: pointer;
	transition:
		background 0.2s ease,
		color 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--sage-text-secondary);
}

.header-menu-btn:hover {
	background: var(--sage-gray-100);
	color: var(--sage-ink);
}

.product-title {
	display: flex;
	align-items: center;
	gap: 12px;
}

.product-icon {
	font-size: 18px;
}

.product-meta {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.product-name {
	font-size: 18px;
	font-weight: 600;
	color: var(--sage-ink);
}

.product-section {
	font-size: 13px;
	color: var(--sage-text-secondary);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}
