/* ==========================================================================
   Tanmay Mandal — Personal Website Version 2 (tanmaymandal.com)
   Design System: Linear / Vercel / Apple Dark UI + AI-Assisted Software Builder
   Includes Interactive Physics Exhibits: Prism Dispersion & Quantum Visualizer
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Custom Properties & Design Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Color Palette — Deep Cosmic Space & Engineering Dark */
  --bg-space: #03050a;
  --bg-deep: #070a14;
  --bg-card: rgba(13, 19, 36, 0.65);
  --bg-card-hover: rgba(20, 29, 54, 0.85);
  --bg-card-solid: #0d1324;
  --bg-terminal: #090d16;
  --bg-glass: rgba(255, 255, 255, 0.03);

  /* Primary & Accent Neon Glows */
  --accent-cyan: #00e5ff;
  --accent-cyan-glow: rgba(0, 229, 255, 0.25);
  --accent-indigo: #6366f1;
  --accent-indigo-glow: rgba(99, 102, 241, 0.25);
  --accent-purple: #a855f7;
  --accent-gold: #f59e0b;
  --accent-emerald: #10b981;

  /* Syntax Highlighting Colors */
  --syn-keyword: #ff79c6;
  --syn-func: #50fa7b;
  --syn-string: #f1fa8c;
  --syn-comment: #6272a4;
  --syn-var: #8be9fd;
  --syn-num: #bd93f9;

  /* Text & Neutral Hierarchy (WCAG AAA Compliant) */
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-dim: #94a3b8;
  --border-light: rgba(255, 255, 255, 0.1);
  --border-glow: rgba(0, 229, 255, 0.4);

  /* 8px Spacing Scale */
  --space-1: 0.25rem; /* 4px */
  --space-2: 0.5rem;  /* 8px */
  --space-3: 0.75rem; /* 12px */
  --space-4: 1.0rem;  /* 16px */
  --space-5: 1.5rem;  /* 24px */
  --space-6: 2.0rem;  /* 32px */
  --space-7: 3.0rem;  /* 48px */
  --space-8: 4.0rem;  /* 64px */

  /* Typography Scales */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Fira Code', monospace;

  --text-display: clamp(2.5rem, 5vw, 4.2rem);
  --text-h1: clamp(2.0rem, 4vw, 3.2rem);
  --text-h2: clamp(1.6rem, 3vw, 2.4rem);
  --text-h3: clamp(1.25rem, 2vw, 1.75rem);
  --text-body: 1.0rem;
  --text-caption: 0.85rem;

  --tracking-tight: -0.025em;
  --tracking-wide: 0.05em;
  --lh-heading: 1.2;
  --lh-body: 1.7;

  /* Border Radius Tokens */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  /* Elevation & Shadow Tokens */
  --shadow-xs: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.75);
  --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.85);
  --shadow-glow: 0 0 30px rgba(0, 229, 255, 0.18);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.45);

  /* Glass Surface Tokens (Vercel / Apple Standard) */
  --glass-bg: rgba(6, 8, 18, 0.85);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-border-glow: rgba(0, 229, 255, 0.4);
  --glass-blur: blur(20px) saturate(180%);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.1);

  /* Motion & Easing Tokens */
  --ease-apple: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 0.15s;
  --dur-norm: 0.3s;
  --dur-slow: 0.5s;
  --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);

  /* Container Width Tokens — Expansive Widescreen System */
  --container-sm: 640px;
  --container-md: 960px;
  --container-lg: 1420px;
  --container-xl: 1580px;

  /* Z-Index Scale Tokens */
  --z-bg: -1;
  --z-content: 1;
  --z-nav: 1000;
  --z-mascot: 1500;
  --z-tooltip: 2000;
  --z-modal: 3000;
  --z-debug: 4000;
}

/* Light Theme Design System Tokens & High-Contrast Typography */
[data-theme="light"] {
  --bg-space: #f8fafc;
  --bg-deep: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.94);
  --bg-card-hover: #ffffff;
  --bg-card-solid: #ffffff;
  --bg-terminal: #0f172a;
  --bg-glass: rgba(15, 23, 42, 0.04);

  --accent-cyan: #0284c7;
  --accent-cyan-glow: rgba(2, 132, 199, 0.22);
  --accent-indigo: #4f46e5;
  --accent-indigo-glow: rgba(79, 70, 229, 0.22);
  --accent-purple: #9333ea;
  --accent-gold: #d97706;
  --accent-emerald: #059669;

  --text-main: #0f172a;
  --text-muted: #334155;
  --text-dim: #64748b;
  --border-light: rgba(15, 23, 42, 0.12);
  --border-glow: rgba(2, 132, 199, 0.35);

  --shadow-xs: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 4px 16px rgba(15, 23, 42, 0.07);
  --shadow-md: 0 8px 30px rgba(15, 23, 42, 0.09);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.11);
  --shadow-xl: 0 24px 60px rgba(15, 23, 42, 0.13);
  --shadow-glow: 0 0 25px rgba(2, 132, 199, 0.12);
  --shadow-card: 0 4px 24px rgba(15, 23, 42, 0.08);

  --glass-bg: rgba(255, 255, 255, 0.92);
  --glass-border: rgba(15, 23, 42, 0.12);
  --glass-border-glow: rgba(2, 132, 199, 0.30);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 1);
}

[data-theme="light"] body {
  background-image: 
    radial-gradient(circle at 4% 12%, rgba(2, 132, 199, 0.06) 0%, transparent 42%),
    radial-gradient(circle at 96% 22%, rgba(79, 70, 229, 0.06) 0%, transparent 45%),
    radial-gradient(circle at 3% 58%, rgba(5, 150, 105, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 97% 82%, rgba(2, 132, 199, 0.05) 0%, transparent 44%),
    linear-gradient(to right, rgba(15, 23, 42, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
}

/* Light Theme Header & Navigation */
[data-theme="light"] .header.scrolled {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .nav-link {
  color: #334155;
  font-weight: 600;
}

[data-theme="light"] .nav-link:hover,
[data-theme="light"] .nav-link.active {
  color: #0284c7;
}

/* Light Theme Sub-Tags & Badges */
[data-theme="light"] .sub-tag {
  background: rgba(2, 132, 199, 0.10);
  border-color: rgba(2, 132, 199, 0.30);
  color: #0369a1;
  font-weight: 600;
}

[data-theme="light"] .workflow-num {
  background: rgba(2, 132, 199, 0.12);
  color: #0369a1;
  font-weight: 700;
}

[data-theme="light"] .skill-tag,
[data-theme="light"] .tech-badge {
  background: #f1f5f9;
  border-color: rgba(2, 132, 199, 0.28);
  color: #0369a1;
  font-weight: 600;
}

/* Light Theme Buttons */
[data-theme="light"] .btn-primary {
  background: linear-gradient(135deg, #0284c7 0%, #4f46e5 100%);
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.28);
}

[data-theme="light"] .btn-primary:hover {
  color: #ffffff !important;
  box-shadow: 0 6px 24px rgba(2, 132, 199, 0.42);
}

[data-theme="light"] .btn-secondary {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.16);
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

[data-theme="light"] .btn-secondary:hover {
  background: rgba(2, 132, 199, 0.08);
  border-color: #0284c7;
  color: #0284c7;
}

/* Light Theme Icon Containers */
[data-theme="light"] .toolbox-icon,
[data-theme="light"] .info-icon,
[data-theme="light"] .hero-stat-icon {
  background: rgba(2, 132, 199, 0.12);
  color: #0284c7;
}

[data-theme="light"] .skill-cat-icon {
  background: rgba(79, 70, 229, 0.12);
  color: #4f46e5;
}

[data-theme="light"] .fun-fact-icon {
  background: rgba(5, 150, 105, 0.12);
  color: #059669;
}

/* Light Theme Cards & Story Points */
[data-theme="light"] .story-point-item {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.10);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

[data-theme="light"] .story-point-item i {
  color: #0284c7;
}

[data-theme="light"] .equation-chip {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.15);
  color: #0f172a;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .equation-display {
  background: rgba(2, 132, 199, 0.08);
  border-color: rgba(2, 132, 199, 0.25);
  color: #0369a1;
  font-weight: 600;
}

/* Light Theme Physics Sim Controls */
[data-theme="light"] .sim-controls {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05);
}

[data-theme="light"] .control-label {
  color: #0f172a;
  font-weight: 600;
}

[data-theme="light"] .sim-tooltip {
  background: #0f172a;
  color: #f8fafc;
  border-color: #0284c7;
}

/* Light Theme Side Rails & Docks */
[data-theme="light"] .telemetry-card,
[data-theme="light"] .actions-dock,
[data-theme="light"] .scroll-top-btn {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.14);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .dock-btn {
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.10);
  color: #334155;
}

[data-theme="light"] .dock-btn:hover {
  background: rgba(2, 132, 199, 0.15);
  color: #0284c7;
  border-color: #0284c7;
}

[data-theme="light"] .track-dot {
  background: rgba(15, 23, 42, 0.25);
}

[data-theme="light"] .track-dot.active {
  background: #0284c7;
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.5);
}

[data-theme="light"] .track-dot::after,
[data-theme="light"] .dock-btn::after {
  background: #0f172a;
  color: #f8fafc;
  border-color: #0284c7;
}

[data-theme="light"] .telemetry-vertical-text {
  color: #475569;
  opacity: 1;
  font-weight: 700;
}

/* Light Theme Forms & Footers */
[data-theme="light"] .form-control {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.18);
  color: #0f172a;
}

[data-theme="light"] .form-control:focus {
  border-color: #0284c7;
  box-shadow: 0 0 12px rgba(2, 132, 199, 0.25);
}

[data-theme="light"] .footer {
  background: #f1f5f9;
  border-top-color: rgba(15, 23, 42, 0.10);
}

[data-theme="light"] .footer-brand p {
  color: #475569;
}

[data-theme="light"] .footer-links a {
  color: #475569 !important;
}

[data-theme="light"] .footer-links a:hover {
  color: #0284c7 !important;
}

[data-theme="light"] .footer-bottom {
  color: #64748b;
  border-top-color: rgba(15, 23, 42, 0.10);
}

/* Custom Glass Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-space);
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 229, 255, 0.3);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-space);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 229, 255, 0.6);
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 229, 255, 0.3) var(--bg-space);
}

/* ---------- Step 9: Section & Component Reveal Animations ---------- */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(18px);
  will-change: opacity, transform;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-on-scroll.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Heading reveal: Fade + 12px upward movement */
.reveal-heading {
  opacity: 0;
  transform: translateY(12px);
  will-change: opacity, transform;
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-heading.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Paragraph reveal: Fade only */
.reveal-fade {
  opacity: 0;
  will-change: opacity;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-fade.is-revealed {
  opacity: 1;
}

/* Button reveal: Fade + scale from 98% */
.reveal-button {
  opacity: 0;
  transform: scale(0.98);
  will-change: opacity, transform;
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-button.is-revealed {
  opacity: 1;
  transform: scale(1);
}

/* Reduced Motion Override */
@media (prefers-reduced-motion: reduce) {
  .reveal-on-scroll,
  .reveal-heading,
  .reveal-fade,
  .reveal-button {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* --------------------------------------------------------------------------
   2. Reset & Core Base Styles
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  color-scheme: dark;
}

body {
  background-color: var(--bg-space);
  background-image: 
    radial-gradient(circle at 4% 12%, rgba(0, 229, 255, 0.08) 0%, transparent 42%),
    radial-gradient(circle at 96% 22%, rgba(99, 102, 241, 0.09) 0%, transparent 45%),
    radial-gradient(circle at 3% 58%, rgba(16, 185, 129, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 97% 82%, rgba(0, 229, 255, 0.07) 0%, transparent 44%),
    linear-gradient(to right, rgba(255, 255, 255, 0.012) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.012) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 72px 72px, 72px 72px;
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scroll Progress Bar */
#scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-indigo), var(--accent-purple));
  z-index: 2000;
  transition: width 0.1s linear;
}

/* Ambient Canvas Overlay */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}

/* Container Utility — Fluid Dynamic Scaling */
.container {
  width: 100%;
  max-width: var(--container-lg);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 2.8vw, 3.25rem);
}

.container-wide {
  max-width: var(--container-xl);
}

/* Typography Utility Classes */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-main);
}

.gradient-text {
  background: linear-gradient(135deg, var(--text-main) 0%, var(--accent-cyan) 50%, var(--accent-indigo) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-emerald {
  background: linear-gradient(135deg, var(--text-main) 0%, var(--accent-emerald) 60%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sub-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: var(--radius-full);
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.sub-tag i {
  font-size: 0.75rem;
}

/* Buttons & CTA Styling — Step 12 Premium Micro-Interactions */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.8rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
  outline: none;
}

.btn:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

.btn:active {
  transform: scale(0.98) !important;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-indigo) 100%);
  color: #03050a;
  box-shadow: 0 4px 16px rgba(0, 229, 255, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 229, 255, 0.4);
  color: #000;
}

.btn-secondary {
  background: var(--bg-glass);
  border-color: var(--border-light);
  color: var(--text-main);
  backdrop-filter: var(--backdrop-blur);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

/* ---------- Step 12: Premium Card Hover Interactions ---------- */
.tilt-card {
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.tilt-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 229, 255, 0.4);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 229, 255, 0.12);
}

/* --------------------------------------------------------------------------
   3. Header & Navigation Bar
   -------------------------------------------------------------------------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 1.25rem 0;
  transition: var(--transition);
}

.header.scrolled {
  padding: 0.75rem 0;
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-blur);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
}

.logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-cyan) 0%, var(--accent-indigo) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #03050a;
  box-shadow: 0 0 15px var(--accent-cyan-glow);
}

.logo-brand span {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-cyan);
  display: block;
  font-weight: 400;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.85rem;
  transition: var(--transition);
  position: relative;
  padding: 0.4rem 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-cyan);
  transition: var(--transition);
  border-radius: 2px;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent-cyan);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Theme Toggle Button Styling */
.theme-toggle-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
  border: 1px solid var(--border-light);
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: var(--glass-blur);
}

.theme-toggle-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-gold);
  transform: translateY(-2px) rotate(12deg);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.25);
}

[data-theme="light"] .theme-toggle-btn {
  color: var(--accent-indigo);
}

[data-theme="light"] .theme-toggle-btn:hover {
  border-color: var(--accent-indigo);
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.25);
}

/* --------------------------------------------------------------------------
   4. Hero Section & General Cards
   -------------------------------------------------------------------------- */
.hero-section {
  min-height: 100vh;
  padding-top: 9rem;
  padding-bottom: 5rem;
  display: flex;
  align-items: center;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3.5rem;
  align-items: center;
}

.hero-title {
  font-size: 3.5rem;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  line-height: 1.15;
}

.typing-container {
  font-size: 1.3rem;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  min-height: 2.2rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1.5rem;
}

.typing-cursor {
  display: inline-block;
  width: 8px;
  height: 1.35rem;
  background: var(--accent-cyan);
  animation: blink 0.8s infinite;
}

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

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  max-width: 580px;
}

.location-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.location-badge i {
  color: var(--accent-cyan);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

/* Hero Stats Telemetry Strip */
.hero-stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2.25rem;
  width: 100%;
}

.hero-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  backdrop-filter: var(--glass-blur);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  transition: var(--transition);
}

.hero-stat-card:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-3px);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-sm), 0 0 16px var(--accent-cyan-glow);
}

.hero-stat-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(0, 229, 255, 0.1);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.hero-stat-number {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-main);
  line-height: 1.1;
}

.hero-stat-label {
  font-size: 0.76rem;
  color: var(--text-dim);
  line-height: 1.3;
}

.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quantum-card {
  width: 100%;
  aspect-ratio: 1;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  backdrop-filter: var(--backdrop-blur);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card), var(--shadow-glow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  cursor: pointer;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.quantum-card:hover {
  transform: scale(1.02);
  border-color: rgba(0, 229, 255, 0.4);
}

.atom-wrapper {
  position: relative;
  width: 220px;
  height: 220px;
  margin-bottom: 1rem;
}

.atom-core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0%, var(--accent-cyan) 60%, var(--accent-indigo) 100%);
  box-shadow: 0 0 30px var(--accent-cyan), 0 0 60px var(--accent-indigo);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  font-weight: 800;
  font-size: 1.2rem;
  font-family: var(--font-mono);
  user-select: none;
}

.orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px dashed rgba(0, 229, 255, 0.4);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: spin 16s linear infinite;
}

.orbit-1 { width: 120px; height: 120px; animation-duration: 8s; }
.orbit-2 { width: 170px; height: 170px; animation-duration: 14s; animation-direction: reverse; border-color: rgba(99, 102, 241, 0.4); }
.orbit-3 { width: 220px; height: 220px; animation-duration: 20s; border-color: rgba(245, 158, 11, 0.3); }

.electron {
  position: absolute;
  top: -6px;
  left: 50%;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
}

.orbit-2 .electron { background: var(--accent-indigo); box-shadow: 0 0 10px var(--accent-indigo); }
.orbit-3 .electron { background: var(--accent-gold); box-shadow: 0 0 10px var(--accent-gold); }

@keyframes spin {
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.equation-chip {
  position: absolute;
  padding: 0.4rem 0.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-cyan);
  box-shadow: var(--shadow-sm);
  animation: floatEquation 4s ease-in-out infinite alternate;
}

.eq-1 { top: 20px; left: 20px; animation-delay: 0s; }
.eq-2 { bottom: 25px; right: 20px; color: var(--accent-gold); animation-delay: 1.5s; }
.eq-3 { top: 40px; right: 15px; color: var(--accent-emerald); animation-delay: 0.8s; }

@keyframes floatEquation {
  0% { transform: translateY(0); }
  100% { transform: translateY(-8px); }
}

.section {
  padding: 6rem 0;
  position: relative;
}

.section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 4rem auto;
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.section-desc {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.tilt-card {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.3s ease;
  transform-style: preserve-3d;
  will-change: transform;
}

.tilt-card:hover {
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

/* --------------------------------------------------------------------------
   5. Experience 1: White Light Prism Simulation Styling
   -------------------------------------------------------------------------- */
.sim-container {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2rem;
  backdrop-filter: var(--backdrop-blur);
  position: relative;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.sim-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.control-label {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.control-slider {
  accent-color: var(--accent-cyan);
  cursor: pointer;
  width: 110px;
}

.sim-btn-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sound-toggle-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  padding: 0.5rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.sound-toggle-btn.active {
  background: rgba(0, 229, 255, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.canvas-wrapper {
  position: relative;
  width: 100%;
  height: 500px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: radial-gradient(circle at 35% 48%, rgba(14, 22, 45, 0.95) 0%, rgba(3, 5, 12, 0.98) 100%);
  border: 1px solid rgba(0, 229, 255, 0.2);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6);
}

.sim-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.sim-tooltip {
  position: absolute;
  padding: 0.4rem 0.8rem;
  background: rgba(7, 10, 20, 0.9);
  border: 1px solid var(--accent-cyan);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 100;
  box-shadow: 0 4px 15px rgba(0, 229, 255, 0.2);
}

/* --------------------------------------------------------------------------
   6. Experience 2: Quantum Computing Simulation Styling
   -------------------------------------------------------------------------- */
.quantum-mode-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.tab-btn {
  padding: 0.6rem 1.25rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.tab-btn:hover {
  border-color: var(--accent-cyan);
  color: var(--text-main);
  transform: translateY(-2px);
}

.tab-btn.active {
  background: var(--accent-cyan);
  color: #03050a;
  border-color: var(--accent-cyan);
  box-shadow: 0 4px 16px var(--accent-cyan-glow);
  font-weight: 700;
}

.circuit-diagram {
  background: rgba(7, 10, 20, 0.8);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem 2rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-around;
  font-family: var(--font-mono);
}

.circuit-wire {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.circuit-gate {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  box-shadow: 0 0 12px var(--accent-cyan-glow);
}

.quantum-info-panel {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-top: 2rem;
}

.info-panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  backdrop-filter: var(--backdrop-blur);
  transition: var(--transition);
}

.info-panel-card:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card), 0 0 20px rgba(0, 229, 255, 0.15);
}

.info-panel-card h4 {
  font-size: 1rem;
  color: var(--accent-cyan);
  margin-bottom: 0.5rem;
  font-family: var(--font-heading);
}

.info-panel-card p {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   7. Rest of Site Components & Media Queries
   -------------------------------------------------------------------------- */
.story-card, .workflow-step-card, .toolbox-card, .skill-category-card, .project-card, .physics-card, .fun-fact-card, .contact-info-card, .contact-form {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  backdrop-filter: var(--backdrop-blur);
}

.story-card { padding: 3rem; position: relative; overflow: hidden; }
.story-card::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 4px; background: linear-gradient(90deg, var(--accent-cyan), var(--accent-indigo), var(--accent-emerald)); }
.story-points-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin-top: 2.5rem; }
.story-point-item { background: var(--bg-glass); border: 1px solid var(--border-light); border-radius: var(--radius-md); padding: 1.5rem; transition: var(--transition); }
.story-point-item:hover { border-color: var(--accent-cyan); transform: translateY(-4px); }
.story-point-item i { font-size: 2rem; color: var(--accent-cyan); margin-bottom: 1rem; }

.workflow-pipeline { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.75rem; }
.workflow-step-card { padding: 2rem; transition: var(--transition); }
.workflow-step-card.active, .workflow-step-card:hover { border-color: var(--accent-cyan); transform: translateY(-6px); box-shadow: var(--shadow-card), var(--shadow-glow); }
.workflow-num { font-family: var(--font-mono); font-size: 0.85rem; font-weight: 700; color: var(--accent-cyan); padding: 0.25rem 0.7rem; background: rgba(0, 229, 255, 0.1); border-radius: var(--radius-sm); display: inline-block; margin-bottom: 1rem; }

.toolbox-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.75rem; }
.toolbox-card { padding: 2rem; display: flex; align-items: center; gap: 1.5rem; transition: var(--transition); animation: floatCard 6s ease-in-out infinite alternate; }
.toolbox-card:nth-child(even) { animation-delay: 1.5s; }
@keyframes floatCard { 0% { transform: translateY(0); } 100% { transform: translateY(-8px); } }
.toolbox-card:hover { transform: translateY(-10px) scale(1.02); border-color: var(--accent-cyan); box-shadow: var(--shadow-card), var(--shadow-glow); }
.toolbox-icon { width: 56px; height: 56px; border-radius: 14px; background: rgba(0, 229, 255, 0.1); color: var(--accent-cyan); display: flex; align-items: center; justify-content: center; font-size: 1.6rem; flex-shrink: 0; }

.skill-cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.75rem; }
.skill-category-card { padding: 2rem; transition: var(--transition); }
.skill-category-card:hover { transform: translateY(-8px); border-color: var(--accent-indigo); box-shadow: var(--shadow-card), 0 0 25px var(--accent-indigo-glow); }
.skill-cat-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.skill-cat-icon { width: 46px; height: 46px; border-radius: 12px; background: rgba(99, 102, 241, 0.1); color: var(--accent-indigo); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.skill-cat-desc { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1.25rem; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.skill-tag { font-family: var(--font-mono); font-size: 0.75rem; padding: 0.25rem 0.65rem; background: rgba(255, 255, 255, 0.05); border-radius: var(--radius-sm); color: var(--accent-cyan); border: 1px solid rgba(0, 229, 255, 0.15); }

.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.project-card { overflow: hidden; transition: var(--transition); display: flex; flex-direction: column; }
.project-card:hover { transform: translateY(-8px); border-color: var(--accent-cyan); box-shadow: var(--shadow-card), var(--shadow-glow); }
.project-media { height: 190px; background: var(--bg-terminal); position: relative; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--border-light); }
.project-body { padding: 1.75rem; display: flex; flex-direction: column; flex-grow: 1; }
.project-body h3 { font-size: 1.3rem; margin-bottom: 0.75rem; }
.project-body p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1.5rem; flex-grow: 1; }
.tech-stack { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.tech-badge { font-family: var(--font-mono); font-size: 0.75rem; padding: 0.25rem 0.65rem; background: rgba(255, 255, 255, 0.05); border-radius: var(--radius-sm); color: var(--accent-cyan); border: 1px solid rgba(0, 229, 255, 0.15); }
.project-actions { display: flex; gap: 0.75rem; }

.code-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: start; }
.terminal-window { background: var(--bg-terminal); border: 1px solid var(--border-light); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-card); }
.terminal-header { background: rgba(255, 255, 255, 0.03); padding: 0.85rem 1.25rem; display: flex; align-items: center; gap: 0.6rem; border-bottom: 1px solid var(--border-light); }
.terminal-btn { width: 12px; height: 12px; border-radius: 50%; }
.tb-red { background: #ff5f56; } .tb-yellow { background: #ffbd2e; } .tb-green { background: #27c93f; }
.terminal-title { margin-left: auto; margin-right: auto; font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-dim); }
.terminal-body { padding: 1.5rem; font-family: var(--font-mono); font-size: 0.9rem; line-height: 1.7; color: var(--text-main); min-height: 320px; max-height: 420px; overflow-y: auto; }
.term-prompt { color: var(--accent-cyan); }
.term-output { color: var(--text-muted); margin-bottom: 1rem; }
.term-input-line { display: flex; align-items: center; gap: 0.5rem; }
.term-input { background: none; border: none; color: #fff; font-family: var(--font-mono); font-size: 0.9rem; width: 100%; }
.term-input:focus { outline: none; }
.code-snippet-card { background: var(--bg-terminal); border: 1px solid var(--border-light); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-card); }
.code-header { padding: 0.85rem 1.25rem; background: rgba(255, 255, 255, 0.03); border-bottom: 1px solid var(--border-light); display: flex; align-items: center; justify-content: space-between; font-family: var(--font-mono); font-size: 0.85rem; color: var(--accent-cyan); }
.code-content { padding: 1.5rem; font-family: var(--font-mono); font-size: 0.9rem; line-height: 1.6; overflow-x: auto; }
.syn-kw { color: var(--syn-keyword); } .syn-fn { color: var(--syn-func); } .syn-str { color: var(--syn-string); } .syn-cm { color: var(--syn-comment); } .syn-var { color: var(--syn-var); } .syn-num { color: var(--syn-num); }

.physics-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.physics-card { padding: 2rem; transition: var(--transition); text-align: center; }
.physics-card:hover { transform: translateY(-8px); border-color: var(--accent-cyan); box-shadow: var(--shadow-card), var(--shadow-glow); }
.equation-display { font-family: var(--font-mono); font-size: 1.6rem; color: var(--accent-cyan); padding: 1rem; background: rgba(0, 229, 255, 0.05); border: 1px solid rgba(0, 229, 255, 0.15); border-radius: var(--radius-md); margin-bottom: 1.25rem; }

.fun-facts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.75rem; }
.fun-fact-card { padding: 1.75rem; display: flex; align-items: center; gap: 1.25rem; transition: var(--transition); }
.fun-fact-card:hover { transform: translateY(-5px); border-color: var(--accent-emerald); box-shadow: 0 10px 25px rgba(16, 185, 129, 0.2); }
.fun-fact-icon { width: 50px; height: 50px; border-radius: 12px; background: rgba(16, 185, 129, 0.1); color: var(--accent-emerald); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; }



.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 3rem; }
.contact-info-card, .contact-form { padding: 2.5rem; }
.info-item { display: flex; align-items: flex-start; gap: 1.25rem; margin-bottom: 2rem; }
.info-icon { width: 48px; height: 48px; border-radius: 12px; background: rgba(0, 229, 255, 0.1); color: var(--accent-cyan); display: flex; align-items: center; justify-content: center; font-size: 1.25rem; flex-shrink: 0; }
.form-group { margin-bottom: 1.5rem; }
.form-label { display: block; font-family: var(--font-heading); font-size: 0.9rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--text-main); }
.form-control { width: 100%; padding: 0.85rem 1.1rem; background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-md); color: var(--text-main); font-family: var(--font-body); font-size: 0.95rem; transition: var(--transition); }
.form-control:focus { outline: none; border-color: var(--accent-cyan); box-shadow: 0 0 15px var(--accent-cyan-glow); }
textarea.form-control { resize: vertical; min-height: 120px; }

.toast { position: fixed; bottom: 2rem; right: 2rem; padding: 1rem 1.5rem; background: rgba(13, 19, 36, 0.95); border: 1px solid var(--accent-cyan); border-radius: var(--radius-md); color: #fff; font-family: var(--font-body); box-shadow: var(--shadow-card), var(--shadow-glow); backdrop-filter: var(--backdrop-blur); z-index: 2000; display: flex; align-items: center; gap: 0.75rem; transform: translateY(100px); opacity: 0; transition: var(--transition); }
.toast.show { transform: translateY(0); opacity: 1; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(3, 5, 10, 0.85); backdrop-filter: var(--backdrop-blur); z-index: 3000; display: flex; align-items: center; justify-content: center; padding: 1.5rem; opacity: 0; pointer-events: none; transition: var(--transition); }
.modal-backdrop.active { opacity: 1; pointer-events: auto; }
.modal-box { background: var(--bg-card-solid); border: 1px solid var(--border-light); border-radius: var(--radius-lg); max-width: 650px; width: 100%; max-height: 85vh; overflow-y: auto; padding: 2.5rem; position: relative; box-shadow: var(--shadow-card), var(--shadow-glow); transform: scale(0.95); transition: var(--transition); }
.modal-backdrop.active .modal-box { transform: scale(1); }
.modal-close { position: absolute; top: 1.25rem; right: 1.25rem; background: none; border: none; color: var(--text-muted); font-size: 1.4rem; cursor: pointer; transition: var(--transition); }
.modal-close:hover { color: var(--accent-cyan); }

.footer { border-top: 1px solid var(--border-light); padding: 3.5rem 0 2rem 0; background: var(--bg-deep); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 3rem; margin-bottom: 3rem; }
.footer-bottom { border-top: 1px solid var(--border-light); padding-top: 1.5rem; display: flex; align-items: center; justify-content: space-between; color: var(--text-dim); font-size: 0.85rem; }

/* --------------------------------------------------------------------------
   8. Architectural Edge Guides & Docked Side Rails (Desktop Widescreen)
   -------------------------------------------------------------------------- */
.page-guide-rail-left,
.page-guide-rail-right {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 229, 255, 0.15) 12%, rgba(99, 102, 241, 0.12) 50%, rgba(0, 229, 255, 0.15) 88%, transparent 100%);
  z-index: 10;
  pointer-events: none;
  display: none;
}

.page-guide-rail-left {
  left: clamp(1rem, 2.2vw, 2.2rem);
}

.page-guide-rail-right {
  right: clamp(1rem, 2.2vw, 2.2rem);
}

/* ---------- Left Docked Telemetry Rail ---------- */
.side-rail-left {
  position: fixed;
  left: clamp(0.6rem, 1.4vw, 1.4rem);
  top: 50%;
  transform: translateY(-50%);
  z-index: 900;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 1.15rem;
}

.telemetry-card {
  background: var(--glass-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 0.75rem 0.45rem;
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  transition: var(--transition);
}

.telemetry-card:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.15);
}

.telemetry-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulseDot 2.2s infinite ease-in-out;
  cursor: help;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

.telemetry-track {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding: 0.3rem 0;
}

.track-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  position: relative;
  text-decoration: none;
  display: block;
}

.track-dot:hover {
  background: var(--accent-cyan);
  transform: scale(1.5);
  box-shadow: 0 0 8px var(--accent-cyan);
}

.track-dot.active {
  background: var(--accent-cyan);
  height: 16px;
  border-radius: 4px;
  box-shadow: 0 0 10px var(--accent-cyan);
}

.track-dot::after {
  content: attr(data-label);
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%) translateX(-6px);
  background: rgba(6, 8, 18, 0.95);
  border: 1px solid var(--accent-cyan);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #fff;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.track-dot:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.telemetry-vertical-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  text-transform: uppercase;
  user-select: none;
  opacity: 0.7;
}

/* ---------- Right Docked Action Rail ---------- */
.side-rail-right {
  position: fixed;
  right: clamp(0.6rem, 1.4vw, 1.4rem);
  top: 50%;
  transform: translateY(-50%);
  z-index: 900;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 1.15rem;
}

.actions-dock {
  background: var(--glass-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 0.6rem 0.45rem;
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  transition: var(--transition);
}

.actions-dock:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.15);
}

.dock-btn {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: var(--bg-glass);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  position: relative;
}

.dock-btn:hover {
  background: rgba(0, 229, 255, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  transform: scale(1.1);
}

.dock-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 44px;
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  background: rgba(6, 8, 18, 0.95);
  border: 1px solid var(--accent-cyan);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #fff;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.dock-btn:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.scroll-top-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--border-light);
  color: var(--accent-cyan);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.scroll-top-btn:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-3px);
  box-shadow: 0 0 15px var(--accent-cyan-glow);
}

.scroll-percentage-text {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-dim);
  margin-top: 1px;
}

@media (min-width: 1400px) {
  .page-guide-rail-left,
  .page-guide-rail-right {
    display: block;
  }
}

@media (min-width: 1280px) {
  .side-rail-left,
  .side-rail-right {
    display: flex;
  }
}

/* --------------------------------------------------------------------------
   9. Responsive Media Queries & Widescreen Grid Optimization
   -------------------------------------------------------------------------- */
@media (min-width: 1400px) {
  .hero-grid {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 4.5rem;
  }
  .projects-grid {
    gap: 2.25rem;
  }
  .workflow-pipeline,
  .toolbox-grid,
  .skill-cards-grid,
  .fun-facts-grid {
    gap: 2rem;
  }
}

@media (max-width: 1280px) {
  .hero-stats-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-actions, .typing-container { justify-content: center; }
  .about-grid, .contact-grid, .code-grid { grid-template-columns: 1fr; }
  .interests-grid, .projects-grid, .physics-grid, .workflow-pipeline, .toolbox-grid, .skill-cards-grid, .fun-facts-grid, .story-points-grid, .quantum-info-panel { grid-template-columns: repeat(2, 1fr); }
  .hero-stats-strip { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .hero-title { font-size: 2.5rem; }
  .nav-menu { position: fixed; top: 70px; left: 0; width: 100%; background: var(--glass-bg); backdrop-filter: var(--backdrop-blur); flex-direction: column; padding: 2rem; gap: 1.25rem; transform: translateY(-150%); transition: var(--transition); border-bottom: 1px solid var(--border-light); }
  .nav-menu.active { transform: translateY(0); }
  .mobile-toggle { display: block; }
  .interests-grid, .projects-grid, .physics-grid, .workflow-pipeline, .toolbox-grid, .skill-cards-grid, .fun-facts-grid, .story-points-grid, .quantum-info-panel { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .sim-controls { flex-direction: column; align-items: flex-start; }
  .hero-stats-strip { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
