/* ─────────────────────────────────────────────────────────────────
   Monolith — site styles
   Fonts are loaded via <link> to Google Fonts in each page's <head>.
   ───────────────────────────────────────────────────────────────── */
: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: inline-flex; align-items: center; line-height: 0; text-decoration: none; }
/* Monolith mark — black rectangle, 7:5. Uses --ink so it flips to white in dark mode. */
.mark { width: auto; height: 40px; aspect-ratio: 7 / 5; background: var(--ink); display: block; flex: none; }
.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); }
.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: auto; height: 60px; aspect-ratio: 7 / 5; background: var(--ink); 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) */
.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;
  cursor: pointer;
  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); }

/* ── Application modal ─────────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 100; display: none; }
.modal.is-open { display: block; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.45); }
html[data-theme="dark"] .modal__backdrop { background: rgba(0, 0, 0, 0.62); }
.modal__panel {
  position: relative;
  background: var(--bg);
  color: var(--ink);
  width: min(560px, calc(100% - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  margin: 24px auto;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 42px 42px 36px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.22);
}
.modal__close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: none;
  border: 0;
  font-size: 26px;
  line-height: 1;
  color: var(--muted-2);
  cursor: pointer;
}
.modal__close:hover { color: var(--ink); }
.modal__eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted-2);
  margin: 0 0 8px;
}
.modal__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 26px;
  line-height: 1.2;
  margin: 0 0 26px;
  color: var(--ink);
}
.form-group { display: flex; flex-direction: column; gap: 7px; margin-bottom: 20px; }
.form-group > label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted-2);
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
  outline: none;
  width: 100%;
  transition: border-color 0.15s ease;
}
.form-group input:focus,
.form-group textarea:focus { border-bottom-color: var(--ink); }
.form-group textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.dropzone {
  border: 1px dashed var(--muted);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--muted-2);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.dropzone:hover, .dropzone.is-drag { border-color: var(--ink); background: var(--fill); }
.dropzone.has-file { color: var(--ink); border-style: solid; border-color: var(--line); }
.dropzone input[type="file"] { display: none; }
.form-submit { display: flex; justify-content: flex-end; margin-top: 6px; }
.form-success { display: none; font-family: var(--serif); font-size: 16px; line-height: 1.5; color: var(--ink); }

/* ── Footer ───────────────────────────────────────────────────── */
.footer {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 28px 32px;
  margin-top: auto;
}
.footer__left, .footer__right {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  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 { height: 26px; }
  .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 { height: 40px; }
  .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; }
  .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; }
  .modal__panel { padding: 36px 24px 30px; }
}
@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; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
