/* === Base Reset & Body === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg-deep);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html[lang="fa"] body, html[lang="fa"] * { font-family: var(--font-fa); }
html[lang="en"] body, html[lang="en"] * { font-family: var(--font-en); letter-spacing: -0.005em; }

/* Body background with aurora */
body {
  position: relative;
  background:
    radial-gradient(1300px 800px at 12% -8%, rgba(99, 102, 241, 0.30), transparent 60%),
    radial-gradient(1000px 700px at 92% 0%, rgba(168, 85, 247, 0.25), transparent 60%),
    radial-gradient(900px 700px at 50% 110%, rgba(236, 72, 153, 0.20), transparent 60%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-mid) 50%, var(--bg-deep) 100%) !important;
  background-attachment: fixed;
}

body::after {
  content: "";
  position: fixed;
  inset: -20%;
  background: conic-gradient(from 180deg at 50% 50%, rgba(99,102,241,0.06), rgba(168,85,247,0.05), rgba(236,72,153,0.04), rgba(99,102,241,0.06));
  filter: blur(90px);
  opacity: 0.55;
  pointer-events: none;
  animation: aurora-spin 30s linear infinite;
  z-index: 0;
}

@keyframes aurora-spin { to { transform: rotate(360deg); } }

/* Selection */
::selection { background: rgba(168, 85, 247, 0.55); color: #fff; }

/* Focus visible */
:focus-visible {
  outline: 2px solid rgba(168, 85, 247, 0.75);
  outline-offset: 2px;
  border-radius: 10px;
}

/* Scrollbar */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: rgba(255,255,255,0.03); border-radius: 999px; }
*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(168,85,247,.55), rgba(99,102,241,.45));
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(168,85,247,.85), rgba(99,102,241,.75));
  background-clip: padding-box;
}

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

/* Utility */
.hidden { display: none !important; }
.mono { font-variant-numeric: tabular-nums; }
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }
