/* ==========================================================================
   ByteVerse // Modern Minimalist Stylesheet
   ========================================================================== */

:root {
  --bg-dark: #070913;
  --bg-surface: rgba(15, 23, 42, 0.6);
  --bg-surface-hover: rgba(30, 41, 69, 0.75);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 242, 254, 0.35);
  --border-active: rgba(147, 51, 234, 0.4);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --cyan-glow: #00f2fe;
  --cyan-subtle: rgba(0, 242, 254, 0.12);
  --violet-glow: #a855f7;
  --violet-subtle: rgba(168, 85, 247, 0.12);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --transition-smooth: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html, body {
  width: 100%;
  min-height: 100%;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
}

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

/* Atmospheric Ambient Orbs */
.glow-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 1;
  opacity: 0.45;
  will-change: transform;
}

.orb-1 {
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(0, 242, 254, 0.25) 0%, rgba(0, 0, 0, 0) 70%);
  top: -150px;
  right: -100px;
  animation: floatOrb 22s ease-in-out infinite alternate;
}

.orb-2 {
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.22) 0%, rgba(0, 0, 0, 0) 70%);
  bottom: -200px;
  left: -150px;
  animation: floatOrb 26s ease-in-out infinite alternate-reverse;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 30px) scale(1.08); }
  100% { transform: translate(-30px, 60px) scale(0.95); }
}

/* Page Layout */
.page-wrapper {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 2rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.85rem;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.status-dot {
  width: 7px;
  height: 7px;
  background-color: var(--cyan-glow);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--cyan-glow);
  animation: pulseDot 2.2s infinite;
}

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

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-coord {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.cryptic-link {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: var(--transition-smooth);
}

.cryptic-link:hover {
  color: var(--cyan-glow);
  border-color: rgba(0, 242, 254, 0.35);
  background: var(--cyan-subtle);
  text-shadow: 0 0 8px var(--cyan-glow);
}

html[data-theme="terminal"] .cryptic-link:hover {
  color: #00ff66 !important;
  border-color: rgba(0, 255, 102, 0.4) !important;
  background: rgba(0, 255, 102, 0.12) !important;
  text-shadow: 0 0 8px #00ff66 !important;
}

html[data-theme="modern"] .cryptic-link:hover {
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  background: rgba(255, 255, 255, 0.06) !important;
}

/* Main Section */
.main-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: auto 0;
  width: 100%;
}

.hero-section {
  text-align: center;
  max-width: 700px;
  margin-bottom: 3.5rem;
}

.symbol-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  background: var(--cyan-subtle);
  border: 1px solid rgba(0, 242, 254, 0.2);
  color: var(--cyan-glow);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.byte-icon {
  width: 15px;
  height: 15px;
}

.brand-title {
  font-size: clamp(3rem, 7vw, 4.8rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.035em;
  margin-bottom: 1rem;
}

.brand-byte {
  color: #ffffff;
  text-shadow: 0 0 35px rgba(255, 255, 255, 0.25);
}

.brand-verse {
  background: linear-gradient(135deg, var(--cyan-glow) 0%, var(--violet-glow) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  filter: drop-shadow(0 0 25px rgba(0, 242, 254, 0.3));
}

.brand-tagline {
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  color: var(--text-secondary);
  font-weight: 400;
  line-height: 1.65;
  max-width: 620px;
  margin: 1.25rem auto 0 auto;
  text-wrap: balance;
}

@media (max-width: 540px) {
  .desktop-br {
    display: none;
  }
}

/* System Telemetry Bar */
.system-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 0.75rem 1.75rem;
  background: rgba(10, 15, 28, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.system-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.system-label {
  color: #475569;
}

.system-val {
  color: var(--text-secondary);
}

.system-divider {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: var(--border-subtle);
}

/* ==========================================================================
   ByteVerse Title & Register Architecture (8-Bit Blocks with Scramble)
   ========================================================================== */

.byte-art-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  margin-bottom: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.brand-title {
  font-family: 'Press Start 2P', monospace !important;
  font-size: clamp(1.6rem, 4.4vw, 3.2rem) !important;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.4;
  margin-bottom: 1.25rem;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  transition: transform 0.2s ease;
}

.byte-art-wrapper:hover .brand-title {
  transform: scale(1.02);
}

.brand-byte {
  color: #ffffff;
  text-shadow: 
    3px 3px 0px #020617,
    6px 6px 0px #00f2fe,
    -1px -1px 0px #000,
    1px -1px 0px #000,
    -1px 1px 0px #000,
    1px 1px 0px #000;
}

.brand-verse {
  background: linear-gradient(180deg, #00f2fe 0%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(3px 3px 0px #020617) drop-shadow(6px 6px 0px #a855f7);
}

/* Terminal theme overrides */
html[data-theme="terminal"] .brand-byte {
  color: #00ff66 !important;
  -webkit-text-fill-color: #00ff66 !important;
  text-shadow: 3px 3px 0px #001f08, 6px 6px 0px #008837 !important;
}

html[data-theme="terminal"] .brand-verse {
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: #39ff14 !important;
  color: #39ff14 !important;
  text-shadow: 3px 3px 0px #001f08, 6px 6px 0px #00ff66 !important;
  filter: none !important;
}

/* Modern theme overrides */
html[data-theme="modern"] .brand-byte {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  text-shadow: 3px 3px 0px #000000, 6px 6px 0px rgba(255, 255, 255, 0.35) !important;
}

html[data-theme="modern"] .brand-verse {
  background: linear-gradient(180deg, #ffffff 0%, #71717a 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  filter: drop-shadow(3px 3px 0px #000000) drop-shadow(6px 6px 0px rgba(113, 113, 122, 0.6)) !important;
}

/* Subtrack ("BYTE // BV") and 8-bit memory register */
.byte-subtrack {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--cyan-glow);
  margin-top: 1.1rem;
  margin-bottom: 0.25rem;
  opacity: 0.95;
  transition: var(--transition-smooth);
}

.subtrack-chunk {
  background: rgba(0, 242, 254, 0.12);
  padding: 0.22rem 0.55rem;
  border-radius: 4px;
  border: 1px solid rgba(0, 242, 254, 0.35);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.15);
  font-weight: 500;
}

.subtrack-hex {
  color: #94a3b8;
  font-weight: 600;
  padding: 0.22rem 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.bit-register {
  display: inline-flex;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.bit-cell {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  transition: all 0.15s ease;
}

.bit-cell.active {
  background: var(--cyan-subtle);
  color: var(--cyan-glow);
  border-color: var(--cyan-glow);
  box-shadow: 0 0 10px var(--cyan-glow);
}

html[data-theme="terminal"] .bit-cell.active {
  background: rgba(0, 255, 102, 0.2) !important;
  color: #00ff66 !important;
  border-color: #00ff66 !important;
  box-shadow: 0 0 10px #00ff66 !important;
}

html[data-theme="terminal"] .subtrack-chunk {
  background: rgba(0, 255, 102, 0.1) !important;
  border-color: rgba(0, 255, 102, 0.3) !important;
  color: #00ff66 !important;
}

html[data-theme="modern"] .bit-cell.active {
  background: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.3) !important;
}

html[data-theme="modern"] .subtrack-chunk {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #e4e4e7 !important;
}

/* Controls Wrapper in Footer */
.controls-wrapper {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
}

/* Controls & Theme Switcher (Same style as previous byte art buttons) */
.control-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.control-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-weight: 500;
}

.theme-segmented {
  display: inline-flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  padding: 3px;
  gap: 2px;
}

.theme-btn,
.art-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: none;
  border-radius: 9999px;
  padding: 0.28rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.theme-btn:hover,
.art-btn:hover {
  color: var(--text-primary);
}

.theme-btn.active,
.art-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

/* Footer layout */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Theme 2: Modern Datascape ([data-theme="modern"])
   Ultra-clean, high-end developer studio aesthetic (Linear/Vercel style)
   ========================================================================== */
[data-theme="modern"] {
  --bg-dark: #050508;
  --bg-surface: rgba(18, 18, 24, 0.7);
  --border-subtle: rgba(255, 255, 255, 0.1);
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
}

[data-theme="modern"] body {
  background-color: #050508;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.08) 0%, transparent 60%),
    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);
  background-size: 100% 100%, 48px 48px, 48px 48px;
}

/* Turn off cosmic particles and floating nebulae in modern mode for pure architectural minimalism */
[data-theme="modern"] #cosmic-canvas,
[data-theme="modern"] .glow-orb {
  display: none !important;
}

[data-theme="modern"] .brand-title {
  letter-spacing: -0.045em;
}

[data-theme="modern"] .brand-byte {
  color: #ffffff;
  text-shadow: none;
}

[data-theme="modern"] .brand-verse {
  background: linear-gradient(180deg, #ffffff 20%, #71717a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: none;
}

[data-theme="modern"] .brand-tagline {
  color: #a1a1aa;
  font-weight: 300;
  letter-spacing: -0.01em;
}

[data-theme="modern"] .status-badge {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.14);
  color: #e4e4e7;
}

[data-theme="modern"] .status-dot {
  background-color: #ffffff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

[data-theme="modern"] .system-bar {
  background: rgba(18, 18, 22, 0.85);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  color: #a1a1aa;
}

[data-theme="modern"] .system-label {
  color: #52525b;
}

[data-theme="modern"] .system-val {
  color: #e4e4e7;
}

/* ==========================================================================
   Theme 3: Quantum Terminal ([data-theme="terminal"])
   Retro-futuristic cyber console / CRT Phosphor Green Matrix
   ========================================================================== */
html[data-theme="terminal"],
html[data-theme="terminal"] body {
  background-color: #010a04 !important;
  background-image: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.7) 0px,
    rgba(0, 0, 0, 0.7) 2px,
    rgba(0, 255, 102, 0.05) 2px,
    rgba(0, 255, 102, 0.05) 4px
  ) !important;
  color: #00ff66 !important;
  font-family: var(--font-mono) !important;
}

html[data-theme="terminal"] * {
  font-family: var(--font-mono);
}

html[data-theme="terminal"] .glow-orb {
  display: none !important;
}

html[data-theme="terminal"] #cosmic-canvas {
  display: block !important;
  opacity: 1 !important;
}

/* Ensure 8-bit blocky font is preserved in Terminal mode */
html[data-theme="terminal"] .brand-title,
html[data-theme="terminal"] .brand-title * {
  font-family: 'Press Start 2P', monospace !important;
  font-size: clamp(1.6rem, 4.4vw, 3.2rem) !important;
  letter-spacing: 0.05em !important;
  text-transform: uppercase !important;
  line-height: 1.4 !important;
  image-rendering: pixelated !important;
  image-rendering: crisp-edges !important;
}

html[data-theme="terminal"] .brand-byte {
  color: #00ff66 !important;
  -webkit-text-fill-color: #00ff66 !important;
  text-shadow: 
    3px 3px 0px #011f08,
    6px 6px 0px #008837,
    -1px -1px 0px #000,
    1px -1px 0px #000,
    -1px 1px 0px #000,
    1px 1px 0px #000 !important;
}

html[data-theme="terminal"] .brand-verse {
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: #39ff14 !important;
  color: #39ff14 !important;
  text-shadow: 
    3px 3px 0px #011f08,
    6px 6px 0px #00ff66,
    -1px -1px 0px #000,
    1px -1px 0px #000,
    -1px 1px 0px #000,
    1px 1px 0px #000 !important;
  filter: none !important;
}

html[data-theme="terminal"] .brand-tagline {
  color: #00cc55 !important;
  text-shadow: 0 0 8px rgba(0, 255, 102, 0.35) !important;
  font-family: var(--font-mono) !important;
}

html[data-theme="terminal"] .status-badge {
  background: rgba(0, 255, 102, 0.1) !important;
  border-color: rgba(0, 255, 102, 0.45) !important;
  color: #00ff66 !important;
  border-radius: 4px !important;
  box-shadow: 0 0 10px rgba(0, 255, 102, 0.25) !important;
}

html[data-theme="terminal"] .status-dot {
  background-color: #00ff66 !important;
  border-radius: 0 !important;
  box-shadow: 0 0 12px #00ff66 !important;
}

html[data-theme="terminal"] .system-bar {
  background: rgba(2, 16, 8, 0.95) !important;
  border-color: rgba(0, 255, 102, 0.4) !important;
  border-radius: 4px !important;
  box-shadow: 0 0 25px rgba(0, 255, 102, 0.12) !important;
  color: #00cc52 !important;
}

html[data-theme="terminal"] .system-label {
  color: #008833 !important;
}

html[data-theme="terminal"] .system-val {
  color: #00ff66 !important;
  text-shadow: 0 0 8px rgba(0, 255, 102, 0.5) !important;
}

html[data-theme="terminal"] .theme-segmented {
  background: rgba(2, 16, 8, 0.95) !important;
  border-color: rgba(0, 255, 102, 0.4) !important;
  border-radius: 4px !important;
}

html[data-theme="terminal"] .theme-btn,
html[data-theme="terminal"] .art-btn {
  border-radius: 2px !important;
  color: #008837 !important;
}

html[data-theme="terminal"] .theme-btn.active,
html[data-theme="terminal"] .art-btn.active {
  background: rgba(0, 255, 102, 0.25) !important;
  color: #00ff66 !important;
  text-shadow: 0 0 8px rgba(0, 255, 102, 0.6) !important;
}

html[data-theme="terminal"] .footer {
  border-top-color: rgba(0, 255, 102, 0.2) !important;
  color: #008837 !important;
}

html[data-theme="terminal"] .footer-copy {
  color: #008837 !important;
}

html[data-theme="terminal"] .control-label {
  color: #00aa44 !important;
}
  color: #008837;
}

[data-theme="terminal"] .theme-btn.active {
  background: rgba(0, 255, 102, 0.2);
  color: #00ff66;
}

[data-theme="terminal"] .footer {
  border-top-color: rgba(0, 255, 102, 0.15);
  color: #008837;
}

/* Footer */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 2.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-copy {
  font-family: var(--font-mono);
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .page-wrapper {
    padding: 1.5rem 1rem;
  }
  .system-bar {
    border-radius: 12px;
    flex-direction: column;
    gap: 0.6rem;
    align-items: flex-start;
  }
  .system-divider {
    display: none;
  }
  .footer {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
}
