/* ==========================================================================
   ApexHub — Pure Standalone Refined Design System Stylesheet
   Zero External Dependencies • 100% Reliable Offline & Local File Execution
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&family=Playfair+Display:ital,wght@0,500;0,600;0,700;1,400;1,600&display=swap');

/* --- CSS Variables & Design Tokens --- */
:root {
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  --bg-deep: #080A0F;
  --bg-surface: #0E121B;
  --bg-card: rgba(16, 22, 34, 0.78);
  --bg-card-hover: rgba(22, 30, 48, 0.9);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-card: rgba(255, 255, 255, 0.12);
  --border-highlight: rgba(59, 130, 246, 0.45);

  --color-primary: #3B82F6;
  --color-primary-dark: #2563EB;
  --color-secondary: #8B5CF6;
  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-danger: #EF4444;

  --text-main: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;
  --text-dim: #64748B;

  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.6), 0 0 1px 1px rgba(255, 255, 255, 0.06);
  --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.25);
  --shadow-hero: 0 25px 60px -15px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.12);

  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  overflow-x: hidden;
  background-color: var(--bg-deep);
  background-image: 
    radial-gradient(circle 800px at 50% -100px, rgba(59, 130, 246, 0.14), transparent 70%),
    radial-gradient(circle 600px at 85% 600px, rgba(139, 92, 246, 0.08), transparent 70%),
    radial-gradient(circle 700px at 15% 1400px, rgba(16, 185, 129, 0.05), transparent 70%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.5;
}

/* Global SVG Safety Constraint */
svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  max-width: 100%;
}

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

a {
  color: inherit;
  text-decoration: none;
}

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

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

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.shrink-0 { flex-shrink: 0; }

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.gap-12 { gap: 3rem; }

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

.w-full { width: 100%; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.relative { position: relative; }
.absolute { position: absolute; }
.sticky { position: sticky; }
.fixed { position: fixed; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.hidden { display: none !important; }

/* --- Typography --- */
.font-display { font-family: var(--font-display); }
.font-mono { font-family: var(--font-mono); }
.font-body { font-family: var(--font-body); }

h1, h2, h3, h4, .heading-editorial {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text-main);
  line-height: 1.15;
}

.text-gradient {
  background: linear-gradient(135deg, #FFFFFF 15%, #E2E8F0 50%, #94A3B8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-accent {
  background: linear-gradient(135deg, #60A5FA 0%, #A78BFA 60%, #F472B6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* --- Cards & Bento Components --- */
.refined-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  transition: all 0.3s var(--ease-smooth);
}

.refined-card:hover {
  border-color: var(--border-highlight);
  box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.7), var(--shadow-glow);
  transform: translateY(-2px);
}

/* --- Buttons --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.35);
  transition: all 0.25s var(--ease-smooth);
  cursor: pointer;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
  box-shadow: 0 6px 22px rgba(37, 99, 235, 0.5);
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-weight: 500;
  font-size: 0.95rem;
  backdrop-filter: blur(8px);
  transition: all 0.25s var(--ease-smooth);
  cursor: pointer;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.28);
  color: #FFFFFF;
  transform: translateY(-1px);
}

/* --- Badges & Status Indicators --- */
.pulse-emerald {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-success);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

/* --- Specific Section Styles --- */
/* Top Production Bar */
.top-banner {
  background: rgba(14, 18, 27, 0.92);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.5rem 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  font-size: 0.8rem;
}

/* Header */
.main-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(8, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 36px;
  z-index: 40;
}

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

.logo-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon-box {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563EB, #8B5CF6);
  padding: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon-inner {
  width: 100%;
  height: 100%;
  background: #0E121B;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.nav-links a:hover {
  color: #FFFFFF;
}

/* Hero Section */
.hero-section {
  padding-top: 5rem;
  padding-bottom: 6rem;
  text-align: center;
  position: relative;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  margin: 1.5rem auto;
  max-width: 950px;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 750px;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
}

/* Hero Mockup Browser Frame */
.mockup-frame {
  margin-top: 4rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.03) 100%);
  padding: 4px;
  border-radius: 20px;
  box-shadow: var(--shadow-hero);
}

.mockup-window {
  background: #0A0D14;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.mockup-topbar {
  height: 42px;
  background: #0E121B;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.window-dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot-red { background: #EF4444; }
.dot-yellow { background: #F59E0B; }
.dot-green { background: #10B981; }

.url-bar {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 0.2rem 0.8rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Telemetry Section */
.telemetry-section {
  padding: 3rem 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(9, 12, 18, 0.65);
}

.telemetry-card {
  padding: 1.25rem;
  border-radius: 14px;
  background: rgba(14, 18, 27, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
}

.telemetry-number {
  font-size: 2.2rem;
  font-weight: 700;
  font-family: var(--font-mono);
  margin-bottom: 0.25rem;
}

/* Bento Grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.bento-col-2 {
  grid-column: span 2;
}

/* Role Tabs */
.role-tabs {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 0.7rem 1.25rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(14, 18, 27, 0.5);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.tab-btn.active {
  background: #2563EB;
  border-color: #3B82F6;
  color: #FFFFFF;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
}

/* FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.faq-card {
  background: rgba(14, 18, 27, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.faq-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: #FFFFFF;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.35s var(--ease-smooth), opacity 0.3s ease, margin-top 0.3s ease;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.faq-card.active .faq-answer {
  max-height: 250px;
  opacity: 1;
  margin-top: 0.75rem;
}

.faq-card.active .faq-chevron {
  transform: rotate(180deg);
}

/* Pricing Switch */
.pricing-switch-container {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  background: rgba(14, 18, 27, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  margin-bottom: 3rem;
  font-size: 0.9rem;
}

.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  display: inline-block;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #334155;
  transition: .3s;
  border-radius: 26px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #2563EB;
}

input:checked + .slider:before {
  transform: translateX(22px);
}

/* Footer */
.main-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #05070B;
  padding: 4rem 0 2rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-content {
  background: #0E121C;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  width: 100%;
  max-width: 640px;
  padding: 2rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9);
}

/* Responsive Media Queries */
@media (max-width: 992px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .bento-grid { grid-template-columns: 1fr; }
  .bento-col-2 { grid-column: span 1; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
}

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