/* ============ tokens ============ */
:root {
  --bg0: #04060d;
  --bg1: #0a0f1e;
  --panel: #0c1322;
  --line: rgba(148, 163, 184, 0.14);
  --cyan: #22d3ee;
  --purple: #a78bfa;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --text: #dbe4f0;
  --muted: #8b9bb4;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: "Inter", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg0);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.65;
  overflow-x: hidden;
}
.mono { font-family: var(--mono); }
.accent { color: var(--cyan); }
.grad {
  background: linear-gradient(100deg, var(--cyan), var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.prompt { color: var(--green); }
a { color: var(--cyan); text-decoration: none; }
strong { color: #f1f5fb; }

::selection { background: rgba(34, 211, 238, 0.3); }

.cursor-blink { animation: blink 1.1s steps(1) infinite; color: var(--cyan); }
@keyframes blink { 50% { opacity: 0; } }

/* ============ nav ============ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0.9rem 2rem;
  background: rgba(4, 6, 13, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav__logo {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--text);
  font-size: 1rem;
}
.nav__links { display: flex; gap: 1.4rem; margin-left: auto; }
.nav__links a {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
  transition: color 0.2s;
}
.nav__links a:hover { color: var(--cyan); }
.nav__links a::before { content: "./"; color: var(--cyan); opacity: 0; transition: opacity 0.2s; }
.nav__links a:hover::before { opacity: 1; }
.nav__burger {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font-size: 1.3rem;
  padding: 0.1rem 0.6rem;
  cursor: pointer;
}
.nav__tqdm {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  color: var(--muted);
  min-width: 160px;
}
.tqdm-track {
  width: 80px; height: 6px;
  background: rgba(148, 163, 184, 0.15);
  border-radius: 3px;
  overflow: hidden;
}
.tqdm-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  transition: width 0.1s linear;
}

/* ============ hero ============ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
#neural-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero__inner {
  position: relative;
  z-index: 2;
  max-width: 860px;
  padding: 7rem 2rem 4rem;
  text-align: center;
  pointer-events: none;
}
.hero__inner a, .hero__inner .btn { pointer-events: auto; }
.hero__hello { color: var(--muted); font-size: 0.95rem; margin-bottom: 0.8rem; }
.hero__name {
  font-size: clamp(2.8rem, 8vw, 5.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  text-shadow: 0 0 60px rgba(34, 211, 238, 0.25);
}
.hero__role { font-size: clamp(1rem, 2.6vw, 1.35rem); color: var(--muted); margin-top: 0.8rem; }
.typed { color: var(--cyan); }
.hero__blurb {
  max-width: 620px;
  margin: 1.4rem auto 0;
  color: var(--muted);
  font-size: 1.02rem;
}
.hero__cta { display: flex; gap: 1rem; justify-content: center; margin-top: 2rem; flex-wrap: wrap; }
.hero__stats {
  display: flex;
  justify-content: center;
  gap: 2.6rem;
  margin-top: 3rem;
  flex-wrap: wrap;
}
.stat { display: flex; flex-direction: column; align-items: center; max-width: 160px; }
.stat__num { font-size: 1.7rem; font-weight: 700; color: var(--cyan); }
.stat__label { font-size: 0.72rem; color: var(--muted); text-align: center; margin-top: 0.2rem; }
.hero__hint { margin-top: 2.6rem; font-size: 0.72rem; color: rgba(139, 155, 180, 0.55); }
.hero__scroll {
  position: absolute;
  bottom: 1.4rem; left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  animation: bob 1.8s ease-in-out infinite;
  z-index: 2;
}
@keyframes bob { 50% { transform: translate(-50%, 8px); } }

/* ============ buttons ============ */
.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.9rem;
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn--sm { padding: 0.45rem 0.9rem; font-size: 0.78rem; }
.btn--primary {
  background: linear-gradient(100deg, rgba(34, 211, 238, 0.18), rgba(167, 139, 250, 0.18));
  border-color: rgba(34, 211, 238, 0.45);
  color: var(--cyan);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(34, 211, 238, 0.25);
}
.btn--ghost {
  border-color: var(--line);
  color: var(--muted);
  background: transparent;
}
.btn--ghost:hover { color: var(--text); border-color: var(--muted); transform: translateY(-2px); }

/* ============ sections ============ */
.section {
  max-width: 1060px;
  margin: 0 auto;
  padding: 6rem 2rem 2rem;
}
.section--wide { max-width: 1200px; }
.section--center { text-align: center; }
.section__title {
  font-size: clamp(1.4rem, 3.4vw, 1.9rem);
  font-weight: 700;
  margin-bottom: 0.7rem;
}
.section__title--center { text-align: center; }
.section__title::after {
  content: "";
  display: inline-block;
  width: clamp(60px, 16vw, 220px);
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
  margin-left: 1.2rem;
  vertical-align: middle;
}
.section__title--center::after { display: none; }
.section__no { color: var(--cyan); font-size: 0.85em; margin-right: 0.5rem; }
.section__sub { color: var(--muted); max-width: 720px; margin-bottom: 2.4rem; }
.section--center .section__sub { margin-left: auto; margin-right: auto; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ============ about / terminal ============ */
.about {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 2.6rem;
  align-items: start;
  margin-top: 2rem;
}
.about__text p { color: var(--muted); margin-bottom: 1.1rem; }
.terminal {
  background: #070b15;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.terminal__bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1rem;
  background: rgba(148, 163, 184, 0.07);
  border-bottom: 1px solid var(--line);
}
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot--r { background: #ff5f57; } .dot--y { background: #febc2e; } .dot--g { background: #28c840; }
.terminal__title { margin-left: 0.6rem; font-size: 0.74rem; color: var(--muted); }
.terminal__body {
  padding: 1.1rem 1.2rem 1.4rem;
  font-size: 0.74rem;
  line-height: 1.75;
  min-height: 380px;
  white-space: pre-wrap;
  word-break: break-word;
}
.t-prompt { color: var(--green); }
.t-cmd { color: var(--text); }
.t-info { color: var(--muted); }
.t-epoch { color: var(--cyan); }
.t-val { color: var(--amber); }
.t-ok { color: var(--green); }

/* ============ experience timeline ============ */
.timeline { position: relative; margin-top: 1rem; padding-left: 0.4rem; }
.timeline::before {
  content: "";
  position: absolute;
  left: 26px; top: 10px; bottom: 10px;
  width: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--purple), transparent);
  opacity: 0.35;
}
.tcard { display: flex; gap: 1.6rem; margin-bottom: 2.6rem; }
.tcard__node {
  flex: 0 0 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg1);
  border: 1px solid rgba(34, 211, 238, 0.5);
  color: var(--cyan);
  font-size: 0.8rem;
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.25);
  z-index: 1;
}
.tcard__body {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.4rem 1.6rem;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}
.tcard__body:hover {
  border-color: rgba(34, 211, 238, 0.4);
  box-shadow: 0 10px 40px rgba(34, 211, 238, 0.08);
  transform: translateY(-3px);
}
.tcard__body header { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.8rem; }
.tcard__body h3 { font-size: 1.08rem; }
.tcard__date { color: var(--muted); font-size: 0.74rem; align-self: center; }
.tcard__body ul { list-style: none; }
.tcard__body li {
  color: var(--muted);
  font-size: 0.92rem;
  padding-left: 1.2rem;
  position: relative;
  margin-bottom: 0.5rem;
}
.tcard__body li::before { content: "▸"; position: absolute; left: 0; color: var(--cyan); }
.tags { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 1rem; }
.tags span {
  font-size: 0.68rem;
  padding: 0.18rem 0.6rem;
  border-radius: 99px;
  border: 1px solid rgba(167, 139, 250, 0.35);
  color: var(--purple);
}

/* ============ playground ============ */
.lab--a { color: var(--cyan); font-weight: 600; }
.lab--b { color: var(--purple); font-weight: 600; }
.pg {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 200px;
  gap: 1.6rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.6rem;
}
.pg__label { display: block; font-size: 0.7rem; color: var(--muted); margin-bottom: 0.45rem; letter-spacing: 0.04em; }
.pg__label b { color: var(--cyan); }
.pg__group { margin-bottom: 1.3rem; }
.pg__group--row { display: flex; gap: 0.6rem; }
.pg__btns { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pg__btns button {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0.32rem 0.7rem;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}
.pg__btns button:hover { color: var(--text); border-color: var(--muted); }
.pg__btns button.on {
  color: var(--cyan);
  border-color: rgba(34, 211, 238, 0.55);
  background: rgba(34, 211, 238, 0.1);
}
.pg input[type="range"] {
  width: 100%;
  accent-color: var(--cyan);
}
.pg__stage { display: flex; flex-direction: column; align-items: center; gap: 0.8rem; min-width: 0; }
#pg-canvas {
  width: 100%;
  max-width: 560px;
  aspect-ratio: 1;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #060a14;
  cursor: crosshair;
}
.pg__readout {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.pg__readout b { color: var(--cyan); }
#pg-losscurve { border-bottom: 1px solid var(--line); }
.pg__arch { display: flex; flex-direction: column; }
#pg-archsvg { width: 100%; flex: 1; min-height: 230px; }
.pg__archnote { font-size: 0.72rem; color: var(--muted); text-align: center; }

/* ============ publications ============ */
.pubs { display: grid; grid-template-columns: 1fr 1fr; gap: 1.3rem; }
.pub {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.4rem 1.5rem;
  color: var(--text);
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.pub:hover {
  transform: translateY(-4px);
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow: 0 14px 44px rgba(34, 211, 238, 0.1);
}
.pub__venue {
  display: inline-block;
  font-size: 0.66rem;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  margin-bottom: 0.8rem;
  letter-spacing: 0.04em;
}
.pub__venue--cyan { color: var(--cyan); border: 1px solid rgba(34, 211, 238, 0.4); }
.pub__venue--green { color: var(--green); border: 1px solid rgba(52, 211, 153, 0.4); }
.pub__venue--purple { color: var(--purple); border: 1px solid rgba(167, 139, 250, 0.4); }
.pub__venue--amber { color: var(--amber); border: 1px solid rgba(251, 191, 36, 0.4); }
.pub h3 { font-size: 0.98rem; line-height: 1.45; margin-bottom: 0.5rem; }
.pub p { font-size: 0.8rem; color: var(--muted); }
.pub__link { display: inline-block; margin-top: 0.8rem; font-size: 0.72rem; color: var(--cyan); }

/* ============ skills / smi ============ */
.smi {
  background: #070b15;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
  overflow-x: auto;
  font-size: 0.74rem;
  line-height: 1.55;
  color: var(--muted);
}
.smi pre { color: var(--muted); }
.smi__rows .smi-row { display: flex; white-space: pre; }
.smi-row .smi-name { color: var(--text); }
.smi-row .smi-bar { color: var(--cyan); }
.smi-row .smi-mem { color: var(--amber); }
.chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; margin-top: 2rem; }
.chips__group h4 {
  font-size: 0.72rem;
  color: var(--green);
  letter-spacing: 0.08em;
  margin-bottom: 0.7rem;
}
.chips__group h4::before { content: "# "; color: var(--muted); }
.chips__group div { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chips__group span {
  font-size: 0.76rem;
  padding: 0.3rem 0.75rem;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.07);
  border: 1px solid var(--line);
  color: var(--text);
  transition: all 0.2s;
  cursor: default;
}
.chips__group span:hover {
  border-color: rgba(34, 211, 238, 0.5);
  color: var(--cyan);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(34, 211, 238, 0.15);
}

/* ============ education ============ */
.edu { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
.edu__card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.5rem 1.6rem;
  position: relative;
  transition: border-color 0.25s, transform 0.25s;
}
.edu__card:hover { border-color: rgba(167, 139, 250, 0.45); transform: translateY(-3px); }
.edu__year {
  position: absolute;
  top: 1.3rem; right: 1.4rem;
  color: var(--purple);
  font-size: 0.8rem;
}
.edu__card h3 { font-size: 1rem; margin-bottom: 0.3rem; max-width: 85%; }
.edu__card p { color: var(--muted); font-size: 0.9rem; }
.edu__gpa { display: inline-block; margin-top: 0.9rem; font-size: 0.74rem; color: var(--green); }

/* ============ contact / footer ============ */
.contact__big { font-size: clamp(1.8rem, 5vw, 3rem); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 0.6rem; }
.contact__row { margin-top: 1.6rem; }
.contact__socials { display: flex; justify-content: center; gap: 1.8rem; margin-top: 2rem; font-size: 0.85rem; }
.contact__socials a { color: var(--muted); transition: color 0.2s; }
.contact__socials a:hover { color: var(--cyan); }
.contact__socials a::before { content: "[ "; color: var(--line); }
.contact__socials a::after { content: " ]"; color: var(--line); }
.footer {
  text-align: center;
  padding: 4rem 2rem 2.4rem;
  color: rgba(139, 155, 180, 0.6);
  font-size: 0.72rem;
}
.footer__tip { margin-top: 0.4rem; opacity: 0.65; }

/* ============ responsive ============ */
@media (max-width: 980px) {
  .pg { grid-template-columns: 1fr; }
  .pg__arch { display: none; }
  .pg__controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.4rem 1.2rem; }
  .chips { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .about { grid-template-columns: 1fr; }
  .pubs { grid-template-columns: 1fr; }
  .edu { grid-template-columns: 1fr; }
  .nav__tqdm { display: none; }
  .nav__links {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(4, 6, 13, 0.97);
    border-bottom: 1px solid var(--line);
  }
  .nav__links.open { display: flex; }
  .nav__links a { padding: 0.9rem 2rem; border-top: 1px solid var(--line); }
  .nav__burger { display: block; }
  .timeline::before { display: none; }
  .tcard { flex-direction: column; gap: 0.7rem; }
  .tcard__node { display: none; }
  .hero__stats { gap: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { transition: none; opacity: 1; transform: none; }
  .hero__scroll, .cursor-blink { animation: none; }
}
