:root {
  --bg: #07090d;
  --panel: rgba(12, 16, 24, 0.82);
  --ink: #eef3f8;
  --muted: #8b97a8;
  --soft: #b7c2d0;
  --line: rgba(238, 243, 248, 0.1);
  --accent: #3ecfbe;
  --accent-2: #ff7a45;
  --font-display: "Syne", system-ui, sans-serif;
  --font-body: "Space Grotesk", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --max: 1100px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#canvas3d {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 70% 40%, transparent 10%, rgba(7, 9, 13, 0.55) 70%),
    linear-gradient(90deg, rgba(7, 9, 13, 0.75) 0%, transparent 45%, transparent 70%, rgba(7, 9, 13, 0.35) 100%);
}

.site-header,
main,
.site-footer,
.mobile-nav {
  position: relative;
  z-index: 2;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem clamp(1.2rem, 4vw, 2.75rem);
  backdrop-filter: blur(14px);
  background: rgba(7, 9, 13, 0.55);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease;
}

.site-header.scrolled {
  border-bottom-color: var(--line);
}

.logo {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.04em;
  font-size: 1.15rem;
}

.nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav a {
  font-size: 0.9rem;
  color: var(--soft);
  transition: color 0.2s ease;
}

.nav a:hover {
  color: var(--ink);
}

.nav-cta {
  color: var(--bg) !important;
  background: var(--accent);
  padding: 0.45rem 0.9rem;
  font-weight: 600;
}

.nav-cta:hover {
  background: #2fb8a9;
  color: var(--bg) !important;
}

.menu-toggle {
  display: none;
  width: 2.4rem;
  height: 2.4rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.menu-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ink);
}

.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 15;
  background: rgba(7, 9, 13, 0.96);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1.35rem;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 6vw, 2.4rem);
  font-weight: 700;
}

.mobile-nav[hidden] {
  display: none;
}

.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6.5rem clamp(1.2rem, 4vw, 2.75rem) 3rem;
  max-width: var(--max);
}

.hero-copy {
  max-width: 40rem;
  animation: rise 1s var(--ease) both;
  overflow: visible;
}

.kicker {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 1rem;
}

.brand {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 9vw, 5.8rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1.05;
  margin-bottom: 1.4rem;
  color: #ffffff;
  background: linear-gradient(120deg, #ffffff 10%, #d7fff8 55%, var(--accent) 130%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  overflow: visible;
  max-width: 100%;
  word-break: keep-all;
}

.headline {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.5vw, 1.65rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.25;
  max-width: 18ch;
  margin-bottom: 1rem;
}

.lede {
  color: var(--soft);
  font-weight: 400;
  max-width: 34rem;
  margin-bottom: 1.75rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease), background 0.2s ease, color 0.2s ease,
    border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--accent);
  color: #041312;
}

.btn-primary:hover {
  background: #5ee0d1;
}

.btn-ghost {
  border-color: rgba(238, 243, 248, 0.35);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.03);
}

.btn-ghost:hover {
  border-color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
}

.hero-hint {
  margin-top: 4rem;
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.panel {
  margin: 0 clamp(1.2rem, 4vw, 2.75rem) 1.25rem;
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
  width: min(100% - 2.4rem, var(--max));
  padding: clamp(2rem, 5vw, 3rem);
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
  transform: translateY(28px);
  opacity: 0;
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

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

.section-label {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.85rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 750;
  letter-spacing: -0.035em;
  margin-bottom: 2rem;
}

.about-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(1.5rem, 4vw, 3rem);
}

.about-grid h2 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.about-grid p {
  color: var(--soft);
  margin-bottom: 1rem;
}

.links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
  margin-top: 1.25rem;
}

.links a {
  font-weight: 600;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
  color: var(--ink);
}

.links a:hover {
  color: var(--accent);
}

.timeline {
  display: flex;
  flex-direction: column;
}

.timeline article {
  display: grid;
  grid-template-columns: minmax(180px, 0.85fr) 1.4fr;
  gap: 1rem 2rem;
  padding: 1.4rem 0;
  border-top: 1px solid var(--line);
}

.timeline article:last-child {
  border-bottom: 1px solid var(--line);
}

.timeline h3 {
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.org {
  color: var(--soft);
  margin-top: 0.15rem;
}

.timeline time {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.timeline article > p {
  color: var(--soft);
}

.projects article {
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  gap: 1rem;
  padding: 1.4rem 0;
  border-top: 1px solid var(--line);
}

.projects article:last-child {
  border-bottom: 1px solid var(--line);
}

.projects span {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--accent-2);
  padding-top: 0.15rem;
}

.projects h3 {
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin-bottom: 0.45rem;
}

.projects p {
  color: var(--soft);
}

.projects .tags {
  margin-top: 0.65rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.skills {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem 2rem;
}

.skills dt {
  font-weight: 650;
  margin-bottom: 0.3rem;
}

.skills dd {
  color: var(--soft);
}

.edu {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.edu h3 {
  font-size: 1.05rem;
  font-weight: 650;
  margin-bottom: 0.35rem;
}

.edu p {
  color: var(--soft);
  margin-bottom: 0.35rem;
}

.edu time {
  font-size: 0.8rem;
  color: var(--muted);
}

.pubs {
  margin-top: 2.25rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}

.pubs h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.pubs ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.pubs a {
  font-weight: 600;
  border-bottom: 1px solid transparent;
}

.pubs a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.pubs span {
  display: block;
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.contact h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 0.85rem;
}

.contact .lede {
  margin-bottom: 1.5rem;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem clamp(1.2rem, 4vw, 2.75rem) 2.5rem;
  max-width: var(--max);
  margin: 0 auto;
  color: var(--muted);
  font-size: 0.84rem;
}

.site-footer a:hover {
  color: var(--accent);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 860px) {
  .nav {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .vignette {
    background:
      radial-gradient(ellipse at 50% 30%, transparent 0%, rgba(7, 9, 13, 0.5) 65%),
      linear-gradient(180deg, rgba(7, 9, 13, 0.35) 0%, transparent 30%, rgba(7, 9, 13, 0.7) 100%);
  }

  .about-grid,
  .timeline article,
  .skills,
  .edu {
    grid-template-columns: 1fr;
  }

  .timeline article {
    gap: 0.45rem;
  }
}

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

  .hero-copy,
  .panel {
    animation: none;
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn:hover {
    transform: none;
  }
}
