/**
 * Searqo design tokens.
 *
 * Every value the rest of the system depends on is declared here as a custom
 * property so the companion plugin can consume the same scale without
 * duplicating it. Plugin stylesheets always provide a literal fallback so the
 * tools still look correct under a different theme.
 */

:root {
	/* Brand palette. */
	--sq-navy: #0b1220;
	--sq-navy-700: #16203a;
	--sq-navy-600: #1f2b47;
	--sq-blue: #2563eb;
	--sq-blue-hover: #1d4ed8;
	--sq-blue-active: #1e40af;
	--sq-blue-soft: #eff4ff;
	--sq-blue-border: #c7d8fd;
	--sq-cyan: #06b6d4;
	--sq-cyan-soft: #e6fbff;
	--sq-accent: #2563eb;
	--sq-violet: #7c3aed;
	--sq-violet-soft: #f3e8ff;
	--sq-amber: #d97706;
	--sq-amber-soft: #fef3c7;
	--sq-emerald: #059669;
	--sq-emerald-soft: #ecfdf5;
	--sq-coral: #f43f5e;
	--sq-coral-soft: #fff1f2;
	--sq-slate: #475569;
	--sq-slate-soft: #f1f5f9;

	/* Report chrome (shared across tools). */
	--sq-report-card-radius: 12px;
	--sq-report-card-border: 2px solid var(--sq-border);
	--sq-report-card-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
	--sq-report-metric-value: clamp(1.25rem, 1.1rem + 0.55vw, 1.625rem);

	/* Status palette. Contrast-checked against white and against their soft tints. */
	--sq-success: #16a34a;
	/* Deep enough for AA text contrast on --sq-success-soft. */
	--sq-success-strong: #0f7a37;
	--sq-success-soft: #e8f8ee;
	--sq-warning: #d97706;
	--sq-warning-strong: #a85c04;
	--sq-warning-soft: #fdf3e3;
	--sq-error: #dc2626;
	--sq-error-strong: #b91c1c;
	--sq-error-soft: #fdecec;
	--sq-info: #0e7490;
	--sq-info-soft: #e6f6fa;

	/* Surfaces and text. */
	--sq-bg: #f7f9fc;
	--sq-bg-alt: #eef2f9;
	--sq-surface: #ffffff;
	--sq-surface-sunken: #f4f7fb;
	--sq-text: #111827;
	--sq-text-muted: #5b6474;
	--sq-text-inverse: #f8fafc;
	--sq-text-inverse-muted: #b6c1d6;
	--sq-border: #e3e8f0;
	--sq-border-strong: #cbd4e2;
	--sq-focus: #1d4ed8;
	--sq-focus-inverse: #7dd3fc;

	/* Typography. System stack keeps the critical path free of font requests. */
	--sq-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
	--sq-font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

	--sq-text-xs: 0.75rem;
	--sq-text-sm: 0.8125rem;
	--sq-text-base: clamp(0.9375rem, 0.91rem + 0.14vw, 1rem);
	--sq-text-md: clamp(1rem, 0.97rem + 0.16vw, 1.0625rem);
	--sq-text-lg: clamp(1.0625rem, 1.02rem + 0.22vw, 1.1875rem);
	--sq-h4: clamp(1.0625rem, 1.01rem + 0.28vw, 1.25rem);
	--sq-h3: clamp(1.1875rem, 1.11rem + 0.4vw, 1.4375rem);
	--sq-h2: clamp(1.4375rem, 1.3rem + 0.68vw, 1.9375rem);
	--sq-h1: clamp(1.75rem, 1.5rem + 1.25vw, 2.75rem);

	/* Responsive type roles (layout system 1.6.0). */
	--sq-page-title: clamp(1.75rem, 1.45rem + 1.1vw, 2.75rem);
	--sq-section-title: clamp(1.375rem, 1.2rem + 0.7vw, 2rem);
	--sq-card-title: clamp(1.125rem, 1.05rem + 0.35vw, 1.375rem);
	--sq-body-copy: clamp(0.9375rem, 0.91rem + 0.14vw, 1.0625rem);

	--sq-leading-tight: 1.2;
	--sq-leading-snug: 1.35;
	--sq-leading: 1.65;
	--sq-tracking-tight: -0.015em;
	--sq-tracking-wide: 0.04em;

	/* Spacing scale (4px base). */
	--sq-space-1: 0.25rem;
	--sq-space-2: 0.5rem;
	--sq-space-3: 0.75rem;
	--sq-space-4: 1rem;
	--sq-space-5: 1.25rem;
	--sq-space-6: 1.5rem;
	--sq-space-8: 2rem;
	--sq-space-10: 2.5rem;
	--sq-space-12: 3rem;
	--sq-space-16: 4rem;

	/*
	 * Premium container system (1.7.0).
	 * Reference: SEO Article Writer centered 1440px workspace (--sq-aw-workspace-max).
	 * Wide = tools/dashboards/chrome · Standard = marketing · Form = auth · Reading = prose.
	 */
	--sq-container-wide: 1440px;
	--sq-container-standard: 1240px;
	--sq-container-form: 960px;
	--sq-container-reading: 780px;
	--sq-page-gutter: clamp(16px, 3vw, 40px);
	--sq-section-space: clamp(56px, 7vw, 96px);
	--sq-grid-gap: clamp(20px, 2.5vw, 32px);
	--sq-card-radius: 16px;
	--sq-card-padding: clamp(20px, 2.5vw, 32px);

	/* Layout aliases — prefer --sq-container-* above. */
	--page-max-width: var(--sq-container-standard);
	--workspace-max-width: var(--sq-container-wide);
	--reading-max-width: var(--sq-container-reading);
	--page-gutter: var(--sq-page-gutter);
	--section-gap: var(--sq-section-space);
	--content-gap: var(--sq-grid-gap);
	--card-radius: var(--sq-card-radius);
	--card-padding: var(--sq-card-padding);
	--hero-to-content-gap: clamp(56px, 5vw, 72px);
	--heading-to-lede-gap: clamp(16px, 1.5vw, 24px);
	--related-block-gap: clamp(24px, 2vw, 32px);

	--sq-section-y: var(--sq-section-space);

	/* Radii, shadows, layout. */
	--sq-radius-sm: 6px;
	--sq-radius: 10px;
	--sq-radius-lg: 14px;
	--sq-radius-xl: 20px;
	--sq-radius-pill: 999px;
	--sq-shadow-xs: 0 1px 2px rgba(11, 18, 32, 0.05);
	--sq-shadow-sm: 0 1px 3px rgba(11, 18, 32, 0.07), 0 1px 2px rgba(11, 18, 32, 0.04);
	--sq-shadow: 0 6px 18px rgba(11, 18, 32, 0.07), 0 2px 6px rgba(11, 18, 32, 0.04);
	--sq-shadow-lg: 0 18px 44px rgba(11, 18, 32, 0.12), 0 4px 12px rgba(11, 18, 32, 0.06);

	/* Legacy aliases — consolidate former 820/1720/1820 shells. */
	--sq-container: var(--sq-container-standard);
	--sq-container-narrow: var(--sq-container-form);
	--sq-gutter: var(--sq-page-gutter);
	--sq-header-height: 76px;
	--searqo-mobile-header-height: 80px;
	--mobile-header-height: var(--searqo-mobile-header-height);
	/* Measured by navigation.js (admin bar + announcement + header). */
	--combined-header-height: var(--sq-header-height);
	--sq-admin-bar-offset: 0px;
	--sq-tap: 44px;
	--sq-control-height: 56px;

	--sq-transition: 150ms ease;
	--sq-transition-slow: 240ms ease;
}

/*
 * Dark mode architecture is prepared but opt-in: nothing switches automatically,
 * so the launch palette stays predictable. Add data-sq-theme="dark" to <html>
 * to activate it.
 */
[data-sq-theme="dark"] {
	--sq-bg: #0b1220;
	--sq-bg-alt: #0f1729;
	--sq-surface: #131c30;
	--sq-surface-sunken: #0e1626;
	--sq-text: #eef2f9;
	--sq-text-muted: #a3aec4;
	--sq-border: #24304a;
	--sq-border-strong: #33415f;
	--sq-blue-soft: #16234a;
	--sq-blue-border: #2b3f6d;
	--sq-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
	--sq-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
	--sq-shadow-lg: 0 18px 44px rgba(0, 0, 0, 0.55);
	color-scheme: dark;
}
