/* ==========================================================================
   TENSORFACT DESIGN SYSTEM (style.css)
   Next-Gen AI Compute & Model Context Protocol (MCP) Cloud
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-primary: #060913;
  --bg-secondary: #0A0F1D;
  --bg-card: rgba(13, 21, 43, 0.75);
  --bg-card-hover: rgba(19, 31, 64, 0.9);
  --bg-glass: rgba(11, 19, 43, 0.7);
  --bg-glass-strong: rgba(6, 9, 19, 0.95);
  --bg-input: #0B1224;
  --bg-code: #050811;

  /* Neon Accents */
  --accent-cyan: #00F0FF;
  --accent-purple: #7000FF;
  --accent-pink: #FF007A;
  --accent-indigo: #6366F1;
  --accent-emerald: #10B981;
  --accent-amber: #F59E0B;
  --accent-blue: #38BDF8;

  /* Gradients */
  --grad-primary: linear-gradient(135deg, #00F0FF 0%, #7000FF 50%, #FF007A 100%);
  --grad-cyan-blue: linear-gradient(135deg, #00F0FF 0%, #3B82F6 100%);
  --grad-purple-pink: linear-gradient(135deg, #A855F7 0%, #EC4899 100%);
  --grad-emerald-cyan: linear-gradient(135deg, #10B981 0%, #06B6D4 100%);
  --grad-dark-card: linear-gradient(180deg, rgba(20, 30, 60, 0.75) 0%, rgba(9, 14, 29, 0.9) 100%);

  /* Text Colors */
  --text-primary: #FFFFFF;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --text-accent: #00F0FF;

  /* Borders & Shadows */
  --border-subtle: rgba(148, 163, 184, 0.14);
  --border-glow: rgba(0, 240, 255, 0.35);
  --border-purple-glow: rgba(168, 85, 247, 0.35);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.7);
  --shadow-neon-cyan: 0 0 25px rgba(0, 240, 255, 0.25);
  --shadow-neon-purple: 0 0 25px rgba(112, 0, 255, 0.25);

  /* Fonts */
  --font-heading: 'Space Grotesk', -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', 'Courier New', monospace;

  /* Spacing & Layout */
  --max-width: 1280px;
  --max-width-wide: 1440px;
  --header-height: 76px;
  --header-height-mobile: 66px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-secondary);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

body.mobile-nav-open {
  overflow: hidden;
  touch-action: none;
}

/* Background Atmospheric Gradient Mesh */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(112, 0, 255, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 60%, rgba(0, 240, 255, 0.1) 0%, transparent 45%),
    radial-gradient(circle at 50% 90%, rgba(255, 0, 122, 0.08) 0%, transparent 40%),
    linear-gradient(to right, rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 48px 48px, 48px 48px;
  pointer-events: none;
  z-index: 0;
}

/* Typography with Fluid clamp() */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 5.5vw, 4rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 4vw, 2.6rem); }
h3 { font-size: clamp(1.25rem, 2.8vw, 1.75rem); }
h4 { font-size: clamp(1.05rem, 2vw, 1.25rem); font-weight: 600; }
h5 { font-size: 1.05rem; }
h6 { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.08em; }

p {
  margin-bottom: 1.2rem;
  font-size: clamp(0.95rem, 1.8vw, 1.05rem);
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: var(--transition);
  touch-action: manipulation;
}

a:hover {
  color: #FFFFFF;
}

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

/* Inputs & Form Controls */
input, select, textarea, button {
  font-family: inherit;
  font-size: 1rem;
}

/* Containers */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(1rem, 3vw, 1.5rem);
  padding-right: clamp(1rem, 3vw, 1.5rem);
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  overflow-x: clip;
}

.container-wide {
  max-width: var(--max-width-wide);
}

/* Text Gradients */
.text-gradient {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.text-gradient-cyan {
  background: var(--grad-cyan-blue);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.text-gradient-purple {
  background: var(--grad-purple-pink);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.text-gradient-emerald {
  background: var(--grad-emerald-cyan);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-white { color: #FFFFFF; }
.font-mono { font-family: var(--font-mono); }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: clamp(0.72rem, 1.5vw, 0.8rem);
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.3);
  color: var(--accent-cyan);
  margin-bottom: 1.25rem;
  backdrop-filter: blur(8px);
  max-width: 100%;
}

.badge-purple {
  background: rgba(168, 85, 247, 0.12);
  border-color: rgba(168, 85, 247, 0.35);
  color: #C084FC;
}

.badge-emerald {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34D399;
}

.badge-pink {
  background: rgba(244, 114, 182, 0.12);
  border-color: rgba(244, 114, 182, 0.35);
  color: #F472B6;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  flex-shrink: 0;
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

/* Touch Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 44px;
  padding: 0.8rem 1.6rem;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  text-decoration: none;
  touch-action: manipulation;
  user-select: none;
}

.btn-primary {
  background: var(--grad-primary);
  color: #FFFFFF;
  box-shadow: 0 4px 20px rgba(0, 240, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 240, 255, 0.5);
  color: #FFFFFF;
}

.btn-secondary {
  background: rgba(19, 31, 64, 0.8);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: #FFFFFF;
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(30, 48, 96, 0.9);
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
  box-shadow: var(--shadow-neon-cyan);
  color: #FFFFFF;
}

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

.btn-outline:hover {
  border-color: var(--text-primary);
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.05);
}

.btn-sm {
  min-height: 38px;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
}

.btn-lg {
  min-height: 52px;
  padding: 1rem 2.2rem;
  font-size: 1.05rem;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
}

@media (max-width: 576px) {
  .btn-group {
    flex-direction: column;
    width: 100%;
  }
  .btn-group .btn {
    width: 100%;
  }
}

/* Glassmorphic Cards */
.glass-card {
  background: var(--grad-dark-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3.5vw, 2.5rem);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.glass-card:hover {
  border-color: var(--border-glow);
}

/* Grids & Hero Grids - ALWAYS DEFLATE & SAFE ON MOBILE */
.grid, .hero-grid, .stats-grid, .footer-grid, .docs-layout, .admin-layout {
  min-width: 0;
  max-width: 100%;
}

.grid > *,
.hero-grid > *,
.stats-grid > *,
.footer-grid > *,
.docs-layout > *,
.admin-layout > * {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid { gap: 1.25rem; }
}

/* Section Spacing */
.section {
  padding: clamp(3.5rem, 7vw, 6.5rem) 0;
  position: relative;
}

.section-sm {
  padding: clamp(2.5rem, 5vw, 4rem) 0;
}

.section-title-wrap {
  text-align: center;
  max-width: 780px;
  margin: 0 auto clamp(2.5rem, 5vw, 4rem) auto;
}

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

.section-subtitle {
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  color: var(--text-secondary);
  line-height: 1.65;
}

/* Checklist Styling (Clean Left Aligned) */
.checklist {
  list-style: none;
  margin-bottom: 2rem;
  color: var(--text-secondary);
  text-align: left;
}

.checklist li {
  margin-bottom: 0.8rem;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.95rem;
}

.checklist-icon {
  color: var(--accent-emerald);
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ==========================================================================
   HEADER & MOBILE NAVIGATION DRAWER
   ========================================================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-glass-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 1000;
  transition: var(--transition);
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
}

.header.scrolled {
  background: rgba(6, 9, 19, 0.98);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  border-bottom-color: rgba(0, 240, 255, 0.2);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 1060;
}

.brand-logo img {
  height: 36px;
  width: auto;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-link {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
  position: relative;
  padding: 0.4rem 0;
  display: block;
}

.nav-link:hover, .nav-link.active {
  color: #FFFFFF;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
  border-radius: 2px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mobile-nav-actions {
  display: none;
}

/* Mobile Toggle Hamburger Button */
.mobile-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: #FFFFFF;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.4rem 0.65rem;
  z-index: 1060;
  line-height: 1;
  transition: var(--transition);
}

.mobile-toggle:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Mobile Backdrop */
.nav-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1020;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.nav-backdrop.open {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 1024px) {
  .header {
    height: var(--header-height-mobile);
  }

  .brand-logo img {
    height: 30px;
  }

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

  .nav-actions {
    display: none;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    max-width: 82vw;
    height: 100vh;
    background: #090F20;
    border-left: 1px solid var(--border-glow);
    box-shadow: -15px 0 45px rgba(0, 0, 0, 0.95);
    flex-direction: column;
    align-items: stretch;
    padding: calc(var(--header-height-mobile) + 1.25rem) 1.5rem 2rem 1.5rem;
    gap: 0.4rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1055;
  }

  .nav-menu.open {
    transform: translateX(0);
  }

  .nav-menu li {
    width: 100%;
  }

  .nav-link {
    font-size: 1.05rem;
    padding: 0.7rem 0.85rem;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
  }

  .nav-link:hover, .nav-link.active {
    background: rgba(0, 240, 255, 0.1);
    color: var(--accent-cyan);
  }

  .nav-link.active::after {
    display: none;
  }

  .mobile-nav-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-subtle);
    width: 100%;
  }

  .mobile-nav-actions .btn {
    width: 100%;
  }
}

/* ==========================================================================
   HERO & TWO-COLUMN GRIDS
   ========================================================================== */
.hero {
  padding-top: calc(var(--header-height) + clamp(2rem, 5vw, 4rem));
  padding-bottom: clamp(3rem, 6vw, 6rem);
  position: relative;
  overflow: hidden;
}

@media (max-width: 1024px) {
  .hero {
    padding-top: calc(var(--header-height-mobile) + 2rem);
  }
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: clamp(2rem, 4vw, 3.5rem);
  text-align: left;
}

.hero-title {
  margin-bottom: 1.25rem;
}

.hero-description {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.65;
}

.hero-visual {
  position: relative;
  width: 100%;
}

.hero-visual img {
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), var(--shadow-neon-cyan);
  border: 1px solid rgba(0, 240, 255, 0.25);
  width: 100%;
  height: auto;
}

@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
}

/* Stats Banner Responsive */
.stats-banner {
  background: #090F20;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 2rem 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  text-align: center;
}

.stat-item h3 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.stat-item p {
  font-size: clamp(0.75rem, 1.5vw, 0.88rem);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-mono);
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
}

@media (max-width: 420px) {
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .stat-item {
    background: rgba(255, 255, 255, 0.02);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
  }
}

/* Responsive Table Wrapper */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1rem 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  box-sizing: border-box;
}

.table-responsive table {
  min-width: 600px;
  width: 100%;
  border-collapse: collapse;
}

/* Footer Responsive */
.footer {
  background: #04070F;
  border-top: 1px solid var(--border-subtle);
  padding: clamp(3.5rem, 6vw, 5.5rem) 0 2.5rem 0;
  position: relative;
  z-index: 1;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1.2fr;
  gap: clamp(1.5rem, 3vw, 3rem);
  margin-bottom: 3.5rem;
}

.footer-brand p {
  margin-top: 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 320px;
}

.footer-col h4 {
  font-size: 0.95rem;
  color: #FFFFFF;
  margin-bottom: 1.2rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--accent-cyan);
}

.footer-newsletter input[type="email"] {
  width: 100%;
  min-height: 44px;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: #FFFFFF;
  font-size: 1rem;
  margin-bottom: 0.75rem;
  outline: none;
}

.footer-newsletter input[type="email"]:focus {
  border-color: var(--accent-cyan);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-legal {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

@media (max-width: 992px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 1.25rem;
    text-align: center;
  }
  .footer-legal {
    justify-content: center;
  }
}
