/* CV: from 1000 px, section headings on the left and two-column rows (dates in mono, then the entry) on the right;
   below that, headings above the rows; one column on phones.
   print.css (media print) turns the page into a clean light document. */

.cv-head { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px 40px; }
.cv-id { display: flex; flex-direction: column; gap: 14px; }
.cv-role { font-size: clamp(1.1rem, 1.6vw, 1.25rem); line-height: 1.4; }
.cv-contact { font-style: normal; color: var(--ink-2); font-size: 0.92rem; }
.cv-contact a { font-family: var(--mono); font-size: 0.8rem; color: var(--ink); }
.cv-links { display: flex; flex-wrap: wrap; gap: 4px 18px; font-family: var(--mono); font-size: 0.72rem; }
.cv-portrait { width: 132px; height: 132px; border-radius: 50%; object-fit: cover; }

/* ---------- Career at a glance (templates/_timeline.html): every mark is placed at a percentage of the span ---------- */
.tl { margin: 0; flex: 1 1 460px; max-width: 760px; min-width: 0; display: flex; flex-direction: column; gap: 10px; container-type: inline-size; }
.tl-title { font-family: var(--mono); font-size: 0.68rem; color: var(--ink-2); }
.tl-title b { color: var(--accent); font-weight: 500; }
.tl-plot { position: relative; display: flex; flex-direction: column; gap: 7px; padding-top: 16px; }
.tl-row { display: grid; grid-template-columns: 4.6rem minmax(0, 1fr); align-items: center; }
.tl-lane { font-family: var(--mono); font-size: 0.6rem; color: var(--ink-2); }
.tl-track { position: relative; height: 18px; }
.tl-mark { position: absolute; left: var(--x); top: 0; cursor: pointer; transition: opacity 0.15s; }
.tl-bar { width: var(--w); height: 18px; padding: 0 5px; border-radius: 3px; font: 500 0.6rem/18px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--ink); background: color-mix(in srgb, var(--ink) 11%, transparent); }
.tl-bar.is-study { background: none; box-shadow: inset 0 0 0 1px var(--rule); color: var(--ink-2); }
.tl-bar.is-current { background: color-mix(in srgb, var(--accent) 24%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent); }
.tl-tick { width: 9px; height: 18px; margin-left: -4.5px; color: color-mix(in srgb, var(--ink-2) 80%, transparent);
  background: linear-gradient(to right, transparent 3.5px, currentColor 3.5px 5.5px, transparent 5.5px); }
.tl-tick.is-first { color: var(--accent); }
.tl-dot { width: 7px; height: 7px; margin-left: -3.5px; top: calc(5.5px - var(--y) * 8px); border-radius: 50%; background: var(--cold); }
.tl-prize { width: 8px; height: 8px; margin-left: -4px; top: 5px; background: var(--accent); transform: rotate(45deg); }
.tl-axis { position: relative; height: 16px; border-top: 1px solid var(--rule); }
.tl-year { position: absolute; left: var(--x); top: 4px; transform: translateX(-50%); font: 0.58rem/1 var(--mono); color: transparent; font-variant-numeric: tabular-nums; }
.tl-year.is-major { color: var(--ink-2); }
.tl-year::before { content: ""; position: absolute; left: 50%; top: -4px; height: 3px; border-left: 1px solid var(--rule); }
.tl-now { position: absolute; top: 0; bottom: 16px; left: 4.6rem; right: 0; pointer-events: none; }
.tl-now::before { content: ""; position: absolute; left: var(--x); top: 14px; bottom: 0; border-left: 1px dashed color-mix(in srgb, var(--accent) 70%, transparent); }
.tl-now span { position: absolute; left: var(--x); top: 0; transform: translateX(-50%); font: 500 0.58rem/1 var(--mono); color: var(--accent); }
.tl-readout { font-family: var(--mono); font-size: 0.66rem; line-height: 1.5; color: var(--ink-2); min-height: 3em; }
.tl-readout.is-active { color: var(--ink); }
.tl.has-hover .tl-mark:not(.is-hot) { opacity: 0.35; }
@container (max-width: 440px) {   /* phones: a narrower label column and tighter bars */
  .tl-row { grid-template-columns: 3.7rem minmax(0, 1fr); }
  .tl-now { left: 3.7rem; }
  .tl-bar { padding: 0 3px; font-size: 0.56rem; }
  .tl-bar.is-narrow { color: transparent; }
  .tl-year.is-major:not(.is-q4) { color: transparent; }
}
/* The row a timeline mark points at */
.cv-row { border-radius: 4px; transition: background-color 0.15s, box-shadow 0.15s; }
.cv-row.is-lit { background: color-mix(in srgb, var(--accent) 8%, transparent); box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 8%, transparent); }

.cv-section { border-top: 1px solid var(--rule); padding-block: 28px 36px; display: flex; flex-direction: column; gap: 20px; }
.cv-section:last-child { padding-bottom: clamp(56px, 8vw, 96px); }
.cv-h { font-family: var(--display); font-weight: 700; font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.05; letter-spacing: -0.03em; display: flex; align-items: center; gap: 12px; }
.cv-count { font-family: var(--mono); font-weight: 500; font-size: 0.66rem; letter-spacing: 0; color: var(--ink-2); border: 1px solid var(--rule); border-radius: 999px; padding: 3px 9px; }
.cv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.cv-row { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 4px 28px; break-inside: avoid; }
.cv-date { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-2); padding-top: 5px; font-variant-numeric: tabular-nums; }

/* Key dates (key_dates in content/cv.yml): hover, focus or tap the dates to see the exact ones. The card's gap is
   padding, not margin, so the pointer can move onto it without it closing; Escape hides it (ui.js). */
.cv-when { position: relative; align-self: start; }
.cv-date-btn { font: inherit; color: inherit; background: none; border: 0; padding: 0; text-align: left; cursor: help;
  text-decoration: underline dotted color-mix(in srgb, var(--ink-2) 70%, transparent); text-underline-offset: 4px; }
.cv-date-btn:hover, .cv-when:focus-within .cv-date-btn { color: var(--ink); }
.cv-key-dates { display: none; position: absolute; left: 0; top: 100%; z-index: 2; padding-top: 8px; }
.cv-when:hover .cv-key-dates, .cv-when:focus-within .cv-key-dates { display: block; }
.cv-when.is-dismissed .cv-key-dates { display: none; }
.cv-key-dates dl { margin: 0; padding: 9px 12px; display: flex; flex-direction: column; gap: 4px; min-width: max-content;
  background: var(--ground-2); border: 1px solid var(--rule); border-radius: 4px; }
.cv-key-dates dl > div { display: flex; justify-content: space-between; gap: 18px; }
.cv-key-dates dt { color: var(--ink-2); }
.cv-key-dates dd { margin: 0; color: var(--ink); }
.cv-entry { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cv-title { font-family: var(--display); font-weight: 600; font-size: 1.12rem; line-height: 1.25; letter-spacing: -0.015em; }
.cv-detail { color: var(--ink-2); font-size: 0.94rem; }
.cv-note { color: var(--ink-2); font-size: 0.88rem; font-style: italic; }
.cv-tags { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 4px; }
/* Sections without dates line up with the entry column */
.cv-pubs, .cv-funders { margin-left: 218px; }
.cv-pubs { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; }
.cv-funders { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 28px; margin-block: 0; }

/* Wide screens: each section's heading sits in a left column (sticky, like the year labels on Publications) and the
   rows fill the right two-thirds, so the entries start about halfway across the page. */
@media (min-width: 1000px) {
  .cv-section { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 0 32px; align-items: start; }
  .cv-h { position: sticky; top: 18px; }
  .cv-row { grid-template-columns: 170px minmax(0, 1fr); }
  .cv-pubs, .cv-funders { margin-left: 0; }
  .cv-key-dates { left: auto; right: 0; }   /* open leftwards, into the free space, rather than over the entry */
}

@media (max-width: 640px) {
  .cv-head { flex-direction: column; align-items: stretch; }
  .cv-portrait { order: -1; }   /* portrait above the name; the timeline below, full width */
  .cv-portrait { width: 96px; height: 96px; }
  .cv-row { grid-template-columns: minmax(0, 1fr); }
  .cv-date { padding-top: 0; }
  .cv-pubs, .cv-funders { margin-left: 0; }
}
