/* ==========================================================================
   base.css — reset, design tokens, typography
   Memetics · memetics.pro
   ========================================================================== */

:root {
  /* Backgrounds */
  --bg-base: #0a0e1a;
  --bg-surface: #121829;
  --bg-elevated: #1a2335;

  /* Borders */
  --border-subtle: #1e293b;
  --border-default: #334155;

  /* Brand */
  --brand-primary: #3b82f6;
  --brand-primary-hover: #2563eb;
  --brand-accent: #f59e0b;
  --brand-accent-hover: #d97706;

  /* Text */
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;

  /* Status */
  --status-success: #22c55e;
  --status-danger: #ef4444;
  --status-warning: #f59e0b;

  /* Typography */
  --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;
  --space-2xl: 8rem;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;

  /* Max width */
  --max-width: 1200px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --speed: 200ms;
}

/* --------------------------------------------------------------------------
   Reset
   -------------------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  -webkit-text-size-adjust: 100%;
  background: var(--bg-base);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  background: var(--bg-base);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

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

button { background: none; border: none; cursor: pointer; }

ul, ol { list-style: none; }

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

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.25rem, 5.2vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.75rem); }
h3 { font-size: clamp(1.125rem, 1.8vw, 1.375rem); letter-spacing: -0.01em; }
h4 { font-size: 1.0625rem; letter-spacing: -0.01em; }

p { max-width: 66ch; }
p + p { margin-top: var(--space-sm); }

strong, b { color: var(--text-primary); font-weight: 600; }

a {
  color: var(--brand-primary);
  text-decoration: none;
  transition: color var(--speed) var(--ease);
}

a:hover { text-decoration: underline; }

small { font-size: 0.8125rem; }

code, kbd, pre, samp { font-family: var(--font-mono); }

::selection {
  background: var(--brand-primary);
  color: #ffffff;
}

:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */

.mono {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
}

.lead {
  font-size: clamp(1rem, 1.5vw, 1.1875rem);
  line-height: 1.65;
}

.text-center { text-align: center; }
.text-primary { color: var(--text-primary); }
.text-muted { color: var(--text-secondary); }
.text-success { color: var(--status-success); }
.text-danger { color: var(--status-danger); }
.text-accent { color: var(--brand-accent); }

.center-block { margin-left: auto; margin-right: auto; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--brand-primary);
  color: #fff;
  padding: 0.75rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.skip-link:focus {
  left: 0;
  text-decoration: none;
}

.no-wrap { white-space: nowrap; }
