/* ==========================================================================
   OPENLABTECH - Precision High-Tech Design System (v2.1)
   Engineered for seamless Light & Dark Mode rendering, high contrast,
   glowing accents, modern typography, and robust component styling.
   ========================================================================== */

:root {
  /* Brand Core Colors (Light Mode) */
  --primary: #0a1128;
  --on-primary: #ffffff;
  --primary-container: #141a32;
  --on-primary-container: #7c839f;
  --primary-fixed: #dce1ff;
  
  --secondary: #0051d5;
  --secondary-container: #346cef;
  --on-secondary: #ffffff;
  --secondary-hover: #003ea7;
  
  /* Cyber / High-Tech Accents */
  --accent-cyan: #0099ff;
  --accent-cyan-glow: rgba(0, 153, 255, 0.2);
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.2);
  --accent-violet: #8b5cf6;
  --accent-amber: #f59e0b;

  /* Surfaces & Backgrounds (Light Mode) */
  --background: #f8fafc;
  --on-background: #0b1c30;
  --surface: #ffffff;
  --card-bg: #ffffff;
  --slate-surface: #f8fafc;
  --slate-surface-elevated: #ffffff;
  --slate-border: #e2e8f0;
  --slate-border-subtle: #f1f5f9;
  --slate-title: #0f172a;
  --on-surface: #0b1c30;
  --on-surface-variant: #475569;
  --on-surface-muted: #94a3b8;
  
  --nav-bg: rgba(255, 255, 255, 0.92);
  --nav-border: #e2e8f0;
  --hero-card-bg: rgba(255, 255, 255, 0.92);
  --hero-card-border: rgba(255, 255, 255, 0.65);
  --card-hover-shadow: 0 12px 30px -8px rgba(0, 81, 213, 0.12);
  --grid-line-color: rgba(0, 81, 213, 0.05);

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* ==========================================================================
   Dark Theme Overrides (High-Tech Precision Obsidian & Cyan Palette)
   ========================================================================== */
html.dark {
  /* Brand Core Colors in Dark Mode */
  --primary: #2563eb;
  --on-primary: #ffffff;
  --primary-container: #0f172a;
  --on-primary-container: #94a3b8;
  --primary-fixed: #93c5fd;
  
  --secondary: #38bdf8;
  --secondary-container: #1d4ed8;
  --on-secondary: #ffffff;
  --secondary-hover: #7dd3fc;
  
  /* Cyber / High-Tech Accents in Dark Mode */
  --accent-cyan: #38bdf8;
  --accent-cyan-glow: rgba(56, 189, 248, 0.35);
  --accent-emerald: #34d399;
  --accent-emerald-glow: rgba(52, 211, 153, 0.35);
  --accent-violet: #a78bfa;
  --accent-amber: #fbbf24;

  /* Surfaces & Backgrounds in Dark Mode */
  --background: #070b14;
  --on-background: #e2e8f0;
  --surface: #0f172a;
  --card-bg: #0f172a;
  --slate-surface: #070b14;
  --slate-surface-elevated: #0f172a;
  --slate-border: #1e293b;
  --slate-border-subtle: #141e33;
  --slate-title: #f8fafc;
  --on-surface: #e2e8f0;
  --on-surface-variant: #94a3b8;
  --on-surface-muted: #64748b;
  
  --nav-bg: rgba(7, 11, 20, 0.92);
  --nav-border: #1e293b;
  --hero-card-bg: rgba(15, 23, 42, 0.88);
  --hero-card-border: rgba(56, 189, 248, 0.25);
  --card-hover-shadow: 0 14px 35px -8px rgba(0, 210, 255, 0.16);
  --grid-line-color: rgba(56, 189, 248, 0.06);
}

*, *::before, *::after {
  box-sizing: border-box;
}

/* Smooth Theme Switch Transitions */
html.theme-transition,
html.theme-transition *,
html.theme-transition *::before,
html.theme-transition *::after {
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, fill 0.25s ease, stroke 0.25s ease, box-shadow 0.25s ease !important;
}

html {
  scroll-behavior: smooth;
  background-color: var(--slate-surface);
}

body {
  font-family: var(--font-sans);
  background-color: var(--slate-surface);
  color: var(--on-surface);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Material Symbols */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  display: inline-block;
  vertical-align: middle;
  line-height: 1;
}
.icon-filled {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ==========================================================================
   Header, Navigation & Layout Elements
   ========================================================================== */
nav.fixed {
  background-color: var(--nav-bg) !important;
  border-bottom-color: var(--nav-border) !important;
}

/* Hero Glass Card */
.hero-card {
  background-color: var(--hero-card-bg);
  border-color: var(--hero-card-border);
}
html.dark .hero-card {
  background-color: rgba(15, 23, 42, 0.88);
  border-color: rgba(56, 189, 248, 0.25);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(56, 189, 248, 0.1);
}

/* High-Tech Patterns & Grid Backgrounds */
.tech-grid-bg {
  background-image: 
    linear-gradient(to right, var(--grid-line-color) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line-color) 1px, transparent 1px);
  background-size: 32px 32px;
}

.tech-dots-bg {
  background-image: radial-gradient(var(--grid-line-color) 1.5px, transparent 1.5px);
  background-size: 24px 24px;
}

/* Radial Glow Orbs */
.glow-orb-cyan {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 9999px;
  background: radial-gradient(circle, var(--accent-cyan-glow) 0%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
}

.glow-orb-blue {
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 9999px;
  background: radial-gradient(circle, rgba(0, 81, 213, 0.2) 0%, transparent 70%);
  filter: blur(50px);
  pointer-events: none;
  z-index: 0;
}

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

.animate-fade-in-up {
  animation: fadeInUp 0.8s ease-out forwards;
}
.animation-delay-200 {
  animation-delay: 0.2s;
}
.animation-delay-400 {
  animation-delay: 0.4s;
}

/* Scanning Line Button */
.scanning-line-btn {
  position: relative;
  overflow: hidden;
}
.scanning-line-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: skewX(-20deg);
  animation: scanLine 3.5s infinite;
}
@keyframes scanLine {
  0% { left: -100%; }
  25% { left: 200%; }
  100% { left: 200%; }
}

/* Live Pulse Badges */
.pulse-emerald {
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseEmerald 2s infinite;
}
@keyframes pulseEmerald {
  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 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.pulse-cyan {
  box-shadow: 0 0 0 0 rgba(0, 210, 255, 0.7);
  animation: pulseCyan 2s infinite;
}
@keyframes pulseCyan {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 210, 255, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(0, 210, 255, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 210, 255, 0); }
}

/* Glass Card */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--slate-border);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.glass-card:hover {
  transform: translateY(-4px);
  border-color: var(--secondary);
  box-shadow: var(--card-hover-shadow);
}

/* Tech Card */
.tech-card {
  background-color: var(--card-bg);
  border: 1px solid var(--slate-border);
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.tech-card:hover {
  border-color: var(--secondary);
  box-shadow: var(--card-hover-shadow);
  transform: translateY(-2px);
}

/* ==========================================================================
   Solutions & Architectural Cases Sub-Cards (High-Contrast & Cyber Aesthetic)
   ========================================================================== */

/* 1. Operational Challenge Card (.challenge-box) */
.challenge-box {
  background-color: rgba(254, 242, 242, 0.75);
  border: 1px solid rgba(254, 202, 202, 0.85);
  border-radius: 0.75rem;
  padding: 1.25rem;
  transition: all 0.2s ease;
}
.challenge-box .challenge-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #dc2626;
  margin-bottom: 0.5rem;
}
.challenge-box .challenge-text {
  color: #334155;
  font-size: 0.875rem;
  line-height: 1.625;
}
@media (min-width: 640px) {
  .challenge-box .challenge-text {
    font-size: 1rem;
  }
}

html.dark .challenge-box {
  background-color: rgba(225, 29, 72, 0.09) !important;
  border: 1px solid rgba(244, 63, 94, 0.3) !important;
  box-shadow: 0 4px 20px -2px rgba(225, 29, 72, 0.12), inset 0 1px 1px 0 rgba(255, 255, 255, 0.05);
}
html.dark .challenge-box:hover {
  border-color: rgba(244, 63, 94, 0.5) !important;
  background-color: rgba(225, 29, 72, 0.14) !important;
}
html.dark .challenge-box .challenge-header {
  color: #fb7185 !important;
}
html.dark .challenge-box .challenge-text {
  color: #cbd5e1 !important;
}

/* 2. Sub-Services Card (.sub-service-box) */
.sub-service-box {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.625rem;
  padding: 1rem;
  transition: all 0.2s ease;
}
.sub-service-box:hover {
  border-color: #cbd5e1;
  transform: translateY(-1px);
}
.sub-service-box .service-box-title {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 700;
  color: #0051d5;
  display: block;
  margin-bottom: 0.25rem;
}
.sub-service-box .service-box-desc {
  font-size: 0.875rem;
  color: #475569;
  line-height: 1.625;
}

html.dark .sub-service-box {
  background-color: rgba(30, 41, 59, 0.5) !important;
  border: 1px solid rgba(51, 65, 85, 0.7) !important;
  backdrop-filter: blur(4px);
}
html.dark .sub-service-box:hover {
  border-color: rgba(56, 189, 248, 0.45) !important;
  background-color: rgba(30, 41, 59, 0.8) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
html.dark .sub-service-box .service-box-title {
  color: #38bdf8 !important;
}
html.dark .sub-service-box .service-box-desc {
  color: #cbd5e1 !important;
}

/* 3. Differential / Key Advantage Box (.differential-box) */
.differential-box {
  background-color: rgba(239, 246, 255, 0.85);
  border: 1px solid #bfdbfe;
  border-radius: 0.75rem;
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  transition: all 0.2s ease;
}
.differential-box .diff-icon {
  color: #0051d5;
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-top: 0.125rem;
}
.differential-box .diff-title {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  text-transform: uppercase;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.25rem;
}
.differential-box .diff-desc {
  font-size: 0.875rem;
  color: #334155;
  line-height: 1.625;
}
@media (min-width: 640px) {
  .differential-box .diff-desc {
    font-size: 0.9375rem;
  }
}

html.dark .differential-box {
  background-color: rgba(14, 116, 144, 0.12) !important;
  border: 1px solid rgba(56, 189, 248, 0.28) !important;
  box-shadow: 0 4px 20px -2px rgba(56, 189, 248, 0.08), inset 0 1px 1px 0 rgba(255, 255, 255, 0.05);
}
html.dark .differential-box:hover {
  border-color: rgba(56, 189, 248, 0.5) !important;
  background-color: rgba(14, 116, 144, 0.18) !important;
}
html.dark .differential-box .diff-icon {
  color: #38bdf8 !important;
}
html.dark .differential-box .diff-title {
  color: #f8fafc !important;
}
html.dark .differential-box .diff-desc {
  color: #cbd5e1 !important;
}

/* 4. Specs Header Badge (.specs-pill) */
.specs-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  border-radius: 0.5rem;
  background-color: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #1e293b;
  flex-shrink: 0;
}
@media (min-width: 640px) {
  .specs-pill {
    font-size: 0.875rem;
  }
}
html.dark .specs-pill {
  background-color: rgba(30, 41, 59, 0.65) !important;
  border-color: rgba(51, 65, 85, 0.8) !important;
  color: #e2e8f0 !important;
}

/* Bento Gradient Card Border */
.bento-card-gradient {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--slate-border);
  border-radius: 0.875rem;
  transition: all 0.3s ease;
}
.bento-card-gradient:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 10px 25px -5px rgba(0, 210, 255, 0.12);
}

/* Step Node in Workflow */
.step-node {
  background-color: var(--card-bg);
  border: 1px solid var(--slate-border);
  border-radius: 0.75rem;
  padding: 24px;
  transition: all 0.25s ease;
}
.step-node:hover {
  border-color: var(--secondary);
  box-shadow: var(--card-hover-shadow);
  transform: translateY(-2px);
}
.step-number {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  width: 32px;
  height: 32px;
  border-radius: 0.375rem;
  background: var(--primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
html.dark .step-number {
  background: #2563eb;
  color: #ffffff;
}

/* Interactive Tabs */
.tab-btn {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  color: var(--on-surface-variant);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}
.tab-btn:hover {
  color: var(--slate-title);
  background: rgba(125, 125, 125, 0.08);
}
.tab-btn.active {
  background: var(--card-bg);
  color: var(--secondary);
  border-color: var(--slate-border);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
html.dark .tab-btn.active {
  background: var(--card-bg);
  color: var(--secondary);
  border-color: var(--slate-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* FAQ Accordion */
.faq-accordion {
  border: 1px solid var(--slate-border);
  border-radius: 0.75rem;
  background-color: var(--card-bg);
  overflow: hidden;
  transition: all 0.2s ease;
}
.faq-accordion:hover {
  border-color: var(--secondary);
}
.faq-accordion[open] {
  border-color: var(--secondary);
  box-shadow: var(--card-hover-shadow);
}
.faq-summary {
  padding: 20px 24px;
  font-weight: 600;
  font-size: 15px;
  color: var(--slate-title);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  list-style: none;
}
.faq-summary::-webkit-details-marker {
  display: none;
}
.faq-summary .faq-icon {
  transition: transform 0.25s ease;
  color: var(--secondary);
}
.faq-accordion[open] .faq-summary .faq-icon {
  transform: rotate(180deg);
}
.faq-body {
  padding: 0 24px 20px 24px;
  color: var(--on-surface-variant);
  font-size: 14px;
  line-height: 1.65;
  border-top: 1px solid var(--slate-border-subtle);
}

/* Tech Form Inputs */
.tech-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 0.5rem;
  border: 1px solid var(--slate-border);
  background-color: var(--slate-surface);
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--slate-title);
  transition: all 0.2s ease;
}
.tech-input::placeholder {
  color: var(--on-surface-muted);
}
.tech-input:focus {
  outline: none;
  background-color: var(--card-bg);
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(0, 81, 213, 0.18);
}
select.tech-input option {
  background-color: var(--card-bg);
  color: var(--slate-title);
}

html.dark .tech-input {
  background-color: #0c1424;
  border-color: #1e293b;
  color: #f8fafc;
}
html.dark .tech-input:focus {
  background-color: #0f172a;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
}
html.dark select.tech-input option {
  background-color: #0f172a;
  color: #f8fafc;
}

/* Scroll Reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: all 0.7s ease-out;
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Custom Scrollbar for Modern Browsers */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--slate-surface);
}
::-webkit-scrollbar-thumb {
  background: var(--slate-border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--on-surface-muted);
}

/* ==========================================================================
   Universal Dark Mode Adaptations & Component Harmonization
   ========================================================================== */

/* Backgrounds */
html.dark .bg-white {
  background-color: var(--card-bg) !important;
}
html.dark .bg-slate-surface {
  background-color: var(--slate-surface) !important;
}
html.dark .bg-background {
  background-color: var(--background) !important;
}
html.dark .bg-surface {
  background-color: var(--surface) !important;
}
html.dark .bg-card-bg {
  background-color: var(--card-bg) !important;
}

/* Borders */
html.dark .border-slate-border {
  border-color: var(--slate-border) !important;
}
html.dark .border-slate-100,
html.dark .border-slate-200 {
  border-color: var(--slate-border) !important;
}
html.dark .divide-slate-border > :not([hidden]) ~ :not([hidden]) {
  border-color: var(--slate-border) !important;
}

/* Text Colors */
html.dark .text-slate-title {
  color: var(--slate-title) !important;
}
html.dark .text-on-surface-variant {
  color: var(--on-surface-variant) !important;
}
html.dark .text-on-background {
  color: var(--on-background) !important;
}
html.dark .text-slate-900,
html.dark .text-slate-800,
html.dark .text-slate-700 {
  color: var(--slate-title) !important;
}
html.dark .text-slate-600,
html.dark .text-slate-500 {
  color: var(--on-surface-variant) !important;
}
html.dark .text-slate-400 {
  color: var(--on-surface-muted) !important;
}

/* Badges & Accent Containers */
html.dark .bg-blue-50,
html.dark .bg-blue-50\/60 {
  background-color: rgba(37, 99, 235, 0.14) !important;
}
html.dark .border-blue-100,
html.dark .border-blue-200 {
  border-color: rgba(56, 189, 248, 0.28) !important;
}
html.dark .text-secondary {
  color: var(--secondary) !important;
}

html.dark .bg-emerald-50 {
  background-color: rgba(16, 185, 129, 0.14) !important;
}
html.dark .text-emerald-700,
html.dark .text-emerald-600 {
  color: #34d399 !important;
}
html.dark .border-emerald-200 {
  border-color: rgba(52, 211, 153, 0.3) !important;
}

html.dark .bg-amber-50 {
  background-color: rgba(245, 158, 11, 0.14) !important;
}
html.dark .text-amber-700,
html.dark .text-amber-600 {
  color: #fbbf24 !important;
}
html.dark .border-amber-200 {
  border-color: rgba(251, 191, 36, 0.3) !important;
}

html.dark .bg-rose-50 {
  background-color: rgba(239, 68, 68, 0.14) !important;
}
html.dark .text-rose-700,
html.dark .text-rose-600 {
  color: #f87171 !important;
}
html.dark .border-rose-200 {
  border-color: rgba(248, 113, 113, 0.3) !important;
}

html.dark .bg-green-50 {
  background-color: rgba(37, 211, 102, 0.14) !important;
}

html.dark .bg-slate-50 {
  background-color: rgba(15, 23, 42, 0.65) !important;
}
html.dark .bg-slate-100 {
  background-color: rgba(30, 41, 59, 0.75) !important;
}

/* Hover States for Dark Mode */
html.dark .hover\:bg-slate-50:hover,
html.dark .hover\:bg-slate-100:hover {
  background-color: rgba(30, 41, 59, 0.7) !important;
}
html.dark .hover\:bg-rose-50:hover {
  background-color: rgba(239, 68, 68, 0.2) !important;
}
html.dark .hover\:bg-slate-surface:hover {
  background-color: rgba(15, 23, 42, 0.8) !important;
}

/* Primary Action Buttons in Dark Mode */
html.dark a.bg-primary,
html.dark button.bg-primary,
html.dark input.file\:bg-primary::file-selector-button {
  background-color: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
}
html.dark a.bg-primary:hover,
html.dark button.bg-primary:hover,
html.dark input.file\:bg-primary:hover::file-selector-button {
  background-color: #1d4ed8 !important;
  border-color: #1d4ed8 !important;
}