/* ═══════════════════════════════════════════════════════════════
   MAIN.CSS — Dark hacker terminal theme
   ═══════════════════════════════════════════════════════════════ */

/* ── Variables ── */
:root {
  --bg:        #0a0e17;
  --bg-card:   #111827;
  --bg-card-hover: #1a2332;
  --surface:   #1e293b;
  --border:    #1e293b;
  --border-hover: #38bdf8;
  --text:      #e2e8f0;
  --text-dim:  #94a3b8;
  --accent:    #38bdf8;   /* cyan */
  --green:     #4ade80;
  --yellow:    #facc15;
  --red:       #f87171;
  --purple:    #a78bfa;
  --orange:    #fb923c;
  --mono:      'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --sans:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-w:     1100px;
  --radius:    10px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color .2s;
}
a:hover { color: #7dd3fc; }

img { display: block; max-width: 100%; }
ul { list-style: none; }

/* ────────────────────────── NAV ────────────────────────── */
#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 14, 23, .85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--green);
}
.nav-logo:hover { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-family: var(--mono);
  font-size: .85rem;
  color: var(--text-dim);
  transition: color .2s;
}
.nav-links a:hover { color: var(--accent); }

/* Mobile toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .3s, opacity .3s;
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(10, 14, 23, .97);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 1.5rem 2rem;
    gap: 1.2rem;
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }
}

/* ────────────────────────── HERO ────────────────────────── */
#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 1.5rem 60px;
}

/* Terminal window */
.terminal-window {
  width: 100%;
  max-width: 680px;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #161b22;
  border-bottom: 1px solid #30363d;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.dot.red    { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green  { background: #28c840; }

.terminal-title {
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--text-dim);
  margin-left: auto;
}

.terminal-body {
  padding: 1.5rem;
  font-family: var(--mono);
  font-size: .9rem;
  line-height: 1.8;
}

.line { margin-bottom: .15rem; }

.prompt {
  color: var(--green);
  margin-right: .5rem;
  user-select: none;
}

.output {
  color: var(--text);
  padding-left: 1.4rem;
}

.bio {
  color: var(--text-dim);
  font-size: .85rem;
}

.motto {
  color: var(--accent);
  font-style: italic;
}

#typed-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  min-height: 1.8em;
}

.cursor {
  animation: blink 1s step-end infinite;
  color: var(--green);
}
@keyframes blink {
  50% { opacity: 0; }
}

/* Hero links */
.hero-links {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--text-dim);
  transition: border-color .2s, color .2s, background .2s;
}
.hero-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(56, 189, 248, .06);
}
.hero-btn img {
  display: inline;
  filter: grayscale(1) brightness(1.7);
  transition: filter .2s;
}
.hero-btn:hover img { filter: none; }

/* ────────────────────────── SECTIONS ────────────────────────── */
section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 5rem 1.5rem;
}

.section-title {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: .5rem;
}

.hash { color: var(--accent); margin-right: .3rem; }

.section-sub {
  color: var(--text-dim);
  font-size: .85rem;
  margin-bottom: 2rem;
}

/* ────────────────────────── FEATURED PROJECTS ────────────────────────── */
.projects-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  margin-top: 2rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color .25s, transform .25s, box-shadow .25s;
  display: flex;
  flex-direction: column;
}
.project-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(56, 189, 248, .08);
}
.project-card.featured {
  border-left: 3px solid var(--accent);
}

.card-header {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: .75rem;
}

.tag {
  font-family: var(--mono);
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .2rem .55rem;
  border-radius: 4px;
  background: var(--surface);
}
.tag.compiler   { color: var(--purple); border: 1px solid rgba(167, 139, 250, .3); }
.tag.blockchain { color: var(--accent);  border: 1px solid rgba(56, 189, 248, .3); }
.tag.ai         { color: var(--green);   border: 1px solid rgba(74, 222, 128, .3); }
.tag.web        { color: var(--orange);  border: 1px solid rgba(251, 146, 60, .3); }
.tag.hackathon  { color: var(--yellow);  border: 1px solid rgba(250, 204, 21, .3); }
.tag.award {
  color: var(--yellow);
  border: 1px solid rgba(250, 204, 21, .3);
  background: rgba(250, 204, 21, .08);
}

.project-card h3 {
  font-family: var(--mono);
  font-size: 1.05rem;
  margin-bottom: .5rem;
}
.project-card h3 a { color: var(--text); }
.project-card h3 a:hover { color: var(--accent); }

.project-card p {
  font-size: .88rem;
  color: var(--text-dim);
  flex: 1;
  line-height: 1.55;
}
.project-card p a { color: var(--accent); }

.card-tech {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--text-dim);
  margin-top: 1rem;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
}

/* ────────────────────────── GITHUB REPOS (live) ────────────────────────── */
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
  vertical-align: middle;
  margin-left: .4rem;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}

.repos-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.repo-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color .25s, transform .25s;
  display: flex;
  flex-direction: column;
}
.repo-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.repo-card h4 {
  font-family: var(--mono);
  font-size: .92rem;
  margin-bottom: .4rem;
}
.repo-card h4 a { color: var(--text); }
.repo-card h4 a:hover { color: var(--accent); }

.repo-card .repo-desc {
  font-size: .82rem;
  color: var(--text-dim);
  flex: 1;
  margin-bottom: .75rem;
}

.repo-meta {
  display: flex;
  gap: 1rem;
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--text-dim);
}

.repo-lang {
  display: flex;
  align-items: center;
  gap: 4px;
}

.lang-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.repo-stars, .repo-forks {
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Loading spinner */
.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ────────────────────────── TECH STACK ────────────────────────── */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.stack-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.stack-group h4 {
  font-family: var(--mono);
  font-size: .85rem;
  color: var(--accent);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.stack-group ul {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.stack-group li {
  font-family: var(--mono);
  font-size: .78rem;
  background: var(--surface);
  padding: .3rem .7rem;
  border-radius: 4px;
  color: var(--text-dim);
  border: 1px solid transparent;
  transition: border-color .2s, color .2s;
}
.stack-group li:hover {
  border-color: var(--accent);
  color: var(--text);
}

/* ────────────────────────── FOOTER ────────────────────────── */
#footer {
  border-top: 1px solid var(--border);
  padding: 3rem 1.5rem;
  text-align: center;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.footer-prompt {
  font-family: var(--mono);
  font-size: .9rem;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
}

.footer-qr {
  margin-bottom: 1.5rem;
}

.footer-qr img {
  border-radius: 8px;
  border: 1px solid var(--border);
  margin: 0 auto;
}

.qr-label {
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--text-dim);
  margin-top: .5rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.footer-links a {
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--text-dim);
}
.footer-links a:hover { color: var(--accent); }

.copyright {
  font-size: .75rem;
  color: #475569;
}

/* ────────────────────────── ANIMATIONS ────────────────────────── */
/* Fade-in on scroll */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s ease, transform .6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ────────────────────────── RESPONSIVENESS ────────────────────────── */
@media (max-width: 640px) {
  #hero {
    padding: 80px 1rem 40px;
  }
  .terminal-body {
    padding: 1rem;
    font-size: .8rem;
  }
  #typed-name {
    font-size: 1.1rem;
  }
  .section-title {
    font-size: 1.25rem;
  }
  .projects-grid,
  .repos-grid {
    grid-template-columns: 1fr;
  }
}
