:root {
  --bg: #FAFCFE;
  --surface: #FFFFFF;
  --ink: #16283B;
  --muted: #5B6B7E;
  --azure: #0078D4;
  --azure-deep: #005A9E;
  --azure-tint: #EAF4FD;
  --border: #E3EAF2;
  --sans: 'Inter', sans-serif;
  --disp: 'Sora', sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --nav-h: 60px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box
}

html {
  scroll-behavior: smooth
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65
}

body.nav-open {
  overflow: hidden
}

.wrap {
  max-width: 1020px;
  margin: 0 auto;
  padding: 0 24px
}

a {
  color: var(--azure);
  text-decoration: none
}

a:hover {
  color: var(--azure-deep)
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--azure);
  outline-offset: 3px;
  border-radius: 4px
}

h2 {
  font-family: var(--disp);
  font-size: clamp(1.35rem, 3vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -.01em
}

/* ===== NAV ===== */
nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 252, 254, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border)
}

.nav-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  position: relative
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none
}

.logo-link:hover {
  color: var(--ink)
}

.logo img {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain
}

.logo-text {
  font-family: var(--disp);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink)
}

.nav-links {
  display: flex;
  gap: 26px
}

.nav-links a {
  font-size: .86rem;
  font-weight: 500;
  color: var(--muted)
}

.nav-links a:hover {
  color: var(--azure)
}

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  width: 44px;
  height: 44px;
  cursor: pointer;
  padding: 10px;
  border-radius: 8px
}

.hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
  transition: transform .25s ease, opacity .2s ease
}

.hamburger {
  position: relative
}

.hamburger::before,
.hamburger::after {
  content: "";
  position: absolute;
  left: 0
}

.hamburger::before {
  top: -7px
}

.hamburger::after {
  top: 7px
}

.nav-toggle[aria-expanded="true"] .hamburger {
  background: transparent
}

.nav-toggle[aria-expanded="true"] .hamburger::before {
  top: 0;
  transform: rotate(45deg)
}

.nav-toggle[aria-expanded="true"] .hamburger::after {
  top: 0;
  transform: rotate(-45deg)
}

@media (max-width:820px) {
  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 12px 24px 20px;
    gap: 4px;
    box-shadow: 0 12px 28px rgba(22, 40, 59, .08)
  }

  .nav-links.open {
    display: flex
  }

  .nav-links a {
    padding: 12px 8px;
    font-size: .95rem;
    border-radius: 8px
  }

  .nav-links a:hover {
    background: var(--azure-tint)
  }
}

/* ===== HERO ===== */
.hero {
  padding: 72px 0 56px;
  position: relative;
  overflow: hidden
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 40px;
  place-items: center
}

.hero-copy {
  will-change: transform, opacity;
  transition: none
}

.profile-content {
  width: clamp(14rem, 38vw, 22rem);
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 16px 40px rgba(0, 120, 212, .12)
}

.profile-content img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--azure-deep);
  background: var(--azure-tint);
  padding: 7px 14px;
  border-radius: 100px;
  margin-bottom: 18px
}

.kicker::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--azure)
}

h1 {
  font-family: var(--disp);
  font-size: clamp(2.3rem, 5.5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.02em
}

h1 em {
  font-style: normal;
  color: var(--azure)
}

.lede {
  margin: 18px 0 28px;
  font-size: 1.06rem;
  color: var(--muted);
  max-width: 46ch
}

.cta-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap
}

.btn {
  font-family: var(--disp);
  font-weight: 600;
  font-size: .92rem;
  padding: 13px 26px;
  border-radius: 10px;
  display: inline-block;
  transition: transform .15s ease, box-shadow .15s ease
}

.btn-primary {
  background: var(--azure);
  color: #fff;
  box-shadow: 0 6px 18px rgba(0, 120, 212, .28)
}

.btn-primary:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 120, 212, .34)
}

.btn-ghost {
  border: 1.5px solid var(--border);
  color: var(--ink);
  background: var(--surface)
}

.btn-ghost:hover {
  border-color: var(--azure);
  color: var(--azure)
}

/* Hero staggered entrance */
.hero-anim {
  opacity: 0;
  transform: translateY(18px);
  animation: heroIn .7s ease forwards;
  animation-delay: calc(var(--d, 0) * 110ms)
}

@keyframes heroIn {
  to {
    opacity: 1;
    transform: none
  }
}

/* Diagram */
.diagram {
  position: relative;
  margin-top: 28px
}

.diagram svg {
  width: 100%;
  height: auto;
  display: block
}

.node-label {
  font-family: var(--mono);
  font-size: 9.5px;
  fill: var(--muted)
}

.flow {
  stroke: var(--azure);
  stroke-width: 1.5;
  fill: none;
  opacity: .5;
  stroke-dasharray: 6 7;
  animation: flow 2.6s linear infinite
}

@keyframes flow {
  to {
    stroke-dashoffset: -13
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto
  }

  .flow {
    animation: none
  }

  .hero-anim {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important
  }

  .fade,
  .fade-stagger {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important
  }

  #hero-copy {
    transform: none !important;
    opacity: 1 !important
  }
}

@media (max-width:820px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 32px
  }

  .diagram {
    max-width: 420px;
    margin-inline: auto
  }

  .profile-content {
    order: -1;
    width: clamp(12rem, 55vw, 18rem)
  }
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 48px
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease
}

.stat:hover {
  border-color: var(--azure);
  box-shadow: 0 6px 18px rgba(0, 120, 212, .1);
  transform: translateY(-2px)
}

.stat b {
  font-family: var(--disp);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--azure);
  display: block;
  line-height: 1.2
}

.stat span {
  font-size: .82rem;
  color: var(--muted)
}

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

/* ===== SECTIONS ===== */
section {
  padding: 60px 0 4px;
  scroll-margin-top: calc(var(--nav-h) + 16px)
}

.sec-head {
  margin-bottom: 30px
}

.sec-tag {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--azure);
  display: block;
  margin-bottom: 8px
}

/* About */
.about p {
  color: var(--muted);
  max-width: 68ch;
  margin-bottom: 14px
}

.about strong {
  color: var(--ink);
  font-weight: 600
}

/* Experience timeline */
.timeline {
  border-left: 2px solid var(--border);
  margin-left: 6px
}

.t-item {
  position: relative;
  padding: 0 0 36px 34px
}

.t-item:last-child {
  padding-bottom: 8px
}

.t-item::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--azure)
}

.t-when {
  font-family: var(--mono);
  font-size: .74rem;
  color: var(--azure-deep);
  letter-spacing: .05em
}

.t-item h3 {
  font-family: var(--disp);
  font-size: 1.12rem;
  font-weight: 600;
  margin: 6px 0 2px
}

.t-co {
  font-size: .9rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 10px
}

.t-item p {
  color: var(--muted);
  font-size: .95rem;
  max-width: 66ch
}

/* Projects */
.projects {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease
}

.project-card:hover {
  border-color: var(--azure);
  box-shadow: 0 10px 28px rgba(0, 120, 212, .12);
  transform: translateY(-4px)
}

.project-tag {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--azure-deep);
  background: var(--azure-tint);
  padding: 4px 10px;
  border-radius: 100px;
  align-self: flex-start
}

.project-card h3 {
  font-family: var(--disp);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3
}

.project-card p {
  font-size: .92rem;
  color: var(--muted);
  flex: 1
}

@media (max-width:900px) {
  .projects {
    grid-template-columns: 1fr
  }
}

/* Skills */
.skills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px
}

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

.skill-card:hover {
  border-color: var(--azure);
  box-shadow: 0 8px 22px rgba(0, 120, 212, .1);
  transform: translateY(-3px)
}

.skill-card h3 {
  font-family: var(--disp);
  font-size: .95rem;
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px
}

.skill-card h3 svg {
  width: 18px;
  height: 18px;
  stroke: var(--azure);
  flex-shrink: 0
}

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

.tag {
  font-size: .8rem;
  font-weight: 500;
  color: var(--azure-deep);
  background: var(--azure-tint);
  padding: 5px 12px;
  border-radius: 100px
}

@media (max-width:760px) {
  .skills {
    grid-template-columns: 1fr
  }
}

/* Certifications */
.certs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
  gap: 12px
}

.cert {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease
}

.cert:hover {
  border-color: var(--azure);
  box-shadow: 0 6px 18px rgba(0, 120, 212, .1);
  transform: translateY(-2px)
}

.badge {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--azure-tint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: .6rem;
  font-weight: 500;
  color: var(--azure-deep)
}

.cert.gold .badge {
  background: #FFF4DE;
  color: #9A6B00
}

.cert small {
  font-size: .68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .1em;
  display: block
}

.cert p {
  font-weight: 600;
  font-size: .9rem;
  line-height: 1.35;
  margin-top: 2px
}

/* Education */
.edu {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px
}

.edu-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease
}

.edu-card:hover {
  border-color: var(--azure);
  box-shadow: 0 6px 18px rgba(0, 120, 212, .08);
  transform: translateY(-2px)
}

.edu-card .yrs {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--azure-deep)
}

.edu-card h3 {
  font-family: var(--disp);
  font-size: 1.02rem;
  font-weight: 600;
  margin: 8px 0 4px
}

.edu-card p {
  font-size: .9rem;
  color: var(--muted)
}

@media (max-width:700px) {
  .edu {
    grid-template-columns: 1fr
  }
}

/* Contact */
.contact-band {
  margin: 72px 0 0;
  background: linear-gradient(135deg, var(--azure) 0%, var(--azure-deep) 100%);
  border-radius: 22px;
  padding: 52px 48px;
  color: #fff;
  text-align: center;
  scroll-margin-top: calc(var(--nav-h) + 16px)
}

.contact-band h2 {
  color: #fff;
  margin-bottom: 10px
}

.contact-band p {
  opacity: .85;
  max-width: 52ch;
  margin: 0 auto 28px
}

.contact-links {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap
}

.contact-links a {
  font-weight: 600;
  font-size: .9rem;
  color: var(--azure-deep);
  background: #fff;
  padding: 12px 24px;
  border-radius: 10px;
  transition: transform .15s ease
}

.contact-links a:hover {
  transform: translateY(-2px);
  color: var(--azure-deep)
}

.contact-links a.outline {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, .55)
}

.contact-links a.outline:hover {
  color: #fff;
  background: rgba(255, 255, 255, .1)
}

@media (max-width:600px) {
  .contact-band {
    padding: 40px 24px
  }
}

/* Footer */
footer {
  padding: 36px 0 44px;
  font-size: .8rem;
  color: var(--muted)
}

.footer-in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: center
}

.footer-links {
  display: flex;
  gap: 18px
}

.footer-links a {
  color: var(--muted);
  font-weight: 500
}

.footer-links a:hover {
  color: var(--azure)
}

@media (max-width:560px) {
  .footer-in {
    flex-direction: column
  }
}

/* Reveal animations */
.fade {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .65s ease, transform .65s ease
}

.fade.in {
  opacity: 1;
  transform: none
}

.fade-stagger {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .55s ease, transform .55s ease
}

.fade-stagger.in {
  opacity: 1;
  transform: none
}
