/* ==========================================================================
   TERMINAL PHOSPHOR DESIGN SYSTEM - DANIEL GONÇALVES ARAUJO (@dandgabr)
   High-Assurance Security Architecture & Engineering Aesthetic
   Zero External Dependencies | Pure CSS3 Native
   ========================================================================== */

:root {
  /* Phosphor Color Tokens - Dark Mode (Default) */
  --bg-void: #030a06;
  --bg-base: #061109;
  --bg-surface: #0b1810;
  --bg-card: rgba(12, 24, 18, 0.88);
  --bg-card-hover: rgba(18, 34, 25, 0.95);
  --bg-card-active: #15241d;
  --bg-input: #08140b;
  --bg-header: rgba(6, 17, 9, 0.88);

  /* Phosphor Green Palette */
  --green-core: #00ff66;
  --green-bright: #33ff85;
  --green-dim: #00cc55;
  --green-dark: #003311;
  --green-ultradark: #001f0a;

  /* Luminescence & Overlays */
  --green-glow-sm: 0 0 8px rgba(0, 255, 102, 0.4);
  --green-glow-md: 0 0 16px rgba(0, 255, 102, 0.25);
  --green-glow-lg: 0 0 28px rgba(0, 255, 102, 0.18);
  --green-subtle: rgba(0, 255, 102, 0.06);
  --green-subtle-hover: rgba(0, 255, 102, 0.12);

  /* Hairline Borders */
  --border-subtle: rgba(0, 255, 102, 0.16);
  --border-medium: rgba(0, 255, 102, 0.35);
  --border-bright: #00ff66;
  --border-dim: rgba(0, 204, 85, 0.22);

  /* Semantic Cybernetic Accents */
  --amber-alert: #ffb000;
  --red-alert: #ff3838;
  --cyan-intel: #00f0ff;
  --purple-cert: #a855f7;

  /* Typography Colors (High Contrast WCAG 2.2) */
  --text-white: #f2fff5;
  --text-main: #d0edd8;
  --text-muted: #82ab8e;
  --text-dim: #4c6e56;

  /* Card Shadows */
  --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);

  /* Monospace Typography Stack */
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Source Code Pro', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;

  /* Dimensions & Spacing */
  --header-height: 56px;
  --sidebar-width: 110px;
  --max-width: 1180px;
  --radius-xs: 2px;
  --radius-sm: 3px;

  /* Smooth Transitions */
  --transition-fast: 0.15s cubic-bezier(0.2, 0, 0, 1);
  --transition-smooth: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Light Mode Theme (High-Contrast Security Console: White & Orange)
   ========================================================================== */
[data-theme="light"] {
  --bg-void: #f8faf9;
  --bg-base: #ffffff;
  --bg-surface: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.96);
  --bg-card-hover: #fffaf5;
  --bg-card-active: #fff1e5;
  --bg-input: #ffffff;
  --bg-header: rgba(255, 255, 255, 0.95);

  --green-core: #ea580c;
  --green-bright: #c2410c;
  --green-dim: #f97316;
  --green-dark: #ffedd5;
  --green-ultradark: #fff7ed;

  --green-glow-sm: 0 0 8px rgba(234, 88, 12, 0.22);
  --green-glow-md: 0 0 16px rgba(234, 88, 12, 0.16);
  --green-glow-lg: 0 0 28px rgba(234, 88, 12, 0.1);
  --green-subtle: rgba(234, 88, 12, 0.08);
  --green-subtle-hover: rgba(234, 88, 12, 0.14);

  --border-subtle: rgba(234, 88, 12, 0.22);
  --border-medium: rgba(234, 88, 12, 0.45);
  --border-bright: #ea580c;
  --border-dim: rgba(234, 88, 12, 0.3);

  --amber-alert: #d97706;
  --red-alert: #dc2626;
  --cyan-intel: #0284c7;
  --purple-cert: #7c3aed;

  --text-white: #18181b;
  --text-main: #27272a;
  --text-muted: #52525b;
  --text-dim: #71717a;

  --card-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg-void: #f8faf9;
    --bg-base: #ffffff;
    --bg-surface: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.96);
    --bg-card-hover: #fffaf5;
    --bg-card-active: #fff1e5;
    --bg-input: #ffffff;
    --bg-header: rgba(255, 255, 255, 0.95);

    --green-core: #ea580c;
    --green-bright: #c2410c;
    --green-dim: #f97316;
    --green-dark: #ffedd5;
    --green-ultradark: #fff7ed;

    --green-glow-sm: 0 0 8px rgba(234, 88, 12, 0.22);
    --green-glow-md: 0 0 16px rgba(234, 88, 12, 0.16);
    --green-glow-lg: 0 0 28px rgba(234, 88, 12, 0.1);
    --green-subtle: rgba(234, 88, 12, 0.08);
    --green-subtle-hover: rgba(234, 88, 12, 0.14);

    --border-subtle: rgba(234, 88, 12, 0.22);
    --border-medium: rgba(234, 88, 12, 0.45);
    --border-bright: #ea580c;
    --border-dim: rgba(234, 88, 12, 0.3);

    --amber-alert: #d97706;
    --red-alert: #dc2626;
    --cyan-intel: #0284c7;
    --purple-cert: #7c3aed;

    --text-white: #18181b;
    --text-main: #27272a;
    --text-muted: #52525b;
    --text-dim: #71717a;

    --card-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  }
}

/* ==========================================================================
   CSS Reset & Base Rules
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-mono);
  background-color: var(--bg-void);
  color: var(--text-main);
  line-height: 1.6;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  position: relative;
  min-height: 100vh;
  background-color: var(--bg-base);
  color: var(--text-main);
  overflow-x: hidden;
  font-size: 14.5px;
}

/* Selection Color */
::selection {
  background-color: var(--green-core);
  color: #000000;
  text-shadow: none;
}

/* Accessibility: Skip Link */
.skip-link {
  position: absolute;
  top: -60px;
  left: 20px;
  padding: 10px 18px;
  background: var(--green-core);
  color: #000000;
  font-weight: 700;
  border-radius: var(--radius-xs);
  z-index: 9999;
  transition: top var(--transition-fast);
  text-decoration: none;
  font-size: 13px;
}
.skip-link:focus {
  top: 15px;
  outline: 2px solid #ffffff;
}

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

/* CRT Scanlines & Vignette Overlay */
.crt-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10;
  pointer-events: none;
  background:
    linear-gradient(rgba(18, 28, 20, 0) 50%, rgba(0, 0, 0, 0.45) 50%),
    radial-gradient(circle at center, transparent 60%, rgba(0, 5, 2, 0.7) 100%);
  background-size: 100% 3px, 100% 100%;
  opacity: 0.7;
}

body.crt-off .crt-overlay {
  display: none;
}

:root:not([data-theme="light"]) body.crt-off {
  --text-main: #dcf5e3;
}

/* Links */
a {
  color: var(--green-core);
  text-decoration: none;
  transition: color var(--transition-fast), text-shadow var(--transition-fast);
}
a:hover {
  color: var(--green-bright);
  text-shadow: var(--green-glow-sm);
}

/* Helper Utilities */
.text-dim { color: var(--text-dim) !important; }
.text-accent { color: var(--green-core) !important; text-shadow: var(--green-glow-sm); }
.text-highlight { color: var(--text-white) !important; }
.code-highlight {
  color: var(--green-bright);
  background-color: var(--green-ultradark);
  padding: 1px 5px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
}

/* ==========================================================================
   HUD Header & Navigation Bar
   ========================================================================== */
.hud-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background-color: var(--bg-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: background-color var(--transition-smooth), border-color var(--transition-smooth);
}

.hud-container {
  max-width: var(--max-width);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

/* System State Badge */
.sys-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  flex-shrink: 0;
}

.status-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--green-core);
  box-shadow: 0 0 10px var(--green-core);
  animation: pulseLed 2s infinite ease-in-out;
  flex-shrink: 0;
}

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

.sys-title {
  color: var(--green-bright);
  letter-spacing: 0.5px;
  line-height: 1;
}

.sys-state {
  color: var(--text-dim);
  font-size: 11.5px;
  line-height: 1;
}

/* Navigation Links */
.hud-nav {
  display: flex;
  align-items: center;
  height: 100%;
}

.nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 16px;
  height: 100%;
  margin: 0;
  padding: 0;
}

.nav-links li {
  display: flex;
  align-items: center;
  height: 100%;
}

.nav-item {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  padding: 6px 6px;
  position: relative;
  display: inline-flex;
  align-items: center;
  line-height: 1;
  transition: color var(--transition-fast);
}

.nav-num {
  color: var(--text-dim);
  margin-right: 2px;
  line-height: 1;
}

.nav-item:hover {
  color: var(--green-core);
}

.nav-item.active {
  color: var(--green-bright);
  text-shadow: var(--green-glow-sm);
}

.nav-item.active::after {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 6px;
  right: 6px;
  height: 2px;
  background-color: var(--green-core);
  box-shadow: var(--green-glow-sm);
}

/* HUD System Controls */
.hud-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.hud-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1;
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: all var(--transition-fast);
}

.hud-btn:hover {
  border-color: var(--border-medium);
  color: var(--green-core);
  background: var(--green-subtle);
}

.hud-btn .btn-bracket {
  color: var(--text-dim);
  line-height: 1;
}

.hud-btn .btn-val {
  color: var(--green-core);
  font-weight: 600;
  line-height: 1;
}

.mobile-only {
  display: none;
}

/* ==========================================================================
   SYS-CTRL Vertical Side Panel
   ========================================================================== */
.sys-ctrl-panel {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 90;
  width: var(--sidebar-width);
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.45), var(--green-glow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ctrl-header {
  padding: 8px 10px 6px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: center;
}

.ctrl-title {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
  line-height: 1;
}

.ctrl-group {
  display: flex;
  flex-direction: column;
}

.ctrl-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-mono);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  text-align: left;
  gap: 4px;
}

.ctrl-item:last-child {
  border-bottom: none;
}

.ctrl-item:hover,
.ctrl-item:focus-visible {
  background: var(--green-subtle);
  outline: none;
}

.ctrl-item:focus-visible {
  outline: 1px solid var(--border-medium);
  outline-offset: -1px;
}

.ctrl-item-label {
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  line-height: 1.2;
  white-space: nowrap;
  transition: color var(--transition-fast);
}

.ctrl-item:hover .ctrl-item-label {
  color: var(--text-muted);
}

/* .btn-val reused from header buttons — color + weight already defined */
.ctrl-item .btn-val {
  font-size: 11px;
  font-weight: 700;
  color: var(--green-core);
  letter-spacing: 1px;
  line-height: 1;
}

.ctrl-item:hover .btn-val {
  text-shadow: var(--green-glow-sm);
}

/* ==========================================================================
   Main Layout & Section Structure
   ========================================================================== */
.main-layout {
  position: relative;
  z-index: 5;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 20px 80px calc(var(--sidebar-width) + 20px);
  display: flex;
  flex-direction: column;
  gap: 60px;
}

.terminal-section {
  scroll-margin-top: calc(var(--header-height) + 24px);
}

#skills, #projects, #credentials, #contact {
  content-visibility: auto;
  contain-intrinsic-size: 1px 700px;
}

/* Section Tag Header */
.section-tag-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.tag-index {
  color: var(--green-core);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
}

.section-title {
  color: var(--text-white);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1.5px;
}

.section-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-medium), transparent);
}

/* ==========================================================================
   Terminal Window Components (Cards & HUD Reticles)
   ========================================================================== */
.terminal-card {
  background-color: var(--bg-surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  position: relative;
  transition: background-color var(--transition-smooth), border-color var(--transition-smooth), box-shadow var(--transition-smooth);
}

.terminal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-medium), transparent);
}

.terminal-card-header {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  padding: 9px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  opacity: 0.8;
}
.dot-red { background-color: var(--red-alert); }
.dot-amber { background-color: var(--amber-alert); }
.dot-green { background-color: var(--green-core); }

.terminal-title {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-meta {
  font-size: 11px;
  color: var(--text-dim);
}

.terminal-card-body {
  padding: 24px;
}

/* HUD Tactical Cards */
.hud-card {
  background-color: var(--bg-surface);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 24px;
  position: relative;
  box-shadow: var(--card-shadow);
  transition: border-color var(--transition-smooth), transform var(--transition-smooth), box-shadow var(--transition-smooth), background-color var(--transition-smooth);
}

.hud-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--green-glow-md);
  transform: translateY(-2px);
}

.card-hud-label {
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 1px;
  margin-bottom: 10px;
  font-weight: 600;
}

.card-title {
  font-size: 17px;
  color: var(--green-bright);
  font-weight: 700;
  margin-bottom: 14px;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   Hero Section & Glitch Identity
   ========================================================================== */
.hero-section {
  margin-top: 12px;
}

.hero-card .terminal-card-body {
  padding: 28px;
}

/* Boot Sequence Screen */
.boot-sequence {
  background-color: var(--bg-void);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 14px 18px;
  margin-bottom: 28px;
  font-size: 12.5px;
  line-height: 1.7;
  min-height: 140px;
  max-height: 160px;
  overflow-y: auto;
  contain: layout;
}

.log-line {
  white-space: pre-wrap;
  word-break: break-all;
}

/* Hero Content Grid */
.hero-identity-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 36px;
  align-items: center;
}

.identity-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tag-badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  text-transform: uppercase;
  border: 1px solid transparent;
}

.tag-security {
  background-color: var(--green-subtle);
  color: var(--green-bright);
  border-color: var(--border-medium);
}

.tag-cert {
  background-color: rgba(255, 176, 0, 0.1);
  color: var(--amber-alert);
  border-color: rgba(255, 176, 0, 0.3);
}

.tag-geo {
  background-color: rgba(0, 240, 255, 0.08);
  color: var(--cyan-intel);
  border-color: rgba(0, 240, 255, 0.25);
}

.hero-glitch-title {
  font-size: clamp(26px, 4.2vw, 42px);
  font-weight: 800;
  color: var(--text-white);
  letter-spacing: 1.5px;
  line-height: 1.15;
  margin-bottom: 14px;
  text-shadow: var(--green-glow-sm);
}

.hero-subline {
  font-size: 15.5px;
  color: var(--text-main);
  line-height: 1.6;
  margin-bottom: 24px;
  max-width: 680px;
}

/* Three Hero Pillars */
.hero-pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.pillar-chip {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.pillar-chip:hover {
  border-color: var(--border-medium);
  background-color: var(--bg-card-hover);
}

.chip-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.chip-body {
  display: flex;
  flex-direction: column;
}

.chip-body strong {
  font-size: 12.5px;
  color: var(--text-white);
}

.chip-body small {
  font-size: 11px;
  color: var(--text-muted);
}

/* Hero Tactical Action Buttons */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.8px;
  padding: 10px 20px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.action-primary {
  background-color: var(--green-core);
  color: #000000;
  box-shadow: var(--green-glow-sm);
}

.action-primary:hover {
  background-color: var(--green-bright);
  color: #000000;
  box-shadow: var(--green-glow-md);
  transform: translateY(-1px);
}

.action-secondary {
  background-color: transparent;
  border-color: var(--border-medium);
  color: var(--green-core);
}

.action-secondary:hover {
  background-color: var(--green-subtle);
  border-color: var(--green-core);
  color: var(--green-bright);
  box-shadow: var(--green-glow-sm);
}

.action-ghost {
  background-color: transparent;
  border-color: var(--border-subtle);
  color: var(--text-muted);
}

.action-ghost:hover {
  border-color: var(--text-muted);
  color: var(--text-white);
}

.btn-prefix {
  font-weight: 700;
}

/* Avatar Reticle Frame */
.hero-avatar-pane {
  display: flex;
  justify-content: center;
}

.hud-reticle {
  position: relative;
  width: 240px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 16px;
  border-radius: var(--radius-xs);
}

/* Reticle HUD Corners */
.hud-corner {
  position: absolute;
  width: 8px;
  height: 8px;
  border-color: var(--green-core);
  border-style: solid;
}
.hud-corner.top-left { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.hud-corner.top-right { top: -1px; right: -1px; border-width: 2px 2px 0 0; }
.hud-corner.bottom-left { bottom: -1px; left: -1px; border-width: 0 0 2px 2px; }
.hud-corner.bottom-right { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }

.avatar-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: var(--bg-void);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05) brightness(1);
  mix-blend-mode: normal;
  opacity: 0.92;
  transition: filter 0.3s ease, opacity 0.3s ease;
}

.avatar-frame:hover .avatar-img {
  filter: grayscale(0) contrast(1.05) brightness(1);
  mix-blend-mode: normal;
  opacity: 1;
}

.ascii-fallback {
  color: var(--green-core);
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
}

.scan-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--green-core);
  box-shadow: 0 0 8px var(--green-core);
  opacity: 0.6;
  will-change: transform;
  animation: scanAvatar 3.5s linear infinite;
}

@keyframes scanAvatar {
  0% { transform: translateY(0); opacity: 0; }
  10% { opacity: 0.7; }
  90% { opacity: 0.7; }
  100% { transform: translateY(208px); opacity: 0; }
}

.telemetry-hud-data {
  font-size: 10.5px;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.telemetry-item {
  display: flex;
  justify-content: space-between;
}

.telemetry-item span {
  color: var(--text-muted);
  font-weight: 600;
}

/* ==========================================================================
   Interactive Terminal Section
   ========================================================================== */
.terminal-interactive {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.terminal-instructions {
  font-size: 12.5px;
}

/* Quick Command Chips */
.quick-cmd-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cmd-chip {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--green-core);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.cmd-chip:hover {
  background-color: var(--green-core);
  color: #000000;
  border-color: var(--green-core);
  box-shadow: var(--green-glow-sm);
}

.cmd-chip:active {
  transform: scale(0.96);
}

/* Output Log Window */
.terminal-output {
  background-color: var(--bg-void);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 16px;
  min-height: 200px;
  max-height: 420px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.65;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--green-dim) var(--bg-void);
}

.term-entry {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.term-cmd-echo {
  color: var(--green-bright);
  font-weight: 600;
}

.term-response {
  color: var(--text-main);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Terminal Input Row */
.terminal-input-row {
  display: flex;
  align-items: center;
  background-color: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xs);
  padding: 8px 12px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.terminal-input-row:focus-within {
  border-color: var(--green-core);
  box-shadow: var(--green-glow-sm);
}

.term-prompt {
  font-size: 13px;
  font-weight: 600;
  user-select: none;
  display: inline-flex;
  white-space: nowrap;
}

.term-user { color: var(--green-core); }
.term-at { color: var(--text-dim); }
.term-host { color: var(--green-bright); }
.term-path { color: var(--cyan-intel); }

.term-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-white);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.5px;
}

.term-input::placeholder {
  color: var(--text-dim);
}

.term-submit-btn {
  background: transparent;
  border: none;
  color: var(--green-core);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 4px;
  transition: color var(--transition-fast);
}

.term-submit-btn:hover {
  color: var(--green-bright);
  text-shadow: var(--green-glow-sm);
}

/* ==========================================================================
   Section 03: Profile Intel & Methodology (About)
   ========================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.dossier-org {
  display: flex;
  gap: 8px;
  font-size: 12.5px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.org-label {
  color: var(--text-dim);
  font-weight: 600;
}

.org-name {
  color: var(--green-bright);
  font-weight: 600;
}

.dossier-body {
  font-size: 14px;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.dossier-body strong {
  color: var(--text-white);
}

.dossier-specs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background-color: var(--bg-card);
  padding: 14px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

.spec-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  gap: 10px;
}

.spec-key {
  color: var(--text-dim);
  font-weight: 600;
}

.spec-val {
  color: var(--text-muted);
  text-align: right;
  font-weight: 500;
}

/* Triad Pillars */
.triad-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.triad-item {
  display: flex;
  gap: 16px;
  padding: 14px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.triad-item:hover {
  border-color: var(--border-medium);
  transform: translateX(4px);
}

.triad-num {
  font-size: 18px;
  font-weight: 800;
  color: var(--green-core);
  opacity: 0.8;
  line-height: 1.2;
}

.triad-content h4 {
  font-size: 13.5px;
  color: var(--text-white);
  margin-bottom: 6px;
}

.triad-content p {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ==========================================================================
   Section 04: Technical Capabilities & Domains (Skills)
   ========================================================================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.skill-card {
  display: flex;
  flex-direction: column;
}

.skill-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.domain-icon {
  font-size: 20px;
}

.skill-title {
  font-size: 15.5px;
  color: var(--text-white);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.skill-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
  line-height: 1.5;
}

.skill-pill-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.skill-pill {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 12px;
  padding: 5px 10px;
  border-radius: var(--radius-xs);
  transition: all var(--transition-fast);
}

.skill-pill:hover {
  border-color: var(--green-core);
  color: var(--green-bright);
  background-color: var(--green-subtle);
  box-shadow: var(--green-glow-sm);
}

[data-theme="light"] .skill-pill {
  background-color: #ffffff;
  border: 1px solid rgba(234, 88, 12, 0.4);
  color: #c2410c;
  font-weight: 600;
}

[data-theme="light"] .skill-pill:hover {
  background-color: #ea580c;
  color: #ffffff;
  border-color: #ea580c;
  box-shadow: 0 2px 10px rgba(234, 88, 12, 0.35);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .skill-pill {
    background-color: #ffffff;
    border: 1px solid rgba(234, 88, 12, 0.4);
    color: #c2410c;
    font-weight: 600;
  }
  :root:not([data-theme="dark"]) .skill-pill:hover {
    background-color: #ea580c;
    color: #ffffff;
    border-color: #ea580c;
    box-shadow: 0 2px 10px rgba(234, 88, 12, 0.35);
  }
}

/* ==========================================================================
   Section 05: Featured Projects & Filter Tabs
   ========================================================================== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.filter-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-btn:hover {
  border-color: var(--border-medium);
  color: var(--green-core);
  background: var(--green-subtle);
}

.filter-btn.active {
  background-color: var(--green-core);
  color: #000000;
  border-color: var(--green-core);
  box-shadow: var(--green-glow-sm);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 22px;
}

.project-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 22px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: border-color var(--transition-smooth), transform var(--transition-smooth), box-shadow var(--transition-smooth), opacity var(--transition-smooth);
}

.project-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--green-glow-md);
  transform: translateY(-3px);
}

.project-card.is-hidden {
  display: none !important;
}

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.proj-telemetry {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.proj-id {
  color: var(--text-dim);
  font-weight: 700;
}

.proj-status {
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.status-active { background: var(--green-subtle); color: var(--green-bright); border: 1px solid var(--border-medium); }
.status-prototype { background: rgba(255, 176, 0, 0.12); color: var(--amber-alert); border: 1px solid rgba(255, 176, 0, 0.25); }
.status-audit { background: rgba(0, 240, 255, 0.12); color: var(--cyan-intel); border: 1px solid rgba(0, 240, 255, 0.25); }
.status-community { background: rgba(168, 85, 247, 0.12); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.25); }

.proj-category-tags {
  display: flex;
  gap: 6px;
}

.mini-tag {
  font-size: 10.5px;
  color: var(--text-dim);
  background-color: var(--bg-card);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

.proj-title {
  font-size: 16.5px;
  color: var(--text-white);
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.proj-icon {
  font-size: 18px;
}

.proj-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
}

.proj-capabilities {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 20px;
  margin-top: auto;
}

.cap-item {
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.4;
}

.proj-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.inspect-btn {
  background: transparent;
  border: 1px solid var(--border-medium);
  color: var(--green-core);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.inspect-btn:hover {
  background: var(--green-core);
  color: #000000;
  box-shadow: var(--green-glow-sm);
}

.repo-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 8px;
}

.repo-link:hover {
  color: var(--text-white);
}

/* ==========================================================================
   Section 06: Academic Trajectory & Credentials
   ========================================================================== */
.credentials-timeline {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  padding-left: 36px;
}

.credentials-timeline::before {
  content: '';
  position: absolute;
  top: 15px;
  bottom: 15px;
  left: 11px;
  width: 2px;
  background: linear-gradient(180deg, var(--green-core), var(--border-subtle));
}

.timeline-entry {
  position: relative;
}

.timeline-marker {
  position: absolute;
  left: -36px;
  top: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.marker-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--green-core);
  box-shadow: 0 0 10px var(--green-core);
  border: 2px solid var(--bg-base);
}

.marker-code {
  font-size: 9.5px;
  font-weight: 800;
  color: var(--green-dim);
  display: none;
}

.timeline-card {
  padding: 20px 24px;
}

.timeline-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.cred-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  letter-spacing: 0.5px;
}

.badge-cert { background: rgba(255, 176, 0, 0.12); color: var(--amber-alert); border: 1px solid rgba(255, 176, 0, 0.3); }
.badge-academic { background: rgba(0, 240, 255, 0.1); color: var(--cyan-intel); border: 1px solid rgba(0, 240, 255, 0.25); }
.badge-teaching { background: var(--green-subtle); color: var(--green-bright); border: 1px solid var(--border-medium); }

.cred-institution {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 600;
}

.cred-title {
  font-size: 16px;
  color: var(--text-white);
  font-weight: 700;
  margin-bottom: 8px;
}

.cred-detail {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ==========================================================================
   Section 07: Coordinates & Telemetry (Contact)
   ========================================================================== */
.contact-panel {
  padding: 32px;
}

.contact-headline {
  font-size: 22px;
  color: var(--text-white);
  font-weight: 700;
  margin-bottom: 10px;
}

.contact-sub {
  font-size: 14.5px;
  color: var(--text-main);
  margin-bottom: 28px;
  max-width: 720px;
}

.channels-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.channel-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition-fast);
}

.channel-card:hover {
  border-color: var(--green-core);
  background-color: var(--bg-card-hover);
  box-shadow: var(--green-glow-sm);
  transform: translateY(-2px);
}

.channel-icon {
  color: var(--green-core);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.channel-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.channel-label {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
}

.channel-value {
  font-size: 14px;
  color: var(--text-white);
  font-weight: 700;
}

.channel-arrow {
  font-size: 14px;
  color: var(--green-dim);
  font-weight: 700;
  transition: transform var(--transition-fast);
}

.channel-card:hover .channel-arrow {
  color: var(--green-bright);
  transform: translateX(4px);
}

.transmission-status {
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.status-line {
  display: flex;
  font-size: 12px;
  gap: 10px;
}

.status-key {
  color: var(--text-dim);
  font-weight: 600;
}

.status-val {
  color: var(--text-muted);
}

/* ==========================================================================
   Project Inspection Modal (<dialog>)
   ========================================================================== */
.terminal-modal {
  margin: auto;
  padding: 0;
  background: transparent;
  border: none;
  max-width: 720px;
  width: 90%;
  color: var(--text-main);
}

.terminal-modal::backdrop {
  background-color: rgba(2, 4, 3, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--green-core);
  border-radius: var(--radius-sm);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4), var(--green-glow-lg);
  overflow: hidden;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 6px;
  transition: color var(--transition-fast);
}

.modal-close-btn:hover {
  color: var(--red-alert);
}

.modal-card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-meta-row {
  display: flex;
  gap: 8px;
}

.modal-title {
  font-size: 20px;
  color: var(--text-white);
  font-weight: 700;
}

.modal-desc {
  font-size: 14px;
  color: var(--text-main);
  line-height: 1.6;
}

.modal-tech-block {
  background-color: var(--bg-void);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-subheading {
  font-size: 12px;
  color: var(--green-bright);
  letter-spacing: 0.8px;
  font-weight: 700;
}

.modal-details-content {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
  white-space: pre-wrap;
}

.modal-stack-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  padding-top: 10px;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.hud-footer {
  position: relative;
  z-index: 5;
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-void);
  padding: 20px 0;
  font-size: 12px;
  color: var(--text-dim);
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.prompt-symbol {
  color: var(--green-core);
  font-weight: 700;
}

.footer-sep {
  color: var(--border-medium);
}

.footer-spec {
  color: var(--text-muted);
  font-size: 11px;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

/* --- 1. Tablet compacto (768–1023px): sidebar estreita, só o valor ------ */
@media (max-width: 1023px) {
  :root {
    --sidebar-width: 48px;
  }
  .ctrl-header {
    display: none;
  }
  .ctrl-item {
    align-items: center;
    padding: 10px 6px;
    gap: 3px;
  }
  .ctrl-item-label {
    display: none;
  }
  .ctrl-item .btn-val {
    font-size: 10px;
    letter-spacing: 0.5px;
  }
}

/* --- 2. Grid/hero adjustments 900px --------------------------------------- */
@media (max-width: 900px) {
  .hero-identity-grid {
    grid-template-columns: 1fr;
  }
  .hero-avatar-pane {
    order: -1;
    margin-bottom: 10px;
  }
  .hud-reticle {
    width: 180px;
  }
  .about-grid {
    grid-template-columns: 1fr;
  }
  .skills-grid {
    grid-template-columns: 1fr;
  }
  .channels-grid {
    grid-template-columns: 1fr;
  }
}

/* --- 3. Mobile portrait (≤767px): sidebar → barra inferior fixa ---------- */
@media (max-width: 767px) {
  :root {
    --sidebar-width: 0px;
  }

  /* Sidebar transforma-se em barra inferior */
  .sys-ctrl-panel {
    position: fixed;
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    transform: none;
    width: 100%;
    height: 48px;
    flex-direction: row;
    border: none;
    border-top: 1px solid var(--border-subtle);
    border-radius: 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    z-index: 95;
  }

  .ctrl-header {
    display: none;
  }

  .ctrl-group {
    flex-direction: row;
    flex: 1;
  }

  .ctrl-item {
    flex: 1;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    border-bottom: none;
    border-right: 1px solid var(--border-subtle);
    gap: 5px;
    height: 100%;
  }

  .ctrl-item:last-child {
    border-right: none;
  }

  .ctrl-item-label {
    display: block;
    font-size: 8.5px;
    letter-spacing: 0.3px;
  }

  .ctrl-item .btn-val {
    font-size: 10.5px;
  }

  /* Main layout: padding bottom para não ficar atrás da barra */
  .main-layout {
    padding-left: 20px;
    padding-bottom: 68px;
  }

  /* Hero pillars single column */
  .hero-pillars {
    grid-template-columns: 1fr;
  }

  /* Nav links dropdown mobile */
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    flex-direction: column;
    padding: 16px 20px;
    gap: 12px;
    height: auto;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.8);
  }
  .nav-links li {
    height: auto;
  }
  .nav-links.mobile-open {
    display: flex;
  }
  .mobile-only {
    display: inline-flex;
  }
  .footer-container {
    flex-direction: column;
    align-items: flex-start;
  }
  .credentials-timeline {
    padding-left: 24px;
  }
  .timeline-marker {
    left: -24px;
  }
}

/* --- 4. Landscape mobile (altura curta): sidebar ultra-compacta ---------- */
@media (max-height: 500px) and (orientation: landscape) {
  :root {
    --header-height: 44px;
    --sidebar-width: 40px;
  }
  .ctrl-header {
    display: none;
  }
  .ctrl-item {
    align-items: center;
    padding: 6px 4px;
  }
  .ctrl-item-label {
    display: none;
  }
  .ctrl-item .btn-val {
    font-size: 9px;
    letter-spacing: 0;
  }
  .sys-state {
    display: none;
  }
}

/* ==========================================================================
   Accessibility: Reduced Motion Preference
   ========================================================================== */
@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;
  }
  #stream-canvas {
    display: none !important;
  }
}
