/* ─────────────────────────────────────
   TOKENS
───────────────────────────────────── */
:root {
  --white:    #ffffff;
  --off:      #f8f8f6;
  --border:   #e8e8e4;
  --border-h: #cecec8;
  --ink:      #0f0f0e;
  --ink-2:    #3a3a36;
  --ink-3:    #7a7a74;
  --ink-4:    #b8b8b0;
  --green:    #16a34a;
  --green-bg: #f0fdf4;
  --green-bd: #bbf7d0;
  --sidebar:  280px;
  --r:        8px;
  --r-lg:     12px;
}

/* ─────────────────────────────────────
   RESET
───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-font-smoothing: antialiased; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--white);
  color: var(--ink);
  line-height: 1.6;
  height: 100dvh;
  overflow: hidden;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }

/* ─────────────────────────────────────
   LAYOUT
───────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  height: 100dvh;
}

/* ─────────────────────────────────────
   SIDEBAR
───────────────────────────────────── */
.sidebar {
  background: var(--off);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.4rem;
  gap: 1.1rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* scrollbar */
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Profile block ── */
.profile-block {
  display: flex;
  align-items: center;
  gap: .85rem;
}

.avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 2px solid var(--border-h);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
}

.profile-text h1 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.2;
}
.profile-text .role {
  font-size: .75rem;
  color: var(--ink-3);
  margin-top: .1rem;
}

/* ── Status ── */
.status-row { display: flex; }

.badge-live {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  font-size: .71rem;
  color: var(--green);
  background: var(--green-bg);
  border: 1px solid var(--green-bd);
  padding: .22rem .65rem;
  border-radius: 50px;
  font-weight: 500;
}
.dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--green);
  animation: blink 2.4s ease-in-out infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.25} }

/* ── Affiliation logo card ── */
.affil-block {
  display: flex;
  align-items: center;
  gap: .7rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: .65rem .8rem;
}

.affil-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  filter: grayscale(20%);
}

.affil-name {
  font-size: .72rem;
  color: var(--ink-3);
  line-height: 1.45;
}

/* ── Bio ── */
.bio {
  font-size: .79rem;
  color: var(--ink-3);
  line-height: 1.7;
  padding-bottom: .1rem;
}

/* ── Nav ── */
.side-nav {
  display: flex;
  flex-direction: column;
  gap: .15rem;
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: 1px solid transparent;
  text-align: left;
  font-size: .82rem;
  color: var(--ink-3);
  padding: .48rem .7rem;
  border-radius: var(--r);
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.nav-btn:hover { background: #eeeeed; color: var(--ink); }
.nav-btn.active {
  background: var(--white);
  color: var(--ink);
  font-weight: 500;
  border-color: var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px; height: 17px;
  font-size: .62rem;
  color: var(--ink-4);
  background: #e4e4e0;
  border: 1px solid #ccccc6;
  border-radius: 4px;
  line-height: 1;
}
.nav-btn.active kbd { color: var(--ink-3); }

/* ── Links ── */
.sidebar-links {
  margin-top: auto;
  padding-top: .85rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.link-chip {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .78rem;
  color: var(--ink-3);
  padding: .4rem .6rem;
  border-radius: var(--r);
  transition: background .15s, color .15s;
}
.link-chip:hover { background: #eeeeed; color: var(--ink); }
.link-chip svg { flex-shrink: 0; opacity: .65; }

/* ─────────────────────────────────────
   MAIN PANEL
───────────────────────────────────── */
.main-panel {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2rem 2.25rem;
}
.main-panel::-webkit-scrollbar { width: 4px; }
.main-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ─────────────────────────────────────
   PANELS
───────────────────────────────────── */
.panel { display: none; }
.panel.active { display: block; }

@keyframes up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.panel.active .stagger {
  opacity: 0;
  animation: up .28s ease forwards;
}
.panel.active .stagger:nth-child(1) { animation-delay: .03s; }
.panel.active .stagger:nth-child(2) { animation-delay: .07s; }
.panel.active .stagger:nth-child(3) { animation-delay: .11s; }
.panel.active .stagger:nth-child(4) { animation-delay: .15s; }
.panel.active .stagger:nth-child(5) { animation-delay: .19s; }
.panel.active .stagger:nth-child(6) { animation-delay: .23s; }

.panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: .7rem;
  border-bottom: 1px solid var(--border);
}

.panel-header h2 { font-size: .92rem; font-weight: 600; letter-spacing: -.012em; }
.panel-meta { font-size: .72rem; color: var(--ink-4); }

.panel-ext-link {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .73rem;
  color: var(--ink-3);
  transition: color .15s;
}
.panel-ext-link:hover { color: var(--ink); }

/* ─────────────────────────────────────
   EXPERIENCE
───────────────────────────────────── */
.entries { display: flex; flex-direction: column; }

.entry {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 0 1rem;
}

.entry-left {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Org logo in timeline */
.org-logo-wrap {
  width: 34px;
  height: 34px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.org-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.letter-logo {
  font-size: .58rem;
  font-weight: 700;
  color: var(--ink-3);
  letter-spacing: .03em;
}

.tline {
  flex: 1;
  width: 1px;
  background: var(--border);
  margin: .35rem 0;
  position: relative;
}
.tline.last { background: transparent; }

.tdot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ink-4);
  border: 1.5px solid var(--white);
  outline: 1.5px solid var(--ink-4);
  position: absolute;
  left: 50%; top: 0;
  transform: translate(-50%, -50%);
}
.tdot.active {
  background: var(--green);
  outline-color: var(--green);
  box-shadow: 0 0 0 3px #dcfce7;
}

.entry-content {
  padding: .05rem 0 1.65rem;
}
.entry:last-child .entry-content { padding-bottom: 0; }

.entry-top {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .15rem;
}
.entry-content strong { font-size: .88rem; font-weight: 500; }

.chip-green {
  font-size: .63rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--green);
  background: var(--green-bg);
  border: 1px solid var(--green-bd);
  padding: .1rem .42rem;
  border-radius: 4px;
}

.entry-org {
  font-size: .77rem;
  color: var(--ink-3);
  margin-bottom: .4rem;
}

.entry-desc {
  font-size: .81rem;
  color: var(--ink-2);
  line-height: 1.65;
  margin-bottom: .55rem;
}

.entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .27rem;
  margin-bottom: .45rem;
}
.entry-tags span {
  font-size: .67rem;
  padding: .16rem .5rem;
  border-radius: 4px;
  background: #f0f0ec;
  border: 1px solid var(--border);
  color: var(--ink-3);
}

.entry-year {
  font-size: .68rem;
  color: var(--ink-4);
}

/* ─────────────────────────────────────
   PUBLICATIONS
───────────────────────────────────── */
.pub-group { margin-bottom: 1.4rem; }
.pub-group:last-child { margin-bottom: 0; }

.pub-group-label {
  font-size: .67rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: .55rem;
}

.pub-list { display: flex; flex-direction: column; gap: .3rem; }
.dimmed-group { opacity: .6; }
.dimmed-group .pub-row:hover { opacity: 1; }

.pub-row {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: .75rem;
  padding: .8rem .85rem;
  border: 1px solid var(--border);
  border-radius: var(--r);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
a.pub-row:hover {
  border-color: var(--border-h);
  background: var(--off);
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

.pub-n {
  font-size: .68rem;
  font-weight: 600;
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}

.pub-title {
  font-size: .82rem;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: .12rem;
}
.pub-byline { font-size: .72rem; color: var(--ink-3); }

.pub-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .3rem;
  flex-shrink: 0;
}

.pub-badge {
  font-size: .65rem;
  font-weight: 600;
  color: var(--ink-3);
  background: #f0f0ec;
  border: 1px solid var(--border);
  padding: .13rem .42rem;
  border-radius: 4px;
  white-space: nowrap;
}
.pub-badge.pending {
  color: #92400e;
  background: #fffbeb;
  border-color: #fde68a;
}

.pub-ext {
  opacity: 0;
  color: var(--ink-3);
  transition: opacity .15s;
}
a.pub-row:hover .pub-ext { opacity: 1; }

/* ─────────────────────────────────────
   PROJECTS
───────────────────────────────────── */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .65rem;
}

.proj-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.05rem 1rem;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.proj-card:hover {
  border-color: var(--border-h);
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
  transform: translateY(-2px);
}

.proj-accent {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2.5px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
  border-radius: 0 0 2px 2px;
}
.proj-card:hover .proj-accent { transform: scaleX(1); }

.proj-icon { font-size: 1.25rem; margin-bottom: .5rem; display: block; }
.proj-card h3 { font-size: .83rem; font-weight: 600; margin-bottom: .28rem; letter-spacing: -.01em; }
.proj-card p  { font-size: .76rem; color: var(--ink-3); line-height: 1.55; margin-bottom: .6rem; }

.proj-chips { display: flex; flex-wrap: wrap; gap: .25rem; }
.proj-chips span {
  font-size: .65rem;
  padding: .14rem .42rem;
  border-radius: 4px;
  background: var(--off);
  border: 1px solid var(--border);
  color: var(--ink-3);
}

/* ─────────────────────────────────────
   SKILLS & EDUCATION
───────────────────────────────────── */
.se-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem 2rem;
}
.edu-block { grid-column: 1 / -1; }

.se-label {
  font-size: .66rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: .6rem;
}

.pill-group { display: flex; flex-wrap: wrap; gap: .28rem; }

.pill {
  font-size: .76rem;
  padding: .25rem .62rem;
  border-radius: 6px;
  background: var(--off);
  border: 1px solid var(--border);
  color: var(--ink-2);
  transition: border-color .15s, background .15s;
}
.pill:hover { border-color: var(--border-h); background: #ededea; }

/* Education rows */
.edu-list { display: flex; flex-direction: column; gap: .9rem; }

.edu-row {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: .7rem;
  align-items: start;
}

.edu-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 2px;
  background: var(--white);
}

.edu-logo-placeholder {
  width: 34px;
  height: 34px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--off);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .58rem;
  font-weight: 700;
  color: var(--ink-4);
  letter-spacing: .03em;
}

.edu-row strong { display: block; font-size: .82rem; font-weight: 500; margin-bottom: .1rem; }
.edu-row p { font-size: .74rem; color: var(--ink-3); }
.edu-note { color: var(--ink-4) !important; font-style: italic; margin-top: .1rem; }

/* ─────────────────────────────────────
   NOTES
───────────────────────────────────── */
.notes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}

.note-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.1rem;
  transition: border-color .2s, box-shadow .2s, transform .2s;
  text-decoration: none;
  color: inherit;
}
a.note-card:hover {
  border-color: var(--border-h);
  box-shadow: 0 4px 16px rgba(0,0,0,.07);
  transform: translateY(-2px);
}
.note-card.placeholder {
  border-style: dashed;
  background: var(--off);
}

.note-card-top {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .75rem;
}

.note-icon {
  font-size: 1.35rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--off);
  border: 1px solid var(--border);
  border-radius: var(--r);
  flex-shrink: 0;
  font-style: normal;
}

.note-meta { flex: 1; }
.note-tag {
  display: block;
  font-size: .72rem;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: .1rem;
}
.note-date {
  display: block;
  font-size: .68rem;
  color: var(--ink-4);
}

.note-ext {
  color: var(--ink-4);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity .15s;
}
a.note-card:hover .note-ext { opacity: 1; }

.note-card h3 {
  font-size: .88rem;
  font-weight: 600;
  margin-bottom: .35rem;
  letter-spacing: -.01em;
  line-height: 1.35;
}
.note-card p {
  font-size: .78rem;
  color: var(--ink-3);
  line-height: 1.6;
  margin-bottom: .75rem;
}

.note-topics {
  display: flex;
  flex-wrap: wrap;
  gap: .28rem;
}
.note-topics span {
  font-size: .67rem;
  padding: .14rem .45rem;
  border-radius: 4px;
  background: var(--off);
  border: 1px solid var(--border);
  color: var(--ink-3);
}

/* ─────────────────────────────────────
   KEYBOARD HINT
───────────────────────────────────── */
.kbd-hint {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: rgba(15,15,14,.88);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: .7rem;
  padding: .38rem .9rem;
  border-radius: 50px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .3s;
  white-space: nowrap;
  z-index: 99;
}
.kbd-hint kbd {
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.3);
  color: #fff;
  margin: 0 1px;
}
.kbd-hint.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─────────────────────────────────────
   RESPONSIVE
───────────────────────────────────── */
@media (max-width: 900px) {
  body   { overflow: auto; height: auto; }
  .layout { grid-template-columns: 1fr; height: auto; }
  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .sidebar-links { flex-direction: row; flex-wrap: wrap; margin-top: 0; }
  .main-panel { padding: 1.5rem; }
  .proj-grid { grid-template-columns: 1fr 1fr; }
  .se-grid { grid-template-columns: 1fr; }
  .edu-block { grid-column: 1; }
}

@media (max-width: 480px) {
  .proj-grid { grid-template-columns: 1fr; }
  .pub-row { grid-template-columns: 20px 1fr; }
  .pub-right { display: none; }
}
