/* ============================================================
   MAHMOUD SAMI — TERMINAL PORTFOLIO v2
   Matrix / Cyberpunk Terminal Theme
   ============================================================ */

:root {
  --bg:         #000000;
  --bg-soft:    #030a03;
  --bg-card:    rgba(0, 12, 2, 0.92);
  --text:       #c8f0c8;
  --muted:      #4a7c4a;
  --primary:    #00ff41;
  --primary-dim:#00b82e;
  --secondary:  #00e5ff;
  --warn:       #ffb800;
  --danger:     #ff3c3c;
  --stroke:     rgba(0, 255, 65, 0.18);
  --stroke-hot: rgba(0, 255, 65, 0.55);
  --glow:       0 0 18px rgba(0, 255, 65, 0.35);
  --glow-hot:   0 0 32px rgba(0, 255, 65, 0.6);
  --shadow:     0 20px 50px rgba(0, 0, 0, 0.7);
}

/* ─── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Fira Code', 'Share Tech Mono', monospace;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  cursor: none;
}

/* ─── CUSTOM SCROLLBAR ───────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--primary-dim); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ─── CUSTOM CURSOR ──────────────────────────────────────────── */
#cursor {
  position: fixed;
  width: 16px;
  height: 16px;
  border: 2px solid var(--primary);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s, border-color 0.2s, background 0.2s;
  mix-blend-mode: screen;
}
#cursor-trail {
  position: fixed;
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: left 0.08s ease, top 0.08s ease;
  opacity: 0.7;
}
body:has(a:hover) #cursor,
body:has(button:hover) #cursor,
body:has(input:hover) #cursor {
  width: 32px;
  height: 32px;
  background: rgba(0, 255, 65, 0.12);
  border-color: var(--primary);
}

/* ─── SCROLL PROGRESS ────────────────────────────────────────── */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  z-index: 1000;
  width: 0%;
  transition: width 0.1s linear;
  box-shadow: 0 0 10px var(--primary);
}

/* ─── MATRIX CANVAS ──────────────────────────────────────────── */
#matrix-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  opacity: 0.09;
}

/* ─── SCANLINE OVERLAY ───────────────────────────────────────── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 255, 65, 0.02) 3px
  );
}

/* ─── BOOT SCREEN ────────────────────────────────────────────── */
#boot-screen {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}
#boot-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.boot-content {
  width: min(860px, 90vw);
  font-family: 'Fira Code', monospace;
}
.ascii-logo {
  color: var(--primary);
  font-size: clamp(0.35rem, 0.9vw, 0.72rem);
  line-height: 1.3;
  margin: 0 0 1rem;
  text-shadow: 0 0 12px rgba(0, 255, 65, 0.6);
  overflow-x: auto;
}
.boot-subtitle {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 1.5rem;
  letter-spacing: 0.1em;
}
.boot-log {
  min-height: 7rem;
  font-size: 0.82rem;
  line-height: 1.8;
  color: var(--text);
}
.boot-log .ok    { color: var(--primary); }
.boot-log .warn  { color: var(--warn); }
.boot-log .info  { color: var(--secondary); }
.boot-progress-wrap {
  height: 3px;
  background: rgba(0, 255, 65, 0.12);
  border-radius: 2px;
  margin: 1.2rem 0 0.8rem;
  overflow: hidden;
}
.boot-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  box-shadow: 0 0 12px var(--primary);
  transition: width 0.3s ease;
}
.boot-hint {
  color: var(--muted);
  font-size: 0.75rem;
  margin: 0;
  min-height: 1.2rem;
}
.boot-hint span { color: var(--primary); }

/* ─── LAYOUT ─────────────────────────────────────────────────── */
.container {
  width: min(1160px, 92vw);
  margin: 0 auto;
}
.section { padding: 5rem 0 2rem; }

/* ─── NAVBAR ─────────────────────────────────────────────────── */
.nav-wrapper {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(12px);
  transition: border-color 0.3s;
}
.nav-wrapper.scrolled {
  border-color: var(--stroke-hot);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  gap: 1rem;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.logo {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.logo-path { color: var(--muted); }
.logo-dollar { color: var(--primary); margin: 0 2px; }
.logo-blink {
  color: var(--primary);
  animation: blink 1s step-end infinite;
}

.nav ul {
  list-style: none;
  display: flex;
  gap: 0.2rem;
  margin: 0;
  padding: 0;
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  padding: 0.4rem 0.65rem;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}
.nav-num { color: var(--primary); font-size: 0.72rem; margin-right: 3px; }
.nav a:hover, .nav a.active {
  color: var(--primary);
  background: rgba(0, 255, 65, 0.07);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: none;
  padding: 4px;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--primary);
  transition: 0.3s;
}
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ─── SECTION HEADERS ────────────────────────────────────────── */
.section-header { margin-bottom: 2rem; }
.section-tag {
  font-size: 0.75rem;
  color: var(--primary);
  letter-spacing: 0.15em;
  display: block;
  margin-bottom: 0.4rem;
}
.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 700;
  margin: 0 0 0.7rem;
  color: var(--text);
  letter-spacing: -0.01em;
  position: relative;
  display: inline-block;
}
.title-line {
  height: 2px;
  width: 80px;
  background: linear-gradient(90deg, var(--primary), transparent);
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.4);
}

/* ─── GLITCH EFFECT ──────────────────────────────────────────── */
.glitch { position: relative; }
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  font-size: inherit;
  font-weight: inherit;
  font-family: inherit;
}
.glitch::before {
  color: #ff00cc;
  animation: glitch-top 4s infinite;
  clip-path: polygon(0 0, 100% 0, 100% 38%, 0 38%);
  transform: translate(-2px, -2px);
}
.glitch::after {
  color: #00e5ff;
  animation: glitch-bot 4s infinite;
  clip-path: polygon(0 62%, 100% 62%, 100% 100%, 0 100%);
  transform: translate(2px, 2px);
}

@keyframes glitch-top {
  0%, 92%, 100% { opacity: 0; transform: translate(-2px, -2px); }
  93%  { opacity: 0.75; transform: translate(-4px, 0); clip-path: polygon(0 0, 100% 0, 100% 42%, 0 42%); }
  94%  { opacity: 0.75; transform: translate(4px, 0); clip-path: polygon(0 0, 100% 0, 100% 30%, 0 30%); }
  95%  { opacity: 0; }
}
@keyframes glitch-bot {
  0%, 92%, 100% { opacity: 0; transform: translate(2px, 2px); }
  93%  { opacity: 0.6; transform: translate(4px, 0); clip-path: polygon(0 60%, 100% 60%, 100% 100%, 0 100%); }
  94%  { opacity: 0.6; transform: translate(-4px, 0); clip-path: polygon(0 70%, 100% 70%, 100% 100%, 0 100%); }
  95%  { opacity: 0; }
}

/* ─── HERO ───────────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 2rem;
  align-items: start;
  padding-top: 5rem;
}
.tag {
  display: inline-block;
  font-size: 0.75rem;
  border: 1px solid var(--stroke-hot);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  color: var(--primary);
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
  background: rgba(0, 255, 65, 0.04);
}
h1 {
  font-size: clamp(1.9rem, 4vw, 3.2rem);
  line-height: 1.1;
  margin: 0 0 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.subtitle {
  color: var(--muted);
  line-height: 1.85;
  font-size: 0.92rem;
}

/* Buttons */
.hero-actions, .contact-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin: 1.4rem 0;
}
.btn {
  text-decoration: none;
  border-radius: 6px;
  padding: 0.7rem 1.3rem;
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}
.btn-primary {
  background: var(--primary);
  color: #001a06;
  box-shadow: 0 0 18px rgba(0, 255, 65, 0.3);
}
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.2) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.5s;
}
.btn-primary:hover::after { transform: translateX(100%); }
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 32px rgba(0, 255, 65, 0.55);
}
.btn-ghost {
  color: var(--primary);
  border: 1px solid var(--stroke-hot);
  background: rgba(0, 255, 65, 0.03);
}
.btn-ghost:hover {
  background: rgba(0, 255, 65, 0.1);
  border-color: var(--primary);
  box-shadow: var(--glow);
  transform: translateY(-3px);
}

/* Quick links */
.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin-top: 0.5rem;
}
.quick-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.quick-links a:hover { color: var(--primary); }
.ql-icon { color: var(--primary); font-size: 0.65rem; }

/* ─── TERMINAL WINDOW ────────────────────────────────────────── */
.terminal-window {
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: var(--bg-card);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.terminal-window:hover {
  border-color: var(--stroke-hot);
  box-shadow: var(--shadow), var(--glow);
}
.terminal-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--stroke);
  background: rgba(0, 20, 5, 0.85);
}
.terminal-dots { display: flex; gap: 6px; align-items: center; }
.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.dot-red    { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green  { background: #27c93f; box-shadow: 0 0 6px rgba(39, 201, 63, 0.6); }
.terminal-title {
  flex: 1;
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.04em;
}
.terminal-actions {
  display: flex;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.8rem;
  opacity: 0.5;
}

.terminal-layout {
  display: grid;
  grid-template-columns: 1.3fr 0.85fr;
  gap: 1rem;
  padding: 1rem;
}

.terminal-shell {
  font-size: 0.82rem;
  line-height: 1.6;
  overflow-y: auto;
  max-height: 400px;
  padding-right: 0.5rem;
}
.terminal-shell::-webkit-scrollbar { width: 3px; }
.terminal-shell::-webkit-scrollbar-thumb { background: var(--stroke-hot); }

.shell-line {
  display: flex;
  gap: 0.5rem;
  margin: 0.3rem 0 0.1rem;
  color: var(--muted);
}
.prompt-sym { color: var(--primary); flex-shrink: 0; }
.cmd-text { color: var(--text); }
.output {
  color: #78c878;
  margin-left: 1rem;
  min-height: 1.1em;
}
.live-output { color: var(--muted); }
#live-command {
  color: var(--primary);
  font-weight: 600;
  min-height: 1.1em;
}
#live-command.flash {
  animation: livePulse 0.4s ease;
}
@keyframes livePulse {
  from { opacity: 0.3; transform: translateX(-3px); }
  to   { opacity: 1;   transform: translateX(0); }
}

/* Interactive terminal input */
.terminal-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.6rem;
  border-top: 1px solid var(--stroke);
  padding-top: 0.5rem;
}
.prompt-path { color: var(--secondary); font-size: 0.78rem; }
#terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--primary);
  font-family: 'Fira Code', monospace;
  font-size: 0.82rem;
  caret-color: var(--primary);
  cursor: none;
}
#terminal-input::placeholder { color: rgba(0, 255, 65, 0.25); font-size: 0.75rem; }

#interactive-output .i-line {
  font-size: 0.78rem;
  line-height: 1.55;
  margin: 0.1rem 0;
}
#interactive-output .i-cmd { color: var(--muted); }
#interactive-output .i-cmd .prompt-sym { color: var(--primary); }
#interactive-output .i-out { color: var(--secondary); padding-left: 1rem; }
#interactive-output .i-err { color: var(--danger); padding-left: 1rem; }
#interactive-output .i-easter { color: var(--warn); padding-left: 1rem; }

/* Typing effect */
.type-line.typing::after {
  content: "█";
  color: var(--primary);
  animation: blink 0.8s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ─── PROFILE PANEL ──────────────────────────────────────────── */
.profile-panel {
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: rgba(0, 15, 4, 0.95);
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.profile-ring {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--stroke);
  box-shadow: 0 0 0 2px rgba(0, 255, 65, 0.1);
}
.profile-ring img {
  width: 100%;
  display: block;
  aspect-ratio: 4/5;
  object-fit: cover;
  object-position: center top;
}
.profile-scan {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  animation: scan 3s linear infinite;
  opacity: 0.6;
}
@keyframes scan {
  0%   { top: 0%; }
  100% { top: 100%; }
}

.profile-info { text-align: center; }
.profile-info h3 { margin: 0 0 0.2rem; font-size: 0.9rem; color: var(--text); }
.profile-role { margin: 0 0 0.6rem; color: var(--muted); font-size: 0.75rem; }
.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  justify-content: center;
  margin-bottom: 0.7rem;
}
.badge {
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  color: var(--primary);
  background: rgba(0, 255, 65, 0.04);
}
.status-dot-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  color: var(--muted);
}
.status-dot {
  width: 7px;
  height: 7px;
  background: var(--primary);
  border-radius: 50%;
  animation: statusPulse 2s ease-in-out infinite;
  box-shadow: 0 0 6px var(--primary);
}
@keyframes statusPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.7; }
}

/* ─── TERMINAL CARDS ─────────────────────────────────────────── */
.terminal-card {
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: var(--bg-card);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
  overflow: hidden;
}
.terminal-card:hover {
  border-color: var(--stroke-hot);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6), var(--glow);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--stroke);
  padding: 0.6rem 0.9rem;
  background: rgba(0, 20, 5, 0.8);
  font-size: 0.75rem;
  color: var(--primary);
}
.card-head-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 6px var(--primary);
  flex-shrink: 0;
}
.card-head-dot.devops  { background: #00e5ff; box-shadow: 0 0 6px #00e5ff; }
.card-head-dot.dotnet  { background: #a259ff; box-shadow: 0 0 6px #a259ff; }
.card-head-dot.node    { background: #4ade80; box-shadow: 0 0 6px #4ade80; }
.card-head-dot.tool    { background: #ffb800; box-shadow: 0 0 6px #ffb800; }
.card-lang {
  margin-left: auto;
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.card-body {
  padding: 1.1rem;
  line-height: 1.75;
  color: var(--muted);
  font-size: 0.88rem;
}
.card-body h3 {
  margin: 0 0 0.7rem;
  color: var(--text);
  font-size: 1rem;
}

/* ─── GRID ───────────────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.1rem;
}

/* ─── ABOUT SECTION ──────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 0.7fr;
  gap: 2rem;
  align-items: start;
}
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}
.stat-box {
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 0.8rem 0.5rem;
  text-align: center;
  background: rgba(0, 255, 65, 0.03);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.stat-box:hover {
  border-color: var(--stroke-hot);
  box-shadow: var(--glow);
}
.stat-num {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  text-shadow: 0 0 12px rgba(0, 255, 65, 0.5);
  line-height: 1;
}
.stat-label {
  font-size: 0.65rem;
  color: var(--muted);
  display: block;
  margin-top: 0.3rem;
  letter-spacing: 0.08em;
}

/* ─── EDUCATION ──────────────────────────────────────────────── */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary), transparent);
}
.timeline-item { position: relative; margin-bottom: 1.5rem; }
.timeline-dot {
  position: absolute;
  left: -2.3rem;
  top: 1.2rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 12px var(--primary);
  border: 2px solid var(--bg);
}
.edu-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}
.edu-row h3 { margin: 0 0 0.3rem; color: var(--text); }
.accent { color: var(--primary); }
.muted-text { color: var(--muted); font-size: 0.82rem; margin: 0; }
.gpa-badge {
  text-align: center;
  border: 1px solid var(--stroke-hot);
  border-radius: 8px;
  padding: 0.5rem 0.9rem;
  background: rgba(0, 255, 65, 0.05);
  flex-shrink: 0;
}
.gpa-label { display: block; font-size: 0.65rem; color: var(--muted); }
.gpa-value { display: block; font-size: 1.5rem; font-weight: 700; color: var(--primary); text-shadow: 0 0 10px rgba(0, 255, 65, 0.5); }
.edu-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.8rem;
}
.tag-pill {
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  color: var(--secondary);
  background: rgba(0, 229, 255, 0.04);
}

/* ─── SKILLS ─────────────────────────────────────────────────── */
.skill-icon { margin-right: 0.4rem; }
.skill-list {
  list-style: none;
  margin: 0 0 0.8rem;
  padding: 0;
}
.skill-list li {
  padding: 0.25rem 0;
  font-size: 0.83rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.bullet { color: var(--primary); font-size: 0.6rem; }
.tech-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}
.tech {
  font-size: 0.65rem;
  padding: 0.15rem 0.55rem;
  border: 1px solid var(--stroke);
  border-radius: 4px;
  color: var(--primary);
  background: rgba(0, 255, 65, 0.04);
  letter-spacing: 0.04em;
}

/* ─── ANALYSIS / METERS ──────────────────────────────────────── */
.meter-wrap { margin: 0.5rem 0 0.9rem; }
.meter-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.meter-pct { color: var(--primary); font-weight: 600; }
.meter {
  height: 6px;
  border-radius: 999px;
  background: rgba(0, 255, 65, 0.1);
  overflow: hidden;
}
.meter span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--primary-dim), var(--primary));
  border-radius: 999px;
  box-shadow: 0 0 8px rgba(0, 255, 65, 0.5);
  transition: width 1.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── SERVICES ───────────────────────────────────────────────── */
.service-card .card-body { text-align: center; }
.service-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.service-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  margin-top: 0.8rem;
}
.service-stack span {
  font-size: 0.65rem;
  padding: 0.15rem 0.55rem;
  border: 1px solid var(--stroke);
  border-radius: 4px;
  color: var(--muted);
}

/* ─── PROJECTS ───────────────────────────────────────────────── */
.projects-label {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.7rem 0;
}
.project-tag {
  font-size: 0.65rem;
  padding: 0.15rem 0.55rem;
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 4px;
  color: var(--secondary);
  background: rgba(0, 229, 255, 0.04);
}
.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--primary);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  transition: gap 0.2s, color 0.2s;
  border-bottom: 1px solid var(--stroke);
  padding-bottom: 2px;
}
.project-link:hover {
  gap: 0.6rem;
  color: var(--text);
  border-color: var(--primary);
}

/* ─── CONTACT ────────────────────────────────────────────────── */
.contact-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 1.5rem;
}
.contact-ascii {
  font-size: 0.8rem;
  color: var(--primary);
  margin: 0 0 1rem;
  line-height: 1.5;
}
.contact-methods { display: flex; flex-direction: column; gap: 0.5rem; }
.contact-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.82rem;
  transition: all 0.2s;
  background: rgba(0, 255, 65, 0.02);
}
.contact-row:hover {
  border-color: var(--stroke-hot);
  color: var(--text);
  background: rgba(0, 255, 65, 0.06);
  transform: translateX(4px);
}
.contact-icon { font-size: 1rem; flex-shrink: 0; }
.contact-label { flex: 1; }
.contact-arrow { color: var(--primary); transition: transform 0.2s; }
.contact-row:hover .contact-arrow { transform: translateX(4px); }

/* ─── FOOTER ─────────────────────────────────────────────────── */
.footer {
  margin-top: 3rem;
  border-top: 1px solid var(--stroke);
  padding: 2rem 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}
.footer-inner { display: flex; flex-direction: column; gap: 0.4rem; align-items: center; }
.footer-logo { color: var(--primary); font-weight: 700; margin: 0; }
.footer-logo span { color: var(--muted); }
.footer p { margin: 0; }
.footer-hint { font-size: 0.7rem; color: rgba(74, 124, 74, 0.6); }
.footer-hint span { color: var(--primary); }

/* ─── REVEAL ANIMATIONS ──────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* ─── LIGHT MODE ─────────────────────────────────────────────── */
[data-theme="light"] {
  --bg:         #eef4ee;
  --bg-soft:    #e4ede4;
  --bg-card:    rgba(255, 255, 255, 0.97);
  --text:       #162916;
  --muted:      #4a7050;
  --primary:    #006824;
  --primary-dim:#004d1a;
  --secondary:  #005e99;
  --warn:       #a05500;
  --danger:     #bb1111;
  --stroke:     rgba(0, 104, 36, 0.18);
  --stroke-hot: rgba(0, 104, 36, 0.5);
  --glow:       0 0 18px rgba(0, 104, 36, 0.18);
  --glow-hot:   0 0 28px rgba(0, 104, 36, 0.3);
  --shadow:     0 12px 40px rgba(0, 0, 0, 0.12);
}
[data-theme="light"] #matrix-canvas       { opacity: 0.03; }
[data-theme="light"] body::after          { opacity: 0.3; }
[data-theme="light"] #boot-screen         { background: #eef4ee; }
[data-theme="light"] .ascii-logo          { color: var(--primary); }
[data-theme="light"] .terminal-head,
[data-theme="light"] .card-head           { background: rgba(230, 245, 230, 0.9); }
[data-theme="light"] .terminal-window,
[data-theme="light"] .terminal-card       { background: rgba(255, 255, 255, 0.97); }
[data-theme="light"] .nav-wrapper         { background: rgba(238, 244, 238, 0.95); }
[data-theme="light"] .profile-panel       { background: rgba(245, 252, 245, 0.97); }
[data-theme="light"] .profile-ring        { border-color: var(--stroke-hot); }

/* Smooth theme transitions */
body, .terminal-card, .terminal-window, .nav-wrapper, .btn,
.card-head, .terminal-head, .profile-panel, .stat-box,
.contact-row, footer, .boot-content, .tag, #scroll-progress {
  transition: background-color 0.35s ease, color 0.35s ease,
              border-color 0.35s ease, box-shadow 0.35s ease;
}

/* ─── THEME TOGGLE BUTTON ────────────────────────────────────── */
#theme-toggle {
  background: none;
  border: 1px solid var(--stroke);
  color: var(--primary);
  font-size: 1rem;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  flex-shrink: 0;
  order: -1;
}
#theme-toggle:hover {
  border-color: var(--stroke-hot);
  background: rgba(0, 255, 65, 0.08);
  transform: rotate(20deg) scale(1.1);
}
#theme-icon {
  display: inline-block;
  transition: transform 0.5s ease;
  line-height: 1;
}

/* ─── PIXEL ART RUNNER ───────────────────────────────────────── */
.pixel-runner {
  position: fixed;
  bottom: 36px;
  left: -40px;
  z-index: 49;
  pointer-events: auto;
  cursor: none;
  width: 18px;
  height: 30px;
  animation: pixelWalk 22s linear infinite;
}
.pixel-runner.turbo {
  animation-duration: 4s !important;
}
.pixel-runner:hover .px-label,
.pixel-runner.turbo .px-label { opacity: 1; }

.px-label {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Fira Code', monospace;
  font-size: 0.52rem;
  color: var(--primary);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s;
  text-shadow: 0 0 8px var(--primary);
  background: var(--bg);
  padding: 1px 4px;
  border-radius: 3px;
  border: 1px solid var(--stroke);
}

/* ─── PIXEL FRAMES ───────────────────────────────────────────── */
.px-base {
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 3px;
  background: transparent;
  image-rendering: pixelated;
}

/* Shared body pixels + frame 1 legs */
.px-f1 {
  box-shadow:
    /* HEAD */
    6px  0px 0 var(--primary), 9px  0px 0 var(--primary),
    3px  3px 0 var(--primary), 6px  3px 0 var(--primary), 9px  3px 0 var(--primary), 12px 3px 0 var(--primary),
    3px  6px 0 var(--primary), 12px 6px 0 var(--primary),
    3px  9px 0 var(--primary), 6px  9px 0 var(--primary), 9px  9px 0 var(--primary), 12px 9px 0 var(--primary),
    /* BODY */
    6px  12px 0 var(--primary), 9px 12px 0 var(--primary),
    3px  15px 0 var(--primary), 6px 15px 0 var(--primary), 9px 15px 0 var(--primary), 12px 15px 0 var(--primary),
    6px  18px 0 var(--primary), 9px 18px 0 var(--primary),
    6px  21px 0 var(--primary), 9px 21px 0 var(--primary),
    /* LEGS FRAME 1 (spread) */
    3px  24px 0 var(--primary), 12px 24px 0 var(--primary),
    0px  27px 0 var(--primary), 15px 27px 0 var(--primary);
  animation: pxF1 0.25s step-end infinite;
}

/* Shared body pixels + frame 2 legs */
.px-f2 {
  box-shadow:
    /* HEAD */
    6px  0px 0 var(--primary), 9px  0px 0 var(--primary),
    3px  3px 0 var(--primary), 6px  3px 0 var(--primary), 9px  3px 0 var(--primary), 12px 3px 0 var(--primary),
    3px  6px 0 var(--primary), 12px 6px 0 var(--primary),
    3px  9px 0 var(--primary), 6px  9px 0 var(--primary), 9px  9px 0 var(--primary), 12px 9px 0 var(--primary),
    /* BODY */
    6px  12px 0 var(--primary), 9px 12px 0 var(--primary),
    3px  15px 0 var(--primary), 6px 15px 0 var(--primary), 9px 15px 0 var(--primary), 12px 15px 0 var(--primary),
    6px  18px 0 var(--primary), 9px 18px 0 var(--primary),
    6px  21px 0 var(--primary), 9px 21px 0 var(--primary),
    /* LEGS FRAME 2 (together/stride) */
    6px  24px 0 var(--primary), 9px  24px 0 var(--primary),
    3px  27px 0 var(--primary), 12px 27px 0 var(--primary);
  animation: pxF2 0.25s step-end infinite;
}

@keyframes pxF1 {
  0%, 49%  { opacity: 1; }
  50%, 100%{ opacity: 0; }
}
@keyframes pxF2 {
  0%, 49%  { opacity: 0; }
  50%, 100%{ opacity: 1; }
}

/* Walking left to right, then flip and walk back */
@keyframes pixelWalk {
  0%   { left: -40px;              transform: scaleX(1);  }
  48%  { left: calc(100vw + 10px); transform: scaleX(1);  }
  50%  { left: calc(100vw + 10px); transform: scaleX(-1); }
  98%  { left: -40px;              transform: scaleX(-1); }
  100% { left: -40px;              transform: scaleX(1);  }
}

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 980px) {
  .hero              { grid-template-columns: 1fr; }
  .terminal-layout   { grid-template-columns: 1fr; }
  .about-grid        { grid-template-columns: 1fr; }
  .contact-inner     { grid-template-columns: 1fr; }
  .hamburger         { display: flex; }
  .terminal-shell    { max-height: 280px; }
  .profile-panel     { flex-direction: row; gap: 1rem; padding: 0.8rem; }
  .profile-ring      { width: 90px; flex-shrink: 0; }
  .profile-info      { text-align: left; }
  .profile-badges    { justify-content: flex-start; }
  .status-dot-wrap   { justify-content: flex-start; }
  .hero              { padding-top: 3rem; }
  .section           { padding: 3.5rem 0 1.5rem; }
  .nav               { position: relative; flex-wrap: wrap; }
  .nav ul            {
    display: none;
    position: absolute;
    top: calc(100% + 1px);
    left: 0; right: 0;
    background: rgba(0, 0, 0, 0.97);
    border-top: 1px solid var(--stroke);
    border-bottom: 1px solid var(--stroke);
    flex-direction: column;
    align-items: flex-start;
    padding: 0.5rem 1rem;
    gap: 0;
    z-index: 90;
  }
  [data-theme="light"] .nav ul { background: rgba(238, 244, 238, 0.98); }
  .nav ul.open       { display: flex; }
  .nav ul li         { width: 100%; }
  .nav ul a          { padding: 0.6rem 0; display: block; border-bottom: 1px solid var(--stroke); }
  .pixel-runner      { bottom: 18px; }
}

@media (max-width: 640px) {
  .stats-grid        { grid-template-columns: 1fr 1fr; }
  .ascii-logo        { font-size: 0.28rem; }
  .contact-ascii     { display: none; }
  .hero-actions      { flex-direction: column; }
  .contact-btns      { flex-direction: column; }
  h1                 { font-size: 1.65rem; }
  .section-title     { font-size: 1.6rem; }
  .grid              { grid-template-columns: 1fr; }
  .terminal-shell    { max-height: 220px; font-size: 0.75rem; }
  #terminal-input    { font-size: 0.75rem; }
  .boot-content      { padding: 0 1rem; }
  .ascii-logo        { font-size: 0.22rem; }
  .quick-links       { gap: 0.8rem; }
  .pixel-runner      { display: none; } /* hide on very small screens */
  .section           { padding: 2.5rem 0 1rem; }
  .edu-row           { flex-direction: column; gap: 0.8rem; }
  .contact-inner     { gap: 1rem; }
}

