/* ========================================
   VARIABLES & RESET
======================================== */
:root {
  --bg:             #0d1117;
  --surface:        #161b22;
  --surface-2:      #21262d;
  --border:         #30363d;
  --text:           #e6edf3;
  --text-muted:     #8b949e;
  --accent:         #58a6ff;
  --accent-dim:     rgba(88, 166, 255, 0.1);
  --accent-border:  rgba(88, 166, 255, 0.25);
  --font-sans:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:      'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --nav-h:          60px;
  --radius:         8px;
  --ease:           0.2s ease;
  --max-w:          1100px;
  --max-w-sm:       720px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

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

a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ========================================
   NAV
======================================== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  transition: background var(--ease), border-bottom var(--ease);
}

.nav.scrolled {
  background: rgba(13, 17, 23, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 2px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  font-size: 14px;
  color: var(--text-muted);
  transition: color var(--ease);
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.nav-cta {
  color: var(--accent) !important;
  border: 1px solid var(--accent-border);
  padding: 6px 16px;
  border-radius: var(--radius);
  transition: background var(--ease), border-color var(--ease) !important;
}

.nav-cta:hover {
  background: var(--accent-dim);
  border-color: var(--accent) !important;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin: -8px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--ease), opacity var(--ease);
}

/* ========================================
   HERO
======================================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-h) + 60px) 24px 80px;
}

.hero-content {
  max-width: 640px;
  width: 100%;
}

.hero-terminal {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 44px;
  overflow: hidden;
  text-align: left;
  min-width: 280px;
  max-width: 100%;
}

.terminal-bar {
  background: var(--surface-2);
  padding: 10px 14px;
  display: flex;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

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

.terminal-body { padding: 14px 18px; }

.terminal-line {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
}

.terminal-prompt { color: var(--accent); }

.terminal-cursor {
  color: var(--accent);
  animation: blink 1s step-end infinite;
  margin-left: 1px;
}

@keyframes blink { 50% { opacity: 0; } }

.hero-name {
  font-size: clamp(2rem, 7vw, 3.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 12px;
}

.hero-title {
  font-family: var(--font-mono);
  font-size: clamp(0.8rem, 2.5vw, 0.95rem);
  color: var(--accent);
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}

.hero-pitch {
  font-size: clamp(1rem, 2.5vw, 1.125rem);
  color: var(--text-muted);
  margin-bottom: 36px;
}

.hero-ctas {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--ease), border-color var(--ease), color var(--ease), transform var(--ease);
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: #0d1117;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: #79b8ff;
  border-color: #79b8ff;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ========================================
   SECTIONS
======================================== */
.section { padding: 88px 24px; }

.section-alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

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

.container-narrow {
  max-width: var(--max-w-sm);
  margin: 0 auto;
}

.section-title {
  font-size: clamp(1.4rem, 4vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 40px;
}

.section-title::after {
  content: '';
  display: block;
  width: 36px;
  height: 3px;
  background: var(--accent);
  margin-top: 10px;
  border-radius: 2px;
}

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

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color var(--ease), transform var(--ease), box-shadow var(--ease);
}

.project-card:hover {
  border-color: var(--accent-border);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.project-card.featured {
  border-color: var(--accent-border);
  background: linear-gradient(145deg, var(--surface) 0%, rgba(88, 166, 255, 0.04) 100%);
}

.project-card.featured:hover {
  border-color: var(--accent);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.project-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.project-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.project-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}

.project-link {
  color: var(--text-muted);
  padding: 4px;
  border-radius: 4px;
  transition: color var(--ease);
  display: flex;
  align-items: center;
}

.project-link:hover { color: var(--accent); }

.project-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.75;
  flex: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-demo-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  align-self: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  padding: 7px 14px;
  border-radius: var(--radius);
  transition: background var(--ease), border-color var(--ease), gap var(--ease);
}

.project-demo-btn:hover {
  background: rgba(88, 166, 255, 0.18);
  border-color: var(--accent);
  gap: 10px;
}

/* ========================================
   TAGS (shared)
======================================== */
.tag {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 3px 10px;
  border-radius: 4px;
  border: 1px solid var(--accent-border);
  white-space: nowrap;
}

/* ========================================
   SKILLS
======================================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.skill-group {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color var(--ease);
}

.skill-group:hover { border-color: var(--accent-border); }

.skill-group-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ========================================
   ABOUT
======================================== */
.about-text {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.85;
  margin-bottom: 20px;
}

.about-text:last-child { margin-bottom: 0; }

/* ========================================
   EDUCATION
======================================== */
.education-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  transition: border-color var(--ease);
}

.education-card:hover { border-color: var(--accent-border); }

.education-degree {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.education-school {
  font-size: 15px;
  color: var(--accent);
  margin-bottom: 2px;
}

.education-location {
  font-size: 13px;
  color: var(--text-muted);
}

.education-date {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ========================================
   CONTACT
======================================== */
.contact-section { text-align: center; }

.contact-text {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 32px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.contact-links {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 12px 20px;
  border-radius: var(--radius);
  transition: color var(--ease), border-color var(--ease), background var(--ease);
}

.contact-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}

/* ========================================
   FOOTER
======================================== */
.footer {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
}

/* ========================================
   FADE-IN ANIMATIONS
======================================== */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   RESPONSIVE — TABLET (≤ 900px)
======================================== */
@media (max-width: 900px) {
  .projects-grid {
    grid-template-columns: 1fr 1fr;
  }

  .project-card.featured {
    grid-column: 1 / -1;
  }
}

/* ========================================
   RESPONSIVE — MOBILE (≤ 680px)
======================================== */
@media (max-width: 680px) {
  .nav-toggle { display: flex; }

  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: rgba(13, 17, 23, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 8px 24px 20px;
    gap: 0;
    display: none;
  }

  .nav-links.open { display: flex; }

  .nav-links li { width: 100%; }

  .nav-links a {
    display: block;
    padding: 14px 0;
    font-size: 16px;
    border-bottom: 1px solid var(--border);
  }

  .nav-links li:last-child a {
    border-bottom: none;
  }

  .nav-cta {
    border: none !important;
    padding: 14px 0 !important;
    border-radius: 0 !important;
    background: none !important;
  }

  .hero {
    padding: calc(var(--nav-h) + 40px) 16px 64px;
  }

  .hero-terminal {
    width: 100%;
    min-width: unset;
    margin-bottom: 32px;
  }

  .hero-ctas {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    min-width: 200px;
    text-align: center;
  }

  .section { padding: 64px 16px; }

  .projects-grid { grid-template-columns: 1fr; }
  .project-card.featured { grid-column: unset; }

  .skills-grid { grid-template-columns: 1fr; }

  .education-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 20px;
  }

  .contact-links { flex-direction: column; align-items: stretch; }
  .contact-link { justify-content: center; }
}

/* ========================================
   SMALL MOBILE (≤ 380px)
======================================== */
@media (max-width: 380px) {
  .hero-name { font-size: 1.75rem; }
  .terminal-line { font-size: 12px; }
  .section { padding: 52px 14px; }
}

/* ========================================
   REDUCED MOTION
======================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fade-in { opacity: 1; transform: none; transition: none; }
  .terminal-cursor { animation: none; opacity: 1; }
  .btn:active { transform: none; }
  .project-card:hover { transform: none; }
}
