/* ---------- Fonts (self-hosted, SIL Open Font License) ---------- */
@font-face {
  font-family: 'Anybody';
  src: url('../fonts/anybody.woff') format('woff');
  font-weight: 100 900;
  font-stretch: 50% 150%;
  font-display: swap;
}
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  src: url('../fonts/atkinson-next.woff') format('woff');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  src: url('../fonts/atkinson-next-italic.woff') format('woff');
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Atkinson Hyperlegible Mono';
  src: url('../fonts/atkinson-mono.woff') format('woff');
  font-weight: 200 800;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --paper: #edf0ec;
  --paper-2: #e2e7e1;
  --panel: #f6f8f5;
  --ink: #18202e;
  --ink-2: #445063;
  --ink-3: #5a6576;
  --rule: #c5cdc6;
  --shelf: #d6ddd5;
  --route: #2b45e0;
  --route-ink: #ffffff;
  --route-soft: rgba(43, 69, 224, 0.12);
  --atk: #c13d29;
  --def: #0f7b77;

  --display: 'Anybody', 'Arial Narrow', system-ui, sans-serif;
  --text: 'Atkinson Hyperlegible Next', 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Atkinson Hyperlegible Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --gutter: clamp(16px, 4vw, 40px);
  --max: 1200px;
  --r-lg: 18px;
  --r-md: 10px;
  --r-sm: 6px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #0f151e;
    --paper-2: #151d28;
    --panel: #18212d;
    --ink: #e6eaf0;
    --ink-2: #b0b9c7;
    --ink-3: #95a0b0;
    --rule: #2b3646;
    --shelf: #1d2633;
    --route: #8d9dff;
    --route-ink: #0f151e;
    --route-soft: rgba(141, 157, 255, 0.14);
    --atk: #f27a63;
    --def: #49c4bd;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --paper: #0f151e;
  --paper-2: #151d28;
  --panel: #18212d;
  --ink: #e6eaf0;
  --ink-2: #b0b9c7;
  --ink-3: #95a0b0;
  --rule: #2b3646;
  --shelf: #1d2633;
  --route: #8d9dff;
  --route-ink: #0f151e;
  --route-soft: rgba(141, 157, 255, 0.14);
  --atk: #f27a63;
  --def: #49c4bd;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
@media (min-width: 900px) {
  body {
    font-size: 1.125rem;
  }
}
img {
  max-width: 100%;
  height: auto;
}
a {
  color: var(--route);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover {
  text-decoration-thickness: 2px;
}
:focus-visible {
  outline: 2px solid var(--route);
  outline-offset: 3px;
  border-radius: 4px;
}
h1,
h2,
h3,
h4 {
  font-family: var(--display);
  line-height: 1.05;
  margin: 0;
  font-weight: 700;
}
p {
  margin: 0 0 1em;
}
ul,
ol {
  margin: 0 0 1em;
  padding-left: 1.2em;
}
li + li {
  margin-top: 0.35em;
}
b,
strong {
  font-weight: 700;
}
.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 50;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 14px;
  border-radius: var(--r-sm);
}
.skip:focus {
  top: 12px;
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  min-height: 44px;
  padding: 0.55em 1.05em;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font: 600 0.95rem/1 var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.btn:hover {
  background: var(--ink);
  color: var(--paper);
}
.btn--primary {
  background: var(--route);
  border-color: var(--route);
  color: var(--route-ink);
}
.btn--primary:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

/* ---------- Nav ---------- */
.nav {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--max);
  margin-inline: auto;
  padding: 18px var(--gutter);
}
.nav__mark {
  font-family: var(--display);
  font-stretch: 125%;
  font-weight: 750;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
}
.nav nav {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2.4vw, 28px);
}
.nav__link {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 6px 0;
}
.nav__link:hover,
.nav__link[aria-current='page'] {
  color: var(--route);
}
.nav__link[aria-current='page'] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.4em;
}
.nav__search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 8px 0 12px;
  border: 1.5px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font: 600 0.9rem/1 var(--text);
  cursor: pointer;
}
.nav__search:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.nav__search svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.nav__menu-label {
  display: none;
}
kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 2px 6px;
  border: 1px solid var(--rule);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--panel);
  color: var(--ink-2);
  font: 600 0.75rem/1.4 var(--mono);
  text-align: center;
  white-space: nowrap;
}
@media (max-width: 760px) {
  .nav__link {
    display: none;
  }
  .nav__search {
    padding-right: 14px;
  }
  .nav__search kbd,
  .nav__search-label {
    display: none;
  }
  .nav__menu-label {
    display: inline;
  }
}
@media (hover: none) {
  .nav__search kbd,
  .footer__hint {
    display: none;
  }
}
.theme-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--rule);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.theme-toggle:hover {
  border-color: var(--ink);
}
.theme-toggle svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  grid-area: 1 / 1;
}
.theme-toggle svg:last-child {
  fill: currentColor;
  stroke: none;
}
/* Show the icon for the theme you'd switch to. */
.theme-toggle svg:first-child {
  display: none;
}
:root[data-theme='dark'] .theme-toggle svg:first-child {
  display: block;
}
:root[data-theme='dark'] .theme-toggle svg:last-child {
  display: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .theme-toggle svg:first-child {
    display: block;
  }
  :root:not([data-theme='light']) .theme-toggle svg:last-child {
    display: none;
  }
}

/* ---------- Hero: the shop floor ---------- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: max(660px, 100svh);
  border-bottom: 1px solid var(--rule);
  cursor: crosshair;
  overflow: hidden;
}
.hero__floor {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.hero__body {
  position: relative;
  z-index: 1;
  padding-top: clamp(28px, 7vh, 88px);
  pointer-events: none;
}
.hero__body > * {
  pointer-events: auto;
  cursor: auto;
}
.hero__name {
  font-family: var(--display);
  font-stretch: 150%;
  font-weight: 800;
  font-size: clamp(2.5rem, 7.1vw, 6.6rem);
  line-height: 0.88;
  letter-spacing: -0.015em;
  margin: 0 0 0.32em -0.04em;
  width: fit-content;
}
.hero__headline {
  font-family: var(--display);
  font-stretch: 105%;
  font-weight: 560;
  font-size: clamp(1.35rem, 0.95rem + 1.35vw, 2.1rem);
  line-height: 1.15;
  max-width: 25ch;
  margin-bottom: 0.7em;
  width: fit-content;
}
.hero__intro {
  max-width: 46ch;
  color: var(--ink-2);
  width: fit-content;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 1.5em;
  width: fit-content;
}
.hero__foot {
  position: relative;
  z-index: 1;
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 24px;
  padding-bottom: 20px;
  pointer-events: none;
}
.hero__caption {
  max-width: 60ch;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--ink-2);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  padding: 6px 0;
}
.hero__readout {
  display: flex;
  gap: 18px;
  margin: 0;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.hero__readout b {
  color: var(--ink);
  font-weight: 600;
}
@media (max-width: 599px) {
  .hero__name {
    font-stretch: 118%;
    font-size: 13.5vw;
  }
}
@media (max-width: 640px) {
  .hero {
    min-height: max(720px, 100svh);
  }
  .hero__readout {
    gap: 12px;
    font-size: 0.75rem;
  }
}

/* ---------- Now band ---------- */
.now {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 24px;
  padding-top: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--rule);
}
.now p {
  margin: 0;
}
.now__text strong {
  font-family: var(--display);
  font-stretch: 125%;
  margin-right: 0.6em;
}
.now__clock {
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* ---------- Sections ---------- */
.section {
  padding-top: clamp(64px, 9vw, 120px);
}
.section h2 {
  font-stretch: 130%;
  font-weight: 760;
  font-size: clamp(2rem, 1.3rem + 2.6vw, 3.3rem);
  letter-spacing: -0.01em;
  margin-bottom: 0.55em;
}
.section__intro {
  color: var(--ink-2);
  max-width: 52ch;
}
/* Heading above, content below: works for headings of any length. */
.split__body {
  max-width: 900px;
}
.split__body > p,
.split__body > .section__intro {
  max-width: 68ch;
}
.lede {
  font-size: 1.2em;
  line-height: 1.5;
}

/* Skills */
.skills {
  display: grid;
  gap: 14px;
  margin: 2em 0 0;
  padding-top: 1.4em;
  border-top: 1px solid var(--rule);
}
.skills div {
  display: grid;
  gap: 2px 24px;
}
@media (min-width: 640px) {
  .skills div {
    grid-template-columns: 11em 1fr;
  }
}
.skills dt {
  font-weight: 700;
}
.skills dd {
  margin: 0;
  color: var(--ink-2);
}

/* Work timeline */
.jobs {
  list-style: none;
  padding: 0;
  margin: 0;
}
.job {
  position: relative;
  display: grid;
  gap: 4px 28px;
  padding: 0 0 2.2em 26px;
}
.job + .job {
  margin-top: 0;
}
.job::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 0.55em;
  bottom: -0.55em;
  width: 1.5px;
  background: var(--rule);
}
.job:last-child::before {
  display: none;
}
.job::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0.4em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--route);
  background: var(--paper);
}
.job:first-child::after {
  background: var(--route);
}
@media (min-width: 700px) {
  .job {
    grid-template-columns: 10.5em 1fr;
  }
}
.job__dates {
  margin: 0;
  color: var(--ink-3);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  padding-top: 0.15em;
}
.job h3 {
  font-family: var(--text);
  font-size: 1.15em;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.35em;
}
.job__org {
  font-weight: 400;
  color: var(--ink-2);
}
.job__org::before {
  content: 'at ';
}
.job ul {
  list-style: disc;
  color: var(--ink-2);
  margin-bottom: 0;
}
.job p:last-child {
  margin-bottom: 0;
}

/* ---------- Projects ---------- */
.proj {
  display: grid;
  gap: 28px 56px;
  padding: clamp(40px, 6vw, 72px) 0;
  border-top: 1px solid var(--rule);
}
.proj:first-of-type {
  margin-top: 1.8em;
}
@media (min-width: 1000px) {
  .proj {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: start;
  }
  .proj:has(.vp) {
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  }
}
.proj h3 {
  font-stretch: 118%;
  font-weight: 720;
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  margin-bottom: 0.4em;
}
.proj__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  color: var(--ink-3);
  font-size: 0.95rem;
}
.proj__text ul {
  color: var(--ink-2);
}
.stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 1.2em 0;
}
.stack span {
  font-size: 0.8125rem;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  color: var(--ink-2);
}
.proj__links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  font-weight: 600;
}

/* Demo panels */
.demo {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: clamp(18px, 2.6vw, 28px);
  min-width: 0;
}
.demo__note {
  margin: 1.4em 0 0;
  font-size: 0.875rem;
  color: var(--ink-3);
  line-height: 1.5;
}
.demo fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.demo legend,
.vp__time label {
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 6px;
  padding: 0;
}

/* Segmented controls */
.seg {
  display: inline-flex;
  flex-wrap: wrap;
  border: 1.5px solid var(--rule);
  border-radius: var(--r-md);
  padding: 2px;
  gap: 2px;
  background: var(--paper);
}
.seg label {
  position: relative;
  cursor: pointer;
}
.seg input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.seg span {
  display: grid;
  place-items: center;
  min-width: 36px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.seg label:hover span {
  color: var(--ink);
  background: var(--paper-2);
}
.seg input:checked + span {
  background: var(--ink);
  color: var(--paper);
}
.seg input:focus-visible + span {
  outline: 2px solid var(--route);
  outline-offset: 2px;
}

/* Valorant predictor */
.vp {
  display: grid;
  gap: 22px 32px;
}
@media (min-width: 640px) {
  .vp {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  }
  .vp .demo__note {
    grid-column: 1 / -1;
  }
}
@media (min-width: 1000px) and (max-width: 1099px) {
  .vp {
    grid-template-columns: 1fr;
  }
}
.vp__controls {
  display: grid;
  gap: 16px;
  align-content: start;
}
.vp__time label {
  display: flex;
  justify-content: space-between;
}
.vp__time output {
  font-family: var(--mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.vp__time input {
  width: 100%;
  accent-color: var(--ink);
  height: 28px;
  margin: 0;
}
.vp__result {
  min-width: 0;
}
.vp__odds {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin: 0 0 10px;
}
.vp__odds > span {
  display: flex;
  flex-direction: column;
  font-size: 0.875rem;
  font-weight: 700;
}
.vp__def {
  text-align: right;
  align-items: flex-end;
}
.vp__odds b {
  font-family: var(--display);
  font-stretch: 130%;
  font-weight: 800;
  font-size: clamp(2rem, 1.5rem + 1.4vw, 2.75rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.vp__atk {
  color: var(--atk);
}
.vp__def {
  color: var(--def);
  flex-direction: column-reverse !important;
}
.vp__bar {
  height: 14px;
  border-radius: 999px;
  background: var(--def);
  overflow: hidden;
}
.vp__bar span {
  display: block;
  height: 100%;
  width: 50%;
  background: var(--atk);
  border-right: 3px solid var(--panel);
  transition: width 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.vp__decided {
  margin: 14px 0 0;
  font-weight: 600;
}
.vp__factors-h {
  margin: 22px 0 8px;
  font-size: 0.875rem;
  font-weight: 700;
}
.vp__factors-h span {
  font-weight: 400;
  color: var(--ink-3);
}
.vp__factors ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.vp__factors li {
  display: grid;
  grid-template-columns: 7.6em 1fr 3.4em;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  margin: 0;
  padding: 3px 0;
}
.vp__factors .track {
  position: relative;
  height: 10px;
}
.vp__factors .track::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -3px;
  bottom: -3px;
  width: 1px;
  background: var(--ink-3);
}
.vp__factors .fill {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 3px;
  transition: width 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), left 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.vp__factors .val {
  font-family: var(--mono);
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}
.vp__presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 22px;
}
.vp__presets p {
  width: 100%;
  margin: 0 0 2px;
  font-size: 0.875rem;
  font-weight: 700;
}
.vp__presets button {
  font: 600 0.85rem/1 var(--text);
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1.5px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}
.vp__presets button:hover {
  border-color: var(--ink);
}

/* Homelab */
.lab__flow {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  justify-items: start;
}
.lab__flow > li {
  position: relative;
  margin: 0 0 26px;
}
.lab__flow > li:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 22px;
  top: 100%;
  height: 26px;
  border-left: 2px dotted var(--route);
}
.lab__node {
  padding: 10px 16px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--ink);
  background: var(--paper);
  font-weight: 700;
}
.lab__node span {
  font-weight: 400;
  color: var(--ink-2);
  margin-left: 0.35em;
}
.lab__cluster {
  width: 100%;
  border: 1.5px dashed var(--ink-3);
  border-radius: var(--r-lg);
  padding: 14px 16px 16px;
}
.lab__cluster > p:first-child {
  font-weight: 700;
  margin: 0 0 10px;
}
.lab__cluster ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.lab__cluster li {
  margin: 0;
  padding: 7px 12px;
  border-radius: var(--r-sm);
  background: var(--route-soft);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
}
.lab__hosts {
  margin: 14px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
  font-size: 0.875rem;
  color: var(--ink-2);
}
.lab__node--store {
  border-style: solid;
  border-color: var(--ink-3);
}
.lab__speed {
  margin: 8px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}
.lab__speed figcaption {
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.lab__bars p {
  display: grid;
  grid-template-columns: 4em 1fr 6em;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  font-size: 0.875rem;
}
.lab__bars i {
  display: block;
  height: 12px;
  width: var(--w);
  background: var(--route);
  border-radius: 3px;
}
.lab__bars p:first-child i {
  background: var(--ink-3);
}
.lab__bars b {
  font-family: var(--mono);
  font-weight: 600;
}

/* Email assistant */
.em__mail {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 14px 16px;
}
.em__from {
  margin: 0 0 2px;
  font-size: 0.875rem;
  color: var(--ink-3);
}
.em__from b {
  color: var(--ink);
}
.em__subject {
  font-weight: 700;
  margin: 0 0 4px;
}
.em__snippet {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.em__steps {
  list-style: none;
  padding: 0;
  margin: 18px 0;
  counter-reset: step;
}
.em__steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 8.5em 1fr;
  gap: 4px 14px;
  align-items: start;
  padding: 10px 0;
  margin: 0;
  border-top: 1px solid var(--rule);
  font-size: 0.95rem;
}
.em__step {
  font-weight: 700;
  font-size: 0.875rem;
}
.em__step::before {
  content: counter(step) '. ';
  color: var(--route);
}
.em__tag {
  justify-self: start;
  padding: 3px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--atk) 14%, transparent);
  color: var(--atk);
  font-weight: 700;
  font-size: 0.85rem;
}
.em__draft textarea {
  width: 100%;
  resize: vertical;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--rule);
  border-radius: var(--r-sm);
  padding: 8px 10px;
}
.em__draft textarea:focus {
  outline: 2px solid var(--route);
  outline-offset: 1px;
}
@media (max-width: 520px) {
  .em__steps li {
    grid-template-columns: 1fr;
  }
}
.em__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.em__confirm {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--route);
  background: var(--route-soft);
}
.em__confirm[hidden] {
  display: none;
}
.em__confirm p {
  margin: 0 auto 0 0;
  font-weight: 700;
}
.em__status {
  margin: 0;
  font-weight: 600;
  color: var(--def);
}

/* Cart legend */
.cartdemo > p:first-child {
  margin-top: 0;
}
.legend {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: grid;
  gap: 10px;
}
.legend li {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
}
.lg {
  flex: none;
  display: inline-block;
  width: 22px;
  height: 22px;
  position: relative;
}
.lg--cart::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--route);
  box-shadow: 0 0 0 4px var(--route-soft);
}
.lg--shopper::before {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  border: 2px solid var(--ink-2);
}
.lg--searched {
  background: var(--route-soft);
  border-radius: 3px;
  outline: 1px solid color-mix(in srgb, var(--route) 30%, transparent);
}
.lg--open {
  border-radius: 3px;
  outline: 1.5px solid color-mix(in srgb, var(--route) 55%, transparent);
  outline-offset: -4px;
}
.lg--route::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 10px;
  border-top: 3px solid var(--route);
}
.lg--item::before {
  content: '';
  position: absolute;
  inset: 7px;
  background: var(--ink);
  border-radius: 2px;
}

/* More projects */
.more {
  border-top: 1px solid var(--rule);
  padding-top: clamp(40px, 6vw, 64px);
}
.more > h3 {
  font-stretch: 118%;
  font-size: 1.5rem;
  margin-bottom: 1em;
}
.more__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 32px 40px;
}
@media (min-width: 800px) {
  .more__list {
    grid-template-columns: repeat(2, 1fr);
  }
}
.more__item {
  margin: 0;
}
.more__item h4 {
  font-family: var(--text);
  font-size: 1.1em;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.4em;
}
.more__item p {
  color: var(--ink-2);
  font-size: 0.95em;
}
.more__item .stack {
  margin: 0.6em 0 0;
}

/* ---------- Blog lists ---------- */
.posts {
  list-style: none;
  padding: 0;
  margin: 1.6em 0 1.4em;
}
.posts__item {
  display: grid;
  gap: 2px 28px;
  padding: 18px 0;
  margin: 0;
  border-top: 1px solid var(--rule);
}
.posts__item:last-child {
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 640px) {
  .posts__item {
    grid-template-columns: 9.5em 1fr;
  }
}
.posts time {
  color: var(--ink-3);
  font-size: 0.95rem;
  padding-top: 0.15em;
  font-variant-numeric: tabular-nums;
}
.posts h3 {
  font-family: var(--text);
  font-size: 1.2em;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.25em;
}
.posts h3 a {
  color: var(--ink);
  text-decoration: none;
}
.posts h3 a:hover {
  color: var(--route);
  text-decoration: underline;
}
.posts p {
  margin: 0;
  color: var(--ink-2);
}
.textlink {
  font-weight: 700;
}
.empty {
  color: var(--ink-3);
}

/* ---------- Contact + footer ---------- */
.contact {
  padding-bottom: clamp(64px, 9vw, 120px);
}
.contact > p:first-of-type {
  max-width: 52ch;
  color: var(--ink-2);
}
.contact__email {
  display: inline-block;
  font-family: var(--display);
  font-stretch: 120%;
  font-weight: 750;
  font-size: clamp(1.45rem, 0.6rem + 4.6vw, 3.6rem);
  line-height: 1.1;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--route);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.14em;
  overflow-wrap: anywhere;
}
@media (max-width: 599px) {
  .contact__email {
    font-stretch: 104%;
    font-size: 7.4vw;
  }
}
.contact__email:hover {
  color: var(--route);
}
.footer {
  border-top: 1px solid var(--rule);
  font-size: 0.95rem;
  color: var(--ink-3);
}
.footer p {
  margin: 0;
}
.footer__grid {
  display: grid;
  gap: 28px 48px;
  padding-top: 40px;
  padding-bottom: 32px;
}
@media (min-width: 720px) {
  .footer__grid {
    grid-template-columns: 2fr 1fr 1fr;
  }
}
.footer__about {
  display: grid;
  gap: 6px;
  align-content: start;
}
.footer__name {
  font-family: var(--display);
  font-stretch: 125%;
  font-weight: 750;
  font-size: 1.15rem;
  color: var(--ink);
}
.footer__hint {
  margin-top: 8px !important;
}
.footer__col {
  display: grid;
  gap: 6px;
  align-content: start;
}
.footer__col p {
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}
.footer a {
  color: var(--ink-2);
  text-decoration: none;
}
.footer a:hover {
  color: var(--route);
  text-decoration: underline;
}
.footer__base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 24px;
  padding-top: 16px;
  padding-bottom: 28px;
  border-top: 1px solid var(--rule);
  font-size: 0.875rem;
}
.footer__build code {
  font-family: var(--mono);
  font-size: 0.95em;
}

/* ---------- Blog pages ---------- */
body:not(.page-home) .nav {
  border-bottom: 1px solid var(--rule);
  max-width: none;
  padding-inline: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
}
.blog {
  padding-top: clamp(40px, 7vw, 88px);
  padding-bottom: 80px;
  max-width: 860px;
}
.page-head h1,
.notfound h1 {
  font-stretch: 140%;
  font-weight: 800;
  font-size: clamp(2.6rem, 1.4rem + 5vw, 5rem);
  letter-spacing: -0.01em;
  margin-bottom: 0.3em;
}
.page-head p {
  color: var(--ink-2);
  max-width: 56ch;
}
.page-head {
  margin-bottom: 1.6em;
}
.year {
  margin-top: 2.6em;
}
.year h2 {
  font-stretch: 120%;
  font-size: 1.25rem;
  color: var(--ink-3);
}
.year .posts {
  margin-top: 0.8em;
}
.post {
  max-width: 820px;
  padding-top: clamp(32px, 6vw, 72px);
  padding-bottom: 80px;
}
.post__back {
  margin-bottom: 1.6em;
  font-weight: 600;
  font-size: 0.95rem;
}
.post__head h1 {
  font-stretch: 122%;
  font-weight: 780;
  font-size: clamp(2.1rem, 1.3rem + 3.4vw, 3.9rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin-bottom: 0.45em;
}
.post__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  color: var(--ink-3);
  font-size: 0.95rem;
  margin-bottom: 2.4em;
}
.post__cover {
  display: block;
  width: 100%;
  border-radius: var(--r-lg);
  margin-bottom: 2.4em;
}
.prose {
  max-width: 66ch;
  font-size: 1.0625em;
  line-height: 1.72;
}
.prose > * + * {
  margin-top: 1.15em;
}
.prose p,
.prose ul,
.prose ol {
  margin-bottom: 0;
}
.prose h2,
.prose h3,
.prose h4 {
  margin-top: 1.9em;
  line-height: 1.15;
}
.prose h2 {
  font-stretch: 118%;
  font-size: 1.65em;
}
.prose h3 {
  font-stretch: 110%;
  font-size: 1.3em;
}
.prose h4 {
  font-family: var(--text);
  font-size: 1.05em;
}
.prose img {
  display: block;
  border-radius: var(--r-md);
  margin-inline: auto;
}
.prose blockquote {
  margin-left: 0;
  margin-right: 0;
  padding-left: 1.1em;
  border-left: 3px solid var(--route);
  color: var(--ink-2);
}
.prose code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--paper-2);
  padding: 0.12em 0.35em;
  border-radius: 4px;
}
.prose pre {
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 14px 16px;
  line-height: 1.5;
}
.prose pre code {
  background: none;
  padding: 0;
}
.prose hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.4em 0;
}
.prose table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95em;
}
.prose th,
.prose td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--rule);
}
.post__pn {
  display: grid;
  gap: 12px;
  margin-top: 4em;
  padding-top: 2em;
  border-top: 1px solid var(--rule);
}
@media (min-width: 640px) {
  .post__pn {
    grid-template-columns: 1fr 1fr;
  }
}
.pn {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
}
.pn span {
  font-weight: 400;
  font-size: 0.875rem;
  color: var(--ink-3);
}
.pn:hover {
  color: var(--route);
}
.pn--next {
  text-align: right;
  grid-column: 2;
}
@media (max-width: 639px) {
  .pn--next {
    grid-column: auto;
    text-align: left;
  }
}
.notfound {
  padding-top: clamp(56px, 10vw, 120px);
  padding-bottom: 120px;
}
.notfound__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 1.6em;
}

/* ---------- Status chips and tags ---------- */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  font: 700 0.78rem/1.3 var(--text);
  white-space: nowrap;
  vertical-align: middle;
  color: var(--ink-2);
  background: var(--paper-2);
}
.status::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.status--in-progress {
  color: var(--route);
  background: var(--route-soft);
}
.status--running {
  color: var(--def);
  background: color-mix(in srgb, var(--def) 14%, transparent);
}
.status--finished {
  color: var(--ink-3);
}
.proj__meta .status {
  margin-left: 2px;
}
.proj__title {
  color: inherit;
  text-decoration: none;
}
.proj__title:hover {
  color: var(--route);
  text-decoration: underline;
  text-decoration-thickness: 2px;
}
.tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag {
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
}
.tag:hover {
  border-color: var(--route);
  color: var(--route);
}
.posts__meta {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-top: 8px !important;
  font-size: 0.875rem;
  color: var(--ink-3) !important;
}
.more__all {
  margin-top: 2em;
}

/* ---------- Contact ---------- */
.contact__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}

/* ---------- Archive pages ---------- */
.archive {
  max-width: 980px;
  padding-top: clamp(40px, 7vw, 88px);
  padding-bottom: 80px;
}
.year__count {
  font-family: var(--text);
  font-stretch: 100%;
  font-weight: 400;
  font-size: 0.95rem;
  margin-left: 0.4em;
}
.plist {
  list-style: none;
  padding: 0;
  margin: 1em 0 0;
}
.plist__item {
  display: grid;
  gap: 4px 32px;
  margin: 0;
  padding: 22px 0;
  border-top: 1px solid var(--rule);
}
.plist__item:last-child {
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 720px) {
  .plist__item {
    grid-template-columns: 11em 1fr;
  }
}
.plist__when {
  margin: 0;
  color: var(--ink-3);
  font-size: 0.95rem;
  padding-top: 0.2em;
}
.plist h3 {
  font-family: var(--text);
  font-size: 1.2em;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.3em;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
}
.plist h3 a {
  color: var(--ink);
  text-decoration: none;
}
.plist h3 a:hover {
  color: var(--route);
  text-decoration: underline;
}
.plist p {
  color: var(--ink-2);
  margin-bottom: 0.4em;
}
.plist .stack {
  margin: 0.6em 0 0;
}

/* History timeline */
.history {
  list-style: none;
  padding: 0;
  margin: 1em 0 0;
  position: relative;
}
.history li {
  position: relative;
  display: grid;
  gap: 2px 24px;
  margin: 0;
  padding: 0 0 1.4em 26px;
}
@media (min-width: 640px) {
  .history li {
    grid-template-columns: 8em 1fr;
  }
}
.history li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 0.6em;
  bottom: -0.5em;
  width: 1.5px;
  background: var(--rule);
}
.history li:last-child::before {
  display: none;
}
.history li::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--route);
  background: var(--paper);
}
.history time {
  color: var(--ink-3);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
.history p {
  margin: 0;
  color: var(--ink-2);
}
.history p a {
  font-weight: 700;
  margin-right: 0.3em;
}

/* ---------- Project pages ---------- */
.project {
  max-width: 980px;
  padding-top: clamp(32px, 6vw, 72px);
  padding-bottom: 80px;
}
.project__head {
  max-width: 760px;
}
.project__head h1 {
  font-stretch: 125%;
  font-weight: 790;
  font-size: clamp(2.2rem, 1.3rem + 3.6vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin-bottom: 0.4em;
  text-wrap: balance;
}
.project__head .proj__meta {
  margin-bottom: 1.2em;
}
.project__points {
  max-width: 760px;
  margin-top: 1.6em;
  padding: 18px 22px 18px 24px;
  border-left: 3px solid var(--route);
  background: var(--panel);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}
.project__points ul {
  margin: 0;
  color: var(--ink-2);
}
.project__demo,
.project__history {
  margin-top: clamp(48px, 7vw, 80px);
}
.project__demo h2,
.project__history h2,
.project__body h2 {
  font-stretch: 118%;
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  margin-bottom: 0.7em;
}
.project__body {
  margin-top: clamp(48px, 7vw, 80px);
}
.project__body > h2:first-child {
  margin-top: 0;
}
.project .post__pn {
  max-width: 760px;
}

/* Interactive diagram */
.diagram {
  margin: clamp(40px, 6vw, 64px) 0 0;
  padding: clamp(18px, 2.6vw, 28px);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  min-width: 0;
}
.diagram__title {
  font-family: var(--display);
  font-stretch: 112%;
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 4px;
}
.diagram__scroll {
  overflow-x: auto;
  margin: 12px -4px 0;
  padding: 6px 4px 10px;
  scrollbar-width: thin;
}
.diagram__track {
  list-style: none;
  display: flex;
  gap: 30px;
  margin: 0;
  padding: 0;
  width: max-content;
  min-width: 100%;
}
.diagram__track li {
  position: relative;
  margin: 0;
  flex: 1 0 auto;
}
.diagram__track li + li::before {
  content: '';
  position: absolute;
  left: -27px;
  top: 50%;
  width: 24px;
  border-top: 2px dotted var(--route);
}
.diagram__track li + li::after {
  content: '';
  position: absolute;
  left: -8px;
  top: calc(50% - 4px);
  border: 5px solid transparent;
  border-left: 6px solid var(--route);
  border-right: 0;
}
.diagram__node {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  min-width: 9.5em;
  max-width: 13em;
  min-height: 64px;
  padding: 10px 14px;
  border: 1.5px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.diagram__node:hover {
  border-color: var(--ink);
}
.diagram__node[aria-selected='true'] {
  border-color: var(--route);
  background: var(--route);
  color: var(--route-ink);
}
.diagram__label {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.25;
}
.diagram__note {
  font-size: 0.8rem;
  line-height: 1.3;
  opacity: 0.8;
}
.diagram__detail {
  margin-top: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  max-width: 68ch;
}
.diagram__detail p {
  margin: 0;
}
.diagram__nav {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.diagram__nav button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1.5px solid var(--rule);
  background: transparent;
  color: var(--ink);
  font: 600 0.85rem/1 var(--text);
  cursor: pointer;
}
.diagram__nav button:hover:not(:disabled) {
  border-color: var(--ink);
}
.diagram__nav button:disabled {
  opacity: 0.4;
  cursor: default;
}
.diagram__scroll.has-more {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent);
}
.diagram__step {
  font-size: 0.8rem;
  color: var(--ink-3);
  margin-bottom: 2px !important;
}
.diagram__head {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 4px !important;
}
@media (max-width: 640px) {
  .diagram__scroll {
    overflow: visible;
  }
  .diagram__track {
    flex-direction: column;
    gap: 22px;
    width: 100%;
  }
  .diagram__track li + li::before {
    left: 22px;
    top: -20px;
    width: 0;
    height: 18px;
    border-top: 0;
    border-left: 2px dotted var(--route);
  }
  .diagram__track li + li::after {
    left: 18px;
    top: -8px;
    border: 5px solid transparent;
    border-top: 6px solid var(--route);
    border-bottom: 0;
  }
  .diagram__node {
    max-width: none;
    min-height: 0;
    flex-direction: row;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 2px 10px;
  }
}

/* HUD reader */
.hud {
  margin: clamp(40px, 6vw, 64px) 0 0;
  padding: clamp(18px, 2.6vw, 28px);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
}
.hud__title {
  font-family: var(--display);
  font-stretch: 112%;
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 14px;
}
.hud__frame {
  position: relative;
  max-width: 600px;
  border-radius: var(--r-sm);
  overflow: hidden;
}
.hud__frame img {
  display: block;
  width: 100%;
  height: auto;
}
.hud__box {
  position: absolute;
  padding: 0;
  border: 2px dashed rgba(255, 255, 255, 0.75);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}
.hud__box:hover {
  border-style: solid;
}
.hud__box[aria-pressed='true'] {
  border: 2.5px solid #ffd84d;
  box-shadow: 0 0 0 9999px rgba(10, 14, 22, 0.35);
}
.hud__out {
  margin-top: 14px;
}
.hud__out p:first-child {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin-bottom: 6px;
  font-weight: 700;
}
.hud__out code {
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--route);
}
.hud__out b {
  font-family: var(--mono);
  font-size: 1.3rem;
}
.hud__note {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ink-3);
}

/* Blog filters */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 1em;
}
.filters button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1.5px solid var(--rule);
  background: transparent;
  color: var(--ink);
  font: 600 0.9rem/1 var(--text);
  cursor: pointer;
}
.filters button:hover {
  border-color: var(--ink);
}
.filters button[aria-pressed='true'] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.filters__empty {
  color: var(--ink-3);
}

/* Tables inside posts and project write-ups */
.table-scroll {
  overflow-x: auto;
}

/* ---------- Now page ---------- */
.nowpage .page-head .post__meta {
  margin-bottom: 0;
}
.nowpage__about {
  margin-top: 3em;
  padding-top: 1.2em;
  border-top: 1px solid var(--rule);
  font-size: 0.95rem;
  color: var(--ink-3);
}

/* ---------- Resume ---------- */
.cv {
  max-width: 900px;
  padding-top: clamp(28px, 5vw, 56px);
  padding-bottom: 80px;
}
.cv__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin-bottom: 24px;
}
.cv__actions p {
  margin: 0;
  color: var(--ink-3);
  font-size: 0.9rem;
}
.cv__sheet {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: clamp(22px, 5vw, 56px);
}
.cv__head h1 {
  font-stretch: 140%;
  font-weight: 800;
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.2rem);
  margin-bottom: 0.25em;
}
.cv__contact {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  font-size: 0.95rem;
  color: var(--ink-2);
}
.cv__summary {
  max-width: 70ch;
  color: var(--ink-2);
}
.cv section {
  margin-top: 2em;
}
.cv h2 {
  font-stretch: 118%;
  font-size: 1.15rem;
  padding-bottom: 6px;
  border-bottom: 1.5px solid var(--ink);
  margin-bottom: 0.9em;
}
.cv__list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.cv__entry {
  margin: 0 0 1.2em;
}
.cv__entry ul {
  list-style: disc;
  margin: 0.3em 0 0;
  color: var(--ink-2);
  font-size: 0.97em;
}
.cv__entry > p {
  margin: 0.2em 0 0;
  color: var(--ink-2);
}
.cv__line {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 2px 16px;
}
.cv__line h3 {
  font-family: var(--text);
  font-size: 1.05em;
  font-weight: 700;
  line-height: 1.35;
}
.cv__line h3 a {
  color: inherit;
}
.cv__dates {
  margin: 0;
  color: var(--ink-3);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.cv__stack {
  font-size: 0.9rem;
  color: var(--ink-3) !important;
}
.cv__skills {
  display: grid;
  gap: 8px;
  margin: 0;
}
.cv__skills div {
  display: grid;
  gap: 0 20px;
}
@media (min-width: 640px) {
  .cv__skills div {
    grid-template-columns: 10em 1fr;
  }
}
.cv__skills dt {
  font-weight: 700;
}
.cv__skills dd {
  margin: 0;
  color: var(--ink-2);
}
@media print {
  @page {
    size: A4;
    margin: 14mm;
  }
  .page-resume .nav,
  .page-resume .footer,
  .page-resume .cv__actions,
  .skip {
    display: none !important;
  }
  .page-resume {
    background: #fff;
    color: #000;
    font-size: 10.5pt;
  }
  .page-resume .cv {
    padding: 0;
    max-width: none;
  }
  .page-resume .cv__sheet {
    border: 0;
    padding: 0;
    background: #fff;
  }
  .page-resume a {
    color: #000;
    text-decoration: none;
  }
  .page-resume .cv__entry {
    break-inside: avoid;
  }
}

/* ---------- Colophon ---------- */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13em, 1fr));
  gap: 1px;
  margin: 0 0 2.6em;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  overflow: hidden;
}
.facts div {
  background: var(--panel);
  padding: 14px 16px;
}
.facts dt {
  font-size: 0.85rem;
  color: var(--ink-3);
}
.facts dd {
  margin: 2px 0 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.facts code {
  font-family: var(--mono);
}
.shortcuts {
  margin-top: 3em;
}
.shortcuts h2 {
  font-stretch: 118%;
  font-size: 1.65em;
  margin-bottom: 0.6em;
}
.shortcuts table {
  border-collapse: collapse;
  width: 100%;
  max-width: 560px;
}
.shortcuts td {
  padding: 8px 10px 8px 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}
.shortcuts td:first-child {
  width: 8em;
  white-space: nowrap;
}

/* ---------- Command palette ---------- */
.palette {
  width: min(640px, calc(100vw - 24px));
  max-height: min(560px, calc(100dvh - 48px));
  margin: max(8vh, 24px) auto auto;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 24px 60px -12px rgba(15, 21, 30, 0.35);
  overflow: hidden;
}
.palette::backdrop {
  background: rgba(15, 21, 30, 0.38);
}
.palette__box {
  display: flex;
  flex-direction: column;
  max-height: inherit;
}
.palette__search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 12px 16px;
  border-bottom: 1px solid var(--rule);
}
.palette__search svg {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 2;
  stroke-linecap: round;
}
.palette__search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 500 1.05rem/1.4 var(--text);
  padding: 6px 0;
}
.palette__search input:focus {
  outline: none;
}
.palette__search input::placeholder {
  color: var(--ink-3);
}
.palette__close {
  flex: none;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink-2);
  font: 600 0.75rem/1 var(--mono);
  cursor: pointer;
}
.palette__answer {
  margin: 12px 12px 0;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--route-soft);
  font-size: 0.95rem;
}
.palette__answer p {
  margin: 0;
}
.palette__hello {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9em, 1fr));
  gap: 8px 16px;
}
.palette__hello li {
  display: flex;
  flex-direction: column;
  margin: 0;
}
.palette__hello b {
  font-size: 1.3rem;
}
.palette__hello span {
  font-size: 0.8rem;
  color: var(--ink-3);
}
.palette__keys {
  border-collapse: collapse;
}
.palette__keys td {
  padding: 3px 14px 3px 0;
}
.palette__list {
  list-style: none;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.palette__group {
  margin: 0;
  padding: 10px 10px 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-3);
}
.palette__opt {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.palette__opt[aria-selected='true'] {
  background: var(--route);
  color: var(--route-ink);
}
.palette__opt[aria-selected='true'] .palette__kind,
.palette__opt[aria-selected='true'] .palette__hint {
  color: inherit;
  opacity: 0.85;
}
.palette__opt[aria-selected='true'] kbd {
  background: transparent;
  color: inherit;
  border-color: currentColor;
}
.palette__title {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.palette__kind,
.palette__hint {
  flex: none;
  font-size: 0.8rem;
  color: var(--ink-3);
}
.palette__empty {
  margin: 0;
  padding: 18px 12px;
  color: var(--ink-3);
}
.palette__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0;
  padding: 10px 16px;
  border-top: 1px solid var(--rule);
  font-size: 0.8rem;
  color: var(--ink-3);
}
.palette__foot-tip {
  margin-left: auto;
}
.palette__close-word {
  display: none;
}
@media (hover: none), (max-width: 560px) {
  .palette__foot,
  .palette__hint kbd,
  .palette__close-key {
    display: none;
  }
  .palette__close-word {
    display: inline;
    font-family: var(--text);
    font-size: 0.85rem;
  }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
