/* Tokens — DESIGN.md (colors, typography, rounded, spacing) + animation-inspo.md §2 (motion) */
:root {
  /* colors */
  --primary: #ffffff;
  --on-primary: #000000;
  --accent-blue: #0099ff;
  --ink: #ffffff;
  --ink-muted: #999999;
  --canvas: #090909;
  --surface-1: #141414;
  --surface-2: #1c1c1c;
  --hairline: #262626;
  --hairline-soft: #1a1a1a;
  --semantic-success: #22c55e;
  --gradient-magenta: #d44df0;
  --gradient-violet: #6a4cf5;

  /* type — GT Walsheim substitute per DESIGN.md "Note on Font Substitutes" */
  --font-display: "Geist", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --inter-features: "cv01", "cv05", "cv09", "cv11", "ss03", "ss07";

  /* rounded */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 15px;
  --r-xl: 20px;
  --r-xxl: 30px;
  --r-pill: 100px;
  --r-full: 9999px;

  /* spacing */
  --s-xxs: 4px;
  --s-xs: 8px;
  --s-sm: 12px;
  --s-md: 15px;
  --s-lg: 20px;
  --s-xl: 30px;
  --s-xxl: 40px;
  --s-section: 96px;

  /* layout */
  --container: 1199px;
  --gutter: var(--s-xl);
  --nav-h: 56px;

  /* motion */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-ed: cubic-bezier(.65, .05, 0, 1);
  --ease-hover: ease;
  --d-press: .14s;
  --d-hover: .2s;
  --d-ui: .3s;
  --d-enter: .6s;
  --press: .97;
  --lift: -2px;
  --rise: 24px;
}

@media (prefers-reduced-motion: reduce) {
  :root { --rise: 0px; --lift: 0px; --press: 1; }
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;            /* typography.body */
  line-height: 1.3;
  letter-spacing: -0.15px;
  font-feature-settings: var(--inter-features);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Grain — subtle noise over the whole canvas */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("../assets/img/grain.png");   /* pre-rendered tile: SVG filter noise re-rasterized per GPU tile and drew uneven patches */
  background-size: 200px 200px;
  transform: translateZ(0);   /* own stable layer */
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
p, h1, figure { margin: 0; }

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  left: var(--s-md);
  top: -100px;
  z-index: 200;
  padding: 10px 15px;
  border-radius: var(--r-pill);
  background: var(--primary);
  color: var(--on-primary);
  font-size: 14px;
  font-weight: 500;
}
.skip-link:focus { top: var(--s-md); }

/* Interaction layer — animation-inspo.md §4.1 */
a, button, .btn {
  transition-property: transform, background-color, color, border-color, box-shadow, opacity;
  transition-duration: var(--d-hover);
  transition-timing-function: var(--ease-hover);
}
:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 3px;
}

/* Buttons — components.button-primary / button-secondary */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-xs);
  min-height: 44px;
  padding: 10px 15px;
  border: 0;
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-size: 14px;            /* typography.button */
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.14px;
  white-space: nowrap;
  cursor: pointer;
}
.btn:active { transform: scale(var(--press)); transition-duration: var(--d-press); }

.btn--primary { background: var(--primary); color: var(--on-primary); }
.btn--secondary { background: var(--surface-1); color: var(--ink); }

@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover { background: #e6e6e6; }
  .btn--secondary:hover { background: var(--surface-2); }
}

/* Header — components.top-nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--canvas);
}

.site-header__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--s-lg);
  min-height: var(--nav-h);
  padding-block: var(--s-xs);
}

.monogram {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -1px;
}

.nav__links {
  display: flex;
  gap: var(--s-xxs);
}
.nav__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: var(--s-sm);
  color: var(--ink-muted);
  font-size: 14px;            /* typography.body-sm */
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.14px;
}

@media (hover: hover) and (pointer: fine) {
  .nav__links a:hover { color: var(--ink); }
}

.site-header__actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: var(--s-xs);
}

/* Language switcher — segmented control (pricing-tab-default / pricing-tab-selected) */
.lang-switch {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  padding: var(--s-xxs);
  border-radius: var(--r-pill);
  background: var(--surface-1);
}
.lang-switch::before {
  content: "";
  position: absolute;
  inset: var(--s-xxs) auto var(--s-xxs) var(--s-xxs);
  width: calc(50% - var(--s-xxs));
  border-radius: var(--r-pill);
  background: var(--surface-2);
  transition: transform var(--d-ui) var(--ease-out);
}
.lang-switch:has(a:last-child[aria-current])::before { transform: translateX(100%); }
.lang-switch a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 36px;
  padding-inline: var(--s-sm);
  border-radius: var(--r-pill);
  color: var(--ink-muted);
  font-size: 14px;            /* typography.button */
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.14px;
}
.lang-switch a::after { content: ""; position: absolute; inset: calc(var(--s-xxs) * -1) 0; }
.lang-switch a[aria-current] { color: var(--ink); pointer-events: none; }
@media (hover: hover) and (pointer: fine) {
  .lang-switch a:hover { color: var(--ink); }
}

/* Download CV → language choice */
.cv { position: relative; }

.cv__menu {
  position: absolute;
  top: calc(100% + var(--s-xs));
  right: 0;
  z-index: 60;
  display: grid;
  min-width: 200px;
  padding: var(--s-xs);
  border-radius: var(--r-lg);
  background: var(--surface-2);
  box-shadow: inset 0 0.5px 0 rgb(255 255 255 / .10), 0 10px 30px rgb(0 0 0 / .25); /* elevation level 2 */
  transform-origin: top right;
  animation: menu-in var(--d-hover) var(--ease-out);
}
.cv__menu[hidden] { display: none; }

.cv__question {
  padding: var(--s-xs) var(--s-sm) var(--s-xxs);
  color: var(--ink-muted);
  font-size: 13px;            /* typography.caption */
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.13px;
}
.cv__menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding-inline: var(--s-sm);
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.14px;
}
@media (hover: hover) and (pointer: fine) {
  .cv__menu a:hover { background: var(--surface-1); }
}

.hero .cv__menu,
.contact .cv__menu { left: 0; right: auto; transform-origin: top left; }

@keyframes menu-in {
  from { opacity: 0; transform: scale(.96); }
}

/* Mobile menu */
.menu-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--r-full);
  background: var(--surface-1);
  cursor: pointer;
}
.menu-toggle span {
  position: absolute;
  left: 14px;
  right: 14px;
  height: 1.5px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform var(--d-ui) var(--ease-out);
}
.menu-toggle span:first-child { top: 18px; }
.menu-toggle span:last-child { top: 24px; }
.menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(3px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3px) rotate(-45deg); }

.mobile-menu {
  height: calc(100dvh - var(--nav-h));
  overflow-y: auto;
  background: var(--canvas);
  padding-block: var(--s-lg);
}
.mobile-menu[hidden] { display: none; }
.mobile-menu:not([hidden]) { animation: lb-in var(--d-ui) var(--ease-out); }
.mobile-menu ul { display: grid; gap: var(--s-xxs); }
.mobile-menu li > a {
  display: flex;
  align-items: center;
  min-height: 48px;
  font-family: var(--font-display);
  font-size: 32px;            /* typography.display-md */
  font-weight: 500;
  line-height: 1.13;
  letter-spacing: -1px;
}
.mobile-menu__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--s-lg);
}
.mobile-menu .cv__menu { right: 0; }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--s-xl);
  row-gap: var(--s-xxl);
  padding-top: var(--s-section);
  padding-bottom: var(--s-section);
}

.hero__title {
  font-family: var(--font-display);
  font-size: 85px;            /* typography.display-xl */
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.05em;    /* -4.25px at 85px, kept as a percentage when scaled */
  font-feature-settings: "ss02";
  text-wrap: balance;
  animation: hero-title-in var(--d-enter) ease both;
}

@keyframes hero-title-in {
  from { opacity: 0; transform: translateY(var(--rise)); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__title { animation: none; }
}

.hero__body {
  grid-column: 1 / span 8;
  align-self: center;
  display: grid;
  gap: var(--s-xl);
}
.hero__lead,
.hero__meta { max-width: 520px; }
.hero__title + .hero__lead { margin-top: var(--s-xs); }

.hero__lead {
  font-size: 18px;            /* typography.body-lg */
  line-height: 1.3;
  letter-spacing: -0.18px;
  color: var(--ink);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-xs);
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  row-gap: var(--s-xxs);
  color: var(--ink-muted);
  font-size: 13px;            /* typography.caption */
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.13px;
}
.hero__meta > span:not(:last-child)::after {
  content: "·";
  padding-inline: var(--s-xs);
  color: var(--ink-muted);
}

.status { color: var(--ink); }
.status__dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: var(--s-xs);
  border-radius: var(--r-full);
  background: var(--semantic-success);
  vertical-align: 1px;
}

.hero__visual {
  grid-column: 9 / -1;
  align-self: stretch;
}
.hero__visual picture,
.hero__visual img { height: 100%; }
.hero__visual img {
  width: 100%;
  min-height: 420px;
  object-fit: cover;
  object-position: 50% 20%;
  border-radius: var(--r-xl);
  background: var(--surface-1);
}

/* Desktop narrow */
@media (max-width: 1199px) {
  .hero__title { font-size: 62px; letter-spacing: -0.05em; }  /* typography.display-lg */
  .nav__links a { padding-inline: var(--s-xs); }
}

/* Tablet: nav → hamburger, primary pill stays on the bar */
@media (max-width: 1023px) {
  .site-header__inner { grid-template-columns: auto 1fr; }
  .nav,
  .site-header__actions > .lang-switch,
  .site-header__actions > .cv { display: none; }
  .menu-toggle { display: inline-block; }
}

/* Mobile: text and visual in one column */
@media (max-width: 809px) {
  :root { --gutter: var(--s-md); }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    row-gap: var(--s-xxl);
    padding-top: var(--s-xxl);
    padding-bottom: var(--s-section);
  }
  .hero__title {
    font-size: clamp(32px, 10.5vw, 62px);   /* display-md → display-lg */
  }
  .hero__body,
  .hero__visual { grid-column: 1 / -1; }
  .hero__lead { font-size: 18px; }
  .hero__visual img { height: auto; min-height: 0; aspect-ratio: 4 / 5; }
}

/* ───────── Sections below the hero ───────── */

/* Neighbouring sections add up to one spacing.section (96px) gap on desktop */
.section {
  padding-block: clamp(32px, 5vw, calc(var(--s-section) / 2));
}

.section__head {
  display: grid;
  gap: var(--s-lg);
  margin-bottom: clamp(var(--s-xl), 5vw, 64px);
}
.section__head--row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: var(--s-xl);
}

.section__title {
  margin: 0;
  max-width: 16ch;
  font-family: var(--font-display);
  font-size: clamp(32px, 5.6vw, 62px);   /* display-md → display-lg */
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.05em;
  font-feature-settings: "ss02";
  text-wrap: balance;
}

.section__lead {
  max-width: 560px;
  color: var(--ink-muted);
  font-size: 18px;            /* typography.body-lg */
  line-height: 1.3;
  letter-spacing: -0.18px;
}

.sub-title {
  margin: 0 0 var(--s-lg);
  font-family: var(--font-body);
  font-size: 22px;            /* typography.headline */
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.8px;
  font-feature-settings: var(--inter-features);
}

h2, h3, h4 { margin: 0; }
ol { margin: 0; padding: 0; list-style: none; }

/* Tags — inline tag radius from DESIGN.md */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-xs);
}
.tags li {
  padding: 6px 10px;
  border-radius: var(--r-sm);
  background: var(--surface-1);
  color: var(--ink);
  font-size: 14px;            /* typography.body-sm */
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.14px;
}
.tags--on-color li { background: rgb(0 0 0 / .22); }

/* About */

/* How I work — sticky scroll scene with a stepper rail (dvorianinov Process, animation-inspo §5.4).
   Static stack by default; JS adds .is-scene on wide screens without reduced motion. */
.how { margin-bottom: clamp(64px, 8vw, var(--s-section)); }   /* same rhythm as between sections (2 × 48) */
.how__head {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: var(--s-sm);
  align-items: end;
  margin-bottom: var(--s-xl);
}
.how__head .section__title { grid-column: 1 / 6; }
.how__note {
  grid-column: 7 / -1;
  color: var(--ink-muted);
  font-size: 15px;
  line-height: 1.4;
}
.how__rail { display: none; }
.how__stage { display: grid; gap: var(--s-md); }
.how__step {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
  align-items: center;
  gap: var(--s-xl);
  padding: clamp(24px, 3vw, 40px);
  border-radius: var(--r-xl);
  background: var(--surface-1);
}
.how__txt { display: grid; align-content: start; gap: var(--s-sm); max-width: 520px; }
.how__n {
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.13px;
}
.how__n em { font-style: normal; color: var(--accent-blue); }
.how__title {
  font-family: var(--font-display);
  font-size: 32px;            /* display-md */
  font-weight: 500;
  line-height: 1.13;
  letter-spacing: -1px;
}
.how__body {
  color: var(--ink-muted);
  font-size: 15px;
  line-height: 1.4;
}

/* Scene mode */
.how.is-scene .how__sticky {
  position: sticky;
  top: 0;                     /* JS centers it: top = (viewport − own height) / 2 */
  display: grid;
}
.how.is-scene .how__card {
  display: grid;
  gap: clamp(32px, 4vw, 56px);
  padding: 32px clamp(32px, 4vw, 56px) clamp(32px, 4vw, 56px);
  border-radius: var(--r-xxl);
  background: var(--surface-1);
}
.how.is-scene .how__rail {
  --f: 0;
  position: relative;
  display: block;
  height: 40px;
}
.how__base, .how__fill {
  position: absolute;
  left: 20px;
  right: 20px;
  top: 50%;
  height: 1px;
  background: var(--hairline);
}
.how__fill {
  background: var(--accent-blue);
  transform: scaleX(var(--f));
  transform-origin: left center;
}
.how__track {
  position: absolute;
  left: 20px;
  right: 20px;
  top: 50%;
  height: 0;
  transform: translateX(calc(var(--f) * 100%));
}
.how__head-dot {
  position: absolute;
  left: -5px;
  top: -5px;
  width: 10px;
  height: 10px;
  border-radius: var(--r-full);
  background: var(--accent-blue);
  box-shadow: 0 0 0 4px rgb(0 153 255 / .18);
}
.how__nodes {
  position: relative;
  display: flex;
  justify-content: space-between;
  height: 100%;
  align-items: center;
}
.how__node {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-full);
  background: var(--surface-1);
  color: var(--ink-muted);
  font: 500 13px/1 var(--font-body);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background var(--d-ui) var(--ease-out), color var(--d-ui) var(--ease-out), border-color var(--d-ui) var(--ease-out), transform var(--d-press) var(--ease-out);
}
.how__node { position: relative; }
.how__node::after { content: ""; position: absolute; inset: -2px; border-radius: inherit; }   /* 44px touch target */
.how__node:active { transform: scale(var(--press)); }
.how__node.is-done { border-color: var(--accent-blue); color: var(--ink); }
.how__node[aria-current="true"] { background: var(--accent-blue); border-color: var(--accent-blue); color: var(--on-primary); }   /* white on #0099ff is 3:1, black is 7:1 (WCAG AA) */
@media (hover: hover) and (pointer: fine) {
  .how__node:not([aria-current="true"]):hover { color: var(--ink); border-color: var(--ink-muted); }
}

.how.is-scene .how__stage { display: grid; }
.how.is-scene .how__step {
  grid-area: 1 / 1;
  padding: 0;
  border-radius: 0;
  background: none;
  grid-template-columns: minmax(0, 1fr) minmax(0, 360px);
  opacity: 0;
  translate: 0 14px;
  pointer-events: none;
  transition: opacity .2s var(--ease-hover), translate .2s var(--ease-out);
}
.how.is-scene .how__step.is-on {
  opacity: 1;
  translate: 0 0;
  pointer-events: auto;
  transition: opacity .45s var(--ease-out) .15s, translate .55s var(--ease-ed) .15s;
}

/* Step illustrations: one 6s cycle per scene (draw → nodes → result → erase), paused off-stage */
.how__art { color: var(--ink-muted); }
.art { display: block; width: 100%; height: auto; overflow: visible; }
.art .ln {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  /* dash 2 / gap 2 on pathLength 1: the drawn state covers the whole contour twice over,
     so no browser rounding leaves a hole where the line closes */
  stroke-dasharray: 2;
  stroke-dashoffset: 0;
}
.art .ln--accent { stroke: var(--accent-blue); }
.art .ln--ink { stroke: var(--ink); stroke-width: 2; }
.art__noise { fill: var(--hairline); }
.art .pop, .art .rise { transform-box: fill-box; transform-origin: 50% 50%; fill: var(--ink-muted); }
.art .pop--accent, .art .rise--accent { fill: var(--accent-blue); }
.art .pop--success { fill: var(--semantic-success); }
.art .pop--handle { fill: var(--surface-1); stroke: var(--accent-blue); stroke-width: 1.5; }
.art .pop--text { fill: var(--ink); font: 500 15px var(--font-body); }
.art .rise { transform-origin: 50% 100%; }
.art .rider {
  fill: var(--ink);
  offset-path: path("M70 152 C100 152 100 84 132 84 H196 C228 84 228 152 258 152");
  offset-rotate: 0deg;
  opacity: 0;
}

.js .how__step .art .ln { animation: art-draw 6s var(--ease-ed) var(--d, 0s) infinite both; }
.js .how__step .art .pop { animation: art-pop 6s var(--ease-out) var(--d, 0s) infinite both; }
.js .how__step .art .rise { animation: art-rise 6s var(--ease-out) var(--d, 0s) infinite both; }
.js .how__step .art .rider { animation: art-ride 6s var(--ease-ed) 1.2s infinite both; }
.js .how__step:not(.is-on) .art * { animation-play-state: paused; }

@keyframes art-draw {
  0% { stroke-dashoffset: 2; }
  22%, 84% { stroke-dashoffset: 0; }
  96%, 100% { stroke-dashoffset: 2; }
}
@keyframes art-pop {
  0%, 10% { opacity: 0; transform: scale(.3); }
  20%, 84% { opacity: 1; transform: none; }
  94%, 100% { opacity: 0; transform: scale(.3); }
}
@keyframes art-rise {
  0%, 6% { opacity: 0; transform: scaleY(0); }
  24%, 84% { opacity: 1; transform: none; }
  94%, 100% { opacity: 0; transform: scaleY(0); }
}
@keyframes art-ride {
  0% { offset-distance: 0%; opacity: 0; }
  6% { opacity: 1; }
  34%, 60% { offset-distance: 100%; opacity: 1; }
  68%, 100% { offset-distance: 100%; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .how__step .art * { animation: none !important; }
  .how__step .art .ln { stroke-dashoffset: 0; }
  .how__step .art .pop, .how__step .art .rise { opacity: 1; transform: none; }
}

/* Skills — sticky scroll scene (qbray Services pattern, animation-inspo §5.4).
   Static stack by default; JS adds .is-scene on wide screens without reduced motion. */
.skills { --ring: min(440px, 34vw); }
.skills__ring { display: none; }
.skills__stage { display: grid; gap: var(--s-xl); }
.skills__panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: var(--s-sm);
}

.skills.is-scene { position: relative; }
.skills.is-scene .skills__sticky {
  position: sticky;
  top: 0;                     /* JS centers it: top = (viewport − own height) / 2 */
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--s-xl);
  align-items: center;
}
.skills.is-scene .skills__ring {
  position: relative;
  display: block;
  grid-column: 1 / span 6;
  width: var(--ring);
  aspect-ratio: 1;
  margin-left: calc(var(--s-section) / 2);
}
.ring__track {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
  stroke: var(--hairline);
  stroke-width: .35;
  stroke-dasharray: .6 2.4;
  animation: ring-march 60s linear infinite;
}
@keyframes ring-march { to { stroke-dashoffset: -150; } }
.ring__label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: clamp(32px, 5.6vw, 62px);   /* same as .section__title */
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.05em;
  font-feature-settings: "ss02";
  color: var(--ink);
}
.ring__pills li {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: var(--x, 0) var(--y, 0);
  opacity: var(--o, 1);
  z-index: var(--z, 1);
}
.ring__pill {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--surface-1);
  color: color-mix(in srgb, var(--ink-muted), #808080 calc(var(--t, 0) * 100%));   /* #808080 on surface-1 = 4.6:1 */
  font-size: 14px;            /* typography.button */
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.14px;
  white-space: nowrap;
  cursor: pointer;
  transform: translate(-50%, -50%);
}
.ring__pill { position: relative; }
.ring__pill::after { content: ""; position: absolute; inset: -2px 0; }   /* 44px touch target */
.ring__pill:active { transform: translate(-50%, -50%) scale(var(--press)); }
.ring__pill[aria-current="true"] { background: var(--primary); color: var(--on-primary); }
@media (hover: hover) and (pointer: fine) {
  .ring__pill:not([aria-current="true"]):hover { background: var(--surface-2); color: var(--ink); }
}

.skills.is-scene .skills__heading { display: none; }
.skills.is-scene .skills__stage {
  grid-column: 8 / -1;
  display: grid;
}
.skills.is-scene .skills__panel {
  grid-area: 1 / 1;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;       /* same title → tags gap in every category */
  gap: var(--s-lg);
  opacity: 0;
  translate: 0 14px;
  pointer-events: none;
  transition: opacity .2s var(--ease-hover), translate .2s var(--ease-out);
}
.skills.is-scene .skills__panel.is-on {
  opacity: 1;
  translate: 0 0;
  pointer-events: auto;
  transition: opacity .45s var(--ease-out) .15s, translate .55s var(--ease-ed) .15s;
}
.skills.is-scene .skills__panel .skills__title {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 32px;            /* display-md, same as .case-card__title */
  font-weight: 500;
  line-height: 1.13;
  letter-spacing: -1px;
}
.skills.is-scene .skills__panel .tags li {
  opacity: 0;
  translate: 0 8px;
  transition: opacity .2s var(--ease-hover), translate .2s var(--ease-out);
}
.skills.is-scene .skills__panel.is-on .tags li {
  opacity: 1;
  translate: 0 0;
  transition: opacity .4s var(--ease-out), translate .5s var(--ease-out);
  transition-delay: calc(.2s + var(--i, 0) * 30ms);
}

.skills__title {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 32px;            /* display-md, same as .case-card__title */
  font-weight: 500;
  line-height: 1.13;
  letter-spacing: -1px;
}

.looking__list {
  display: grid;
  gap: var(--s-lg);
  color: var(--ink-muted);
  font-size: 15px;
  line-height: 1.3;
  letter-spacing: -0.18px;
}
.looking__list b { color: var(--ink); font-weight: 500; }

/* Work — product-mockup-tile cards, 2-up */
.work__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-xl);
}
.case-card {
  display: grid;
  height: 100%;
  gap: var(--s-lg);
  padding: 16px;
  border-radius: var(--r-xl);
  background: var(--surface-1);
}
.case-card__media {
  overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--surface-2);
}
.case-card__media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform var(--d-enter) var(--ease-out);
}
.case-card__body {
  display: grid;
  align-content: start;
  gap: var(--s-sm);
  padding: 0 var(--s-xs) var(--s-xs);
}
.case-card__title {
  font-family: var(--font-display);
  font-size: 32px;            /* display-md */
  font-weight: 500;
  line-height: 1.13;
  letter-spacing: -1px;
}
.case-card__text {
  color: var(--ink-muted);
  font-size: 15px;
  line-height: 1.3;
}
.case-card__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-xs) var(--s-lg);
  margin-top: var(--s-xs);
  color: var(--ink-muted);
  font-size: 13px;            /* typography.caption */
  font-weight: 500;
  line-height: 1.2;
}
.case-card__cta { color: var(--ink); }
.case-card__cta span { display: inline-block; transition: transform var(--d-hover) var(--ease-hover); }

@media (hover: hover) and (pointer: fine) {
  .case-card:hover {
    transform: translateY(var(--lift));
    box-shadow: 0 18px 40px -20px rgb(0 0 0 / .75), 0 8px 28px -14px rgb(0 153 255 / .18);
  }
  .case-card:hover .case-card__media img { transform: scale(1.03); }
  .case-card:hover .case-card__cta span { transform: translateX(3px); }
}
.case-card:focus-visible {
  transform: translateY(var(--lift));
  box-shadow: 0 18px 40px -20px rgb(0 0 0 / .75), 0 8px 28px -14px rgb(0 153 255 / .18);
}
.case-card:focus-visible .case-card__media img { transform: scale(1.03); }
.case-card:focus-visible .case-card__cta span { transform: translateX(3px); }
@media (prefers-reduced-motion: reduce) {
  .case-card:hover, .case-card:hover .case-card__media img,
  .case-card:focus-visible, .case-card:focus-visible .case-card__media img { transform: none; }
}

/* Experience — chronology */
.jobs { display: grid; }
.job {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--s-lg) var(--s-xl);
  padding-block: var(--s-xl);
  border-top: 1px solid var(--hairline);
}
/* Desktop hover: the row lifts onto surface-1, text brightens, bullets turn accent */
@media (hover: hover) and (pointer: fine) and (min-width: 1024px) {
  .job {
    margin-inline: calc(var(--s-lg) * -1);
    padding-inline: var(--s-lg);
    transition: background-color var(--d-ui) var(--ease-out), border-color var(--d-ui) var(--ease-out);
  }
  .job__dates, .job__list, .job__title span { transition: color var(--d-ui) var(--ease-out); }
  .job__title { transition: translate var(--d-ui) var(--ease-out); }
  .job__list li::before { transition: background-color var(--d-ui) var(--ease-out); }
  .job:hover { background: var(--surface-1); border-top-color: transparent; border-radius: var(--r-xl); }
  .job:hover + .job { border-top-color: transparent; }
  .job:hover .job__dates, .job:hover .job__title span { color: var(--ink); }
  .job:hover .job__list { color: var(--ink); }
  .job:hover .job__title { translate: 4px 0; }
  .job:hover .job__list li::before { background: var(--accent-blue); }
}
.job__dates {
  grid-column: 1 / span 3;
  color: var(--ink-muted);
  font-size: 15px;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.job__body { grid-column: 4 / -1; display: grid; gap: var(--s-md); }
.job__title {
  font-size: 22px;            /* typography.headline */
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.8px;
}
.job__title span { color: var(--ink-muted); font-weight: 400; }
.job__list {
  display: grid;
  gap: var(--s-xs);
  max-width: 720px;
  color: var(--ink-muted);
  font-size: 15px;
  line-height: 1.4;
}
.job__list li {
  position: relative;
  padding-left: var(--s-lg);
}
.job__list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .6em;
  width: 5px;
  height: 5px;
  border-radius: var(--r-full);
  background: var(--ink-muted);
}

/* Contact */
.contact {
  display: grid;
  gap: clamp(var(--s-xl), 5vw, 64px);
  padding-bottom: clamp(96px, 12vw, 160px);
}
.contact__title {
  max-width: 24ch;
  font-family: var(--font-display);
  font-size: clamp(32px, 5.6vw, 62px);   /* same as .section__title */
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.05em;
  font-feature-settings: "ss02";
  text-wrap: balance;
}
.contact__body {
  display: grid;
  gap: var(--s-xl);
  max-width: 640px;
}
.contact__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--s-xxl) var(--s-xl);
}
.contact__grid > .contact__body { grid-column: 1 / span 6; align-content: start; }
.contact__grid > .looking {
  grid-column: 8 / -1;
  padding: 24px;
  border-radius: var(--r-xl);
  background: var(--surface-1);
}
.contact__links {
  display: grid;
  gap: var(--s-xs);
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: -0.18px;
}
.contact__links a,
.site-footer a {
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}
.contact__links a { color: var(--ink); text-decoration-color: var(--hairline); }
@media (hover: hover) and (pointer: fine) {
  .contact__links a:hover { text-decoration-color: var(--accent-blue); }
  .site-footer a:hover { color: var(--ink); }
}
.contact__actions { display: flex; flex-wrap: wrap; gap: var(--s-xs); }

/* Copy email: the address and its icon are one button that copies, plus a toast */
.copy-email {
  display: inline-flex;
  align-items: center;
  gap: var(--s-xs);
  max-width: 100%;
  margin: -4px -8px;
  padding: 4px 8px;
  border: 0;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--ink);
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  position: relative;
  cursor: pointer;
  transition: background var(--d-hover) var(--ease-hover), transform var(--d-press) var(--ease-out);
}
/* Text tooltip above the button */
.copy-email::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  padding: 4px 10px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  opacity: 0;
  translate: -50% 4px;
  pointer-events: none;
  transition: opacity var(--d-hover) var(--ease-out), translate var(--d-hover) var(--ease-out);
}
.copy-email:focus-visible::after { opacity: 1; translate: -50% 0; }
.copy-email > span:first-child {
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-color: var(--hairline);
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
  transition: text-decoration-color var(--d-hover) var(--ease-hover);
}
.copy-email svg {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--ink-muted);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke var(--d-hover) var(--ease-hover);
}
.copy-email:active { transform: scale(var(--press)); }
.copy-email:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .copy-email:hover { background: var(--surface-1); }
  .copy-email:hover::after { opacity: 1; translate: -50% 0; transition-delay: .15s; }
  .copy-email:hover > span:first-child { text-decoration-color: var(--accent-blue); }
  .copy-email:hover svg { stroke: var(--ink); }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: var(--s-xs);
  padding: 10px 16px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgb(0 0 0 / .4);
  opacity: 0;
  translate: -50% 12px;
  pointer-events: none;
  transition: opacity var(--d-ui) var(--ease-out), translate var(--d-ui) var(--ease-out);
}
.toast.is-on { opacity: 1; translate: -50% 0; }
.toast svg { width: 16px; height: 16px; fill: none; stroke: var(--semantic-success); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* Footer — components.footer */
.site-footer {
  padding: 64px 0;
  background: var(--canvas);
  color: var(--ink-muted);
  font-size: 13px;            /* typography.caption */
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.13px;
  border-top: 1px solid var(--hairline-soft);
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 2fr repeat(4, minmax(0, 1fr));
  gap: var(--s-xxl) var(--s-xl);
}
.site-footer__about { max-width: 260px; font-size: 14px; line-height: 1.4; }
.site-footer__about b { color: var(--ink); font-weight: 500; }
.site-footer__title {
  margin-bottom: var(--s-md);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}
.site-footer__col ul { display: grid; gap: var(--s-sm); }
.site-footer__col a { overflow-wrap: anywhere; }
.site-footer__status { display: grid; gap: var(--s-sm); }
.site-footer__copy { grid-column: 1 / -1; }

/* ───── Responsive for sections ───── */
@media (max-width: 1199px) {
  .site-footer__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .site-footer__about { grid-column: 1 / -1; max-width: none; }
}

@media (max-width: 1023px) {
  .contact__grid > .contact__body, .contact__grid > .looking { grid-column: 1 / -1; }
  .job__dates { grid-column: 1 / -1; }
  .job__body { grid-column: 1 / -1; }
  .job { gap: var(--s-xs); }
}

@media (max-width: 809px) {
  .work__grid { grid-template-columns: minmax(0, 1fr); }
  .how__head .section__title, .how__note { grid-column: 1 / -1; }
  .how__title, .skills__title { font-size: 24px; letter-spacing: -0.6px; }
  .how__step { grid-template-columns: minmax(0, 1fr); }
  .how__art { order: -1; max-width: 320px; }
  .section__head--row { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .section__head--row .cv__menu { left: 0; right: auto; transform-origin: top left; }
  .site-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer { padding: 48px 0; }
}


/* ───────── Case study pages ───────── */

.case-hero {
  display: grid;
  gap: var(--s-xl);
  padding-top: clamp(var(--s-xxl), 6vw, 64px);
  padding-bottom: clamp(48px, 7vw, 80px);
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-xs);
  color: var(--ink-muted);
  font-size: 13px;            /* typography.caption */
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.13px;
}
.breadcrumbs li + li::before {
  content: "/";
  margin-right: var(--s-xs);
  color: var(--hairline);
}
.breadcrumbs [aria-current] { color: var(--ink); }
@media (hover: hover) and (pointer: fine) {
  .breadcrumbs a:hover { color: var(--ink); }
}

.case-hero__title {
  max-width: 16ch;
  font-family: var(--font-display);
  font-size: clamp(36px, 6.4vw, 85px);   /* display-md → display-xl */
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.05em;
  font-feature-settings: "ss02";
  text-wrap: balance;
  animation: hero-title-in var(--d-enter) ease both;
}
@media (prefers-reduced-motion: reduce) {
  .case-hero__title { animation: none; }
}

.case-hero__lead {
  max-width: 720px;
  font-size: clamp(18px, 2vw, 24px);     /* body-lg → subhead */
  line-height: 1.3;
  letter-spacing: -0.01px;
  color: var(--ink-muted);
}

.case-hero__media,
.case-figure {
  margin: 0;
  overflow: hidden;
  border-radius: var(--r-xl);
  background: var(--surface-1);
}
.case-hero__media img,
.case-figure img { width: 100%; }

.case-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap: var(--s-lg) var(--s-xl);
  margin: 0;
}
.case-meta dt,
.tldr dt {
  margin-bottom: var(--s-xs);
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.13px;
}
.case-meta dd,
.tldr dd { margin: 0; }
.case-meta dd {
  font-size: 15px;
  line-height: 1.3;
}

/* TL;DR — surface-1 card, three columns */
.case-tldr,
.case-section,
.case-next {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--s-xl);
  row-gap: var(--s-lg);
  padding-block: clamp(32px, 5vw, calc(var(--s-section) / 2));
}

.case-section__title {
  grid-column: 1 / span 4;
  align-self: start;
  font-family: var(--font-display);
  font-size: clamp(28px, 3.4vw, 32px);   /* display-md */
  font-weight: 500;
  line-height: 1.13;
  letter-spacing: -1px;
}
@media (min-width: 1024px) {
  .case-section__title {
    position: sticky;
    top: calc(var(--nav-h) + var(--s-lg));
  }
}

.tldr {
  grid-column: 5 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-xl);
  margin: 0;
  padding: clamp(20px, 3vw, 32px);
  border-radius: var(--r-xl);
  background: var(--surface-1);
}
.tldr dd {
  font-size: 15px;
  line-height: 1.4;
}
.tldr dd::first-letter { text-transform: uppercase; }

.case-section__body {
  grid-column: 5 / -1;
  display: grid;
  gap: var(--s-lg);
  max-width: 760px;
  font-size: 18px;            /* typography.body-lg */
  line-height: 1.4;
  letter-spacing: -0.18px;
  color: var(--ink-muted);
}
.case-section__body b { color: var(--ink); font-weight: 500; }
.case-section__sub {
  margin-top: var(--s-lg);    /* 40px above (gap + margin) vs 20px to its own text */
  color: var(--ink);
  font-size: 22px;            /* typography.headline */
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.8px;
}
.case-section__body > .case-section__sub:first-child { margin-top: 0; }
.case-section__body:has(.case-gallery),
.case-section__body:has(.case-figure) { max-width: none; }

/* Legal pages, sitemap & 404 — reuse the case-study layout */
.legal a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--hairline); }
@media (hover: hover) and (pointer: fine) {
  .legal a:hover { text-decoration-color: currentColor; }
}
.legal__updated { color: var(--ink-muted); font-size: 13px; font-weight: 500; }
.not-found { min-height: 60svh; align-content: center; }
.not-found__code { color: var(--ink-muted); font-size: 13px; font-weight: 500; }

.case-list {
  display: grid;
  gap: var(--s-sm);
}
.case-list li {
  position: relative;
  padding-left: var(--s-lg);
  color: var(--ink);
}
.case-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .6em;
  width: 6px;
  height: 6px;
  border-radius: var(--r-full);
  background: var(--accent-blue);
}

.case-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-md);
}
.case-gallery img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* Next case */
.case-card--next {
  grid-column: 5 / -1;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
}
.case-card--next .case-card__title { font-size: clamp(24px, 2.6vw, 32px); }

/* Case pages — responsive */
@media (max-width: 1023px) {
  .case-section__title,
  .tldr,
  .case-section__body,
  .case-card--next { grid-column: 1 / -1; }
  .case-section__body { max-width: none; }
}

@media (max-width: 809px) {
  .tldr,
  .case-gallery,
  .case-card--next { grid-template-columns: minmax(0, 1fr); }
  .tldr { gap: var(--s-lg); }
}

/* Case images open in a lightbox gallery */
.case-zoom {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.case-zoom img { display: block; transition: transform var(--d-enter) var(--ease-out); }
.case-zoom:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: -2px; border-radius: var(--r-xl); }
@media (prefers-reduced-motion: reduce) { .case-zoom:hover img { transform: none; } }
@media (hover: hover) and (pointer: fine) {
  .case-zoom:hover img { transform: scale(1.02); }
}

.lightbox {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: var(--s-lg) clamp(16px, 3vw, 40px);
  border: 0;
  background: rgb(9 9 9 / .96);
  color: var(--ink);
}
.lightbox[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: var(--s-lg);
  animation: lb-in var(--d-ui) var(--ease-out);
}
.lightbox::backdrop { background: rgb(0 0 0 / .6); }
@keyframes lb-in { from { opacity: 0; } }

.lightbox__bar { display: flex; align-items: center; justify-content: space-between; }
.lightbox__count {
  color: var(--ink-muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.lightbox__count span { color: var(--ink); }
.lightbox__btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--r-full);
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  transition: background var(--d-hover) var(--ease-hover), transform var(--d-press) var(--ease-out);
}
.lightbox__btn:active { transform: scale(var(--press)); }
.lightbox__btn:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 2px; }
.lightbox__btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) and (pointer: fine) {
  .lightbox__btn:hover { background: var(--hairline); }
}

.lightbox__stage {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s-lg);
  min-height: 0;
}
.lightbox__img {
  justify-self: center;
  max-width: 100%;
  max-height: calc(100dvh - 220px);   /* bar + thumbs + gaps */
  object-fit: contain;
  border-radius: var(--r-lg);
  transition: opacity var(--d-ui) var(--ease-out);
}
.lightbox__img.is-loading { opacity: 0; }

.lightbox__thumbs {
  display: flex;
  justify-content: center;
  gap: var(--s-sm);
  overflow-x: auto;
  padding: 4px;
}
.lightbox__thumb {
  flex: none;
  width: 96px;
  aspect-ratio: 4 / 3;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--r-md);
  background: var(--surface-1);
  opacity: .45;
  cursor: pointer;
  transition: opacity var(--d-ui) var(--ease-out), box-shadow var(--d-ui) var(--ease-out);
}
.lightbox__thumb img { width: 100%; height: 100%; object-fit: cover; }
.lightbox__thumb[aria-current="true"] { opacity: 1; box-shadow: 0 0 0 2px var(--accent-blue); }
.lightbox__thumb:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) {
  .lightbox__thumb:not([aria-current="true"]):hover { opacity: .8; }
}

@media (max-width: 809px) {
  .lightbox__stage { grid-template-columns: minmax(0, 1fr); }
  .lightbox__nav { position: absolute; bottom: 8px; z-index: 1; }
  .lightbox__nav--prev { left: 8px; }
  .lightbox__nav--next { right: 8px; }
  .lightbox__thumbs { justify-content: flex-start; }
  .lightbox__thumb { width: 64px; }
  .lightbox__img { max-height: calc(100dvh - 260px); }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Typography: no single-word last lines in body copy (hero copy is approved as set), steady clock digits */
.section__lead, .how__note, .how__body, .case-card__text, .job__list li, .looking__list li,
.case-hero__lead, .case-section__body p, .case-list li, .tldr dd { text-wrap: pretty; }
time[data-kyiv-clock] { font-variant-numeric: tabular-nums; }

/* Touch: links in footer, contact and lists get a 44px row on phones */
@media (max-width: 809px) {
  .site-footer__col ul { gap: 0; }
  .site-footer__col a,
  .contact__links a,
  .legal .case-list a { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; }
  .contact__links { gap: 0; }
  .copy-email { min-height: 44px; margin-block: 0; }
  .legal .case-list { gap: 0; }
  .breadcrumbs a { position: relative; }
  .breadcrumbs a::after { content: ""; position: absolute; inset: -14px -6px; }   /* 44px hit area, layout unchanged */
  .site-footer__status { gap: 0; }
  .site-footer__status > span { padding-block: 14px; line-height: 16px; }   /* rows line up with the 44px link rows next to them */
  .site-footer__title { margin-bottom: var(--s-xxs); }
}

/* Manual line break for wide screens only; on phones the text just flows */
@media (max-width: 809px) { .br-desk { display: none; } }

/* Cookie consent banner: card bottom-left, both choices equal weight (GDPR) */
.consent {
  position: fixed;
  left: var(--s-lg);
  bottom: var(--s-lg);
  z-index: 90;
  width: min(400px, calc(100vw - 2 * var(--s-lg)));
  padding: var(--s-lg);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  background: var(--surface-1);
  box-shadow: 0 8px 24px rgb(0 0 0 / .4);
  opacity: 0;
  translate: 0 var(--rise);
  transition: opacity var(--d-ui) var(--ease-out), translate var(--d-ui) var(--ease-out);
}
.consent.is-on { opacity: 1; translate: 0 0; }
.consent__text { margin: 0 0 var(--s-md); color: var(--ink-muted); font-size: 14px; line-height: 1.4; }
.consent__text a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--hairline); text-underline-offset: 4px; }
.consent__actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-xs); }
.consent .btn--secondary { background: var(--surface-2); }
@media (hover: hover) and (pointer: fine) {
  .consent__text a:hover { text-decoration-color: var(--accent-blue); }
  .consent .btn--secondary:hover { background: var(--hairline); }
}
@media (max-width: 809px) {
  .consent { left: 16px; bottom: 16px; width: calc(100vw - 32px); }
}

/* Footer "Cookie settings" reopens the banner; looks like the links next to it */
.site-footer__col .link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}
@media (hover: hover) and (pointer: fine) {
  .site-footer__col .link-btn:hover { color: var(--ink); }
}
@media (max-width: 809px) {
  .site-footer__col .link-btn { display: inline-flex; align-items: center; min-height: 44px; }
}
