/* ============================================
   xaviera.tech — Elite Tech Layer
   ============================================ */

/* ---- Theme variants ---- */
.dev-theme[data-theme="cyber"] {
  --brand: #00f0ff;
  --brand-light: #67f7ff;
  --brand-dark: #0099aa;
  --brand-glow: rgba(0, 240, 255, 0.35);
  --code-green: #00ff9f;
  --code-purple: #ff00ea;
  --ide-border: #0a3a4a;
}

.dev-theme[data-theme="matrix"] {
  --brand: #00ff41;
  --brand-light: #39ff14;
  --brand-dark: #008f11;
  --brand-glow: rgba(0, 255, 65, 0.35);
  --code-green: #00ff41;
  --code-purple: #00cc33;
  --ide-border: #0a2a0a;
}

.dev-theme[data-theme="matrix"] .dev-scanlines { opacity: 0.5; }
.dev-theme[data-theme="matrix"] .dev-hero-content h1 .highlight {
  background: linear-gradient(135deg, #00ff41, #39ff14);
  -webkit-background-clip: text;
  background-clip: text;
}

/* ---- Holographic hero brand ---- */
.dev-holo-ring {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  border: 1px solid rgba(26, 143, 224, 0.2);
  animation: holoSpin 8s linear infinite;
  pointer-events: none;
}

.dev-holo-ring:nth-child(2) {
  inset: -32px;
  animation-duration: 12s;
  animation-direction: reverse;
  border-color: rgba(99, 102, 241, 0.15);
}

@keyframes holoSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.hero-brand-logo-wrap {
  position: relative;
  flex-shrink: 0;
}

.dev-theme .hero-brand-logo {
  animation: holoPulse 4s ease-in-out infinite;
}

@keyframes holoPulse {
  0%, 100% { box-shadow: 0 0 32px var(--brand-glow), 0 0 64px rgba(26, 143, 224, 0.1); }
  50% { box-shadow: 0 0 48px var(--brand-glow), 0 0 80px rgba(99, 102, 241, 0.15); }
}

/* ---- System HUD ---- */
.dev-sys-hud {
  position: fixed;
  top: calc(var(--header-height, 88px) + 12px);
  right: 16px;
  z-index: 997;
  width: 220px;
  background: rgba(3, 5, 8, 0.92);
  border: 1px solid var(--ide-border);
  border-radius: 10px;
  overflow: hidden;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(26, 143, 224, 0.08);
  font-family: var(--mono, monospace);
  transition: transform 0.3s ease, opacity 0.3s;
}

.dev-sys-hud.collapsed {
  transform: translateX(calc(100% + 20px));
  opacity: 0;
  pointer-events: none;
}

.dev-sys-hud-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #020406;
  border-bottom: 1px solid var(--ide-border);
  font-size: 0.625rem;
  color: var(--brand-light);
}

.dev-sys-hud-head span { display: flex; align-items: center; gap: 6px; }
.dev-sys-hud-head .pulse-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--code-green);
  box-shadow: 0 0 8px var(--code-green);
  animation: pulse 1.5s infinite;
}

.dev-sys-hud-toggle {
  background: none; border: none; color: var(--text-muted);
  font-size: 0.75rem; cursor: pointer; padding: 2px 4px;
}
.dev-sys-hud-toggle:hover { color: var(--text-primary); }

.dev-sys-hud-body { padding: 10px 12px; }

.dev-sys-metric {
  margin-bottom: 10px;
}

.dev-sys-metric:last-child { margin-bottom: 0; }

.dev-sys-metric-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.5625rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.dev-sys-metric-label strong {
  color: var(--brand-light);
  font-weight: 500;
}

.dev-sys-bar {
  height: 4px;
  background: var(--ide-border);
  border-radius: 2px;
  overflow: hidden;
}

.dev-sys-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand-dark), var(--brand-light));
  transition: width 0.6s ease;
  box-shadow: 0 0 8px var(--brand-glow);
}

.dev-sys-metric.network .dev-sys-bar-fill {
  background: linear-gradient(90deg, #6366f1, var(--code-green));
}

.dev-sys-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--ide-border);
}

.dev-sys-stat {
  text-align: center;
  padding: 6px;
  background: rgba(26, 143, 224, 0.04);
  border-radius: 6px;
  border: 1px solid rgba(26, 143, 224, 0.08);
}

.dev-sys-stat .val {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand-light);
  font-variant-numeric: tabular-nums;
}

.dev-sys-stat .lbl {
  font-size: 0.5rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

/* ---- Live terminal panel ---- */
.dev-terminal-panel {
  position: fixed;
  left: var(--activity-w, 48px);
  right: 0;
  bottom: var(--statusbar-h, 26px);
  height: 0;
  z-index: 9996;
  background: #020406;
  border-top: 1px solid var(--ide-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
}

.dev-terminal-panel.open {
  height: min(280px, 40vh);
}

.dev-terminal-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  background: #030508;
  border-bottom: 1px solid var(--ide-border);
  flex-shrink: 0;
}

.dev-terminal-tabs {
  display: flex;
  gap: 4px;
}

.dev-terminal-tab {
  padding: 4px 12px;
  font-family: var(--mono, monospace);
  font-size: 0.625rem;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 4px 4px 0 0;
  cursor: pointer;
}

.dev-terminal-tab.active {
  background: var(--ide-bg);
  color: var(--brand-light);
  border: 1px solid var(--ide-border);
  border-bottom-color: var(--ide-bg);
}

.dev-terminal-panel-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.dev-terminal-panel-actions button {
  background: none; border: none;
  color: var(--text-muted);
  font-family: var(--mono, monospace);
  font-size: 0.625rem;
  cursor: pointer; padding: 2px 6px;
  border-radius: 4px;
}
.dev-terminal-panel-actions button:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}

.dev-terminal-output {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  font-family: var(--mono, monospace);
  font-size: 0.6875rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.dev-terminal-output .t-prompt { color: var(--brand-light); }
.dev-terminal-output .t-path { color: var(--code-green); }
.dev-terminal-output .t-cmd { color: var(--text-primary); }
.dev-terminal-output .t-out { color: var(--text-muted); }
.dev-terminal-output .t-ok { color: var(--code-green); }
.dev-terminal-output .t-err { color: #f07178; }
.dev-terminal-output .t-info { color: var(--brand-light); }

.dev-terminal-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-top: 1px solid var(--ide-border);
  background: #030508;
  flex-shrink: 0;
}

.dev-terminal-input-row .prompt {
  font-family: var(--mono, monospace);
  font-size: 0.6875rem;
  color: var(--code-green);
  white-space: nowrap;
}

.dev-terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--mono, monospace);
  font-size: 0.6875rem;
  color: var(--text-primary);
}

/* ---- Page compile transition ---- */
.dev-compile-overlay {
  position: fixed;
  inset: 0;
  z-index: 10004;
  background: #020406;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.dev-compile-overlay.active {
  opacity: 1;
  visibility: visible;
}

.dev-compile-box {
  text-align: center;
  font-family: var(--mono, monospace);
  max-width: 400px;
  padding: 32px;
}

.dev-compile-box .compile-icon {
  font-size: 2rem;
  margin-bottom: 16px;
  animation: compileSpin 1.5s linear infinite;
}

@keyframes compileSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.dev-compile-box h3 {
  font-size: 0.875rem;
  color: var(--text-primary);
  margin-bottom: 8px;
  font-weight: 500;
}

.dev-compile-box p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.dev-compile-bar {
  height: 3px;
  background: var(--ide-border);
  border-radius: 2px;
  overflow: hidden;
}

.dev-compile-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand), var(--code-green));
  box-shadow: 0 0 12px var(--brand-glow);
  transition: width 0.15s ease;
}

.dev-compile-log {
  margin-top: 16px;
  font-size: 0.625rem;
  color: var(--text-muted);
  text-align: left;
  min-height: 60px;
}

/* ---- API endpoint ticker ---- */
.dev-api-ticker {
  overflow: hidden;
  max-width: 200px;
  mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
}

.dev-api-ticker-track {
  display: flex;
  animation: apiTicker 12s linear infinite;
  white-space: nowrap;
}

.dev-api-ticker-item {
  font-family: var(--mono, monospace);
  font-size: 0.5625rem;
  color: var(--code-purple, #c792ea);
  padding-right: 24px;
}

@keyframes apiTicker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ---- Elite FAB dock ---- */
.dev-fab-dock {
  position: fixed;
  bottom: calc(var(--statusbar-h, 26px) + 16px);
  right: 16px;
  z-index: 998;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dev-fab {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(5, 8, 16, 0.95);
  border: 1px solid var(--ide-border);
  color: var(--brand-light);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.dev-fab:hover {
  border-color: var(--brand);
  box-shadow: 0 0 20px var(--brand-glow);
  transform: scale(1.08);
}

.dev-fab.active {
  background: rgba(26, 143, 224, 0.15);
  border-color: var(--brand);
}

/* ---- Decode reveal text ---- */
.decode-text {
  display: inline;
}

.decode-text .decode-char {
  display: inline-block;
  transition: color 0.1s;
}

.decode-text.revealed .decode-char {
  color: inherit;
}

/* ---- Tech stack orbit (homepage) ---- */
.dev-orbit-wrap {
  position: absolute;
  right: -40px;
  top: 50%;
  transform: translateY(-50%);
  width: 180px;
  height: 180px;
  opacity: 0.35;
  pointer-events: none;
  z-index: 1;
}

.dev-orbit-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 20px var(--brand-glow);
}

.dev-orbit-ring {
  position: absolute;
  inset: 0;
  border: 1px dashed rgba(26, 143, 224, 0.2);
  border-radius: 50%;
  animation: holoSpin 20s linear infinite;
}

.dev-orbit-node {
  position: absolute;
  font-family: var(--mono, monospace);
  font-size: 0.5rem;
  color: var(--brand-light);
  padding: 2px 6px;
  background: rgba(5, 8, 16, 0.8);
  border: 1px solid var(--ide-border);
  border-radius: 4px;
  white-space: nowrap;
}

/* ---- Neon section separator ---- */
.dev-theme .dev-services::after,
.dev-theme .dev-workflow::after {
  content: '';
  display: block;
  width: 100%;
  height: 1px;
  margin-top: 0;
  background: linear-gradient(90deg, transparent, var(--brand), var(--code-green), var(--brand), transparent);
  opacity: 0.2;
}

/* ---- Arch diagram strip ---- */
.dev-arch-strip {
  padding: 24px 0;
  background: #020406;
  border-top: 1px solid var(--ide-border);
  border-bottom: 1px solid var(--ide-border);
  overflow: hidden;
}

.dev-arch-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
  font-family: var(--mono, monospace);
  font-size: 0.6875rem;
}

.dev-arch-node {
  padding: 8px 16px;
  background: var(--ide-bg);
  border: 1px solid var(--ide-border);
  border-radius: 8px;
  color: var(--text-secondary);
  position: relative;
}

.dev-arch-node.highlight {
  border-color: var(--brand);
  color: var(--brand-light);
  box-shadow: 0 0 16px var(--brand-glow);
}

.dev-arch-arrow {
  padding: 0 8px;
  color: var(--brand);
  opacity: 0.5;
  font-size: 0.875rem;
}

/* ---- Mobile ---- */
@media (max-width: 1024px) {
  .dev-sys-hud,
  .dev-orbit-wrap,
  .dev-fab-dock { display: none; }
  .dev-terminal-panel { left: 0; }
}

.dev-theme.has-statusbar.terminal-open {
  padding-bottom: calc(var(--statusbar-h, 26px) + min(280px, 40vh));
}

@media (max-width: 768px) {
  .dev-api-ticker { display: none; }
  .dev-arch-strip { display: none; }
}
