/* ========================================
   Base & Reset — Lunati
   ======================================== */

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

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

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: var(--leading-base);
  letter-spacing: -0.01em;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  transition: background var(--duration-normal) var(--ease-in-out),
    color var(--duration-normal) var(--ease-in-out);
}

body::before {
  content: '';
  position: fixed;
  inset: -20%;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(circle at 16% 10%, rgba(215, 180, 106, 0.10), transparent 24%),
    radial-gradient(circle at 86% 18%, rgba(122, 162, 199, 0.08), transparent 26%),
    linear-gradient(180deg, #0b0d12 0%, #111219 48%, #0b0d12 100%);
}

[data-theme="light"] body::before {
  background:
    linear-gradient(180deg, #f4efe6 0%, #ece5d8 52%, #f7f3eb 100%);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(#000, transparent 82%);
}

[data-theme="light"] body::after {
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.015) 1px, transparent 1px);
}

a {
  color: inherit;
  text-decoration: none;
}

img,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

input,
textarea {
  font-family: inherit;
  outline: none;
  border: none;
}

ul,
ol {
  list-style: none;
}

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

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

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

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

/* Selection */
::selection {
  background: var(--accent);
  color: #111219;
}

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