/* base.css — Reset, tokens, typography, responsive breakpoints */

/* ========== CSS Custom Properties (Design Tokens) ========== */
:root {
  /* Base */
  --bg:           #0a0a0a;
  --surface:      #141414;
  --surface-2:    #1c1c1c;
  --border:       #262626;
  --border-hover: #404040;

  /* Text — all pass WCAG AA on --bg */
  --text:       #fafafa;
  --text-dim:   #a1a1a1;
  --text-muted: #737373;

  /* Accent — per-service override */
  --accent:      #10b981;
  --accent-dim:  #065f46;
  --accent-text: #000000;

  /* States */
  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
  --transition: 150ms ease;

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Sizing */
  --max-width:     1080px;
  --content-width: 720px;
  --radius:        8px;
  --radius-lg:     12px;

  /* Spacing scale (4px base) */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-6:  24px;
  --sp-8:  32px;
  --sp-12: 48px;
  --sp-16: 64px;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

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

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

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

ul, ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* ========== Skip to Content ========== */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--sp-4);
  z-index: 1000;
  padding: var(--sp-2) var(--sp-4);
  background: var(--accent);
  color: var(--accent-text);
  border-radius: var(--radius);
  font-weight: 500;
  transition: top var(--transition);
}

.skip-link:focus {
  top: var(--sp-4);
}

/* ========== Typography ========== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text);
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

h3 {
  font-size: clamp(1.125rem, 2vw, 1.375rem);
}

h4 {
  font-size: 1.125rem;
}

p {
  color: var(--text-dim);
  max-width: 65ch;
}

strong {
  font-weight: 600;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

/* Inline code */
:not(pre) > code {
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  font-size: 0.85em;
}

/* ========== Focus Styles ========== */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* ========== Layout Utilities ========== */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

.content-width {
  max-width: var(--content-width);
}

/* ========== Accessibility ========== */
.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;
}

/* ========== Reduced Motion ========== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ========== Responsive Breakpoints ========== */
/* Mobile: < 768px (default) */
/* Tablet: 768–1023px */
/* Desktop: ≥ 1024px */

@media (min-width: 768px) {
  .container {
    padding: 0 var(--sp-8);
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 var(--sp-12);
  }
}
