/* ─── Design Tokens ─── */
:root {
  --bg:            #07090F;
  --surface:       #0D1626;
  --card:          #111927;
  --accent:        #22D3EE;
  --accent-dim:    rgba(34, 211, 238, 0.08);
  --accent-border: rgba(34, 211, 238, 0.18);
  --amber:         #F59E0B;
  --text:          #F0F4F8;
  --muted:         #5E7084;
  --border:        rgba(255, 255, 255, 0.06);
  --radius:        12px;
}

/* ─── Reset & Base ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

/* ─── Blueprint Grid Background ─── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
  z-index: -1;
}

/* ─── Liquid Blob / Shader Background ─── */
.liquid-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
  filter: blur(72px) saturate(160%);
}
.liquid-blob {
  position: absolute;
  border-radius: 50%;
  will-change: transform, border-radius;
}

.lb-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle at 40% 40%, rgba(34,211,238,0.22), rgba(34,211,238,0.06) 60%, transparent 80%);
  top: -180px; left: -120px;
  animation: morph-1 20s ease-in-out infinite, drift-1 24s ease-in-out infinite;
}
.lb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle at 55% 55%, rgba(245,158,11,0.18), rgba(245,158,11,0.05) 60%, transparent 80%);
  bottom: -140px; right: -100px;
  animation: morph-2 26s ease-in-out infinite, drift-2 30s ease-in-out infinite;
}
.lb-3 {
  width: 420px; height: 420px;
  background: radial-gradient(circle at 50% 50%, rgba(34,211,238,0.14), rgba(34,211,238,0.04) 60%, transparent 80%);
  top: 35%; right: 5%;
  animation: morph-3 18s ease-in-out infinite, drift-3 22s ease-in-out infinite;
}
.lb-4 {
  width: 380px; height: 380px;
  background: radial-gradient(circle at 45% 45%, rgba(99,102,241,0.14), rgba(99,102,241,0.04) 60%, transparent 80%);
  top: 50%; left: 5%;
  animation: morph-4 22s ease-in-out infinite, drift-4 28s ease-in-out infinite;
}
.lb-5 {
  width: 280px; height: 280px;
  background: radial-gradient(circle at 50% 50%, rgba(245,158,11,0.12), rgba(245,158,11,0.03) 60%, transparent 80%);
  top: 10%; right: 20%;
  animation: morph-2 14s ease-in-out infinite reverse, drift-5 18s ease-in-out infinite;
}

@keyframes morph-1 {
  0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
  25%       { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
  50%       { border-radius: 50% 40% 60% 30% / 40% 70% 30% 60%; }
  75%       { border-radius: 40% 70% 40% 60% / 60% 40% 60% 30%; }
}
@keyframes morph-2 {
  0%, 100% { border-radius: 40% 60% 55% 45% / 50% 40% 60% 50%; }
  25%       { border-radius: 55% 45% 40% 60% / 40% 60% 50% 40%; }
  50%       { border-radius: 65% 35% 50% 50% / 35% 65% 40% 60%; }
  75%       { border-radius: 35% 65% 60% 40% / 60% 35% 65% 40%; }
}
@keyframes morph-3 {
  0%, 100% { border-radius: 70% 30% 50% 50% / 40% 60% 40% 60%; }
  33%       { border-radius: 40% 60% 30% 70% / 60% 40% 70% 30%; }
  66%       { border-radius: 50% 50% 60% 40% / 30% 70% 50% 50%; }
}
@keyframes morph-4 {
  0%, 100% { border-radius: 45% 55% 65% 35% / 55% 45% 35% 65%; }
  30%       { border-radius: 65% 35% 45% 55% / 35% 65% 55% 45%; }
  60%       { border-radius: 35% 65% 55% 45% / 65% 35% 45% 55%; }
}
@keyframes drift-1 {
  0%, 100% { transform: translate(0px, 0px)    scale(1);    }
  25%       { transform: translate(60px, 40px)  scale(1.06); }
  50%       { transform: translate(30px, 80px)  scale(0.96); }
  75%       { transform: translate(-40px, 50px) scale(1.03); }
}
@keyframes drift-2 {
  0%, 100% { transform: translate(0px, 0px)     scale(1);    }
  25%       { transform: translate(-50px, -40px) scale(1.05); }
  50%       { transform: translate(-80px, 20px)  scale(0.94); }
  75%       { transform: translate(-30px, -60px) scale(1.08); }
}
@keyframes drift-3 {
  0%, 100% { transform: translate(0px, 0px)    scale(1);    }
  33%       { transform: translate(-60px, 60px) scale(1.07); }
  66%       { transform: translate(40px, 90px)  scale(0.95); }
}
@keyframes drift-4 {
  0%, 100% { transform: translate(0px, 0px)    scale(1);    }
  25%       { transform: translate(70px, -50px) scale(1.04); }
  50%       { transform: translate(40px, -90px) scale(0.97); }
  75%       { transform: translate(80px, -40px) scale(1.06); }
}
@keyframes drift-5 {
  0%, 100% { transform: translate(0px, 0px)    scale(1);    }
  40%       { transform: translate(-50px, 60px) scale(1.08); }
  80%       { transform: translate(30px, 30px)  scale(0.93); }
}

/* ─── Scroll Progress Bar ─── */
#progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--amber));
  z-index: 200;
  transition: width 0.1s linear;
}

/* ─── Navbar ─── */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.25rem 2rem;
  transition: transform 0.3s ease, background 0.3s ease, border-bottom 0.3s ease;
}

#navbar.scrolled {
  background: rgba(7, 9, 15, 0.88);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
}

#navbar.nav-hidden {
  transform: translateY(-100%);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.nav-logo span { color: var(--accent); }

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.2s;
  position: relative;
}

.nav-links a::before {
  content: '//';
  color: var(--accent);
  margin-right: 4px;
  opacity: 0;
  transition: opacity 0.2s;
  font-size: 0.72rem;
}

.nav-links a:hover { color: var(--text); }
.nav-links a:hover::before { opacity: 1; }

.hamburger {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px; height: 36px;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s;
}
.hamburger:hover { border-color: var(--accent-border); }

.mobile-menu {
  display: none;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-top: 0.75rem;
  gap: 1rem;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  color: var(--muted);
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  transition: color 0.2s;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--border);
}
.mobile-menu a:last-child { border-bottom: none; }
.mobile-menu a:hover { color: var(--accent); }

@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
}

/* ─── Section Skeleton ─── */
.section-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 6rem 2rem;
}

.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  display: block;
}

.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 4.5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1rem;
}
.section-title .accent { color: var(--accent); }

/* ─── Reveal Animations ─── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.rd1 { transition-delay: 0.08s; }
.rd2 { transition-delay: 0.16s; }
.rd3 { transition-delay: 0.24s; }
.rd4 { transition-delay: 0.32s; }
.rd5 { transition-delay: 0.40s; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.6rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.88rem;
  border-radius: 9px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s, border-color 0.2s;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--accent);
  color: #07090F;
  border: none;
}
.btn-primary:hover { box-shadow: 0 8px 28px rgba(34, 211, 238, 0.28); }

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

/* ─── Hero ─── */
#home {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 8rem 2rem 4rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 5rem;
}

.hero-greeting {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-bottom: 1.1rem;
}

.hero-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(3rem, 6.5vw, 5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  color: var(--text);
}

.hero-role {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.1rem, 2.5vw, 1.55rem);
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 1.6rem;
  min-height: 2.2rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.hero-role-typed { color: var(--accent); }

.cursor-blink {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  background: var(--accent);
  border-radius: 2px;
  animation: blink 0.9s step-end infinite;
}

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

.hero-bio {
  max-width: 500px;
  color: var(--muted);
  line-height: 1.85;
  margin-bottom: 2.25rem;
  font-size: 0.97rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 2.75rem;
}

.hero-socials {
  display: flex;
  gap: 0.75rem;
}

.social-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}
.social-pill:hover {
  border-color: var(--accent-border);
  color: var(--accent);
  transform: translateY(-3px);
}

/* ─── Profile Image ─── */
.profile-wrap {
  position: relative;
  flex-shrink: 0;
}

.profile-frame {
  position: relative;
  width: 270px;
  height: 330px;
  border-radius: 20px;
  padding: 2px;
  background: linear-gradient(145deg, var(--accent), rgba(34,211,238,0.15) 50%, var(--amber));
}

.profile-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 18px;
  display: block;
  background: var(--surface);
}

.profile-frame .img-fallback {
  width: 100%;
  height: 100%;
  border-radius: 18px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 3rem;
}

.profile-frame .img-fallback span {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.profile-badge {
  position: absolute;
  bottom: -14px;
  right: -14px;
  background: var(--card);
  border: 1px solid var(--accent-border);
  border-radius: 10px;
  padding: 0.7rem 1rem;
  z-index: 2;
}
.profile-badge p {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--muted);
  margin-bottom: 0.15rem;
}
.profile-badge strong {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.badge-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #4ADE80;
  box-shadow: 0 0 8px #4ADE8080;
  display: inline-block;
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.3); opacity: 0.7; }
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }
  .profile-wrap { order: -1; margin: 0 auto; }
  .hero-bio { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .hero-socials { justify-content: center; }
  .profile-frame { width: 220px; height: 270px; }
}

/* ─── About ─── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
  margin-top: 2.5rem;
}

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

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  transition: border-color 0.2s, transform 0.2s;
}
.stat-card:hover {
  border-color: var(--accent-border);
  transform: translateY(-4px);
}
.stat-number {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.4rem;
}

@media (max-width: 768px) {
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
}

/* ─── Skills ─── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
  margin-top: 2.5rem;
}

.skill-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
  cursor: default;
}
.skill-card:hover {
  border-color: var(--accent-border);
  transform: translateY(-6px);
  box-shadow: 0 16px 36px rgba(34, 211, 238, 0.07);
}
.skill-card i { font-size: 2.1rem; }
.skill-card span {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* ─── Experience ─── */
.timeline {
  position: relative;
  margin-top: 2.5rem;
  padding-left: 2.5rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent), rgba(34,211,238,0.05));
}

.timeline-item {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.25rem;
  transition: border-color 0.2s, transform 0.2s;
}
.timeline-item:hover {
  border-color: var(--accent-border);
  transform: translateX(4px);
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -2.9rem; top: 1.6rem;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(34,211,238,0.5);
}

.timeline-period {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}
.timeline-role {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.timeline-org {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ─── Projects ─── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 1.4rem;
  margin-top: 2.5rem;
}

.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.project-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent-border);
  box-shadow: 0 20px 50px rgba(34, 211, 238, 0.07);
}

.project-thumb {
  width: 100%;
  height: 190px;
  object-fit: cover;
  display: block;
}
.project-thumb-placeholder {
  width: 100%;
  height: 190px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--card) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 2.5rem;
  border-bottom: 1px solid var(--border);
}

.project-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.project-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.project-desc {
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 1rem;
  flex: 1;
}
.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}
.tech-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  padding: 0.2rem 0.55rem;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  border-radius: 4px;
  letter-spacing: 0.04em;
}
.project-links {
  display: flex;
  gap: 0.65rem;
}
.project-link {
  font-size: 0.8rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  padding: 0.4rem 1rem;
  border-radius: 7px;
  text-decoration: none;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.project-link.live {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}
.project-link.live:hover {
  background: var(--accent);
  color: #07090F;
}
.project-link.source {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.project-link.source:hover {
  color: var(--text);
  border-color: rgba(255,255,255,0.15);
}

/* ─── Contact ─── */
.contact-center {
  max-width: 580px;
  margin: 0 auto;
  text-align: center;
}
.contact-desc {
  color: var(--muted);
  margin: 0.75rem 0 2rem;
  line-height: 1.85;
  font-size: 0.97rem;
}
.contact-email-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2.5rem;
  background: var(--accent);
  color: #07090F;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.97rem;
  border-radius: 10px;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  margin-bottom: 2.5rem;
}
.contact-email-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 40px rgba(34, 211, 238, 0.3);
}

.contact-socials {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.contact-social {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.84rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  transition: all 0.2s;
}
.contact-social:hover {
  border-color: var(--accent-border);
  color: var(--accent);
  transform: translateY(-2px);
}

/* ─── Section divider ─── */
.section-divider {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}
.section-divider hr {
  border: none;
  height: 1px;
  background: var(--border);
}

/* ─── Footer ─── */
footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
  font-family: 'JetBrains Mono', monospace;
}
footer .accent { color: var(--accent); }

/* ─── Floating Profile Photo ─── */
.profile-wrap {
  animation: photo-float 5s ease-in-out infinite;
}

@keyframes photo-float {
  0%, 100% { transform: translateY(0px);    }
  25%       { transform: translateY(-12px);  }
  50%       { transform: translateY(-20px);  }
  75%       { transform: translateY(-10px);  }
}