/* ── Self-hosted Inter (so the UI never falls back to a system sans) ── */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 200;
  font-display: swap;
  src: url("fonts/inter-latin-200-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("fonts/inter-latin-300-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/inter-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/inter-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/geist-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/geist-mono-latin-500-normal.woff2") format("woff2");
}

:root {
  --bg: #ffffff;
  --ink: #0c0c0c;
  --ink-soft: #1b1b1b;
  --muted: #b3b3b0;
  --muted-2: #8d8d8a;
  --line: #ececea;
  --solid: #111111;
  --solid-ink: #ffffff;
  --fill: #ecebe7;
  --sidebar-w: 232px;
  --content-w: 600px;
  --gutter: 96px;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

html[data-theme="dark"] {
  --bg: #0d0d0d;
  --ink: #f4f4f1;
  --ink-soft: #d8d8d4;
  --muted: #5c5c59;
  --muted-2: #777774;
  --line: #1f1f1f;
  --solid: #f4f4f1;
  --solid-ink: #0d0d0d;
  --fill: #1b1b1b;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

.app { display: flex; min-height: 100vh; }

/* ── Sidebar ──────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: transparent;
  display: flex;
  flex-direction: column;
  padding: 64px 22px 22px;
  z-index: 10;
}

.brand { display: block; line-height: 0; }
.mark { width: 168px; height: auto; display: block; }

.nav-toggle {
  display: none;
  width: 40px;
  height: 34px;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.nav-toggle__lines,
.nav-toggle__lines::before,
.nav-toggle__lines::after {
  content: "";
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle__lines { position: relative; }
.nav-toggle__lines::before { position: absolute; top: -7px; left: 0; }
.nav-toggle__lines::after { position: absolute; top: 7px; left: 0; }
.sidebar.is-open .nav-toggle__lines { background: transparent; }
.sidebar.is-open .nav-toggle__lines::before { transform: translateY(7px) rotate(45deg); }
.sidebar.is-open .nav-toggle__lines::after { transform: translateY(-7px) rotate(-45deg); }
/* Logo is black on transparent; flip to white in dark mode */
html[data-theme="dark"] .mark,
html[data-theme="dark"] .hero__mark { filter: invert(1); }

.nav {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.nav__item {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 7px 10px;
  border-radius: 7px;
  text-decoration: none;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.1px;
  color: var(--ink);
  transition: background 0.15s ease;
}
.nav__item:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.nav__item.is-active { background: var(--fill); }
.nav__num {
  font-family: var(--mono);
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  min-width: 20px;
}

.sidebar__footer { margin-top: auto; }
.mode {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: var(--bg);
  cursor: pointer;
  border-radius: 999px;
  padding: 6px 12px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 300;
  color: var(--ink);
  transition: background 0.15s ease;
}
.mode:hover { background: var(--fill); }
.mode__icon { font-size: 12px; line-height: 1; }

/* ── Main ─────────────────────────────────────────────────────── */
.main {
  margin-left: 0;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.rule {
  border: 0;
  border-top: 1px solid var(--line);
  width: var(--content-w);
  max-width: calc(100% - 44px);
  margin: 0 auto;
}
.careers + .rule { width: 720px; }

/* Hero */
.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 68px 24px 36px;
}
.hero__mark { width: 60px; height: auto; display: block; }

/* ── Sections ─────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }
.section { padding: 84px 24px; scroll-margin-top: 24px; }

.section__num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 24px;
}
.section__num--center { text-align: center; }

.section__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 30px;
  line-height: 1.25;
  letter-spacing: 0.1px;
  margin: 0;
  color: var(--ink);
}
.section__title--center { text-align: center; width: var(--content-w); max-width: 100%; margin-left: auto; margin-right: auto; }
.section__title--brand { letter-spacing: 3px; font-size: 34px; }

/* Academic footnote reference + note */
.footnote-ref {
  font-size: 0.34em;
  font-weight: 400;
  letter-spacing: normal;
  vertical-align: super;
  line-height: 0;
}
.footnote-ref a { text-decoration: none; color: var(--muted-2); }
.footnote-ref a:hover { color: var(--ink); }

.footnotes {
  width: var(--content-w);
  max-width: 100%;
  margin: 52px auto 0;
}
.footnotes::before {
  content: "";
  display: block;
  width: 520px;
  max-width: 100%;
  border-top: 1px solid var(--line);
  margin-bottom: 16px;
}
.footnote {
  font-family: var(--serif);
  font-style: normal;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted-2);
  margin: 0;
}
.footnote__num {
  font-style: normal;
  font-size: 0.72em;
  margin-right: 3px;
}

/* Intro: centered header + centered prose column */
.section--intro { padding-top: 20px; padding-bottom: 60px; }
.prose {
  width: var(--content-w);
  max-width: 100%;
  margin: 56px auto 0;
}
.prose p {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0 0 24px;
}
.prose p:last-child { margin-bottom: 0; }
.prose__fade {
  background: linear-gradient(
    to bottom,
    var(--ink-soft) 0%,
    var(--ink-soft) 18%,
    var(--muted) 78%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Numbered sections (Join us / Contact): centered column matching the intro,
   with the number stacked on top of the text. Equal, taller blocks so a nav
   click can scroll the section to the top rather than bottoming out the page. */
.section:not(.section--intro) { min-height: 34vh; }
.section:not(.section--intro) .section__num,
.section:not(.section--intro) .section__body {
  width: var(--content-w);
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}
.section:not(.section--intro) .section__num {
  margin-bottom: 22px;
  text-align: center;
}
.section:not(.section--intro) .actions { justify-content: center; }

.section__lead {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
  margin: 0 0 26px;
}
.section__lead a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.15s ease;
}
.section__lead a:hover { color: var(--muted-2); }

/* ── Buttons ──────────────────────────────────────────────────── */
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid transparent;
  cursor: pointer;
  border-radius: 999px;
  padding: 10px 18px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 450;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
.btn__icon { font-size: 13px; line-height: 1; }
.btn--solid { background: var(--solid); color: var(--solid-ink); }
.btn--solid:hover { opacity: 0.86; }
.btn--fill { background: var(--fill); color: var(--ink); }
.btn--fill:hover { background: color-mix(in srgb, var(--ink) 10%, transparent); }
.btn--ghost { background: var(--bg); color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--fill); }
.btn--join { background: #6B8159; color: #fff; border-color: #6B8159; }
.btn--join:hover { background: #5E724E; border-color: #5E724E; }

/* ── Careers page ─────────────────────────────────────────────── */
.careers {
  width: 720px;
  max-width: 100%;
  margin: 0 auto;
  padding: 96px 24px 88px;
}
.careers__intro {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-soft);
  text-align: center;
  max-width: 520px;
  margin: 24px auto 0;
}

.jobs { margin-top: 64px; }
.jobs__status {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--muted-2);
  text-align: center;
  margin: 40px 0;
}
.jobs__status a { color: var(--ink); }

.jobs__group + .jobs__group { margin-top: 48px; }
.jobs__dept {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--mono);
  font-weight: 400;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted-2);
  margin: 0 0 6px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.jobs__count { color: var(--muted); }

.job {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 8px 18px 4px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  border-radius: 6px;
  transition: background 0.15s ease, padding 0.15s ease;
}
.job:hover { background: var(--fill); padding-left: 12px; padding-right: 12px; }
.job__main { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.job__title { font-family: var(--serif); font-size: 19px; line-height: 1.3; }
.job__meta { font-family: var(--sans); font-size: 13px; font-weight: 300; color: var(--muted-2); }
.job__aside {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-shrink: 0;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted-2);
}
.job__comp { white-space: nowrap; }
.job__arrow { color: var(--muted); transition: transform 0.15s ease, color 0.15s ease; }
.job:hover .job__arrow { color: var(--ink); transform: translate(2px, -2px); }

/* ── Footer ───────────────────────────────────────────────────── */
.footer {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  padding: 28px 32px;
  margin-top: auto;
}
.footer__left, .footer__right {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted-2);
}
.footer a { text-decoration: none; color: var(--muted-2); }
.footer a:hover { color: var(--ink); }
.footer__brand { color: var(--muted-2); }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 860px) {
  .app { flex-direction: column; }
  .sidebar {
    position: sticky;
    top: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    padding: 12px 16px;
    background: var(--bg);
    border-right: 0;
    border-bottom: 1px solid var(--line);
    z-index: 20;
  }
  .brand { order: 1; }
  .mark { width: 116px; }
  .nav-toggle { display: inline-flex; order: 2; margin-left: auto; }

  .nav {
    order: 3;
    flex-basis: 100%;
    margin: 4px 0 0;
    padding: 8px 0 2px;
    border-top: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    display: none;
  }
  .sidebar.is-open .nav { display: flex; }
  .nav__item { padding: 11px 8px; }

  .sidebar__footer {
    order: 4;
    flex-basis: 100%;
    display: none;
    margin: 0;
    padding-bottom: 6px;
  }
  .sidebar.is-open .sidebar__footer { display: block; }

  .main { margin-left: 0; }

  .hero { padding: 48px 24px 18px; }
  .hero__mark { width: 36px; }
  .section { padding: 52px 22px; }
  .section--intro { padding-top: 16px; padding-bottom: 56px; }
  .prose { margin-top: 36px; }
  .footnotes { margin-top: 40px; }
  .section__title { font-size: 25px; }

  /* On mobile the side nav is a sticky top bar, so the tall min-heights that
     shape the desktop scroll behaviour just create empty voids. Let the lower
     sections size to their content instead. */
  .section:not(.section--intro) { min-height: auto; }
  .section:not(.section--intro) .section__num { margin-bottom: 16px; }

  .careers { padding: 56px 22px 64px; }
  .jobs { margin-top: 44px; }
}

@media (max-width: 560px) {
  .job { flex-direction: column; gap: 8px; }
  .job__aside { gap: 10px; }
}

@media (max-width: 520px) {
  .section__lead br { display: none; }
  .section__title br { display: none; }
}
