/* Bonifác Faucher-Timár: career as a trajectory.
   Three tracks on a real time axis, one line that follows where the time went.
   All colours are the tokens below; dark theme overrides them. */

/* Soft stone ground, deep teal and terracotta. Lanes: education soft teal,
   work (see --work), projects terracotta. The trajectory blends between them. */
:root {
  --bg: #f2f1ef;
  --soft: #e7e5e2;
  --line: #d8d5d0;
  --ink: #0f2e33;
  --mute: #33494c;
  --faint: #526467;

  --edu: #5f8f93;      /* education bars */
  --edu-ink: #1d5458;
  --work: #6a3d63;     /* work bars (plum) */
  --proj: #b5532f;     /* project marks (terracotta) */
  --proj-ink: #9c4526;
  --pri: #0f5f66;      /* primary buttons (deep teal) */
  --acc: #a84b2a;      /* accent text (terracotta, AA on the ground) */
  --traj: #b5532f;     /* trajectory when drawn in one colour */
  --amber: #d9cbb0;    /* the RENKKL field */
  --on-amber: #0f2e33;

  --r: 12px;
  --gut: clamp(16px, 5vw, 64px);
  --max: 1200px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #121a1c; --soft: #1a2427; --line: #2a373a; --ink: #e9efef; --mute: #b9c6c7; --faint: #8fa0a2;
  --edu: #5c999e; --edu-ink: #9fd0d3; --work: #b886ae; --proj: #d9774f; --proj-ink: #eb9a77; --pri: #1f7a82; --acc: #eb9a77; --traj: #d9774f; --amber: #cdbb94;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
html.is-locked { overflow: hidden; }
h1, h2, h3, p, ul, dl, dd, figure { margin: 0; }
ul { padding: 0; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
::selection { background: color-mix(in srgb, var(--proj) 26%, transparent); }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; text-decoration-color: var(--line); }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--pri); outline-offset: 3px; border-radius: 6px; }
[tabindex="-1"]:focus { outline: none; }
h1, h2, .d-title { text-wrap: balance; }
.num { font-variant-numeric: tabular-nums; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gut); }
.skip { position: fixed; left: 12px; top: 12px; z-index: 300; padding: 10px 16px; border-radius: 8px; background: var(--ink); color: var(--bg); font-weight: 600; text-decoration: none; transform: translateY(-160%); }
.skip:focus { transform: none; }
.noscript { padding: 64px var(--gut); display: grid; gap: 14px; max-width: 760px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  font-weight: 600; font-size: 16px; line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: background-color .2s var(--ease), border-color .2s var(--ease);
}
.btn:hover { border-color: var(--faint); }
.btn.primary { background: var(--pri); border-color: var(--pri); color: #fff; }
.btn.primary:hover { background: var(--proj); border-color: var(--proj); }
.btn { background: transparent; }
.btn small { font-weight: 400; opacity: .85; }
.btn.quiet { border-color: transparent; }
.btn.quiet:hover { background: var(--soft); }

/* header */
.site-head { position: sticky; top: 0; z-index: 40; background: var(--bg); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 12px; }
.brand { font-weight: 650; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.nav { display: flex; align-items: center; gap: 2px; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 11px; border-radius: 8px; font-size: 15px; color: var(--mute); text-decoration: none; }
.nav a:hover { color: var(--ink); background: var(--soft); }
.nav .nav-cv { color: var(--ink); font-weight: 600; border: 1px solid var(--line); margin-left: 6px; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; color: var(--mute); }
.icon-btn:hover { background: var(--soft); color: var(--ink); }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
@media (max-width: 760px) { .nav .nav-sec { display: none; } }
/* section links for phones, under the contact buttons */
.jump { display: none; }
@media (max-width: 760px) {
  /* phone profile: CV across the top, Email and LinkedIn as equal buttons below */
  .intro .cta.cta { display: grid; grid-template-columns: 1fr 1fr; }
  .intro .cta .btn:first-child { grid-column: 1 / -1; }
  .intro .cta .btn.quiet { border-color: var(--line); }
  /* the header repeats the name and CV only after the profile has scrolled away */
  .site-head .brand, .site-head .nav-cv { transition: opacity .2s var(--ease); }
  html:not(.past-intro) .site-head .brand, html:not(.past-intro) .site-head .nav-cv { opacity: 0; visibility: hidden; }
  .item .lb b { color: var(--ci, var(--ink)); } /* lane-coloured titles on phones, where all labels share one column */
  .jump { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 14px; font-size: 15px; font-weight: 600; }
  .jump a { display: inline-flex; align-items: center; min-height: 44px; color: var(--pri); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: color-mix(in srgb, var(--pri) 40%, transparent); }
}

/* intro */
.intro { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 48px; align-items: center; padding-top: clamp(28px, 5vw, 56px); padding-bottom: clamp(28px, 4vw, 44px); }
.intro h1 { font-size: clamp(36px, 5vw, 56px); line-height: 1.05; font-weight: 700; letter-spacing: -.02em; }
.intro .role { font-size: clamp(18px, 2vw, 21px); color: var(--mute); margin-top: 12px; max-width: 46ch; }
.intro .facts { list-style: none; font-size: 15px; line-height: 1.55; color: var(--faint); margin-top: 12px; display: grid; gap: 2px; }
.intro .facts b { color: var(--ink); font-weight: 600; }
.intro .cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.portrait { width: clamp(112px, 15vw, 176px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: var(--soft); }
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; }
@media (max-width: 640px) {
  .intro { grid-template-columns: 1fr; }
  .portrait { order: -1; width: 96px; }
}

/* sections */
.sec { padding-top: clamp(64px, 9vw, 112px); }
.sec-head { display: grid; gap: 8px; margin-bottom: 28px; max-width: 62ch; }
.sec-head h2 { font-size: clamp(28px, 3.6vw, 40px); line-height: 1.1; font-weight: 700; letter-spacing: -.015em; }
.sec-head p { color: var(--mute); }

/* ---------- timeline ---------- */
#timeline { padding-top: 8px; }
.tl { position: relative; }
.tl-head { position: sticky; top: 64px; z-index: 4; display: grid; grid-template-columns: var(--axis) repeat(3, minmax(0, 1fr)); background: color-mix(in srgb, var(--bg) 94%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding: 10px 0; font-weight: 600; font-size: 15px; }
.tl-head span { display: flex; align-items: center; gap: 8px; color: var(--mute); }
.tl-head i { width: 10px; height: 10px; border-radius: 50%; }
.tl { --axis: 72px; }
.tl-body { position: relative; }
.tl-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.traj-ghost { fill: none; stroke: var(--traj); stroke-opacity: .12; stroke-width: 2; stroke-dasharray: 2 6; stroke-linecap: round; }
.traj { fill: none; stroke: url(#traj-grad); stroke-opacity: .7; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.traj-dot { fill: var(--traj); stroke: var(--bg); stroke-width: 3; }
:root[data-traj="mono"] .traj { stroke: var(--traj); stroke-opacity: .5; }
.year { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--line); }
.year span { position: absolute; left: 0; top: -24px; font-size: 14px; font-weight: 650; color: var(--faint); }
.year.now { border-top-color: var(--ink); opacity: .7; }
.year.now span { color: var(--ink); white-space: nowrap; }
@media (max-width: 760px) { .year.now { right: auto; width: calc(var(--axis) - 8px); } }
.item { position: absolute; display: block; text-decoration: none; color: var(--mute); }
.item .mk { position: absolute; left: 0; top: 0; width: 10px; border-radius: 5px; background: var(--c); transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.item.point .mk { width: 14px; height: 14px; left: -2px; border-radius: 50%; }
.item.point.ring .mk { background: var(--bg); border: 3px solid var(--c); }
.item .lb { position: absolute; left: 20px; top: var(--ly, -3px); white-space: nowrap; font-size: 15px; line-height: 1.3; padding-right: 8px; transition: color .2s var(--ease); }
.item .lb b, .item .lb small span { background: var(--bg); -webkit-box-decoration-break: clone; box-decoration-break: clone; padding: 0 4px; margin-left: -4px; }
.item .lb b { display: inline; font-weight: 600; color: var(--ink); }
.item .lb small { display: block; margin-top: 1px; }
.item .lb small.dt { white-space: nowrap; font-size: 12.5px; }
.item .lb small { font-size: 13px; color: var(--faint); }
.item .lead { position: absolute; left: 12px; top: 6px; display: none; border: 0 solid color-mix(in srgb, var(--c) 55%, transparent); border-left-width: 1.5px; }
.item .lead.down { border-bottom-width: 1.5px; border-bottom-left-radius: 6px; }
.item .lead.up { border-top-width: 1.5px; border-top-left-radius: 6px; }
.item.pushed .lead { display: block; }
.item:hover .lb b, .item.on .lb b { color: var(--ci, var(--ink)); }
.item:focus-visible { outline: none; }
.item:focus-visible .lb { outline: 2px solid var(--pri); outline-offset: 3px; border-radius: 6px; }
.item:focus-visible .mk { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--c); }
.item.on .mk { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--c); }
.item.stub .mk { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.item.stub .mk::after { content: ""; position: absolute; left: 0; right: 0; bottom: -24px; height: 24px; background: linear-gradient(to bottom, var(--c), transparent); opacity: .6; }

.playhead { position: sticky; top: 46vh; z-index: 5; height: 0; pointer-events: none; }
.playhead::before { content: ""; position: absolute; left: var(--axis); right: 0; top: 0; border-top: 1.5px solid var(--ink); opacity: .55; }
.playhead span { position: absolute; left: 0; top: -12px; padding: 3px 8px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 650; }
.tl-note { margin-top: 8px; font-size: 15px; color: var(--faint); max-width: 70ch; }
.tl-note svg { vertical-align: -3px; margin-right: 6px; }
/* the date pill waits until the visitor scrolls, so the top shows only 'Now' */
.playhead { transition: opacity .2s var(--ease); }
html:not(.scrolled) .playhead { opacity: 0; }
@media (max-width: 760px) {
  .tl { --axis: 52px; }
  .tl-head { grid-template-columns: calc(var(--axis) + 5px) repeat(3, 20px) 1fr; gap: 0; font-size: 0; } /* dots centred over the lane bars */
  .tl-head span { justify-content: center; }
  .tl-head span.lbl-col { font-size: 13px; justify-content: flex-start; padding-left: 12px; color: var(--faint); }
  .item .lb { font-size: 14px; }
}
@media (min-width: 761px) { .tl-head .lbl-col { display: none; } }

/* ---------- thesis field ---------- */
.field { background: var(--amber); color: var(--on-amber); border-radius: 24px; padding: clamp(24px, 4vw, 56px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px clamp(28px, 4vw, 56px); }
/* heading across the full width on two lines; lede on the left, facts and buttons on the right, plot below */
.field h2 { grid-column: 1 / -1; font-size: clamp(28px, 2.7vw, 38px); line-height: 1.1; font-weight: 750; letter-spacing: -.02em; text-wrap: balance; max-width: 22em; }
.field .lede { font-size: 18px; line-height: 1.55; max-width: 34em; }
.field dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; font-size: 16px; }
.field dt { font-weight: 650; }
.field .cta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; } /* the three buttons in one row under the text and facts */
.field .btn { background: transparent; border-color: rgba(15, 46, 51, .45); color: var(--on-amber); }
.field .btn.primary { background: var(--pri); border-color: var(--pri); color: #fff; }
.field .plot { grid-column: 1 / -1; background: #fff; border-radius: var(--r); padding: 12px; }
.field .plot img { width: 100%; height: auto; }
.field .plot figcaption { font-size: 14px; color: #374151; padding: 10px 4px 2px; }
@media (max-width: 900px) { .field { grid-template-columns: 1fr; } }

/* ---------- projects ---------- */
.plist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; }
.prow { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 18px; align-items: start; padding: 20px 0; border-top: 1px solid var(--line); text-decoration: none; }
.prow .thumb { width: 112px; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--soft); }
.prow .thumb img { width: 100%; height: 100%; object-fit: cover; }
.prow .thumb.contain img { object-fit: contain; background: #fff; padding: 6px; }
.prow h3 { font-size: 18px; line-height: 1.3; font-weight: 650; }
.pgroup { font-size: 15px; font-weight: 650; color: var(--mute); margin: 28px 0 4px; }
.sec-head + .pgroup { margin-top: 0; }
.prow:hover h3 { color: var(--acc); }
.prow .meta { font-size: 14px; color: var(--faint); margin-top: 2px; }
.prow p { font-size: 15px; line-height: 1.5; color: var(--mute); margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 860px) { .plist { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .prow { grid-template-columns: 88px minmax(0, 1fr); gap: 14px; } .prow .thumb { width: 88px; } }

/* ---------- skills ---------- */
.skills { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 28px; }
.skills h3 { font-size: 15px; font-weight: 650; padding-bottom: 8px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.skills li { list-style: none; font-size: 15px; color: var(--mute); padding: 3px 0; }
/* a skill with evidence links to the project or job where it was used */
.skills li a { color: inherit; text-decoration: underline; text-decoration-style: dotted; text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: var(--faint); }
.skills li a:hover { color: var(--pri); text-decoration-color: var(--pri); }
@media (max-width: 1000px) { .skills { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 18px; } }

/* ---------- close ---------- */
.close-band { padding-top: clamp(72px, 10vw, 128px); padding-bottom: 36px; }
.close-band h2 { font-size: clamp(30px, 4vw, 48px); line-height: 1.1; font-weight: 700; letter-spacing: -.02em; }
.close-band p { color: var(--mute); margin-top: 10px; }
.close-band .cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 64px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; color: var(--faint); }

/* ---------- dialog: pop-up sheet or full page ---------- */
dialog#detail { padding: 0; border: 0; color: var(--ink); background: var(--bg); overscroll-behavior: contain; }
dialog#detail::backdrop { background: rgba(10, 14, 22, .45); }
dialog#detail.sheet {
  width: min(720px, 100%); max-width: 100%; max-height: min(86vh, 900px); margin: auto auto 0;
  border-radius: 20px 20px 0 0; overflow: hidden; display: none; flex-direction: column;
}
dialog#detail.sheet[open] { display: flex; }
@media (min-width: 761px) { dialog#detail.sheet { margin: auto; border-radius: 20px; max-height: 84vh; } }
dialog#detail.page { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; overflow-y: auto; }
@media (prefers-reduced-motion: no-preference) {
  dialog#detail.sheet[open] { animation: up .38s var(--ease); }
  dialog#detail.page[open] { animation: fade .3s var(--ease); }
  @keyframes up { from { transform: translateY(32px); opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes fade { from { opacity: 0; } to { opacity: 1; } }
}
.s-body { overflow-y: auto; padding: 26px clamp(18px, 4vw, 32px) 18px; }
.s-body:focus-visible { outline-offset: -3px; border-radius: 0; }
.s-foot { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; padding: 12px clamp(18px, 4vw, 32px) max(14px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg); }
.s-foot .acts { display: flex; flex-wrap: wrap; gap: 10px; }
.d-title { font-size: clamp(26px, 3.6vw, 36px); line-height: 1.15; font-weight: 700; letter-spacing: -.015em; margin-top: 8px; }
.page .d-title { font-size: clamp(32px, 5vw, 52px); }
.d-dates { font-size: 15px; color: var(--faint); margin-top: 6px; }
.d-sub { font-size: 18px; color: var(--mute); margin-top: 12px; max-width: 60ch; }
.d-sec { margin-top: 26px; }
.d-sec h2 { font-size: 17px; font-weight: 650; margin-bottom: 10px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin-top: 20px; font-size: 16px; }
.kv dt { color: var(--faint); }
.bullets { display: grid; gap: 8px; padding-left: 20px; max-width: 66ch; }
.prose { display: grid; gap: 16px; max-width: 68ch; font-size: 18px; line-height: 1.65; }
.prose > p { max-width: 36em; } /* about 70 characters a line; figures and demos keep the full width */
.tags { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; color: var(--faint); margin-top: 14px; }
.tags li { list-style: none; }
.s-photo { margin-top: 20px; border-radius: var(--r); overflow: hidden; background: var(--soft); }
.s-photo img { width: 100%; max-height: 340px; object-fit: cover; }
.s-photo.contain img { object-fit: contain; background: #fff; }
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 28px; }
.gallery.one { grid-template-columns: 1fr; }
.gallery img { width: 100%; height: auto; border-radius: var(--r); background: var(--soft); }
.gallery figcaption { font-size: 14px; color: var(--faint); padding-top: 6px; }
@media (max-width: 640px) { .gallery { grid-template-columns: 1fr; } }
.p-top { position: sticky; top: 0; z-index: 3; background: color-mix(in srgb, var(--bg) 94%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.p-top .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 60px; max-width: 920px; gap: 10px; }
.p-crumb { font-size: 14px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-in { max-width: 920px; padding-top: 28px; padding-bottom: 96px; }
.d-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

/* degree sheet */
.result { font-size: 20px; font-weight: 650; margin-top: 18px; }
.scale { font-size: 14px; color: var(--faint); margin-top: 4px; }
.sems { margin-top: 18px; border-top: 1px solid var(--line); }
.sem summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 14px 4px; min-height: 52px; border-bottom: 1px solid var(--line); }
.sem summary::-webkit-details-marker { display: none; }
.sem summary:hover { background: var(--soft); }
.sem .st { font-weight: 600; }
.sem .st small { display: block; font-weight: 400; color: var(--faint); font-size: 14px; }
.sem .sa { color: var(--mute); font-size: 15px; }
.sem .chev { transition: transform .2s var(--ease); color: var(--faint); }
.sem[open] .chev { transform: rotate(180deg); }
.courses { padding: 4px 4px 14px; }
.crow { display: grid; grid-template-columns: minmax(0, 1fr) 60px 84px; gap: 10px; padding: 7px 0; font-size: 15px; border-bottom: 1px dashed var(--line); }
.crow.h { font-size: 13px; color: var(--faint); border-bottom-style: solid; }
.crow > :nth-child(2), .crow > :nth-child(3) { text-align: right; }
.crow em { font-style: normal; font-size: 12px; color: var(--faint); margin-left: 6px; }
.sem-note { font-size: 14px; color: var(--faint); padding: 0 4px 12px; }
@media (max-width: 520px) {
  .crow:not(.h) { row-gap: 2px; }
  .crow:not(.h) > :first-child { grid-column: 1 / -1; }
  .crow:not(.h) > :nth-child(2) { grid-column: 2; }
}

/* app tour */
.app-frame { margin-top: 24px; border-radius: 12px; overflow: hidden; border: 1px solid #d8dee9; background: #eceff4; color: #2e3440; }
.app-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #e5e9f0; border-bottom: 1px solid #d8dee9; font-size: 14px; }
.app-bar .dots { display: flex; gap: 5px; }
.app-bar .dots i { width: 10px; height: 10px; border-radius: 50%; background: #bf616a; }
.app-bar .dots i:nth-child(2) { background: #ebcb8b; }
.app-bar .dots i:nth-child(3) { background: #a3be8c; }
.app-bar .addr { flex: 1; min-width: 0; background: #fff; border-radius: 6px; padding: 4px 10px; color: #4c566a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-nav { display: flex; align-items: center; gap: 2px 12px; padding: 4px 12px; background: #fff; border-bottom: 1px solid #d8dee9; overflow-x: auto; }
.app-full { display: none; }
@media (max-width: 640px) {
  .app-nav { flex-wrap: wrap; gap: 0 2px; padding: 4px 6px; } /* every page of the app stays visible on phones */
  .app-nav a { padding: 0 8px; font-size: 14px; }
  .app-full { display: inline; color: var(--pri); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
}
.app-nav a { flex: none; min-height: 44px; display: inline-flex; align-items: center; padding: 0 10px; border-radius: 6px; font-size: 15px; color: #2e3440; text-decoration: none; }
.app-nav .brand-app { font-weight: 700; }
.app-nav a[aria-current="page"] { background: #e5e9f0; font-weight: 650; }
.app-shot { position: relative; }
.app-shot img { width: 100%; height: auto; }
.hot { position: absolute; display: block; border-radius: 6px; outline: 2px dashed rgba(15, 95, 102, .85); background: rgba(15, 95, 102, .08); }
.hot:hover, .hot:focus-visible { background: rgba(15, 95, 102, .2); outline-style: solid; }
/* invisible tap area of at least 44×44 px, so small hotspots are easy to hit on phones */
.hot::before { content: ''; position: absolute; left: 50%; top: 50%; width: max(100%, 44px); height: max(100%, 44px); transform: translate(-50%, -50%); }
.app-cap { font-size: 15px; color: var(--mute); margin-top: 10px; max-width: 70ch; }
.app-teaser { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.app-teaser h2 { font-size: 22px; font-weight: 700; }
.app-teaser img { border-radius: 10px; border: 1px solid var(--line); }

/* ---------- wide screens: profile sidebar, timeline on the right ---------- */
@media (min-width: 1000px) {
  main { display: grid; grid-template-columns: 340px minmax(0, 1fr); column-gap: 56px; max-width: 1400px; margin: 0 auto; padding: 0 48px; }
  main > section, main > section.wrap:not(.intro) { grid-column: 2; max-width: none; padding-left: 0; padding-right: 0; }
  main > .intro { grid-column: 1; grid-row: 1 / span 10; position: sticky; top: 88px; align-self: start; grid-template-columns: 1fr; padding: 28px 0; }
  main > .intro .portrait { order: -1; width: 132px; border-radius: 18px; }
  .intro h1 { font-size: 42px; }
  .intro .cta { flex-direction: column; align-items: stretch; }
}

@media (max-width: 760px) {
  .item .lb b::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 7px; vertical-align: 1px; }
}
/* category dot in the detail dates line (replaces the old eyebrow) */
.d-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); margin-right: 8px; vertical-align: 0; }
.year span { transition: opacity .15s var(--ease); }
@media (min-width: 1000px) {
  .site-head .wrap { max-width: 1400px; padding: 0 48px; }
  .site-head .brand { visibility: hidden; }
}

/* photos placed between paragraphs of a write-up */
.inline-fig { margin: 10px 0 8px; }
/* images keep their own shape (no grey bars beside portrait photos) */
.inline-fig img { display: block; width: auto; max-width: 100%; height: auto; max-height: min(78vh, 760px); margin: 0 auto; border-radius: var(--r); }
.inline-fig figcaption { font-size: 15px; color: var(--faint); padding-top: 8px; max-width: 40em; }
/* equations: the image keeps its own white ground in both themes; on phones it keeps a readable size and scrolls sideways */
.inline-fig.eq { min-width: 0; max-width: 100%; }
.inline-fig.eq .eq-scroll { max-width: 100%; overflow-x: auto; border-radius: var(--r); background: #fff; }
.inline-fig.eq img { display: block; max-width: 720px; margin: 0 auto; padding: 14px 10px; box-sizing: border-box; background: #fff; border-radius: 0; }
@media (max-width: 640px) { .inline-fig.eq img { width: 560px; max-width: none; } }
.inline-fig.lead-fig { margin-top: 28px; }
.inline-fig.demo iframe { display: block; width: 100%; border: 0; border-radius: var(--r); background: #000; }
.inline-fig.demo figcaption b { color: var(--ink); font-weight: 600; }
@media (max-width: 640px) { .inline-fig.demo iframe { height: 380px !important; } }
