/* ========================================
   Encryptiun — Base Reset & CSS Variables
   ======================================== */

/* ---------- CSS Custom Properties ---------- */
:root {
  /* --- Color Tokens (Dark mode default) --- */
  --color-bg: #0d0d0d;
  --color-surface: #161616;
  --color-surface-2: #1e1e1e;
  --color-border: #2d2d2d;
  --color-text: #f4f4f4;
  --color-text-muted: #a8a8a8;
  --color-text-faint: #6f6f6f;
  --color-primary: #0f62fe;
  --color-primary-hover: #0353e9;
  --color-primary-rgb: 15, 98, 254;
  --color-secondary: #4589ff;
  --color-secondary-rgb: 69, 137, 255;
  --color-error: #da1e28;
  --color-success: #24a148;

  /* --- Typography Scale (clamp-based fluid) --- */
  --text-xs: clamp(0.7rem, 0.65rem + 0.25vw, 0.75rem);
  --text-sm: clamp(0.8rem, 0.75rem + 0.25vw, 0.875rem);
  --text-base: clamp(0.95rem, 0.9rem + 0.25vw, 1rem);
  --text-lg: clamp(1.05rem, 1rem + 0.3vw, 1.125rem);
  --text-xl: clamp(1.2rem, 1.1rem + 0.5vw, 1.25rem);
  --text-2xl: clamp(1.4rem, 1.2rem + 1vw, 1.5rem);
  --text-3xl: clamp(1.7rem, 1.4rem + 1.5vw, 1.875rem);
  --text-4xl: clamp(2rem, 1.5rem + 2.5vw, 2.25rem);
  --text-5xl: clamp(2.5rem, 1.8rem + 3.5vw, 3rem);
  --text-hero: clamp(2.8rem, 2rem + 4vw, 4rem);

  /* --- Font Families --- */
  --font-display: 'Cabinet Grotesk', 'Satoshi', sans-serif;
  --font-body: 'Satoshi', sans-serif;

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

  /* --- Layout --- */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
  --content-full: 100%;

  /* --- Radius --- */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* --- Shadows (dark mode) --- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25), 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.3), 0 4px 8px rgba(0, 0, 0, 0.15);

  /* --- Transitions --- */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Light Mode ---------- */
[data-theme="light"] {
  --color-bg: #ffffff;
  --color-surface: #f4f4f4;
  --color-surface-2: #e8e8e8;
  --color-border: #d1d1d1;
  --color-text: #161616;
  --color-text-muted: #525252;
  --color-text-faint: #8d8d8d;
  --color-primary: #0f62fe;
  --color-primary-hover: #0353e9;
  --color-primary-rgb: 15, 98, 254;
  --color-secondary: #4589ff;
  --color-secondary-rgb: 69, 137, 255;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-interactive);
}
a:hover {
  color: var(--color-primary-hover);
}

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

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

ul, ol {
  list-style: none;
}

/* ---------- Focus Visible ---------- */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

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

/* ---------- Skip Link ---------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  padding: var(--space-2) var(--space-4);
  background: var(--color-primary);
  color: var(--color-bg);
  font-weight: 500;
  border-radius: 0;
  z-index: 10000;
  transition: top var(--transition-interactive);
}
.skip-link:focus {
  top: var(--space-4);
}

/* ---------- Selection ---------- */
::selection {
  background: rgba(var(--color-primary-rgb), 0.25);
  color: var(--color-text);
}
