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

:root {
  --bg: #060912;
  --bg-2: #0a0f1d;
  --panel: rgba(17, 24, 43, 0.6);
  --line: rgba(120, 160, 255, 0.14);
  --text: #e6ecff;
  --muted: #8a96b8;
  --cyan: #22d3ee;
  --violet: #a855f7;
  --blue: #6ea0ff;
  --disp: 'Space Grotesk', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --content-max: 1400px; /* set to 'none' for full width */
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--disp);
  background:
    radial-gradient(900px 600px at 80% -10%, rgba(168,85,247,0.12), transparent 60%),
    radial-gradient(900px 600px at 10% 10%, rgba(34,211,238,0.10), transparent 55%),
    var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--cyan); color: #060912; }
a { color: inherit; text-decoration: none; }

/* ─── NAV / LAYERS ─── */
.layers {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: 200px;
  padding: 28px 22px;
  border-right: 1px solid var(--line);
  background: rgba(6, 9, 18, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  z-index: 30;
}
.brand {
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  margin-bottom: 2.5rem;
}
.brand .dot { color: var(--cyan); }
.layers ul { list-style: none; display: flex; flex-direction: column; gap: 2px; position: relative; }
.layers ul::before {
  content: "";
  position: absolute;
  left: 4px; top: 12px; bottom: 12px;
  width: 1px;
  background: var(--line);
}
.layers li a {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
  padding: 7px 0;
  transition: color 0.18s;
}
.node {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--blue);
  flex-shrink: 0;
  transition: all 0.2s;
  z-index: 1;
}
.layers li a:hover { color: var(--text); }
.layers li a:hover .node {
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}

/* ─── MAIN ─── */
.main {
  margin-left: max(200px, calc((100vw - 1200px) / 2));
  margin-right: auto;
  max-width: var(--content-max);
}

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 6rem 6rem;
  overflow: hidden;
}
#net {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
.hero-content { isolation: isolate; z-index: 2; max-width: 620px; }

.kicker {
  font-family: var(--mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--cyan);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}
.pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 0 rgba(34,211,238,0.6);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 12px rgba(34,211,238,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,211,238,0); }
}

.hero h1 {
  font-size: clamp(3rem, 7vw, 6rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.04em;
  background: linear-gradient(120deg, #fff 30%, var(--cyan) 70%, var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tagline {
  font-family: var(--mono);
  color: var(--muted);
  font-size: 1rem;
  margin-top: 1rem;
}
.bio {
  font-size: 1.15rem;
  color: #c4cef0;
  margin-top: 1.5rem;
  max-width: 34ch;
  line-height: 1.55;
}
.bio em {
  font-style: normal;
  color: var(--cyan);
}
.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 2.25rem;
}
.btn {
  font-family: var(--mono);
  font-size: 0.82rem;
  border: 1px solid var(--line);
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  color: var(--text);
  transition: all 0.18s;
}
.btn:hover { border-color: var(--cyan); transform: translateY(-2px); }
.btn-on {
  background: var(--cyan);
  color: #060912;
  border-color: var(--cyan);
  font-weight: 600;
}
.btn-on:hover { background: #67e8f9; }
.loc {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 1.5rem;
}
.hero-photo {
  position: absolute;
  right: 6rem;
  top: 50%;
  transform: translateY(-50%);
  width: 230px;
  height: 280px;
  object-fit: cover;
  object-position: center top;
  border-radius: 14px;
  border: 1px solid var(--line);
  filter: grayscale(0.2);
  box-shadow: 0 0 60px rgba(34,211,238,0.15);
  z-index: 2;
}

/* ─── LAYERS / SECTIONS ─── */
.layer {
  position: relative;
  padding: 6rem;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, rgba(10,15,29,0.4));
}
.layer-head {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}
.lcode {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--cyan);
  border: 1px solid var(--line);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
}
.layer-head h2 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.03em;
}
.lact {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  margin-left: auto;
}

/* neurons */
.neurons { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.neuron {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  transition: all 0.2s;
}
.neuron:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 16px rgba(34,211,238,0.2);
}

/* project grid */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}
.card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.6rem;
  backdrop-filter: blur(4px);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.card:hover {
  transform: translateY(-5px);
  border-color: var(--cyan);
  box-shadow: 0 18px 40px -22px rgba(34,211,238,0.5);
}
.card-feat {
  grid-column: span 2;
  background: linear-gradient(135deg, rgba(34,211,238,0.1), rgba(168,85,247,0.08));
  border-color: rgba(34,211,238,0.3);
}
.card-top {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 1.75rem;
}
.card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
}
.card-feat h3 { font-size: 1.6rem; }
.card p { font-size: 0.9rem; color: var(--muted); line-height: 1.6; }
.card-img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  margin-bottom: 1.2rem;
  border: 1px solid var(--line);
}
.card-link {
  display: inline-block;
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--cyan);
}

/* experience flow */
.flow {
  position: relative;
  padding-left: 2rem;
}
.flow::before {
  content: "";
  position: absolute;
  left: 5px; top: 8px; bottom: 8px;
  width: 1px;
  background: linear-gradient(var(--cyan), var(--violet));
  opacity: 0.4;
}
.step {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  padding: 1.3rem 0;
  border-bottom: 1px solid var(--line);
}
.step:last-child { border-bottom: none; }
.step-node {
  position: absolute;
  left: -2rem;
  top: 1.7rem;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--cyan);
  transform: translateX(0);
  box-shadow: 0 0 12px rgba(34,211,238,0.5);
}
.step h3 { font-size: 1.15rem; font-weight: 600; }
.step .where { font-family: var(--mono); font-size: 0.8rem; color: var(--cyan); margin: 0.2rem 0 0.4rem; }
.step p { font-size: 0.9rem; color: var(--muted); }

/* papers */
.papers { list-style: none; counter-reset: p; }
.papers li {
  counter-increment: p;
  position: relative;
  padding: 1.1rem 0 1.1rem 3rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
  color: #c4cef0;
  line-height: 1.55;
}
.papers li::before {
  content: counter(p, decimal-leading-zero);
  position: absolute;
  left: 0; top: 1.1rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--cyan);
}
.papers strong { color: #fff; font-weight: 600; }
.papers li a { border-bottom: 1px solid transparent; transition: border-color 0.2s; }
.papers li a:hover { border-bottom-color: var(--cyan); }
.ven { display: block; font-family: var(--mono); font-size: 0.76rem; color: var(--muted); margin-top: 0.3rem; }

/* stack */
.stack {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}
.scol h4 {
  font-family: var(--mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cyan);
  margin-bottom: 0.5rem;
}
.scol p { font-size: 1.1rem; font-weight: 500; color: var(--text); }

/* output / contact */
.out { text-align: left; }
.contact-big {
  display: inline-block;
  font-size: clamp(1.7rem, 5vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, #fff, var(--cyan));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s;
}
.contact-big:hover { border-color: var(--cyan); }
.contact-sub { color: var(--muted); margin-top: 1.25rem; font-size: 1.05rem; max-width: 42ch; }
.contact-row { display: flex; gap: 2rem; margin-top: 1.75rem; font-family: var(--mono); font-size: 0.9rem; }
.contact-row a { color: var(--text); border-bottom: 1px solid var(--line); padding-bottom: 2px; transition: color 0.15s, border-color 0.15s; }
.contact-row a:hover { color: var(--cyan); border-color: var(--cyan); }
.foot { margin-top: 2.5rem; font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }

/* ─── FOUNDATIONS ─── */
.foundations { position: relative; min-height: 60vh; }
#traj {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}
.foundations .layer-head,
.foundations-grid { position: relative; z-index: 1; }
.foundations-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
.f-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.5rem;
  backdrop-filter: blur(4px);
}
.f-block h4 {
  font-family: var(--mono);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cyan);
  margin-bottom: 1rem;
}
.f-block ul { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; }
.f-block li { font-size: 0.88rem; color: var(--muted); line-height: 1.55; padding-bottom: 0.75rem; border-bottom: 1px solid var(--line); }
.f-block li:last-child { border-bottom: none; padding-bottom: 0; }
.f-block li strong { color: var(--text); font-weight: 500; }

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .card-feat { grid-column: span 2; }
  .hero-photo { width: 160px; height: 200px; right: 3rem; }
  .foundations-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .hero {
    flex-direction: column;
    justify-content: center;
    padding-top: 5rem;
    min-height: auto;
    padding-bottom: 4rem;
  }
  .hero-photo {
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    margin: 2rem auto 0;
    width: 180px;
    height: 220px;
  }
}

@media (max-width: 820px) {
  /* sticky top nav: single horizontally-scrollable row, no wrap */
  .layers {
    position: sticky;
    width: 100%;
    height: auto;
    inset: auto;
    flex-direction: row;
    align-items: center;
    gap: 0.25rem;
    padding: 10px 14px;
    border-right: none;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .layers::-webkit-scrollbar { display: none; }
  .brand { margin: 0 0.75rem 0 0; font-size: 1.05rem; flex-shrink: 0; }
  .layers ul {
    flex-flow: row nowrap;
    gap: 0.25rem;
    width: max-content;
  }
  .layers ul::before { display: none; }
  .layers li a span.node { display: none; }
  .layers li a {
    padding: 0.5rem 0.7rem;
    white-space: nowrap;
    border-radius: 999px;
  }
  .layers li a:active { color: var(--cyan); }

  .main { margin: 0 auto; max-width: var(--content-max); }

  /* offset anchored sections so headings clear the sticky bar */
  html { scroll-padding-top: 64px; }
  .hero, .layer { scroll-margin-top: 64px; }

  .hero {
    padding: 3.5rem 1.5rem;
    min-height: 78vh;
    min-height: 78svh;
  }
  .layer { padding: 4rem 1.5rem; }
  .grid, .stack, .foundations-grid { grid-template-columns: 1fr; }
  .card-feat { grid-column: span 1; }
  .lact { margin-left: 0; width: 100%; }
}

@media (max-width: 480px) {
  .hero { padding: 3rem 1.25rem; }
  .hero h1 { font-size: clamp(2.6rem, 13vw, 3.4rem); }
  .bio { font-size: 1.02rem; max-width: 100%; }
  .kicker { font-size: 0.72rem; letter-spacing: 0.12em; }
  .cta { gap: 0.5rem; }
  .btn { padding: 0.6rem 1rem; font-size: 0.78rem; }
  .layer { padding: 3.25rem 1.25rem; }
  .layer-head { gap: 0.75rem; margin-bottom: 2rem; }
  .card { padding: 1.3rem; }
  .papers li { padding-left: 2.4rem; }
  .stack { gap: 1.5rem; }
  .contact-row { gap: 1.25rem; flex-wrap: wrap; }
  .contact-big {
    font-size: clamp(1.4rem, 8vw, 2rem);
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pulse { animation: none; }
}
