/* ===== BMS CUSTOM BRAND & ANIMATION LAYER (LIGHT THERMAL) ===== */

:root {
  --primary: #a63b00;
  --primary-container: #ff5f00;
  --primary-fixed: #ffdbce;
  --secondary: #0042c7;
  --secondary-container: #0056fd;
  --secondary-fixed: #dce1ff;
  --secondary-fixed-dim: #b6c4ff;
  
  --background: #f8f9fa;
  --surface: #f8f9fa;
  --surface-container-low: #f3f4f5;
  --surface-container-high: #e7e8e9;
  --on-surface: #191c1d;
  --on-surface-var: #5b4137;
  --inverse-surface: #2e3132;
  
  --outline: #8f7065;
  --outline-variant: #e4bfb1;
  --error: #ba1a1a;
  
  --font-display: 'Hanken Grotesk', sans-serif;
  --font-body: 'Hanken Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Body Adjustments */
body {
  background-color: var(--surface);
  color: var(--on-surface);
  font-family: var(--font-body);
  overflow-x: hidden;
  cursor: none; /* Hide default cursor on desktop */
}

section > *:not(.section-watermark) {
  z-index: 10;
}
section > *:not(.section-watermark):not([class*="absolute"]) {
  position: relative;
}

@media (max-width: 1024px) {
  body {
    cursor: auto; /* Show default cursor on mobile/tablet */
  }
  #cursor {
    display: none !important;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 3px;
  height: 3px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 9999px;
}

/* Custom Cursor */
#cursor {
  position: fixed;
  width: 18px;
  height: 18px;
  border: 1.5px solid rgba(255, 95, 0, 0.6);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.12s var(--ease-out), height 0.12s var(--ease-out), background-color 0.12s var(--ease-out);
}
#cursor.hover {
  width: 44px;
  height: 44px;
  background-color: rgba(255, 95, 0, 0.08);
  border-color: var(--primary-container);
}

/* Scroll Progress Bar */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-container), var(--secondary-container));
  z-index: 9999;
  width: 0%;
  transform-origin: left center;
}

/* Ambient Running Lines */
.running-line-h {
  position: absolute;
  height: 1px;
  width: 100%;
  background: repeating-linear-gradient(90deg, var(--primary) 0, var(--primary) 10px, transparent 10px, transparent 20px);
  background-size: 40px 100%;
  z-index: 0;
  opacity: 0.2;
  animation: flow-h 4s linear infinite;
  pointer-events: none;
}
.running-line-v {
  position: absolute;
  width: 1px;
  height: 100%;
  background: repeating-linear-gradient(180deg, var(--secondary-container) 0, var(--secondary-container) 10px, transparent 10px, transparent 20px);
  background-size: 100% 40px;
  z-index: 0;
  opacity: 0.2;
  animation: flow-v 4s linear infinite;
  pointer-events: none;
}
.reverse-flow {
  animation-direction: reverse;
}
@keyframes flow-h {
  from { background-position: 0 0; }
  to { background-position: -40px 0; }
}
@keyframes flow-v {
  from { background-position: 0 0; }
  to { background-position: 0 -40px; }
}

/* Ghost Grid Background */
.ghost-grid {
  background-image:
    linear-gradient(to right, #e7e8e9 1px, transparent 1px),
    linear-gradient(to bottom, #e7e8e9 1px, transparent 1px);
  background-size: 24px 24px;
}

/* Viewport Magnifier & Hero Zoom */
.circle-zoom-container {
  position: relative;
  overflow: hidden;
}
.circle-lens {
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 2px solid var(--primary-container);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.1s ease;
  box-shadow: 0 0 0 9999px rgba(248, 249, 250, 0.6);
  background-repeat: no-repeat;
  z-index: 20;
}
.circle-zoom-container:hover .circle-lens {
  opacity: 1;
}
.zoom-data-tag {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--on-surface);
  color: var(--surface);
  padding: 4px 8px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 21;
}
.circle-zoom-container:hover .zoom-data-tag {
  opacity: 1;
}

/* Scan Line Sweep */
.scan-sweep {
  position: absolute;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 95, 0, 0.15), transparent);
  animation: scan-sweep-anim 4s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}
@keyframes scan-sweep-anim {
  0% { transform: translateX(0); }
  100% { transform: translateX(200%); }
}

/* Image Glitch Effects */
.image-glitch {
  position: relative;
  display: inline-block;
  overflow: hidden;
}
.image-glitch::before,
.image-glitch::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: inherit;
  background-size: cover;
  opacity: 0.4;
  mix-blend-mode: color-burn;
  pointer-events: none;
}
.image-glitch::before {
  background-color: rgba(255, 95, 0, 0.3);
  animation: glitch-anim 2s infinite alternate-reverse;
  clip-path: polygon(0 20%, 100% 20%, 100% 35%, 0 35%);
}
.image-glitch::after {
  background-color: rgba(0, 86, 253, 0.3);
  animation: glitch-anim 3s infinite alternate;
  clip-path: polygon(0 60%, 100% 60%, 100% 75%, 0 75%);
}
@keyframes glitch-anim {
  20% { transform: translate(-2px, 2px); }
  40% { transform: translate(-2px, -2px); }
  60% { transform: translate(2px, 2px); }
  80% { transform: translate(2px, -2px); }
}

/* Marquee Left Infinite Scroll */
.marquee-track {
  display: inline-flex;
  animation: marquee-anim 25s linear infinite;
}
.marquee-track:hover {
  animation-play-state: paused;
}
@keyframes marquee-anim {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Telemetry Card Transitions */
.reveal, .reveal-left, .reveal-right {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.reveal-left {
  transform: translateX(-40px);
}
.reveal-right {
  transform: translateX(40px);
}
.reveal.visible, .reveal-left.visible, .reveal-right.visible {
  opacity: 1;
  transform: none;
}

/* Animated Dotted Process Connection Line */
.process-line {
  position: absolute;
  border-top: 1.5px dashed var(--primary-container);
  opacity: 0.3;
  z-index: 0;
  width: 0%;
  transition: width 1.5s ease-out;
}
.process-line.active {
  width: calc(100% - 128px);
}

/* Tab Panel Switch Content Transition */
.tab-panel {
  display: none;
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}
.tab-panel.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}
.tab-btn.active {
  background-color: var(--primary);
  color: var(--surface);
  border-color: var(--primary);
}

/* FAQ Accordion Transitions */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0, 1, 0, 1);
}
.faq-item.open .faq-answer {
  max-height: 500px;
  transition: max-height 0.4s ease-in-out;
}
.faq-item.open .faq-arrow {
  transform: rotate(180deg);
}

/* Terminal Typewriter Cursor */
#term-cursor {
  animation: cursor-blink 0.8s step-end infinite;
  color: var(--primary-container);
}
@keyframes cursor-blink {
  50% { opacity: 0; }
}

/* Vibration Waveform Bars */
#waveform-bars .bar {
  flex: 1;
  background: linear-gradient(180deg, var(--primary-container), var(--secondary-container));
  border-top: 1px solid var(--surface);
  min-height: 6px;
  animation: pulse-bar 1.5s ease-in-out infinite alternate;
}
@keyframes pulse-bar {
  from { height: 10px; }
  to { height: 100%; }
}

/* Alert dot flashing */
.alert-dot {
  animation: alert-blink 1.2s infinite alternate;
}
@keyframes alert-blink {
  0% { opacity: 1; }
  100% { opacity: 0.3; }
}

/* Section Number Watermark Parallax */
.section-watermark {
  position: absolute;
  top: 40px;
  right: -10px;
  font-family: var(--font-display);
  font-size: 240px;
  line-height: 1;
  pointer-events: none;
  user-select: none;
  -webkit-text-stroke: 1px rgba(25, 28, 29, 0.08);
  color: transparent;
  z-index: 0;
  will-change: transform;
}

/* Slide In Animations */
.slide-in-left {
  opacity: 0;
  transform: translateX(-80px);
  transition: all 0.6s var(--ease-out);
}
.slide-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}
.slide-in-right {
  opacity: 0;
  transform: translateX(80px);
  transition: all 0.6s var(--ease-out);
}
.slide-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}
.slide-in-up {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.6s var(--ease-out);
}
.slide-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Processing overlay for images */
.processing-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 95, 0, 0.25), transparent);
  animation: scan-sweep-anim 0.8s ease-in-out forwards;
  pointer-events: none;
  z-index: 2;
}

/* Image sequence fade */
.img-fade-in {
  opacity: 0;
  transition: opacity 0.8s ease;
}
.img-fade-in.visible {
  opacity: 1;
}

/* Border glow for cost statement */
.border-pulse {
  animation: borderPulse 2s ease-in-out infinite alternate;
}
@keyframes borderPulse {
  from { border-left-color: var(--primary); }
  to { border-left-color: var(--primary-container); }
}

/* Pulsing subtle elements */
@keyframes pulse-subtle {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}
.animate-pulseSubtle {
  animation: pulse-subtle 2s infinite;
}

/* Brutalist Button Styles */
.btn-brutal {
  position: relative;
  border-radius: 0;
  border: 2px solid var(--on-surface);
  box-shadow: 4px 4px 0 var(--on-surface);
  transition: transform 0.1s var(--ease-out), box-shadow 0.1s var(--ease-out);
}
.btn-brutal:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--on-surface);
}
.btn-brutal:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--on-surface);
}
.btn-brutal.bg-primary-container {
  box-shadow: 4px 4px 0 var(--on-surface);
}
.btn-brutal.bg-primary-container:hover {
  box-shadow: 6px 6px 0 var(--on-surface);
}

/* Custom Hamburger Styles */
.ham-bar {
  width: 24px;
  height: 2px;
  background-color: var(--on-surface);
  transition: all 0.3s ease;
}
#hamburger.open .ham-bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
#hamburger.open .ham-bar:nth-child(2) {
  opacity: 0;
}
#hamburger.open .ham-bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Team and Mentor Photos */
.member-photo-frame {
  position: relative;
  border: 2px solid var(--on-surface);
  box-shadow: 4px 4px 0 var(--on-surface);
}
.member-photo-frame::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--primary-container);
  border-right: 2px solid var(--primary-container);
}

/* Kinetic Frame */
.kinetic-frame {
  position: relative;
  width: 100%;
  min-height: 400px;
  background: transparent;
  border: 4px solid var(--on-surface);
  box-shadow: 12px 12px 0px var(--primary-container);
  transition: transform 0.3s ease;
}
.corner {
  position: absolute;
  width: 60px;
  height: 60px;
  border-color: var(--primary-container);
  pointer-events: none;
}
.corner-tl { top: -8px; left: -8px; border-top: 12px solid; border-left: 12px solid; }
.corner-tr { top: -8px; right: -8px; border-top: 12px solid; border-right: 12px solid; }
.corner-bl { bottom: -8px; left: -8px; border-bottom: 12px solid; border-left: 12px solid; }
.corner-br { bottom: -8px; right: -8px; border-bottom: 12px solid; border-right: 12px solid; }
.sticker {
  background: var(--on-surface);
  color: var(--surface);
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 4px 8px;
  text-transform: uppercase;
  position: absolute;
  z-index: 10;
}
.sticker-orange {
  background: var(--primary-container);
  color: var(--surface);
}
.border-texture {
  position: absolute;
  inset: 0;
  border: 20px solid transparent;
  border-image-source: url('https://lh3.googleusercontent.com/aida-public/AB6AXuA2L3T6eBxasZd4rnHKrX--VDHvcR8qQyy2orCwqpeMU4n44jssevrP0WQPT2XZmFlQEPmvtUlH8KnUvl1PWJeoJqCv4LVAe57yFrGeXWTAKqJGqcOt7KnFTPVO6NBwpoXmg18nYqvn1FMtqnKMpdCkuOK5RSlY8-WF_4cUbZPycPGU_LI-nPt-tfXYTPrNxg0WbXzIlk3GlmxTtgGSI_8mVf3C6InNyY3gnXSoSpDWPe_T861ThlZyDFCxSwrbScRwLLfrlg_cpEs');
  border-image-slice: 100;
  border-image-repeat: round;
  opacity: 0.15;
  pointer-events: none;
  mix-blend-mode: multiply;
}
.crosshair {
  position: absolute;
  width: 30px;
  height: 30px;
  border: 1px solid var(--primary-container);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
}
.crosshair::before { content: ''; position: absolute; width: 40px; height: 1px; background: var(--primary-container); }
.crosshair::after { content: ''; position: absolute; height: 40px; width: 1px; background: var(--primary-container); }

/* ===== 3D SHOWCASE SECTION STYLES ===== */
.technical-grid {
  background-size: 40px 40px;
  background-image:
    linear-gradient(to right, rgba(0,0,0,0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0,0,0,0.05) 1px, transparent 1px);
}
.sticker-label {
  clip-path: polygon(0 0, 100% 0, 100% 70%, 90% 100%, 0 100%);
}
.scan-line {
  width: 100%;
  height: 2px;
  background: #a63b00;
  position: absolute;
  top: 0;
  animation: scan 4s linear infinite;
  z-index: 20;
  opacity: 0.3;
  pointer-events: none;
}
@keyframes scan {
  0% { top: 0%; opacity: 0; }
  50% { opacity: 0.5; }
  100% { top: 100%; opacity: 0; }
}
.hover-lift:hover {
  transform: translate(-4px, -4px);
  box-shadow: 4px 4px 0px 0px #0042c7;
}
.floating-ui {
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.neo-button-shadow {
  box-shadow: 4px 4px 0px 0px #191c1d;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.neo-button-shadow:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0px 0px #191c1d;
}

/* ===== ROBOT UNDERLAY — Scroll-driven 3D background ===== */

#robot-underlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
}

#robot-underlay canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* Accessibility: disable for reduced-motion */
@media (prefers-reduced-motion: reduce) {
  #robot-underlay {
    display: none !important;
  }
}

/* Mobile: hide entirely for performance */
@media (max-width: 767px) {
  #robot-underlay {
    display: none !important;
  }
}

/* ===== ROBOT SHOWCASE OVERRIDES ===== */
#robot-underlay.showcase-mode {
  z-index: 9995 !important; /* Above the backdrop (9990) but below the UI (10000) */
  pointer-events: auto !important; /* Enable orbit controls click/drag */
}

#robot-underlay.dock-active {
  z-index: 50 !important; /* Above main to render on top of the frame */
}

#robot-underlay.overlay-active {
  z-index: 45 !important; /* Render on top of cards on alternating sections */
}

/* ===== DARK MODE ===== */
html.dark {
  --background: #0a0c0e;
  --surface: #121418;
  --surface-container-low: #1a1e24;
  --surface-container-high: #252932;
  --on-surface: #e8eaed;
  --on-surface-var: #b0b5bd;
  --inverse-surface: #f8f9fa;
  --primary: #ff5f00;
  --primary-container: #ff8533;
  --primary-fixed: #3a1a00;
  --secondary: #6699ff;
  --secondary-container: #0044cc;
  --secondary-fixed: #001a4d;
  --secondary-fixed-dim: #334d80;
  --outline: #6b7280;
  --outline-variant: #374151;
  --error: #ff4444;
}
html.dark .ghost-grid {
  background-image:
    linear-gradient(to right, #252932 1px, transparent 1px),
    linear-gradient(to bottom, #252932 1px, transparent 1px);
}
html.dark #cursor {
  border-color: rgba(255, 95, 0, 0.8);
}
html.dark .section-watermark {
  -webkit-text-stroke: 1px rgba(232, 234, 237, 0.06);
}


