/* ── CSS Variables ── */
:root {
  --bg-color: #0a0a10;
  --surface-color: #13131c;
  --primary-accent: #3b82f6;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --terminal-green: #10b981;
  --border-color: rgba(255, 255, 255, 0.07);
}

/* ── Animated Background ── */
#bg-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

body > *:not(#bg-canvas) {
  position: relative;
  z-index: 1;
}

/* ── Hero grid overlay ── */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(59,130,246,0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,130,246,0.07) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 40%, transparent 100%);
  pointer-events: none;
}

.hero {
  position: relative;
  overflow: hidden;
}

/* ── Hero glow orbs ── */
.hero::after {
  content: '';
  position: absolute;
  width: 700px;
  height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,0.14) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: pulse-glow 6s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.18); }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
}

/* ── Container ── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Navbar ── */
.navbar {
  background: rgba(13, 13, 18, 0.9);
  backdrop-filter: blur(10px);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  border-bottom: 1px solid var(--border-color);
}
.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
}
.logo {
  font-weight: 700;
  color: var(--primary-accent);
  text-decoration: none;
  font-family: monospace;
  font-size: 1.2rem;
  white-space: nowrap;
}
.nav-links {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.3s;
}
.nav-links a:hover { color: var(--primary-accent); }

/* Hamburger */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}
.menu-toggle .bar {
  width: 25px;
  height: 2px;
  background-color: var(--text-main);
  transition: 0.3s;
  border-radius: 2px;
}

/* ── Hero ── */
.hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem 2rem;
}
.hero-content { max-width: 720px; width: 100%; }
.terminal-badge {
  display: inline-block;
  padding: 0.4rem 1rem;
  background: rgba(16, 185, 129, 0.08);
  color: var(--terminal-green);
  border-radius: 20px;
  font-family: monospace;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(16,185,129,0.2);
  animation: badge-pulse 3s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
  50% { box-shadow: 0 0 12px 2px rgba(16,185,129,0.18); }
}
.hero h1 {
  font-size: clamp(2rem, 6vw, 3.8rem);
  margin-bottom: 1rem;
  line-height: 1.2;
}
.highlight { color: var(--primary-accent); }
.hero h2 {
  font-size: clamp(1.1rem, 3vw, 1.8rem);
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: 1.5rem;
}
.hero p {
  max-width: 580px;
  color: var(--text-muted);
  margin: 0 auto 2.5rem auto;
  line-height: 1.7;
  font-size: clamp(0.9rem, 2vw, 1rem);
}
.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 0.75rem 1.6rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
  font-size: 0.95rem;
  white-space: nowrap;
}
.btn-primary { background-color: var(--primary-accent); color: white; }
.btn-primary:hover { background-color: #2563eb; }
.btn-secondary {
  border: 1px solid var(--border-color);
  color: var(--text-main);
}
.btn-secondary:hover { background: var(--surface-color); }

/* ── Sections ── */
section { padding: 5rem 0; }

.section-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-family: monospace;
  margin-bottom: 3rem;
  border-left: 4px solid var(--primary-accent);
  padding-left: 1rem;
  color: var(--text-main);
  line-height: 1.3;
}

/* ── Terminal ── */
.terminal-window {
  background: #07070a;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}
.terminal-header {
  background: #121218;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.red    { background: #ef4444; }
.yellow { background: #f59e0b; }
.green  { background: #10b981; }
.terminal-title {
  margin-left: auto;
  margin-right: auto;
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}
.terminal-body {
  padding: 1.5rem;
  font-family: monospace;
  line-height: 1.8;
  font-size: clamp(0.78rem, 2vw, 0.9rem);
  overflow-x: auto;
  word-break: break-word;
}
.prompt { color: var(--primary-accent); }
.response { color: var(--text-muted); margin-bottom: 0.8rem; }
.cursor { animation: blink 1s infinite; color: var(--terminal-green); }
@keyframes blink { 50% { opacity: 0; } }

/* ── Skills Grid ── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}
.skill-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  padding: 2rem 1.5rem;
  border-radius: 8px;
  transition: transform 0.2s;
}
.skill-card:hover { transform: translateY(-5px); }
.skill-icon {
  font-size: 1.8rem;
  color: var(--primary-accent);
  margin-bottom: 1rem;
}
.skill-card h3 { margin-bottom: 0.5rem; font-size: 1rem; }
.skill-card p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }

/* ── Projects ── */
.filter-container {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}
.filter-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.45rem 1.1rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: monospace;
  font-size: 0.85rem;
  transition: all 0.2s;
}
.filter-btn.active, .filter-btn:hover {
  background: var(--primary-accent);
  color: white;
  border-color: var(--primary-accent);
}
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.project-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  padding: 1.8rem;
  border-radius: 8px;
  transition: opacity 0.3s ease, transform 0.2s;
}
.project-card:hover { transform: translateY(-4px); }
.project-tags span {
  font-size: 0.75rem;
  background: rgba(255,255,255,0.05);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  color: var(--primary-accent);
  font-family: monospace;
}
.project-card h3 { margin: 0.9rem 0 0.5rem; font-size: 1rem; }
.project-card p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }

/* ── Contact ── */
.contact-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}
.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.2rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.88rem;
  transition: background 0.2s;
  white-space: nowrap;
}
.contact-link:hover { background: var(--surface-color); }
.contact-link i { color: var(--primary-accent); font-size: 1rem; }

.contact-form { max-width: 600px; margin: 0 auto; }
.form-group { margin-bottom: 1.5rem; }
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.9rem 1rem;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: white;
  outline: none;
  font-size: 0.95rem;
  font-family: inherit;
}
.form-group input:focus,
.form-group textarea:focus { border-color: var(--primary-accent); }
.form-group textarea { resize: vertical; }

/* ── Footer ── */
footer {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  border-top: 1px solid var(--border-color);
  font-family: monospace;
}
.footer-icons {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
}
.footer-icons a {
  color: var(--text-muted);
  font-size: 1.3rem;
  transition: color 0.2s;
  text-decoration: none;
}
.footer-icons a:hover { color: var(--primary-accent); }

/* ── Timeline ── */
.timeline { display: flex; flex-direction: column; gap: 1.5rem; }
.timeline-item {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 1.5rem;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.8rem;
  transition: transform 0.2s;
}
.timeline-item:hover { transform: translateY(-3px); }
.timeline-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
  padding-top: 0.2rem;
}
.timeline-year {
  font-family: monospace;
  color: var(--primary-accent);
  font-size: 0.88rem;
  font-weight: 700;
  word-break: break-word;
}
.timeline-tag {
  font-size: 0.7rem;
  background: rgba(59,130,246,0.12);
  color: var(--primary-accent);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-family: monospace;
}
.timeline-content h3 { margin-bottom: 0.3rem; font-size: 1rem; }
.timeline-company {
  color: var(--terminal-green);
  font-size: 0.85rem;
  font-family: monospace;
  margin-bottom: 0.8rem;
}
.timeline-list {
  padding-left: 1.2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
}
.timeline-list li { margin-bottom: 0.4rem; }

/* ── Scroll Reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.16,1,0.3,1), transform 0.7s cubic-bezier(0.16,1,0.3,1);
}
.reveal.from-left  { transform: translateX(-40px); }
.reveal.from-right { transform: translateX(40px); }
.reveal.visible    { opacity: 1 !important; transform: translate(0,0) !important; }
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }

/* ── Location badge ── */
.location-badge {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  text-align: center;
}

/* ════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ════════════════════════════════ */

/* ── Tablet: 600px – 1024px ── */
@media (max-width: 1024px) {
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Mobile + small tablet: ≤ 768px ── */
@media (max-width: 768px) {
  /* Nav */
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 57px;
    left: 0;
    width: 100%;
    background: var(--bg-color);
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    gap: 1.2rem;
    z-index: 999;
  }
  .nav-links.active { display: flex; }
  .menu-toggle { display: flex; }

  /* Hero */
  .hero { padding: 5rem 1rem 2rem; min-height: 100svh; }
  .hero h1 { font-size: 2.2rem; }
  .hero h2 { font-size: 1.2rem; }
  .hero-cta { flex-direction: column; align-items: center; }
  .hero-cta .btn { width: 100%; max-width: 280px; text-align: center; }

  /* Sections */
  section { padding: 4rem 0; }
  .section-title { font-size: 1.3rem; margin-bottom: 2rem; }

  /* Skills */
  .skills-grid { grid-template-columns: 1fr; }

  /* Timeline */
  .timeline-item {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 1.3rem;
  }
  .timeline-meta { flex-direction: row; align-items: center; gap: 0.75rem; }

  /* Projects */
  .projects-grid { grid-template-columns: 1fr; }

  /* Contact links */
  .contact-links { flex-direction: column; align-items: center; }
  .contact-link { width: 100%; max-width: 320px; justify-content: center; }

  /* Terminal */
  .terminal-body { font-size: 0.78rem; padding: 1rem; }
  .terminal-title { font-size: 0.7rem; }
}

/* ── Small phones: ≤ 400px ── */
@media (max-width: 400px) {
  .logo { font-size: 1rem; }
  .hero h1 { font-size: 1.8rem; }
  .section-title { font-size: 1.1rem; }
  .skill-card { padding: 1.3rem 1rem; }
  .timeline-item { padding: 1rem; }
  .project-card { padding: 1.3rem; }
  .terminal-body { font-size: 0.72rem; }
}

/* ── Large screens: ≥ 1280px ── */
@media (min-width: 1280px) {
  .container { max-width: 1200px; }
  .skills-grid { grid-template-columns: repeat(4, 1fr); }
  .projects-grid { grid-template-columns: repeat(3, 1fr); }
  .hero h1 { font-size: 4rem; }
}
/* ── Education Cards ── */
.education-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.education-card {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 1.5rem;
  align-items: start;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 2rem;
  transition: transform 0.2s, border-color 0.2s;
}

.education-card:hover {
  transform: translateY(-4px);
  border-color: rgba(59, 130, 246, 0.35);
}

.education-icon {
  width: 52px;
  height: 52px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--primary-accent);
  flex-shrink: 0;
}

.education-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.education-year {
  font-family: monospace;
  font-size: 0.78rem;
  color: var(--primary-accent);
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  padding: 0.15rem 0.6rem;
  border-radius: 20px;
  display: inline-block;
  width: fit-content;
  margin-bottom: 0.3rem;
}

.education-card h3 {
  font-size: 1.05rem;
  color: var(--text-main);
  margin: 0;
}

.education-school {
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--terminal-green);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.education-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-top: 0.3rem;
}

/* Responsive education */
@media (max-width: 768px) {
  .education-card {
    grid-template-columns: 50px 1fr;
    gap: 1rem;
    padding: 1.3rem;
  }
  .education-icon {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }
}

@media (max-width: 400px) {
  .education-card {
    grid-template-columns: 1fr;
  }
  .education-icon { display: none; }
}