/* ==========================================================================
   HARVAR INNOVATIONS — SHARED SITE CHROME
   1. Dark / Light Theme Toggle Support Across All HarVar Pages (High Contrast)
   2. Bottom-Right Floating Dock + Compact Side Popup Drawer (WhatsApp & Consultation)
   ========================================================================== */

.brand-sub {
  display: none !important;
}

/* Theme Toggle Button in Navbar */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, 0.34);
  background: rgba(255, 255, 255, 0.08);
  color: #F8FAFC;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.theme-toggle-btn:hover {
  transform: translateY(-1px);
  border-color: #38BDF8;
  color: #38BDF8;
  background: rgba(56, 189, 248, 0.14);
}

/* ==========================================================================
   Bottom-Right Floating Quick Dock (Cleanly Lowered Out of Hero/3D Way)
   ========================================================================== */
.floating-wa {
  display: none !important;
}

.harvar-side-dock {
  position: fixed;
  right: 0;
  bottom: 20px;
  z-index: 2500;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.side-dock-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px 7px 11px;
  border-radius: 999px 0 0 999px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid rgba(56, 189, 248, 0.32);
  border-right: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: -4px 6px 18px rgba(4, 7, 13, 0.28);
  transition: transform 0.2s ease, padding-right 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

.side-dock-btn svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.side-dock-btn:hover {
  padding-right: 16px;
  transform: translateX(-2px);
}

.side-dock-consult {
  background: rgba(15, 23, 42, 0.92);
  color: #7DD3FC;
  border-color: rgba(56, 189, 248, 0.4);
}
.side-dock-consult:hover {
  border-color: #38BDF8;
  color: #FFFFFF;
}

.side-dock-wa {
  background: rgba(15, 23, 42, 0.92);
  color: #34D399;
  border-color: rgba(52, 211, 153, 0.38);
}
.side-dock-wa:hover {
  border-color: #34D399;
  color: #6EE7B7;
}

/* Compact Floating Side Popup Card (Non-Clipping Widget) */
.harvar-side-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2900;
  background: rgba(4, 7, 13, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.harvar-side-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.harvar-side-popup {
  position: fixed;
  right: 22px;
  bottom: 82px;
  width: min(390px, calc(100vw - 28px));
  max-height: calc(100vh - 108px);
  z-index: 3000;
  background: #0F172A;
  color: #F4F8FD;
  border-radius: 20px;
  border: 1px solid rgba(56, 189, 248, 0.36);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px) scale(0.97);
  transition: opacity 0.24s ease, transform 0.26s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.24s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 20px 22px;
}
.harvar-side-popup.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.side-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  margin-bottom: 12px;
}

.side-popup-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #34D399;
  display: block;
  margin-bottom: 2px;
}

.side-popup-head h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.18rem;
  color: #FFFFFF;
}

.side-popup-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.06);
  color: #CBD5E1;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}
.side-popup-close:hover {
  border-color: #38BDF8;
  color: #FFFFFF;
}

.side-popup-desc {
  font-size: 0.84rem;
  color: #CBD5E1;
  line-height: 1.5;
  margin-bottom: 12px;
}

.side-popup-field { margin-bottom: 10px; }
.side-popup-field label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7DD3FC;
  margin-bottom: 4px;
}
.side-popup-field input,
.side-popup-field select,
.side-popup-field textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: #070B14;
  color: #FFFFFF;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.86rem;
}

.side-popup-alert {
  display: none;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 0.82rem;
  margin-bottom: 10px;
}
.side-popup-alert.ok {
  display: block;
  background: rgba(52, 211, 153, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: #6EE7B7;
}
.side-popup-alert.err {
  display: block;
  background: rgba(248, 113, 113, 0.14);
  border: 1px solid rgba(248, 113, 113, 0.45);
  color: #FCA5A5;
}

.side-popup-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}
.side-popup-actions .btn { padding: 10px 16px; font-size: 0.84rem; }

.side-popup-footer-links {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: #94A3B8;
}
.side-popup-footer-links a { color: #38BDF8; text-decoration: none; }

@media (max-width: 640px) {
  .harvar-side-dock { right: 0; bottom: 16px; gap: 7px; }
  .side-dock-btn { padding: 10px 13px; font-size: 0.76rem; }
}

/* ==========================================================================
   LIGHT THEME OVERRIDES (html[data-theme="light"]) — 100% Legible Text & Contrast
   ========================================================================== */
html[data-theme="light"] body {
  background-color: #F4F8FD !important;
  color: #0F172A !important;
}

html[data-theme="light"] .site-header {
  background: rgba(248, 250, 252, 0.96) !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.12) !important;
}

html[data-theme="light"] .brand-name { color: #0F172A !important; }
html[data-theme="light"] .brand-name span { color: #2563EB !important; }
html[data-theme="light"] .brand-sub { color: #059669 !important; }
html[data-theme="light"] .nav-links a { color: #334155 !important; }
html[data-theme="light"] .nav-links a:hover,
html[data-theme="light"] .nav-links a.active { color: #0F172A !important; }

html[data-theme="light"] .theme-toggle-btn {
  background: #FFFFFF;
  color: #0F172A;
  border-color: rgba(15, 23, 42, 0.2);
}
html[data-theme="light"] .theme-toggle-btn:hover {
  border-color: #2563EB;
  color: #2563EB;
}

html[data-theme="light"] .nav-toggle {
  background: #FFFFFF;
  color: #0F172A;
  border-color: rgba(15, 23, 42, 0.2);
}

html[data-theme="light"] .mobile-drawer {
  background: rgba(248, 250, 252, 0.98) !important;
  border-bottom-color: rgba(15, 23, 42, 0.12) !important;
}
html[data-theme="light"] .mobile-nav-list a {
  color: #1E293B !important;
  border-bottom-color: rgba(15, 23, 42, 0.08) !important;
}

/* Light Backgrounds for Heroes & Dark Contrast Bands */
html[data-theme="light"] .hero-cinematic,
html[data-theme="light"] .svc-hero,
html[data-theme="light"] .svc-detail-hero,
html[data-theme="light"] .prod-hero,
html[data-theme="light"] .about-hero,
html[data-theme="light"] .blog-hero,
html[data-theme="light"] .contact-hero,
html[data-theme="light"] .section-obsidian,
html[data-theme="light"] .band-obsidian,
html[data-theme="light"] .band-dark,
html[data-theme="light"] .subpage-hero {
  background: linear-gradient(160deg, #F8FAFC 0%, #EFF6FF 100%) !important;
  color: #0F172A !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.1) !important;
}

html[data-theme="light"] .section-vision,
html[data-theme="light"] .section-mission,
html[data-theme="light"] .band-navy,
html[data-theme="light"] .process-section,
html[data-theme="light"] .workflow-section,
html[data-theme="light"] .svc-switcher-strip,
html[data-theme="light"] .svc-final-cta,
html[data-theme="light"] .prod-final-cta,
html[data-theme="light"] .about-final-cta,
html[data-theme="light"] .blog-final-cta,
html[data-theme="light"] .contact-finale {
  background: linear-gradient(160deg, #E9F0F9 0%, #F4F8FD 100%) !important;
  color: #0F172A !important;
  border-color: rgba(15, 23, 42, 0.1) !important;
}

/* Force crisp high-contrast ink headings inside formerly dark bands (even inline white headings) */
html[data-theme="light"] main h1,
html[data-theme="light"] main h2,
html[data-theme="light"] main h3,
html[data-theme="light"] main strong {
  color: #0F172A !important;
}
html[data-theme="light"] main .accent-brand {
  background: linear-gradient(120deg, #2563EB 0%, #0284C7 52%, #059669 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
}

html[data-theme="light"] main p,
html[data-theme="light"] main li,
html[data-theme="light"] main .hero-desc,
html[data-theme="light"] main .svc-hero-desc,
html[data-theme="light"] main .prod-hero-desc,
html[data-theme="light"] main .blog-hero-desc,
html[data-theme="light"] main .contact-hero-desc,
html[data-theme="light"] main .section-lead,
html[data-theme="light"] main .svc-lead,
html[data-theme="light"] main .prod-lead,
html[data-theme="light"] main .about-statement,
html[data-theme="light"] main .about-subnote {
  color: #334155 !important;
}

html[data-theme="light"] .eyebrow { color: #2563EB !important; }
html[data-theme="light"] .breadcrumb { color: #475569 !important; }
html[data-theme="light"] .breadcrumb a { color: #2563EB !important; }
html[data-theme="light"] .scroll-cue { color: #334155 !important; }

/* Card Surfaces in Light Theme */
html[data-theme="light"] .svc-mini-card,
html[data-theme="light"] .mkt-kpi-row,
html[data-theme="light"] .process-step,
html[data-theme="light"] .mv-card,
html[data-theme="light"] .founder-panel,
html[data-theme="light"] .exp-card,
html[data-theme="light"] .why-item,
html[data-theme="light"] .svc-final-box,
html[data-theme="light"] .prod-final-box,
html[data-theme="light"] .about-final-box,
html[data-theme="light"] .blog-final-box,
html[data-theme="light"] .contact-finale-box,
html[data-theme="light"] .who-art-card,
html[data-theme="light"] .why-principle-row,
html[data-theme="light"] .featured-article,
html[data-theme="light"] .about-identity-card,
html[data-theme="light"] .triptych-block {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border-color: rgba(15, 23, 42, 0.14) !important;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.06) !important;
}

html[data-theme="light"] .mv-label,
html[data-theme="light"] .mkt-tag-badge,
html[data-theme="light"] .exp-link,
html[data-theme="light"] .featured-meta {
  color: #059669 !important;
}
html[data-theme="light"] .process-step-num,
html[data-theme="light"] .why-num {
  color: #2563EB !important;
}

html[data-theme="light"] .svc-jump-pill,
html[data-theme="light"] .filter-pill,
html[data-theme="light"] .tech-pill,
html[data-theme="light"] .founder-pill {
  background: rgba(37, 99, 235, 0.08) !important;
  color: #1D4ED8 !important;
  border-color: rgba(37, 99, 235, 0.24) !important;
}
html[data-theme="light"] .filter-pill.active,
html[data-theme="light"] .mode-btn.active,
html[data-theme="light"] .calc-chip.active {
  background: #0F172A !important;
  color: #FFFFFF !important;
}

html[data-theme="light"] .btn-primary { color: #FFFFFF !important; }
html[data-theme="light"] .btn-outline-light {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border-color: rgba(15, 23, 42, 0.24) !important;
}
html[data-theme="light"] .btn-outline-light:hover {
  border-color: #2563EB !important;
  background: rgba(37, 99, 235, 0.06) !important;
}

/* Keep Estimator Summary Card Crisp Dark or Crisp Slate Contrast */
html[data-theme="light"] .calc-summary {
  background: #0F172A !important;
  color: #FFFFFF !important;
}
html[data-theme="light"] .calc-summary *,
html[data-theme="light"] .calc-summary strong {
  color: #FFFFFF !important;
}
html[data-theme="light"] .calc-summary .calc-price { color: #7DD3FC !important; }
html[data-theme="light"] .calc-summary .calc-timeline { color: #34D399 !important; }
html[data-theme="light"] .calc-summary span { color: #CBD5E1 !important; }
html[data-theme="light"] .calc-summary .btn-outline-light {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #FFFFFF !important;
  border-color: rgba(203, 213, 225, 0.35) !important;
}

/* Keep Three.js WebGL Stage Dark Inside & Maintain Visible HUD Labels */
html[data-theme="light"] .stage-3d-frame {
  background: radial-gradient(circle at 50% 44%, #111E3A 0%, #050911 100%) !important;
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.16) !important;
  border-color: rgba(37, 99, 235, 0.28) !important;
}
html[data-theme="light"] .stage-3d-frame .hud-pill {
  background: rgba(15, 23, 42, 0.9) !important;
  color: #7DD3FC !important;
}
html[data-theme="light"] .stage-3d-frame .hud-pill.emerald {
  color: #34D399 !important;
}

html[data-theme="light"] .svc-3d-dark-stage {
  background: radial-gradient(circle at 50% 45%, #E2E8F0 0%, #F8FAFC 80%) !important;
  border-color: rgba(37, 99, 235, 0.2) !important;
}

/* Light Theme Footer — Override inline muted colors so text stays crisp */
html[data-theme="light"] .site-footer {
  background: #E2E8F0 !important;
  color: #334155 !important;
  border-top: 1px solid rgba(15, 23, 42, 0.14) !important;
}
html[data-theme="light"] .site-footer p,
html[data-theme="light"] .site-footer li,
html[data-theme="light"] .footer-bottom {
  color: #334155 !important;
}
html[data-theme="light"] .footer-col h4 { color: #2563EB !important; }
html[data-theme="light"] .footer-links a { color: #1E293B !important; }
html[data-theme="light"] .footer-links a:hover { color: #2563EB !important; }
html[data-theme="light"] .footer-bottom { border-top-color: rgba(15, 23, 42, 0.14) !important; }

/* Light Theme Side Popup & Dock */
html[data-theme="light"] .side-dock-consult {
  background: rgba(255, 255, 255, 0.96);
  color: #1D4ED8;
  border-color: rgba(37, 99, 235, 0.32);
}

html[data-theme="light"] .side-dock-wa {
  background: rgba(255, 255, 255, 0.96);
  color: #059669;
  border-color: rgba(5, 150, 105, 0.34);
}

html[data-theme="light"] .harvar-side-popup {
  background: #FFFFFF;
  color: #0F172A;
  border-color: rgba(37, 99, 235, 0.24);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
}
html[data-theme="light"] .side-popup-head h3 { color: #0F172A; }
html[data-theme="light"] .side-popup-tag { color: #059669; }
html[data-theme="light"] .side-popup-desc { color: #475569; }
html[data-theme="light"] .side-popup-close {
  background: #F1F5F9;
  color: #334155;
  border-color: rgba(15, 23, 42, 0.16);
}
html[data-theme="light"] .side-popup-field label { color: #2563EB; }
html[data-theme="light"] .side-popup-field input,
html[data-theme="light"] .side-popup-field select,
html[data-theme="light"] .side-popup-field textarea {
  background: #F8FAFC;
  color: #0F172A;
  border-color: rgba(15, 23, 42, 0.2);
}
html[data-theme="light"] .side-popup-footer-links {
  color: #475569;
  border-top-color: rgba(15, 23, 42, 0.12);
}
html[data-theme="light"] .side-popup-footer-links a { color: #2563EB; }

/* Dark Theme Explicit Contrast Guarantees on Buttons & Controls */
html[data-theme="dark"] .side-popup-actions .btn-outline-light {
  color: #F4F8FD;
  border-color: rgba(203, 213, 225, 0.34);
}
