:root {
  --bg: #07070b;
  --bg-panel: rgba(13, 13, 20, 0.75);
  --bg-card: rgba(18, 18, 28, 0.65);
  --fg: #f1f0f7;
  --muted: #8e88a3;
  --subtle: #4d4763;
  --purple: #9d65ff;
  --purple-glow: rgba(157, 101, 255, 0.35);
  --lime: #52ff94;
  --lime-glow: rgba(82, 255, 148, 0.35);
  --cyan: #38efef;
  --cyan-glow: rgba(56, 239, 239, 0.3);
  --line: rgba(255, 255, 255, 0.08);
  --line-bright: rgba(82, 255, 148, 0.25);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

.mono { font-family: "JetBrains Mono", monospace; }
a { color: var(--lime); text-decoration: none; transition: all 0.2s; }
a:hover { color: #fff; text-shadow: 0 0 8px var(--lime); }

/* --- Cyber Grid & Mycelium Engine --- */
#mycelium {
  position: fixed; inset: 0; z-index: -2; opacity: 0.65; pointer-events: none;
}

.cyber-grid {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 30%, black 40%, transparent 85%);
}

.cursor-glow {
  position: fixed; width: 450px; height: 450px;
  border-radius: 50%; pointer-events: none; z-index: -1;
  background: radial-gradient(circle, rgba(157, 101, 255, 0.07), rgba(82, 255, 148, 0.03) 40%, transparent 70%);
  transform: translate(-50%, -50%);
  transition: opacity 0.3s;
}

/* --- HUD Top Telemetry Bar --- */
.hud-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.45rem 6vw; font-size: 0.72rem; letter-spacing: 0.05em;
  background: rgba(7, 7, 11, 0.9);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
.hud-item { display: flex; align-items: center; gap: 0.5rem; }
.hud-tag {
  background: rgba(255, 255, 255, 0.05); padding: 0.15rem 0.4rem;
  border-radius: 4px; color: var(--cyan); border: 1px solid rgba(56, 239, 239, 0.2);
}
.hud-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--subtle);
}
.hud-dot.live {
  background: var(--lime); box-shadow: 0 0 10px var(--lime);
  animation: blinkLive 2s infinite ease-in-out;
}
@keyframes blinkLive { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.hud-link { color: var(--muted); font-size: 0.7rem; }
.hud-link:hover { color: var(--lime); }

/* --- Sticky Nav --- */
.nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.9rem 6vw;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  background: rgba(7, 7, 11, 0.7);
  border-bottom: 1px solid var(--line);
}
.logo {
  font-weight: 700; font-size: 1.25rem; color: #fff; letter-spacing: 0.05em;
}
.logo .pulse { color: var(--lime); animation: blink 1.2s infinite; }
.nav nav { display: flex; gap: 1.5rem; }
.nav nav a {
  color: var(--muted); font-size: 0.82rem; letter-spacing: 0.03em;
  position: relative;
}
.nav nav a:hover { color: var(--lime); }
.nav nav a:hover::after {
  content: ""; position: absolute; bottom: -4px; left: 0; width: 100%; height: 2px;
  background: var(--lime); box-shadow: 0 0 8px var(--lime);
}

/* --- Layout --- */
main { max-width: 1140px; margin: 0 auto; padding: 0 6vw; }
section { padding: 6.5rem 0 3rem; }
.section-panel { position: relative; }
.section-tag {
  color: var(--cyan); font-size: 0.72rem; letter-spacing: 0.12em;
  margin-bottom: 0.75rem; display: inline-block;
}

h2 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700; letter-spacing: -0.03em; margin-bottom: 2rem;
  color: #fff;
}
.glitch-title {
  position: relative; display: inline-block;
}
.num {
  font-family: "JetBrains Mono", monospace; color: var(--lime);
  font-size: 0.9rem; margin-right: 0.5rem;
}

/* --- Hero Section --- */
.hero { min-height: 90vh; display: flex; flex-direction: column; justify-content: center; }
.hero-header { display: flex; align-items: center; gap: 1.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }

.avatar-wrap { position: relative; width: 110px; height: 110px; }
.avatar-ring {
  position: absolute; inset: -4px; border-radius: 50%;
  background: conic-gradient(var(--purple), var(--cyan), var(--lime), var(--purple));
  animation: spinRing 8s linear infinite; filter: blur(0.5px);
}
.avatar-scanner {
  position: absolute; inset: -10px; border-radius: 50%;
  border: 1px dashed rgba(82, 255, 148, 0.3);
  animation: spinRing 20s linear infinite reverse;
}
.avatar {
  position: relative; width: 100%; height: 100%; border-radius: 50%;
  overflow: hidden; background: #000; border: 3px solid var(--bg);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-status {
  position: absolute; bottom: 4px; right: 4px; width: 15px; height: 15px;
  border-radius: 50%; background: var(--lime); border: 2.5px solid var(--bg);
  box-shadow: 0 0 10px var(--lime);
}
@keyframes spinRing { to { transform: rotate(360deg); } }

.hero-badge {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.4rem 0.9rem; font-size: 0.75rem; letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line);
  border-radius: 999px; color: var(--lime);
}
.hero-badge .indicator {
  width: 6px; height: 6px; border-radius: 50%; background: var(--lime);
  box-shadow: 0 0 8px var(--lime);
}

h1 {
  font-size: clamp(3.2rem, 8vw, 6.2rem); font-weight: 800; line-height: 0.98;
  letter-spacing: -0.04em; color: #fff; margin-bottom: 1.25rem;
}
.grad {
  background: linear-gradient(135deg, #fff 20%, var(--purple) 65%, var(--lime) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  display: inline-block;
}

.typed {
  font-size: 1.15rem; color: var(--cyan); margin-bottom: 1.5rem; min-height: 1.8em;
}
.prompt { color: var(--lime); margin-right: 0.5rem; font-weight: 700; }
.caret { animation: blink 1s steps(1) infinite; color: var(--lime); margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }

.lead {
  max-width: 680px; font-size: 1.15rem; color: var(--muted);
  line-height: 1.7; font-weight: 400;
}
.lead b { color: var(--fg); font-weight: 600; }

.cta { display: flex; gap: 1rem; margin: 2.2rem 0; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.75rem 1.4rem; border-radius: 8px; font-weight: 600; font-size: 0.88rem;
  letter-spacing: 0.03em; font-family: "JetBrains Mono", monospace;
  position: relative; overflow: hidden; transition: all 0.25s; cursor: pointer;
}
.btn.primary {
  background: var(--lime); color: #050508; border: 1px solid var(--lime);
  box-shadow: 0 0 20px rgba(82, 255, 148, 0.25);
}
.btn.primary:hover {
  background: #fff; border-color: #fff; box-shadow: 0 0 25px rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
}
.btn.secondary {
  background: rgba(255, 255, 255, 0.03); color: var(--fg);
  border: 1px solid var(--line); backdrop-filter: blur(8px);
}
.btn.secondary:hover {
  border-color: var(--cyan); color: #fff; box-shadow: 0 0 15px rgba(56, 239, 239, 0.25);
  transform: translateY(-2px);
}

/* --- Stats Matrix --- */
.stats-matrix {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem; margin: 1.5rem 0 2.5rem;
}
.stat-card {
  background: var(--bg-card); border: 1px solid var(--line);
  padding: 1.4rem 1.5rem; border-radius: 12px;
  position: relative; overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.stat-card:hover {
  border-color: var(--line-bright);
  transform: translateY(-3px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4), 0 0 15px rgba(82, 255, 148, 0.1);
}
.stat-card::before {
  content: ""; position: absolute; top: 0; left: 0; width: 32px; height: 2px;
  background: var(--lime); box-shadow: 0 0 10px var(--lime);
}
.stat-shimmer {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.03) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: cardShimmer 6s infinite;
}
@keyframes cardShimmer {
  0%, 75% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.stat-num {
  font-size: 2.6rem; font-weight: 700; color: #fff; line-height: 1; margin-bottom: 0.4rem;
}
.stat-num .plus { color: var(--lime); font-size: 1.8rem; margin-left: 2px; }
.stat-label { font-size: 0.85rem; color: var(--fg); font-weight: 500; }
.stat-foot { font-size: 0.72rem; color: var(--muted); margin-top: 0.35rem; }

.tech-telemetry .telemetry-bar {
  display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.6rem;
}
.telemetry-label {
  font-size: 0.75rem; color: var(--lime); font-weight: 700; letter-spacing: 0.06em;
}

/* --- Interactive Embedded Terminal --- */
.terminal-box {
  background: #09090f; border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden; margin-top: 1rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}
.terminal-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.65rem 1rem; background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--line);
}
.terminal-dots { display: flex; gap: 0.4rem; }
.terminal-dots .dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }
.terminal-title { font-size: 0.74rem; color: var(--muted); }
.terminal-actions button {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-family: inherit; font-size: 0.72rem;
}
.terminal-actions button:hover { color: var(--lime); }
.terminal-body {
  padding: 1.2rem; min-height: 120px; max-height: 220px; overflow-y: auto;
  font-size: 0.84rem; line-height: 1.6; color: #cfcbe2;
}
.term-line { margin-bottom: 0.4rem; }
.term-line.cmd { color: var(--lime); }
.term-line.cmd::before { content: "> "; color: var(--cyan); }
.term-line.welcome { color: var(--muted); }
.term-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.8rem; }
.term-pills button {
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line);
  padding: 0.25rem 0.65rem; border-radius: 6px; color: var(--cyan);
  font-family: inherit; font-size: 0.75rem; cursor: pointer; transition: all 0.2s;
}
.term-pills button:hover {
  background: rgba(56, 239, 239, 0.12); border-color: var(--cyan); color: #fff;
}
.terminal-input-row {
  display: flex; align-items: center; padding: 0.6rem 1rem;
  background: rgba(0, 0, 0, 0.35); border-top: 1px solid var(--line);
}
.term-prompt { color: var(--lime); font-size: 0.82rem; margin-right: 0.6rem; }
.terminal-input-row input {
  flex: 1; background: transparent; border: none; outline: none;
  color: #fff; font-family: inherit; font-size: 0.84rem;
}

/* --- Section 01: About & Interactive Soundwave --- */
.about-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2.5rem; }
.about-text p { color: var(--muted); font-size: 1.05rem; margin-bottom: 1.2rem; }
.about-text b { color: #fff; font-weight: 600; }

.tech-spec-card {
  background: var(--bg-card); border: 1px solid var(--line);
  padding: 1.5rem; border-radius: 12px; font-size: 0.8rem;
  position: relative;
}
.tech-spec-card::after {
  content: "[SYS_CONFIG]"; position: absolute; top: 1rem; right: 1rem;
  color: var(--subtle); font-size: 0.68rem;
}
.spec-head { color: var(--lime); font-weight: 700; margin-bottom: 1rem; font-size: 0.85rem; }
.spec-list { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; }
.spec-list .k { color: var(--cyan); font-weight: 600; display: inline-block; width: 100px; }
.spec-list .v { color: #ddd; }

/* Interactive Waveform Visualizer */
.wave-visualizer-box {
  background: #090912; border: 1px solid var(--line);
  border-radius: 12px; padding: 1rem 1.4rem; margin-top: 2rem;
  position: relative; overflow: hidden;
}
.visualizer-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.6rem; font-size: 0.72rem;
}
.wave-mode { color: var(--muted); }
#waveCanvas {
  width: 100%; height: 80px; display: block; border-radius: 6px;
  background: rgba(0, 0, 0, 0.4);
}

.chips-container { margin-top: 2rem; }
.chip-title { color: var(--muted); font-size: 0.75rem; display: block; margin-bottom: 0.75rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chips span {
  font-family: "JetBrains Mono", monospace; font-size: 0.78rem;
  padding: 0.35rem 0.85rem; border: 1px solid var(--line);
  border-radius: 6px; color: #ddd; background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s;
}
.chips span:hover {
  border-color: var(--lime); color: var(--lime); background: rgba(82, 255, 148, 0.05);
}

/* --- Section 02: Experience Timeline --- */
.timeline { list-style: none; border-left: 2px solid var(--line); padding-left: 2rem; }
.timeline-item { position: relative; margin-bottom: 2.75rem; }
.timeline-item::before {
  content: ""; position: absolute; left: -2.45rem; top: 0.4rem;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--line); transition: all 0.3s;
}
.timeline-item.active-role::before {
  border-color: var(--lime); background: var(--lime); box-shadow: 0 0 12px var(--lime);
}
.timeline-item:hover::before { border-color: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.timeline .when { color: var(--lime); font-size: 0.75rem; letter-spacing: 0.05em; display: block; }
.role-header { margin: 0.2rem 0 0.5rem; }
.role-header h3 { font-size: 1.25rem; font-weight: 600; color: #fff; }
.role-header .org { color: var(--purple); font-size: 0.88rem; display: block; margin-top: 0.15rem; }
.timeline-item p { color: var(--muted); font-size: 0.95rem; }

/* --- Section 03: Projects with 3D Tilt & Specular Sheen --- */
.projects-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem;
}
.projects-head h2 { margin-bottom: 0; }
.filter-bar { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.filter-btn {
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line);
  color: var(--muted); padding: 0.4rem 0.85rem; border-radius: 6px;
  font-family: inherit; font-size: 0.75rem; cursor: pointer; transition: all 0.2s;
}
.filter-btn:hover, .filter-btn.active {
  background: rgba(82, 255, 148, 0.1); border-color: var(--lime); color: #fff;
  box-shadow: 0 0 12px rgba(82, 255, 148, 0.2);
}

.cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.4rem; perspective: 1200px;
}
.card {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden; display: flex; flex-direction: column;
  position: relative; transition: border-color 0.3s, box-shadow 0.3s, transform 0.15s ease-out;
  transform-style: preserve-3d;
}
.card.hide { display: none; }
.card:hover {
  border-color: var(--line-bright);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.55), 0 0 25px rgba(82, 255, 148, 0.15);
}

.card-glass-sheen {
  position: absolute; inset: 0; pointer-events: none; z-index: 10; opacity: 0;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.12), transparent 60%);
  transition: opacity 0.3s;
}
.card:hover .card-glass-sheen { opacity: 1; }

.thumb {
  position: relative; height: 190px; overflow: hidden; background: #0c0c14;
  border-bottom: 1px solid var(--line);
}
.thumb img:first-child {
  width: 100%; height: 100%; object-fit: cover; object-position: top;
  opacity: 0.85; transition: transform 0.5s ease;
}
.card:hover .thumb img:first-child { transform: scale(1.06); opacity: 1; }
.thumb .icon {
  position: absolute; left: 1rem; bottom: 0.8rem; width: 54px; height: 54px;
  border-radius: 12px; object-fit: cover; box-shadow: 0 6px 20px rgba(0,0,0,0.6);
  border: 2px solid rgba(255, 255, 255, 0.2);
}
.thumb-tag {
  position: absolute; top: 0.8rem; right: 0.8rem;
  background: rgba(0, 0, 0, 0.75); border: 1px solid var(--line);
  padding: 0.2rem 0.55rem; border-radius: 4px; font-size: 0.68rem;
  color: var(--cyan); letter-spacing: 0.05em; backdrop-filter: blur(6px);
}

.card-content { padding: 1.5rem; display: flex; flex-direction: column; flex: 1; }
.badge-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.72rem; margin-bottom: 0.6rem;
}
.badge.live { color: var(--lime); font-weight: 600; }
.badge.old { color: var(--muted); }
.card-id { color: var(--subtle); }
.card h3 { font-size: 1.25rem; font-weight: 700; color: #fff; margin-bottom: 0.5rem; }
.card p { color: var(--muted); font-size: 0.92rem; flex: 1; margin-bottom: 1.25rem; }
.card-links { font-size: 0.78rem; display: flex; gap: 0.6rem; align-items: center; }
.card-links .sep { color: var(--subtle); }
.card-links a { color: var(--cyan); }
.card-links a:hover { color: #fff; text-shadow: 0 0 8px var(--cyan); }

/* --- Section 04: Contact Matrix --- */
.contact { text-align: center; }
.contact .lead { margin: 0 auto 3rem; }
.cta-matrix {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem; max-width: 900px; margin: 0 auto;
}
.contact-pill {
  background: var(--bg-card); border: 1px solid var(--line);
  padding: 1.2rem 1.4rem; border-radius: 12px; display: flex;
  align-items: center; gap: 1rem; text-align: left;
  transition: all 0.3s;
}
.contact-pill:hover {
  border-color: var(--lime); transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(82, 255, 148, 0.15);
}
.contact-pill.primary {
  border-color: rgba(82, 255, 148, 0.4); background: rgba(82, 255, 148, 0.04);
}
.pill-icon {
  width: 44px; height: 44px; border-radius: 10px; background: rgba(255, 255, 255, 0.05);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: var(--lime); border: 1px solid var(--line);
}
.pill-body { display: flex; flex-direction: column; }
.pill-body .label { font-size: 0.68rem; color: var(--muted); letter-spacing: 0.06em; }
.pill-body .val { font-size: 0.94rem; color: #fff; font-weight: 600; }

/* --- Footer --- */
footer {
  border-top: 1px solid var(--line); padding: 2rem 6vw;
  background: #050508; color: var(--muted); font-size: 0.78rem;
}
.footer-wrap {
  max-width: 1140px; margin: 0 auto; display: flex;
  justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
}
.footer-pulse { display: flex; align-items: center; gap: 0.5rem; color: var(--subtle); }

/* --- Reveal Animation --- */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal.in { opacity: 1; transform: none; }

/* --- Responsive --- */
@media (max-width: 820px) {
  .nav nav { display: none; }
  .about-grid { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .stats-matrix { grid-template-columns: 1fr; }
}
