/* ============================================================================
   axiaMail — core.css
   Design system tokens, reset, base typography.
   Dark-first premium futurist.
   ============================================================================ */

:root {
  /* Backgrounds */
  --bg-0: #07090d;
  --bg-1: #0d1117;
  --bg-2: #141a24;
  --bg-3: #1a2230;
  --glass-bg: rgba(20, 26, 36, 0.55);
  --glass-border: rgba(120, 160, 220, 0.12);
  --glass-blur: blur(18px) saturate(140%);

  /* Text */
  --text-0: #e9f0fa;
  --text-1: #9aa7bd;
  --text-2: #5a6578;
  --text-3: #3a4252;

  /* Accents */
  --accent: #7cf9ff;
  --accent-2: #b48cff;
  --accent-3: #6cffb8;
  --accent-glow: rgba(124, 249, 255, 0.35);
  --accent-glow-soft: rgba(124, 249, 255, 0.12);

  /* Status */
  --success: #6cffb8;
  --warning: #ffc857;
  --danger: #ff5d73;
  --info: #7cf9ff;

  /* Borders & surfaces */
  --border: rgba(120, 160, 220, 0.12);
  --border-strong: rgba(120, 160, 220, 0.22);
  --shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 20px 60px -16px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 0 1px var(--glass-border), 0 8px 40px -12px var(--accent-glow-soft);
  --shadow-glow-strong: 0 0 0 1px var(--accent-glow), 0 0 32px -8px var(--accent-glow);

  /* Radii */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Spacing scale (multiplu de 4) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;

  /* Fonts */
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* Type scale */
  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-base: 0.9375rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-2xl: 1.75rem;
  --fs-3xl: 2.25rem;
  --fs-display: 3rem;

  /* Tracking */
  --tracking-tight: -0.02em;
  --tracking-tighter: -0.035em;
  --tracking-wide: 0.04em;

  /* Motion */
  --ease: cubic-bezier(0.4, 0.0, 0.2, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-1: 120ms;
  --dur-2: 200ms;
  --dur-3: 320ms;
  --dur-4: 500ms;

  /* Z-index */
  --z-nav: 10;
  --z-overlay: 50;
  --z-modal: 100;
  --z-toast: 200;
  --z-palette: 300;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  color-scheme: dark;
}
body {
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  line-height: 1.5;
  color: var(--text-0);
  background: var(--bg-0);
  min-height: 100vh;
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; background: none; border: none; }
a { color: inherit; text-decoration: none; }
ol, ul { list-style: none; }
table { border-collapse: collapse; border-spacing: 0; }

/* ---------- Background — ambient futurist ---------- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% -10%, rgba(124, 249, 255, 0.08), transparent 60%),
    radial-gradient(ellipse 40% 40% at 100% 100%, rgba(180, 140, 255, 0.06), transparent 60%),
    radial-gradient(ellipse 40% 40% at 0% 100%, rgba(108, 255, 184, 0.04), transparent 60%);
  z-index: -2;
  pointer-events: none;
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(120, 160, 220, 0.08) 1px, transparent 0);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black, transparent);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black, transparent);
  z-index: -1;
  pointer-events: none;
  opacity: 0.6;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 { font-weight: 600; letter-spacing: var(--tracking-tight); }
h1 { font-size: var(--fs-3xl); letter-spacing: var(--tracking-tighter); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

.mono, code, kbd, pre {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.tabular { font-variant-numeric: tabular-nums; }

.muted { color: var(--text-1); }
.dim   { color: var(--text-2); }

/* ---------- Selection ---------- */
::selection { background: var(--accent-glow); color: var(--bg-0); }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(120, 160, 220, 0.15);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-0);
}
::-webkit-scrollbar-thumb:hover { background: rgba(120, 160, 220, 0.3); }

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

/* ---------- Skip-link (a11y) ---------- */
.skip-link {
  position: absolute;
  top: -40px;
  left: 8px;
  background: var(--bg-2);
  color: var(--accent);
  padding: var(--s-2) var(--s-4);
  border-radius: var(--radius-sm);
  z-index: var(--z-palette);
  transition: top var(--dur-2) var(--ease);
}
.skip-link:focus { top: 8px; }

/* ---------- Fonts (loaded locally) ---------- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/Inter-Variable.woff2') format('woff2-variations');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/JetBrainsMono-Variable.woff2') format('woff2-variations');
}

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