:root{
  --maxw: 1100px;
  --text: #111;
  --muted: #555;
  --link: #0b57d0;

  --ephys-x-offset: -50px; /* 🔧 adjust this */
}

/* Force scrollbar to prevent layout shift */
html{
  overflow-y: scroll;
}

body{
  margin: 10;
  font-family: Georgia, serif;
  color: var(--text);
  line-height: 1.65;
  font-size: 17px;
}

/* ---------- Container ---------- */
.container{
  max-width: var(--maxw);
  margin: 15px auto 40px auto;
  padding: 28px 24px;
  text-align: center;
}

/* ---------- Header (LOCKED GEOMETRY) ---------- */

header{
  display: grid;
  grid-template-rows: 3rem 1.4rem 1.8rem;
  align-items: center;
  justify-items: center;
  margin-bottom: 60px;
}

header h1{
  margin: 0;
  font-size: 2.1rem;
  line-height: 3rem;
  height: 3rem;
  white-space: nowrap;
}

header h1{
  min-width: 22ch;
  text-align: center;
}


.subtitle{
  height: 1.4rem;
}

.subtitle::after{
  content: "";
  display: block;
  width: 400px;
  height: 2px;
  background: #ddd;
  margin: 5px auto 0 auto;
}


/* ---------- Navigation (FIXED SLOTS) ---------- */

nav{
  display: flex;
  justify-content: center;
  gap: 8px;
  height: 2rem;
}

nav a{
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 120px;          /* 🔒 FIXED SLOT WIDTH */
  height: 2rem;

  text-decoration: none;
  color: var(--text);
  font-weight: 400;
  font-size: 0.95rem;

  border: 1px solid transparent;
  border-radius: 4px;

  transition:
    border-color 0.15s ease,
    background-color 0.15s ease;
}

/* hover affordance */
nav a:hover{
  border-color: #ccc;
}

/* active page */
nav a.active{
  border-color: var(--text);
  background-color: rgba(0,0,0,0.03);
}


/* ---------- Typography ---------- */
p{
  max-width: 65ch;
  margin: 0.8rem 0;
}

h2{
  font-size: 1.35rem;
  margin-bottom: 0.4rem;
}

.center-text{
  text-align: center;
  margin-left: auto;
  margin-right: auto;
  color: var(--muted);
  font-size: 0.95rem;
}


/* ---------- Home ---------- */
.intro-wide{
  max-width: 760px;
  margin-bottom: 10px;
  font-size: 1.05rem;
}

.intro-wide{
  max-width: 760px;
  margin: 0 auto -20px auto;
  text-align: center;
}


.ephys-gif{
  width: 100%;
  max-width: 950px;
  border-radius: 0px;

  transform: translateX(var(--ephys-x-offset));
}


/* ---------- Icons ---------- */
.icon-links{
  display: flex;
  justify-content: center;
  gap: 50px;
  margin-top: -10px;
}

.icon-links a{
  width: 34px;
  height: 34px;
}

.icon-links img{
  width: 100%;
  height: 100%;
  filter: grayscale(100%) brightness(0.55);
  transition: filter 0.2s ease, transform 0.2s ease;
}

.icon-links a:hover img,
.icon-links a:focus img{
  transform: translateY(-3px);
  filter: brightness(0) saturate(100%)
          invert(29%) sepia(91%)
          saturate(2145%)
          hue-rotate(203deg)
          brightness(96%)
          contrast(101%);
}

/* ---------- About ---------- */
.about-layout{
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
  align-items: center;
  margin-top: 40px;
}

.about-image{
  width: 100%;
  border-radius: 6px;
}

/* ---------- Research Tiles ---------- */

.research-grid{
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 48px;
  justify-items: center;
}

.research-tile{
  max-width: 300px;
  text-align: center;
}

.research-tile img{
  width: 100%;
  max-width: 260px;
  border-radius: 6px;
  margin-bottom: 16px;
}

.research-tile h2{
  margin: 0 0 8px 0;
  font-size: 1.25rem;
}

.research-tile p{
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}


/* ---------- Publications ---------- */
.pub-figure{
  width: 100%;
  max-width: 400px;
  margin: 32px auto;
  border-radius: 6px;
}

.pub-list{
  list-style: none;
  padding: 0;
}

.pub-list li{
  margin-bottom: 28px;
  line-height: 1.5;
}

.pub-year{
  color: var(--muted);
}

.pub-list{
  margin: 24px auto 40px auto;
  max-width: 80ch;
  padding-left: 1.4em;
  text-align: left;
}

.pub-list li{
  margin-bottom: 24px;
  line-height: 1.5;
}

.pub-list strong{
  font-weight: 600;
}

.pub-list a{
  word-break: break-word;
}


/* ---------- CV ---------- */
.cv-frame{
  width: 100%;
  height: 80vh;
  border: none;
  margin-top: 20px;
}

/* ---------- Responsive ---------- */
@media(max-width: 700px){
  .about-layout{
    grid-template-columns: 1fr;
    text-align: center;
  }

  .research-block{
    flex-direction: column;
    text-align: center;
  }
}
