/* Black and white, dark for everyone (2026-10-31). One family: --mono is kept as a name only, so old rules fall back to the sans. */
:root {
  --bg:      #000000;
  --text:    #ededed;
  --muted:   #cfcfcf;
  --faint:   #a1a1a1;
  --chip:    rgba(210,210,208,.12);
  --chip-h:  rgba(210,210,208,.22);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: var(--sans);
  --accent: #ffffff;     /* no hue: primary action, key numbers and case links stand out by white + weight */
  --on-accent: #000000;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap { max-width: 720px; margin: 0 auto; padding: 72px 28px 120px; }
@media (max-width: 640px) { .wrap { padding: 52px 22px 76px; } }

a { color: inherit; text-decoration: underline; text-underline-offset: 3px;
    text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
a:hover { text-decoration-color: currentColor; }

h1 {
  font-size: clamp(34px, 6.4vw, 44px);
  line-height: 1.04;
  letter-spacing: -0.042em;
  font-weight: 700;
  margin: 0 0 22px;
}
em { font-style: italic; }

p { margin: 0 0 16px; }

h2 {
  font-size: 26px; font-weight: 700; line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0 0 24px;
}
section { margin-top: 58px; }

/* home: each section opens with a real heading and air, no rule */
.home > section { margin-top: 88px; }
@media (max-width: 640px) { .home > section { margin-top: 64px; } }

/* home: header = name, role, the two CVs (equal weight), Telegram one step lower, then the about text */
.role { font-size: 17px; color: var(--faint); margin: 0 0 28px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 40px; }
.actions a, .dock a { display: inline-flex; align-items: center; gap: .5em; min-height: 44px; padding: 0 18px; border-radius: 6px;
             background: var(--chip); font-weight: 600; text-decoration: none; transition: background .15s; }
.actions a:hover, .dock a:hover { background: var(--chip-h); }
.actions a.primary, .dock a.primary { background: var(--accent); color: var(--on-accent); }
.actions a.primary:hover, .dock a.primary:hover { background: #d9d9d9; }
.actions small, .dock small { font-size: 14px; font-weight: 400; opacity: .72; }
.actions a.plain { background: none; padding: 0 8px; font-weight: 400; color: var(--muted); }
.actions a.plain:hover { color: var(--text); background: none; text-decoration: underline; }
.actions svg, .dock svg { width: 1.1em; height: 1.1em; fill: currentColor; flex: none; }
@media (max-width: 640px) { .actions a.plain { padding: 0 4px; } .dock a { padding: 0 14px; } }

/* inline links carrying a small icon */
.ml {
  display: inline-flex; align-items: center; gap: .34em;
  background: var(--chip); border-radius: 5px;
  padding: .1em .38em .1em .28em;
  text-decoration: none;
  transform: translateY(2px);
  transition: background .15s;
}
.ml:hover { background: var(--chip-h); text-decoration: none; }
.ml img, .ml svg { width: 1.05em; height: 1.05em; border-radius: 2px; display: block; }
.ml svg { fill: currentColor; }

/* entries — no cards, no borders */
.entry { margin-bottom: 32px; }
.entry:last-child { margin-bottom: 0; }
.entry .top {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 1px;
}
.entry h3 { font-size: 17px; font-weight: 600; margin: 0; letter-spacing: -0.022em; line-height: 1.35; }
.entry .where { font-size: 14px; color: var(--faint); margin: 0 0 9px; }
.entry .when { font-family: var(--mono); font-size: 14px; color: var(--faint); white-space: nowrap; }
.entry ul { margin: 0 0 9px; padding-left: 18px; }
.entry li { margin-bottom: 6px; }
.entry li::marker { color: var(--faint); }
.entry p { margin: 0 0 9px; }
.entry .stack { font-family: var(--mono); font-size: 14px; color: var(--faint); margin: 0; }

.contacts { display: flex; flex-wrap: wrap; gap: 7px 18px; margin: 0; }
.contacts a {
  display: inline-flex; align-items: center; gap: .5em;
  font-family: var(--mono); font-size: 14px;
  overflow-wrap: anywhere;
}
.contacts svg { width: 1.15em; height: 1.15em; flex: none; fill: currentColor; }
.contacts svg.stroked { fill: none; stroke: currentColor; stroke-width: 1.8;
                        stroke-linecap: round; stroke-linejoin: round; }

/* ---------- browser surfaces ---------- */
::selection { background: var(--text); color: var(--bg); }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; border-radius: 3px; }
.num, table.data td, table.data th { font-variant-numeric: tabular-nums; }

/* filmstrip: same Lighthouse test, frames on a shared clock */
.film { margin: 16px 0 14px; }
.film .row { display: grid; grid-template-columns: 64px repeat(5, 1fr); gap: 8px; align-items: end; margin-bottom: 12px; }
.film .label { font-family: var(--mono); font-size: 14px; color: var(--faint); line-height: 1.3; align-self: center; }
.film .label b { display: block; color: var(--text); font-weight: 600; }
.film figure { margin: 0; }
.film img { display: block; width: 100%; aspect-ratio: 1 / 2; object-fit: contain; object-position: top;
            background: #fff; border-radius: 6px; outline: 1px solid var(--chip-h); }
.film figcaption { font-family: var(--mono); font-size: 14px; color: var(--faint); margin-top: 4px; text-align: center; }
.film .note { font-size: 14px; color: var(--faint); margin: 2px 0 0; max-width: 70ch; }
@media (max-width: 640px) {
  .film .row { grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .film .label { grid-column: 1 / -1; }
}

/* data tables */
table.data { width: 100%; border-collapse: collapse; font-size: 14px; margin: 6px 0 14px; }
table.data th { text-align: left; font-size: 14px; font-weight: 600;
                letter-spacing: 0; color: var(--faint);
                padding: 0 10px 8px 0; border-bottom: 1px solid var(--chip-h); }
table.data td { padding: 9px 10px 9px 0; border-bottom: 1px solid var(--chip); vertical-align: baseline; }
table.data td.r, table.data th.r { text-align: right; padding-right: 0; }
table.data .down { font-weight: 650; }
table.data .worse { font-weight: 650; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }

/* ---------- case page ---------- */
.back { font-size: 14px; text-decoration: none; display: inline-block; margin-bottom: 40px; }
.back:hover { text-decoration: underline; }
.case h1 { font-size: clamp(30px, 5.4vw, 40px); margin-bottom: 12px; text-wrap: balance; }
.case .where { font-family: var(--mono); font-size: 14px; color: var(--faint); margin: 0 0 30px; }
.case .lead { font-size: 18px; line-height: 1.55; letter-spacing: -0.016em; }
.case h2 { margin-top: 0; }
.case section { margin-top: 54px; }
.case ol.timeline { list-style: none; padding: 0; margin: 0 0 16px; }
.case ol.timeline li { display: grid; grid-template-columns: 118px 1fr; gap: 14px; padding: 7px 0;
                       border-bottom: 1px solid var(--chip); }
.case ol.timeline time { font-family: var(--mono); font-size: 14px; color: var(--faint); padding-top: 2px; }
@media (max-width: 640px) { .case ol.timeline li { grid-template-columns: 1fr; gap: 0; } }
.case ul { padding-left: 18px; margin: 0 0 16px; }
.case li { margin-bottom: 7px; }
.case li::marker { color: var(--faint); }
.case .stack { font-family: var(--mono); font-size: 14px; color: var(--faint); }
.case footer { margin-top: 72px; padding-top: 22px; border-top: 1px solid var(--chip-h); }

.entry .case-link { font-size: 14px; margin: 0 0 9px; }

/* case page table of contents: lives in the left margin on wide screens only */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
section[id] { scroll-margin-top: 32px; }
.toc { display: none; }
@media (min-width: 1120px) {
  .toc {
    display: block; position: fixed; top: 168px;
    left: max(24px, calc(50% - 360px - 214px)); width: 176px;
    font-family: var(--mono); font-size: 14px; line-height: 1.45;
  }
  .toc ol { list-style: none; margin: 0 0 22px; padding: 0; }
  .toc li { margin-bottom: 11px; }
  .toc a { color: var(--faint); text-decoration: none; }
  .toc a:hover { color: var(--text); text-decoration: underline; }
  .toc .toc-cv { display: block; margin-bottom: 8px; color: var(--text); text-decoration: underline; }
}

/* ---------- KEYGO case: overview board, three-phone rows, one wipe, compare viewer ---------- */
.bleed { width: min(1180px, calc(100vw - 48px)); margin-left: calc(50% - min(590px, 50vw - 24px)); }
.kg h2 { font-family: var(--sans); font-size: clamp(25px, 3.6vw, 30px); font-weight: 700; letter-spacing: -0.035em;
         line-height: 1.15; text-transform: none; color: var(--text); margin: 0 0 18px; text-wrap: balance; }
.kg article > section { margin-top: 104px; }
.kg section > h3 { font-size: 18px; font-weight: 650; letter-spacing: -0.022em; margin: 40px 0 10px; }
.kg section > h2 + h3 { margin-top: 26px; }
:root { --shot-line: rgba(255,255,255,.10); }

/* version line under the lead */
.vline { list-style: none; padding: 0; margin-top: 44px; margin-bottom: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 32px; }
.vline li { position: relative; padding-top: 26px; }
.vline li::before { content: ""; position: absolute; top: 0; left: 0; width: 11px; height: 11px; border-radius: 50%;
                    background: var(--bg); border: 2px solid var(--text); }
.vline li::after { content: ""; position: absolute; top: 6px; left: 17px; right: -26px; height: 1px; background: var(--chip-h); }
.vline li:last-child::after { display: none; }
.vline a { display: block; text-decoration: none; }
.vline b { display: block; font-size: 18px; letter-spacing: -0.025em; }
.vline .d { display: block; font-family: var(--mono); font-size: 14px; color: var(--faint); margin: 2px 0 6px; }
.vline span:not(.d) { display: block; font-size: 14px; line-height: 1.45; color: var(--muted); max-width: 34ch; }
.vline a:hover b { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 760px) {
  .vline { grid-template-columns: 1fr; gap: 22px; margin-left: 0; width: auto; }
  .vline li { padding: 0 0 0 26px; }
  .vline li::before { top: 5px; }
  .vline li::after { top: 22px; bottom: -18px; left: 5px; right: auto; width: 1px; height: auto; }
}

/* screenshots */
a.shot { display: block; cursor: zoom-in; border-radius: 8px; }
a.shot img { display: block; width: 100%; height: auto; background: #fff; outline: 1px solid var(--shot-line); outline-offset: -1px;
             box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 6px 18px rgba(0,0,0,.10);
             transition: transform .45s cubic-bezier(.22,1,.36,1), box-shadow .45s cubic-bezier(.22,1,.36,1); }
a.shot:hover img { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(0,0,0,.08), 0 16px 34px rgba(0,0,0,.18); }
a.shot img.m { border-radius: 8px; }
a.shot img.d { border-radius: 6px; }
a.shot:focus-visible { outline-offset: 4px; }

/* overview board: versions are rows, steps of one booking are columns; on phones it transposes */
.board-note { max-width: 70ch; }
.board-h { font-size: 18px; font-weight: 650; letter-spacing: -0.022em; margin: 52px 0 4px; }
.board { display: grid; grid-template-columns: 64px repeat(var(--steps), minmax(0, 1fr)); gap: 16px 12px; margin-top: 22px; align-items: start; }
.board > * { grid-row: var(--r); grid-column: var(--c); }
.board .ch { font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--faint); align-self: end; text-wrap: balance; }
.board .rl { align-self: center; }
.board .rl b { display: block; font-size: 22px; letter-spacing: -0.035em; line-height: 1; }
.board .rl span { display: block; font-size: 14px; color: var(--faint); margin-top: 4px; }
.board .none { aspect-ratio: 600 / 1299; border-radius: 8px; display: grid; place-items: center; text-align: center; padding: 10px;
               font-size: 14px; line-height: 1.35; color: var(--faint);
               background: repeating-linear-gradient(135deg, transparent 0 7px, var(--chip) 7px 8px); outline: 1px solid var(--chip-h); outline-offset: -1px; }
.board.desktop { grid-template-columns: 64px repeat(var(--steps), minmax(0, 1fr)); gap: 18px 16px; }
.note-small { font-size: 14px; color: var(--faint); margin: 10px 0 0; max-width: 70ch; }
#screens > .note-small { margin-top: 26px; }
.cmpv header, .cmpv footer { min-width: 0; }
@media (max-width: 760px) {
  .board { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 10px; margin-top: 14px; }
  .board.desktop { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 10px; }
  .board > * { grid-row: calc(var(--c) * 2); grid-column: calc(var(--r) - 1); }
  .board .rl { display: none; }
  .board .ch { grid-row: calc(var(--c) * 2 - 1); grid-column: 1 / -1; font-size: 16px; font-weight: 600; color: var(--text); margin-top: 18px; }
  .board .cell::after, .board .none::after { display: block; font-family: var(--mono); font-size: 14px; color: var(--faint); margin-top: 5px; }
  .board > [style*="--r:2"]::after { content: "v0"; } .board > [style*="--r:3"]::after { content: "v1"; } .board > [style*="--r:4"]::after { content: "v2"; }
  .board .none { aspect-ratio: auto; height: 100%; min-height: 120px; }
}

/* three phones in a row: one screen across versions */
.trio { margin-top: 30px; margin-bottom: 18px; }
.trio-t { font-size: 16px; font-weight: 600; letter-spacing: -0.015em; margin: 0 0 14px; }
.trio-row { display: grid; grid-template-columns: repeat(3, minmax(0, 330px)); justify-content: space-between; gap: 32px; }
.trio figure { margin: 0; }
.trio a.shot img.m { border-radius: 12px; box-shadow: 0 2px 6px rgba(0,0,0,.10), 0 18px 44px rgba(0,0,0,.16); }
.trio figcaption { margin-top: 14px; font-size: 14px; line-height: 1.45; color: var(--muted); }
.trio figcaption b { display: block; font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
@media (max-width: 760px) {
  .trio-row { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
              margin: 0 calc(50% - 50vw); padding: 2px 24px 8px; scroll-padding-inline: 24px; scrollbar-width: none; }
  .trio-row::-webkit-scrollbar { display: none; }
  .trio-row figure { flex: 0 0 min(66vw, 300px); scroll-snap-align: start; }
}

/* before/after wipe */
.wipe-wrap { margin-top: 30px; margin-bottom: 26px; }
.wipe { position: relative; border-radius: 8px; overflow: hidden; background: #fff; outline: 1px solid var(--shot-line); outline-offset: -1px;
        box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 14px 36px rgba(0,0,0,.14); }
.wipe img { display: block; width: 100%; height: auto; }
.wipe .top { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--x)) 0 0); }
.wipe .bar { position: absolute; top: 0; bottom: 0; left: var(--x); width: 2px; margin-left: -1px; background: #fff;
             box-shadow: 0 0 0 1px rgba(0,0,0,.18); pointer-events: none; }
.wipe .bar svg { position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; padding: 11px; margin: -22px 0 0 -22px;
                 border-radius: 50%; background: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.25);
                 fill: none; stroke: #111; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wipe input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.wipe:has(input:focus-visible) { outline: 2px solid var(--text); outline-offset: 4px; }
.wipe .tag { position: absolute; bottom: 14px; font-family: var(--mono); font-size: 14px; color: #fff;
             background: rgba(0,0,0,.62); padding: 4px 9px; border-radius: 6px; pointer-events: none; }
.wipe .tag.l { left: 14px; } .wipe .tag.r { right: 14px; }

/* compare viewer */
html:has(dialog.cmpv[open]) { overflow: hidden; }
dialog.cmpv { overflow: hidden; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
              background: #111; color: #ededeb; display: none; }
dialog.cmpv[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
dialog.cmpv::backdrop { background: transparent; }
.cmpv header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 10px; }
.cmpv-t { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -0.02em; }
.cmpv button { font: inherit; color: inherit; cursor: pointer; }
.cmpv-close, .cmpv-prev, .cmpv-next { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
                                      background: rgba(255,255,255,.09); transition: background .3s cubic-bezier(.22,1,.36,1), opacity .3s; flex: none; }
.cmpv-close:hover, .cmpv-prev:hover:not(:disabled), .cmpv-next:hover:not(:disabled) { background: rgba(255,255,255,.18); }
.cmpv-prev:disabled, .cmpv-next:disabled { opacity: .25; cursor: default; }
.cmpv svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cmpv :focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.cmpv-stage { min-height: 0; min-width: 0; display: flex; justify-content: center; align-items: center; gap: clamp(16px, 3vw, 44px); padding: 6px 22px; }
.cmpv-stage[data-kind=mobile] figure { margin: 0; height: 100%; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.cmpv-stage[data-kind=mobile] figcaption { font-family: var(--mono); font-size: 14px; color: #bdbdbb; margin-bottom: 10px; }
.cmpv-stage[data-kind=mobile] img, .cmpv-stage .none { height: calc(100% - 28px); width: auto; max-width: 30vw; aspect-ratio: 600 / 1299;
                                                         border-radius: 10px; object-fit: contain; background: #fff; }
.cmpv-stage .none { display: grid; place-items: center; padding: 20px; text-align: center; font-size: 14px; color: #a9a9a7;
                    background: repeating-linear-gradient(135deg, transparent 0 9px, rgba(255,255,255,.06) 9px 10px); outline: 1px solid rgba(255,255,255,.14); outline-offset: -1px; }
.cmpv-stage[data-kind=desktop] { flex-direction: column; gap: 14px; }
.cmpv-stage[data-kind=desktop] img { min-height: 0; max-width: min(100%, 1500px); max-height: calc(100% - 52px); object-fit: contain; border-radius: 6px; }
.cmpv-seg { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(255,255,255,.08); flex: none; }
.cmpv-seg button { border: 0; background: none; padding: 7px 16px; border-radius: 999px; font-family: var(--mono); font-size: 14px; color: #bdbdbb;
                   transition: background .3s cubic-bezier(.22,1,.36,1), color .3s; }
.cmpv-seg button[aria-pressed=true] { background: #ededeb; color: #111; }
.cmpv footer { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 12px 22px 20px; }
.cmpv-steps { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; max-width: 980px; }
.cmpv-steps button { border: 0; background: none; padding: 6px 11px; border-radius: 999px; font-size: 14px; color: #a9a9a7;
                     transition: background .3s cubic-bezier(.22,1,.36,1), color .3s; }
.cmpv-steps button:hover { color: #ededeb; background: rgba(255,255,255,.07); }
.cmpv-steps button[aria-current=true] { color: #111; background: #ededeb; }
@media (max-width: 760px) {
  .cmpv-stage[data-kind=mobile] { justify-content: flex-start; overflow-x: auto; scroll-snap-type: x mandatory; gap: 14px; padding: 6px 16px; }
  .cmpv-stage[data-kind=mobile] figure { flex: 0 0 74vw; scroll-snap-align: center; }
  .cmpv-stage[data-kind=mobile] img, .cmpv-stage .none { max-width: 100%; height: auto; max-height: calc(100% - 28px); width: 100%; }
  .cmpv-steps { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; }
  .cmpv-steps button { flex: none; }
  .cmpv footer { gap: 8px; padding: 8px 10px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  a.shot img, .cmpv button { transition: none; }
  a.shot:hover img { transform: none; }
}

/* language switch */
.topbar { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 40px; }
.topbar .back { margin-bottom: 0; }
.topbar.end { justify-content: flex-end; margin-bottom: 28px; }
.lang { display: inline-flex; gap: 2px; font-family: var(--mono); font-size: 14px; }
.lang a { padding: 3px 7px; border-radius: 5px; text-decoration: none; color: var(--faint); }
.lang a:hover { color: var(--text); background: var(--chip); }
.lang a[aria-current] { color: var(--text); background: var(--chip); }

/* small and monospaced text reads better without the body's negative tracking */
code, .entry .when, .entry .stack, .contacts a, .film .label, .film figcaption, .case .where, .case ol.timeline time,
.case .stack, .cases span, .toc, .vline .d, .trio figcaption b, .wipe .tag, .cmpv-stage figcaption, .cmpv-seg button,
.lang, .board .cell::after, .board .none::after { letter-spacing: 0; }

/* headline numbers under the version line */
.case ul.nums { list-style: none; padding: 0; margin: 30px 0 0 calc(50% - min(590px, 50vw - 24px)); display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 32px; }
.nums li { border-top: 1px solid var(--chip-h); padding-top: 12px; }
.nums b { display: block; font-size: 22px; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }
.nums span { display: block; font-size: 14px; line-height: 1.45; color: var(--muted); margin-top: 2px; max-width: 30ch; }
@media (max-width: 760px) { .nums { grid-template-columns: 1fr; gap: 16px; } }

/* two phones side by side (admin before/after) */
.trio.pair .trio-row { grid-template-columns: repeat(2, minmax(0, 330px)); justify-content: start; gap: 48px; }

/* home: three-phone cover above the KEYGO case link */
.cases .cover { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 4px 0 16px; text-decoration: none; }
.cases .cover figure { margin: 0; }
.cases .cover img, .cases .cover video { display: block; width: 100%; height: auto;
  border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 10px 26px rgba(0,0,0,.10); transition: transform .2s ease; }
.cases .cover:hover img, .cases .cover:hover video { transform: translateY(-3px); }
.cases .cover figcaption { font-family: var(--mono); font-size: 14px; font-weight: 400; color: var(--faint); margin-top: 8px; }
@media (max-width: 640px) { .cases .cover { gap: 10px; } .cases .cover img, .cases .cover video { border-radius: 6px; } .cases .cover figcaption { font-size: 14px; } }
@media (prefers-reduced-motion: reduce) { .cases .cover img, .cases .cover video { transition: none; } }

/* home: quiet link to the 90s parody (/hire-me) */
.nineties { margin: 22px 0 0; font-family: var(--mono); font-size: 14px; }
.nineties a { color: var(--faint); }

/* home: more air between jobs and projects than inside them */
.home .entry { margin-bottom: 56px; }
.home .entry:last-child { margin-bottom: 0; }

/* highlighted numbers in the prose */
.home b { font-weight: 600; color: var(--accent); }

/* contacts: a copy button next to email and Telegram */
.ct { display: inline-flex; align-items: center; gap: 2px; }
.copy { display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px;
        background: none; color: var(--faint); cursor: pointer; transition: background .15s, color .15s; }
.copy:hover { background: var(--chip); color: var(--text); }
.copy svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.copy .ok { display: none; }
.copy.done { color: var(--accent); }
.copy.done svg { display: none; } .copy.done .ok { display: block; }

/* case cards: the whole card is the link */
.cases { display: grid; gap: 20px; }
.card { position: relative; padding: 28px; border-radius: 10px; background: rgba(255,255,255,.05); transition: background .2s ease-out; }
.card:hover { background: rgba(255,255,255,.075); }
.card:has(.stretch:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.card h3 { font-size: 17px; font-weight: 600; line-height: 1.35; letter-spacing: -0.015em; margin: 0; text-wrap: balance; }
.card h3 a { text-decoration: none; }
.card h3 a:focus-visible { outline: none; }
.stretch::after { content: ""; position: absolute; inset: 0; z-index: 5; border-radius: inherit; }
.card .sub { font-size: 14px; color: var(--faint); margin: 6px 0 22px; }
.cases .cover { margin: 0 0 24px; }
.card:hover .cover img, .card:hover .cover video { transform: translateY(-3px); }
.knums { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-wrap: wrap; gap: 12px 40px; }
.knums b { display: block; font-size: 26px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; color: var(--accent); font-variant-numeric: tabular-nums; }
.knums span { display: block; font-size: 14px; color: var(--faint); margin-top: 2px; }
.card .btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 6px;
             font-weight: 600; color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); transition: background .15s, color .15s; }
.card:hover .btn { background: var(--accent); color: var(--on-accent); }
@media (max-width: 640px) { .card { padding: 20px 16px; border-radius: 8px; } .card .sub { margin-bottom: 18px; } }

/* phones and narrow windows: CV + Telegram dock once the header buttons scroll away */
.dock { display: none; }
@media (max-width: 1119px) {
  .dock { display: flex; gap: 8px; position: fixed; z-index: 20; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom));
          padding: 8px; border-radius: 8px; background: rgba(28,28,28,.82); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
          box-shadow: 0 8px 30px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.08);
          transform: translate(-50%, calc(100% + 24px)); transition: transform .35s cubic-bezier(.16,1,.3,1); }
  .dock.on { transform: translate(-50%, 0); }
  .dock a { white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) { .dock, .card, .copy { transition: none; } .card:hover .cover img, .card:hover .cover video { transform: none; } }

/* ---------- home: wider page (960 content), prose keeps a reading measure ---------- */
.wrap.home { max-width: 1016px; }
#contact > p { max-width: 680px; }
.home .card { padding: 32px; }

/* jobs and projects: who/where/when on the left, what on the right */
.home .entry { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 8px 48px; }
.home .entry .head h3 { margin: 0 0 4px; }
.home .entry .head .where { margin: 0 0 4px; }
.home .entry .head .when { display: block; margin: 0; white-space: normal; }
.home .entry .body > :first-child { margin-top: 0; }
@media (max-width: 760px) {
  .home .entry { grid-template-columns: 1fr; gap: 0; }
  .home .entry .head { margin-bottom: 12px; }
  .home .card { padding: 20px 16px; }
}

/* side menu sits left of the wider column; below 1408px the bottom dock carries the CVs instead */
@media (min-width: 1120px) and (max-width: 1407px) { .home .toc { display: none; } }
@media (min-width: 1408px) { .home .toc { left: calc(50% - 480px - 200px); } }
@media (min-width: 1120px) and (max-width: 1407px) {
  .home ~ .dock { display: flex; gap: 8px; position: fixed; z-index: 20; left: 50%; bottom: 16px; padding: 8px; border-radius: 8px;
                  background: rgba(20,20,20,.82); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
                  box-shadow: 0 8px 30px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.08);
                  transform: translate(-50%, calc(100% + 24px)); transition: transform .35s cubic-bezier(.16,1,.3,1); }
  .home ~ .dock.on { transform: translate(-50%, 0); }
}

/* ---------- case cards: text left, the versions as a deck right (newest in front) ---------- */
.home .card { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 48px; align-items: center; }
.card .txt .sub { margin-bottom: 28px; }
.card .txt .knums { flex-direction: column; gap: 18px; margin-bottom: 28px; }
.deck { display: grid; align-items: end; }
.deck figure { grid-area: 1 / 1; margin: 0; position: relative; }
.deck img, .deck video { display: block; width: 100%; height: auto; border-radius: 8px;
                         box-shadow: -16px 0 36px rgba(0,0,0,.7); outline: 1px solid rgba(255,255,255,.08); outline-offset: -1px;
                         transition: filter .35s ease-out; }
/* three widths that step up and three offsets that end exactly at the right edge */
.deck figure:nth-child(1) { width: 38%; margin-left: 0; z-index: 1; }
.deck figure:nth-child(2) { width: 42%; margin-left: 25%; z-index: 2; }
.deck figure:nth-child(3) { width: 46%; margin-left: 54%; z-index: 3; }
.deck figure:nth-child(1) img, .deck figure:nth-child(1) video { filter: brightness(.55); }
.deck figure:nth-child(2) img, .deck figure:nth-child(2) video { filter: brightness(.75); }
.card:hover .deck img, .card:hover .deck video { filter: none; }
.legend { font-size: 14px; color: var(--faint); margin: 14px 0 0; }
.card:hover .cover img, .card:hover .cover video { transform: none; }
@media (max-width: 760px) {
  .home .card { grid-template-columns: 1fr; gap: 24px; }
  .card .pics { order: -1; }
  .card .txt .knums { flex-direction: row; gap: 12px 32px; }
}
@media (prefers-reduced-motion: reduce) { .deck img, .deck video { transition: none; } }

/* ---------- home header: one column; the CV summary is the lead ---------- */
.home h1 { margin-bottom: 24px; }
.home .lead { font-size: 20px; line-height: 1.5; letter-spacing: -0.015em; max-width: 820px; margin-bottom: 24px; }
@media (max-width: 640px) { .home .lead { font-size: 18px; } }

/* ---------- case card text: name, one line, numbers table, stack, link ---------- */
.card .txt h3 { font-size: 32px; font-weight: 700; line-height: 1.1; letter-spacing: -0.03em; margin: 0; }
.card .desc { font-size: 17px; color: var(--muted); margin: 8px 0 28px; text-wrap: balance; }
.kt { margin: 0 0 28px; border-top: 1px solid var(--chip-h); }
.kt div { display: grid; grid-template-columns: 7.5em 1fr; gap: 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--chip-h); }
.kt dt { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kt dd { margin: 0; font-size: 14px; color: var(--faint); }
.card .stk { font-size: 14px; color: var(--faint); margin: 0 0 24px; }
.card .go { display: inline-flex; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(255,255,255,.35); }
.card:hover .go { text-decoration-color: currentColor; }
@media (max-width: 760px) { .card .txt h3 { font-size: 26px; } }

/* ---------- polish pass ---------- */
/* case cards stack before the deck gets squeezed next to the text */
@media (max-width: 959px) {
  .home .card { grid-template-columns: 1fr; gap: 28px; }
  .card .pics { order: -1; max-width: 560px; }
}
/* numbers table: on narrow phones the label goes under the number instead of a thin column */
@media (max-width: 480px) {
  .kt div { grid-template-columns: 1fr; gap: 2px; }
}
/* contact: CV downloads on their own line */
.contacts.cvs { margin-top: 10px; }
/* phones: the two CV buttons stack at equal width */
@media (max-width: 480px) { .actions a.primary { flex: 1 1 100%; } }

/* home: secondary link on a case card sits above the card-wide link */
.card .go-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 24px; margin: 0; }
.card .go-row > * { white-space: nowrap; }
.card .side { position: relative; z-index: 6; font-size: 14px; color: var(--faint); }
.card .side:hover { color: var(--text); }

