/* ============================================================
   SECURESTACK — Design System & Global Styles
   ============================================================ */

/* ---------- CSS Custom Properties (Design Tokens) ---------- */
:root {
  /* Colors — Brand */
  --brand-green: #020533;
  --brand-green-accent: #0a0e4a;
  --brand-green-dim: rgba(2, 5, 51, 0.15);
  --brand-green-glow: rgba(2, 5, 51, 0.25);

  /* Colors — Surfaces */
  --bg-dark: #FFFFFF;
  --surface: #F7F7F8;
  --surface-alt: #EFEFEF;
  --surface-hover: #E5E5E5;
  --border: #D1D5DB;
  --border-light: #E5E7EB;

  /* Colors — Text */
  --text-primary: #111827;
  --text-secondary: #4B5563;
  --text-muted: #6B7280;

  /* Colors — Status */
  --danger: #F87171;
  --warning: #FBBF24;
  --info: #60A5FA;

  /* Typography */
  --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

  /* Spacing Scale */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;

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

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-glow: none;
  --shadow-glow-strong: none;

  /* Layout */
  --max-width: 1200px;
  --navbar-height: 72px;
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
}

/* ---------- Dark Theme (Design Tokens) ---------- */
[data-theme="dark"] {
  /* Colors — Brand Accent in Dark Mode */
  --brand-green: #A9EAFF;
  --brand-green-accent: #F8FAFC;
  --brand-green-dim: rgba(248, 250, 252, 0.1);
  --brand-green-glow: rgba(248, 250, 252, 0.2);

  /* Colors — Surfaces */
  --bg-dark: #0A0D14;
  --surface: #111726;
  --surface-alt: #1B2338;
  --surface-hover: #26334D;
  --border: #26334D;
  --border-light: #1B2338;

  /* Colors — Text */
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;

  /* Status */
  --danger: #F87171;
  --warning: #FBBF24;
  --info: #A9EAFF;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.55);
}

/* ---------- Theme Logo Toggle ---------- */
.logo-light {
  display: inline-block;
}
.logo-dark {
  display: none !important;
}

[data-theme="dark"] .logo-light {
  display: none !important;
}
[data-theme="dark"] .logo-dark {
  display: inline-block !important;
}

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

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

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-dark);
  overflow-x: hidden;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

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

h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }

p {
  color: var(--text-secondary);
  line-height: 1.7;
}

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

code, pre {
  font-family: var(--font-mono);
}

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

ul, ol {
  list-style: none;
}

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

input, textarea, select {
  font-family: var(--font-body);
  outline: none;
}

/* ---------- Layout Utilities ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.section {
  padding: 120px 0;
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.grid {
  display: grid;
}

/* ---------- Background Textures ---------- */
.grid-bg {
  background-image:
    radial-gradient(circle at 1px 1px, rgba(0, 0, 0, 0.03) 1px, transparent 0);
  background-size: 32px 32px;
}

.dot-bg {
  background-image:
    radial-gradient(circle, rgba(2, 5, 51, 0.06) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* ---------- Glow Effects ---------- */
.glow {
  box-shadow: var(--shadow-glow);
}

.glow-strong {
  box-shadow: var(--shadow-glow-strong);
}

.glow-text {
  text-shadow: 0 0 20px rgba(2, 5, 51, 0.3);
}

/* ---------- Glass Effect ---------- */
.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
}

/* ---------- Section Headers ---------- */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand-green);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: var(--space-md);
}

.section-label::before {
  content: '';
  width: 24px;
  height: 2px;
  background: var(--brand-green);
  border-radius: var(--radius-full);
}

.section-title {
  margin-bottom: var(--space-md);
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 640px;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-4xl);
}

.section-header .section-subtitle {
  margin: 0 auto;
}

/* ---------- Keyframe Animations ---------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes glowPulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes testimonialMarquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-33.33%); }
}

@keyframes countUp {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate(-10deg) scale(0.9);
  }
  to {
    opacity: 1;
    transform: rotate(0) scale(1);
  }
}

@keyframes progressFill {
  from { width: 0%; }
}

/* ---------- Scroll Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-md);
  }
  .section {
    padding: var(--space-3xl) 0;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 15px;
  }
}

/* ---------- Selection ---------- */
::selection {
  background: rgba(2, 5, 51, 0.3);
  color: #FFFFFF;
}

/* ---------- Focus visible ---------- */
:focus-visible {
  outline: 2px solid var(--brand-green);
  outline-offset: 2px;
}
