:root {
  --bg: #071117;
  --bg-soft: #0d1b24;
  --panel: rgba(255,255,255,0.055);
  --panel-strong: rgba(255,255,255,0.09);
  --accent: #3dd6a3;
  --accent-2: #55b7ff;
  --accent-3: #f6c85f;
  --text: #f4f7fb;
  --muted: #9aabba;
  --faint: #60717f;
  --border: rgba(255,255,255,0.12);
  --shadow: 0 20px 70px rgba(0,0,0,0.35);
  --font-main: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius: 8px;
  --nav-height: 74px;
  --section-pad: 96px 0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-height); }
body {
  min-height: 100vh;
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
ul { list-style: none; }
.highlight { color: var(--accent); }

#navbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--nav-height);
  border-bottom: 1px solid transparent;
  transition: background .25s ease, height .25s ease, border-color .25s ease;
}
#navbar.scrolled {
  height: 62px;
  background: rgba(7,17,23,0.88);
  border-bottom-color: var(--border);
  backdrop-filter: blur(18px);
}
.nav-container {
  width: min(1180px, calc(100% - 32px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.nav-logo, .footer-logo {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0;
}
.logo-bracket, .logo-dot { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-link, .nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: .92rem;
  font-weight: 650;
  transition: color .2s ease, background .2s ease, border-color .2s ease;
}
.nav-link:hover, .nav-link.active { color: var(--text); background: rgba(255,255,255,0.06); }
.nav-btn-outline { border: 1px solid var(--border); }
.nav-btn-filled { color: #041012; background: var(--accent); }
.nav-toggle { display: none; width: 40px; height: 40px; border-radius: var(--radius); background: var(--panel); }
.nav-toggle span { display: block; width: 20px; height: 2px; margin: 5px auto; background: var(--text); transition: transform .2s ease, opacity .2s ease; }
.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 {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: calc(var(--nav-height) + 48px) 20px 56px;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 20%, rgba(61,214,163,.14), transparent 30%),
    radial-gradient(circle at 85% 20%, rgba(85,183,255,.13), transparent 34%),
    linear-gradient(135deg, #071117 0%, #10212a 55%, #0a171d 100%);
}
#particle-canvas { position: absolute; inset: 0; opacity: .7; }
.hero-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, .72fr);
  gap: 52px;
  align-items: center;
}
.hero-content { max-width: 720px; }
.hero-badge, .section-tag, .project-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(61,214,163,.36);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(61,214,163,.08);
  padding: 7px 13px;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.badge-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 18px var(--accent); }
.hero-name {
  margin-top: 22px;
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 1;
  font-weight: 900;
}
.name-highlight {
  color: var(--accent-3);
  text-shadow: 0 12px 50px rgba(246,200,95,.23);
}
.hero-typed-wrapper {
  min-height: 42px;
  margin-top: 18px;
  color: var(--muted);
  font-size: clamp(1.15rem, 3vw, 1.65rem);
  font-weight: 700;
}
.typed-text { color: var(--accent-2); font-family: var(--font-mono); }
.hero-bio {
  max-width: 660px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 1.06rem;
}
.hero-bio strong { color: var(--text); }
.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 500px;
  margin-top: 28px;
}
.hero-metrics div, .portrait-card, .stack-card, .project-card, .timeline-item, .contact-form-wrap, .contact-links a {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.hero-metrics div { padding: 14px 16px; }
.hero-metrics strong { display: block; color: var(--accent); font: 800 1.45rem var(--font-mono); line-height: 1; }
.hero-metrics span { color: var(--muted); font-size: .82rem; }
.hero-cta, .hero-socials { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 12px 18px;
  border-radius: var(--radius);
  font-weight: 800;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { color: #061114; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 16px 40px rgba(61,214,163,.22); }
.btn-secondary, .btn-outline-full { color: var(--text); border: 1px solid var(--border); background: rgba(255,255,255,.04); }
.btn-full { width: 100%; }
.social-icon, #back-to-top, .footer-socials a {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  background: rgba(255,255,255,.05);
  transition: transform .2s ease, border-color .2s ease;
}
.social-icon:hover, .footer-socials a:hover { transform: translateY(-3px); border-color: var(--accent); }
.hero-portrait { position: relative; }
.portrait-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 24px 24px 8px 8px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.18);
  background: var(--panel-strong);
  box-shadow: 0 30px 90px rgba(0,0,0,.45);
}
.portrait-frame::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 38%;
  background: linear-gradient(transparent, rgba(7,17,23,.82));
}
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; }
.portrait-card {
  position: absolute;
  left: -24px;
  right: 24px;
  bottom: 24px;
  padding: 16px;
  backdrop-filter: blur(18px);
}
.portrait-card span { display: block; color: var(--accent); font: 700 .75rem var(--font-mono); text-transform: uppercase; }
.portrait-card strong { display: block; margin-top: 5px; line-height: 1.35; }

section { padding: var(--section-pad); }
#about, #projects, #footer { background: var(--bg-soft); }
.section-container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 46px; }
.section-title { margin-top: 12px; font-size: clamp(2rem, 5vw, 3.3rem); line-height: 1.12; }
.section-divider { width: 64px; height: 3px; margin: 16px auto; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.section-desc { max-width: 620px; margin: 0 auto; color: var(--muted); }
.about-grid, .skills-grid, .contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 42px;
  align-items: start;
}
.about-lead { color: var(--text); font-size: 1.18rem; font-weight: 650; }
.about-text p + p { margin-top: 16px; color: var(--muted); }
.about-panel h3, .skills-col-title { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; color: var(--accent); }
.stack-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stack-card { padding: 18px; box-shadow: none; }
.stack-card i { color: var(--accent-2); font-size: 1.25rem; }
.stack-card h4 { margin-top: 10px; font-size: 1rem; }
.stack-card p { margin-top: 6px; color: var(--muted); font-size: .88rem; line-height: 1.55; }

.skills-column {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--panel);
}
.skill-item + .skill-item { margin-top: 20px; }
.skill-header { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 8px; font-weight: 750; }
.skill-header span:last-child { color: var(--accent); font-family: var(--font-mono); }
.skill-bar { height: 8px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.08); }
.skill-fill { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 1.1s cubic-bezier(.22,.61,.36,1); }
.tech-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 34px; }
.tech-badges span { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 999px; padding: 8px 13px; color: var(--muted); background: var(--panel); font-weight: 700; }

.project-filter { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: -18px 0 30px; }
.filter-btn {
  min-width: 88px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255,255,255,.04);
  font-weight: 800;
}
.filter-btn.active, .filter-btn:hover { color: #061114; background: var(--accent); border-color: var(--accent); }
.projects-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.project-card { display: flex; flex-direction: column; min-height: 360px; padding: 24px; transition: transform .2s ease, border-color .2s ease, opacity .2s ease; }
.project-card:hover { transform: translateY(-5px); border-color: rgba(61,214,163,.45); }
.project-card.hidden { display: none; }
.project-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.project-card-header a { display: grid; place-items: center; width: 38px; height: 38px; border-radius: var(--radius); border: 1px solid var(--border); color: var(--muted); }
.project-icon { color: var(--accent-2); font-size: 1.5rem; }
.project-label { width: fit-content; padding: 5px 10px; margin-bottom: 12px; }
.project-card h3 { font-size: 1.25rem; line-height: 1.25; }
.project-card p { margin: 12px 0 18px; color: var(--muted); }
.project-tags { display: flex; flex-wrap: wrap; gap: 7px; margin: auto 0 20px; }
.project-tags span { padding: 5px 9px; border-radius: 999px; background: rgba(255,255,255,.07); color: var(--muted); font-size: .78rem; font-weight: 750; }
.project-cta { color: var(--accent); font-weight: 850; }
.projects-more { margin-top: 34px; text-align: center; }

.timeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.timeline-item { padding: 22px; box-shadow: none; }
.timeline-item > span { color: var(--accent-3); font: 800 1.1rem var(--font-mono); }
.timeline-item h3 { margin-top: 16px; }
.timeline-item p { margin-top: 8px; color: var(--muted); font-size: .92rem; }

.contact-info h3 { font-size: clamp(1.6rem, 4vw, 2.35rem); line-height: 1.15; }
.contact-info p { margin-top: 16px; color: var(--muted); }
.contact-links { display: grid; gap: 12px; margin-top: 24px; }
.contact-links a { display: flex; align-items: center; gap: 14px; padding: 16px; box-shadow: none; }
.contact-links i { color: var(--accent); font-size: 1.35rem; }
.contact-links strong { display: block; line-height: 1.2; }
.contact-links span { color: var(--muted); }
.contact-form-wrap { padding: 24px; }
.form-group { margin-bottom: 17px; }
.form-group label { display: block; margin-bottom: 7px; color: var(--muted); font-weight: 750; }
.form-group label span { color: var(--accent); }
.form-group input, .form-group textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: 0;
  color: var(--text);
  background: rgba(255,255,255,.045);
  padding: 12px 13px;
}
.form-group textarea { resize: vertical; min-height: 130px; }
.form-group input:focus, .form-group textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(61,214,163,.13); }
.form-group .invalid { border-color: #ff6b7a; }
.form-error { display: block; min-height: 18px; margin-top: 5px; color: #ff8a96; font-size: .82rem; }
.btn-loading { display: none; }
#contact-submit-btn.loading .btn-text { display: none; }
#contact-submit-btn.loading .btn-loading { display: inline-flex; align-items: center; gap: 8px; }
#form-status { display: none; margin-top: 14px; padding: 11px 12px; border-radius: var(--radius); font-weight: 700; }
#form-status.success { display: block; color: var(--accent); border: 1px solid rgba(61,214,163,.3); background: rgba(61,214,163,.09); }
#form-status.error { display: block; color: #ff8a96; border: 1px solid rgba(255,107,122,.3); background: rgba(255,107,122,.09); }

#footer { padding: 42px 20px; border-top: 1px solid var(--border); text-align: center; color: var(--muted); }
.footer-logo { color: var(--text); font-size: 1.35rem; }
.footer-socials, .footer-nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.footer-nav a { color: var(--muted); font-weight: 750; }
.footer-nav a:hover { color: var(--accent); }
#footer small { display: block; margin-top: 18px; color: var(--faint); }
#back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  opacity: 0;
  pointer-events: none;
}
#back-to-top.visible { opacity: 1; pointer-events: auto; }

@media (max-width: 980px) {
  .hero-shell, .about-grid, .skills-grid, .contact-grid { grid-template-columns: 1fr; }
  .hero-content { text-align: center; margin: 0 auto; }
  .hero-cta, .hero-socials { justify-content: center; }
  .hero-metrics { margin-left: auto; margin-right: auto; }
  .hero-portrait { width: min(420px, 100%); margin: 0 auto; }
  .timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  :root { --section-pad: 72px 0; }
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed;
    inset: var(--nav-height) 16px auto;
    display: grid;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(7,17,23,.96);
    box-shadow: var(--shadow);
    transform: translateY(-18px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
  }
  .nav-links.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-link, .nav-btn { width: 100%; justify-content: center; }
  .projects-grid, .timeline, .stack-grid { grid-template-columns: 1fr; }
  .hero-metrics { grid-template-columns: 1fr; }
  .portrait-card { position: static; margin-top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
