:root {
  --bg: #0d1117;
  --bg-window: #161b22;
  --border: #30363d;
  --text: #c9d1d9;
  --text-dim: #8b949e;
  --accent: #58a6ff;
  --accent-glow: rgba(88, 166, 255, 0.3);
  --success: #3fb950;
  --warning: #d29922;
  --error: #f85149;
  --folder: #f0883e;
  --mono: 'JetBrains Mono', monospace;
  --sans: 'Inter', -apple-system, sans-serif;
}

* { margin:0; padding:0; box-sizing:border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* CRT & scanlines */
.scanlines {
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.1) 2px,
    rgba(0,0,0,0.1) 4px
  );
  pointer-events: none;
  z-index: 999;
}
.crt-overlay {
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at center, transparent 0%, rgba(0,0,0,0.3) 100%);
  pointer-events: none;
  z-index: 998;
}

/* Desktop layout */
.desktop {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Top bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: var(--bg-window);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}
.window-controls { display: flex; gap: 6px; }
.control {
  width: 12px; height: 12px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 8px; cursor: pointer;
  transition: transform 0.1s;
}
.control:hover { transform: scale(1.1); }
.close { background: #ff5f56; }
.min { background: #ffbd2e; }
.max { background: #27ca40; }
.breadcrumbs { display: flex; gap: 0.5rem; align-items: center; }
.separator { opacity: 0.5; }
.current { color: var(--text); font-weight: 700; }
.status-right { display: flex; gap: 0.75rem; align-items: center; }
.indicator {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-dim);
}
.indicator.online { background: var(--success); box-shadow: 0 0 8px var(--success); }

/* Generic window frame */
.window {
  background: var(--bg-window);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}
.title-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-dim);
}
.content { padding: 1.5rem; }
.status-bar {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: rgba(255,255,255,0.02);
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Hero */
.hero-window { border-color: var(--accent); }
.hero-content {
  text-align: center;
  padding: 2rem 1.5rem;
}
.glitch-container {
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
}
.logo-svg {
  width: 100%;
  max-width: 500px;
  height: auto;
  filter: drop-shadow(0 0 12px rgba(0, 240, 255, 0.3));
  transition: filter 0.3s, transform 0.3s;
}
.logo-svg:hover {
  filter: drop-shadow(0 0 20px rgba(0, 240, 255, 0.5));
  transform: scale(1.02);
}

/* Replaced logo: image-based, lightweight */
.logo-frame {
  position: relative;
  display: inline-block;
  width: 160px;
  height: 160px;
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(100, 116, 139, 0.2));
  transition: filter 0.4s ease, transform 0.4s ease;
  position: relative;
  z-index: 2;
}
.logo-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(100, 116, 139, 0.15) 0%, transparent 70%);
  z-index: 1;
  transition: opacity 0.4s ease;
  opacity: 0.8;
}
.logo-frame:hover .logo-img {
  filter: drop-shadow(0 0 16px rgba(100, 116, 139, 0.4));
  transform: rotate(3deg) scale(1.05);
}
.logo-frame:hover .logo-glow {
  opacity: 1;
  background: radial-gradient(circle at center, rgba(100, 116, 139, 0.25) 0%, transparent 70%);
}
.glitch {
  font-family: var(--mono);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  position: relative;
  display: inline-block;
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  background: var(--bg-window);
}
.glitch::before {
  left: 2px;
  text-shadow: -2px 0 var(--error);
  clip: rect(24px, 550px, 90px, 0);
  animation: glitch-anim-2 3s infinite linear alternate-reverse;
}
.glitch::after {
  left: -2px;
  text-shadow: -2px 0 var(--accent);
  clip: rect(85px, 550px, 140px, 0);
  animation: glitch-anim 2.5s infinite linear alternate-reverse;
}
@keyframes glitch-anim {
  0% { clip: rect(51px, 9999px, 28px, 0); }
  20% { clip: rect(70px, 9999px, 91px, 0); }
  40% { clip: rect(12px, 9999px, 46px, 0); }
  60% { clip: rect(87px, 9999px, 23px, 0); }
  80% { clip: rect(33px, 9999px, 78px, 0); }
  100% { clip: rect(56px, 9999px, 12px, 0); }
}
@keyframes glitch-anim-2 {
  0% { clip: rect(65px, 9999px, 19px, 0); }
  20% { clip: rect(12px, 9999px, 57px, 0); }
  40% { clip: rect(93px, 9999px, 44px, 0); }
  60% { clip: rect(28px, 9999px, 81px, 0); }
  80% { clip: rect(74px, 9999px, 35px, 0); }
  100% { clip: rect(47px, 9999px, 66px, 0); }
}

.tagline {
  font-size: 1.15rem;
  color: var(--text-dim);
  margin-bottom: 2rem;
  line-height: 1.6;
}
.cta-row { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
  border: 1px solid transparent;
}
.scroll-indicator {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  color: var(--text-dim);
  font-size: 0.7rem;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  animation: bounce 2s infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}
.btn.primary {
  background: var(--accent);
  color: #0d1117;
  box-shadow: 0 0 20px var(--accent-glow);
}
.btn.primary:hover {
  box-shadow: 0 0 30px var(--accent-glow);
  transform: translateY(-1px);
}
.btn.secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn.secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Projects Grid */
.grid-folder { margin-top: 1rem; }
.folder-title {
  font-family: var(--mono);
  font-size: 1.1rem;
  color: var(--folder);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.project-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.project-card:hover,
.project-card:focus {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.file-icon { font-size: 1.8rem; }
.file-type {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  padding: 0.25rem 0.5rem;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
}
.project-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text);
  font-family: var(--mono);
}
.project-card p {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 1rem;
}
.meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
}
.lang { color: var(--warning); }
.stars { color: var(--text-dim); font-family: var(--mono); }
.card-link {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  text-decoration: none;
  margin-top: 0.5rem;
}
.card-link:hover { text-decoration: underline; }

/* Manifesto */
.manifesto-window { margin-top: 2rem; }
.manifesto-content pre {
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-dim);
  white-space: pre-wrap;
}
.typewriter {
  position: relative;
}
.typewriter::after {
  content: '|';
  animation: blink 1s infinite;
  color: var(--accent);
}
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }
.manifesto-content a {
  color: var(--accent);
  text-decoration: none;
}
.manifesto-content a:hover { text-decoration: underline; }

/* Stats Bar */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.stat-item {
  background: var(--bg-window);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
}
.stat-value {
  display: block;
  font-family: var(--mono);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 0.25rem;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Footer */
.footer {
  text-align: center;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}
.footer-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 0.75rem;
  font-family: var(--mono);
}
.footer-links a {
  color: var(--accent);
  text-decoration: none;
}
.footer-links a:hover { text-decoration: underline; }
.footer-links .separator { color: var(--border); }
.copyright {
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* Responsive */
@media (max-width: 640px) {
  .desktop { padding: 1rem; }
  .hero-content { padding: 1.5rem 1rem; }
  .logo-frame { width: 130px; height: 130px; }
  .top-bar { flex-direction: column; gap: 0.5rem; align-items: flex-start; }
  .status-right { width: 100%; justify-content: space-between; }
  .cta-row { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
}
