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

:root {
  --bg: #f5f7fa;
  --glass: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(0, 0, 0, 0.06);
  --glass-hover: rgba(255, 255, 255, 0.8);
  --accent: #4f46e5;
  --accent-glow: rgba(79, 70, 229, 0.12);
  --accent-solid: rgba(79, 70, 229, 0.15);
  --text: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;
  --radius: 16px;
  --radius-sm: 10px;
  --blur: 16px;
  --max-w: 1100px;
  --nav-h: 64px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
}

body {
  font-family: 'Instrument Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── Animated Gradient Mesh ── */
.mesh {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.mesh__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.5;
  will-change: transform;
}

.mesh__blob--1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, transparent 70%);
  top: -10%;
  left: -5%;
  animation: drift1 20s ease-in-out infinite;
}

.mesh__blob--2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.2) 0%, transparent 70%);
  top: 40%;
  right: -10%;
  animation: drift2 25s ease-in-out infinite;
}

.mesh__blob--3 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.2) 0%, transparent 70%);
  bottom: -10%;
  left: 30%;
  animation: drift3 22s ease-in-out infinite;
}

@keyframes drift1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(80px, 60px) scale(1.1); }
  66% { transform: translate(-40px, 30px) scale(0.95); }
}

@keyframes drift2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-60px, -40px) scale(0.9); }
  66% { transform: translate(40px, -80px) scale(1.05); }
}

@keyframes drift3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(50px, -50px) scale(1.08); }
  66% { transform: translate(-70px, 20px) scale(0.92); }
}

/* ── Glass Panel ── */
.glass-panel {
  background: var(--glass);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 32px;
  transition: background 0.25s, border-color 0.25s, transform 0.25s;
}

.glass-panel--sm {
  padding: 20px 24px;
  border-radius: var(--radius-sm);
}

.glass-panel--accent {
  border-color: rgba(79, 70, 229, 0.15);
}

.glass-panel--solid {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.panel--wide {
  max-width: var(--max-w);
  margin-inline: auto;
}

/* ── Nav ── */
.nav {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100% - 32px), 720px);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  z-index: 100;
}

.nav__logo {
  font-family: 'DM Serif Display', serif;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.nav__links {
  display: flex;
  gap: 8px;
}

.nav__link {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
  cursor: pointer;
}

.nav__link:hover,
.nav__link.active {
  color: var(--text);
  background: rgba(0, 0, 0, 0.05);
}

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav__toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* ── Hero ── */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px 24px 80px;
  max-width: var(--max-w);
  margin-inline: auto;
}

.hero__tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}

.hero__title {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(3.2rem, 10vw, 7rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
}

.hero__sub {
  max-width: 540px;
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 36px;
}

.hero__row {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.hero__links {
  display: flex;
  gap: 12px;
}

.hero__loc {
  font-size: 0.8rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  cursor: pointer;
}

.btn:hover {
  background: var(--glass-hover);
  border-color: rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.btn--solid {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn--solid:hover {
  background: #818cf8;
  border-color: #818cf8;
}

.btn--ghost {
  background: transparent;
  border-color: rgba(0, 0, 0, 0.12);
  color: var(--text);
}

.btn--ghost:hover {
  background: rgba(0, 0, 0, 0.04);
}

/* ── Section shared ── */
section {
  position: relative;
  z-index: 1;
  padding: 80px 24px;
}

.section-header {
  max-width: var(--max-w);
  margin: 0 auto 40px;
}

.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

section h2,
.section-header h2 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 400;
  line-height: 1.15;
}

/* ── About ── */
.about {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: start;
}

.about__text h2 {
  margin-bottom: 16px;
}

.about__text p {
  color: var(--text-muted);
  margin-bottom: 12px;
  max-width: 560px;
}

.about__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.mini-stat {
  text-align: center;
  padding: 20px 16px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
}

.mini-stat__num {
  display: block;
  font-family: 'DM Serif Display', serif;
  font-size: 1.6rem;
  color: var(--accent);
  margin-bottom: 4px;
}

.mini-stat__label {
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* ── Journey ── */
.journey-grid {
  max-width: var(--max-w);
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.journey-pivot {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 0;
}

.journey-pivot::before,
.journey-pivot::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.journey-pivot span {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}

.j-year {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.j-year--light { color: #fff; }

.glass-panel--sm strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.j-co {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.j-co--light { color: rgba(255, 255, 255, 0.8); }

.j-current-role { color: #fff; }

/* ── Projects ── */
.projects-grid {
  max-width: var(--max-w);
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.project {
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.project:hover {
  background: var(--glass-hover);
  border-color: rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.project__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.project__badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-muted);
}

.project__badge--live {
  background: var(--accent);
  color: #fff;
}

.project__arrow {
  font-size: 1.2rem;
  color: var(--text-dim);
  transition: color 0.2s, transform 0.2s;
}

.project:hover .project__arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}

.project h3 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.3rem;
  font-weight: 400;
  margin-bottom: 8px;
}

.project p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
}

.project__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.project__tags span {
  font-size: 0.68rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.06);
  color: var(--text-muted);
}

/* ── Skills ── */
.skills-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 24px;
}

.skills-col h3 {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
  margin-bottom: 8px;
}

.skills-col p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.certs {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--glass-border);
}

.certs h3 {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}

.certs__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.certs__list span {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-glow);
  color: var(--accent);
}

/* ── Contact ── */
.contact {
  text-align: center;
  padding: 56px 32px;
}

.contact__title {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 12px;
}

.contact__sub {
  color: var(--text-muted);
  margin-bottom: 28px;
  font-size: 1rem;
}

.contact__btns {
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* ── Footer ── */
.footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 24px;
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ── Reveal animation ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .mesh__blob { animation: none; }
  .reveal { transition: none; opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav__links {
    position: fixed;
    inset: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(245, 247, 250, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 99;
  }

  .nav__links.open {
    opacity: 1;
    visibility: visible;
  }

  .nav__links .nav__link {
    font-size: 1.1rem;
    padding: 12px 24px;
  }

  .nav__toggle { display: flex; z-index: 101; }

  .nav__toggle.open span:first-child {
    transform: rotate(45deg) translate(2.5px, 2.5px);
  }

  .nav__toggle.open span:last-child {
    transform: rotate(-45deg) translate(2.5px, -2.5px);
  }

  .hero { padding: 100px 20px 60px; min-height: auto; }
  .hero__title { font-size: clamp(2.6rem, 12vw, 4rem); }

  section { padding: 60px 20px; }

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

  .about__stats {
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
  }

  .mini-stat { padding: 14px 8px; }
  .mini-stat__num { font-size: 1.2rem; }

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

  .skills-cols {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .contact__btns { flex-direction: column; align-items: center; }

  .footer { flex-direction: column; gap: 4px; text-align: center; }

  .mesh__blob { opacity: 0.2; }
}

@media (max-width: 480px) {
  .about__stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .skills-cols {
    grid-template-columns: 1fr;
  }

  .journey-grid {
    grid-template-columns: 1fr;
  }
}
