/* jacobblumoff.com */

:root {
  --bg: #faf8f3;
  --surface: #f1eee6;
  --ink: #18181b;
  --ink-soft: #55555c;
  --rule: #dcd8cc;
  --accent: #127270;       /* teal: links, highlights */
  --accent-warm: #b2452f;  /* coral: dates, small details */
  --accent-tint: #e4f1ef;
  --fig-paper: #fdf1d3;    /* cream, from the thesis illustration */
  /* In dark mode the sketch keeps dark strokes on a paper card (inverting reads badly). */
  --portrait-ink: var(--ink);
  --portrait-paper: transparent;
  --portrait-pad: 0px;
  color-scheme: light;

  --sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --max: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  --label-col: 200px;
}

/* Dark: follow the system unless the toggle chose light; or the toggle chose dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111215;
    --surface: #1a1b20;
    --ink: #ecebe6;
    --ink-soft: #a2a1a8;
    --rule: #2c2d33;
    --accent: #5cc6c1;
    --accent-warm: #f08a72;
    --accent-tint: #15302f;
    --fig-paper: #ece2c6;
    --portrait-ink: #1d1d20;
    --portrait-paper: var(--fig-paper);
    --portrait-pad: 6px;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111215;
  --surface: #1a1b20;
  --ink: #ecebe6;
  --ink-soft: #a2a1a8;
  --rule: #2c2d33;
  --accent: #5cc6c1;
  --accent-warm: #f08a72;
  --accent-tint: #15302f;
  --fig-paper: #ece2c6;
  --portrait-ink: #1d1d20;
  --portrait-paper: var(--fig-paper);
  --portrait-pad: 6px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

img { max-width: 100%; display: block; }

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

/* ---------- header ---------- */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding-top: 28px;
  padding-bottom: 28px;
  font-size: 15px;
}
.site-header { align-items: center; }
.site-header .name { color: var(--ink); font-size: 16px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.site-header .name:hover { text-decoration: none; }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--rule); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle svg { width: 16px; height: 16px; }
/* Show the moon in light mode (click for dark), the sun in dark mode. */
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
}

/* ---------- label/content grid (the backbone of every page) ---------- */

.row {
  display: grid;
  grid-template-columns: var(--label-col) 1fr;
  gap: 24px;
  padding: 40px 0;
  border-top: 1px solid var(--rule);
}
.label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-top: 4px;
}

@media (max-width: 720px) {
  .row { grid-template-columns: 1fr; gap: 12px; padding: 32px 0; }
}

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

.hero {
  display: grid;
  grid-template-columns: var(--label-col) 1fr;
  gap: 24px;
  padding: 48px 0 72px;
}
.hero .meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.8;
}
/* Sketch is a transparent PNG used as a mask, colored by --portrait-ink. */
.portrait-frame {
  display: block;
  width: fit-content;
  margin-top: 24px;
  padding: var(--portrait-pad);
  border-radius: 10px;
  background: var(--portrait-paper);
}
.portrait {
  display: block;
  width: 180px;
  aspect-ratio: 1;
  background: var(--portrait-ink);
  -webkit-mask: url(/img/portrait.png) center / contain no-repeat;
          mask: url(/img/portrait.png) center / contain no-repeat;
}
.hero h1 {
  font-size: clamp(34px, 5.4vw, 60px);
  line-height: 1.07;
  letter-spacing: -0.025em;
  font-weight: 500;
  margin: 0 0 24px;
  max-width: 16ch;
}
.hero h1 em {
  font-style: normal;
  color: var(--accent);
}
.hero .lede {
  font-size: 19px;
  color: var(--ink-soft);
  max-width: 54ch;
  margin: 0 0 28px;
}
.buttons { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  font-family: var(--mono);
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  color: var(--ink);
}
.btn:hover { border-color: var(--ink); text-decoration: none; }

@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; padding: 16px 0 48px; }
  .hero .side { display: flex; align-items: center; gap: 20px; flex-direction: row-reverse; justify-content: flex-end; }
  .portrait { width: 110px; }
  .portrait-frame { margin-top: 0; }
  .buttons { gap: 8px; }
  .btn { padding: 8px 12px; font-size: 12px; }
}

/* ---------- CV entries ---------- */

.org {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 20px;
}
.role { margin: 0 0 28px; }
.role:last-child { margin-bottom: 0; }
.role h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
}
.dates {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 400;
  color: var(--accent-warm);
  white-space: nowrap;
}
.role ul {
  margin: 10px 0 0;
  padding-left: 0;
  list-style: none;
  color: var(--ink-soft);
  max-width: 68ch;
}
.role li { position: relative; padding-left: 18px; margin-bottom: 6px; }
.role li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.72em;
  width: 7px; height: 1px;
  background: var(--ink-soft);
}

.plain { margin: 0; color: var(--ink-soft); max-width: 62ch; }

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

.site-footer {
  border-top: 1px solid var(--rule);
  padding-top: 24px;
  padding-bottom: 40px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-soft);
}
.site-footer a { color: var(--ink-soft); }
.site-footer a:hover { color: var(--ink); }

/* ---------- timeline (desktop) ---------- */

.timeline {
  --tl-when: 96px;
  --tl-pubs: 380px;
  border-top: 1px solid var(--rule);
  padding-top: 36px;
}
.tl-head,
.tl-org,
.era {
  display: grid;
  grid-template-columns: var(--tl-when) minmax(0, 1fr) var(--tl-pubs);
  column-gap: 44px;
}
.tl-head { margin-bottom: 12px; }

.tl-org { padding: 28px 0 8px; }
.tl-org h2 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 2px;
}

.era { padding: 20px 0 28px; }

/* Dates column doubles as the rail. */
.when {
  position: relative;
  border-right: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent-warm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2px 16px 2px 0;
  text-align: right;
}
.when::after {
  content: "";
  position: absolute;
  right: -5px; top: 6px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--accent);
  transition: background 0.2s;
}
.era:has(.on) .when::after,
.era:hover .when::after { background: var(--accent); }

/* On desktop the rail shows each era's dates, so role dates would repeat
   them. A role whose span differs from its era (.own) keeps its dates. */
.work .role h3 .dates:not(.own) { display: none; }

.work .role { margin-bottom: 28px; }
.work .role:last-child { margin-bottom: 0; }
/* Lab names link out, quietly: same color as the title, dotted underline. */
.role h3 a.lab {
  color: inherit;
  text-decoration: underline dotted;
  text-decoration-color: var(--ink-soft);
  text-underline-offset: 4px;
}
.role h3 a.lab:hover { color: var(--accent); text-decoration-color: var(--accent); }

.edu-note { font-size: 15px; color: var(--ink-soft); margin: 12px 0 0; max-width: 68ch; }

/* Linked highlight: dim everything outside the hovered era. */
.timeline .role,
.timeline .tl-pub,
.timeline .more-pubs { transition: opacity 0.2s; }
.timeline.dim .role:not(.on),
.timeline.dim .tl-pub:not(.on),
.timeline.dim .more-pubs:not(.on) { opacity: 0.28; }
.timeline .role.on h3 { color: var(--accent); }

/* Publication cards in the right column. */
.side-pubs { display: flex; flex-direction: column; gap: 16px; }
.tl-pub {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 14px;
  align-items: start;
  color: var(--ink);
  position: relative;
}
.tl-pub:hover { text-decoration: none; z-index: 10; }
.tl-pub .fig {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  border: 1px solid var(--rule);
  overflow: hidden;
  transform-origin: left center;
  transition: transform 0.3s cubic-bezier(.2,.7,.2,1), box-shadow 0.3s;
}
.tl-pub .fig img { width: 100%; height: 100%; object-fit: contain; }
.tl-pub:hover .fig,
.tl-pub:focus-visible .fig {
  transform: scale(2.6);
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.22);
}
.tl-pub .txt { display: flex; flex-direction: column; gap: 3px; }
.tl-pub .venue { font-family: var(--mono); font-size: 11px; color: var(--accent-warm); }
.tl-pub .t { font-size: 14px; line-height: 1.35; font-weight: 500; }
.tl-pub:hover .t { color: var(--accent); }
.tl-pub .blurb { font-size: 13px; color: var(--ink-soft); }

.tl-pub.key {
  grid-template-columns: 1fr;
  padding: 12px;
  border-radius: 10px;
  background: var(--accent-tint);
}
.tl-pub.key .fig { transform-origin: center top; }
.tl-pub.key:hover .fig { transform: scale(1.05); }
.tl-pub.key .t { font-size: 16px; }
.tl-pub.key .blurb { font-size: 14px; line-height: 1.5; margin-top: 4px; }

/* Unselected papers: a plain text list under the cards, no figures. */
.more-pubs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
}
.more-pubs .lbl {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.more-pubs a { font-size: 13px; line-height: 1.4; color: var(--ink-soft); }
.more-pubs a:hover { color: var(--accent); text-decoration: none; }
.more-pubs .v { display: block; margin-top: 1px; font-family: var(--mono); font-size: 11px; }

/* ---------- timeline (phone and tablet) ----------
   One column: dates, then the roles, then that era's papers as a
   swipeable strip. The rail moves to a thin line down the left edge. */
@media (max-width: 900px) {
  .timeline { padding-top: 8px; }
  .tl-head { display: none; }
  .tl-org { grid-template-columns: 1fr; padding: 32px 0 6px; }
  .tl-org > span { display: none; }
  .tl-org h2 { font-size: 21px; }

  .era {
    position: relative;
    grid-template-columns: minmax(0, 1fr);
    row-gap: 14px;
    margin-left: 4px;
    padding: 16px 0 32px 20px;
    border-left: 1px solid var(--rule);
  }
  .era::before {
    content: "";
    position: absolute;
    left: -5px; top: 23px;
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--bg);
    border: 1.5px solid var(--accent);
  }
  /* Each role already shows its dates, so the era dates would repeat them. */
  .when { display: none; }

  .role h3 { font-size: 16px; flex-direction: column; gap: 2px; }
  .work .role h3 .dates:not(.own) { display: inline; }
  .role ul { font-size: 15px; }

  /* Papers: a horizontal strip that bleeds to the screen edge. */
  .era:has(.tl-pub) .work::after {
    content: "Selected publications";
    display: block;
    margin-top: 24px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-soft);
  }
  .side-pubs {
    flex-direction: row;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin-right: calc(-1 * var(--gutter));
    padding: 2px var(--gutter) 6px 0;
    scrollbar-width: none;
  }
  .side-pubs::-webkit-scrollbar { display: none; }
  .tl-pub {
    flex: 0 0 min(64vw, 240px);
    grid-template-columns: 1fr;
    gap: 8px;
    align-content: start;
    scroll-snap-align: start;
  }
  .tl-pub.key { flex-basis: min(78vw, 300px); }
  .tl-pub:hover .fig { transform: none; box-shadow: none; }
  .tl-pub .t { font-size: 14px; }
  .more-pubs {
    flex: 0 0 min(64vw, 240px);
    scroll-snap-align: start;
    border-top: 0;
    align-self: flex-start;
    border-left: 1px solid var(--rule);
    padding: 0 0 0 12px;
  }
}

/* ---------- figures ---------- */

/* Every figure is shown whole on cream paper and recolored with the thesis
   palette (SVG gradient map #fx-thesis, inlined in the page). Hover shows
   the original colors. Artwork already in the palette opts out with .art. */
.fig { position: relative; background: var(--fig-paper); padding: 4%; }
.fig img { filter: url(#fx-thesis); transition: filter 0.25s; }
.tl-pub:hover .fig img { filter: none; }
.fig.art { padding: 0; }
.fig.art img { filter: none; object-fit: cover; }
