/* Custom Styles for HUBAP Website (Unified Elegant Theme) */

/* iOS WebKit & Safari Strict Viewport Layout */
html {
  scroll-behavior: smooth;
}

html, body {
  width: 100%;
  max-width: 100%;
  position: relative;
  -webkit-text-size-adjust: 100%;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #07090e;
}
::-webkit-scrollbar-thumb {
  background: #1e2638;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #2a344b;
}

/* Scroll progress bar (Unified HUBAP Crimson) */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #b91c1c 0%, #ef4444 50%, #ff3b5c 100%);
  z-index: 100;
  width: 0%;
  transition: width 0.1s ease-out;
}

/* Background mesh grid with subtle radial glow */
.bg-grid {
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
}

/* Subtle spotlight card hover effect */
.spotlight-card {
  position: relative;
  background: rgba(13, 17, 26, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(12px);
  overflow: hidden;
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.spotlight-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    500px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(239, 68, 68, 0.06),
    transparent 40%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.spotlight-card:hover::before {
  opacity: 1;
}

.spotlight-card:hover {
  border-color: rgba(239, 68, 68, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -8px rgba(239, 68, 68, 0.12);
}

/* Scroll reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Logo glow container animation */
.logo-glow {
  position: relative;
}
.logo-glow::after {
  content: '';
  position: absolute;
  inset: -4px;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.3) 0%, transparent 70%);
  filter: blur(8px);
  z-index: -1;
  opacity: 0.6;
  animation: pulse-glow 3s ease-in-out infinite alternate;
}

@keyframes pulse-glow {
  0% { opacity: 0.3; transform: scale(0.95); }
  100% { opacity: 0.7; transform: scale(1.05); }
}

/* Live interactive node pulse */
.node-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: relative;
}

.node-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  animation: node-ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes node-ping {
  75%, 100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

/* Glassmorphism navigation bar */
.glass-header {
  background: rgba(7, 9, 14, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* ==================== LIGHT MODE ENGINE ==================== */
html.light {
  color-scheme: light;
}

html.light body {
  background-color: #f8fafc !important;
  color: #0f172a !important;
}

html.light .bg-grid {
  background-image: 
    linear-gradient(to right, rgba(15, 23, 42, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.05) 1px, transparent 1px) !important;
}

html.light .glass-header {
  background: rgba(255, 255, 255, 0.92) !important;
  border-bottom-color: rgba(226, 232, 240, 0.9) !important;
  box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.05) !important;
}

html.light .bg-surface-950,
html.light [class*="bg-surface-950"] {
  background-color: #f1f5f9 !important;
}

html.light .bg-surface-900,
html.light [class*="bg-surface-900"] {
  background-color: #ffffff !important;
}

html.light .bg-surface-850,
html.light [class*="bg-surface-850"] {
  background-color: #f8fafc !important;
}

html.light .border-slate-800,
html.light [class*="border-slate-800"],
html.light [class*="border-slate-700"] {
  border-color: #e2e8f0 !important;
}

html.light .spotlight-card {
  background: rgba(255, 255, 255, 0.95) !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.06) !important;
}

html.light .spotlight-card:hover {
  border-color: rgba(239, 68, 68, 0.4) !important;
  box-shadow: 0 14px 35px -10px rgba(239, 68, 68, 0.15) !important;
}

html.light .text-white {
  color: #0f172a !important;
}

html.light .bg-hubap-500,
html.light .bg-hubap-600,
html.light [class*="bg-hubap-500"],
html.light [class*="bg-hubap-600"],
html.light .bg-hubap-500 *,
html.light .bg-hubap-600 * {
  color: #ffffff !important;
}

html.light .text-slate-100,
html.light .text-slate-200 {
  color: #1e293b !important;
}

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

html.light .text-slate-400 {
  color: #64748b !important;
}

/* Light mode link & interactive elements hover state fix */
html.light nav a:hover,
html.light #mobile-nav-menu a:hover,
html.light [class*="hover:text-white"]:hover {
  color: #ef4444 !important;
}

html.light ::-webkit-scrollbar-track {
  background: #f1f5f9;
}
html.light ::-webkit-scrollbar-thumb {
  background: #cbd5e1;
}
