/* jakubvrba.cz: hand-written CSS, no framework. */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/assets/fonts/schibsted-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/assets/fonts/schibsted-latin-ext.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/assets/fonts/schibsted-italic-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/assets/fonts/schibsted-italic-latin-ext.woff2") format("woff2");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jbmono-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jbmono-latin-ext.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- tokens ---------- */
:root {
  --ground: #f2ece9;
  --surface: #faf6f4;
  --surface-2: #e4dad5;
  --ink: #1c1317;
  --ink-2: #5c4a4f;
  --ink-3: #6f5d62;
  --ink-4: #b8a8ac;
  --line: rgba(28, 19, 23, 0.14);
  --accent: #c41e68;
  --accent-ink: #a8175a;
  --accent-hover: #a8175a;
  --on-accent: #fbfcfc;
  --shadow-sm: 0 1px 2px rgba(28, 19, 23, 0.05), 0 1px 1px rgba(28, 19, 23, 0.04);
  --shadow-md: 0 12px 32px -16px rgba(28, 19, 23, 0.22);
  --shadow-lg: 0 32px 72px -28px rgba(28, 19, 23, 0.3);

  --font: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --gutter: clamp(16px, 4vw, 48px);
  --nav-h: 64px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 28px;
  --radius-pill: 999px;

  /* z-index scale: nav < floating labels < dialog < skip link */
  --z-nav: 20;
  --z-float: 30;
  --z-dialog: 100;
  --z-skip: 200;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #140f12;
    --surface: #1d1518;
    --surface-2: #2b2024;
    --ink: #f0e8ea;
    --ink-2: #b8a4aa;
    --ink-3: #9c868c;
    --ink-4: #473a3e;
    --line: rgba(240, 232, 234, 0.14);
    --accent: #ee4b8f;
    --accent-ink: #f06aa2;
    --accent-hover: #f26aa3;
    --on-accent: #0e1113;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 1px rgba(0, 0, 0, 0.24);
    --shadow-md: 0 12px 32px -16px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 32px 72px -28px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #140f12;
  --surface: #1d1518;
  --surface-2: #2b2024;
  --ink: #f0e8ea;
  --ink-2: #b8a4aa;
  --ink-3: #9c868c;
  --ink-4: #473a3e;
  --line: rgba(240, 232, 234, 0.14);
  --accent: #ee4b8f;
  --accent-ink: #f06aa2;
  --accent-hover: #f26aa3;
  --on-accent: #0e1113;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 1px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 12px 32px -16px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 32px 72px -28px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  background: var(--ground);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  scrollbar-color: var(--ink-3) var(--ground);
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body.is-locked { overflow: hidden; }

::selection { background: var(--accent); color: var(--on-accent); }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -0.03em; line-height: 1; text-wrap: balance; }
p { margin: 0; }
button { font: inherit; color: inherit; }
/* Taps fire immediately (no double-tap-zoom wait); control labels don't get selected on long-press. */
a, button, [role="button"] { touch-action: manipulation; }
button, .btn, .icon-btn { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: fixed; left: 12px; top: -64px; z-index: var(--z-skip);
  padding: 10px 14px; background: var(--ink); color: var(--ground);
  font-weight: 700; text-decoration: none;
  transition: top 160ms var(--ease-out);
}
.skip:focus { top: 12px; }

/* Physical properties instead of logical ones keep the layout intact in Safari before 14.1. */
.wrap {
  max-width: 1400px; margin-left: auto; margin-right: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}
.icon { width: 1.15em; height: 1.15em; flex: none; fill: currentColor; }
.mono { font-family: var(--mono); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55em;
  min-height: 48px; padding: 0 1.3em;
  border: 1.5px solid var(--ink); border-radius: var(--radius-sm); background: transparent; color: var(--ink);
  font-weight: 700; font-size: 1rem; line-height: 1; text-decoration: none; white-space: nowrap;
  cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn .icon { width: 1.1em; height: 1.1em; }

.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 1.5px solid var(--line); border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer;
  transition: transform 160ms var(--ease-out), border-color 160ms ease, background-color 160ms ease;
}
.icon-btn:active { transform: scale(0.95); }

@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--ink); color: var(--ground); }
  .btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
  .icon-btn:hover { border-color: var(--ink); }
}

/* ---------- navigation ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: var(--z-nav);
  height: var(--nav-h);
  display: flex; align-items: center; gap: clamp(12px, 2vw, 28px);
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
  background: var(--ground);
  border-bottom: 1px solid var(--line);
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .nav {
    background: color-mix(in srgb, var(--ground) 72%, transparent);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    backdrop-filter: blur(20px) saturate(160%);
  }
}
.nav__brand {
  margin-right: auto;
  font-weight: 800; font-size: 1.125rem; letter-spacing: -0.02em;
  text-decoration: none; white-space: nowrap;
}
.nav__links { display: flex; gap: clamp(16px, 2.4vw, 34px); list-style: none; margin: 0; padding: 0; }
.nav__links a {
  position: relative; display: block; padding: 8px 0;
  font-weight: 600; font-size: 0.98rem; color: var(--ink-2); text-decoration: none;
  transition: color 160ms ease;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1.5px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform 260ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .nav__links a:hover { color: var(--ink); }
  .nav__links a:hover::after { transform: scaleX(1); }
}
.nav__theme .i-sun { display: none; }
:root[data-theme="dark"] .nav__theme .i-sun { display: block; }
:root[data-theme="dark"] .nav__theme .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .nav__theme .i-sun { display: block; }
  :root:not([data-theme="light"]) .nav__theme .i-moon { display: none; }
}
.nav__menu { display: none; }

@media (max-width: 960px) {
  .nav__menu { display: inline-grid; }
  .nav__links {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    display: none; flex-direction: column; gap: 0;
    max-height: calc(100svh - var(--nav-h)); overflow-y: auto;
    padding: 8px max(var(--gutter), env(safe-area-inset-right, 0px)) 28px max(var(--gutter), env(safe-area-inset-left, 0px));
    background: var(--ground); border-bottom: 1px solid var(--line);
  }
  .nav.is-open .nav__links { display: flex; }
  .nav__links a { padding: 14px 0; font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding-top: calc(var(--nav-h) + clamp(3rem, 8vw, 6rem));
  padding-bottom: clamp(3rem, 7vw, 5rem);
  background: var(--ground);
}
.hero__inner {
  max-width: 46rem; margin: 0 auto; text-align: center;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 0.6em;
  padding: 0.5em 1.1em 0.5em 0.9em; border-radius: var(--radius-pill);
  background: var(--surface); box-shadow: var(--shadow-sm);
  font-family: var(--mono); font-size: 0.8rem; font-weight: 600; color: var(--accent-ink);
}
.hero__eyebrow::before { content: ""; width: 7px; height: 7px; background: var(--accent); flex: none; }
.hero h1 { margin-top: 1.4rem; font-size: clamp(2.4rem, 6vw, 4.6rem); letter-spacing: -0.04em; line-height: 1.03; }
.hero__lede { margin: 1.1rem auto 0; max-width: 42ch; color: var(--ink-2); font-size: clamp(1.05rem, 1.4vw, 1.22rem); line-height: 1.55; }
.hero__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 1.8rem; }

@media (max-width: 380px) {
  .hero h1 { font-size: 2rem; }
  .hero__lede { font-size: 0.98rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .hero__eyebrow, .hero h1, .hero__lede, .hero__actions { animation: rise-in 700ms var(--ease-out) both; }
  .hero h1 { animation-delay: 90ms; }
  .hero__lede { animation-delay: 170ms; }
  .hero__actions { animation-delay: 250ms; }
}
@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Manual horizontal strip of real project screenshots: the visitor scrolls/drags it, nothing moves on its own. */
.hero__showcase {
  margin-top: clamp(3rem, 7vw, 5rem);
  overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity; touch-action: pan-x;
  scrollbar-width: thin;
  cursor: grab;
  mask-image: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent);
}
.hero__showcase.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.hero__track {
  display: flex; gap: clamp(14px, 2vw, 22px);
  width: max-content; padding: 0 max(var(--gutter), env(safe-area-inset-left, 0px));
}
.hero__card {
  display: block; flex: none; width: clamp(150px, 16vw, 220px);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md);
  background: var(--surface); text-decoration: none;
  scroll-snap-align: start;
  transition: transform 300ms var(--ease-out);
}
.hero__card img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: top; pointer-events: none; }
@media (hover: hover) and (pointer: fine) {
  .hero__card:hover { transform: translateY(-6px); }
}
@media (max-width: 760px) {
  .hero__card { width: clamp(120px, 38vw, 160px); }
}

/* ---------- sections ---------- */
.section { padding-top: clamp(5.5rem, 11vw, 10rem); padding-bottom: clamp(5.5rem, 11vw, 10rem); }
.section h2 { font-size: clamp(2.1rem, 4.8vw, 4rem); letter-spacing: -0.035em; line-height: 1; }
.lede { margin-top: 1.1rem; max-width: 58ch; color: var(--ink-2); font-size: clamp(1.05rem, 1.3vw, 1.2rem); }

/* ---------- about ---------- */
.about__grid {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: clamp(2.5rem, 6vw, 6rem); align-items: start;
}
.about h2 { max-width: 15ch; }
.about__bio { margin-top: clamp(1.6rem, 3vw, 2.4rem); max-width: 64ch; color: var(--ink-2); font-size: clamp(1.05rem, 1.2vw, 1.12rem); }
.about__bio p + p { margin-top: 1.1em; }
.about__bio p:first-child { color: var(--ink); font-size: clamp(1.18rem, 1.6vw, 1.42rem); line-height: 1.5; }
.about__facts { position: relative; padding: clamp(22px, 2.4vw, 32px); background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.about__photo { display: block; width: 136px; height: 136px; border-radius: var(--radius-pill); object-fit: cover; margin-bottom: 1.4rem; box-shadow: var(--shadow-sm); }
.about__facts dl { margin: 0; }
.about__facts dl > div + div { margin-top: 1.05rem; }
.about__facts dt { font-size: 0.85rem; color: var(--ink-3); }
.about__facts dd { margin: 0.15rem 0 0; font-weight: 700; line-height: 1.35; }
.about__profile { margin-top: 0.6rem; width: 100%; }
.about__profile:first-of-type { margin-top: 1.7rem; }
.about__profile .icon:last-child { margin-left: auto; }
.about__subhead { margin-top: clamp(4rem, 8vw, 6.5rem); font-size: clamp(1.6rem, 2.8vw, 2.4rem); letter-spacing: -0.03em; }
.focus {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2.5rem clamp(1.5rem, 3vw, 3rem); margin-top: clamp(1.8rem, 3vw, 2.4rem);
}
.focus h4 {
  margin: 0; padding-bottom: 0.9rem; border-bottom: 1px solid var(--line);
  font-size: clamp(1.2rem, 1.6vw, 1.4rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15;
}
.focus p { margin-top: 1rem; color: var(--ink-2); }
.focus .focus__tech { margin-top: 0.8rem; color: var(--ink); font-weight: 700; line-height: 1.45; }
.about__note { margin-top: clamp(2.4rem, 4vw, 3.2rem); max-width: 66ch; color: var(--ink-2); }
@media (min-width: 961px) {
  .about__facts { position: sticky; top: calc(var(--nav-h) + 40px); }
}
@media (max-width: 960px) {
  .about__grid { grid-template-columns: 1fr; }
  .about__facts { max-width: 34rem; }
  .focus { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .focus { grid-template-columns: 1fr; }
}

/* ---------- index ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2.2rem; }
.filters button {
  display: inline-flex; align-items: center; gap: 0.55em;
  min-height: 40px; padding: 0 16px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: transparent; color: var(--ink);
  font-size: 0.95rem; font-weight: 600; cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms var(--ease-out);
}
.filters button:active { transform: scale(0.97); }
.filters button span { font-family: var(--mono); font-size: 0.76rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.filters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--ground); }
.filters button[aria-pressed="true"] span { color: inherit; }
@media (hover: hover) and (pointer: fine) {
  .filters button:hover { border-color: var(--ink); }
}
@media (pointer: coarse) {
  .filters button { min-height: 44px; }
  .job__links a, .contact__meta a { padding-top: 6px; padding-bottom: 6px; }
}

.typeset {
  list-style: none; margin: 2.8rem 0 0; padding: 0;
  font-size: clamp(1.55rem, 3.4vw, 3rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.18;
  text-wrap: pretty;
}
.typeset > li { display: inline; }
.typeset > li:not(:last-child):not(.typeset__group)::after {
  content: "/" / ""; margin: 0 0.28em; color: var(--ink-4); font-weight: 400;
}
.typeset > li.typeset__group {
  display: block; margin: 1.8rem 0 0.5rem;
  font-family: var(--mono); font-size: 0.78rem; font-weight: 500; letter-spacing: 0; line-height: 1;
  color: var(--ink-3); white-space: nowrap;
}
.typeset > li.typeset__group:first-child { margin-top: 0; }
.typeset > li.is-end:not(:last-child)::after { content: none; }
.t-item { color: var(--ink); text-decoration: none; cursor: pointer; transition: color 200ms ease; }
.typeset > li[data-g="vlm"] .t-item { color: var(--accent-ink); }
.typeset.is-filtered > li:not(.is-on) .t-item,
.typeset.is-filtered > li.typeset__group:not(.is-on) { color: var(--ink-3); }
@media (hover: hover) and (pointer: fine) {
  .t-item:hover { text-decoration: underline; text-decoration-thickness: 0.06em; text-underline-offset: 0.1em; }
}
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .typeset > li { animation: ink-in linear both; animation-timeline: view(); animation-range: entry 0% entry 90%; }
  }
}
@keyframes ink-in { from { opacity: 0.1; } to { opacity: 1; } }

.peek {
  position: fixed; left: 0; top: 0; z-index: var(--z-float);
  width: 240px; height: 300px; overflow: hidden;
  background: #fff; border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  pointer-events: none; opacity: 0;
  transform: translate3d(-999px, -999px, 0);
  transition: opacity 160ms ease;
}
.peek.is-on { opacity: 1; }
.peek img { width: 100%; height: auto; }
.peek.is-scrolling img { animation: peek-scroll var(--peek-dur, 4s) linear 0.5s both; }
@keyframes peek-scroll { to { transform: translateY(var(--peek-shift, 0)); } }
.peek__type, .detail__type {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  display: flex; flex-direction: column; justify-content: space-between;
  background: #1c1317; color: #f2ece9;
}
.peek__type[data-current="true"], .detail__type[data-current="true"] { background: var(--accent); }
.peek__type { padding: 18px; }
.peek__group { font-family: var(--mono); font-size: 0.72rem; opacity: 0.85; }
.peek__name { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; overflow-wrap: anywhere; }

/* ---------- cache simulation ---------- */
.sim__grid {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2.5rem, 5vw, 5rem); align-items: start;
}
.sim__controls { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 2rem; }
.sim__stats { display: flex; flex-wrap: wrap; gap: 1rem 2.4rem; margin: 2.2rem 0 0; }
.sim__stats dt { font-size: 0.85rem; color: var(--ink-3); }
.sim__stats dd {
  margin: 0.15rem 0 0; font-weight: 800; font-size: 1.65rem; letter-spacing: -0.02em; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.sim__headers {
  margin: 2rem 0 0; padding: 16px 18px; min-height: 10.5em;
  background: var(--surface); border-radius: var(--radius-md);
  font-family: var(--mono); font-size: 0.8rem; line-height: 1.7; color: var(--ink-2);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.sim__stage { margin: 0; display: grid; gap: 14px; justify-items: start; min-width: 0; }
.sim__canvas { display: block; touch-action: manipulation; }
.sim__load { display: block; }
.sim__legend {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; margin: 0; padding: 0; list-style: none;
  font-size: 0.85rem; color: var(--ink-2);
}
.sim__legend li { display: inline-flex; align-items: center; gap: 0.5em; }
.sim__legend i { display: inline-block; width: 11px; height: 11px; }
.sim__legend .k-hit { background: var(--ink); opacity: 0.82; }
.sim__legend .k-miss { box-shadow: inset 0 0 0 1px var(--ink-3); }
.sim__legend .k-purge { background: var(--accent); }
.sim__loadlabel { font-size: 0.85rem; color: var(--ink-3); margin-top: 0.4rem; }
.sim__stage figcaption { font-size: 0.9rem; color: var(--ink-3); max-width: 62ch; }
@media (max-width: 960px) {
  .sim__grid { grid-template-columns: 1fr; }
}

/* ---------- career ---------- */
.career__grid {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 5vw, 5rem); margin-top: clamp(2.5rem, 5vw, 4rem);
}
.career__rail { position: sticky; top: calc(var(--nav-h) + 40px); align-self: start; }
.odo {
  display: flex; height: 1em; overflow: hidden;
  font-size: clamp(5rem, 12.5vw, 12rem); font-weight: 800; letter-spacing: -0.06em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.odo__d { display: block; height: 1em; overflow: hidden; }
.odo__strip { display: flex; flex-direction: column; transform: translateY(calc(var(--d, 0) * -1em)); transition: transform 760ms var(--ease-out); }
.odo__strip span { display: block; height: 1em; line-height: 1; }
.odo__d:nth-child(2) .odo__strip { transition-delay: 40ms; }
.odo__d:nth-child(3) .odo__strip { transition-delay: 80ms; }
.odo__d:nth-child(4) .odo__strip { transition-delay: 120ms; }
.career__railname { margin-top: 1rem; font-weight: 700; font-size: 1.25rem; letter-spacing: -0.01em; }

.career__list { list-style: none; margin: 0; padding: 0; }
.job { padding: 2rem 0 2.3rem; border-top: 1px solid var(--line); }
.job__when { font-family: var(--mono); font-size: 0.85rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.job__org { margin-top: 0.55rem; font-size: clamp(1.5rem, 2.4vw, 2.1rem); letter-spacing: -0.03em; transition: color 300ms ease; }
.job.is-active .job__org { color: var(--accent-ink); }
.job__role { margin-top: 0.4rem; font-weight: 600; color: var(--ink-2); }
.job__text { margin-top: 0.9rem; max-width: 62ch; color: var(--ink-2); }
.job__links { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem; font-family: var(--mono); font-size: 0.82rem; }
.job__links a { color: var(--ink-2); text-decoration-color: var(--ink-4); }
@media (hover: hover) and (pointer: fine) {
  .job__links a:hover { color: var(--accent-ink); text-decoration-color: currentColor; }
}
.career__edu { margin-top: clamp(2.5rem, 5vw, 4rem); max-width: 60ch; color: var(--ink-2); }
@media (max-width: 960px) {
  .career__grid { grid-template-columns: 1fr; }
  .career__rail { display: none; }
}

/* ---------- blog ---------- */
.posts { list-style: none; margin: clamp(2rem, 4vw, 3rem) 0 0; padding: 0; }
.post {
  position: relative; isolation: isolate;
  display: grid; grid-template-columns: 8.5rem minmax(0, 1fr) auto 1.2rem;
  gap: 0.4rem 2rem; align-items: baseline;
  padding: 1.4rem 0; border-top: 1px solid var(--line); text-decoration: none;
}
/* Row fill wipes in from the left on hover, like a proof being pulled. */
.post::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: -16px; right: -16px; z-index: -1;
  background: var(--surface); border-radius: var(--radius-md); clip-path: inset(0 100% 0 0);
  transition: clip-path 460ms var(--ease-out);
}
.posts li:last-child .post { border-bottom: 1px solid var(--line); }
.post__date { font-family: var(--mono); font-size: 0.85rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.post__title { font-weight: 750; font-size: clamp(1.2rem, 1.9vw, 1.6rem); letter-spacing: -0.02em; line-height: 1.2; transition: color 160ms ease; }
.post__tags { font-family: var(--mono); font-size: 0.76rem; color: var(--ink-3); text-align: right; }
.post__arrow { width: 1.2em; height: 1.2em; align-self: center; color: var(--accent-ink); opacity: 0; transform: translateX(-8px); transition: transform 300ms var(--ease-out), opacity 200ms ease; }
.post:focus-visible .post__arrow { opacity: 1; transform: none; }
@media (hover: hover) and (pointer: fine) {
  .post:hover .post__title { color: var(--accent-ink); }
  .post:hover::before { clip-path: inset(0 0 0 0); }
  .post:hover .post__arrow { opacity: 1; transform: none; }
}
@media (max-width: 760px) {
  .post { grid-template-columns: 1fr; }
  .post__tags { text-align: left; }
  .post__arrow { display: none; }
}

/* ---------- contact ---------- */
.contact { padding-bottom: clamp(4.5rem, 9vw, 8rem); }
.contact__mail { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.6rem; margin-top: clamp(2rem, 4vw, 3rem); }
.contact__address {
  position: relative;
  font-size: clamp(1.6rem, 7vw, 6.2rem); font-weight: 800; letter-spacing: -0.045em; line-height: 1.08;
  color: var(--ink); text-decoration: none;
}
.contact__address::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -0.02em; height: 0.06em;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform 460ms var(--ease-out);
}
.contact__address:focus-visible::after { transform: scaleX(1); }
@media (hover: hover) and (pointer: fine) {
  .contact__address:hover::after { transform: scaleX(1); }
}
.js-copy.is-done { border-color: var(--accent); color: var(--accent-ink); }
.js-copy .i-check { display: none; }
.js-copy.is-done .i-check { display: block; }
.js-copy.is-done .i-copy { display: none; }
.contact__meta {
  display: flex; flex-wrap: wrap; gap: 0.8rem 2.2rem;
  list-style: none; margin: 2.6rem 0 0; padding: 0; font-size: 1.05rem;
}
.contact__meta a { display: inline-flex; align-items: center; gap: 0.5em; font-weight: 600; text-decoration: none; }
.contact__meta .icon { color: var(--ink-3); }
@media (hover: hover) and (pointer: fine) {
  .contact__meta a:hover { color: var(--accent-ink); }
}
.contact__meta .muted { color: var(--ink-3); }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); padding-top: 2rem; padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px)); font-size: 0.9rem; color: var(--ink-3); }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; }
.foot a { color: var(--ink-2); }
@media (hover: hover) and (pointer: fine) { .foot a:hover { color: var(--accent-ink); } }

/* ---------- project detail ---------- */
.detail {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: var(--z-dialog);
  display: grid; place-items: center; padding: clamp(0px, 3vw, 40px);
}
.detail[hidden] { display: none; }
.detail__backdrop { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: var(--ground); opacity: 0; transition: opacity 220ms ease; }
.detail.is-open .detail__backdrop { opacity: 0.92; }
.detail__panel {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  width: min(1240px, 100%); height: min(860px, 100%);
  border-radius: var(--radius-lg); overflow: hidden;
}
.detail__panel::before {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  background: var(--surface); box-shadow: var(--shadow-lg);
  opacity: 0; transition: opacity 260ms ease;
}
.detail.is-open .detail__panel::before { opacity: 1; }
.detail__frame {
  position: relative; z-index: 1; overflow: hidden; background: #fff;
  transform-origin: 0 0; opacity: 0; transition: opacity 180ms ease;
}
.detail.is-open .detail__frame { opacity: 1; }
.detail__panel:focus { outline: none; }
.detail__scroll { position: absolute; top: 0; right: 0; bottom: 0; left: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.detail__scroll img { width: 100%; height: auto; }
.detail__scroll.is-short {
  display: grid; align-content: center;
  padding: clamp(16px, 3vw, 40px);
  background: var(--surface-2);
}
.detail__scroll.is-short img { border-radius: var(--radius-md); box-shadow: var(--shadow-md); }
.detail__type { padding: clamp(24px, 4vw, 48px); }
.detail__type-group { font-family: var(--mono); font-size: 0.85rem; opacity: 0.85; }
.detail__type-name { font-size: clamp(2.4rem, 5.6vw, 5rem); font-weight: 800; letter-spacing: -0.04em; line-height: 0.95; overflow-wrap: anywhere; }
.detail__info {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; min-height: 0; overflow: auto;
  padding: clamp(24px, 3.5vw, 48px); padding-top: clamp(56px, 6vw, 76px);
  opacity: 0; transform: translateY(10px);
  transition: opacity 260ms ease, transform 420ms var(--ease-out);
}
.detail.is-open .detail__info { opacity: 1; transform: none; transition-delay: 90ms; }
.detail__info h2 { font-size: clamp(2rem, 3.6vw, 3.25rem); letter-spacing: -0.035em; overflow-wrap: anywhere; }
.detail__host { margin-top: 0.9rem; align-self: flex-start; font-family: var(--mono); font-size: 0.9rem; color: var(--accent-ink); }
.detail__meta { margin-top: 1.6rem; font-weight: 700; }
.detail__info h2.is-long { font-size: clamp(1.7rem, 2.7vw, 2.6rem); }
.detail__host:not([href]) { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1px; }
.detail__note { margin-top: 0.35rem; color: var(--ink-3); font-size: 0.95rem; }
.detail__text { margin-top: 0.5rem; max-width: 46ch; color: var(--ink-2); }
.detail__actions { margin-top: 2rem; }
.detail__nav { margin-top: auto; padding-top: 2rem; display: flex; align-items: center; gap: 10px; }
.detail__counter { margin-left: auto; margin-right: auto; font-family: var(--mono); font-size: 0.85rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.detail__close { position: absolute; top: 14px; right: 14px; z-index: 2; background: var(--surface); }
@media (max-width: 860px) {
  .detail { padding: 0; }
  .detail__panel { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; height: 100%; border-radius: 0; }
  .detail__info { padding: 18px var(--gutter) calc(16px + env(safe-area-inset-bottom)); overflow: visible; }
  .detail__info h2 { font-size: 1.9rem; }
  .detail__meta { margin-top: 0.9rem; }
  .detail__text { display: none; }
  .detail__actions { margin-top: 1rem; }
  .detail__nav { padding-top: 1rem; }
  .detail__close { top: 10px; right: 10px; }
}

/* Phones in landscape: side by side, or the screenshot shrinks to a strip. */
@media (max-height: 520px) and (orientation: landscape) {
  .detail__panel { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); grid-template-rows: none; }
  .detail__info { padding: 16px max(20px, env(safe-area-inset-right, 0px)) 14px 22px; overflow: auto; }
  .detail__info h2 { font-size: 1.55rem; padding-right: 48px; }
  .detail__host { margin-top: 0.5rem; }
  .detail__meta { margin-top: 0.7rem; }
  .detail__text { display: none; }
  .detail__actions { margin-top: 0.8rem; }
  .detail__nav { padding-top: 0.8rem; }
}

/* ---------- blog article pages ---------- */
.article { padding-top: calc(var(--nav-h) + clamp(3rem, 7vw, 6rem)); padding-bottom: clamp(4rem, 8vw, 7rem); }
.article__back { display: inline-flex; align-items: center; gap: 0.45em; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.article__back .icon { width: 1em; height: 1em; }
@media (hover: hover) and (pointer: fine) { .article__back:hover { color: var(--accent-ink); } }
.article h1 { max-width: 22ch; margin-top: 1.4rem; font-size: clamp(2.2rem, 5vw, 4rem); letter-spacing: -0.035em; line-height: 1.02; }
.article__meta { margin-top: 1.2rem; font-family: var(--mono); font-size: 0.85rem; color: var(--ink-3); }
.prose { max-width: 70ch; margin-top: clamp(2rem, 4vw, 3rem); }
.prose p { margin: 0 0 1.1em; }
.prose h2, .prose h3 { margin: 2em 0 0.6em; font-size: 1.5rem; letter-spacing: -0.02em; line-height: 1.15; }
.prose a { color: var(--accent-ink); }
.prose strong { font-weight: 700; }
.prose code { font-family: var(--mono); font-size: 0.86em; background: var(--surface-2); border-radius: var(--radius-sm); padding: 0.1em 0.35em; overflow-wrap: anywhere; }
.prose pre {
  margin: 1.4em 0; padding: 18px 20px; overflow: auto;
  background: var(--surface); border-radius: var(--radius-md); font-family: var(--mono); font-size: 0.82rem; line-height: 1.6; white-space: pre;
}
.prose pre code { background: none; padding: 0; }
.prose img { margin: 1.2em 0; }
.prose ul, .prose ol { margin: 0 0 1.1em; padding-left: 1.3em; }
.article__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2.6rem; padding: 0; list-style: none; }
.article__tags li { padding: 4px 10px; border: 1px solid var(--line); border-radius: var(--radius-pill); font-family: var(--mono); font-size: 0.78rem; color: var(--ink-2); }
.article__more { margin-top: clamp(3rem, 6vw, 5rem); }
.article__more h2 { font-size: 1.5rem; letter-spacing: -0.02em; }

/* ---------- open source ---------- */
.oss__grid {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2.5rem, 5vw, 5rem); align-items: start;
}
.oss__repos { margin-top: 2rem; border-top: 1px solid var(--line); }
.oss__repo {
  display: grid; gap: 0.35rem; width: 100%; padding: 1.1rem 1.1rem 1.2rem;
  border: 0; border-bottom: 1px solid var(--line); border-radius: var(--radius-md); background: transparent;
  text-align: left; cursor: pointer;
  transition: background-color 200ms ease;
}
.oss__repo[aria-selected="true"] { background: var(--surface); }
.oss__name { font-family: var(--mono); font-weight: 700; font-size: 1.2rem; letter-spacing: -0.01em; color: var(--ink); transition: color 200ms ease; }
.oss__repo[aria-selected="true"] .oss__name { color: var(--accent-ink); }
.oss__desc { color: var(--ink-2); font-size: 1rem; line-height: 1.5; }
.oss__meta { font-family: var(--mono); font-size: 0.76rem; color: var(--ink-3); }
@media (hover: hover) and (pointer: fine) { .oss__repo:hover { background: var(--surface); } }
.oss__profile { margin-top: 1.8rem; }
.oss__console { position: sticky; top: calc(var(--nav-h) + 40px); margin: 0; min-width: 0; background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); }
.oss__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 12px 18px; border-bottom: 1px solid var(--line);
  font-size: 0.85rem; color: var(--ink-3);
}
.oss__link { display: inline-flex; align-items: center; gap: 0.35em; font-family: var(--mono); font-size: 0.82rem; color: var(--accent-ink); text-decoration: none; white-space: nowrap; }
@media (hover: hover) and (pointer: fine) { .oss__link:hover { text-decoration: underline; } }
.oss__out {
  margin: 0; padding: 18px 20px 22px; min-height: 27rem; overflow: auto;
  font-family: var(--mono); font-size: 0.8rem; line-height: 1.6; color: var(--ink); white-space: pre;
}
.oss__out .caret { display: inline-block; width: 0.6em; height: 1.15em; margin-left: 1px; background: var(--accent); vertical-align: -0.22em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (max-width: 960px) {
  .oss__grid { grid-template-columns: 1fr; }
  .oss__console { position: relative; top: auto; }
  .oss__out { min-height: 0; }
}

/* ---------- motion layer ---------- */
/* Reading progress under the nav, driven by the document scroll (no JS, no scroll listener). */
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .nav::after {
      content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
      background: var(--accent); transform-origin: 0 50%; transform: scaleX(0);
      animation: grow-x linear both; animation-timeline: scroll(root block);
    }
  }
}
@keyframes grow-x { to { transform: scaleX(1); } }

/* Active section: one indicator slides between nav links. */
.nav nav { position: relative; }
.nav__indicator {
  position: absolute; left: 0; bottom: 2px; width: 100px; height: 1.5px;
  background: var(--accent); transform-origin: 0 50%;
  transform: translateX(0) scaleX(0); opacity: 0; pointer-events: none;
  transition: transform 460ms var(--ease-out), opacity 200ms ease;
}
.nav__indicator.is-on { opacity: 1; }
.nav__links a[aria-current] { color: var(--ink); }
.nav__links a[aria-current]::after { display: none; }
@media (max-width: 960px) { .nav__indicator { display: none; } }

/* Headline words rise from behind a mask when the section arrives. */
.is-split .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.14em; margin-bottom: -0.14em; }
.is-split .w > span { display: inline-block; transform: translateY(112%); transition: transform 900ms var(--ease-out); transition-delay: calc(var(--i, 0) * 55ms); }
.is-split.is-in .w > span { transform: none; }

/* Mechanical counters, like the impression counter on a press. */
.roll { display: inline-flex; vertical-align: top; height: 1em; overflow: hidden; font-variant-numeric: tabular-nums; }
.roll__d { display: block; height: 1em; overflow: hidden; }
.roll__strip { display: flex; flex-direction: column; transform: translateY(calc(var(--d, 0) * -1em)); transition: transform 1150ms var(--ease-out); }
.roll__strip span { display: block; height: 1em; line-height: 1; }

/* Career: a rule that fills as you read, square markers that light up. */
.career__list { position: relative; padding-left: 30px; }
.career__list::before { content: ""; position: absolute; left: 5px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.job { position: relative; }
.job::before {
  content: ""; position: absolute; left: -30px; top: 2.3rem; width: 12px; height: 12px;
  background: var(--ground); box-shadow: inset 0 0 0 2px var(--ink-4);
  transition: background-color 300ms ease, box-shadow 300ms ease;
}
.job.is-active::before { background: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .career__list::after {
      content: ""; position: absolute; left: 5px; top: 0; bottom: 0; width: 2px;
      background: var(--accent); transform-origin: 50% 0; transform: scaleY(0);
      animation: grow-y linear both; animation-timeline: view(); animation-range: cover 18% cover 82%;
    }
  }
}
@keyframes grow-y { to { transform: scaleY(1); } }

/* Mobile menu slides in (enter animation without JS). */
@media (max-width: 960px) {
  .nav.is-open .nav__links { opacity: 1; transform: none; transition: opacity 200ms ease, transform 320ms var(--ease-out); }
}
@starting-style {
  .nav.is-open .nav__links { opacity: 0; transform: translateY(-10px); }
}

/* View transitions: theme switch reveals from the toggle (JS animates the clip), pages crossfade. */
html:active-view-transition-type(theme)::view-transition-old(root),
html:active-view-transition-type(theme)::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
html:active-view-transition-type(theme) .nav { view-transition-name: none; }
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .nav { view-transition-name: site-nav; }
}

/* ---------- print ---------- */
@media print {
  :root { --ground: #fff; --surface: #fff; --ink: #000; --ink-2: #222; --ink-3: #444; --shadow-sm: none; --shadow-md: none; --shadow-lg: none; }
  .nav, .skip, .hero__showcase, .peek, .detail, .filters,
  .sim__stage, .sim__controls, .js-copy, .career__rail { display: none !important; }
  .hero { padding-top: 1rem; }
  .hero__eyebrow { box-shadow: none; }
  .section { padding-top: 2rem; padding-bottom: 2rem; }
  .career__grid, .sim__grid, .about__grid { display: block; }
  .about__facts { position: static; box-shadow: none; padding: 1rem 0; }
  .typeset { font-size: 14pt; }
  .is-split .w > span { transform: none !important; }
  .oss__console { display: none !important; }
  a { text-decoration: none; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
}
