/* One page, one research line. The line is the only ornament; everything else is type and spacing. */

@font-face { font-family: "Bricolage Grotesque"; src: url("../fonts/bricolage-grotesque-normal.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("../fonts/source-serif-4-normal.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("../fonts/source-serif-4-italic.woff2") format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-normal.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  --ground: #f6f8fb;
  --panel: #ffffff;
  --ink: #13233f;
  --soft: #566480;
  --rule: #dbe2ec;
  --accent: #1b4fd8;
  --accent-early: #8fa6cf;
  --mark: #dfe7fb;
  --on-accent: #ffffff;
  --side: #0b7a6e;

  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #10151f;
    --panel: #171e2b;
    --ink: #e7ecf5;
    --soft: #a3afc4;
    --rule: #2b3545;
    --accent: #84a4ff;
    --accent-early: #55678a;
    --mark: #26365c;
    --on-accent: #0d1320;
    --side: #5ccfc0;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--body); font-size: 1.0625rem; line-height: 1.55; }
h1, h2, h3, p, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration-color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
strong { font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.page { max-width: 62rem; margin-inline: auto; padding: clamp(2rem, 6vw, 4.5rem) max(1.25rem, env(safe-area-inset-right, 0px)) 2.5rem max(1.25rem, env(safe-area-inset-left, 0px)); display: grid; gap: clamp(2.5rem, 6vw, 4rem); }

/* Hero */
.hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 2.5rem; }
.hero-text { display: grid; gap: .8rem; min-width: 0; max-width: 42rem; }
h1 { font-family: var(--display); font-weight: 700; font-size: clamp(2.75rem, 8vw, 4.5rem); line-height: 1; letter-spacing: -.025em; margin-bottom: .5rem; }
.seeking { font: 600 .875rem/1.5 var(--mono); color: var(--accent); margin-top: .25rem; }
.contact { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; font: 400 .8125rem/1.7 var(--mono); }
.contact .cv { font-weight: 600; }
.portrait { flex: none; width: 10rem; height: 10rem; object-fit: cover; border-radius: 50%; border: 4px solid var(--panel); box-shadow: 0 0 0 1px var(--rule); background: var(--panel); }

/* Research: a ring has no first or last place. Arc size and colour show emphasis, not order. */
.research { background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; padding: clamp(1.25rem, 3vw, 1.75rem); display: grid; align-items: start; grid-template-columns: minmax(0, 1fr) clamp(11rem, 22vw, 15rem) minmax(0, 1fr); grid-template-areas: "a ring b" "c c c" "earlier earlier earlier"; gap: 1.25rem clamp(1.25rem, 3vw, 2.25rem); }
.ring { grid-area: ring; align-self: center; display: block; width: 100%; height: auto; }
.arc { fill: none; stroke: var(--accent); stroke-width: 20; transition: stroke-width .15s ease; }
.arc-3 { stroke: var(--accent-early); stroke-width: 13; }
.ring text { font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: -.01em; fill: var(--ink); text-anchor: middle; }
.research:has(.theme-1:hover) .arc-1, .research:has(.theme-2:hover) .arc-2 { stroke-width: 25; }
.research:has(.theme-3:hover) .arc-3 { stroke-width: 18; }
.theme { display: grid; gap: .4rem; align-content: start; min-width: 0; font-size: 1rem; line-height: 1.45; }
.theme h3 { font-size: 1.25rem; line-height: 1.2; text-wrap: balance; }
.theme-1 { grid-area: a; }
.theme-2 { grid-area: b; }
.theme-3 { grid-area: c; justify-self: center; max-width: 40rem; text-align: center; color: var(--soft); font-size: .9375rem; }
.theme-3 h3 { font-size: 1.0625rem; color: var(--ink); }
.research-earlier { grid-area: earlier; padding-top: .9rem; border-top: 1px solid var(--rule); color: var(--soft); font-size: .9375rem; line-height: 1.45; }

/* Sections */
.block { min-width: 0; }
h2 { font-family: var(--display); font-weight: 700; font-size: 1.5rem; line-height: 1.2; letter-spacing: -.01em; margin-bottom: .9rem; }
.block-note { color: var(--soft); font-size: .9375rem; margin: -.5rem 0 1.25rem; }

/* Publications */
.pubs { display: grid; gap: 1.25rem; }
.pub { display: grid; grid-template-columns: 8.75rem minmax(0, 1fr); gap: .25rem 1.75rem; scroll-margin-top: 1.5rem; border-radius: 4px; }
.pub:target { background: var(--mark); box-shadow: 0 0 0 .5rem var(--mark); }
.venue { justify-self: start; align-self: start; font: 600 .71875rem/1.35 var(--mono); padding: .2rem .45rem; border: 1px solid var(--rule); border-radius: 3px; color: var(--soft); }
.venue.is-first { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.venue.is-first.is-review { background: none; border: 1px dashed var(--accent); color: var(--accent); }
.pub-body { display: grid; gap: .15rem; min-width: 0; }
.pub-title { font-weight: 600; line-height: 1.35; text-wrap: pretty; }
.pub-authors { color: var(--soft); font-size: .9375rem; line-height: 1.4; }
.me { color: var(--ink); background: var(--mark); border-radius: 2px; box-shadow: 0 0 0 .1em var(--mark); }
.pub-meta { display: flex; flex-wrap: wrap; gap: .1rem .8rem; font: 400 .75rem/1.7 var(--mono); }
.pub-note { color: var(--accent); font-weight: 600; }
.earlier { margin-top: 1.5rem; }
.earlier summary { cursor: pointer; font: 400 .8125rem/1.6 var(--mono); color: var(--soft); }
.earlier .pubs { margin-top: 1.25rem; }

/* Education and experience: the page's one timeline, because these entries really do have an order.
   Degrees are the main line. Internships and assistantships branch off it in a second colour, as cards,
   so they read as things done during a degree and not as full-time jobs. */

.jobs { --date: 8.75rem; --gap: 1.75rem; --to-rail: .875rem; --side-in: 1.5rem; --dot: .95rem; --rail: 4px; display: grid; gap: 2.25rem; }
.job { position: relative; display: grid; grid-template-columns: var(--date) minmax(0, 1fr); column-gap: var(--gap); }
.job::before { content: ""; position: absolute; z-index: 1; left: calc(var(--date) + var(--to-rail) - var(--dot) / 2); top: .4rem; width: var(--dot); height: var(--dot); border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--ground); }
.job::after { content: ""; position: absolute; left: calc(var(--date) + var(--to-rail) - var(--rail) / 2); top: .4rem; bottom: -2.25rem; width: var(--rail); background: var(--accent); }
/* The last rail runs to the end of its entries, since that degree began before them. */
.job:last-child::after { bottom: 0; }
.job-dates { font: 400 .6875rem/1.45 var(--mono); color: var(--soft); text-align: right; padding-top: .45rem; white-space: nowrap; }
.job-body { min-width: 0; }
h3 { font-family: var(--display); font-weight: 700; font-size: 1.1875rem; line-height: 1.3; }
.job-role { color: var(--soft); font-size: .9375rem; margin-bottom: .4rem; }
.points { display: grid; gap: .35rem; max-width: 50rem; }
.points li { position: relative; padding-left: 1rem; font-size: 1rem; line-height: 1.45; }
.points li::before { content: ""; position: absolute; left: 0; top: .6em; width: .375rem; height: .375rem; border-radius: 50%; background: var(--accent); }

.side { display: grid; gap: .875rem; margin: 1rem 0 0 var(--side-in); }
.side-item { position: relative; padding: .8rem 1rem .9rem; background: var(--panel); border: 1px solid var(--rule); border-radius: 6px; }
.side-item::before { content: ""; position: absolute; top: 1.2rem; left: calc(-1px - var(--side-in) - var(--to-rail)); width: calc(var(--side-in) + var(--to-rail)); height: 2px; background: var(--side); }
.side-item::after { content: ""; position: absolute; z-index: 1; top: calc(1.2rem + 1px - .4rem); left: calc(-1px - var(--side-in) - var(--to-rail) - .4rem); width: .8rem; height: .8rem; border-radius: 50%; border: 2px solid var(--side); background: var(--ground); }
.side-dates { position: absolute; top: .95rem; right: calc(100% + var(--side-in) + var(--gap) + 1px); font: 400 .6875rem/1.45 var(--mono); color: var(--side); white-space: nowrap; }
.side-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .6rem; }
h4 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 1rem; line-height: 1.35; }
.side-kind { font: 600 .6875rem/1.4 var(--mono); color: var(--side); }
.side-item .job-role { font-size: .875rem; }
.side-item .points li { font-size: .9688rem; }
.side-item .points li::before { background: var(--side); }

/* Honors, service */
.columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem clamp(1.5rem, 4vw, 2.5rem); }
.plain { display: grid; gap: .8rem; font-size: .9688rem; line-height: 1.4; }
.when { display: block; font: 400 .71875rem/1.7 var(--mono); color: var(--soft); }

.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); font: 400 .75rem/1.6 var(--mono); color: var(--soft); }

/* 404 */
.missing { min-height: 60vh; align-content: center; gap: 1rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .arc { transition: none; }
}

@media (max-width: 760px) {
  .research { grid-template-columns: minmax(0, 1fr); grid-template-areas: "ring" "a" "b" "c" "earlier"; }
  .ring { justify-self: center; width: 11rem; }
  .theme-3 { justify-self: start; text-align: left; }
}

@media (max-width: 640px) {
  .hero { flex-direction: column-reverse; gap: 1.25rem; }
  .portrait { width: 6.5rem; height: 6.5rem; }
  .pub { grid-template-columns: minmax(0, 1fr); }
  .jobs { --to-rail: 1.05rem; --side-in: .6rem; }
  .job { grid-template-columns: minmax(0, 1fr); padding-left: 1.5rem; }
  .job::before { left: calc(.45rem - var(--dot) / 2); }
  .job::after { left: calc(.45rem - var(--rail) / 2); }
  .job-dates { text-align: left; padding-top: 0; }
  .side-dates { position: static; display: block; }
  .side-item::before, .side-item::after { top: 1.1rem; }
  .side-item::after { top: calc(1.1rem + 1px - .4rem); }
  .columns { grid-template-columns: minmax(0, 1fr); }
}
