/* =========================================================
   Altacore Audio — base.css
   Design tokens, reset, typography, shared components.
   Loaded on every page before page-specific styles.
   ========================================================= */

:root {
  --bg: #FFFFFF;
  --bg-raised: #FAFBFC;
  --bg-side: #F5F7FA;
  --ink: #1A1D23;
  --ink-soft: #5F6B7A;
  --ink-faint: #9AA5B4;
  --accent: #2563EB;
  --accent-hover: #1D4ED8;
  --accent-ink: #1E40AF;
  --accent-soft: #EFF6FF;
  --noise: #C7CED4;
  --line: #E8ECF0;
  --card-bg: #FFFFFF;
  --track: #F1F3F5;
  --pill-bg: #1A1D23;
  --pill-fg: #FFFFFF;
  --success: #16A34A;
  --success-soft: #F0FDF4;
  --error: #DC2626;
  --error-soft: #FEF2F2;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.08);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark mode — only when explicitly set: <html data-theme="dark"> */
:root[data-theme="dark"] {
  --bg: #0A0F1A;
  --bg-raised: #111827;
  --bg-side: #111827;
  --ink: #F1F5F9;
  --ink-soft: #94A3B8;
  --ink-faint: #64748B;
  --accent: #3B82F6;
  --accent-hover: #60A5FA;
  --accent-ink: #93C5FD;
  --accent-soft: #1E3A5F;
  --line: #1E293B;
  --card-bg: #111827;
  --track: #1E293B;
  --pill-bg: #F1F5F9;
  --pill-fg: #0A0F1A;
  --success: #22C55E;
  --success-soft: #052E16;
  --error: #EF4444;
  --error-soft: #450A0A;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, .display {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
  line-height: 1.15;
}

a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* Container */
.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 32px;
}

@media (max-width: 640px) {
  .wrap { padding: 0 20px; }
}

/* Screen reader only */
.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;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
  color: var(--ink);
}
.logo svg { width: 26px; height: 26px; flex-shrink: 0; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s var(--ease);
}

.btn-primary {
  background: var(--accent);
  color: #FFFFFF;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-ghost {
  color: var(--ink-soft);
  background: none;
  border: none;
  padding: 12px 20px;
}
.btn-ghost:hover { color: var(--ink); background: var(--bg-raised); }

.btn-outline {
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--line);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* Hamburger */
.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s var(--ease);
}
.menu-toggle:hover { border-color: var(--accent); }
.menu-toggle svg { width: 20px; height: 20px; }

/* Mobile nav */
.mobile-nav {
  display: none;
  flex-direction: column;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.mobile-nav.is-open { display: flex; }
.mobile-nav a {
  padding: 14px 20px;
  color: var(--ink-soft);
  font-size: 15px;
  border-top: 1px solid var(--line);
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.mobile-nav a:first-child { border-top: none; }
.mobile-nav a:hover { color: var(--ink); background: var(--bg-raised); }

/* Shared dot indicator */
.dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.dot::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
}

/* Shared play button */
.play-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s var(--ease), opacity 0.15s var(--ease);
}
.play-btn:hover { transform: scale(1.08); }
.play-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* Pill badge */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  border: none;
}
.pill-outline {
  border: 1.5px solid var(--line);
  color: var(--ink-soft);
  background: var(--bg);
}
.pill-accent {
  background: var(--accent);
  color: #FFFFFF;
}

/* Selection */
::selection {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
