/* Global: reset, variables, typography, layout */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg-canvas: #0a0e14;
  --bg-surface: #111820;
  --text-primary: #e8edf4;
  --text-secondary: #9aa8bc;
  /* ≥4.5:1 on canvas/surface for normal text (WCAG 1.4.3) */
  --text-tertiary: #8b9bb0;
  --border-default: #243041;
  --border-subtle: #1a2433;
  /* ≥4.5:1 white-on-action for CTA text (WCAG 1.4.3) */
  --color-action: #1d4ed8;
  --color-action-hover: #1e40af;
  /* Inline links / text accents on dark surfaces (≥4.5:1) */
  --color-link: #93c5fd;
  --color-trust: #34d399;
  --color-warning: #fbbf24;
  --color-danger: #f87171;
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --container-max: 1120px;
  --section-pad-y: 80px;
  --sticky-chrome-offset: 72px;
  --focus-ring: 2px solid var(--color-action);
  --focus-ring-offset: 2px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--sticky-chrome-offset);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.has-announcement {
  --sticky-chrome-offset: 120px;
}

:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-ring-offset);
}

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 10000;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--color-action);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.15s ease;
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  outline: 2px solid #fff;
  outline-offset: 2px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(100% - 32px, var(--container-max));
  margin-inline: auto;
}

.section {
  padding: var(--section-pad-y) 0;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.danger {
  color: var(--color-warning);
  font-weight: 500;
}

.ok {
  color: var(--color-trust);
  font-weight: 500;
}

.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;
}

@media (max-width: 768px) {
  :root {
    --section-pad-y: 56px;
  }
}
