/**
 * ============================================================
 *  base.css — Design Tokens, Reset & Typography
 * ============================================================
 *  Establishes the global design system: colors, fonts, spacing,
 *  and a modern CSS reset so every component starts clean.
 * ============================================================
 */

/* ── Fonts ────────────────────────────────────────────────── */
/* Using system SF Pro stack for premium native feel */

/* ── CSS Custom Properties (Design Tokens) ────────────────── */
:root {
  /* Primary Palette */
  --color-primary:        #0d9488;       /* Teal 600        */
  --color-primary-light:  #14b8a6;       /* Teal 500        */
  --color-primary-dark:   #0f766e;       /* Teal 700        */

  /* Accent */
  --color-accent:         #f59e0b;       /* Gold / Amber    */
  --color-accent-light:   #fbbf24;

  /* Background Gradient */
  --color-bg-start:       #0f172a;       /* Slate 900       */
  --color-bg-mid:         #1e1b4b;       /* Indigo 950      */
  --color-bg-end:         #0c1631;       /* Deep Blue       */

  /* Surface (glassmorphism layers) */
  --color-surface:        rgba(255, 255, 255, 0.06);
  --color-surface-hover:  rgba(255, 255, 255, 0.10);
  --color-surface-border: rgba(255, 255, 255, 0.12);

  /* Text */
  --color-text:           #f1f5f9;       /* Slate 100       */
  --color-text-muted:     #94a3b8;       /* Slate 400       */
  --color-text-heading:   #ffffff;

  /* Result card accent colors */
  --color-dos:            #22c55e;       /* Green 500       */
  --color-dos-bg:         rgba(34, 197, 94, 0.10);
  --color-donts:          #ef4444;       /* Red 500         */
  --color-donts-bg:       rgba(239, 68, 68, 0.10);
  --color-mistakes:       #f59e0b;       /* Amber 500       */
  --color-mistakes-bg:    rgba(245, 158, 11, 0.10);
  --color-sensitive:      #a855f7;       /* Purple 500      */
  --color-sensitive-bg:   rgba(168, 85, 247, 0.10);

  /* Typography — SF Pro system stack */
  --font-heading:  "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-body:     "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

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

  /* Border Radius */
  --radius-sm:  0.5rem;
  --radius-md:  0.75rem;
  --radius-lg:  1rem;
  --radius-xl:  1.25rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-card:  0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-glow:  0 0 30px rgba(13, 148, 136, 0.25);

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-normal: 300ms ease;
  --transition-slow:   500ms ease;
}

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

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

body {
  font-family: var(--font-body);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;

  /* Deep-blue gradient background */
  background: linear-gradient(
    135deg,
    var(--color-bg-start) 0%,
    var(--color-bg-mid)   50%,
    var(--color-bg-end)   100%
  );
  background-size: 400% 400%;
  background-attachment: fixed;
}

/* Animated gradient movement (activated by background.js) */
body.bg-animated {
  animation: gradientShift 12s ease infinite;
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  25%  { background-position: 100% 50%; }
  50%  { background-position: 100% 0%; }
  75%  { background-position: 0% 100%; }
  100% { background-position: 0% 50%; }
}

/* ── Custom Cursor Styles ─────────────────────────────────── */
body.custom-cursor-active,
body.custom-cursor-active * {
  cursor: none !important;
}

.custom-cursor {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease, background 0.3s ease, opacity 0.3s ease;
}

.custom-cursor--outer {
  width: 36px;
  height: 36px;
  border: 1.5px solid rgba(20, 184, 166, 0.5);
  background: rgba(20, 184, 166, 0.04);
}

.custom-cursor--inner {
  width: 6px;
  height: 6px;
  background: var(--color-primary-light);
  box-shadow: 0 0 10px rgba(20, 184, 166, 0.6);
}

.custom-cursor--hover.custom-cursor--outer {
  width: 56px;
  height: 56px;
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.06);
}

.custom-cursor--hover.custom-cursor--inner {
  background: var(--color-accent);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.6);
}

.custom-cursor--pressed.custom-cursor--outer {
  width: 28px;
  height: 28px;
}

@media (hover: none), (pointer: coarse) {
  .custom-cursor { display: none !important; }
  body.custom-cursor-active,
  body.custom-cursor-active * { cursor: auto !important; }
}

/* ── Typography ───────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-text-heading);
  line-height: 1.2;
}

a {
  color: var(--color-primary-light);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

img {
  max-width: 100%;
  display: block;
}

ul, ol {
  list-style: none;
}

button {
  font-family: var(--font-heading);
  cursor: pointer;
  border: none;
  outline: none;
}

select {
  font-family: var(--font-body);
}

/* ── Utility: Screen-reader only ──────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
