:root {
  --bg: #090d17;
  --bg-alt: #0d1322;
  --surface: #131a2c;
  --surface-hover: #182140;
  --border: #232e4a;
  --border-soft: #1a2340;
  --text: #eef1f9;
  --text-muted: #97a2c2;
  --text-faint: #6b7593;
  --accent: #5b8cff;
  --accent-2: #7fd8c9;
  --accent-soft: rgba(91, 140, 255, 0.14);
  --accent-strong: #7fa6ff;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.55);
  --radius: 16px;
  --radius-sm: 10px;
  --max-width: 1120px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Manrope', var(--font);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--border) var(--bg);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 8%, rgba(91, 140, 255, 0.08), transparent 32%),
    radial-gradient(circle at 88% 4%, rgba(127, 216, 201, 0.06), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.nav-locked { overflow: hidden; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

a { color: inherit; text-decoration: none; }

ul { margin: 0; padding: 0; list-style: none; }

img { max-width: 100%; display: block; }

h1, h2, h3 { font-family: var(--font-display); }

:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(9, 13, 23, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--border);
  background: rgba(9, 13, 23, 0.9);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 72px;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.logo span { color: var(--accent); }

.nav {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-left: auto;
}

.nav a {
  position: relative;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.15s ease;
  padding: 4px 0;
}

.nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -2px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: right 0.25s var(--ease);
}

.nav a:hover { color: var(--text); }
.nav a:hover::after { right: 0; }

.nav-cta-mobile { display: none; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.nav-toggle:hover { background: var(--surface); border-color: var(--border); }

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

.nav-toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-active span:nth-child(2) { opacity: 0; }
.nav-toggle.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-overlay {
  position: fixed;
  inset: 72px 0 0 0;
  background: rgba(4, 6, 12, 0.55);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 45;
}

.nav-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s var(--ease), background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #4f74d6);
  color: #05070f;
  box-shadow: 0 10px 30px -10px rgba(91, 140, 255, 0.55);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 34px -10px rgba(91, 140, 255, 0.7); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  border-color: var(--border);
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
}

.btn-ghost:hover { border-color: var(--accent); color: var(--accent-strong); transform: translateY(-2px); }

.btn-small {
  padding: 9px 20px;
  font-size: 0.85rem;
  background: var(--accent-soft);
  color: var(--accent-strong);
  border: 1px solid transparent;
}

.btn-small:hover { background: var(--accent); color: #05070f; }

/* Hero */

.hero {
  position: relative;
  padding: 150px 0 110px;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 640px;
  background:
    radial-gradient(circle at 18% 30%, rgba(91, 140, 255, 0.22), transparent 45%),
    radial-gradient(circle at 82% 10%, rgba(127, 216, 201, 0.14), transparent 42%);
  filter: blur(10px);
  pointer-events: none;
  z-index: 0;
}

.hero-inner { position: relative; z-index: 1; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-2);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.78rem;
  margin: 0 0 20px;
}

.eyebrow::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(127, 216, 201, 0.18);
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  margin: 0 0 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  background: linear-gradient(135deg, #ffffff 30%, #b9c6ea 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-role {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin: 0 0 26px;
  font-weight: 500;
}

.hero-role .dot { color: var(--accent); margin: 0 8px; }

.hero-pitch {
  max-width: 620px;
  font-size: 1.06rem;
  color: var(--text-muted);
  margin: 0 0 40px;
}

.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* Sections */

section { padding: 100px 0; }

.section-title {
  position: relative;
  display: inline-block;
  font-size: clamp(1.8rem, 3vw, 2.3rem);
  margin: 0 0 44px;
  font-weight: 800;
  letter-spacing: -0.015em;
  padding-bottom: 16px;
}

.section-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 46px;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.section-subtitle {
  margin: -28px 0 44px;
  color: var(--text-muted);
}

.about,
.experience {
  background: var(--bg-alt);
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.about-grid p { color: var(--text-muted); font-size: 1.03rem; margin: 0; }
.about-grid strong { color: var(--text); font-weight: 700; }

/* Skills */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}

.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: border-color 0.2s ease, transform 0.2s var(--ease), background 0.2s ease, box-shadow 0.2s ease;
}

.skill-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  background: var(--surface-hover);
  box-shadow: var(--shadow);
}

.skill-card h3 {
  margin: 0 0 14px;
  font-size: 1rem;
  color: var(--accent-strong);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.skill-card h3::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  flex-shrink: 0;
}

.skill-card ul li {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 8px;
  padding-left: 2px;
}

.skill-card ul li:last-child { margin-bottom: 0; }

/* Experience timeline */

.timeline {
  position: relative;
  margin-left: 8px;
  padding-left: 34px;
  border-left: 2px solid var(--border);
}

.timeline-item { position: relative; padding-bottom: 44px; }

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

.timeline-dot {
  position: absolute;
  left: -41px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 5px var(--accent-soft);
}

.timeline-date {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-strong);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.timeline-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  transition: border-color 0.2s ease, transform 0.2s var(--ease);
}

.timeline-content:hover { border-color: var(--accent); transform: translateX(4px); }

.timeline-content h3 { margin: 0 0 10px; font-size: 1.08rem; font-weight: 700; }

.timeline-content p { margin: 0; color: var(--text-muted); }

/* Projects */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 24px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.25s var(--ease), box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.project-thumb {
  height: 128px;
  background:
    radial-gradient(circle at 25% 15%, rgba(91, 140, 255, 0.28), transparent 55%),
    radial-gradient(circle at 80% 85%, rgba(127, 216, 201, 0.18), transparent 55%),
    var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-bottom: 1px solid var(--border-soft);
}

.project-thumb::after {
  content: attr(data-initials);
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 0.04em;
}

.project-body { padding: 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }

.project-body h3 { margin: 0; font-size: 1.1rem; font-weight: 700; }

.project-tag {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.project-body > p:not(.project-tag) {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.93rem;
  flex: 1;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
}

.project-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  transition: color 0.15s ease;
}

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

.project-link-static {
  color: var(--text-faint);
  cursor: default;
}

.project-link-static:hover { color: var(--text-faint); }

/* Contact */

.contact-inner { text-align: center; }

.contact-email {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 26px 0;
  transition: opacity 0.15s ease;
}

.contact-email:hover { opacity: 0.85; }

.contact-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.contact-social { font-weight: 600; }
.contact-social:hover { color: var(--accent-strong); }

/* Footer */

.site-footer {
  border-top: 1px solid var(--border-soft);
  padding: 30px 0;
}

.site-footer p {
  margin: 0;
  color: var(--text-faint);
  font-size: 0.85rem;
  text-align: center;
}

/* Scroll reveal */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.skills-grid .skill-card.reveal,
.projects-grid .project-card.reveal {
  transition-delay: calc(var(--i, 0) * 60ms);
}

.skills-grid .skill-card:nth-child(1) { --i: 1; }
.skills-grid .skill-card:nth-child(2) { --i: 2; }
.skills-grid .skill-card:nth-child(3) { --i: 3; }
.skills-grid .skill-card:nth-child(4) { --i: 4; }
.skills-grid .skill-card:nth-child(5) { --i: 5; }
.skills-grid .skill-card:nth-child(6) { --i: 6; }
.skills-grid .skill-card:nth-child(7) { --i: 7; }
.skills-grid .skill-card:nth-child(8) { --i: 8; }

.projects-grid .project-card:nth-child(1) { --i: 1; }
.projects-grid .project-card:nth-child(2) { --i: 2; }
.projects-grid .project-card:nth-child(3) { --i: 3; }
.projects-grid .project-card:nth-child(4) { --i: 4; }
.projects-grid .project-card:nth-child(5) { --i: 5; }
.projects-grid .project-card:nth-child(6) { --i: 6; }
.projects-grid .project-card:nth-child(7) { --i: 7; }
.projects-grid .project-card:nth-child(8) { --i: 8; }

/* Responsive */

@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-cta:not(.nav-cta-mobile) { display: none; }
  .nav-toggle { display: flex; }

  .nav {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    margin-left: 0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 10px 24px 20px;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s var(--ease), opacity 0.2s ease;
  }

  .nav.nav-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav a {
    padding: 14px 4px;
    border-bottom: 1px solid var(--border-soft);
    font-size: 1rem;
  }

  .nav a::after { display: none; }
  .nav a:last-of-type { border-bottom: none; }

  .nav-cta-mobile {
    display: inline-flex;
    margin-top: 14px;
    align-self: flex-start;
  }

  .hero { padding: 116px 0 76px; }
  section { padding: 68px 0; }
}

@media (max-width: 480px) {
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
}
