/* ══════════════════════════════════════════════════════════════
   ACADEMIC PROFILE — stylesheet

   The tokens in :root are the whole design. Change --accent and the
   entire page follows. Everything below that you can leave alone.
   ══════════════════════════════════════════════════════════════ */

:root {
  /* ── Light ─────────────────────────────────────────────────── */
  --bg:       #f7f5f1;   /* warm paper, never pure white */
  --bg-2:     #fffdfa;   /* raised surfaces */
  --line:     #e2ddd4;
  --line-2:   #cec8bd;
  --ink:      #16150f;
  --ink-2:    #55514a;
  --ink-3:    #8d877d;
  --accent:   #0f6b5c;
  --accent-2: #b8860b;   /* second accent, used sparingly */
  --glow-a:   rgba(15,107,92,.10);
  --glow-b:   rgba(184,134,11,.09);
  --shadow:   0 1px 2px rgba(20,18,12,.05), 0 12px 28px -14px rgba(20,18,12,.16);

  /* ── Type ──────────────────────────────────────────────────── */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  --mono:  ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;

  /* ── Rhythm ────────────────────────────────────────────────── */
  /* The container is wide so the page fills a laptop or monitor. Running
     text is held to a comfortable measure separately, further down — a wide
     container with unconstrained prose is what makes a site tiring to read. */
  --w:   84rem;                          /* content column */
  --veil: rgba(0,0,0,.55);               /* only used if you add a footer image */
  --pad: clamp(1.25rem, 5vw, 3rem);
  --gap: clamp(5rem, 12vw, 9rem);        /* space between sections */
  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* ── Dark. Declared twice on purpose: once for people whose system is
      dark and who never touched the toggle, once for people who did. ── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0d10; --bg-2: #14161b; --line: #23262e; --line-2: #333844;
    --ink: #f0f1f3; --ink-2: #a4aab5; --ink-3: #6e7480;
    --accent: #4fd6bd; --accent-2: #e0b355;
    --glow-a: rgba(79,214,189,.10); --glow-b: rgba(224,179,85,.07);
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 18px 40px -20px rgba(0,0,0,.7);
  }
}
:root[data-theme="dark"] {
  --bg: #0c0d10; --bg-2: #14161b; --line: #23262e; --line-2: #333844;
  --ink: #f0f1f3; --ink-2: #a4aab5; --ink-3: #6e7480;
  --accent: #4fd6bd; --accent-2: #e0b355;
  --glow-a: rgba(79,214,189,.10); --glow-b: rgba(224,179,85,.07);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 18px 40px -20px rgba(0,0,0,.7);
}

/* ══════════════════ base ══════════════════ */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 6rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Two soft colour washes behind everything. This is most of the reason
   the page reads as designed rather than as a document. */
body::before {
  content: ""; position: fixed; inset: -30vh -10vw auto; height: 110vh;
  background:
    radial-gradient(42vw 42vw at 18% 8%,  var(--glow-a), transparent 70%),
    radial-gradient(38vw 38vw at 88% 22%, var(--glow-b), transparent 70%);
  pointer-events: none; z-index: 0;
}

/* A whisper of film grain stops large flat areas looking plastic. */
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .28;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

main, footer, .nav { position: relative; z-index: 2; }

h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 600; letter-spacing: -.022em; line-height: 1.08; }
p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }

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

.skip { position: absolute; left: -9999px; background: var(--accent); color: #fff; padding: .7rem 1.1rem; z-index: 60; }
.skip:focus { left: .5rem; top: .5rem; border-radius: 8px; }

/* ══════════════════ chrome ══════════════════ */

.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 50;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0); transform-origin: 0 50%;
}

.nav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 1.5rem;
  padding: .85rem var(--pad);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.nav:hover { border-bottom-color: var(--line); }

.brand {
  margin-right: auto; text-decoration: none;
  font-family: var(--serif); font-size: 1.06rem; font-weight: 600;
  color: var(--ink); letter-spacing: -.01em;
}
.brand span { color: var(--ink-3); }

.nav nav { display: flex; gap: 1.6rem; }
.nav nav a {
  position: relative; text-decoration: none; color: var(--ink-2);
  font-size: .875rem; padding: .2rem 0; transition: color .2s;
}
.nav nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -.1rem; height: 1.5px;
  background: var(--accent); transform: scaleX(0); transform-origin: 0 50%;
  transition: transform .3s var(--ease);
}
.nav nav a:hover { color: var(--ink); }
.nav nav a.on { color: var(--ink); }
.nav nav a.on::after, .nav nav a:hover::after { transform: scaleX(1); }

.toggle {
  display: grid; place-items: center; width: 2.1rem; height: 2.1rem; padding: 0;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--bg-2); color: var(--ink-2); cursor: pointer;
  transition: transform .3s var(--ease), color .2s, border-color .2s;
}
.toggle svg { width: 15px; height: 15px; fill: currentColor; }
.toggle:hover { color: var(--ink); border-color: var(--line-2); transform: rotate(-25deg); }

@media (max-width: 46rem) { .nav nav { display: none; } }

/* ══════════════════ layout ══════════════════ */

main { max-width: var(--w); margin: 0 auto; padding: 0 var(--pad); }
section + section { margin-top: var(--gap); }

.tag {
  display: flex; align-items: center; gap: .7rem;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 1.6rem;
}
.tag i { font-style: normal; color: var(--accent); }
.tag::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.section-head { font-size: clamp(1.9rem, 4vw, 2.7rem); margin-bottom: 2.2rem; }

/* Sections lift into place once, but only when scripting is available.
   Without the .js guard, a reader with JavaScript off gets a blank page. */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* ══════════════════ hero ══════════════════ */

/* The photo gets a real column rather than sizing to its own content —
   otherwise a wide monitor opens a dead void between the text and the image. */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(14rem, 27rem);
  gap: clamp(2rem, 5vw, 4rem); align-items: center;
  /* Sized so the hero and the stats band share one screen. */
  min-height: min(64vh, 36rem);
  padding: clamp(1.5rem, 4vw, 2.5rem) 0 0;
}

.status {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--mono); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-2); border: 1px solid var(--line); border-radius: 100px;
  padding: .35rem .8rem .35rem .65rem; background: var(--bg-2); margin-bottom: 1.6rem;
}
.status i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: ping 2.4s var(--ease) infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.hero h1 { font-size: clamp(3.2rem, 11vw, 6.4rem); line-height: .92; letter-spacing: -.038em; }
.hero h1 .l1 { display: block; color: var(--ink-3); font-style: italic; font-weight: 400; }
.hero h1 .l2 { display: block; }

.role {
  font-family: var(--mono); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-2); margin: 1.3rem 0 1.1rem;
}

.lead { font-size: clamp(1.05rem, 1.9vw, 1.22rem); color: var(--ink-2); max-width: 46ch; }

.actions { display: flex; flex-wrap: wrap; gap: .7rem; margin: 2rem 0 1.6rem; }

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .72rem 1.3rem; border-radius: 100px;
  border: 1px solid var(--line-2); background: var(--bg-2); color: var(--ink);
  font-size: .93rem; font-weight: 500; text-decoration: none;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--ink-3); }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
:root[data-theme="dark"] .btn.primary, :root:not([data-theme="light"]) .btn.primary { color: #06231f; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .btn.primary { color: #fff; } }

.social { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.social a { color: var(--ink-2); text-decoration: none; transition: color .2s; }
.social a:hover { color: var(--accent); }

/* The photo sits inside a filled organic shape with an offset outline behind
   it. The shape contains the cut-out so it reads as composed rather than
   floating, and the two radii differ so it never looks like a plain circle. */
.portrait {
  position: relative; margin: 0; justify-self: center;
  width: 100%; max-width: 26rem; aspect-ratio: 1 / 1.04;
}

.blob {
  position: absolute; inset: 0; z-index: 1; overflow: hidden;
  border-radius: 58% 42% 50% 50% / 45% 52% 48% 55%;
  background:
    radial-gradient(80% 70% at 50% 12%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    color-mix(in srgb, var(--accent) 11%, var(--bg-2));
}

/* Offset outline, rotated a few degrees so the pair reads as hand-placed. */
.ring {
  position: absolute; inset: -1rem; z-index: 0;
  border-radius: 58% 42% 50% 50% / 45% 52% 48% 55%;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, transparent);
  /* Offset rather than rotated — rotating a near-circle is invisible. */
  transform: translate(-.75rem, -.55rem);
}

.shot {
  position: absolute; left: 50%; bottom: -1%;
  width: 112%; height: auto; display: block;
  transform: translateX(-50%);
  transition: transform .55s var(--ease), filter .4s ease;
}
.portrait:hover .shot { transform: translateX(-50%) translateY(-7px) scale(1.02); }

/* Full colour on the light theme, black and white on the dark one. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .shot { filter: grayscale(1) brightness(.92) contrast(1.08); }
}
:root[data-theme="dark"] .shot { filter: grayscale(1) brightness(.92) contrast(1.08); }

@media (max-width: 44rem) {
  .hero { grid-template-columns: 1fr; min-height: 0; text-align: left; }
  .portrait { justify-self: start; order: -1; max-width: 15rem; }
  .ring { inset: -.6rem; }
}

/* ══════════════════ stats ══════════════════ */

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
}
/* Overrides the usual section gap so this reads as part of the hero. */
.hero + .stats { margin-top: clamp(1.25rem, 3vh, 2.25rem); }
.stats div { padding: 1.35rem 1rem; text-align: center; border-left: 1px solid var(--line); }
.stats div:first-child { border-left: 0; }
.stats b { display: block; font-family: var(--serif); font-size: clamp(1.8rem, 4.4vw, 2.6rem); font-weight: 600; letter-spacing: -.02em; }
.stats span { font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
@media (max-width: 40rem) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats div:nth-child(3) { border-left: 0; }
  .stats div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

/* ══════════════════ about ══════════════════ */

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: start; }
.two-col h2 { font-size: clamp(1.55rem, 3.1vw, 2.2rem); }
.prose { color: var(--ink-2); max-width: 62ch; }
@media (max-width: 46rem) { .two-col { grid-template-columns: 1fr; } }

/* ══════════════════ research cards ══════════════════ */

/* Two columns, so an even number of cards forms a block rather than
   leaving one stranded on its own row. Drops to one column on a phone. */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 40rem) { .cards { grid-template-columns: 1fr; } }

.card {
  position: relative; overflow: hidden;
  padding: 1.7rem 1.5rem 1.5rem;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .3s;
}
/* The accent bar sweeps in on hover — the one bit of motion per card. */
.card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0); transform-origin: 0 50%; transition: transform .45s var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-2); }
.card:hover::before { transform: scaleX(1); }
.card .n { font-family: var(--mono); font-size: .7rem; color: var(--ink-3); letter-spacing: .1em; }
.card h3 { font-size: 1.16rem; margin: .5rem 0 .5rem; }
.card p { color: var(--ink-2); font-size: .96rem; margin: 0; }

/* ══════════════════ publications ══════════════════ */

.pubs { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.pubs li { border-bottom: 1px solid var(--line); }

.pubs .body {
  position: relative; display: grid; grid-template-columns: 1fr auto;
  gap: .2rem 1rem; align-items: center;
  padding: 1.4rem 1rem 1.4rem 0; text-decoration: none; color: inherit;
  transition: padding-left .35s var(--ease), background .3s;
}
.pubs li { display: grid; grid-template-columns: 5rem 1fr; align-items: center; }
.pubs .yr { font-family: var(--mono); font-size: .8rem; color: var(--ink-3); }
.pubs .t { grid-column: 1; max-width: 68ch; font-size: 1.08rem; font-weight: 500; line-height: 1.4; transition: color .2s; }
.pubs .m { grid-column: 1; color: var(--ink-2); font-size: .9rem; }
.pubs .go {
  grid-column: 2; grid-row: 1 / span 2; width: 18px; height: 18px;
  fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  opacity: 0; transform: translate(-6px, 4px); transition: all .35s var(--ease);
}
.pubs .body:hover { padding-left: .8rem; background: color-mix(in srgb, var(--accent) 5%, transparent); }
.pubs .body:hover .t { color: var(--accent); }
.pubs .body:hover .go { opacity: 1; transform: none; stroke: var(--accent); }

@media (max-width: 38rem) {
  .pubs li { grid-template-columns: 1fr; }
  .pubs .yr { padding-top: 1.2rem; }
  .pubs .body { padding-top: .2rem; }
}

.note { color: var(--ink-3); font-size: .9rem; margin-top: 1.4rem; }

/* ══════════════════ teaching ══════════════════ */

.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rows li {
  display: grid; grid-template-columns: 7rem 1fr; gap: 1rem;
  padding: 1.1rem 0; border-bottom: 1px solid var(--line); color: var(--ink-2);
}
.rows .yr { font-family: var(--mono); font-size: .8rem; color: var(--ink-3); }
.rows b { color: var(--ink); font-weight: 600; }
@media (max-width: 38rem) { .rows li { grid-template-columns: 1fr; gap: .2rem; } }

/* ══════════════════ contact ══════════════════ */

.cta {
  padding: clamp(2.5rem, 7vw, 4.5rem) clamp(1.5rem, 5vw, 3.5rem);
  border: 1px solid var(--line); border-radius: 24px;
  background:
    radial-gradient(70% 120% at 12% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%),
    var(--bg-2);
}
.cta h2 { font-size: clamp(1.8rem, 4.6vw, 3rem); margin-bottom: 1.8rem; }
.mail {
  display: inline-block; font-family: var(--serif);
  font-size: clamp(1.15rem, 2.8vw, 1.7rem); color: var(--ink);
  text-decoration: none; border-bottom: 2px solid var(--accent);
  padding-bottom: .15rem; transition: color .25s;
}
.mail:hover { color: var(--accent); }
.where { margin-top: 1.8rem; color: var(--ink-3); font-size: .92rem; line-height: 1.7; }

/* ══════════════════ footer ══════════════════ */

.foot {
  position: relative; margin-top: var(--gap); overflow: hidden;
  border-top: 1px solid var(--line);
  background:
    linear-gradient(180deg, transparent, color-mix(in srgb, var(--accent) 5%, transparent)),
    var(--bg-2);
  background-size: cover; background-position: center;
}
.foot-in { position: relative; z-index: 1; max-width: var(--w); margin: 0 auto; padding: clamp(3rem, 7vw, 5rem) var(--pad) 0; }

.foot-top { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.5fr); gap: clamp(2rem, 6vw, 5rem); }
/* Name and face together — an identity block, not just decorative type. */
.foot-id { display: flex; align-items: center; gap: .95rem; margin-bottom: 1.35rem; }
.foot-av {
  width: 3.1rem; aspect-ratio: 1; flex: none;
  border-radius: 50%; object-fit: cover;
  border: 1px solid var(--line); background: var(--bg);
}
.foot-av.placeholder {
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 1.02rem; color: var(--accent); letter-spacing: .03em;
}
.foot-name { margin: 0; font-family: var(--serif); font-size: 1.16rem; font-weight: 600; color: var(--ink); }
.foot-role {
  margin: .12rem 0 0; font-family: var(--mono); font-size: .68rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3);
}

.foot-blurb { color: var(--ink-2); font-size: .95rem; max-width: 34ch; }
.foot-mail {
  display: inline-block; margin-top: 1rem;
  font-family: var(--serif); font-size: 1.18rem; color: var(--ink);
  text-decoration: none; border-bottom: 1px solid var(--accent); padding-bottom: .12rem;
  transition: color .25s;
}
.foot-mail:hover { color: var(--accent); }

.foot-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.foot-cols h2 {
  font-family: var(--mono); font-size: .68rem; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 1rem;
}
.foot-cols ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.foot-cols a { color: var(--ink-2); font-size: .92rem; text-decoration: none; transition: color .2s, padding-left .25s var(--ease); }
.foot-cols a:hover { color: var(--accent); padding-left: .28rem; }

/* Oversized name, clipped by the footer edge. Purely decorative. */
.wordmark {
  margin: clamp(2.5rem, 6vw, 4rem) 0 clamp(1.5rem, 3vw, 2.2rem);
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(3.4rem, 14vw, 10rem); line-height: .8; letter-spacing: -.045em;
  color: color-mix(in srgb, var(--ink) 7%, transparent);
  white-space: nowrap; user-select: none;
  /* Bleeds past the left padding and out through the right edge, which the
     footer's overflow:hidden clips. That clipping is the whole effect. */
  margin-left: -.06em;
}

.foot-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.6rem;
  padding: 1.35rem 0 2rem; border-top: 1px solid var(--line);
  color: var(--ink-3); font-size: .83rem;
}
.foot-bar p { margin: 0; }
.totop { margin-left: auto; display: inline-flex; align-items: center; gap: .4rem; color: var(--ink-2); text-decoration: none; }
.totop svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ease); }
.totop:hover { color: var(--accent); }
.totop:hover svg { transform: translateY(-3px); }

@media (max-width: 52rem) { .foot-top { grid-template-columns: 1fr; } }
@media (max-width: 34rem) {
  .foot-cols { grid-template-columns: repeat(2, 1fr); gap: 1.8rem 1rem; }
  .totop { margin-left: 0; }
}

/* ══════════════════ print ══════════════════
   Someone will print this as a one-page profile. Let them. */
@media print {
  .nav, .toggle, .actions, .skip, .grain, .progress, .ring,
  .wordmark, .totop, .foot-cols { display: none !important; }
  body::before { display: none; }
  body { background: #fff; color: #000; font-size: 10.5pt; }
  main { max-width: none; padding: 0; }
  .reveal { opacity: 1 !important; transform: none !important; }
  section + section { margin-top: 1.5rem; }
  .card, .cta, .foot { break-inside: avoid; border-color: #ccc; }
  .foot { background: none; margin-top: 1.5rem; }
  a { color: #000; text-decoration: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .reveal { opacity: 1; transform: none; }
}
