/**
 * Base Styles & Resets
 */

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

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

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: var(--line-height-normal);
  letter-spacing: var(--letter-spacing-normal);
  overflow-x: hidden;
}

/* ── Typography Base ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-tight);
  line-height: var(--line-height-tight);
}

h1 {
  font-size: var(--text-4xl);
  text-wrap: balance;
}

h2 {
  font-size: var(--text-3xl);
  text-wrap: balance;
}

h3 {
  font-size: var(--text-lg);
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

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

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

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* ── Selection ── */
::selection {
  background: rgba(45, 91, 255, 0.15);
  color: inherit;
}

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

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

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 3px;
}

@media (prefers-color-scheme: dark) {
  ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
  }
}

/* ── Focus Styles ── */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Background Mesh ── */
.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.bg-mesh::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 20% 20%, rgba(45, 91, 255, 0.04) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(91, 127, 255, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse 60% 60% at 50% 50%, rgba(45, 91, 255, 0.02) 0%, transparent 70%);
}

.bg-mesh::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
  opacity: 0.015;
}

/* ── Skip Link ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  padding: var(--space-3) var(--space-6);
  background: var(--color-accent);
  color: white;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  transition: top var(--duration-normal) var(--ease);
}

.skip-link:focus {
  top: 1rem;
}
