/* Interior pages.
 *
 * Same world as the landing page: the palette is sampled from the painting,
 * and every page opens with a short band of the same sky / ridge / snow
 * strips, with one of the four figures standing in it. Content then runs on
 * the snow's own off-white so the hero reads as the top of the page rather
 * than a banner stuck on it.
 */

:root {
  /* sampled from the painting */
  --sky-deep: #14305e;
  --sky: #1b3d75;
  --haze: #6d87b0;
  --water: #2b4a76;
  --snow: #eef0f2;
  --paper: #f6f7f8;
  --ink: #14203a;
  --ink-soft: #5b6779;
  --rule: #dfe2e6;
  --rust: #a75f24;        /* the ducks */
  --rust-deep: #8a4d1b;

  --hero-h: clamp(230px, 34vh, 340px);
  --hero-ridge: clamp(34px, 5.5vw, 78px);
  --hero-snow: clamp(46px, 7vh, 84px);
  --hf: clamp(130px, 24vh, 220px);   /* hero figure height */

  --gutter: clamp(20px, 5vw, 56px);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 8px;
  top: 8px;
  z-index: 20;
  padding: 8px 14px;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

/* ---------- top bar ---------- */

/* Deliberately a solid strip rather than an attempt to blend into the sky:
   it stays legible once the page scrolls past the hero onto white. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 14px var(--gutter);
  background: var(--sky-deep);
}

.brand {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -.01em;
  color: #fff;
  text-decoration: none;
}
.brand:hover { color: #cfe0ff; }

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
}

.nav a {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .13em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(255, 255, 255, .68);
  white-space: nowrap;
}
.nav a:hover { color: #fff; }

.nav a[aria-current="page"] {
  color: #fff;
  box-shadow: 0 6px 0 -5px rgba(255, 255, 255, .75);
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  height: var(--hero-h);
  overflow: hidden;
}

.band {
  position: absolute;
  left: 0;
  right: 0;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

/* strips overlap so rounding cannot open a hairline between them */
.band--sky {
  top: 0;
  bottom: calc(var(--hero-ridge) + var(--hero-snow) - 4px);
  background-image: url("/images/landing/sky.jpg");
}
.band--ridge {
  height: var(--hero-ridge);
  bottom: calc(var(--hero-snow) - 3px);
  background-image: url("/images/landing/ridge.jpg");
}
.band--snow {
  height: var(--hero-snow);
  bottom: 0;
  background-image: url("/images/landing/snow.jpg");
}

/* Figure geometry, as on the landing page: fractions of the person's height
   measured off the painting, so a duck stands at the right size next to him. */
.hero-figure {
  position: absolute;
  right: clamp(18px, 7vw, 130px);
  height: var(--hf);
  width: auto;
}

.hero-figure--person {
  bottom: calc(var(--hero-snow) - var(--hf) * .154008);
}
.hero-figure--duckL {
  height: calc(var(--hf) * .415612);
  bottom: calc(var(--hero-snow) - var(--hf) * .128692);
}
.hero-figure--duckR {
  height: calc(var(--hf) * .369198);
  bottom: calc(var(--hero-snow) - var(--hf) * .162447);
}
.hero-figure--sputnik {
  height: calc(var(--hf) * .607595);
  top: clamp(10px, 3vh, 34px);
}

/* Anchored by its bottom edge so the title and strapline stack upward from
   just above the ridge, however many lines the strapline runs to. */
.hero-text {
  position: absolute;
  left: var(--gutter);
  bottom: calc(var(--hero-ridge) + var(--hero-snow) + 16px);
  max-width: min(58%, 48ch);
  color: #fff;
  text-shadow: 0 1px 22px rgba(6, 16, 38, .5);
}

.hero-title {
  margin: 0;
  font-size: clamp(26px, 4.4vw, 46px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -.02em;
}

.hero-strapline {
  margin: .55em 0 0;
  max-width: 46ch;
  font-size: clamp(12px, 1.4vw, 15px);
  font-weight: 300;
  line-height: 1.45;
  color: rgba(255, 255, 255, .84);
}

/* ---------- content ---------- */

.prose {
  max-width: 780px;
  margin: 0 auto;
  padding: clamp(30px, 5vw, 56px) var(--gutter) clamp(48px, 8vw, 96px);
}

.prose--wide { max-width: 1120px; }

.prose > :first-child { margin-top: 0; }

.prose h2 {
  margin: 2.6em 0 .9em;
  padding-bottom: .38em;
  border-bottom: 1px solid var(--rule);
  font-size: clamp(18px, 2.1vw, 22px);
  font-weight: 600;
  letter-spacing: -.012em;
}

.prose h3 {
  margin: 2em 0 .6em;
  font-size: 17px;
  font-weight: 600;
}

.prose p { margin: 0 0 1.1em; }

.prose ul,
.prose ol { margin: 0 0 1.4em; padding-left: 1.25em; }

.prose li { margin: 0 0 .55em; }

.prose li::marker { color: var(--haze); }

.prose a {
  color: var(--rust);
  text-decoration-color: rgba(167, 95, 36, .38);
  text-underline-offset: 2px;
}
.prose a:hover { color: var(--rust-deep); text-decoration-color: currentColor; }

.prose strong { font-weight: 600; }

.prose em { color: var(--ink-soft); font-style: italic; }

.prose img { max-width: 100%; height: auto; }

.prose hr {
  margin: 2.4em 0;
  border: 0;
  border-top: 1px solid var(--rule);
}

.prose blockquote {
  margin: 1.6em 0;
  padding: .2em 0 .2em 1.1em;
  border-left: 2px solid var(--haze);
  color: var(--ink-soft);
}

.prose code {
  padding: .12em .35em;
  border-radius: 4px;
  background: #eceef1;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .88em;
}

.prose pre {
  overflow-x: auto;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: #e6ebf2;
}
.prose pre code { padding: 0; background: none; color: inherit; }

.prose table { width: 100%; border-collapse: collapse; margin: 1.4em 0; }
.prose th, .prose td { padding: .5em .7em; border-bottom: 1px solid var(--rule); text-align: left; }
.prose th { font-weight: 600; }

/* CV entries: organisation and dates on one row, the role beneath it. */
.entry { margin: 1.9em 0 .7em; }

.entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 16px;
}

.entry-org {
  font-weight: 600;
  letter-spacing: -.008em;
}

.entry-when {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  white-space: nowrap;
}

.entry-role {
  margin-top: .1em;
  font-style: italic;
  color: var(--ink-soft);
}

.entry + ul { margin-top: .4em; }

/* CV: institution marks sit inline with the role they belong to */
.prose .org-logo {
  height: 20px;
  width: auto;
  vertical-align: middle;
  margin-right: 8px;
  border-radius: 3px;
}

.prose .inline-logo {
  height: 15px;
  width: auto;
  vertical-align: middle;
  margin-right: 4px;
}

/* Publications: a figure from each paper sits beside its citation. Every
   thumbnail shares one frame so the list keeps a steady rhythm whatever the
   figure's own aspect ratio; the frame links to the full-size image. */
.pub {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 6px 26px;
  align-items: start;
  margin: 0 0 2.1em;
}

.pub-fig { margin: 0; }

.pub-fig a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 150px;
  padding: 6px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: #fff;
}
.pub-fig a:hover { border-color: var(--haze); }

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

.pub-fig figcaption {
  margin-top: .5em;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-soft);
}

.prose .pub-cite { margin: 0; }

/* an entry with no figure to show runs the full width */
.pub--nofig { grid-template-columns: minmax(0, 1fr); }

@media (max-width: 600px) {
  .pub { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .pub-fig a { height: 170px; }
}

/* ---------- footer ---------- */

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 20px var(--gutter) 26px;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  color: var(--ink-soft);
}

.foot-home {
  color: var(--rust);
  text-decoration: none;
}
.foot-home::before { content: "\2190\00a0"; }
.foot-home:hover { color: var(--rust-deep); text-decoration: underline; }

@media (max-width: 620px) {
  .hero-figure { right: 12px; opacity: .92; }
  .hero-text { max-width: 64%; }
  .nav a { font-size: 11px; letter-spacing: .1em; }
}
