/* ==================== Codeisa — Base CSS ==================== */
/* Reset + Custom Properties + Typography */

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

:root {
  /* Color Palette */
  --c-bg: #07061a;
  --c-bg-1: #0d0a2b;
  --c-bg-2: #1a0d3d;
  --c-surface: rgba(255,255,255,0.045);
  --c-surface-hover: rgba(255,255,255,0.08);
  --c-surface-2: rgba(255,255,255,0.03);
  --c-text: #f8fafc;
  --c-text-muted: #cbd5e1;
  --c-text-dim: #94a3b8;
  --c-border: rgba(255,255,255,0.10);
  --c-border-strong: rgba(255,255,255,0.18);
  --c-accent: #818cf8;
  --c-accent-2: #c084fc;
  --c-accent-3: #f472b6;
  --c-accent-4: #22d3ee;
  --c-success: #34d399;
  --c-warn: #fbbf24;
  --c-danger: #f87171;
  --c-red: #ef4444;
  --c-green: #22c55e;

  /* Shadows */
  --shadow-soft: 0 6px 20px rgba(0,0,0,0.18);
  --shadow-md: 0 14px 36px rgba(0,0,0,0.32);
  --shadow-lg: 0 22px 60px rgba(0,0,0,0.42);
  --shadow-glow: 0 0 28px rgba(139,92,246,0.22);

  /* Radii */
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* Easing */
  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-bounce: cubic-bezier(.34,1.56,.64,1);

  /* Spacing */
  --sp-xs: 0.25rem;
  --sp-sm: 0.5rem;
  --sp-md: 1rem;
  --sp-lg: 1.5rem;
  --sp-xl: 2rem;
  --sp-2xl: 3rem;

  /* Typography */
  --font-fa: 'Vazirmatn', 'Estedad', system-ui, sans-serif;
  --font-en: 'Inter', 'Manrope', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
  --text-sm: clamp(0.875rem, 1.5vw, 1rem);
  --text-base: clamp(1rem, 2vw, 1.125rem);
  --text-lg: clamp(1.125rem, 2.5vw, 1.5rem);
  --text-xl: clamp(1.5rem, 3vw, 2rem);
  --text-2xl: clamp(2rem, 5vw, 3rem);
}

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

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: var(--c-bg);
  color: var(--c-text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* Aurora background */
body::before {
  content: "";
  position: fixed; inset: 0;
  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, #050414 0%, #0a0a26 50%, #07061a 100%);
  z-index: -1;
  pointer-events: none;
}

/* Aurora spinning overlay */
body::after {
  content: "";
  position: fixed; inset: -20%;
  background: conic-gradient(from 180deg, 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: -1;
}

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

/* Scrollbar */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: rgba(255,255,255,0.03); border-radius: 99px; }
*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(168,85,247,.55), rgba(99,102,241,.45));
  border-radius: 99px;
  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;
}

::selection { background: rgba(168,85,247,.55); color: #fff; }

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

/* Focus visible */
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid rgba(168,85,247,.75);
  outline-offset: 2px;
  border-radius: 10px;
}

/* Links */
a { color: var(--c-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
