/* ============================================
   Cryptosites.com — Base CSS (Reset + Tokens)
   ============================================ */

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

/* CSS Custom Properties — Design Tokens */
:root {
  /* Typography */
  --font-display: 'Cabinet Grotesk', system-ui, -apple-system, sans-serif;
  --font-body: 'Satoshi', system-ui, -apple-system, sans-serif;

  /* Type Scale (fluid clamp) */
  --text-xs: clamp(0.6875rem, 0.65rem + 0.15vw, 0.75rem);    /* 11-12px */
  --text-sm: clamp(0.8125rem, 0.78rem + 0.15vw, 0.875rem);    /* 13-14px */
  --text-base: clamp(0.9375rem, 0.9rem + 0.2vw, 1rem);        /* 15-16px */
  --text-lg: clamp(1.0625rem, 1rem + 0.3vw, 1.125rem);        /* 17-18px */
  --text-xl: clamp(1.1875rem, 1.1rem + 0.4vw, 1.375rem);      /* 19-22px */
  --text-2xl: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);       /* 22-28px */
  --text-3xl: clamp(1.75rem, 1.4rem + 1.5vw, 2.5rem);         /* 28-40px */
  --text-hero: clamp(2.25rem, 1.6rem + 2.8vw, 3.75rem);       /* 36-60px */

  /* Spacing (4px base) */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows (light mode defaults) */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
  --shadow-xl: 0 12px 50px rgba(0,0,0,0.12);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;

  /* Layout */
  --container-max: 1280px;
  --container-narrow: 960px;
  --container-wide: 1440px;

  /* Z-index scale */
  --z-base: 0;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-toast: 500;
}

/* ============================================
   LIGHT MODE (Default)
   ============================================ */
:root,
[data-theme="light"] {
  --bg-primary: #f8f9fa;
  --bg-surface: #ffffff;
  --bg-surface-2: #f0f2f5;
  --bg-surface-3: #e8eaed;

  --text-primary: #1a1d24;
  --text-secondary: #545964;
  --text-muted: #8b8f99;
  --text-faint: #b5b8c0;

  --accent: #009e80;
  --accent-hover: #008a6e;
  --accent-glow: rgba(0, 158, 128, 0.1);
  --accent-muted: rgba(0, 158, 128, 0.08);

  --secondary: #e5a020;
  --secondary-hover: #d09018;
  --secondary-muted: rgba(229, 160, 32, 0.12);

  --border: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.15);

  --success: #009e80;
  --error: #dc3545;
  --warning: #e5a020;

  --card-bg: #ffffff;
  --card-border: rgba(0, 0, 0, 0.08);
  --card-hover-border: rgba(0, 0, 0, 0.15);

  --nav-bg: rgba(248, 249, 250, 0.9);

  --hero-gradient: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 40%, #f0ecff 70%, #f8f9fa 100%);
  --hero-glow: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(0, 158, 128, 0.06) 0%, transparent 70%);

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
  --shadow-xl: 0 12px 50px rgba(0,0,0,0.12);
}

/* ============================================
   DARK MODE
   ============================================ */
[data-theme="dark"] {
  --bg-primary: #0d0f12;
  --bg-surface: #14161b;
  --bg-surface-2: #1a1d24;
  --bg-surface-3: #21242d;

  --text-primary: #e2e4e9;
  --text-secondary: #8b8f99;
  --text-muted: #4a4e59;
  --text-faint: #363a44;

  --accent: #00d4aa;
  --accent-hover: #00b894;
  --accent-glow: rgba(0, 212, 170, 0.15);
  --accent-muted: rgba(0, 212, 170, 0.1);

  --secondary: #f7b731;
  --secondary-hover: #e5a825;
  --secondary-muted: rgba(247, 183, 49, 0.15);

  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);

  --success: #00d4aa;
  --error: #ff5757;
  --warning: #f7b731;

  --card-bg: rgba(20, 22, 27, 0.8);
  --card-border: rgba(255, 255, 255, 0.06);
  --card-hover-border: rgba(255, 255, 255, 0.12);

  --nav-bg: rgba(13, 15, 18, 0.85);

  --hero-gradient: linear-gradient(135deg, #0d0f12 0%, #141a2e 40%, #1a1230 70%, #0d0f12 100%);
  --hero-glow: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(0, 212, 170, 0.08) 0%, transparent 70%);

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
  --shadow-xl: 0 12px 50px rgba(0,0,0,0.6);
}

/* ============================================
   Base Element Styles
   ============================================ */
html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  min-height: 100vh;
  transition: background-color var(--duration-normal) var(--ease-out),
              color var(--duration-normal) var(--ease-out);
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  padding: var(--space-2) var(--space-4);
  background: var(--accent);
  color: var(--bg-primary);
  border-radius: var(--radius-sm);
  z-index: var(--z-toast);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus {
  top: var(--space-4);
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: 1.2;
  font-weight: 700;
  color: var(--text-primary);
}

h1 { font-size: var(--text-hero); letter-spacing: -0.02em; }
h2 { font-size: var(--text-3xl); letter-spacing: -0.015em; }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); font-weight: 600; }

/* Links */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}
a:hover { color: var(--accent-hover); }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Images */
img, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Lists */
ul, ol { list-style: none; }

/* Buttons */
button {
  cursor: pointer;
  font-family: var(--font-body);
  font-size: inherit;
  border: none;
  background: none;
  color: inherit;
}
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Inputs */
input, textarea, select {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  transition: border-color var(--duration-fast) var(--ease-out);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Table reset */
table {
  border-collapse: collapse;
  width: 100%;
}

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

/* Scrollbar (subtle) */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* 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;
  }
}
