/* Design tokens and global variables */
:root {
  --bg: #f5f7fb;
  --bg-alt: #0f172a;
  --surface: #ffffff;
  --surface-muted: #e2e8f0;
  --text: #0f172a;
  --text-light: #475569;
  --brand: #1d4ed8;
  --brand-dark: #0f3ca8;
  --accent: #f97316;
  --muted: #94a3b8;
  --header-bg: rgba(245, 247, 251, 0.95);
  --header-border: rgba(148, 163, 184, 0.3);
  --mobile-nav-bg: rgba(15, 23, 42, 0.95);
  --radius: 1rem;
  --radius-sm: 0.5rem;
  --shadow-soft: 0 20px 45px rgba(15, 23, 42, 0.1);
  --shadow-card: 0 12px 30px rgba(15, 23, 42, 0.12);
  --max-width: 1200px;
  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: 200ms ease;
  --lightbox-close-bg: #000000;
  --lightbox-close-color: #ffffff;
  --logo-bg: #f8fafc;
  --logo-border: rgba(15, 23, 42, 0.08);
  --footer-border: rgba(15, 23, 42, 0.08);
}

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

/* Reset margin/padding */
* {
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

/* Dark theme overrides */
:root[data-theme="dark"] {
  --bg: #020617;
  --bg-alt: #020617;
  --surface: #111827;
  --surface-muted: #1f2937;
  --text: #f8fafc;
  --text-light: #cbd5f5;
  --brand: #38bdf8;
  --brand-dark: #0ea5e9;
  --muted: #475569;
  --header-bg: rgba(2, 6, 23, 0.9);
  --header-border: rgba(59, 130, 246, 0.35);
  --mobile-nav-bg: rgba(2, 6, 23, 0.98);
  --lightbox-close-bg: #ffffff;
  --lightbox-close-color: #020617;
  --logo-bg: rgba(248, 250, 252, 0.08);
  --logo-border: rgba(148, 163, 184, 0.4);
  --footer-border: rgba(148, 163, 184, 0.35);
  background-color: var(--bg);
  color-scheme: dark;
}

/* Base typography and canvas */
body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Media defaults */
img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-sm);
}

/* Link default */
a {
  color: inherit;
  text-decoration: none;
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

/* Form controls inherit typography */
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

/* Lists */
ul {
  list-style: none;
}

/* Section padding rhythm */
section {
  padding: 3.5rem 0;
}

/* Heading defaults */
h1, h2, h3, h4 {
  line-height: 1.2;
  color: var(--text);
  font-weight: 600;
}

/* Body copy color */
p {
  color: var(--text-light);
}

/* Accessible hidden helper */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
