/* ==========================================================================
   TotumVault Official Website — Main Design System & Base Tokens
   Theme: Deep Purple + White with Emerald Green Identity
   ========================================================================== */

:root {
  /* Brand Purple Palette */
  --purple-50: #faf5ff;
  --purple-100: #f3e8ff;
  --purple-200: #e9d5ff;
  --purple-300: #d8b4fe;
  --purple-400: #c084fc;
  --purple-500: #a855f7;
  --purple-600: #9333ea;
  --purple-700: #7e22ce;
  --purple-800: #6b21a8;
  --purple-900: #581c87;
  --purple-950: #3b0764;

  /* Emerald Identity Palette (Logo & Security Accents) */
  --emerald-300: #6ee7b7;
  --emerald-400: #34d399;
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --emerald-700: #047857;
  --emerald-800: #064e3b;
  --emerald-900: #022c22;
  --emerald-glow: rgba(16, 185, 129, 0.22);

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

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

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 240ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 380ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme (Crisp white background + deep purple buttons & dark purple text) */
:root[data-theme="light"],
:root {
  --bg-page: #ffffff;
  --bg-surface: #faf8ff;
  --bg-surface-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f5f2fe;
  --bg-subtle: #f3effe;
  --bg-muted: #e9e3f8;

  --border-light: rgba(91, 33, 182, 0.08);
  --border-medium: rgba(91, 33, 182, 0.14);
  --border-focus: #6d28d9;

  --text-main: #190e2e;
  --text-muted: #54466d;
  --text-dim: #8b7ca8;
  --text-inverse: #ffffff;

  --nav-bg: rgba(255, 255, 255, 0.9);
  --nav-border: rgba(91, 33, 182, 0.08);

  --brand-primary: #5b21b6;
  --brand-hover: #4c1d95;
  --brand-active: #3b0764;
  --brand-glow: rgba(91, 33, 182, 0.2);
  --brand-subtle: #f3e8ff;
  --brand-text: #5b21b6;

  /* Aliases for backwards compatibility */
  --blue-accent: var(--brand-primary);
  --blue-hover: var(--brand-hover);
  --blue-glow: var(--brand-glow);
  --blue-50: var(--brand-subtle);
  --blue-600: var(--brand-text);
  --shadow-blue: var(--shadow-purple);

  --shadow-sm: 0 1px 2px 0 rgba(25, 14, 46, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(25, 14, 46, 0.06), 0 2px 4px -2px rgba(25, 14, 46, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(25, 14, 46, 0.07), 0 4px 6px -4px rgba(25, 14, 46, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(25, 14, 46, 0.09), 0 8px 10px -6px rgba(25, 14, 46, 0.04);
  --shadow-purple: 0 10px 30px -5px rgba(91, 33, 182, 0.22);

  --badge-bg: #f3e8ff;
  --badge-text: #5b21b6;
  --badge-border: #ddd6fe;

  --code-bg: #f5f3ff;
  --code-text: #190e2e;
}

/* Dark Theme (Near-black deep violet + dark purple cards + rich violet buttons) */
:root[data-theme="dark"] {
  --bg-page: #0a0614;
  --bg-surface: #100b21;
  --bg-surface-elevated: #181131;
  --bg-card: #140d2a;
  --bg-card-hover: #1c133a;
  --bg-subtle: #191033;
  --bg-muted: #241747;

  --border-light: rgba(192, 132, 252, 0.09);
  --border-medium: rgba(192, 132, 252, 0.16);
  --border-focus: #a855f7;

  --text-main: #f8fafc;
  --text-muted: #c4b5fd;
  --text-dim: #8b7ca8;
  --text-inverse: #0a0614;

  --nav-bg: rgba(10, 6, 20, 0.9);
  --nav-border: rgba(192, 132, 252, 0.1);

  --brand-primary: #7c3aed;
  --brand-hover: #6d28d9;
  --brand-active: #5b21b6;
  --brand-glow: rgba(124, 58, 237, 0.28);
  --brand-subtle: rgba(124, 58, 237, 0.15);
  --brand-text: #c4b5fd;

  --blue-accent: var(--brand-primary);
  --blue-hover: var(--brand-hover);
  --blue-glow: var(--brand-glow);
  --blue-50: rgba(124, 58, 237, 0.15);
  --blue-600: #c4b5fd;
  --shadow-blue: var(--shadow-purple);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.55), 0 2px 4px -2px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.65), 0 4px 6px -4px rgba(0, 0, 0, 0.45);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.75), 0 8px 10px -6px rgba(0, 0, 0, 0.55);
  --shadow-purple: 0 10px 30px -5px rgba(124, 58, 237, 0.32);

  --badge-bg: rgba(124, 58, 237, 0.18);
  --badge-text: #ddd6fe;
  --badge-border: rgba(167, 139, 250, 0.3);

  --code-bg: #120b22;
  --code-text: #e9d5ff;
}

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

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color var(--transition-base), color var(--transition-base);
}

/* Global Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.2;
}

h1 {
  font-size: clamp(2.5rem, 5.5vw, 4.25rem);
  letter-spacing: -0.035em;
  line-height: 1.1;
}

h2 {
  font-size: clamp(1.85rem, 3.8vw, 2.75rem);
  letter-spacing: -0.03em;
  line-height: 1.18;
}

h3 {
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  letter-spacing: -0.02em;
}

p {
  color: var(--text-muted);
  font-size: 1.0625rem;
  line-height: 1.65;
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

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

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1220px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.section {
  padding-top: 6.5rem;
  padding-bottom: 6.5rem;
  position: relative;
}

.section-header {
  text-align: center;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 3.5rem;
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: var(--radius-full);
  background-color: var(--badge-bg);
  color: var(--badge-text);
  border: 1px solid var(--badge-border);
  margin-bottom: 1rem;
}

.section-title {
  margin-bottom: 1rem;
}

.section-desc {
  font-size: 1.125rem;
  color: var(--text-muted);
}

/* Base Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.btn-primary {
  background-color: var(--brand-primary);
  color: #ffffff;
  box-shadow: 0 2px 6px var(--brand-glow);
}

.btn-primary:hover {
  background-color: var(--brand-hover);
  color: #ffffff;
  box-shadow: 0 4px 16px var(--brand-glow);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background-color: var(--bg-surface-elevated);
  color: var(--text-main);
  border: 1px solid var(--border-medium);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background-color: var(--bg-subtle);
  border-color: var(--border-focus);
  color: var(--text-main);
  transform: translateY(-1px);
}

.btn-subtle {
  background-color: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
}

.btn-subtle:hover {
  background-color: var(--bg-subtle);
  color: var(--text-main);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
}

/* Badge Component */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  background-color: var(--badge-bg);
  color: var(--badge-text);
  border: 1px solid var(--badge-border);
}

.badge-success {
  background-color: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.3);
}

/* Accessible focus ring */
:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* Respect user's motion preference */
@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;
  }
}
