/* naomi-gendler.com: shared styles for every page */

:root {
  --bg: #fbfaf7;
  --text: #1a1c21;
  --muted: #565b66;
  --faint: #81868f;
  --rule: #e4e1da;
  --accent: #24487f;
  --accent-strong: #163463;
  --accent-wash: #eef1f6;
  --serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --measure: 46rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --text: #e6e4df;
    --muted: #a6aab3;
    --faint: #7d828c;
    --rule: #2a2e35;
    --accent: #9fbbea;
    --accent-strong: #c6d6f3;
    --accent-wash: #19202b;
    color-scheme: dark;
  }
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.65;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
}
a:hover { color: var(--accent-strong); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

p { margin: 0 0 1rem; }
em, i { font-style: italic; }

.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 1.25rem; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 10; background: var(--bg); padding: 0.5rem 0.75rem; }

/* ---------- Header ---------- */

.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-top: 1.15rem;
  padding-bottom: 1.05rem;
}

.site-name {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--text);
  text-decoration: none;
}
.site-name:hover { color: var(--text); }
.site-name svg { width: 1.35rem; height: 1.35rem; flex: none; }

.site-nav { font-family: var(--sans); font-size: 0.875rem; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.35rem; }
.site-nav a {
  display: inline-block;
  padding: 0.2rem 0;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1.5px solid transparent;
}
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }

/* ---------- Page scaffolding ---------- */

main { padding: 3.25rem 0 4.5rem; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; margin: 0; }

.page-title { font-size: clamp(2rem, 5vw, 2.4rem); font-weight: 500; letter-spacing: -0.02em; margin-bottom: 0.85rem; }
.page-intro { color: var(--muted); margin-bottom: 2.75rem; }
.page-title + section { margin-top: 2.25rem; }

section + section { margin-top: 3.5rem; }

/* Small uppercase label followed by a hairline, used to open list sections. */
.label {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 1.1rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--faint);
}
.label::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

.sublabel {
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin: 1.75rem 0 0.4rem;
}

.note { font-family: var(--sans); font-size: 0.8125rem; color: var(--faint); margin-top: 0.75rem; }

/* ---------- Home ---------- */

.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.hero:has(.portrait) { grid-template-columns: minmax(0, 1fr) 11rem; }
.hero h1 { font-size: clamp(2.5rem, 7vw, 3.2rem); font-weight: 500; letter-spacing: -0.025em; line-height: 1.05; }
.role { font-family: var(--sans); font-size: 0.95rem; line-height: 1.5; color: var(--muted); margin: 0.75rem 0 1.9rem; }
.lede { font-size: 1.3rem; line-height: 1.5; }

.portrait { margin: 0.4rem 0 0; }
.portrait img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 4px; }

.contact { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 1.9rem; font-family: var(--sans); font-size: 0.875rem; }
.contact a {
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 0.85rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.contact a:hover { border-color: var(--accent); color: var(--accent); }
.contact a.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.contact a.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--bg); }

.areas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.9rem; }
.area {
  display: flex;
  flex-direction: column;
  padding: 1.05rem 1.1rem 1.1rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s;
}
.area:hover { border-color: var(--accent); color: var(--text); }
.area h3 { font-size: 1.05rem; margin-bottom: 0.45rem; }
.area p { flex: 1; margin: 0 0 0.8rem; font-size: 0.95rem; line-height: 1.5; color: var(--muted); }
.area .more { font-family: var(--sans); font-size: 0.8125rem; color: var(--accent); }

/* ---------- Dated lists (news, talks, teaching) ---------- */

.dated { list-style: none; margin: 0; padding: 0; }
.dated li {
  display: grid;
  grid-template-columns: 6.25rem minmax(0, 1fr);
  gap: 1.1rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--rule);
}
.dated li:last-child { border-bottom: 1px solid var(--rule); }
.dated .when {
  font-family: var(--sans);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--faint);
  padding-top: 0.2rem;
  font-variant-numeric: tabular-nums;
}
.dated .title { font-weight: 600; }
.dated .where { display: block; font-size: 0.975rem; color: var(--muted); }
.dated .tag {
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--muted);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
  margin-left: 0.35rem;
  white-space: nowrap;
  vertical-align: 0.1em;
}

.dated .tag-link { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); text-decoration: none; }
.dated .tag-link:hover { color: var(--bg); background: var(--accent); border-color: var(--accent); }

/* ---------- Recorded talks ---------- */

.videos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.75rem 1.1rem; }
.video-thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 4px; overflow: hidden; background: #000; }
.video-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; }
.video-thumb:hover img { transform: scale(1.025); }
.video-thumb::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3.2rem;
  height: 3.2rem;
  margin: -1.6rem 0 0 -1.6rem;
  border-radius: 50%;
  background: rgba(18, 20, 26, 0.72) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 6.5v11l9-5.5z' fill='white'/%3E%3C/svg%3E") center / 1.3rem no-repeat;
  transition: background-color 0.15s;
}
.video-thumb:hover::after { background-color: var(--accent); }
.video-time {
  position: absolute;
  right: 0.45rem;
  bottom: 0.45rem;
  padding: 0.05rem 0.4rem;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font: 500 0.75rem/1.45 var(--sans);
}
.video-frame { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 4px; background: #000; }
.video-title { font-size: 1.02rem; line-height: 1.35; margin: 0.65rem 0 0.2rem; }
.video-meta { margin: 0; font-family: var(--sans); font-size: 0.8125rem; line-height: 1.45; color: var(--muted); }

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

.theme h2 { font-size: 1.55rem; margin-bottom: 1rem; }
.theme + .theme { margin-top: 3.75rem; padding-top: 3rem; border-top: 1px solid var(--rule); }
.paper-ref { font-style: italic; }

.key-papers { margin-top: 1.5rem; padding: 1rem 1.2rem 1.1rem; background: var(--accent-wash); border-radius: 6px; }
.key-papers h3 {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.55rem;
}
.key-papers ul { list-style: none; margin: 0; padding: 0; font-size: 1rem; line-height: 1.45; }
.key-papers li + li { margin-top: 0.5rem; }
.key-papers .venue { font-family: var(--sans); font-size: 0.8125rem; color: var(--muted); white-space: nowrap; }

/* ---------- Publications ---------- */

.year-group {
  display: grid;
  grid-template-columns: 4.25rem minmax(0, 1fr);
  gap: 1.1rem;
  padding-top: 1.4rem;
  margin-top: 1.4rem;
  border-top: 1px solid var(--rule);
}
.year-group h2 { font-family: var(--sans); font-size: 0.875rem; font-weight: 600; letter-spacing: 0; color: var(--faint); padding-top: 0.2rem; }

.pubs { list-style: none; margin: 0; padding: 0; }
.pub + .pub { margin-top: 1.5rem; }
.pub-title { font-size: 1.075rem; font-weight: 600; line-height: 1.35; color: var(--text); text-decoration: none; }
a.pub-title:hover { color: var(--accent); text-decoration: underline; }
.pub-authors { margin-top: 0.25rem; font-size: 1rem; line-height: 1.5; color: var(--muted); }
.pub-authors .me { color: var(--text); font-weight: 600; }
.pub-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.95rem;
  margin-top: 0.35rem;
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--faint);
}
.pub-meta a { text-decoration: none; }
.pub-meta a:hover { text-decoration: underline; }
.pub-meta .journal { color: var(--muted); }

/* ---------- Photo gallery and viewer ---------- */

/* Square tiles keep every row even; .wide tiles span two columns. The grid
   shows a centered crop, and the viewer shows the whole photo. */
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: dense; gap: 0.75rem; }
.gallery a {
  position: relative;
  display: block;
  aspect-ratio: 1;
  border-radius: 4px;
  overflow: hidden;
  background: var(--rule);
}
.gallery a.wide { grid-column: span 2; aspect-ratio: auto; }
.gallery img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; }
.gallery a:hover img { transform: scale(1.025); }

.lightbox {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  padding: 3.5rem 3.5rem 1.5rem;
  border: 0;
  background: rgba(12, 13, 16, 0.97);
  color: #e6e4df;
}
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox::backdrop { background: transparent; }
.lightbox figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 0.8rem; }
.lightbox img { display: block; max-width: 100%; max-height: calc(100vh - 8rem); width: auto; height: auto; border-radius: 3px; }
.lightbox figcaption { font-family: var(--sans); font-size: 0.875rem; color: #c3c6cd; text-align: center; }
.lightbox button {
  position: absolute;
  padding: 0.4rem 0.8rem;
  border: 0;
  background: none;
  color: #fff;
  font: 300 2.25rem/1 var(--sans);
  opacity: 0.75;
  cursor: pointer;
}
.lightbox button:hover { opacity: 1; }
.lb-close { top: 0.6rem; right: 0.6rem; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); }
.lb-prev { left: 0.4rem; }
.lb-next { right: 0.4rem; }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--rule); font-family: var(--sans); font-size: 0.8125rem; color: var(--faint); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.4rem 1.5rem; padding-top: 1.5rem; padding-bottom: 2.5rem; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }

/* ---------- Small screens ---------- */

@media (max-width: 720px) {
  .areas { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 600px) {
  body { font-size: 1.0625rem; }
  main { padding-top: 2.25rem; }
  .site-nav { width: 100%; font-size: 0.8125rem; }
  .site-nav ul { gap: 0.25rem 1rem; }
  .hero:has(.portrait) { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .portrait { order: -1; width: 8.5rem; margin: 0; }
  .lede { font-size: 1.2rem; }
  .dated li { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; }
  .dated .when { padding-top: 0; }
  .year-group { grid-template-columns: minmax(0, 1fr); gap: 0.6rem; }
  .key-papers .venue { white-space: normal; }
  .videos { grid-template-columns: minmax(0, 1fr); }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
  .gallery a.wide { aspect-ratio: 2 / 1; }
  .lightbox { padding: 3rem 0.5rem 1rem; }
  .lb-prev, .lb-next { top: auto; bottom: 0.5rem; transform: none; }
}

/* ---------- Print ---------- */

@media print {
  .site-nav, .skip, .contact { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  main { padding: 1rem 0; }
  a { color: inherit; text-decoration: none; }
}
