/* ==========================================================================
   inner pages — night style (dark ink, sky-blue accent, timeline cards)
   ========================================================================== */

:root {
  --ink: #0b0f12;
  --text: #e9eef3;
  --muted: #a3aeba;
  --faint: #8a96a3;
  --dim: #5d6875;
  --sky: #a8bfe3;
  --line: rgba(255, 255, 255, 0.08);
  --font-display: "Inter Tight", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "Space Mono", ui-monospace, monospace;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

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

html { -webkit-font-smoothing: antialiased; }

body {
  min-height: 100vh;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.0625rem;
  line-height: 1.65;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --- top bar ------------------------------------------------------------- */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem var(--gutter);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.5rem);
}

.nav-links a {
  opacity: 0.7;
  transition: opacity 0.2s;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  opacity: 1;
}

.nav-links a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.nav-links .resume {
  opacity: 1;
  padding: 0.3rem 0.8rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  transition: background-color 0.2s, color 0.2s;
}

.nav-links .resume:hover {
  background: var(--text);
  color: var(--ink);
}

@media (max-width: 600px) {
  .nav { font-size: 0.72rem; }
  .nav-brand { max-width: 7.5rem; line-height: 1.3; }
  .nav-links .resume { display: none; }
}

/* --- page header --------------------------------------------------------- */

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.page-head {
  padding: clamp(4rem, 9vw, 6.5rem) 0 clamp(3rem, 6vw, 4.5rem);
}

.page-title {
  font-size: clamp(3rem, 16vw, 13rem);
  font-weight: 900;
  line-height: 0.8;
  letter-spacing: -0.055em;
  text-transform: uppercase;
}

/* --- timeline of entry cards --------------------------------------------- */

.entries {
  position: relative;
  padding-left: 2.25rem;
}

.entries::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 0.6rem;
  bottom: 0.6rem;
  width: 1px;
  background: #fff;
}

.entry {
  position: relative;
}

.entry + .entry {
  margin-top: clamp(2.75rem, 5vw, 3.75rem);
}

/* timeline dot, level with the date line */
.entry::before {
  content: "";
  position: absolute;
  left: calc(-2.25rem + 1px);
  top: 0.3rem;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #fff;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  margin-bottom: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

/* entries without a date line: line the dot up with the title instead */
.entry:not(:has(.meta))::before {
  top: 0.55rem;
}

.meta .date { color: #fff; }
.meta .place { color: var(--faint); }

.entry h2,
.entry h3 {
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.org {
  margin: 0.35rem 0 1rem;
  font-weight: 600;
}

.desc + .desc {
  margin-top: 0.75rem;
}

/* entries without an org line */
.entry h2 + .desc {
  margin-top: 0.5rem;
}

.desc {
  max-width: 66ch;
  color: var(--muted);
}

/* skills as plain text: ieeg · cognitive neuroscience · neural decoding */
.tags {
  display: flex;
  flex-wrap: wrap;
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--faint);
}

.tags li:not(:last-child)::after {
  content: "·";
  margin: 0 0.6em;
  color: var(--dim);
}

@media (max-width: 600px) {
  .entries { padding-left: 1.5rem; }
  .entry::before { left: calc(-1.5rem + 1px); }
}

/* links at the bottom of an entry (paper, demo, site) */
.entry-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-top: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.entry-links a {
  padding-bottom: 1px;
  border-bottom: 1px solid rgba(168, 191, 227, 0.35);
  color: var(--sky);
  transition: color 0.2s, border-color 0.2s;
}

.entry-links a:hover {
  border-color: var(--sky);
  color: var(--text);
}

/* shorter entries for awards and presentations */
.entry--compact + .entry--compact {
  margin-top: 2rem;
}

.entry--compact h2,
.entry--compact h3 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
}

.entry--compact .org {
  margin-bottom: 0;
  font-weight: 500;
  color: var(--muted);
}

/* --- groups within a page (publications, awards, ...) --------------------- */

.section + .section {
  margin-top: clamp(4rem, 8vw, 6rem);
}

.section-title {
  margin-bottom: 1.75rem;
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.045em;
  text-transform: uppercase;
}

/* press coverage: plain rows, outlet then headline */
.press a {
  display: grid;
  grid-template-columns: minmax(0, 13rem) minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.25rem 2rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}

.press li:first-child a {
  border-top: 1px solid var(--line);
}

.press-outlet {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  transition: color 0.2s;
}

.press-head {
  color: var(--muted);
}

.press-arrow {
  color: var(--sky);
  transition: transform 0.3s;
}

.press a:hover .press-outlet {
  color: var(--sky);
}

.press a:hover .press-arrow {
  transform: translate(3px, -3px);
}

@media (max-width: 600px) {
  .press a { grid-template-columns: minmax(0, 1fr) auto; }
  .press-head { grid-column: 1; grid-row: 2; }
}

/* --- about: bio + photo gallery ------------------------------------------ */

.bio {
  max-width: 46rem;
}

.bio p {
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  line-height: 1.65;
  color: var(--muted);
}

.bio p + p {
  margin-top: 1.25rem;
}

.bio a {
  border-bottom: 1px solid rgba(168, 191, 227, 0.35);
  color: var(--sky);
  transition: color 0.2s, border-color 0.2s;
}

.bio a:hover {
  border-color: var(--sky);
  color: var(--text);
}

.gallery {
  columns: 3 240px;
  column-gap: 0.75rem;
}

.shot {
  position: relative;
  display: block;
  width: 100%;
  margin: 0 0 0.75rem;
  padding: 0;
  border: 0;
  border-radius: 4px;
  overflow: hidden;
  background: #11161b;
  cursor: zoom-in;
  break-inside: avoid;
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

/* caption slides in on hover */
.shot::after {
  content: attr(data-caption);
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2.5rem 0.9rem 0.8rem;
  text-align: left;
  font: 0.85rem/1.4 var(--font-display);
  color: #fff;
  background: linear-gradient(transparent, rgba(11, 15, 18, 0.85));
  opacity: 0;
  transition: opacity 0.3s;
}

.shot:hover img,
.shot:focus-visible img {
  transform: scale(1.04);
}

.shot:hover::after,
.shot:focus-visible::after {
  opacity: 1;
}

@media (max-width: 600px) {
  .gallery { columns: 2; column-gap: 0.5rem; }
  .shot { margin-bottom: 0.5rem; }
}

/* full-size photo viewer */
.lightbox {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
}

.lightbox::backdrop {
  background: rgba(5, 8, 10, 0.94);
}

.lightbox[open] {
  display: grid;
  place-items: center;
}

.lightbox figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 4rem 1rem 2rem;
}

.lightbox img {
  max-width: min(92vw, 1400px);
  max-height: 78vh;
  border-radius: 4px;
}

.lightbox figcaption {
  max-width: 60ch;
  text-align: center;
  color: var(--muted);
}

.lb-btn {
  position: fixed;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(11, 15, 18, 0.6);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.lb-btn:hover {
  background: var(--text);
  color: var(--ink);
}

.lb-close { top: 1.25rem; right: 1.25rem; }
.lb-prev { left: 1.25rem; top: 50%; }
.lb-next { right: 1.25rem; top: 50%; }

@media (max-width: 600px) {
  .lb-prev,
  .lb-next { top: auto; bottom: 1.5rem; }
}

/* --- footer -------------------------------------------------------------- */

.foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1120px;
  margin: 0 auto;
  padding: 3rem var(--gutter) 2.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.foot a {
  opacity: 0.75;
  transition: opacity 0.2s;
}

.foot a:hover {
  opacity: 1;
}
