* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
:root {
  --bg: #f2eee4;
  --panel: rgba(242, 238, 228, 0.88);
  --ink: #1c1913;
  --ink-soft: #2a251c;
  --body: #4a4437;
  --muted: #6f6857;
  --meta: #8a8271;
  --faint: #b3ab98;
  --rule: #ddd6c5;
  --rule-strong: #1c1913;
  --chip-border: #d3cbb8;
  --accent: oklch(0.44 0.09 152);
  --num: #cbc3b0;
  --hover: rgba(28, 25, 19, 0.03);
}
:root[data-theme="dark"] {
  --bg: #17140f;
  --panel: rgba(23, 20, 15, 0.85);
  --ink: #f3ede1;
  --ink-soft: #e7dfd1;
  --body: #c4bba8;
  --muted: #9a9182;
  --meta: #8a8271;
  --faint: #6b6353;
  --rule: #37322a;
  --rule-strong: #f3ede1;
  --chip-border: #453f35;
  --accent: oklch(0.72 0.12 152);
  --num: #4a4438;
  --hover: rgba(243, 237, 225, 0.04);
}
body {
  margin: 0;
  background: var(--bg);
  transition: background 0.3s ease;
}
a {
  color: inherit;
  text-decoration: none;
}
::selection {
  background: oklch(0.44 0.09 152 / 0.2);
}
section[id] {
  scroll-margin-top: 72px;
}

.page {
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition:
    background 0.3s ease,
    color 0.3s ease;
}
.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding-left: 40px;
  padding-right: 40px;
}

/* top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--panel);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
}
.nav {
  display: flex;
  gap: 22px;
  align-items: center;
}
.nav-icon {
  color: var(--muted);
  display: inline-flex;
  transition: color 0.2s ease;
}
.nav-icon:hover {
  color: var(--accent);
}
.nav-icon .ic {
  width: 16px;
  height: 16px;
}

/* inline icons */
.ic {
  fill: currentColor;
  flex: none;
  display: inline-block;
  vertical-align: middle;
}
.nav-link {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition:
    color 0.2s ease,
    border-color 0.2s ease;
}
.nav-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
#themeBtn {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--chip-border);
  border-radius: 999px;
  padding: 6px 13px;
  cursor: pointer;
  transition:
    color 0.2s ease,
    border-color 0.2s ease;
}
#themeBtn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* masthead */
.masthead {
  padding-top: 76px;
  padding-bottom: 56px;
}
.masthead-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--meta);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 14px;
}
.headline {
  margin: 36px 0 0;
  font-family: "Newsreader", serif;
  font-weight: 400;
  font-size: clamp(44px, 7vw, 88px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.headline em {
  font-style: italic;
  color: var(--accent);
}
.intro-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  margin-top: 44px;
  align-items: start;
}
.lede {
  margin: 0;
  font-family: "Newsreader", serif;
  font-size: 20px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 520px;
}
.facts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12.5px;
  color: var(--muted);
}
.fact {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 8px;
}
.fact-val {
  color: var(--ink);
}
.fact-link {
  display: flex;
  justify-content: space-between;
  padding-top: 2px;
  color: var(--accent);
}

/* section shells */
.section {
  padding-top: 56px;
  padding-bottom: 56px;
}
.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  border-bottom: 2px solid var(--rule-strong);
  padding-bottom: 12px;
}
.section-num {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--accent);
}
.section-title {
  margin: 0;
  font-family: "Newsreader", serif;
  font-weight: 500;
  font-size: 26px;
  letter-spacing: -0.01em;
}

/* chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}
.chip {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  padding: 4px 10px;
  border: 1px solid var(--chip-border);
  border-radius: 3px;
  color: var(--muted);
}
.chip--icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chip--icon .ic {
  width: 12px;
  height: 12px;
}

/* experience */
.job {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 32px;
  padding: 28px 0;
  border-bottom: 1px solid var(--rule);
}
.monogram {
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--chip-border);
  border-radius: 8px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
  background: var(--hover);
}
.monogram--logo {
  background: #fff;
  padding: 7px;
  overflow: hidden;
}
.monogram--logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.monogram--logo-bleed {
  background: none;
  padding: 0;
}
.monogram--logo-bleed img {
  object-fit: cover;
}
.job-dates {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--meta);
  line-height: 1.6;
}
.job-place {
  color: var(--faint);
}
.job-company {
  font-family: "Newsreader", serif;
  font-size: 23px;
  letter-spacing: -0.01em;
}
.job-role {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 6px 0 10px;
}
.job-blurb {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--body);
  max-width: 640px;
}

/* selected work */
.work-item {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 28px;
  align-items: baseline;
  padding: 30px 0;
  border-bottom: 1px solid var(--rule);
  transition: background 0.2s ease;
}
.work-item:hover {
  background: var(--hover);
}
.work-item--archived {
  cursor: default;
}
.work-item--archived:hover {
  background: transparent;
}
.work-visit--archived {
  color: var(--faint);
}
.work-item--stealth {
  cursor: default;
}
.work-item--stealth:hover {
  background: transparent;
}
.work-item--stealth .work-name {
  color: var(--muted);
}
.work-visit--stealth {
  color: var(--accent);
}

/* archived collapsible */
.archive {
  margin-top: 8px;
}
.archive-toggle {
  list-style: none;
  cursor: pointer;
  padding: 18px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--meta);
  transition: color 0.2s ease;
}
.archive-toggle:hover {
  color: var(--accent);
}
.archive-toggle::-webkit-details-marker {
  display: none;
}
.archive-toggle::before {
  content: "+";
  font-size: 15px;
  line-height: 1;
}
details[open] .archive-toggle::before {
  content: "–";
}
.archive-count {
  border: 1px solid var(--chip-border);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
  color: var(--muted);
}
.work-num {
  font-family: "Newsreader", serif;
  font-size: 44px;
  line-height: 1;
  color: var(--num);
}
.work-name {
  font-family: "Newsreader", serif;
  font-size: 28px;
  letter-spacing: -0.01em;
}
.work-desc {
  margin: 8px 0 0;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--body);
  max-width: 560px;
}
.work-visit {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--accent);
  white-space: nowrap;
  padding-top: 6px;
}

/* testimonials */
.testi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px 56px;
  margin-top: 36px;
}
.testi {
  margin: 0;
}
.testi-mark {
  font-family: "Newsreader", serif;
  font-size: 40px;
  line-height: 0;
  color: var(--accent);
  height: 20px;
}
.testi-quote {
  margin: 0;
  font-family: "Newsreader", serif;
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.testi-cap {
  margin-top: 16px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--meta);
  text-transform: uppercase;
  border-top: 1px solid var(--rule);
  padding-top: 12px;
}

/* research */
.pub {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 28px;
  align-items: baseline;
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
  transition: background 0.2s ease;
}
.pub:hover {
  background: var(--hover);
}
.pub-year {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  color: var(--meta);
}
.pub-title {
  font-family: "Newsreader", serif;
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.pub-pdf {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--accent);
  padding-top: 2px;
}
.research-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-top: 40px;
}
.label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--meta);
  margin-bottom: 12px;
}
.edu {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.edu-logo {
  width: 40px;
  height: auto;
  border-radius: 4px;
  flex: none;
}
.edu-school {
  font-family: "Newsreader", serif;
  font-size: 20px;
}
.edu-detail {
  font-size: 13.5px;
  color: var(--body);
  margin-top: 6px;
  line-height: 1.6;
}
.edu-detail .muted {
  color: var(--meta);
}

/* footer */
.footer {
  padding-top: 56px;
  padding-bottom: 104px;
}
.footer-inner {
  border-top: 2px solid var(--rule-strong);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-cta {
  font-family: "Newsreader", serif;
  font-style: italic;
  font-size: 22px;
}
.footer-links {
  display: flex;
  gap: 22px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
}
.footer-links a {
  color: var(--muted);
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.footer-links a:hover {
  color: var(--accent);
}
.footer-links .ic {
  width: 14px;
  height: 14px;
}

/* responsive */
@media (max-width: 720px) {
  .wrap {
    padding-left: 22px;
    padding-right: 22px;
  }
  .nav {
    gap: 16px;
  }
  .nav-link {
    display: none;
  }
  .masthead {
    padding-top: 48px;
    padding-bottom: 40px;
  }
  .intro-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .job {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .work-item {
    grid-template-columns: 40px 1fr;
  }
  .work-visit {
    display: none;
  }
  .testi-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .pub {
    grid-template-columns: 56px 1fr;
  }
  .pub-pdf {
    display: none;
  }
  .research-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}
