:root {
  --bg: #0a0a0f;
  --surface: #111118;
  --border: #1e1e2e;
  --accent: #00ff88;
  --accent2: #6c63ff;
  --text: #e8e8f0;
  --muted: #555570;
  --mono: 'Space Mono', monospace;
  --sans: 'Syne', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Noise overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1000;
  opacity: 0.4;
}

/* Nav */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 3rem;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  background: rgba(10,10,15,0.85);
}

.nav-logo {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--accent);
  letter-spacing: 0.05em;
}

nav ul {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

nav a {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.2s;
}
nav a:hover { color: var(--accent); }

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 8rem 3rem 4rem;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,255,136,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,255,136,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

.hero-glow {
  position: absolute;
  top: 20%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(108,99,255,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-glow2 {
  position: absolute;
  bottom: 0;
  left: -5%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(0,255,136,0.07) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  max-width: 900px;
  position: relative;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  animation: fadeUp 0.6s ease both;
}

.hero-meta .hero-tag {
  margin-bottom: 0;
  animation: none;
}

.hero-location {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.hero-tag {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  animation: fadeUp 0.6s ease both;
}

.hero-tag::before {
  content: '';
  display: block;
  width: 2rem;
  height: 1px;
  background: var(--accent);
}

h1 {
  font-size: clamp(3.5rem, 8vw, 7rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.03em;
  animation: fadeUp 0.6s 0.1s ease both;
  margin-bottom: 1.5rem;
}

h1 .dim { color: var(--muted); }
h1 .highlight { color: var(--accent); }

.hero-desc {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 500px;
  animation: fadeUp 0.6s 0.2s ease both;
  margin-bottom: 2.5rem;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  animation: fadeUp 0.6s 0.3s ease both;
}

.btn {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.85rem 2rem;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border: none;
  font-weight: 700;
}
.btn-primary:hover { background: #00cc6a; transform: translateY(-2px); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

.hero-stats {
  display: flex;
  gap: 3rem;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  animation: fadeUp 0.6s 0.4s ease both;
}

.stat-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
}
.stat-num span { color: var(--accent); }

.stat-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Sections */
section {
  padding: 6rem 3rem;
  max-width: 1100px;
  margin: 0 auto;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 3.5rem;
}

.section-num {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
}

.section-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

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

.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  transition: border-color 0.2s, transform 0.2s;
}
.skill-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.skill-category {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 1rem;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 0.3rem 0.7rem;
  background: rgba(0,255,136,0.06);
  border: 1px solid rgba(0,255,136,0.15);
  border-radius: 3px;
  color: var(--text);
}

.tag-lang {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tag-level {
  font-size: 0.68rem;
  color: var(--accent);
  opacity: 0.8;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 1.5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-left: 2.5rem;
  padding-bottom: 3rem;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-marker {
  position: absolute;
  left: -1px;
  top: 5px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 10px rgba(0,255,136,0.35);
}

.timeline-marker--edu {
  border-color: var(--accent2);
  box-shadow: 0 0 10px rgba(108,99,255,0.35);
}

.timeline-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.timeline-date {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
}

.timeline-type {
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  background: rgba(0,255,136,0.08);
  border: 1px solid rgba(0,255,136,0.2);
  color: var(--accent);
}

.timeline-type--edu {
  background: rgba(108,99,255,0.08);
  border-color: rgba(108,99,255,0.2);
  color: #9090ff;
}

.timeline-role {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.timeline-company {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.timeline-desc {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 1rem;
  max-width: 680px;
}

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

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

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  transition: all 0.25s;
  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(--accent2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s;
}
.project-card:hover::before { transform: scaleX(1); }
.project-card:hover { transform: translateY(-4px); border-color: rgba(0,255,136,0.2); }

.project-type {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.project-name {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.project-desc {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tech-badge {
  font-family: var(--mono);
  font-size: 0.68rem;
  padding: 0.2rem 0.6rem;
  background: rgba(108,99,255,0.1);
  border: 1px solid rgba(108,99,255,0.2);
  border-radius: 3px;
  color: #9090ff;
}

/* About */
.about-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-text p {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 1.2rem;
}

.about-text p strong { color: var(--text); }

.about-terminal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.terminal-bar {
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-r { background: #ff5f57; }
.dot-y { background: #febc2e; }
.dot-g { background: #28c840; }

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

.t-prompt { color: var(--accent); }
.t-cmd { color: var(--text); }
.t-out { color: var(--muted); }
.t-val { color: #9090ff; }

/* Contact */
.contact-intro {
  margin-bottom: 2.5rem;
}

.contact-intro h3 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.contact-intro p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.8;
}

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: end;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.88rem;
  color: var(--text);
  text-decoration: none;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  transition: border-color 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.contact-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateX(4px);
  box-shadow: 0 0 16px rgba(0,255,136,0.08);
}

.contact-link-icon {
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid rgba(0,255,136,0.25);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: rgba(0,255,136,0.06);
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}

.contact-link-icon svg {
  width: 1.1rem;
  height: 1.1rem;
}
.contact-link:hover .contact-link-icon {
  background: rgba(0,255,136,0.14);
  border-color: var(--accent);
}

.copy-btn {
  margin-left: auto;
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--muted);
  cursor: pointer;
  padding: 0.2rem 0.55rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  opacity: 0;
}
.contact-link:hover .copy-btn {
  opacity: 1;
}
.copy-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(0,255,136,0.08);
}
.copy-btn .check-label { display: none; }
.copy-btn.copied { color: var(--accent); border-color: var(--accent); opacity: 1; }
.copy-btn.copied .copy-label { display: none; }
.copy-btn.copied .check-label { display: block; }

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

footer p {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

/* Animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 1em;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
  margin-left: 2px;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* Hamburger button (hidden on desktop) */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 101;
}
.nav-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: all 0.25s;
  transform-origin: center;
}
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
  /* Nav */
  nav { padding: 1rem 1.5rem; }
  .nav-burger { display: flex; }
  .nav-links {
    display: none;
    position: fixed;
    top: 57px;
    left: 0; right: 0;
    background: rgba(10,10,15,0.97);
    backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: stretch;
    border-bottom: 1px solid var(--border);
    z-index: 99;
  }
  .nav-links.open { display: flex; }
  .nav-links li { border-bottom: 1px solid var(--border); }
  .nav-links a {
    display: block;
    padding: 1rem 1.5rem;
    font-size: 0.85rem;
    color: var(--text);
  }

  /* Hero */
  .hero { padding: 6rem 1.5rem 3rem; min-height: auto; padding-bottom: 4rem; }
  .hero-meta { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .hero-cta { flex-direction: column; }
  .btn { text-align: center; }
  .hero-stats { gap: 1.5rem; flex-wrap: wrap; margin-top: 2.5rem; }

  /* Sections */
  section { padding: 4rem 1.5rem; }

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

  /* Projects */
  .projects-grid { grid-template-columns: 1fr; }

  /* About */
  .about-layout { grid-template-columns: 1fr; gap: 2rem; }

  /* Contact */
  .contact-layout { grid-template-columns: 1fr; gap: 2rem; }
  .contact-terminal { display: none; }

  /* Footer */
  footer { padding: 1.5rem; flex-direction: column; gap: 0.5rem; text-align: center; }
}

@media (max-width: 480px) {
  .stat-num { font-size: 1.6rem; }
  .hero-stats { gap: 1.2rem; }
  .section-title { font-size: 1.8rem; }
  .contact-intro h3 { font-size: 1.4rem; }
  .terminal-body { font-size: 0.75rem; }
}
