/* Layout: narrow reading column, masthead + sideways nav, field-notebook calm.
   Moss-and-heather palette drawn from the grouse moors. */
:root {
  --bg: #f6f7f2;
  --surface: #ffffff;
  --ink: #1c2420;
  --muted: #59645d;
  --rule: #d9dfd3;
  --accent: #2e5b3c;      /* moss */
  --accent-2: #7a3b52;    /* heather, used sparingly */
  --font-display: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Literata", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121714; --surface: #19201c; --ink: #e4e9e2; --muted: #a2ada5;
    --rule: #2c3530; --accent: #93c79f; --accent-2: #d898b0; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121714; --surface: #19201c; --ink: #e4e9e2; --muted: #a2ada5;
  --rule: #2c3530; --accent: #93c79f; --accent-2: #d898b0; color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.65;
  padding-inline: 16px;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

main, footer.site { max-width: 46rem; margin-inline: auto; }

/* Weebly-style: white title bar, then the photo edge to edge, then a centred reading column */
header.site { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 2rem;
  margin-inline: -16px; padding: calc(1.1rem + env(safe-area-inset-top, 0px)) clamp(16px, 3vw, 40px) 1.1rem; background: var(--surface); }
.brand { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.05rem, 2.6vw, 1.5rem); text-transform: uppercase; letter-spacing: 0.22em; color: var(--ink); text-decoration: none; }
header.site nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.4rem; font-family: var(--font-display); font-weight: 500; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; }
header.site nav a { color: var(--muted); text-decoration: none; padding-block: 0.2rem; border-bottom: 2px solid transparent; }
header.site nav a:hover { color: var(--ink); }
header.site nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.fullbanner { margin: 0 -16px; }
.fullbanner img { width: 100%; max-width: none; height: clamp(9rem, 22vw, 15rem); object-fit: cover; object-position: 50% 30%; display: block; filter: brightness(0.9); }
.fullbanner-home img { height: clamp(14rem, 38vw, 30rem); }


main { padding-block: 2.5rem 3rem; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; text-wrap: balance; letter-spacing: -0.015em; }
h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); font-weight: 800; margin: 0 0 1rem; }
h2 { font-size: 1.45rem; font-weight: 700; margin: 2.5rem 0 1rem; }
h3 { font-size: 1.1rem; font-weight: 700; margin: 0 0 0.25rem; }
p { margin: 0 0 1em; max-width: 65ch; }
.lede { font-size: 1.15rem; color: var(--ink); }
.eyebrow { font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent-2); margin: 0 0 0.6rem; }

/* home */
.intro h1 { max-width: 20ch; }
.systems { list-style: none; padding: 0; margin: 1.5rem 0 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.systems li { font-family: var(--font-display); font-size: 0.85rem; padding: 0.25rem 0.7rem; border: 1px solid var(--rule); border-radius: 999px; color: var(--muted); }
.news-list { list-style: none; padding: 0; margin: 0; }
.news-list li { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 0 1.5rem; padding-block: 1.1rem; border-top: 1px solid var(--rule); }
.news-list time { font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent); padding-top: 0.25rem; font-variant-numeric: tabular-nums; }
.news-body p:last-child { margin-bottom: 0; }

/* people */
.person { padding-block: 1.25rem; border-top: 1px solid var(--rule); min-width: 0; }
.person .role { font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 0.6rem; }
.person p:last-child { margin-bottom: 0; }
.person.lead { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 1.5rem; }
.person.lead h3 { font-size: 1.35rem; }
.links { font-family: var(--font-display); font-size: 0.9rem; }
.people { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 0 2rem; }
.former { margin-top: 2.5rem; border-top: 2px solid var(--ink); }
.former summary { cursor: pointer; font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; padding-block: 1rem; }

/* research */
.theme { padding-block: 0.5rem 1rem; border-top: 1px solid var(--rule); margin-top: 2rem; }
.theme h2 { margin-top: 0; }
.theme h3 { margin: 1rem 0 0.5rem; }

/* publications */
.years { display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; font-family: var(--font-mono); font-size: 0.85rem; padding-block: 0.75rem; border-block: 1px solid var(--rule); margin-bottom: 1rem; position: sticky; top: env(safe-area-inset-top, 0px); background: var(--bg); z-index: 1; }
.years a { text-decoration: none; }
.year { scroll-margin-top: 4rem; }
.year h2 { font-family: var(--font-mono); font-weight: 500; font-size: 1.1rem; color: var(--accent); margin: 2rem 0 0.75rem; }
.year ol { list-style: none; padding: 0; margin: 0; }
.year li { padding-block: 0.65rem; border-top: 1px solid var(--rule); font-size: 0.97rem; line-height: 1.55; overflow-wrap: anywhere; }
.year li strong { font-weight: 600; }

/* contact */
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 1.5rem; display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 0.9rem 1.5rem; margin: 2rem 0 0; }
.card dt { font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding-top: 0.2rem; }
.card dd { margin: 0; overflow-wrap: anywhere; }
.sel { user-select: all; }
.todo { color: var(--accent-2); font-style: italic; }

footer.site { border-top: 1px solid var(--rule); padding-block: 1.5rem 2.5rem; font-family: var(--font-display); font-size: 0.85rem; color: var(--muted); }
footer.site p { margin: 0 0 0.3rem; }

@media (max-width: 560px) {
  .news-list li { grid-template-columns: 1fr; gap: 0.3rem; }
  .card { grid-template-columns: 1fr; gap: 0.25rem; }
  .card dd { margin-bottom: 0.8rem; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* photos */
figure { margin: 0; }
img { max-width: 100%; height: auto; display: block; }
.banner { margin-top: 2.5rem; }
.banner img { width: 100%; aspect-ratio: 1847 / 425; object-fit: cover; border-radius: 4px; }
.photo img { width: 100%; border-radius: 4px; }
.photo.side { float: right; width: min(40%, 15rem); margin: 0 0 1rem 1.5rem; }
.theme::after { content: ""; display: block; clear: both; }
.photo-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1.25rem; }
.photo-pair img { aspect-ratio: 4 / 3; object-fit: cover; }
.person.has-photo { overflow: hidden; }
.portrait { float: right; width: min(38%, 11rem); margin: 0 0 0.75rem 1.25rem; }
.portrait img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 4px; }
.portrait figcaption { font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted); margin-top: 0.35rem; line-height: 1.35; }
@media (max-width: 560px) {
  .photo.side { width: 45%; margin-left: 1rem; }
  .photo-pair { grid-template-columns: 1fr; }
}
.research .banner { margin: 1.5rem 0; }
.research .banner img { aspect-ratio: auto; }
.photo-pair img.contain { object-fit: contain; background: #000; }
.banner.hero { margin: 0 0 2rem; }
.contact-photo { margin: 1.75rem 0 2rem; }
.contact-photo img { width: 100%; border-radius: 6px; }
