﻿/* ===== VARIABLES ===== */
:root {
  --bg: #0d1117;
  --panel: #161b22;
  --panel-hover: #1c2129;
  --border: #30363d;
  --border-muted: #21262d;
  --text: #c9d1d9;
  --text-muted: #8b949e;
  --text-subtle: #484f58;
  --accent: #58a6ff;
  --green: #3fb950;
  --purple: #bc8cff;
  --red: #f85149;
  --yellow: #e3b341;
  --orange: #d29922;
  --shadow: rgba(0,0,0,.4);
  --radius: 10px;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
  --sans: 'Geist', 'Inter', system-ui, sans-serif;
}

[data-theme="light"] {
  --bg: #ffffff;
  --panel: #f6f8fa;
  --panel-hover: #eef1f5;
  --border: #d0d7de;
  --border-muted: #e4e9ef;
  --text: #1f2328;
  --text-muted: #636c76;
  --text-subtle: #9ba4af;
  --accent: #0969da;
  --green: #1a7f37;
  --purple: #8250df;
  --shadow: rgba(140,149,159,.15);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background .3s, color .3s;
}

/* ===== CANVAS ===== */
#bg-canvas {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0; opacity: .35;
}

/* ===== LAYOUT ===== */
.site-wrapper {
  position: relative; z-index: 1;
  max-width: 1400px; margin: 0 auto; padding: 0 24px;
}

/* ===== NAVBAR ===== */
.navbar {
  position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
}
.navbar-inner {
  max-width: 1400px; margin: 0 auto;
  padding: 0 24px; height: 56px;
  display: flex; align-items: center; gap: 32px;
}
.nav-logo {
  font-family: var(--mono); font-weight: 700; font-size: 15px;
  color: var(--text); text-decoration: none;
  display: flex; align-items: center; gap: 8px; margin-right: auto;
}
.logo-icon {
  width: 28px; height: 28px;
  background: var(--accent); border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: #fff; font-weight: 900;
}
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; }
.nav-links a,
.nav-links button {
  font-size: 14px; font-weight: 500; color: var(--text-muted);
  text-decoration: none; padding: 6px 12px; border-radius: 6px;
  position: relative; transition: color .2s; cursor: pointer;
  border: none; background: none; font-family: inherit;
}
.nav-links a::after,
.nav-links button::after {
  content: ''; position: absolute; bottom: -1px; left: 12px; right: 12px;
  height: 2px; background: var(--accent); border-radius: 2px;
  transform: scaleX(0); transition: transform .2s ease;
}
.nav-links a:hover,
.nav-links button:hover { color: var(--text); }
.nav-links a:hover::after,
.nav-links button:hover::after { transform: scaleX(1); }
.nav-links a.active,
.nav-links button.active { color: var(--text); }
.nav-links a.active::after,
.nav-links button.active::after { transform: scaleX(1); }
.nav-links a:focus-visible,
.nav-links button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.navbar-controls { display: flex; align-items: center; gap: 6px; }
.ctrl-btn {
  height: 34px; min-width: 34px; padding: 0 10px;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text-muted);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .2s; font-size: 13px; font-weight: 600;
  font-family: var(--mono);
}
.ctrl-btn:hover { background: var(--panel-hover); color: var(--text); border-color: var(--accent); }
.ctrl-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ===== SECTIONS ===== */
.section { display: none; padding: 40px 0 80px; animation: fadeSlide .35s ease forwards; }
.section.active { display: block; }
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== OVERVIEW ===== */
.overview-grid { display: grid; grid-template-columns: 280px 1fr; gap: 24px; align-items: start; }

.profile-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  position: sticky; top: 76px;
}
.avatar-wrapper {
  position: relative; width: 100%; aspect-ratio: 1;
  max-width: 220px; margin: 0 auto 16px;
}
.avatar {
  width: 100%; aspect-ratio: 1; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 64px; font-weight: 900; color: #fff;
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent);
  transition: box-shadow .3s; user-select: none;
}
.avatar:hover { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 25%, transparent); }
.avatar-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.avatar.has-image #avatar-initials {
  opacity: 0;
}
.avatar-status-bubble {
  position: absolute; bottom: 10px; right: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--border));
  background: color-mix(in srgb, var(--panel) 88%, var(--accent));
  color: #fff;
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
  box-shadow: 0 6px 18px var(--shadow);
}
.avatar-status-bubble:hover {
  filter: brightness(1.08);
}
.avatar-status-bubble:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.avatar-status-bubble svg { flex-shrink: 0; }
  50%     { box-shadow: 0 0 0 6px transparent; }
}
.profile-name     { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.profile-username { font-family: var(--mono); font-size: 14px; color: var(--text-muted); margin-bottom: 12px; }
.profile-bio      { font-size: 13px; line-height: 1.6; color: var(--text-muted); margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border-muted); }
.profile-meta     { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.meta-item        { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.meta-item svg    { width: 14px; height: 14px; flex-shrink: 0; stroke: currentColor; }
.github-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 8px;
  background: var(--panel-hover); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text);
  font-size: 13px; font-weight: 500; text-decoration: none;
  transition: all .2s; margin-bottom: 16px; cursor: pointer;
}
.github-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.github-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skills-list { display: flex; flex-wrap: wrap; gap: 6px; }
.skill-tag {
  font-family: var(--mono); font-size: 11px; padding: 3px 8px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid var(--border); border-radius: 20px;
  color: var(--accent); cursor: default; transition: all .15s;
}
.skill-tag:hover { border-color: var(--accent); }

/* ===== README ===== */
.readme-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.readme-header { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; background: var(--panel-hover); }
.readme-header-title { font-family: var(--mono); font-size: 12px; color: var(--text-muted); }
.readme-header-title span { color: var(--accent); }
.readme-body { padding: 24px; }
.readme-section { margin-bottom: 32px; }
.readme-section:last-child { margin-bottom: 0; }
.readme-section-title { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.readme-about p { font-size: 14px; line-height: 1.8; color: var(--text-muted); margin-bottom: 10px; }
.stack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px,1fr)); gap: 8px; }
.stack-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; font-family: var(--mono); font-size: 12px; color: var(--text-muted); transition: all .2s; }
.stack-item:hover { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, var(--bg)); }
.stack-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.contact-links { display: flex; flex-direction: column; gap: 8px; }
.contact-link { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; text-decoration: none; transition: all .2s; color: var(--text); }
.contact-link:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, var(--bg)); transform: translateX(4px); }
.contact-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.contact-link-icon { font-size: 18px; width: 24px; text-align: center; }
.contact-link-info { flex: 1; }
.contact-link-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.contact-link-value { font-size: 13px; font-family: var(--mono); color: var(--accent); }
.contact-link-arrow { color: var(--text-subtle); font-size: 12px; }

/* ===== SECTION HEADINGS ===== */
.section-heading { font-size: 24px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.section-sub     { font-size: 14px; color: var(--text-muted); margin-bottom: 28px; }

/* ===== PROJECTS ===== */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px,1fr)); gap: 16px; }

.projects-toolbar {
  display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 24px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.filter-row { display: flex; align-items: center; gap: 10px; min-height: 28px; }
.filter-row-label {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .6px;
  color: var(--text-subtle); width: 90px; flex-shrink: 0;
}
.filter-row .project-filters { display: flex; flex-wrap: wrap; gap: 5px; flex: 1; }
.filter-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--panel-hover);
  color: var(--text-muted); font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all .18s; white-space: nowrap;
  font-family: var(--sans);
}
.filter-btn:hover { border-color: var(--accent); color: var(--text); }
 .filter-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.filter-btn.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--panel));
  color: var(--accent); font-weight: 600;
}
.filter-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.no-results { grid-column: 1/-1; text-align: center; color: var(--text-muted); font-size: 14px; padding: 48px; font-family: var(--mono); }

/* ===== PROJECT CARD ===== */
.project-card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  transition: border-color .2s, transform .2s, box-shadow .2s, background .2s;
  position: relative; overflow: hidden;
}
.project-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--purple));
  transform: scaleX(0); transition: transform .3s ease; transform-origin: left;
}
.project-card:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  transform: translateY(-2px); box-shadow: 0 8px 24px var(--shadow);
  background: var(--panel-hover);
}
.project-card:hover::before { transform: scaleX(1); }
.project-header { display: flex; align-items: center; gap: 7px; }
.project-type-icon { flex-shrink: 0; display: flex; align-items: center; opacity: .85; }
.project-name { font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--text); }
.proj-date { font-family: var(--mono); font-size: 11px; color: var(--text-subtle); margin-left: auto; }
.project-status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sc,#8b949e); flex-shrink: 0; }
.project-status-dot.status-pulse { animation: status-pulse 2.5s infinite; }
@keyframes status-pulse {
  0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--sc) 40%, transparent); }
  50%     { box-shadow: 0 0 0 5px transparent; }
}
.project-desc { font-size: 13px; line-height: 1.65; color: var(--text-muted); flex: 1; }
.proj-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.proj-tag {
  font-family: var(--mono); font-size: 10px; padding: 2px 8px; border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--tag-color,#8b949e) 30%, transparent);
  color: var(--tag-color,#8b949e);
  background: color-mix(in srgb, var(--tag-color,#8b949e) 8%, transparent);
}
.project-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border-muted); margin-top: auto; }
.proj-type-label { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; opacity: .75; }
.proj-links { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.proj-link {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 9px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--bg);
  color: var(--text-muted); text-decoration: none;
  font-size: 11px; font-weight: 500;
  transition: all .15s; white-space: nowrap; font-family: var(--sans);
}
.proj-link:hover           { color: var(--text);   border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--bg)); }
.proj-link--live:hover     { color: var(--green);  border-color: var(--green);  background: color-mix(in srgb, var(--green)  8%, var(--bg)); }
.proj-link--npm:hover,
.proj-link--pypi:hover     { color: #cb3837;       border-color: #cb3837;       background: color-mix(in srgb, #cb3837 8%, var(--bg)); }
.proj-link--docs:hover     { color: var(--purple); border-color: var(--purple); background: color-mix(in srgb, var(--purple) 8%, var(--bg)); }

/* ===== TERMINAL ===== */
.terminal-container { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; max-width: 800px; }
.terminal-titlebar { background: var(--panel-hover); padding: 10px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.term-buttons { display: flex; gap: 6px; }
.term-btn { width: 12px; height: 12px; border-radius: 50%; }
.term-btn.red    { background: #ff5f57; }
.term-btn.yellow { background: #febc2e; }
.term-btn.green  { background: #28c840; }
.term-title { font-family: var(--mono); font-size: 12px; color: var(--text-muted); margin-left: 8px; }
.terminal-body { padding: 20px; height: 420px; overflow-y: auto; font-family: var(--mono); font-size: 13px; line-height: 1.7; scroll-behavior: smooth; }
.term-line { margin-bottom: 4px; animation: termFade .15s ease forwards; }
@keyframes termFade { from { opacity: 0; } to { opacity: 1; } }
.term-output       { color: var(--text-muted); }
.term-output .hi   { color: var(--accent); }
.term-output .ok   { color: var(--green); }
.term-output .warn { color: var(--yellow); }
.term-output .err  { color: var(--red); }
.term-output .key  { color: var(--text); font-weight: 600; }
.term-empty { height: 8px; }
.terminal-input-row { display: flex; align-items: center; padding: 10px 20px; border-top: 1px solid var(--border-muted); gap: 8px; }
.term-input-prompt { font-family: var(--mono); font-size: 13px; color: var(--green); white-space: nowrap; flex-shrink: 0; }
.term-input-prompt .host { color: var(--accent); }
.term-input-prompt .path { color: var(--purple); }
#term-input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-family: var(--mono); font-size: 13px; caret-color: var(--accent); }
.term-hint { font-family: var(--mono); font-size: 11px; color: var(--text-subtle); margin-top: 8px; padding-left: 4px; }


body.terminal-open {
  overflow: hidden;
}

.terminal-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
}
.terminal-modal[hidden] {
  display: none;
}
.terminal-modal-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(0, 0, 0, .6);
  cursor: pointer;
}
.terminal-modal-panel {
  position: relative;
  width: min(920px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: color-mix(in srgb, var(--bg) 96%, transparent);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 20px 56px var(--shadow);
  padding: 20px;
}
.terminal-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.terminal-modal-header .section-heading {
  margin-bottom: 0;
}
.terminal-close-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.terminal-close-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}
.terminal-close-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.terminal-modal .terminal-container {
  max-width: none;
}
.terminal-modal .terminal-body {
  height: min(52vh, 460px);
}
/* ===== FOOTER ===== */
/* (Footer removed in favor of floating copyright) */

/* ===== FLOATING COPYRIGHT ===== */
.floating-copy {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 50;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .3px;
  color: var(--text-subtle);
  opacity: .55;
  pointer-events: none;
  user-select: none;
  text-align: center;
  padding: 2px 10px;
  max-width: calc(100vw - 24px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== LOADING ===== */
.loading { display: flex; align-items: center; justify-content: center; height: 200px; gap: 8px; }
.loading-dot { width: 6px; height: 6px; background: var(--accent); border-radius: 50%; animation: bounce 1.2s infinite; }
.loading-dot:nth-child(2) { animation-delay: .2s; }
.loading-dot:nth-child(3) { animation-delay: .4s; }
@keyframes bounce { 0%,100% { transform: translateY(0); opacity: .4; } 50% { transform: translateY(-8px); opacity: 1; } }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .overview-grid { grid-template-columns: 1fr; }
  .profile-card { position: static; }
  .avatar-wrapper { max-width: 120px; }
  .avatar { font-size: 40px; }
}
@media (max-width: 600px) {
  .navbar-inner { padding: 0 16px; gap: 16px; }
  .site-wrapper { padding: 0 16px; }
  .projects-grid { grid-template-columns: 1fr; }
  .stack-grid { grid-template-columns: 1fr 1fr; }
  .filter-row { flex-direction: column; align-items: flex-start; }
  .filter-row-label { width: auto; }
  .nav-links a { padding: 6px 8px; font-size: 13px; }
}


.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.terminal-open-btn svg {
  display: block;
}






