:root {
  --bg: #0a0e17;
  --bg-alt: #0d1420;
  --surface: #111a2b;
  --surface-hover: #142138;
  --border: #1f2c45;
  --border-light: #2a3a58;
  --text: #e6edf7;
  --muted: #8896ab;
  --cyan: #22d3ee;
  --cyan-bright: #67e8f9;
  --green: #4ade80;
  --purple: #a78bfa;
  --amber: #fbbf24;
  --pink: #f472b6;
  --red: #ff5f57;
  --yellow: #febc2e;
  --dotgreen: #28c840;
  --mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  line-height: 1.65;
  background:
    radial-gradient(circle at 12% 8%, rgba(34,211,238,0.07), transparent 32%),
    radial-gradient(circle at 88% 0%, rgba(167,139,250,0.08), transparent 40%),
    var(--bg);
  background-attachment: fixed;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 90%);
}

::selection { background: rgba(34,211,238,0.25); color: #fff; }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.skip-link {
  position: absolute;
  top: -48px;
  left: 12px;
  z-index: 200;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--cyan);
  border-radius: 6px;
  padding: 10px 18px;
  font-family: var(--mono);
  font-size: 13px;
  transition: top 0.12s ease-out;
}
.skip-link:focus {
  top: 12px;
  text-decoration: none;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--cyan); }

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.2; font-weight: 800; letter-spacing: -0.02em; color: #fff; }

code, .mono { font-family: var(--mono); }

.eyebrow {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 12px;
  font-weight: 600;
  color: var(--cyan);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: '//';
  color: var(--muted);
  opacity: 0.7;
}

.lead { font-size: 18px; color: var(--muted); max-width: 680px; }
#about .lead { max-width: 70ch; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  background: rgba(10,14,23,0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 16px;
  color: #fff;
}
.logo:hover { text-decoration: none; }
.logo-text {
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.logo-text.logo-scramble { display: inline-flex; }
.logo-char {
  display: inline-block;
  overflow: hidden;
  white-space: pre;
  width: calc((1 - var(--p, 0)) * 1.05ch);
  opacity: calc(1 - var(--p, 0));
  transition: width 0.08s linear, opacity 0.08s linear;
}
.logo-char.logo-space { width: calc((1 - var(--p, 0)) * 0.55ch); }
.logo-char.logo-keep {
  width: auto;
  opacity: 1;
  transition: none;
}
.logo-text::after {
  content: '_';
  color: var(--green);
  animation: blink 1.1s step-end infinite;
}
.logo-dot { color: var(--cyan); }
@keyframes blink { 50% { opacity: 0; } }

@media (max-width: 480px) {
  .logo-text { font-size: 13px; }
}

#navLinks {
  display: flex;
  align-items: center;
}
#navLinks a {
  margin-left: 28px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  position: relative;
  padding-bottom: 2px;
}
#navLinks a:not(.nav-cta)::before { content: '';}
#navLinks a:hover { color: var(--cyan-bright); text-decoration: none; }
#navLinks a.active { color: var(--cyan); }
#navLinks a.nav-cta {
  background: transparent;
  color: var(--cyan);
  padding: 7px 16px;
  border-radius: 6px;
  border: 1px solid var(--cyan);
  transition: background 0.12s ease-out, box-shadow 0.12s ease-out, color 0.12s ease-out;
}
#navLinks a.nav-cta:hover {
  background: rgba(34,211,238,0.1);
  box-shadow: 0 0 16px rgba(34,211,238,0.35);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.15s ease-out, opacity 0.15s ease-out;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: 64px 0 100px;
  text-align: center;
  color: #fff;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 15%, rgba(34,211,238,0.16), transparent 45%),
    radial-gradient(circle at 82% 5%, rgba(167,139,250,0.16), transparent 50%),
    radial-gradient(circle at 50% 100%, rgba(74,222,128,0.08), transparent 55%),
    var(--bg);
  z-index: -2;
}
.terminal-window {
  max-width: 620px;
  margin: 0 auto 36px;
  background: rgba(17,26,43,0.7);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  text-align: left;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.45), 0 0 0 1px rgba(34,211,238,0.04);
  backdrop-filter: blur(6px);
}
.terminal-titlebar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
}
.terminal-dots { display: flex; gap: 7px; }
.terminal-dots span { width: 11px; height: 11px; border-radius: 50%; display: block; }
.terminal-dots span:nth-child(1) { background: var(--red); }
.terminal-dots span:nth-child(2) { background: var(--yellow); }
.terminal-dots span:nth-child(3) { background: var(--dotgreen); }
.terminal-path {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  margin: 0 auto;
}
.terminal-body { padding: 28px 32px 32px; }

.hero-inner { display: flex; flex-direction: column; align-items: center; position: relative; z-index: 1; }
.avatar {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--cyan);
  box-shadow: 0 0 0 4px rgba(34,211,238,0.12), 0 0 30px rgba(34,211,238,0.25);
  margin-bottom: 20px;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-divider { display: none; }
.hero .eyebrow { color: var(--green); justify-content: center; text-transform: none; letter-spacing: normal; }
.hero .eyebrow::before { content: '$'; color: var(--muted); }
.hero h1 {
  font-size: 42px;
  margin: 0 0 14px;
  background: linear-gradient(120deg, #fff 30%, var(--cyan-bright));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero .tagline { font-family: var(--mono); font-size: 15px; line-height: 1.8; color: var(--muted); margin-bottom: 32px; max-width: 560px; }
.hero-links { display: flex; gap: 12px; justify-content: center; margin-bottom: 32px; flex-wrap: wrap; }
.hero-social { display: flex; gap: 18px; justify-content: center; }
.hero-social a { color: var(--muted); }
.hero-social a:hover { color: var(--cyan-bright); }

.btn {
  display: inline-block;
  padding: 11px 24px;
  border-radius: 7px;
  font-weight: 600;
  font-family: var(--mono);
  font-size: 13px;
  transition: transform 0.12s ease-out, background 0.12s ease-out, box-shadow 0.12s ease-out;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary {
  background: linear-gradient(120deg, var(--cyan), var(--purple));
  color: #06111f;
}
.btn-primary:hover { box-shadow: 0 10px 28px rgba(34,211,238,0.3); }
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-light);
}
.btn-outline:hover { border-color: var(--cyan); color: var(--cyan-bright); }
.section .btn-primary { color: #06111f; }
.section .btn-outline { color: var(--cyan); border-color: var(--cyan); }

/* Sections */
.section { padding: 88px 0; position: relative; }
.section.alt {
  background: linear-gradient(
    to bottom,
    transparent 0,
    var(--bg-alt) 140px,
    var(--bg-alt) calc(100% - 140px),
    transparent 100%
  );
}
.section h2 { font-size: 30px; margin: 0 0 18px; }

/* Stats */
.stats { display: flex; gap: 48px; margin-top: 36px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat-num { font-family: var(--mono); font-size: 32px; font-weight: 700; color: var(--cyan); }
.stat-label { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 20px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 46px 28px 28px;
  transition: transform 0.12s ease-out, box-shadow 0.12s ease-out, border-color 0.12s ease-out;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 30px;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
}
.card::after {
  content: '';
  position: absolute;
  top: 11px; left: 16px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 16px 0 0 var(--yellow), 32px 0 0 var(--dotgreen);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.35);
  border-color: var(--border-light);
}
.card-icon {
  width: 42px;
  height: 42px;
  border-radius: 9px;
  background: rgba(34,211,238,0.08);
  border: 1px solid rgba(34,211,238,0.18);
  color: var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.section.alt .card-icon { background: rgba(34,211,238,0.08); }
.card h3 { margin: 0 0 4px; font-size: 18px; color: #fff; }
.card-meta { font-family: var(--mono); color: var(--purple); font-size: 12px; font-weight: 600; margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.card p:not(.card-meta) { color: var(--muted); font-size: 14.5px; max-width: 62ch; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.card-tags span {
  font-family: var(--mono);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-light);
  border-radius: 5px;
  padding: 4px 9px;
  font-size: 11.5px;
  color: var(--cyan-bright);
}
.card-links { display: flex; gap: 16px; flex-wrap: wrap; }
.card-links a { font-family: var(--mono); font-weight: 600; font-size: 13px; color: var(--green); }
.card-links a:hover { color: var(--cyan-bright); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-badge {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(244,114,182,0.12);
  border: 1px solid rgba(244,114,182,0.35);
  color: var(--pink);
  white-space: nowrap;
  margin-top: 4px;
}

/* Project filter */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px 0 32px;
}
.filter-pill {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.12s ease-out, color 0.12s ease-out, background 0.12s ease-out;
}
.filter-pill:hover { border-color: var(--cyan); color: var(--cyan-bright); }
.filter-pill.active {
  background: rgba(34,211,238,0.1);
  border-color: var(--cyan);
  color: var(--cyan-bright);
}
.filter-panel[hidden] { display: none; }

/* Featured projects */
.featured-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
.featured-card {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 16px 20px;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 46px 28px 26px;
  position: relative;
  overflow: hidden;
  transition: transform 0.12s ease-out, box-shadow 0.12s ease-out, border-color 0.12s ease-out;
}
.featured-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 30px;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
}
.featured-card::after {
  content: '';
  position: absolute;
  top: 11px; left: 16px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 16px 0 0 var(--yellow), 32px 0 0 var(--dotgreen);
}
.featured-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.35);
  border-color: var(--border-light);
}
.featured-icon {
  grid-row: 1 / 3;
  width: 42px;
  height: 42px;
  border-radius: 9px;
  background: rgba(34,211,238,0.08);
  border: 1px solid rgba(34,211,238,0.18);
  color: var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
}
.featured-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.featured-head h3 { margin: 0; font-size: 19px; color: #fff; }
.featured-card .card-meta { margin: 6px 0 10px; }
.featured-card p:not(.card-meta) { color: var(--muted); font-size: 14.5px; max-width: 68ch; }
.featured-card .card-tags { margin: 14px 0 0; }
.featured-links {
  grid-column: 3;
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  justify-content: center;
}
.featured-links a { font-family: var(--mono); font-weight: 600; font-size: 13px; color: var(--green); white-space: nowrap; }
.featured-links a:hover { color: var(--cyan-bright); }

@media (max-width: 640px) {
  .featured-card { grid-template-columns: 36px 1fr; }
  .featured-links { grid-column: 1 / 3; grid-row: auto; flex-direction: row; align-items: center; margin-top: 10px; }
}

/* Timeline */
.timeline { margin-top: 36px; position: relative; }
.timeline-item {
  display: flex;
  gap: 24px;
  position: relative;
  padding-bottom: 40px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--cyan);
  box-shadow: 0 0 10px rgba(34,211,238,0.5);
  margin-top: 8px;
  position: relative;
  flex-shrink: 0;
}
.timeline-item:not(:last-child) .timeline-dot::after {
  content: '';
  position: absolute;
  top: 14px;
  left: 4px;
  width: 2px;
  height: calc(100% + 28px);
  background: linear-gradient(var(--border-light), transparent);
}
.timeline-content { flex: 1; }
.job-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}
.job-header h3 { margin: 0; font-size: 17px; color: #fff; }
.job-date {
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  background: rgba(34,211,238,0.08);
  border: 1px solid rgba(34,211,238,0.18);
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.timeline-content ul { margin-top: 12px; padding-left: 20px; color: var(--muted); }
.timeline-content li { margin-bottom: 6px; }
.timeline-content li::marker { color: var(--green); }

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  margin-top: 36px;
}
.skill-group h3 {
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--purple);
}
.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  font-family: var(--mono);
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  transition: border-color 0.12s ease-out, color 0.12s ease-out;
}
.tags li:hover { border-color: var(--cyan); color: var(--cyan-bright); }
.tags-toggle {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--cyan);
  background: transparent;
  border: 1px dashed var(--border-light);
  border-radius: 6px;
  padding: 6px 12px;
  margin-top: 8px;
  cursor: pointer;
  transition: border-color 0.12s ease-out, color 0.12s ease-out;
}
.tags-toggle:hover { border-color: var(--cyan); color: var(--cyan-bright); }
.cert-tags li {
  border-color: rgba(251,191,36,0.35);
  background: rgba(251,191,36,0.06);
  color: var(--amber);
}
.cert-tags li:hover { border-color: var(--amber); color: var(--amber); }
.badge {
  background: var(--amber);
  color: #06111f;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Testimonials */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 36px;
}
.testimonial {
  background: var(--surface);
  border-radius: 12px;
  padding: 26px;
  border: 1px solid var(--border);
  position: relative;
}
.testimonial::before {
  content: '"';
  font-family: var(--mono);
  position: absolute;
  top: 14px;
  right: 20px;
  font-size: 40px;
  color: var(--border-light);
  line-height: 1;
}
.testimonial-featured {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(34,211,238,0.06), rgba(167,139,250,0.08));
  border-color: rgba(34,211,238,0.25);
}
.testimonial p { font-size: 14.5px; color: var(--text); margin: 0 0 18px; position: relative; z-index: 1; }
.testimonial-author { display: flex; flex-direction: column; }
.author-name { font-weight: 700; font-size: 14px; color: #fff; }
.author-role { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* Contact */
.contact { text-align: center; }
.contact .lead { margin: 0 auto 28px; }
.contact-links { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* Footer */
.site-footer {
  background: #05080f;
  color: var(--muted);
  padding: 24px 0;
  font-size: 13px;
  font-family: var(--mono);
  border-top: 1px solid var(--border);
}
.footer-inner { display: flex; justify-content: space-between; align-items: center; }
.footer-inner > span::before { content: '$ '; color: var(--green); }
.footer-links { display: flex; gap: 18px; }
.footer-inner a { color: var(--muted); }
.footer-inner a:hover { color: var(--cyan-bright); }

@media (max-width: 720px) {
  #navLinks {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(10,14,23,0.97);
    backdrop-filter: blur(10px);
    flex-direction: column;
    border-bottom: 1px solid var(--border);
    padding: 12px 24px 20px;
    display: none;
  }
  #navLinks.open { display: flex; }
  #navLinks a { margin: 10px 0; }
  .nav-cta { display: inline-block; width: fit-content; }
  .nav-toggle { display: flex; }
  .hero h1 { font-size: 32px; }
  .terminal-body { padding: 24px 20px 28px; }
  .stats { gap: 28px; }
  .job-date { white-space: normal; text-align: right; }
}
