/* Structural base shared by all concepts. Themes set the variables and add personality. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--fs,1.0625rem);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--link,var(--accent));
  text-underline-offset: .18em;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-thickness: 2px;
}

h1,
h2,
h3 {
  font-family: var(--font-head);
  line-height: 1.15;
  margin: 0 0 .5em;
  font-weight: var(--head-weight,600);
  letter-spacing: var(--head-track,-.01em);
}

h2 {
  font-size: clamp(1.6rem,3vw,2.2rem);
}

h3 {
  font-size: 1.2rem;
}

p {
  margin: 0 0 1em;
}

[hidden] {
  display: none!important;
}

.wrap {
  max-width: var(--maxw,1120px);
  margin: 0 auto;
  padding: 0 clamp(16px,4vw,40px);
}

.narrow {
  max-width: 760px;
}

.muted {
  color: var(--muted);
}

.kicker {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .6em;
}

.btn {
  display: inline-block;
  padding: .7em 1.2em;
  border: 1px solid var(--fg);
  color: var(--fg);
  text-decoration: none;
  border-radius: var(--radius,0);
  font-family: var(--font-mono);
  font-size: .85rem;
  letter-spacing: .03em;
}

.btn:hover {
  background: var(--fg);
  color: var(--bg);
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent,#fff);
}

.skip {
  position: absolute;
  left: -999px;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 99;
  background: var(--bg);
  padding: .5rem;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* header / nav */
.site-header .nav a {
  text-decoration: none;
  color: inherit;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid currentColor;
  color: inherit;
  font: inherit;
  padding: .35em .7em;
  border-radius: var(--radius,0);
}

@media (max-width:820px) {
  .nav-toggle {
    display: inline-block;
  }
  .site-header .nav {
    display: none;
    width: 100%;
  }
  body.nav-open .site-header .nav {
    display: flex;
    flex-direction: column;
    gap: .25rem;
  }
}

.page-head {
  padding: clamp(2.5rem,7vw,5rem) 0 2rem;
}

.page-head h1 {
  font-size: clamp(2.2rem,6vw,3.8rem);
}

main {
  padding-bottom: 4rem;
}

main section {
  margin-bottom: 3rem;
}

/* research */
.lede {
  font-size: 1.2em;
  line-height: 1.55;
}

.questions {
  counter-reset: q;
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  display: grid;
  gap: .75rem;
}

.questions li {
  counter-increment: q;
  padding: 1rem 1rem 1rem 3.4rem;
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius,0);
  background: var(--card);
}

.questions li::before {
  content: counter(q,decimal-leading-zero);
  position: absolute;
  left: 1rem;
  top: 1rem;
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: .9rem;
}

.theme {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(1.5rem,4vw,3.5rem);
  align-items: start;
  padding-top: 2.5rem;
  border-top: 1px solid var(--line);
}

.theme:nth-of-type(odd) .theme-fig {
  order: -1;
}

.theme .summary {
  font-size: 1.1em;
  font-weight: 500;
}

.theme-fig {
  margin: 0;
  position: sticky;
  top: 6rem;
}

.ph {
  aspect-ratio: 4/3;
  display: grid;
  place-items: center;
  border: 1px dashed var(--muted);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: .8rem;
  border-radius: var(--radius,0);
  text-align: center;
  padding: 1rem;
}

.f-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(240px,1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.f-card {
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius,0);
  background: var(--card);
}

.f-card p {
  font-size: .95em;
}

.cite {
  font-family: var(--font-mono);
  font-size: .75rem!important;
  color: var(--muted);
  margin: 0;
}

@media (max-width:820px) {
  .theme {
    grid-template-columns: 1fr;
  }
  .theme-fig {
    position: static;
    order: -1;
  }
}

/* teaching */
.principles {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(300px,1fr));
  gap: 1.25rem;
}

.principle {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius,0);
  background: var(--card);
  position: relative;
}

.principle .num {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: .85rem;
  display: block;
  margin-bottom: .4rem;
}

.course-list,
.mentees,
.cv-list,
.news {
  list-style: none;
  padding: 0;
  margin: 0;
}

.course-list li,
.cv-list li {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1rem;
  padding: .9rem 0;
  border-bottom: 1px solid var(--line);
}

.c-when,
.cv-when,
.news-when,
.m-when {
  font-family: var(--font-mono);
  font-size: .82rem;
  color: var(--muted);
  padding-top: .2em;
}

.c-main {
  display: flex;
  flex-direction: column;
}

.c-main span {
  color: var(--muted);
  font-size: .95em;
}

.mentees {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(240px,1fr));
  gap: .75rem;
  margin-top: 1rem;
}

.mentees li {
  display: flex;
  flex-direction: column;
  padding: .9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius,0);
}

.mentees li span {
  font-size: .9em;
  color: var(--muted);
}

@media (max-width:600px) {
  .course-list li,
  .cv-list li {
    grid-template-columns: 1fr;
    gap: .2rem;
  }
}

/* publications */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  margin-bottom: 2rem;
  position: sticky;
  top: var(--sticky-top,4.5rem);
  background: var(--bg);
  padding: .75rem 0;
  z-index: 5;
}

.chip {
  font: inherit;
  font-family: var(--font-mono);
  font-size: .8rem;
  padding: .45em .9em;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  border-radius: 999px;
  cursor: pointer;
}

.chip.is-on {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.search {
  font: inherit;
  font-size: .95rem;
  padding: .55em .9em;
  border: 1px solid var(--line);
  border-radius: var(--radius,0);
  background: var(--card);
  color: var(--fg);
  flex: 1;
  min-width: 220px;
}

.pub-year {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1rem;
  margin-bottom: 1rem!important;
}

.year-label {
  font-family: var(--font-mono);
  font-size: .9rem;
  color: var(--accent);
  font-weight: 500;
  padding-top: 1rem;
}

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

.pub {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: .15rem;
}

.pub-authors {
  font-size: .9em;
  color: var(--muted);
}

.pub-authors strong {
  color: var(--fg);
}

.pub-title {
  font-weight: 600;
  font-family: var(--font-head);
}

.pub-venue {
  font-style: italic;
  font-size: .95em;
}

.pub-links {
  display: flex;
  gap: .5rem;
  margin-top: .3rem;
}

.pub-links a {
  font-family: var(--font-mono);
  font-size: .72rem;
  text-decoration: none;
  border: 1px solid var(--line);
  padding: .15em .55em;
  border-radius: var(--radius,0);
}

.pub-links a:hover {
  border-color: var(--accent);
}

@media (max-width:600px) {
  .pub-year {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .year-label {
    padding-top: .5rem;
  }
}

/* news */
.news li {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 1rem;
  padding: .9rem 0;
  border-bottom: 1px solid var(--line);
}

.news .more {
  white-space: nowrap;
  font-size: .9em;
}

/* cv */
.amt {
  font-family: var(--font-mono);
  font-size: .82em;
  color: var(--accent);
  margin-left: .4em;
}

.cv-dl {
  margin-bottom: 2.5rem;
}

/* contact */
.contact {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(200px,1fr));
  gap: 1rem;
}

.contact .social {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* edible plants */
.ep-book {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2rem;
  align-items: center;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius,0);
  background: var(--card);
}

.ep-book img {
  border-radius: var(--radius,0);
}

.ep-book h2 {
  font-size: 1.5rem;
}

.ep-about details {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius,0);
}

.ep-about summary {
  cursor: pointer;
  font-weight: 600;
}

.ep-tools {
  position: sticky;
  top: var(--sticky-top,4.5rem);
  z-index: 5;
  background: var(--bg);
  padding: .75rem 0;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.5rem;
}

.ep-jump {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
}

.ep-jump a {
  font-family: var(--font-mono);
  font-size: .8rem;
  text-decoration: none;
  min-width: 1.9rem;
  text-align: center;
  padding: .25em .3em;
  border: 1px solid var(--line);
  border-radius: var(--radius,0);
  color: var(--fg);
}

.ep-jump a:hover {
  background: var(--accent);
  color: var(--on-accent,#fff);
  border-color: var(--accent);
}

.ep-letter {
  margin-bottom: 2rem!important;
  scroll-margin-top: 9rem;
}

.ep-letter h3 {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: .4rem;
}

.ep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(190px,1fr));
  gap: 1rem;
}

.ep-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: var(--radius,0);
  overflow: hidden;
  background: var(--card);
  transition: transform .15s,box-shadow .15s;
}

.ep-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
}

.ep-card img {
  aspect-ratio: 1/1;
  object-fit: contain;
  background: #fff;
  width: 100%;
}

.ep-name {
  padding: .6rem .75rem 0;
  font-size: .95rem;
}

.ep-common {
  padding: 0 .75rem .7rem;
  font-size: .85rem;
  color: var(--muted);
}

.ep-methods {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.ep-methods h2 {
  font-size: 1.4rem;
}

@media (max-width:600px) {
  .ep-book {
    grid-template-columns: 1fr;
  }
  .ep-book img {
    max-width: 180px;
  }
  .ep-grid {
    grid-template-columns: repeat(2,1fr);
  }
}

/* footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.5rem 0;
  font-size: .9rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-footer a {
  color: inherit;
}

/* mobile nav: beats theme rules */
@media (max-width:820px) {
  body:not(.nav-open) .site-header .nav {
    display: none!important;
  }
  body.nav-open .site-header .nav {
    display: flex!important;
    flex-direction: column;
    align-items: stretch;
  }
}

.pub span,
.news-text,
.c-main {
  overflow-wrap: anywhere;
}

/* research page v2 */
.toc {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: 1.5rem;
}

.toc a {
  font-family: var(--font-mono);
  font-size: .78rem;
  text-decoration: none;
  padding: .35em .8em;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--fg);
}

.toc a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.status {
  display: inline-block;
  font-size: .68rem;
  padding: .15em .55em;
  border: 1px solid currentColor;
  border-radius: 999px;
  margin-right: .5em;
  vertical-align: 1px;
}

.status-past {
  color: var(--muted);
}

.findings {
  padding-left: 1.2em;
  margin: 0 0 1.2em;
}

.findings li {
  margin-bottom: .45em;
}

.findings li::marker {
  color: var(--accent);
}

.extra {
  font-family: var(--font-mono);
  font-size: .85rem;
}

.next {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--accent);
  background: var(--card);
  border-radius: 0 var(--radius,0) var(--radius,0) 0;
}

.next h3 {
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .4rem;
  font-weight: 500;
}

.next p {
  margin: 0;
  font-size: .95em;
}

.e-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(300px,1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.e-card {
  border: 1px solid var(--line);
  border-radius: var(--radius,0);
  background: var(--card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.e-card img {
  aspect-ratio: 16/9;
  object-fit: cover;
  width: 100%;
}

.e-card>div {
  padding: 1.1rem 1.25rem;
}

.e-card p {
  font-size: .95em;
}

.e-links {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  font-family: var(--font-mono);
  font-size: .78rem!important;
}

.tool-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

.tool-list li {
  display: grid;
  grid-template-columns: 16rem 1fr;
  gap: 1rem;
  padding: .8rem 0;
  border-bottom: 1px solid var(--line);
}

.tool-list span {
  color: var(--muted);
}

@media (max-width:600px) {
  .tool-list li {
    grid-template-columns: 1fr;
    gap: .2rem;
  }
}

/* home tiles */
.tiles {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 1rem;
}

.tile {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: var(--radius,0);
  overflow: hidden;
  background: var(--card);
  transition: border-color .15s,transform .15s;
}

.tile:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.tile img,
.tile .ph {
  aspect-ratio: 3/2;
  object-fit: cover;
  width: 100%;
  border: 0;
  border-radius: 0;
}

.tile div {
  padding: 1rem 1.1rem;
}

.tile h3 {
  font-size: 1.08rem;
  margin-bottom: .3rem;
}

.tile p {
  font-size: .9rem;
  color: var(--muted);
  margin: 0;
}

.intro-text p:first-child {
  font-size: 1.15em;
}

/* resources */
.resources {
  padding-top: 2.5rem;
  border-top: 1px solid var(--line);
}

.r-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(280px,1fr));
  gap: 1.25rem;
  margin: 1.5rem 0 2rem;
}

.r-card {
  display: block;
  text-decoration: none;
  color: var(--fg);
  padding: 1.5rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius,0);
  background: var(--card);
  transition: transform .15s;
}

.r-card:hover {
  transform: translateY(-2px);
}

.r-card .r-url {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--accent);
}

.r-card h3 {
  font-size: 1.5rem;
  margin: .4rem 0;
}

.r-card p {
  margin: 0;
  color: var(--muted);
}

.r-sub {
  font-size: 1.05rem;
  margin-top: 1rem;
}

.doi {
  font-family: var(--font-mono);
  font-size: .75rem;
}

.f-card h3 a {
  color: inherit;
  text-decoration-color: var(--accent);
}

.ph-web {
  font-size: .9rem;
  line-height: 1.7;
  color: var(--accent);
  border-style: solid;
  background: var(--card);
}

@media (max-width:900px) {
  .tiles {
    grid-template-columns: repeat(2,1fr);
  }
}

@media (max-width:560px) {
  .tiles {
    grid-template-columns: 1fr;
  }
}

/* ---------- photos (one, or a gallery) ---------- */
.photos img {
  width: 100%;
  border-radius: var(--radius,0);
  display: block;
}

.photos .photo {
  margin: 0;
}

.photos figcaption {
  font-size: .82rem;
  line-height: 1.45;
  color: var(--muted);
  margin-top: .45rem;
}

.photos.one img {
  aspect-ratio: 4/3;
  object-fit: cover;
}

.photos.many {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}

.photos.many img {
  aspect-ratio: 1/1;
  object-fit: cover;
}

.photos.many .photo.wide {
  grid-column: 1/-1;
}

.photos.many .photo.wide img {
  aspect-ratio: 16/9;
}

.photos img.fit-contain {
  object-fit: contain;
  aspect-ratio: auto!important;
  background: #fff;
}

.ph-link {
  display: block;
  cursor: zoom-in;
}

.theme.has-gallery .theme-fig {
  position: static;
}

/* Research sections with 2+ photos (wide screens): the photo column is stretched to the
   height of the text, and the photos stack and share that height, so the column is
   filled whether the text is long or short. Figures with fit:'contain' keep their
   natural size. On narrow screens (photos above the text) the normal 2-column grid is used. */
@media (min-width:821px) {
  .theme.has-gallery {
    align-items: stretch;
  }
  .theme-fig .photos.many {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
  }
  .theme-fig .photos.many .photo {
    flex: 1 1 0;
    min-height: 160px;
    display: flex;
    flex-direction: column;
  }
  .theme-fig .photos.many .photo.contain,
  .theme-fig .photos.many .photo.contain .ph-link {
    flex: 0 0 auto;
    min-height: 0;
  }
  .theme-fig .photos.many .ph-link {
    flex: 1 1 0;
    min-height: 0;
    display: block;
  }
  .theme-fig .photos.many img {
    height: 100%;
    aspect-ratio: auto;
    object-fit: cover;
  }
  .theme-fig .photos.many img.fit-contain {
    height: auto;
    object-fit: contain;
  }
}

.e-photos.one img {
  aspect-ratio: 16/9;
  border-radius: 0;
}

.e-photos.many {
  padding: .75rem .75rem 0;
  gap: .5rem;
}

.r-photos,
.page-photos {
  margin: 1rem 0 2rem;
}

.page-photos.many {
  grid-template-columns: repeat(auto-fit,minmax(220px,1fr));
}

.page-photos.many .photo.wide img {
  aspect-ratio: 21/9;
  object-position: 50% 35%;
}

/* timeline (Research page; Deep Time home). Text sizes are in SVG units,
   so on narrow screens the figure keeps a minimum width and scrolls sideways. */
.timeline {
  margin: 2rem 0;
  padding: 1.5rem 0 1rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.timeline svg {
  display: block;
  width: 100%;
  min-width: 640px;
  height: auto;
  overflow: visible;
}

.timeline .ax {
  stroke: var(--muted);
  stroke-width: 1;
}

.timeline .tick {
  fill: var(--muted);
  font: 11px var(--font-mono);
}

.timeline .ev circle {
  fill: var(--accent);
}

.timeline .ev line {
  stroke: var(--accent);
  stroke-width: 1;
  stroke-dasharray: 2 3;
}

.timeline .ev text {
  fill: var(--fg);
  font: 15px var(--font-body);
}

.timeline .ev .sm {
  fill: var(--muted);
  font: 12px var(--font-mono);
}

.timeline figcaption {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--muted);
  margin-top: .75rem;
}

:root {
  --bg: #ffffff;
  --fg: #0f172a;
  --muted: #5b6476;
  --accent: #0f766e;
  --on-accent: #fff;
  --line: #e5e7eb;
  --card: #f8fafc;
  --font-body: 'Inter',system-ui,sans-serif;
  --font-head: 'Inter',system-ui,sans-serif;
  --font-mono: 'JetBrains Mono',ui-monospace,monospace;
  --fs: 1.02rem;
  --radius: 12px;
  --head-weight: 700;
  --head-track: -.025em;
  --sticky-top: 4.1rem;
}

/* Dark mode: follows the device setting until the visitor clicks the ◐ button,
   which sets data-theme="light" or "dark" on <html> (remembered per browser).
   Keep the two dark blocks below identical. */
@media (prefers-color-scheme:dark) {
  :root:not([data-theme=light]) {
    --bg: #0b1120;
    --fg: #e6e9ef;
    --muted: #94a0b4;
    --accent: #2dd4bf;
    --on-accent: #04201d;
    --line: #1e293b;
    --card: #111a2e;
    color-scheme: dark;
  }
}

:root[data-theme=dark] {
  --bg: #0b1120;
  --fg: #e6e9ef;
  --muted: #94a0b4;
  --accent: #2dd4bf;
  --on-accent: #04201d;
  --line: #1e293b;
  --card: #111a2e;
  color-scheme: dark;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb,var(--bg) 82%,transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  min-height: 4rem;
  gap: .5rem;
}

.brand {
  font-weight: 700;
  text-decoration: none;
  color: var(--fg);
  letter-spacing: -.02em;
  display: flex;
  align-items: center;
  gap: .6rem;
}

.site-header .nav {
  display: flex;
  gap: .25rem;
}

.site-header .nav a {
  padding: .45rem .8rem;
  border-radius: 8px;
  font-size: .92rem;
  color: var(--muted);
  font-weight: 500;
}

.site-header .nav a:hover {
  color: var(--fg);
  background: var(--card);
}

.site-header .nav a[aria-current] {
  color: var(--fg);
  background: var(--card);
}

.brand {
  margin-right: auto;
}

.mode {
  order: 2;
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 8px;
  width: 2.2rem;
  height: 2.2rem;
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
}

.mode:hover {
  color: var(--fg);
  background: var(--card);
}

@media (max-width:820px) {
  body.nav-open .site-header .nav {
    padding-bottom: 1rem;
  }
  .site-header .nav {
    order: 3;
  }
  .mode {
    order: 1;
  }
  .nav-toggle {
    order: 2;
  }
}

.page-head h1 {
  letter-spacing: -.035em;
}

.page-head {
  border-bottom: 1px solid var(--line);
  margin-bottom: 2.5rem;
}

.btn {
  border-radius: 10px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .92rem;
}

.hero {
  display: grid;
  grid-template-columns: 1.25fr .9fr;
  gap: clamp(2rem,5vw,4rem);
  align-items: center;
  padding: clamp(3rem,8vw,6rem) 0 3rem;
}

.hero h1 {
  font-size: clamp(2.3rem,5.2vw,3.9rem);
  letter-spacing: -.04em;
  line-height: 1.04;
}

.hero h1 span {
  background: linear-gradient(90deg,var(--accent),#65a30d);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero .role {
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 500;
  margin: -.2rem 0 1.5rem;
}

.hero .lede {
  color: var(--muted);
  font-size: 1.05rem;
}

.hero .lede a {
  color: var(--accent);
}

.hero .actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: 1.5rem;
}

.badge {
  display: inline-flex;
  gap: .5rem;
  align-items: center;
  font-size: .82rem;
  font-weight: 500;
  padding: .35rem .8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  margin-bottom: 1.2rem;
}

.badge i {
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: #22c55e;
  display: inline-block;
}

.portrait {
  position: relative;
}

.portrait img {
  border-radius: 24px;
  aspect-ratio: 4/5;
  object-fit: cover;
  object-position: 62% 30%;
  box-shadow: 0 30px 60px -30px rgba(15,23,42,.45);
}

.portrait .tag {
  position: absolute;
  left: -1rem;
  bottom: 1.5rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .8rem 1rem;
  font-size: .85rem;
  box-shadow: 0 10px 30px -12px rgba(0,0,0,.25);
  max-width: 15rem;
}

.portrait .tag b {
  display: block;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 1rem;
  margin: 1rem 0 4rem;
}

.stat {
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.stat b {
  font-size: 1.9rem;
  letter-spacing: -.03em;
  display: block;
}

.stat span {
  font-size: .86rem;
  color: var(--muted);
}

.sec-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.sec-head a {
  font-weight: 600;
  font-size: .92rem;
  text-decoration: none;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 1.25rem;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  text-decoration: none;
  color: var(--fg);
  display: flex;
  flex-direction: column;
  transition: border-color .15s,transform .15s;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.card img,
.card .ph {
  aspect-ratio: 16/10;
  object-fit: cover;
  border: 0;
  border-radius: 0;
}

.card .ph {
  background: repeating-linear-gradient(135deg,var(--card),var(--card) 10px,var(--line) 10px,var(--line) 11px);
}

.card .body {
  padding: 1.25rem;
}

.card h3 {
  font-size: 1.15rem;
  letter-spacing: -.015em;
}

.card p {
  font-size: .93rem;
  color: var(--muted);
  margin: 0;
}

.split {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 2rem;
  margin-top: 4rem;
}

.feature {
  border-radius: var(--radius);
  padding: 1.75rem;
  background: linear-gradient(160deg,color-mix(in srgb,var(--accent) 14%,var(--card)),var(--card));
  border: 1px solid var(--line);
}

.feature .pub {
  border: 0;
  padding: 0;
}

.feature .pub-title {
  font-size: 1.25rem;
  letter-spacing: -.015em;
}

.questions li {
  background: var(--card);
}

.theme-fig img {
  border-radius: 18px;
}

.year-label {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--fg);
}

.pub-title {
  font-family: var(--font-body);
}

.site-footer {
  background: var(--card);
}

@media (max-width:900px) {
  .hero,
  .split {
    grid-template-columns: 1fr;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .stats {
    grid-template-columns: repeat(2,1fr);
  }
  .portrait {
    max-width: 420px;
  }
  .portrait .tag {
    left: .75rem;
  }
}

.tile img,
.tile .ph {
  aspect-ratio: 16/10;
}

.tile .ph {
  background: repeating-linear-gradient(135deg,var(--card),var(--card) 10px,var(--line) 10px,var(--line) 11px);
}
