/* ============================================
   Base — Reset & Global Styles
   ============================================ */

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

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

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: 1.7;
  color: var(--text-light);
  background-color: var(--bg-primary);
  overflow-x: hidden;
}

/* ── Canvas Texture Background ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(
    circle,
    var(--canvas-dot-color) var(--canvas-dot-size),
    transparent var(--canvas-dot-size)
  );
  background-size: var(--canvas-dot-spacing) var(--canvas-dot-spacing);
  pointer-events: none;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  line-height: 1.2;
  color: var(--text-light);
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

p {
  margin-bottom: var(--space-md);
  line-height: 1.8;
}

a {
  color: var(--accent-coral);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--accent-coral-light);
}

/* ── Lists ── */
ul, ol {
  list-style: none;
}

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

/* ── Code ── */
code, pre {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
}

pre {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

code {
  background: rgba(255, 255, 255, 0.06);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
}

/* ── Selection ── */
::selection {
  background: var(--accent-coral);
  color: var(--card-bg);
}

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

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

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

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-indigo-light);
}

/* ── Focus States ── */
:focus-visible {
  outline: 2px solid var(--accent-coral);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

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

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.container--narrow {
  max-width: var(--container-narrow);
}
