:root {
  --bg: #0a0e13;
  --surface: #111720;
  --surface-2: #161e28;
  --border: #223040;
  --border-soft: #1a2432;
  --text: #e8eef4;
  --muted: #93a1b0;
  --accent: #35d6c0;
  --accent-dim: rgba(53, 214, 192, 0.12);
  --link: #7aa2f7;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --container: 1100px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section-y: clamp(4rem, 9vw, 7.5rem);
  --radius: 14px;
  --header-h: 68px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 700;
}

p {
  margin: 0 0 1rem;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--link);
  text-decoration-color: rgba(122, 162, 247, 0.4);
  text-underline-offset: 3px;
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
}

a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

img {
  max-width: 100%;
  height: auto;
}

ul {
  margin: 0;
  padding: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -110%);
  z-index: 100;
  padding: 0.7rem 1.25rem;
  background-color: var(--accent);
  color: #04120f;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 10px 10px;
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translate(-50%, 0);
  color: #04120f;
}

/* Header */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.site-header.is-stuck {
  background-color: rgba(10, 14, 19, 0.82);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom-color: var(--border-soft);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.brand:hover {
  color: var(--text);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background-color: var(--accent-dim);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.primary-nav ul {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 1.75rem);
  list-style: none;
}

.primary-nav a {
  position: relative;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
}

.primary-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 2px;
  background-color: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s ease;
}

.primary-nav a:hover,
.primary-nav a.is-active {
  color: var(--text);
}

.primary-nav a.is-active::after,
.primary-nav a:hover::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background-color: var(--surface);
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background-color: var(--text);
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.nav-toggle[aria-expanded='true'] .nav-toggle-bar:first-child {
  transform: translateY(4px) rotate(45deg);
}

.nav-toggle[aria-expanded='true'] .nav-toggle-bar:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

/* Hero */

.hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: min(88svh, 780px);
  padding: calc(var(--header-h) + 3rem) 0 4rem;
  overflow: hidden;
  border-bottom: 1px solid var(--border-soft);
  text-align: center;
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 18% 22%, rgba(53, 214, 192, 0.16), transparent 42%),
    radial-gradient(circle at 82% 12%, rgba(122, 162, 247, 0.14), transparent 45%),
    radial-gradient(circle at 62% 88%, rgba(53, 214, 192, 0.09), transparent 50%),
    radial-gradient(circle, rgba(255, 255, 255, 0.07) 1px, transparent 1.2px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 34px 34px;
  animation: drift 24s ease-in-out infinite alternate;
}

.hero-backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, var(--bg) 100%);
}

@keyframes drift {
  from {
    background-position: 0 0, 0 0, 0 0, 0 0;
  }
  to {
    background-position: 4% 3%, -3% 4%, 3% -3%, 34px 34px;
  }
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-avatar {
  width: clamp(96px, 12vw, 128px);
  height: clamp(96px, 12vw, 128px);
  margin-bottom: 1.75rem;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--accent);
  padding: 4px;
  background-color: var(--surface);
  box-shadow: 0 0 0 8px rgba(53, 214, 192, 0.06), 0 18px 50px rgba(0, 0, 0, 0.5);
}

.hero h1 {
  font-size: clamp(2.25rem, 1.4rem + 4.2vw, 3.75rem);
  margin-bottom: 1rem;
}

.hero-tagline {
  max-width: 60ch;
  margin: 0 auto 0.85rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: clamp(0.8rem, 0.74rem + 0.3vw, 0.95rem);
  letter-spacing: 0.02em;
  line-height: 1.8;
}

.hero-tagline span {
  white-space: nowrap;
}

.hero-meta {
  color: var(--muted);
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.6rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background-color: var(--accent);
  color: #04120f;
}

.btn-primary:hover {
  background-color: #55e3cf;
  color: #04120f;
}

.btn-ghost {
  border-color: var(--border);
  background-color: var(--surface);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Sections */

.section {
  padding: var(--section-y) 0;
  border-bottom: 1px solid var(--border-soft);
}

.section-label {
  margin-bottom: 0.75rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-heading {
  max-width: 24ch;
  margin-bottom: 2.75rem;
  font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.35rem);
}

.section-intro {
  max-width: 60ch;
  margin-top: -1.75rem;
  margin-bottom: 2.5rem;
  color: var(--muted);
}

.panel {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--surface);
}

.panel-label {
  margin-bottom: 0.6rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* About */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.about-copy p {
  color: var(--muted);
  max-width: 62ch;
}

.about-copy .lede {
  color: var(--text);
  font-size: clamp(1.1rem, 1rem + 0.4vw, 1.3rem);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.panel-body {
  color: var(--muted);
  font-size: 0.95rem;
}

.facts {
  margin: 1.5rem 0 0;
}

.fact {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--border-soft);
}

.fact dt {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding-top: 0.2rem;
}

.fact dd {
  margin: 0;
  font-size: 0.95rem;
  overflow-wrap: break-word;
}

/* Skills */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.skill-group--wide {
  grid-column: 1 / -1;
}

.skill-group {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--surface);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.skill-group:hover {
  border-color: rgba(53, 214, 192, 0.45);
  transform: translateY(-3px);
}

.skill-group h3 {
  margin-bottom: 1.1rem;
  font-size: 1.05rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
}

.tags li {
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background-color: var(--surface-2);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.01em;
}

/* Experience */

.timeline {
  list-style: none;
  display: grid;
  gap: 1.25rem;
}

.role {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--surface);
  position: relative;
  overflow: hidden;
}

.role::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), rgba(53, 214, 192, 0));
  opacity: 0.6;
}

.role-eyebrow {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.role-company {
  font-size: 1.3rem;
}

.role-affiliation {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.role-title {
  margin: 0.5rem 0 0.75rem;
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 600;
}

.role-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
}

.role-dates {
  color: var(--text);
}

.role-body ul {
  display: grid;
  gap: 0.85rem;
  list-style: none;
}

.role-body li {
  position: relative;
  padding-left: 1.35rem;
  color: var(--muted);
  font-size: 0.97rem;
}

.role-body li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background-color: var(--accent);
  opacity: 0.75;
}

/* Selected work */

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.work-card {
  display: flex;
  flex-direction: column;
  padding: 1.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--surface);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.work-card:hover {
  border-color: rgba(53, 214, 192, 0.45);
  transform: translateY(-3px);
}

.work-card h3 {
  font-size: 1.15rem;
}

.work-card h3 a {
  color: var(--text);
  text-decoration: none;
}

.work-card h3 a::after {
  content: ' \2197';
  color: var(--accent);
  font-size: 0.85em;
}

.work-card h3 a:hover {
  color: var(--accent);
}

.work-org {
  margin: 0.4rem 0 1rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.work-card > p:not(.work-org) {
  color: var(--muted);
  font-size: 0.95rem;
}

.work-card .tags {
  margin-top: auto;
  padding-top: 1.25rem;
}

/* Education */

.education h3 {
  font-size: 1.15rem;
}

.education-school {
  margin: 0.5rem 0 0;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
}

/* Contact */

.section-contact {
  border-bottom: none;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

/* Footer */

.site-footer {
  padding: 2rem 0 2.5rem;
  border-top: 1px solid var(--border-soft);
  background-color: var(--surface);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-inner p {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.footer-top {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-decoration: none;
}

/* Reveal on scroll */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Responsive */

@media (max-width: 900px) {
  .about-grid,
  .role {
    grid-template-columns: minmax(0, 1fr);
  }

  .role-meta {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .skills-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .nav-toggle {
    display: flex;
  }

  .primary-nav {
    position: fixed;
    inset: var(--header-h) 0 auto;
    max-height: 0;
    overflow: hidden;
    background-color: rgba(10, 14, 19, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: max-height 0.28s ease, border-color 0.28s ease;
  }

  .primary-nav.is-open {
    max-height: 70svh;
    border-bottom-color: var(--border);
  }

  .primary-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem var(--gutter) 1.25rem;
  }

  .primary-nav li + li {
    border-top: 1px solid var(--border-soft);
  }

  .primary-nav a {
    display: block;
    padding: 0.9rem 0;
    font-size: 0.85rem;
  }

  .primary-nav a::after {
    display: none;
  }

  .hero {
    min-height: auto;
    padding-top: calc(var(--header-h) + 2.5rem);
  }

  .work-grid,
  .skills-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

@media print {
  .site-header,
  .nav-toggle,
  .hero-backdrop,
  .hero-actions,
  .site-footer {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
