/* ═══════════════════════════════════════════════════════════════
   SonicSpace — base.css
   Reset, CSS custom properties, typography, global utilities
   ═══════════════════════════════════════════════════════════════ */

/* ─── CUSTOM PROPERTIES ──────────────────────────────────────── */
:root {
  /* Color system */
  --bg-base:          #0a0a0f;
  --bg-surface:       #0f0f18;
  --bg-elevated:      #14141f;
  --bg-overlay:       #1a1a28;
  --bg-highlight:     #1f1f30;

  --border-subtle:    rgba(255, 255, 255, 0.06);
  --border-default:   rgba(255, 255, 255, 0.10);
  --border-strong:    rgba(255, 255, 255, 0.18);

  --text-primary:     #e8e8f0;
  --text-secondary:   #9090a8;
  --text-muted:       #5a5a72;
  --text-inverse:     #0a0a0f;

  /* Accent colors */
  --accent-primary:   #4fffb0;      /* sonic green */
  --accent-primary-dim: rgba(79, 255, 176, 0.12);
  --accent-primary-glow: rgba(79, 255, 176, 0.25);
  --accent-blue:      #4fc3ff;
  --accent-blue-dim:  rgba(79, 195, 255, 0.12);
  --accent-amber:     #ffb84f;
  --accent-amber-dim: rgba(255, 184, 79, 0.12);
  --accent-red:       #ff4f6b;
  --accent-red-dim:   rgba(255, 79, 107, 0.12);
  --accent-green:     #4fffb0;

  /* Semantic colors */
  --color-good:       #4fffb0;
  --color-warn:       #ffb84f;
  --color-danger:     #ff4f6b;
  --color-info:       #4fc3ff;
  --color-neutral:    #9090a8;

  /* Typography */
  --font-mono:        'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
  --font-sans:        'Inter', 'SF Pro Display', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --text-xs:   0.6875rem;  /* 11px */
  --text-sm:   0.8125rem;  /* 13px */
  --text-base: 0.9375rem;  /* 15px */
  --text-md:   1.0625rem;  /* 17px */
  --text-lg:   1.25rem;    /* 20px */
  --text-xl:   1.5rem;     /* 24px */
  --text-2xl:  2rem;       /* 32px */
  --text-3xl:  2.75rem;    /* 44px */
  --text-4xl:  3.75rem;    /* 60px */
  --text-5xl:  5rem;       /* 80px */

  --weight-regular: 400;
  --weight-medium:  500;
  --weight-semibold: 600;
  --weight-bold:    700;
  --weight-black:   900;

  --leading-tight:  1.1;
  --leading-snug:   1.3;
  --leading-normal: 1.6;
  --leading-loose:  1.8;

  --tracking-tight:  -0.04em;
  --tracking-snug:   -0.02em;
  --tracking-normal: 0;
  --tracking-wide:   0.05em;
  --tracking-wider:  0.1em;
  --tracking-widest: 0.18em;

  /* Spacing */
  --sp-1:   0.25rem;
  --sp-2:   0.5rem;
  --sp-3:   0.75rem;
  --sp-4:   1rem;
  --sp-5:   1.25rem;
  --sp-6:   1.5rem;
  --sp-8:   2rem;
  --sp-10:  2.5rem;
  --sp-12:  3rem;
  --sp-16:  4rem;
  --sp-20:  5rem;
  --sp-24:  6rem;
  --sp-32:  8rem;

  /* Borders */
  --radius-sm:  3px;
  --radius-md:  6px;
  --radius-lg:  10px;
  --radius-xl:  16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.6);
  --shadow-glow-green: 0 0 20px rgba(79, 255, 176, 0.2);
  --shadow-glow-blue:  0 0 20px rgba(79, 195, 255, 0.2);

  /* Transitions */
  --transition-fast:   120ms ease;
  --transition-base:   200ms ease;
  --transition-slow:   350ms ease;
  --transition-spring: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --max-width:      1200px;
  --content-width:  960px;
  --narrow-width:   680px;
  --header-height:  64px;
}

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

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── TYPOGRAPHY ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: var(--weight-black);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
  color: var(--text-primary);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-md); }
h6 { font-size: var(--text-base); }

p {
  line-height: var(--leading-normal);
  color: var(--text-secondary);
}

p + p {
  margin-top: var(--sp-4);
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--text-primary);
}

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

strong {
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.1em 0.35em;
  color: var(--accent-primary);
}

/* ─── MONO UTILITY ───────────────────────────────────────────── */
.mono {
  font-family: var(--font-mono);
  letter-spacing: var(--tracking-normal);
}

/* ─── LISTS ──────────────────────────────────────────────────── */
ul, ol {
  padding-left: var(--sp-5);
}

li {
  line-height: var(--leading-normal);
  color: var(--text-secondary);
}

/* ─── IMAGES ─────────────────────────────────────────────────── */
img, svg {
  display: block;
  max-width: 100%;
}

/* ─── FORM BASE ──────────────────────────────────────────────── */
input, button, select, textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

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

input[type="radio"],
input[type="checkbox"] {
  accent-color: var(--accent-primary);
}

/* ─── FOCUS VISIBLE ──────────────────────────────────────────── */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
}

/* ─── SCROLLBAR ──────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}

/* ─── SELECTION ──────────────────────────────────────────────── */
::selection {
  background: var(--accent-primary-dim);
  color: var(--text-primary);
}

/* ─── LAYOUT CONTAINERS ──────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

.section-inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--sp-20) var(--sp-6);
}

/* ─── UTILITY CLASSES ────────────────────────────────────────── */
.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;
}

.text-accent   { color: var(--accent-primary); }
.text-muted    { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-warn     { color: var(--accent-amber); }
.text-danger   { color: var(--accent-red); }
.text-good     { color: var(--accent-green); }

.text-mono     { font-family: var(--font-mono); }
.text-upper    { text-transform: uppercase; letter-spacing: var(--tracking-widest); }

.hidden        { display: none !important; }
.invisible     { visibility: hidden; }

.flex          { display: flex; }
.flex-col      { display: flex; flex-direction: column; }
.items-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2         { gap: var(--sp-2); }
.gap-4         { gap: var(--sp-4); }
.gap-6         { gap: var(--sp-6); }

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

/* ─── PRINT ──────────────────────────────────────────────────── */
@media print {
  body {
    background: white;
    color: black;
  }

  .site-header,
  .hero-visual,
  .hero-actions,
  .site-footer {
    display: none;
  }
}
