/* ---------------------------------------------------------------------------
   Scandinavian minimalist academic homepage
   Palette: warm paper, soft ink, a single muted accent. Generous whitespace,
   restrained type, functional simplicity.
--------------------------------------------------------------------------- */

:root {
  --paper: #f6f4ef;
  --paper-raised: #fbfaf7;
  --ink: #1c1b19;
  --ink-soft: #55524c;
  --ink-faint: #8a867e;
  --line: #e2e2dd;
  --accent: #4a6572; /* muted Nordic slate-blue */
  --accent-soft: #8aa0aa;

  --max: 62rem;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --section-gap: clamp(4.5rem, 11vw, 9rem);

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  --paper: #16150f;
  --paper-raised: #1d1c15;
  --ink: #ece8df;
  --ink-soft: #b6b1a5;
  --ink-faint: #837f74;
  --line: #262a2c;
  --accent: #8fb0bd;
  --accent-soft: #6f8b97;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.65;
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.4s ease, color 0.4s ease;
}

::selection {
  background: var(--accent);
  color: var(--paper);
}

a {
  color: inherit;
  text-decoration: none;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ------------------------------------------------------------------ Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.4s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.05rem var(--gutter);
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav__mark {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  transition: border-color 0.3s ease, color 0.3s ease;
}
.nav__mark:hover { border-color: var(--accent); color: var(--accent); }

.nav__list {
  list-style: none;
  display: flex;
  gap: clamp(1rem, 3vw, 2rem);
  margin: 0 auto 0 auto;
  padding: 0;
}
.nav__list a {
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  position: relative;
  padding-bottom: 2px;
  transition: color 0.25s ease;
}
.nav__list a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.28s ease;
}
.nav__list a:hover { color: var(--ink); }
.nav__list a:hover::after { width: 100%; }

.theme-toggle {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 0.3s ease;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle__dot {
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: inset -3px -3px 0 0 var(--paper);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
[data-theme="dark"] .theme-toggle__dot {
  box-shadow: none;
  background: var(--accent);
}

/* -------------------------------------------------------------------- Main */

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Hero */
.hero {
  padding: clamp(4rem, 12vw, 9rem) 0 var(--section-gap);
  max-width: 40rem;
}
.hero__eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.4rem;
}
.hero__name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.9rem, 8vw, 5.25rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 1.6rem;
}
.hero__lede {
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.35rem);
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0 0 2.4rem;
  max-width: 34rem;
}
.hero__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem 2rem;
  font-size: 0.95rem;
}
.hero__links a {
  color: var(--ink);
  border-bottom: 1px solid var(--accent-soft);
  padding-bottom: 3px;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.hero__links a:hover { color: var(--accent); border-color: var(--accent); }

/* Sections */
.section {
  padding-bottom: var(--section-gap);
  display: grid;
  grid-template-columns: 12rem 1fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  border-top: 1px solid var(--line);
  padding-top: clamp(2.5rem, 6vw, 4.5rem);
}

.section__head {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
}
.section__index {
  font-family: var(--serif);
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.05em;
}
.section__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.1;
}

.section__body { max-width: 42rem; }

.prose p { margin: 0 0 1.3rem; color: var(--ink-soft); }
.prose p:last-child { margin-bottom: 0; }

.section__more { margin-top: 2rem; font-size: 0.9rem; }
.section__more a { color: var(--accent); }
.section__more a:hover { color: var(--ink); }

.section__note {
  margin-top: 1.8rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* Research keywords */
.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.6rem;
  margin: 0 0 1.8rem;
  padding: 0;
}
.tag {
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.tag:hover { color: var(--accent); border-color: var(--accent-soft); }

/* Research cards */
.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.card {
  background: var(--paper-raised);
  padding: 1.6rem 1.5rem;
  transition: background 0.3s ease;
}
.card:hover { background: var(--paper); }
.card__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.12rem;
  margin: 0 0 0.5rem;
}
.card__text {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.55;
}

/* Open call callout */
.callout {
  background: color-mix(in srgb, var(--accent) 8%, var(--paper-raised));
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 4px;
  padding: 1.7rem 1.7rem;
  margin: 0 0 1.6rem;
}
.callout__kicker {
  margin: 0 0 0.7rem;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}
.callout__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.3rem, 1.1rem + 0.9vw, 1.6rem);
  margin: 0 0 0.8rem;
  line-height: 1.2;
}
.callout__text { margin: 0; color: var(--ink-soft); line-height: 1.6; }
.callout__grid {
  display: grid;
  grid-template-columns: minmax(0, 15rem) 1fr;
  gap: clamp(1.25rem, 3vw, 2rem);
  align-items: center;
  margin-top: 1.2rem;
}
.callout__poster {
  display: block;
  line-height: 0;
}
.callout__poster img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 3px;
  box-shadow: 0 8px 24px -14px rgba(0, 0, 0, 0.4);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.callout__poster:hover img {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -14px rgba(0, 0, 0, 0.45);
}
.callout__aside { min-width: 0; }
.callout__actions {
  margin: 1.4rem 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.4rem;
}
.callout__q {
  font-size: 0.88rem;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--accent-soft);
  padding-bottom: 1px;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.callout__q:hover { color: var(--accent); border-color: var(--accent); }

/* Dissertation feature */
.feature {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--paper-raised);
  padding: 1.9rem 1.8rem;
}
.feature__kicker {
  margin: 0 0 0.8rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.feature__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.2rem, 1rem + 0.9vw, 1.5rem);
  line-height: 1.25;
  margin: 0 0 1rem;
}
.feature__text {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.6;
}
.feature__meta {
  margin: 1.1rem 0 0;
  font-size: 0.92rem;
  color: var(--ink-faint);
}
.feature__meta a {
  color: var(--ink);
  border-bottom: 1px solid var(--accent-soft);
  padding-bottom: 1px;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.feature__meta a:hover { color: var(--accent); border-color: var(--accent); }
.feature__actions { margin: 1.4rem 0 0; }
.btn {
  display: inline-block;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--paper);
  background: var(--accent);
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  transition: background 0.25s ease, transform 0.15s ease;
}
.btn:hover { background: var(--ink); transform: translateY(-1px); }

/* Field notes */
.notes-head { margin: 2.4rem 0 0.4rem; }
.notes-head__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.15rem;
  margin: 0 0 0.4rem;
}
.notes-head__sub {
  margin: 0 0 0.6rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.notes-head__sub a {
  color: var(--ink);
  border-bottom: 1px solid var(--accent-soft);
  padding-bottom: 1px;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.notes-head__sub a:hover { color: var(--accent); border-color: var(--accent); }

.notes { list-style: none; margin: 0.6rem 0 0; padding: 0; }
.note {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1.25rem;
  align-items: baseline;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}
.note:first-child { padding-top: 0; }
.note__date {
  font-family: var(--serif);
  color: var(--ink-faint);
  font-size: 0.88rem;
}
.note__title {
  font-weight: 500;
  position: relative;
  width: fit-content;
}
.note__title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.28s ease;
}
.note__title:hover { color: var(--accent); }
.note__title:hover::after { width: 100%; }

/* Publications */
.pub-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.pub {
  display: grid;
  grid-template-columns: 6rem 1fr auto;
  gap: 1.25rem;
  align-items: start;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--line);
}
.pub:first-child { padding-top: 0; }
.pub__year {
  line-height: 1.3;
  font-family: var(--serif);
  color: var(--ink-faint);
  font-size: 0.95rem;
  padding-top: 0.1rem;
}
.pub__title { margin: 0 0 0.35rem; font-weight: 500; }
.pub__venue { margin: 0; color: var(--ink-soft); font-size: 0.9rem; }
.pub__link {
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--accent);
  border: 1px solid var(--line);
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  transition: border-color 0.25s ease, color 0.25s ease;
  white-space: nowrap;
}
.pub__link:hover { border-color: var(--accent); }

/* Teaching */
.teaching { margin: 0; }
.teaching__row {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 1.25rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}
.teaching__row:first-child { padding-top: 0; }
.teaching dt {
  font-family: var(--serif);
  font-weight: 500;
  color: var(--accent);
}
.teaching dd { margin: 0; color: var(--ink-soft); }

/* Groups & networks */
.affil { list-style: none; margin: 0; padding: 0; }
.affil__item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem 1.5rem;
  align-items: baseline;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--line);
}
.affil__item:first-child { padding-top: 0; }
.affil__name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.12rem;
  margin: 0 0 0.4rem;
}
.affil__role { margin: 0; color: var(--ink-soft); font-size: 0.95rem; line-height: 1.55; }
.affil__link {
  font-size: 0.85rem;
  color: var(--accent);
  white-space: nowrap;
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease;
}
.affil__link:hover { border-color: var(--accent); }

/* Contact */
.contact { display: grid; gap: 1rem; }
.contact__line {
  margin: 0;
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 1.25rem;
  align-items: baseline;
}
.contact__label {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.contact__line a {
  border-bottom: 1px solid var(--accent-soft);
  padding-bottom: 2px;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.contact__line a:hover { color: var(--accent); border-color: var(--accent); }
.contact__set { display: flex; flex-wrap: wrap; gap: 1.25rem; }

/* Footer */
.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem var(--gutter) 3.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  color: var(--ink-faint);
  font-size: 0.85rem;
}

/* Reveal on scroll */
.section,
.hero { --reveal: 1; }
[data-animate] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
[data-animate].is-visible {
  opacity: 1;
  transform: none;
}

/* Focus visibility */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --------------------------------------------------------------- Responsive */

@media (max-width: 720px) {
  .nav__list { display: none; }
  .section { grid-template-columns: 1fr; gap: 1.5rem; }
  .pub {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
  .pub__link { justify-self: start; margin-top: 0.4rem; }
  .note { grid-template-columns: 1fr; gap: 0.15rem; }
  .affil__item { grid-template-columns: 1fr; gap: 0.5rem; }
  .callout__grid { grid-template-columns: 1fr; gap: 1.3rem; }
  .callout__poster { max-width: 22rem; }
  .contact__line { grid-template-columns: 1fr; gap: 0.25rem; }
  .site-footer { flex-direction: column; gap: 0.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-animate] { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0.001ms !important; }
}
