/* ==========================================================================
   BILDAD MWANGI — SYSTEMS ARCHITECT & FRONTIER AI ENGINEER
   Design System: Obsidian Noir, Cosmic Midnight Blue, Imperial Gold & Crisp Ivory
   Aesthetic: Frontier Tech (NVIDIA / Anthropic / Google caliber)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;0,700;1,400;1,600&family=JetBrains+Mono:ital,wght@0,300;0,400;0,500;0,700;1,400&family=Plus+Jakarta+Sans:wght@200;300;400;500;600;700;800&family=Syne:wght@500;600;700;800&display=swap');

/* ==========================================================================
   DESIGN TOKENS & SYSTEM VARIABLES
   ========================================================================== */

:root {
  /* Typography Tokens */
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-display: 'Syne', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Imperial & Champagne Gold Spectrum */
  --gold-primary: #D4AF37;
  --gold-light: #F3E5AB;
  --gold-bright: #E5C158;
  --gold-antique: #A38020;
  --gold-ochre: #5C480E;
  --gold-glow: rgba(212, 175, 55, 0.2);
  --gold-glow-strong: rgba(212, 175, 55, 0.4);

  /* Deep Blue & Midnight Electric Spectrum */
  --blue-deep: #060B18;
  --blue-midnight: #0A1329;
  --blue-royal: #1B2F6E;
  --blue-electric: #2563EB;
  --blue-cyan: #38BDF8;
  --blue-glow: rgba(37, 99, 235, 0.22);
  --blue-glow-strong: rgba(56, 189, 248, 0.35);

  /* Motion & Easing */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.25, 0.1, 0.25, 1);
  --transition-fast: 0.2s var(--ease-smooth);
  --transition-base: 0.35s var(--ease-smooth);
  --transition-slow: 0.7s var(--ease-out-expo);
}

/* --------------------------------------------------------------------------
   THEME: OBSIDIAN COSMIC NOIR (Dark Luxury + Deep Blue & Gold — Default)
   -------------------------------------------------------------------------- */
body.theme-dark {
  --bg-primary: #05070E;
  --bg-surface: #090E1D;
  --bg-elevated: #101830;
  --bg-glass: rgba(9, 14, 29, 0.78);
  --bg-glass-card: rgba(16, 24, 48, 0.72);

  --text-primary: #FAFAF9;
  --text-secondary: #CBD5E1;
  --text-muted: #7E8DA5;
  --text-dim: #455169;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-blue: rgba(37, 99, 235, 0.26);
  --border-gold: rgba(212, 175, 55, 0.26);
  --border-gold-bright: rgba(229, 193, 88, 0.55);

  --card-shadow: 0 20px 45px -15px rgba(2, 6, 20, 0.85), 0 0 1px 1px rgba(212, 175, 55, 0.14);
  --card-shadow-hover: 0 25px 55px -12px rgba(2, 6, 20, 0.95), 0 0 25px 2px rgba(212, 175, 55, 0.26), 0 0 15px rgba(37, 99, 235, 0.2);
  --terminal-bg: #070B16;
}

/* --------------------------------------------------------------------------
   THEME: IVORY EXECUTIVE (Crisp White + Deep Blue & Gold)
   -------------------------------------------------------------------------- */
body.theme-light {
  --bg-primary: #F8FAFD;
  --bg-surface: #EFF3F9;
  --bg-elevated: #FFFFFF;
  --bg-glass: rgba(248, 250, 253, 0.88);
  --bg-glass-card: rgba(255, 255, 255, 0.92);

  --text-primary: #0A1128;
  --text-secondary: #1E293B;
  --text-muted: #53627A;
  --text-dim: #94A3B8;

  --border-subtle: rgba(10, 17, 40, 0.09);
  --border-blue: rgba(27, 47, 110, 0.22);
  --border-gold: rgba(212, 175, 55, 0.38);
  --border-gold-bright: rgba(180, 140, 30, 0.65);

  --card-shadow: 0 20px 40px -15px rgba(10, 17, 40, 0.07), 0 0 1px 1px rgba(212, 175, 55, 0.2);
  --card-shadow-hover: 0 25px 50px -12px rgba(10, 17, 40, 0.15), 0 0 25px 2px rgba(212, 175, 55, 0.28);
  --terminal-bg: #0B1224;
}

/* ==========================================================================
   BASE & RESET
   ========================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  overflow-x: hidden;
  position: relative;
  transition: background-color var(--transition-base), color var(--transition-base);
  line-height: 1.6;
}

::selection {
  background-color: var(--gold-primary);
  color: #05070E;
}

/* ==========================================================================
   ATMOSPHERIC GRAIN & WEBGL CANVAS
   ========================================================================== */

.grain-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Cosmic Ambient Gradients */
.cosmic-radial-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
  background: 
    radial-gradient(ellipse 65% 55% at 80% 25%, rgba(37, 99, 235, 0.12) 0%, transparent 65%),
    radial-gradient(ellipse 45% 45% at 20% 70%, rgba(212, 175, 55, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 50% -10%, rgba(27, 47, 110, 0.18) 0%, transparent 70%);
}

#webgl-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
  transition: opacity 0.5s ease;
}

/* Scroll Progress Indicator */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2.5px;
  background: linear-gradient(90deg, var(--blue-royal), var(--blue-cyan), var(--gold-primary), var(--gold-light));
  z-index: 10001;
  width: 0%;
  transition: width 0.1s linear;
}

/* ==========================================================================
   CUSTOM DUAL-PHASE LIQUID GOLD/BLUE CURSOR
   ========================================================================== */

.custom-cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 6px;
  height: 6px;
  background: var(--gold-primary);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
  transition: width 0.2s ease, height 0.2s ease, background-color 0.2s ease;
  box-shadow: 0 0 10px var(--gold-primary);
}

.custom-cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-gold-bright);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.25s var(--ease-out-expo), height 0.25s var(--ease-out-expo), border-color 0.2s ease, background 0.2s ease;
}

.custom-cursor-ring.cursor-hover {
  width: 64px;
  height: 64px;
  border-color: var(--blue-cyan);
  background: rgba(37, 99, 235, 0.1);
  backdrop-filter: blur(2px);
}

@media (max-width: 768px), (pointer: coarse) {
  .custom-cursor-dot, .custom-cursor-ring {
    display: none !important;
  }
}

/* ==========================================================================
   TYPOGRAPHY UTILITIES
   ========================================================================== */

.font-serif { font-family: var(--font-serif); }
.font-display { font-family: var(--font-display); }
.font-sans { font-family: var(--font-sans); }
.font-mono { font-family: var(--font-mono); }

/* Liquid Gold Gradient Text */
.text-gold-gradient {
  background: linear-gradient(135deg, #FFF6DD 0%, #F3E5AB 25%, #E5C158 55%, #D4AF37 80%, #997A15 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* Deep Blue to Cyan Gradient Text */
.text-blue-gradient {
  background: linear-gradient(135deg, #93C5FD 0%, #38BDF8 50%, #2563EB 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

body.theme-light .text-gold-gradient {
  background: linear-gradient(135deg, #8E6D14 0%, #C5A059 45%, #7A5E0B 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gold { color: var(--gold-primary); }
.text-gold-light { color: var(--gold-light); }
.text-blue-cyan { color: var(--blue-cyan); }
.text-primary-var { color: var(--text-primary); }
.text-secondary-var { color: var(--text-secondary); }
.text-muted-var { color: var(--text-muted); }

/* Monumental Hero Title */
.hero-monument-title {
  font-family: var(--font-serif);
  font-weight: 300;
  line-height: 0.98;
  letter-spacing: -0.025em;
  font-size: clamp(2.7rem, 6.8vw, 6.2rem);
}

.hero-monument-title em {
  font-style: italic;
  font-family: var(--font-serif);
  color: var(--gold-light);
}

body.theme-light .hero-monument-title em {
  color: var(--gold-antique);
}

/* ==========================================================================
   BUTTONS & LUXURY MAGNETIC CTAS
   ========================================================================== */

.btn-luxury-gold {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.85rem 1.85rem;
  background: linear-gradient(135deg, #ECC870 0%, #D4AF37 50%, #B38F2C 100%);
  color: #05070E;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 9999px;
  text-decoration: none;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 20px var(--gold-glow), 0 1px 2px rgba(0,0,0,0.2);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  cursor: pointer;
}

.btn-luxury-gold::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transition: left 0.6s ease;
}

.btn-luxury-gold:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 30px var(--gold-glow-strong), 0 2px 4px rgba(0,0,0,0.3);
}

.btn-luxury-gold:hover::after {
  left: 100%;
}

.btn-luxury-blue {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.85rem 1.85rem;
  background: linear-gradient(135deg, #1E40AF 0%, #1B2F6E 50%, #0D1B3E 100%);
  color: #FAFAF9;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 9999px;
  text-decoration: none;
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 4px 20px var(--blue-glow);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  cursor: pointer;
}

.btn-luxury-blue:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 30px var(--blue-glow-strong);
}

.btn-luxury-outline {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.85rem 1.85rem;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 9999px;
  text-decoration: none;
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(10px);
  transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
  cursor: pointer;
}

.btn-luxury-outline:hover {
  border-color: var(--gold-primary);
  color: var(--gold-light);
  background: rgba(212, 175, 55, 0.08);
  transform: translateY(-2px);
}

/* ==========================================================================
   GLASS PANELS & CARDS
   ========================================================================== */

.glass-panel {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-subtle);
  border-radius: 1.25rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--card-shadow);
  transition: border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
}

.glass-panel:hover {
  border-color: var(--border-gold);
  box-shadow: var(--card-shadow-hover);
}

.glass-panel-blue {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-blue);
  border-radius: 1.25rem;
  backdrop-filter: blur(16px);
  box-shadow: 0 20px 45px -15px rgba(2, 6, 20, 0.85), 0 0 1px 1px rgba(37, 99, 235, 0.2);
  transition: all var(--transition-base);
}

.glass-panel-blue:hover {
  border-color: var(--blue-cyan);
  box-shadow: 0 25px 55px -12px rgba(2, 6, 20, 0.95), 0 0 25px 2px rgba(56, 189, 248, 0.3);
}

.glass-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

/* ==========================================================================
   KINETIC INFINITE MARQUEE
   ========================================================================== */

.marquee-container {
  display: flex;
  overflow: hidden;
  user-select: none;
  gap: 2rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(9, 14, 29, 0.6);
  backdrop-filter: blur(12px);
  position: relative;
  z-index: 10;
}

.marquee-content {
  flex-shrink: 0;
  display: flex;
  justify-content: space-around;
  min-width: 100%;
  gap: 2rem;
  animation: scrollMarquee 38s linear infinite;
}

.marquee-item {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 2rem;
  white-space: nowrap;
}

.marquee-star {
  color: var(--gold-primary);
  font-size: 0.9rem;
}

.marquee-star-blue {
  color: var(--blue-cyan);
  font-size: 0.9rem;
}

@keyframes scrollMarquee {
  from { transform: translateX(0); }
  to { transform: translateX(calc(-100% - 2rem)); }
}

.marquee-container:hover .marquee-content {
  animation-play-state: paused;
}

/* ==========================================================================
   AUDIO EQUALIZER (Synthesizer Widget)
   ========================================================================== */

.audio-equalizer {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.audio-bar {
  width: 2.5px;
  background: var(--gold-primary);
  border-radius: 1px;
  transition: height 0.2s ease;
}

.audio-bar:nth-child(1) { height: 6px; }
.audio-bar:nth-child(2) { height: 12px; }
.audio-bar:nth-child(3) { height: 8px; }

.audio-active .audio-bar:nth-child(1) { animation: soundBar1 0.8s ease-in-out infinite alternate; }
.audio-active .audio-bar:nth-child(2) { animation: soundBar2 0.6s ease-in-out infinite alternate; }
.audio-active .audio-bar:nth-child(3) { animation: soundBar3 0.7s ease-in-out infinite alternate; }

@keyframes soundBar1 { 0% { height: 4px; } 100% { height: 14px; } }
@keyframes soundBar2 { 0% { height: 12px; } 100% { height: 5px; } }
@keyframes soundBar3 { 0% { height: 6px; } 100% { height: 13px; } }

/* ==========================================================================
   INTERACTIVE AI TERMINAL (Synapse / Vector One Lab)
   ========================================================================== */

.terminal-window {
  background: var(--terminal-bg);
  border: 1px solid var(--border-gold);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.9), 0 0 30px rgba(37, 99, 235, 0.15);
}

.terminal-header {
  background: rgba(16, 24, 48, 0.85);
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.terminal-controls {
  display: flex;
  gap: 6px;
}

.terminal-btn {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-btn.close { background: #FF5F56; }
.terminal-btn.minimize { background: #FFBD2E; }
.terminal-btn.maximize { background: #27C93F; }

.terminal-body {
  padding: 1.5rem;
  min-height: 290px;
  max-height: 380px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.65;
}

.terminal-body::-webkit-scrollbar {
  width: 5px;
}

.terminal-body::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.3);
  border-radius: 4px;
}

.terminal-prompt-prefix {
  color: var(--gold-primary);
  font-weight: 700;
}

.terminal-cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: var(--gold-primary);
  vertical-align: middle;
  animation: blinkCursor 0.9s infinite;
}

@keyframes blinkCursor {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* ==========================================================================
   INTERACTIVE HARDWARE DEVICE CHASSIS (MOCKUP STUDIO)
   ========================================================================== */

.mockup-frame {
  background: #0A0E1A;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1.25rem;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.95), 0 0 40px rgba(37, 99, 235, 0.12);
  overflow: hidden;
  transition: all 0.5s var(--ease-out-expo);
}

.mockup-macbook-top {
  background: #141A2E;
  padding: 0.65rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mockup-camera-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #05070E;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.mockup-screen {
  aspect-ratio: 16 / 10;
  background: #060913;
  overflow: hidden;
  position: relative;
}

/* Device Viewport Modes */
.device-desktop {
  max-width: 960px;
}

.device-tablet {
  max-width: 640px;
}

.device-tablet .mockup-screen {
  aspect-ratio: 4 / 3;
}

.device-mobile {
  max-width: 340px;
}

.device-mobile .mockup-screen {
  aspect-ratio: 9 / 19.5;
}

/* ==========================================================================
   MODAL VIEWERS & CASE STUDY DRAWER
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 5, 12, 0.85);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-gold);
  border-radius: 1.5rem;
  width: 100%;
  max-width: 920px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 35px 80px -20px rgba(0, 0, 0, 0.95), 0 0 30px rgba(212, 175, 55, 0.2);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.4s var(--ease-out-expo);
}

.modal-backdrop.open .modal-container {
  transform: translateY(0) scale(1);
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 10060;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast-msg {
  background: rgba(9, 14, 29, 0.92);
  border: 1px solid var(--gold-primary);
  border-radius: 0.75rem;
  padding: 0.85rem 1.4rem;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 15px var(--gold-glow);
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.35s var(--ease-out-expo);
  pointer-events: auto;
}

.toast-msg.show {
  transform: translateY(0);
  opacity: 1;
}

/* ==========================================================================
   PRODUCTION ARCHITECTURE DIAGRAMS & CODE BLOCKS
   ========================================================================== */

.arch-flow-node {
  background: rgba(16, 24, 48, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  transition: all 0.25s ease;
}

.arch-flow-node:hover {
  border-color: var(--blue-cyan);
  background: rgba(27, 47, 110, 0.25);
  transform: translateY(-2px);
}

.arch-flow-node.active-gold {
  border-color: var(--gold-primary);
  background: rgba(212, 175, 55, 0.08);
}
