/* ═══════════════════════════════════════════════════════════
   BASE STYLES — Reset, Typography, Utilities
   ═══════════════════════════════════════════════════════════ */

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  height: 100%;
  background: var(--bg-deepest);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  overflow: hidden;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

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

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

/* ── Links ── */
a {
  color: var(--accent-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ── Buttons ── */
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  outline: none;
}

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

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

/* ── Selection ── */
::selection {
  background: var(--accent-glow-strong);
  color: var(--text-primary);
}

/* ── Utility Classes ── */
.font-mono {
  font-family: var(--font-mono);
}

.font-display {
  font-family: var(--font-display);
}

.text-xs     { font-size: var(--text-xs); }
.text-sm     { font-size: var(--text-sm); }
.text-base   { font-size: var(--text-base); }
.text-md     { font-size: var(--text-md); }
.text-lg     { font-size: var(--text-lg); }

.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }

.text-accent { color: var(--accent-primary); }
.text-red    { color: var(--semantic-red); }
.text-green  { color: var(--semantic-green); }
.text-amber  { color: var(--semantic-amber); }
.text-blue   { color: var(--semantic-blue); }

.uppercase {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tracking-wide {
  letter-spacing: 0.1em;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Glass Surface ── */
.glass {
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-default);
}

.glass-strong {
  background: var(--surface-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-strong);
}

/* ── Visually Hidden (accessible) ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ── Mobile Touch Optimizations ── */
@media (max-width: 767px) {
  button, a, [role="button"] {
    -webkit-tap-highlight-color: transparent;
  }

  input, select, textarea {
    font-size: 16px;
  }
}

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