  :root {
    --bg: #FFFFFF; --bg-alt: #F4F5F6; --ink: #1B1D21; --text: #33373D; --muted: #5A6068;
    --line: #E1E3E6; --chip: #EDEEF0; --accent: #1F4BA5; --accent-ink: #163A82;
    --button: #1B1D21; --button-text: #FFFFFF;
    color-scheme: light;
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --bg: #17191C; --bg-alt: #1D2024; --ink: #EEF0F2; --text: #D0D4D9; --muted: #9DA3AB;
      --line: #2C3036; --chip: #262A2F; --accent: #8EB2F2; --accent-ink: #B5CCF7;
      --button: #EEF0F2; --button-text: #17191C; color-scheme: dark;
    }
  }
  :root[data-theme="dark"] {
    --bg: #17191C; --bg-alt: #1D2024; --ink: #EEF0F2; --text: #D0D4D9; --muted: #9DA3AB;
    --line: #2C3036; --chip: #262A2F; --accent: #8EB2F2; --accent-ink: #B5CCF7;
    --button: #EEF0F2; --button-text: #17191C; color-scheme: dark;
  }

  * { box-sizing: border-box; }
  body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif; }
  a { color: var(--accent); text-underline-offset: 3px; }
  a:hover { color: var(--accent-ink); }
  :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
  img { max-width: 100%; display: block; }
  h1, h2, h3 { color: var(--ink); font-weight: 600; margin: 0; line-height: 1.25; }
  .wrap { max-width: 1120px; margin: 0 auto; padding: 0 32px; }
  .num { font-variant-numeric: tabular-nums; }

  /* header: icons on the left, name centred, sections on the right */
  header { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 10; }
  .bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
  .bar-end { display: flex; align-items: center; gap: 18px; }
  .menu { display: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--ink); place-items: center; cursor: pointer; }
  .profiles { display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; }
  .profiles a { color: var(--muted); width: 40px; height: 44px; display: grid; place-items: center; font-size: 20px; text-decoration: none; }
  .profiles a:hover { color: var(--accent); }
  .name { font-weight: 600; font-size: 19px; color: var(--ink); text-decoration: none; white-space: nowrap; }
  .sections { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0 22px; }
  .sections a { color: var(--muted); text-decoration: none; padding: 12px 0; font-size: 15px; border-bottom: 2px solid transparent; }
  .sections a:hover { color: var(--ink); }
  .sections a[aria-current="page"] { color: var(--ink); font-weight: 500; border-bottom-color: var(--accent); }
  .theme { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
  .theme .sun { display: none; }
  :root[data-theme="dark"] .theme .sun { display: block; } :root[data-theme="dark"] .theme .moon { display: none; }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme .sun { display: block; } :root:not([data-theme="light"]) .theme .moon { display: none; } }
  .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

  .buttons { display: flex; flex-wrap: wrap; gap: 12px; }
  .button { display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border-radius: 6px; font-weight: 500; font-size: 15px; text-decoration: none; border: 1px solid var(--line); color: var(--ink); }
  .button:hover { border-color: var(--muted); color: var(--ink); }
  .button.primary { background: var(--button); color: var(--button-text); border-color: var(--button); }

  /* about */
  .intro { display: grid; grid-template-columns: minmax(0, 1fr) 300px; grid-template-rows: auto 1fr; grid-template-areas: "name demo" "body demo";
           column-gap: 48px; row-gap: 20px; padding-block: 64px 48px; align-items: start; }
  .intro-name { grid-area: name; }
  .intro-body { grid-area: body; display: flex; flex-direction: column; gap: 20px; }
  .intro-body p { margin: 0; max-width: 66ch; }
  .demo { grid-area: demo; justify-self: center; width: 210px; }
  .intro h1 { font-size: 30px; font-weight: 500; letter-spacing: -0.005em; }
  .intro .role-line { margin: 2px 0 0; font-size: 17px; color: var(--muted); }
  .portrait img { width: 100%; aspect-ratio: 208 / 270; object-fit: cover; border-radius: 8px; }

  .demo { display: flex; flex-direction: column; gap: 8px; }
  .demo canvas { width: 100%; height: auto; aspect-ratio: 210 / 280; border-radius: 8px; background: var(--bg-alt); image-rendering: auto; }
  .demo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 13px; color: var(--muted); }
  .demo-button { min-height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
  .demo-button:hover { border-color: var(--muted); }
  .demo-label input { flex: 1; min-width: 80px; accent-color: var(--accent); }
  .demo-label output { width: 1ch; color: var(--ink); font-variant-numeric: tabular-nums; }
  .demo-blocks { border: 0; margin: 0; padding: 0; }
  .demo-blocks legend { float: left; margin-right: 8px; padding: 0; }
  .demo-blocks label { display: inline-flex; align-items: center; gap: 3px; min-height: 32px; cursor: pointer; }
  .demo-blocks input { accent-color: var(--accent); }
  .demo-caption { margin: 2px 0 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
  section.block { padding-block: 48px 8px; }
  .block-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 20px; }
  .block-head h2 { font-size: 22px; }
  .block-head a { font-size: 15px; font-weight: 500; }

  .questions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
  .question { background: var(--bg-alt); border-radius: 8px; padding: 20px 22px; }
  .question h3 { font-size: 16px; margin-bottom: 8px; }
  .question p { margin: 0; font-size: 15px; }
  .keywords { margin: 18px 0 0; font-size: 14px; color: var(--muted); }

  .rows { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
  .rows li { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 2px 24px; padding: 16px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
  .rows .date { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
  .rows .title { font-weight: 500; color: var(--ink); display: block; }
  .rows .meta { font-size: 14px; color: var(--muted); }
  .rows .go { font-size: 14px; font-weight: 500; white-space: nowrap; }
  .rows .role { display: inline-block; font-size: 12px; font-weight: 500; color: var(--text); background: var(--chip); border-radius: 4px; padding: 1px 7px; margin-right: 8px; vertical-align: 1px; }

  .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
  .card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; text-decoration: none; color: inherit; background: var(--bg); }
  .card:hover { border-color: var(--muted); color: inherit; }
  .card img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; border-bottom: 1px solid var(--line); background: #FFFFFF; }
  .card .placeholder { aspect-ratio: 16 / 9; background: var(--bg-alt); border-bottom: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); font-size: 14px; }
  .card .body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 6px; }
  .card h3 { font-size: 18px; }
  .card p { margin: 0; font-size: 15px; }
  .card .tech { font-size: 13px; color: var(--muted); }
  .lessons { margin: 14px 0 0; font-size: 15px; color: var(--muted); }
  .about-end { height: 72px; }

  /* software */
  .page-head { padding-block: 64px 32px; max-width: 720px; display: flex; flex-direction: column; gap: 10px; }
  .page-head h1 { font-size: 30px; font-weight: 500; }
  .page-head p { margin: 0; }
  .tool { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px; align-items: center; padding: 28px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 28px; }
  .tool .text { display: flex; flex-direction: column; gap: 12px; }
  .tool h2 { font-size: 24px; }
  .tool p { margin: 0; }
  .tool .status { font-size: 14px; color: var(--muted); }
  .tool .placeholder { aspect-ratio: 16 / 10; background: var(--bg-alt); border-radius: 8px; display: grid; place-items: center; color: var(--muted); font-size: 14px; }
  .figure { border-radius: 8px; border: 1px solid var(--line); background: #FFFFFF; }
  code.install { display: block; padding: 10px 14px; border-radius: 6px; background: var(--bg-alt); color: var(--ink); font: 14px/1.5 ui-monospace, Menlo, Consolas, monospace; overflow-x: auto; white-space: nowrap; border: 1px solid var(--line); }
  .links { display: flex; flex-wrap: wrap; gap: 0 20px; font-weight: 500; font-size: 15px; }
  .links a { padding: 10px 0; }

  footer { border-top: 1px solid var(--line); }
  footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-block: 24px; font-size: 14px; color: var(--muted); }
  footer a { color: var(--muted); }

  @media (max-width: 900px) {
    .wrap { padding: 0 20px; }
    header { position: static; }
    .intro { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: "name" "demo" "body"; row-gap: 24px; padding-block: 36px 24px; }
    .intro-body .buttons { justify-content: center; }
    .questions { grid-template-columns: 1fr; }
    .rows li { grid-template-columns: 1fr; }
    .tool { grid-template-columns: 1fr; padding: 18px; gap: 20px; }
    .page-head { padding-block: 36px 20px; }
  }
  @media (max-width: 720px) {
    header { position: relative; }
    .menu { display: grid; }
    .bar-end { gap: 8px; }
    .sections { display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 20; flex-direction: column; align-items: stretch;
                gap: 0; padding: 4px 20px 12px; background: var(--bg); border-bottom: 1px solid var(--line); }
    .sections.open { display: flex; }
    .sections a { padding: 12px 0; border-bottom: 1px solid var(--line); }
    .sections a:last-child { border-bottom: 0; }
    .sections a[aria-current="page"] { border-bottom-color: var(--line); color: var(--accent); }
    .profiles { margin-left: -10px; }
  }
  @media (max-width: 380px) {
    .profiles a { width: 34px; font-size: 18px; }
  }

  /* pages made of prose (publications, talks, software pages) */
  .page { padding-block: 56px 72px; }
  .page > h1:first-child, .page-title { font-size: 30px; font-weight: 500; margin: 0 0 8px; }
  .page-lead { margin: 0 0 32px; color: var(--muted); max-width: 66ch; }
  .page h2 { font-size: 22px; margin: 40px 0 16px; }
  .page h3 { font-size: 18px; margin: 28px 0 10px; }
  .page p, .page li { max-width: 72ch; }
  .page .rows li { max-width: none; }
  .page ul { padding-left: 1.2em; }
  .page table { border-collapse: collapse; width: 100%; margin: 12px 0 24px; font-size: 15px; }
  .page th, .page td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
  .page th { font-weight: 600; color: var(--ink); }
  .page code { font: 14px/1.5 ui-monospace, Menlo, Consolas, monospace; background: var(--bg-alt); padding: 1px 5px; border-radius: 4px; }
  .page pre { background: var(--bg-alt); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; overflow-x: auto; }
  .page pre code { background: none; padding: 0; }
  .page img { height: auto; }
  .page .rows { margin-bottom: 8px; }
  @media (max-width: 720px) { .page table { display: block; overflow-x: auto; } .page { padding-block: 32px 56px; } }
  [hidden] { display: none !important; }
