@font-face {
  font-family: Newsreader;
  src: url("./fonts/Newsreader.ttf") format("truetype");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("./fonts/HankenGrotesk.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("./fonts/Geist.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("./fonts/Inter.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Raleway";
  src: url("./fonts/Raleway.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("./fonts/SourceSerif4.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
:root {
  --font-site: "Segoe UI", "Trebuchet MS", sans-serif;
  --font-heading: Newsreader, Georgia, serif;
  --page-base: #fcf9f6;
  --page: var(--page-base);
  --surface: #fffefd;
  --ink: #242125;
  --muted: #655e64;
  --rule: #e6dddd;
  --shadow: 0 14px 36px rgb(48 25 33 / 11%);
  --accent-light: #842943;
  --accent-dark: #efa5b8;
  --tint-light: #f5e8ec;
  --tint-dark: #37242e;
  --accent: var(--accent-light);
  --tint: var(--tint-light);
  color-scheme: light;
}
@supports (background-color: color-mix(in srgb, white, black)) {
  :root { --page: color-mix(in srgb, var(--page-base), var(--accent) 3.5%); }
}
:root[data-typeface="editorial"] { --font-site: "Hanken Grotesk", "Segoe UI", sans-serif; }
:root[data-typeface="geist"] { --font-site: Geist, "Segoe UI", sans-serif; }
:root[data-typeface="inter"] { --font-site: Inter, "Segoe UI", sans-serif; }
:root[data-typeface="raleway"] { --font-site: Raleway, "Segoe UI", sans-serif; }
:root[data-typeface="source-serif"] { --font-site: "Source Serif 4", Georgia, serif; }
:root :is(h1, h2, h3) {
  font-family: var(--font-heading);
  font-weight: 400;
  letter-spacing: -.035em;
}
:root[data-theme="dark"] {
  --page-base: #1c181a;
  --surface: #211e24;
  --ink: #f0edf1;
  --muted: #c0b6c2;
  --rule: #3b343f;
  --shadow: 0 14px 36px rgb(0 0 0 / 33%);
  --accent: var(--accent-dark);
  --tint: var(--tint-dark);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --page-base: #1c181a;
    --surface: #211e24;
    --ink: #f0edf1;
    --muted: #c0b6c2;
    --rule: #3b343f;
    --shadow: 0 14px 36px rgb(0 0 0 / 33%);
    --accent: var(--accent-dark);
    --tint: var(--tint-dark);
    color-scheme: dark;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 5rem; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--ink);
  font: 1rem/1.6 var(--font-site);
}
a {
  color: var(--accent);
  text-decoration-thickness: .065em;
  text-underline-offset: .22em;
  transition: color .16s ease, text-decoration-color .16s ease,
    text-decoration-thickness .16s ease, text-underline-offset .16s ease;
}
a:is(:hover, :focus-visible) { text-decoration-thickness: .12em; text-underline-offset: .27em; }
button, select { font: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.shell { width: min(820px, calc(100% - 4rem)); margin-inline: auto; }
.skip-link { position: fixed; inset: .75rem auto auto .75rem; transform: translateY(-200%); z-index: 10; padding: .5rem 1rem; background: var(--surface); }
.skip-link:focus { transform: none; }
.site-header { position: sticky; top: 0; z-index: 5; border-bottom: 1px solid var(--rule); background: var(--page); }
.header-inner { min-height: 3.6rem; display: flex; align-items: center; gap: clamp(1rem, 4vw, 1.8rem); }
.wordmark { color: var(--ink); font-size: .85rem; font-weight: 650; letter-spacing: .055em; text-decoration: none; white-space: nowrap; }
.site-header-home .wordmark { transition: color .16s ease, opacity .2s ease, visibility 0s linear; }
.site-header-home:not(.show-wordmark) .wordmark { opacity: 0; visibility: hidden; transition-delay: 0s, 0s, .2s; }
nav { margin-left: auto; display: flex; gap: clamp(.9rem, 2.8vw, 1.5rem); }
nav a { position: relative; color: var(--muted); text-decoration: none; font-size: .875rem; }
nav a::after {
  content: "";
  position: absolute;
  inset: auto 0 .06em;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .2s ease;
}
nav a:is([aria-current="page"], :hover, :focus-visible) { color: var(--accent); }
nav a:is([aria-current="page"], :hover, :focus-visible)::after { transform: scaleX(1); }
.wordmark:hover, .icon-button:hover { color: var(--accent); }
.appearance { position: relative; display: flex; align-items: center; gap: .15rem; }
.icon-button { display: grid; place-items: center; width: 2.35rem; height: 2.35rem; border-radius: .4rem; border: 0; background: transparent; color: var(--muted); cursor: pointer; list-style: none; }
.icon-button:hover, details[open] .icon-button { background: var(--tint); }
.icon-button::-webkit-details-marker { display: none; }
.theme-icon { width: .85rem; height: .85rem; border-radius: 50%; display: block; }
@media (prefers-reduced-motion: no-preference) {
  #theme-toggle { transition: color .16s ease, background-color .16s ease; }
  .theme-icon { transition: transform .18s ease; }
  #theme-toggle:is(:hover, :focus-visible) .theme-icon { transform: rotate(-14deg) scale(1.06); }
  #theme-toggle:active .theme-icon { transform: scale(.94); }
}
[data-icon="moon"] .theme-icon { box-shadow: -.2rem .12rem 0 currentColor; margin-left: .22rem; margin-top: -.12rem; }
[data-icon="sun"] .theme-icon {
  width: .58rem;
  height: .58rem;
  border: 1.5px solid currentColor;
  box-shadow: 0 -.48rem 0 -.23rem, 0 .48rem 0 -.23rem, -.48rem 0 0 -.23rem, .48rem 0 0 -.23rem,
    -.34rem -.34rem 0 -.23rem, .34rem -.34rem 0 -.23rem, -.34rem .34rem 0 -.23rem, .34rem .34rem 0 -.23rem;
}
.settings-icon { display: grid; width: .95rem; gap: .2rem; }
.settings-icon i { display: block; height: 1px; background: currentColor; position: relative; }
.settings-icon i::after { content: ""; position: absolute; width: .25rem; height: .25rem; border-radius: 50%; background: currentColor; left: 25%; top: -1.5px; }
.settings-icon i:nth-child(2)::after { left: 66%; }
.settings-panel { position: absolute; z-index: 2; top: 2.9rem; right: 0; width: min(19rem, calc(100vw - 2rem)); padding: 1rem; background: var(--surface); border: 1px solid var(--rule); border-radius: .65rem; box-shadow: var(--shadow); display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .7rem .8rem; }
.settings-panel label { font-size: .9rem; color: var(--muted); }
.settings-panel select { width: 100%; min-width: 0; border: 1px solid var(--rule); border-radius: .35rem; background: var(--page); color: var(--ink); padding: .25rem .45rem; font-size: .9rem; }
main.shell { flex: 1; padding-block: clamp(2rem, 5vw, 3.65rem) 3rem; }
h1, h2, h3, p, ul { margin-top: 0; }
h1, h2, h3 { line-height: 1.3; }
h1 { margin-bottom: .75rem; font-size: clamp(1.9rem, 4vw, 2.5rem); font-weight: 650; letter-spacing: -.045em; }
h2 { margin-bottom: .5rem; font-size: 1.25rem; font-weight: 650; letter-spacing: -.018em; }
h3 { margin-bottom: .2rem; font-size: 1.08rem; font-weight: 650; }
p { margin-bottom: .65rem; }
.home-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(8rem, 11.5rem); align-items: start; gap: clamp(1.5rem, 5vw, 3.5rem); }
.home-section { margin-top: 1.85rem; }
.home-section p { margin-bottom: 0; }
.current { margin-top: 2.65rem; padding-top: 1.35rem; border-top: 1px solid var(--rule); }
.timeline { list-style: none; padding: 0; margin: 1rem 0 0; }
.timeline li { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); align-items: baseline; gap: .8rem; }
.timeline li + li { margin-top: .75rem; }
.timeline-date { color: var(--muted); font-size: .875rem; }
.timeline-peek {
  mask-image: linear-gradient(to bottom, #000 15%, transparent 78%);
}
.timeline-toggle {
  position: relative;
  display: flex;
  width: fit-content;
  align-items: center;
  gap: .5rem;
  margin: .85rem auto 0;
  padding: .22rem .8rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: .875rem;
  cursor: pointer;
  overflow-anchor: none;
}
.timeline-toggle[aria-expanded="false"] { margin-top: -.4rem; }
.timeline-toggle:hover { background: var(--tint); color: var(--accent); }
.timeline-toggle::after {
  content: "";
  width: .4rem;
  height: .4rem;
  border-right: 1px solid;
  border-bottom: 1px solid;
  transform: translateY(-.1rem) rotate(45deg);
}
.timeline-toggle[aria-expanded="true"]::after { transform: translateY(.1rem) rotate(225deg); }
.site-footer { padding-block: 1rem 1.5rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: .75rem; text-align: center; }
.profile-links, .work-links { display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; list-style: none; padding: 0; margin: 0; font-size: .875rem; font-weight: 600; }
.portrait-frame {
  aspect-ratio: 1;
  width: 100%;
  max-width: 11.5rem;
  margin: 0;
  border: 1px solid var(--rule);
  border-radius: .65rem;
  overflow: hidden;
  background: var(--tint);
}
.portrait-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--photo-position, 50% 55%);
  filter: blur(.28px);
  transform: scale(var(--photo-zoom, 1.63));
  transform-origin: var(--photo-origin, 44% 51%);
}
.page-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem 1.4rem; margin-bottom: 1.65rem; }
.page-heading h1 { margin: 0; }
.page-heading > a { font-size: .875rem; }
.research-list + .research-list, .cv-section + .cv-section { margin-top: 2.25rem; }
.work { border-top: 1px solid var(--rule); padding-block: 1rem; }
.work h3, .work p { max-width: 72ch; }
.work-meta, .authors { color: var(--muted); font-size: .875rem; }
.work .work-meta { margin-bottom: .26rem; font-weight: 600; }
.work-status { display: inline-block; margin-inline-start: .35rem; padding: .03rem .5rem; border-radius: .35rem; background: var(--tint); color: var(--accent); font-size: .8rem; }
.work .authors { margin-bottom: .5rem; }
.authors strong { color: var(--accent); }
.work > :last-child, .cv-section article > :last-child { margin-bottom: 0; }
.cv-section { border-top: 1px solid var(--rule); padding-top: 1rem; }
.cv-section article + article { margin-top: 1.25rem; }
.cv-row { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 1rem; }
.cv-publications { padding-left: 1.15rem; }
.cv-publications li + li { margin-top: .45rem; }

@media (max-width: 560px) {
  .shell { width: calc(100% - 2rem); }
  .header-inner { flex-wrap: wrap; column-gap: .85rem; row-gap: .1rem; padding-block: .35rem; }
  nav { gap: .85rem; }
  .icon-button { width: 2.15rem; }
  .home-layout { grid-template-columns: minmax(0, 1fr); gap: 1.65rem; }
  .portrait-frame { grid-row: 1; max-width: 8rem; }
  .timeline li { grid-template-columns: 4.5rem minmax(0, 1fr); }
}
@media (max-width: 350px) {
  html { scroll-padding-top: 6.25rem; }
  nav { order: 1; margin: 0; flex-basis: 100%; padding-bottom: .3rem; }
  .appearance { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
  a, nav a::after, .site-header-home .wordmark, .site-header-home:not(.show-wordmark) .wordmark { transition: none; }
}
