/* ============================================================
   Ezra Winter-Nelson — personal site
   Two-column: fixed sidebar left, scrollable content right.
   ============================================================ */

:root {
  --sidebar-w: 240px;
  --accent: #00356b;   /* Yale/Columbia blue */
  --text: #222;
  --soft: #555;
  --faint: #888;
  --rule: #ddd;
  --bg-main: #fff;
  --bg-side: #f7f7f5;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-size: 15px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

body {
  font-family: var(--font);
  font-size: var(--font-size);
  line-height: 1.7;
  color: var(--text);
  background: var(--bg-main);
}

/* ---------- two-column layout ---------- */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ---------- sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-side);
  border-right: 1px solid var(--rule);
  /* fixed on tall screens */
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar__inner {
  padding: 2.5rem 1.5rem 2rem;
}

.photo {
  display: block;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  margin: 0 0 1.25rem;
}

.sidebar__name {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 0.25rem;
  color: var(--text);
}

.sidebar__role {
  font-size: 0.85rem;
  color: var(--soft);
  margin: 0 0 0.5rem;
}

.sidebar__inst {
  font-size: 0.82rem;
  color: var(--soft);
  margin: 0 0 0.4rem;
  line-height: 1.5;
}

.sidebar__lab {
  font-size: 0.78rem;
  color: var(--faint);
  margin: 0 0 1.5rem;
  line-height: 1.5;
}

/* nav */
.sidebar__nav {
  margin-bottom: 1.25rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 0.5rem 0;
}

.sidebar__nav a {
  display: block;
  font-size: 0.88rem;
  color: var(--soft);
  padding: 0.2rem 0;
}

.sidebar__nav a:hover { color: var(--accent); text-decoration: none; }
.sidebar__nav a.active { color: var(--accent); font-weight: 600; }

/* contact links */
.contact { display: flex; flex-direction: column; gap: 0.3rem; }

.contact li a {
  font-size: 0.85rem;
  color: var(--accent);
}

/* ---------- main content ---------- */
.main {
  flex: 1;
  max-width: 680px;
  padding: 3rem 3.5rem 4rem 3.5rem;
}

/* sections */
.main section { margin-bottom: 3rem; }

.main h2 {
  font-size: 1.1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text);
  margin: 0 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--text);
}

.main p {
  margin: 0 0 0.9rem;
  color: var(--soft);
}
.main p:last-child { margin-bottom: 0; }

/* ---------- sidebar name link ---------- */
.sidebar__name a { color: inherit; }
.sidebar__name a:hover { text-decoration: none; color: var(--accent); }

/* ---------- research page ---------- */
.project {
  margin-bottom: 1.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--rule);
}
.project:last-child { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }

.main h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.3rem;
  color: var(--text);
}

/* ---------- reading page ---------- */
.reading-intro { color: var(--faint); margin-bottom: 1.5rem; }

.books {
  list-style: none;
  padding: 0;
  margin: 0;
}

.book {
  margin-bottom: 1.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--rule);
}
.book:last-child { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }

.book__title {
  font-weight: 600;
  color: var(--text);
}

.book__author {
  font-size: 0.88rem;
  color: var(--faint);
  margin-bottom: 0.4rem;
}

.book__note {
  margin: 0;
  color: var(--soft);
}

/* ---------- mobile ---------- */
@media (max-width: 640px) {
  .layout { flex-direction: column; }

  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--rule);
  }

  .sidebar__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    align-items: flex-start;
    padding: 1.5rem 1.25rem;
  }

  .photo { width: 80px; height: 80px; margin: 0; }

  .sidebar__nav { border: none; padding: 0; margin-bottom: 0; }

  .main { padding: 2rem 1.25rem 3rem; }
}
