/* ==========================================================================
   MIR Engineering Services Inc — Aerospace Scrollytelling 3D/CAD Design System
   Base Surface: #06070A | HUD Panels: backdrop-blur-xl + 1px rgba(255,255,255,0.08)
   ========================================================================== */

:root {
  --bg-aerospace: #06070A;
  --bg-panel: rgba(10, 13, 20, 0.74);
  --bg-panel-solid: #0C0F17;
  --bg-panel-elevated: #121723;

  --border-hud: rgba(255, 255, 255, 0.08);
  --border-hud-hover: rgba(0, 240, 255, 0.45);
  --border-amber-hover: rgba(234, 88, 12, 0.55);

  --cyan-cad: #00F0FF;
  --cyan-soft: rgba(0, 240, 255, 0.16);
  --amber-fea: #EA580C;
  --amber-bright: #F97316;
  --red-fea: #EF4444;
  --emerald-ok: #10B981;

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

  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
}

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

html {
  background-color: var(--bg-aerospace);
  color: var(--text-main);
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

body {
  background-color: var(--bg-aerospace);
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

::selection {
  background: var(--cyan-cad);
  color: #06070A;
}

/* Tabular figures for live changing coordinates & numbers */
.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   FULLSCREEN FIXED CANVASES (z-0 WebGL + z-1 2D Vector Projection HUD)
   ========================================================================== */
#webgl-canvas,
#hud-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
}

#webgl-canvas {
  z-index: 0;
}

#hud-canvas {
  z-index: 1;
  pointer-events: none;
}

/* Subtle dark atmospheric vignette around edges so HUD text pops cleanly */
.viewport-vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, transparent 45%, rgba(6, 7, 10, 0.68) 100%),
    linear-gradient(to bottom, rgba(6, 7, 10, 0.72) 0%, transparent 14%, transparent 86%, rgba(6, 7, 10, 0.8) 100%);
}

/* ==========================================================================
   AEROSPACE HUD GLASS PANELS (1px solid rgba(255,255,255,0.08) + blur-xl)
   ========================================================================== */
.hud-panel {
  background: var(--bg-panel);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--border-hud);
  box-shadow:
    0 24px 60px -15px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.06);
  transition: border-color 0.25s var(--ease-spring), transform 0.25s var(--ease-spring), box-shadow 0.25s var(--ease-spring);
}

.hud-panel-interactive:hover {
  border-color: rgba(0, 240, 255, 0.35);
  box-shadow:
    0 28px 64px -12px rgba(0, 0, 0, 0.9),
    0 0 30px -8px rgba(0, 240, 255, 0.14),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
}

/* Corner reticles for aerospace instrumentation cards */
.hud-reticle {
  position: relative;
}
.hud-reticle::before,
.hud-reticle::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  pointer-events: none;
}
.hud-reticle::before {
  top: -1px;
  left: -1px;
  border-top: 1.5px solid var(--cyan-cad);
  border-left: 1.5px solid var(--cyan-cad);
}
.hud-reticle::after {
  bottom: -1px;
  right: -1px;
  border-bottom: 1.5px solid var(--cyan-cad);
  border-right: 1.5px solid var(--cyan-cad);
}

.hud-reticle-amber::before {
  border-top-color: var(--amber-fea);
  border-left-color: var(--amber-fea);
}
.hud-reticle-amber::after {
  border-bottom-color: var(--amber-fea);
  border-right-color: var(--amber-fea);
}

.hud-reticle-emerald::before {
  border-top-color: var(--emerald-ok);
  border-left-color: var(--emerald-ok);
}
.hud-reticle-emerald::after {
  border-bottom-color: var(--emerald-ok);
  border-right-color: var(--emerald-ok);
}

/* ==========================================================================
   STRATEGIC HEADER CTAs
   ========================================================================== */
.cta-click-to-plans {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  flex-shrink: 0;
  background: linear-gradient(135deg, #00F0FF 0%, #0284C7 100%);
  color: #06070A;
  font-weight: 800;
  border-radius: 9999px;
  padding: 0.5rem 0.95rem;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 0 24px -4px rgba(0, 240, 255, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.65);
  transition: transform 0.16s var(--ease-spring), filter 0.16s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.cta-click-to-plans:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 0 32px -2px rgba(0, 240, 255, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.cta-click-to-plans:active {
  transform: scale(0.97);
}

.cta-corporate {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  flex-shrink: 0;
  background: rgba(234, 88, 12, 0.14);
  color: #FDBA74;
  font-weight: 700;
  border-radius: 9999px;
  padding: 0.5rem 0.9rem;
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  border: 1px solid rgba(234, 88, 12, 0.45);
  backdrop-filter: blur(12px);
  transition: transform 0.16s var(--ease-spring), background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  cursor: pointer;
}

.cta-corporate:hover {
  background: var(--amber-fea);
  color: #FFFFFF;
  border-color: var(--amber-bright);
  transform: translateY(-1px);
}

.cta-corporate:active {
  transform: scale(0.97);
}

/* ==========================================================================
   SCROLLYTELLING SCENE PANELS (600vh Stage Cards)
   ========================================================================== */
.scrolly-stage-band {
  height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  pointer-events: none;
}

.scrolly-card-wrap {
  pointer-events: auto;
  will-change: transform, opacity;
}

/* Vertical Altimeter Progress Rail */
.altimeter-rail {
  position: fixed;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  pointer-events: none;
}

.altimeter-node {
  transition: all 0.25s var(--ease-spring);
}

.altimeter-node.active {
  transform: scale(1.25);
}

/* ==========================================================================
   POST-CANVAS OPERATIONAL HUB (#06070A Grid & Cards)
   ========================================================================== */
.operational-hub {
  position: relative;
  z-index: 20;
  background-color: var(--bg-aerospace);
  border-top: 1px solid rgba(0, 240, 255, 0.2);
  box-shadow: 0 -40px 100px rgba(6, 7, 10, 0.98);
}

.cad-grid-bg {
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to right, rgba(0, 240, 255, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 240, 255, 0.05) 1px, transparent 1px);
  background-size: 28px 28px, 28px 28px, 140px 140px, 140px 140px;
}

.plan-card {
  background: rgba(12, 15, 23, 0.82);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-hud);
  border-radius: 16px;
  transition: transform 0.25s var(--ease-spring), border-color 0.25s ease, box-shadow 0.25s ease;
}

.plan-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 240, 255, 0.42);
  box-shadow: 0 24px 48px -14px rgba(0, 0, 0, 0.85), 0 0 26px -6px rgba(0, 240, 255, 0.16);
}

/* Custom Range Sliders */
.tech-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.tech-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--cyan-cad);
  border: 2px solid #06070A;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.7);
  cursor: pointer;
  transition: transform 0.15s var(--ease-spring);
}

.tech-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.tech-slider-amber::-webkit-slider-thumb {
  background: var(--amber-fea);
  box-shadow: 0 0 12px rgba(234, 88, 12, 0.7);
}

.tech-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--cyan-cad);
  border: 2px solid #06070A;
  cursor: pointer;
}

/* Toast Notification */
#hud-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px) scale(0.95);
  opacity: 0;
  z-index: 100;
  pointer-events: none;
  transition: transform 0.38s var(--ease-spring), opacity 0.25s ease;
}

#hud-toast.visible {
  transform: translateX(-50%) translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* Scroll-to-Top Aerospace HUD Button */
#scroll-to-top-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 90;
  transition: transform 0.4s var(--ease-spring), opacity 0.28s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

#scroll-to-top-btn.visible {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateY(0) scale(1) !important;
}

#scroll-to-top-btn:not(.visible) {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(20px) scale(0.9) !important;
}

/* Modal Backdrop & Sheet */
#plan-modal {
  transition: opacity 0.24s ease;
}

#plan-modal.hidden {
  display: none;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   ARCHITECTURAL LIGHT STUDIO THEME (Clean High-Contrast Engineering System)
   ========================================================================== */
html.theme-light {
  --bg-aerospace: #C5CAD3;
  --bg-panel: #DFE4EC;
  --bg-panel-solid: #DFE4EC;
  --bg-panel-elevated: #E9EDF3;

  --border-hud: #8B95A5;
  --border-hud-hover: #0369A1;
  --border-amber-hover: #C2410C;

  --cyan-cad: #0369A1;
  --cyan-soft: rgba(3, 105, 161, 0.14);
  --amber-fea: #C2410C;
  --amber-bright: #EA580C;
  --red-fea: #DC2626;
  --emerald-ok: #047857;

  --text-main: #080D1A;
  --text-muted: #1E293B;
  --text-dim: #334155;
}

html.theme-light body {
  background-color: #C5CAD3;
  color: #080D1A;
}

html.theme-light ::selection {
  background: #0369A1;
  color: #FFFFFF;
}

/* Remove dark muddy vignette in light mode so the page looks crisp and clean */
html.theme-light .viewport-vignette {
  display: none !important;
}

/* Subtle clean architectural blueprint drafting grid with rich grounding */
html.theme-light .cad-grid-bg {
  background-image:
    linear-gradient(to right, rgba(8, 13, 26, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(8, 13, 26, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
}

/* Typography & High-Contrast Colors */
html.theme-light .text-white {
  color: #080D1A !important;
}

html.theme-light .text-slate-100 {
  color: #080D1A !important;
}

html.theme-light .text-slate-200 {
  color: #131B2E !important;
}

html.theme-light .text-slate-300 {
  color: #1E293B !important;
}

html.theme-light .text-slate-400 {
  color: #334155 !important;
}

html.theme-light .text-slate-500 {
  color: #475569 !important;
}

html.theme-light .text-\[\#00F0FF\] {
  color: #0369A1 !important;
}

html.theme-light .text-cyan-400 {
  color: #0369A1 !important;
}

/* Base Surfaces & Backgrounds — Muted Architectural Slate Stone, Zero Solarization */
html.theme-light .bg-\[\#06070A\] {
  background-color: #C5CAD3 !important;
}

html.theme-light .bg-\[\#080A0F\] {
  background-color: #CFD5DF !important;
}

html.theme-light .bg-\[\#0C0F17\] {
  background-color: #DFE4EC !important;
}

html.theme-light .bg-\[\#121723\] {
  background-color: #E9EDF3 !important;
}

html.theme-light .bg-\[\#040507\] {
  background-color: #B6BDC9 !important;
}

html.theme-light .bg-white\/\[0\.02\],
html.theme-light .bg-white\/\[0\.03\],
html.theme-light .bg-white\/\[0\.04\],
html.theme-light .bg-white\/5 {
  background-color: #CFD5DF !important;
}

html.theme-light .bg-white\/10 {
  background-color: #C5CAD3 !important;
}

html.theme-light .border-white\/5,
html.theme-light .border-white\/10,
html.theme-light .border-white\/15,
html.theme-light .border-white\/20,
html.theme-light .border-white\/25 {
  border-color: #8B95A5 !important;
}

/* Light Mode Glass HUD Panels */
html.theme-light .hud-panel {
  background: #DFE4EC !important;
  border: 1.5px solid #8B95A5 !important;
  box-shadow:
    0 16px 36px -8px rgba(15, 23, 42, 0.12),
    0 2px 6px rgba(15, 23, 42, 0.05) !important;
}

html.theme-light .hud-panel-interactive:hover {
  border-color: #0369A1 !important;
  box-shadow:
    0 24px 48px -10px rgba(15, 23, 42, 0.16),
    0 0 20px -4px rgba(3, 105, 161, 0.16) !important;
}

/* Reticle Highlights */
html.theme-light .hud-reticle::before,
html.theme-light .hud-reticle::after {
  border-color: #0369A1 !important;
}

html.theme-light .hud-reticle-amber::before,
html.theme-light .hud-reticle-amber::after {
  border-color: #C2410C !important;
}

html.theme-light .hud-reticle-emerald::before,
html.theme-light .hud-reticle-emerald::after {
  border-color: #047857 !important;
}

/* Plan Cards in Light Mode */
html.theme-light .plan-card {
  background: #DFE4EC !important;
  border: 1.5px solid #8B95A5 !important;
  box-shadow: 0 10px 25px -4px rgba(15, 23, 42, 0.08) !important;
}

html.theme-light .plan-card:hover {
  border-color: #0369A1 !important;
  box-shadow:
    0 20px 40px -8px rgba(15, 23, 42, 0.14),
    0 0 16px -2px rgba(3, 105, 161, 0.14) !important;
}

html.theme-light .plan-card svg rect[stroke="#00F0FF"],
html.theme-light .plan-card svg path[stroke="#00F0FF"] {
  stroke: #0369A1 !important;
}

html.theme-light .plan-card .bg-black\/60 {
  background-color: #CFD5DF !important;
  border: 1px solid #8B95A5 !important;
}

/* Inner Result Boxes */
html.theme-light .bg-black\/50 {
  background-color: #E6EBF2 !important;
  border: 1.5px solid #8B95A5 !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05) !important;
}

html.theme-light #res-qz {
  color: #0369A1 !important;
}

html.theme-light #res-qz-kpa {
  color: #334155 !important;
}

html.theme-light #res-cc {
  color: #C2410C !important;
}

html.theme-light #res-coeffs {
  color: #334155 !important;
}

html.theme-light #res-system {
  background-color: #E6EBF2 !important;
  border: 1.5px solid #8B95A5 !important;
  color: #131B2E !important;
  font-weight: 600 !important;
}

html.theme-light #hvac-res-fh {
  color: #080D1A !important;
}

html.theme-light #hvac-res-af {
  color: #1E293B !important;
}

html.theme-light #hvac-res-mot {
  color: #C2410C !important;
}

html.theme-light #hvac-res-mr {
  color: #1E293B !important;
}

html.theme-light #hvac-res-tension {
  color: #0369A1 !important;
}

html.theme-light #hvac-res-clips {
  color: #047857 !important;
}

html.theme-light #hvac-res-status {
  color: #C2410C !important;
}

/* CRITICAL FIX FOR FLOATING SLIDER THUMBS: HIGH-CONTRAST SOLID TRACK */
html.theme-light .tech-slider {
  background: #8B95A5 !important;
  height: 8px !important;
  border-radius: 9999px !important;
}

html.theme-light .tech-slider::-webkit-slider-thumb {
  width: 22px !important;
  height: 22px !important;
  background: #0369A1 !important;
  border: 3px solid #E6EBF2 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

html.theme-light .tech-slider-amber::-webkit-slider-thumb {
  width: 22px !important;
  height: 22px !important;
  background: #C2410C !important;
  border: 3px solid #E6EBF2 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

html.theme-light .tech-slider::-moz-range-track {
  background: #8B95A5 !important;
  height: 8px !important;
  border-radius: 9999px !important;
}

html.theme-light .tech-slider::-moz-range-thumb {
  width: 22px !important;
  height: 22px !important;
  background: #0369A1 !important;
  border: 3px solid #E6EBF2 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

/* Calculator Exposure & Risk Category Selection Buttons */
html.theme-light #calc-exposure-group button,
html.theme-light #calc-risk-group button {
  background-color: #CFD5DF !important;
  border: 1.5px solid #8B95A5 !important;
  color: #1E293B !important;
  font-weight: 600 !important;
}

html.theme-light #calc-exposure-group button:hover,
html.theme-light #calc-risk-group button:hover {
  background-color: #C5CAD3 !important;
  color: #080D1A !important;
}

html.theme-light #calc-exposure-group button.active,
html.theme-light #calc-risk-group button.active {
  background-color: #0369A1 !important;
  border-color: #0369A1 !important;
  color: #FFFFFF !important;
  font-weight: 800 !important;
}

/* Form Controls & Inputs (Quote Form) */
html.theme-light input,
html.theme-light select,
html.theme-light textarea {
  background-color: #E8EDF4 !important;
  color: #080D1A !important;
  border: 1.5px solid #8B95A5 !important;
  font-weight: 500 !important;
}

html.theme-light select option {
  background-color: #DFE4EC !important;
  color: #080D1A !important;
}

html.theme-light input::placeholder,
html.theme-light textarea::placeholder {
  color: #475569 !important;
}

html.theme-light input:focus,
html.theme-light select:focus,
html.theme-light textarea:focus {
  background-color: #F1F4F9 !important;
  border-color: #0369A1 !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.18) !important;
}

/* Buttons & CTAs */
html.theme-light .cta-click-to-plans {
  background: linear-gradient(135deg, #0369A1 0%, #075985 100%) !important;
  color: #FFFFFF !important;
  box-shadow: 0 4px 18px -2px rgba(3, 105, 161, 0.45) !important;
}

html.theme-light .cta-click-to-plans:hover {
  filter: brightness(1.08) !important;
  box-shadow: 0 6px 24px -2px rgba(3, 105, 161, 0.6) !important;
}

html.theme-light .cta-corporate {
  background: rgba(194, 65, 12, 0.12) !important;
  color: #C2410C !important;
  border: 1.5px solid rgba(194, 65, 12, 0.5) !important;
}

html.theme-light .cta-corporate:hover {
  background: #C2410C !important;
  color: #FFFFFF !important;
  border-color: #C2410C !important;
}

/* Header Nav & Controls */
html.theme-light .nav-seq-link {
  color: #1E293B !important;
}

html.theme-light .nav-seq-link:hover {
  color: #0369A1 !important;
  background-color: rgba(8, 13, 26, 0.08) !important;
}

/* Operational Hub & Sections */
html.theme-light .operational-hub {
  border-top: 1.5px solid #8B95A5 !important;
  box-shadow: 0 -20px 60px rgba(15, 23, 42, 0.08) !important;
}

html.theme-light .altimeter-rail span {
  color: #334155 !important;
}

html.theme-light .altimeter-rail .w-0\.5 {
  background-color: #8B95A5 !important;
}

/* Modal & Toast */
html.theme-light #plan-modal {
  background-color: rgba(8, 13, 26, 0.65) !important;
}

html.theme-light #plan-modal > div {
  background: #DFE4EC !important;
  border: 1.5px solid #8B95A5 !important;
  box-shadow: 0 30px 80px -15px rgba(15, 23, 42, 0.28) !important;
}

html.theme-light #close-plan-modal {
  background: #CFD5DF !important;
  color: #080D1A !important;
}

html.theme-light #close-plan-modal:hover {
  background: #C2410C !important;
  color: #FFFFFF !important;
}

html.theme-light #hud-toast {
  background: #DFE4EC !important;
  border: 1.5px solid #0369A1 !important;
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.2) !important;
  color: #080D1A !important;
}

html.theme-light #toast-msg {
  color: #080D1A !important;
}

html.theme-light footer {
  background-color: #B4BCC8 !important;
  border-top: 1.5px solid #8B95A5 !important;
}

/* Light Mode Scroll-to-Top Button */
html.theme-light #scroll-to-top-btn {
  background: #DFE4EC !important;
  border: 1.5px solid #8B95A5 !important;
  box-shadow: 0 16px 36px -8px rgba(15, 23, 42, 0.22) !important;
  color: #080D1A !important;
}

html.theme-light #scroll-to-top-btn:hover {
  border-color: #0369A1 !important;
  box-shadow: 0 20px 42px -6px rgba(3, 105, 161, 0.3) !important;
}

html.theme-light #scroll-to-top-progress {
  color: #0369A1 !important;
}

html.theme-light #scroll-to-top-btn i {
  color: #0369A1 !important;
}

html.theme-light #scroll-to-top-btn span {
  color: #080D1A !important;
}
