/* Variant B "Glass". Editorial Liquid Glass on warm paper: paper, bone and
   graphite, one bright ultramarine accent. Light by default, dark on demand.
   Order: tokens, view transitions, base, paper, glass, controls, bar, page
   parts (hero, cards, numbers, lists, contact), project, carousels,
   marketing, engineering, about, docs, footer, then widths, input and
   preferences (touch, reduced motion, transparency, contrast).
   Rule of the theme: glass with a shadow means "press me"; information
   (chips, statuses, labels) is flat. Text on a photo sits on the near solid
   label fill (--lbl-a, --lbl-b). */

:root {
  --bg: #f2efe9;          /* paper */
  --bg-2: #faf8f4;        /* paper soft */
  --ink: #111110;         /* graphite */
  --muted: #55524c;       /* 7:1 on paper */
  --line: #e3ded4;
  --bone: #c9bca6;
  --bone-deep: #8a7c66;
  --accent: #2b3bff;      /* ultramarine: 6.1:1 on paper, white on it 6.9:1 */
  --accent-ink: #ffffff;
  --accent-text: #2b3bff;
  --m1: rgba(201, 188, 166, .55);
  --m2: rgba(43, 59, 255, .10);
  --m3: rgba(255, 255, 255, .9);
  --m4: rgba(228, 218, 203, .8);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .2 0 0 0 0 .17 0 0 0 0 .12 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --grain-o: .8;
  --lg-bg: rgba(255, 255, 255, .58);
  --lg-bg-2: rgba(250, 248, 244, .26);
  --lg-strong: rgba(250, 248, 244, .80);
  --lg-rim: linear-gradient(135deg, rgba(255, 255, 255, .98), rgba(255, 255, 255, .45) 35%, rgba(43, 59, 255, .22) 60%, rgba(201, 188, 166, .55) 78%, rgba(255, 255, 255, .9));
  --lg-edge: rgba(255, 255, 255, .8);
  --lg-spec: rgba(255, 255, 255, .95);
  --lg-shadow: 0 1px 2px rgba(60, 50, 30, .06), 0 14px 40px rgba(60, 50, 30, .10);
  --lg-shadow-up: 0 2px 4px rgba(60, 50, 30, .07), 0 28px 70px rgba(60, 50, 30, .18);
  /* label on a photo, bars, floating controls: near solid so text reads on any cover */
  --lbl-a: rgba(250, 248, 244, .93);
  --lbl-b: rgba(250, 248, 244, .86);
  --lbl-fill: linear-gradient(150deg, var(--lbl-a), var(--lbl-b));
  /* a line that shows on glass too (rows without boxes, flat chips) */
  --line-strong: color-mix(in srgb, var(--ink) 16%, transparent);
  --radius: 30px;          /* cards */
  --r-sm: 18px;            /* small labels, rows */
  --r-md: 26px;            /* boxes */
  --r-lg: 38px;            /* big panels */
  --gutter: clamp(16px, 4vw, 48px);
  --maxw: 1320px;
  --font-d: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --font-b: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.32, .72, 0, 1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-2: #161616;
  --ink: #f2efe9;
  --muted: #b3ab9d;
  --line: #262626;
  --accent: #6b76ff;
  --accent-ink: #0a0a0a;
  --accent-text: #8c95ff;
  --m1: rgba(201, 188, 166, .10);
  --m2: rgba(107, 118, 255, .13);
  --m3: rgba(255, 255, 255, .035);
  --m4: rgba(138, 124, 102, .12);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .10 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --grain-o: .5;
  --lg-bg: rgba(255, 255, 255, .07);
  --lg-bg-2: rgba(255, 255, 255, .02);
  --lg-strong: rgba(17, 17, 16, .66);
  --lg-rim: linear-gradient(135deg, rgba(255, 255, 255, .26), rgba(255, 255, 255, .04) 38%, rgba(107, 118, 255, .34) 62%, rgba(201, 188, 166, .18) 80%, rgba(255, 255, 255, .16));
  --lg-edge: rgba(255, 255, 255, .14);
  --lg-spec: rgba(255, 255, 255, .22);
  --lg-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 14px 40px rgba(0, 0, 0, .45);
  --lg-shadow-up: 0 2px 4px rgba(0, 0, 0, .4), 0 28px 70px rgba(0, 0, 0, .6);
  --lbl-a: rgba(17, 17, 16, .94);  /* the status on a cream cover reads at 5:1 */
  --lbl-b: rgba(17, 17, 16, .91);
  color-scheme: dark;
}
/* The system decides first (light paper when it is light); the toggle wins. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0a0a;
    --bg-2: #161616;
    --ink: #f2efe9;
    --muted: #b3ab9d;
    --line: #262626;
    --accent: #6b76ff;
    --accent-ink: #0a0a0a;
    --accent-text: #8c95ff;
    --m1: rgba(201, 188, 166, .10);
    --m2: rgba(107, 118, 255, .13);
    --m3: rgba(255, 255, 255, .035);
    --m4: rgba(138, 124, 102, .12);
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .10 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    --grain-o: .5;
    --lg-bg: rgba(255, 255, 255, .07);
    --lg-bg-2: rgba(255, 255, 255, .02);
    --lg-strong: rgba(17, 17, 16, .66);
    --lg-rim: linear-gradient(135deg, rgba(255, 255, 255, .26), rgba(255, 255, 255, .04) 38%, rgba(107, 118, 255, .34) 62%, rgba(201, 188, 166, .18) 80%, rgba(255, 255, 255, .16));
    --lg-edge: rgba(255, 255, 255, .14);
    --lg-spec: rgba(255, 255, 255, .22);
    --lg-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 14px 40px rgba(0, 0, 0, .45);
    --lg-shadow-up: 0 2px 4px rgba(0, 0, 0, .4), 0 28px 70px rgba(0, 0, 0, .6);
    --lbl-a: rgba(17, 17, 16, .94);
    --lbl-b: rgba(17, 17, 16, .91);
    color-scheme: dark;
  }
}
/* Reduced transparency or more contrast: glass becomes solid paper
   (:root:root:root beats both dark rules above). */
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  :root:root:root { --lg-bg: var(--bg-2); --lg-bg-2: var(--bg-2); --lg-strong: var(--bg-2); --lbl-a: var(--bg-2); --lbl-b: var(--bg-2); }
}

/* Cross document view transitions: the card grows into the project hero and back.
   The bars have their own groups, so they stay above the growing card. */
@view-transition { navigation: auto; }
::view-transition-group(card),
::view-transition-group(card-img),
::view-transition-group(card-label) { animation-duration: .62s; animation-timing-function: var(--spring); }
::view-transition-old(card-img),
::view-transition-new(card-img) { width: 100%; height: 100%; object-fit: cover; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .32s; }
::view-transition-group(site-bar), ::view-transition-group(p-index) { z-index: 10; }

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%; scroll-padding-top: 150px; scroll-behavior: smooth;
  overflow-x: clip;               /* clip, not hidden: hidden would stop sticky bars */
}
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 17px/1.6 var(--font-b); overflow-x: clip;
  font-variant-numeric: lining-nums;   /* Cormorant has old style figures (10 read as "Io") */
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: .2em; }
h1, h2, h3, h4 { font-family: var(--font-d); font-weight: 500; line-height: 1.05; margin: 0; letter-spacing: -.01em; text-wrap: balance; }
h3, h4 { font-family: var(--font-b); letter-spacing: -.005em; line-height: 1.25; }
h2 { font-weight: 500; font-size: clamp(38px, 4.6vw, 66px); letter-spacing: -.02em; }
h3 { font-size: 18px; font-weight: 600; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
figure { margin: 0; }
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 10px; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 600; }
.skip:focus { top: 16px; }
::selection { background: var(--accent); color: var(--accent-ink); }
.kicker { font: 600 12px/1.4 var(--font-b); letter-spacing: .12em; text-transform: uppercase; color: var(--accent-text); }

/* ------------------------------------------------------------- paper bg */
.mesh { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: var(--bg); }
.mesh::after { content: ""; position: absolute; inset: 0; background-image: var(--grain); background-size: 160px; opacity: var(--grain-o); }
.mesh i { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; will-change: transform; }
.mesh .m1 { left: -18vmax; top: -22vmax; background: radial-gradient(closest-side, var(--m1), transparent); animation: drift1 70s ease-in-out infinite alternate; }
.mesh .m2 { right: -24vmax; top: 6vmax; background: radial-gradient(closest-side, var(--m2), transparent); animation: drift2 84s ease-in-out infinite alternate; }
.mesh .m3 { left: 18vmax; bottom: -30vmax; background: radial-gradient(closest-side, var(--m3), transparent); animation: drift3 90s ease-in-out infinite alternate; }
.mesh .m4 { right: -8vmax; bottom: -26vmax; width: 46vmax; height: 46vmax; background: radial-gradient(closest-side, var(--m4), transparent); animation: drift1 76s ease-in-out infinite alternate-reverse; }
@keyframes drift1 { to { transform: translate3d(12vw, 10vh, 0) scale(1.1); } }
@keyframes drift2 { to { transform: translate3d(-14vw, 16vh, 0) scale(.92); } }
@keyframes drift3 { to { transform: translate3d(10vw, -12vh, 0) scale(1.06); } }

/* Behind the sticky bars after a scroll: a soft blur that fades out downwards,
   so no cut line of text shows between the bars. Taller while the section
   index of a project is stuck. JS sets pr-scrolled and pr-stuck. */
body::after {
  content: ""; position: fixed; left: 0; right: 0; top: 0; height: 72px; z-index: 39;
  pointer-events: none; opacity: 0; transition: opacity .25s var(--ease);
  background: color-mix(in srgb, var(--bg) 40%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent);
}
.pr-scrolled body::after { opacity: 1; }
.pr-stuck body::after { height: 140px; -webkit-mask-image: linear-gradient(#000 72%, transparent); mask-image: linear-gradient(#000 72%, transparent); }

/* --------------------------------------------------------------- glass
   One recipe for bar, cards, buttons: fine blur, grain, a light rim with a
   faint ultramarine and bone dispersion, inner highlight, soft shadow.
   Elements change only --lg-fill. */
.lg, .pill, .btn {
  --lg-fill: linear-gradient(150deg, var(--lg-bg), var(--lg-bg-2));
  position: relative;
  border: 1px solid transparent;
  background: var(--grain) padding-box, var(--lg-fill) padding-box;
  background-size: 160px, auto;
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  backdrop-filter: blur(14px) saturate(1.5);
  box-shadow: inset 0 1px 0 var(--lg-spec), inset 0 -1px 0 rgba(255, 255, 255, .05), var(--lg-shadow);
}
/* the rim: a 1px gradient ring cut out with a mask, so the fill stays clear */
.lg::after, .pill::after, .btn::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: var(--lg-rim);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}

/* ------------------------------------------------------- pills, buttons */
.pill, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 500 14px/1 var(--font-b); color: var(--ink); text-decoration: none; cursor: pointer;
  height: 40px; padding: 0 16px; border-radius: 999px;
  transition: transform .25s var(--ease), box-shadow .25s;
}
.pill.round { width: 40px; padding: 0; flex: none; }
.btn { height: 48px; padding: 0 22px; font-size: 15px; }
.btn-primary { --lg-fill: linear-gradient(160deg, color-mix(in srgb, var(--accent) 88%, #fff), var(--accent)); color: var(--accent-ink); }
@media (hover: hover) {
  .pill:hover, .btn:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 var(--lg-spec), var(--lg-shadow-up); }
}
/* a short press answers at once */
.pill:active, .btn:active, .seg:active, .nav a:active { transform: scale(.97); transition-duration: .1s; }

/* chips are information, not buttons: flat, a thin line, no glass */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; line-height: 1.3; padding: 7px 14px; border-radius: 999px; }
.chip.lg {
  background: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
  border: 1px solid var(--line-strong);
}
.chip.lg::after { display: none; }
.chip b { font-weight: 600; }
.chips .chip { font-size: 13px; }

/* --------------------------------------------------------------- header */
.bar { position: sticky; top: 12px; z-index: 50; padding-inline: var(--gutter); margin-top: 12px; }
@supports (padding: max(0px)) {
  .bar { padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)); }
}
.bar-inner {
  max-width: var(--maxw); margin: 0 auto; display: flex; align-items: center; gap: 12px;
  padding: 7px 7px 7px 10px; border-radius: 999px;
  --lg-fill: var(--lbl-fill);
  view-transition-name: site-bar;   /* on the glass itself: on .bar it would stop the blur */
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 600 22px/1 var(--font-d); font-variant-numeric: lining-nums; white-space: nowrap; }
.brand-short { display: none; }
.mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font: 600 13px/1 var(--font-b); letter-spacing: .04em; }
.mark-sm { width: 26px; height: 26px; border-radius: 9px; font-size: 11px; }
.nav { display: flex; gap: 2px; margin-inline: auto; }
.nav a { padding: 9px 14px; border-radius: 999px; text-decoration: none; font-size: 15px; color: var(--muted); transition: background .2s, color .2s; }
.nav a:hover { color: var(--ink); background: var(--lg-bg); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--lg-strong); box-shadow: inset 0 -2px 0 var(--accent), inset 0 1px 0 var(--lg-spec); }
.nav .nav-cv { display: inline-flex; align-items: center; gap: 6px; }
.nav .nav-lang { display: none; }
.tools { display: flex; gap: 6px; margin-left: auto; }
.nav + .tools { margin-left: 0; }
.menu-btn { display: none; }
.cta { height: 40px; padding: 0 16px; font-size: 14px; white-space: nowrap; flex: none; }

/* ----------------------------------------------------------------- page */
.block { margin-top: clamp(64px, 9vw, 128px); }
.section-head { display: grid; gap: 12px; margin-bottom: 28px; max-width: 760px; }
.section-lead { color: var(--muted); font-size: 18px; max-width: 62ch; text-wrap: pretty; }
.more { margin-top: 28px; }
.lead-p { font: 500 clamp(24px, 2.4vw, 32px)/1.3 var(--font-d); font-variant-numeric: lining-nums; text-wrap: pretty; }

/* ----------------------------------------------------------------- hero
   Text left, the first project as proof on the right (it is the first card,
   so the grid below skips it on wide screens). */
.hero {
  padding-top: clamp(28px, 4vw, 56px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 64px); align-items: center;
}
.eyebrow { font-size: 13px; color: var(--ink); width: fit-content; text-wrap: balance; }
.eyebrow.chip { border-radius: var(--r-sm); }
.hero-h1 {
  margin-top: 16px; max-width: 15ch;
  font: 500 clamp(42px, 4.9vw, 74px)/.98 var(--font-d); font-variant-numeric: lining-nums; letter-spacing: -.025em;
}
.hero-roles { margin-top: 12px; font-size: 14px; letter-spacing: .02em; color: var(--muted); text-wrap: balance; }
.hero-lead { margin-top: 18px; max-width: 56ch; font: 400 clamp(16px, 1.25vw, 18px)/1.6 var(--font-b); color: var(--muted); text-wrap: pretty; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.hero-contact { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 14px; font-size: 15px; color: var(--muted); }
.hero-contact a { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.hero-contact a:hover { color: var(--ink); border-color: var(--accent); }
.hero-card { max-width: 520px; width: 100%; justify-self: end; }
.hero-card .card { transform: rotate(1.5deg); aspect-ratio: 1200 / 680; }
.hero-card .card-media img { object-position: center; transform: translate3d(calc(var(--px, 0) * -4px), calc(var(--py, 0) * -4px), 0); }
@media (hover: hover) { .hero-card .card:hover { transform: rotate(0deg) translateY(-6px); } }
.hero-card .card:active { transform: rotate(1.5deg) scale(.985); }
.work { margin-top: clamp(40px, 5vw, 64px); }
.work .section-head { margin-bottom: 16px; }

/* ----------------------------------------------------------- work cards */
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.card-li { min-width: 0; display: flex; flex-direction: column; }
.card-li.is-big { grid-column: span 2; grid-row: span 2; }
.card-li.is-wide { grid-column: span 2; }
.card {
  position: relative; display: block; aspect-ratio: 1; isolation: isolate; overflow: hidden;
  border-radius: var(--radius); text-decoration: none; background: var(--bg-2);
  border: 1px solid var(--lg-edge); box-shadow: var(--lg-shadow);
  transition: transform .5s var(--spring), box-shadow .5s var(--spring);
}
.card-li.is-big .card { height: 100%; flex: 1 1 auto; width: 100%; }
.card-li.is-wide .card { aspect-ratio: 2.05 / 1; width: 100%; }
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 2;
  box-shadow: inset 0 1px 0 var(--lg-spec), inset 0 0 0 1px rgba(255, 255, 255, .22);
}
.card-media { position: absolute; inset: 0; overflow: hidden; }
.card-media img {
  width: 100%; height: 100%; object-fit: cover; object-position: top center;
  transform: scale(1.08) translate3d(calc(var(--px, 0) * -12px), calc(var(--py, 0) * -12px), 0);
  transition: transform .7s var(--spring);
}
/* The label: title, the status under it (never cut), the description on hover or focus. */
.card-label {
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 1;
  display: grid; gap: 0; padding: 12px 16px; border-radius: 22px;
  --lg-fill: var(--lbl-fill);
}
.card-line { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.card-title { font: 600 22px/1.05 var(--font-d); font-variant-numeric: lining-nums; max-width: 100%; text-wrap: balance; }
.card-status { font: 600 11px/1.3 var(--font-b); letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); max-width: 100%; }
.card-sub {
  display: block; font-size: 14px; line-height: 1.4; color: var(--muted);
  max-height: 0; opacity: 0; overflow: hidden;
  transition: max-height .45s var(--spring), opacity .3s var(--ease), margin .45s var(--spring);
}
.card:hover .card-sub, .card:focus-visible .card-sub { max-height: 5.6em; opacity: 1; margin-top: 6px; }
.card-desc { display: none; margin: 10px 4px 0; font-size: 14px; line-height: 1.45; color: var(--muted); }
@media (hover: none) {
  .card-sub { display: none; }
  .card-desc { display: block; }
}
.is-big .card-label { left: 18px; right: auto; bottom: 18px; max-width: min(460px, calc(100% - 36px)); padding: 14px 20px; border-radius: var(--r-md); }
.is-big .card-title { font-size: clamp(28px, 2.6vw, 38px); font-weight: 500; letter-spacing: -.02em; }
.is-big .card-sub { font-size: 15px; }
/* the arrow points right: a card opens a page of this site */
.card-go {
  position: absolute; top: 14px; right: 14px; z-index: 1; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; background: var(--lbl-a); border: 1px solid var(--lg-edge);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  opacity: 0; transform: scale(.85); transition: opacity .3s, transform .4s var(--spring);
}
@media (hover: hover) {
  .card:hover { transform: translateY(-6px); box-shadow: var(--lg-shadow-up); }
  .card:hover .card-go { opacity: 1; transform: none; }
}
.card:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: var(--radius); }
.card:focus-visible .card-go { opacity: 1; transform: none; }
.card:active { transform: scale(.985); transition-duration: .1s; }

/* ---------------------------------------------------------------- stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.stat { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 24px 26px 22px; border-radius: var(--r-md); align-content: start; }
.stat-n { font: 500 clamp(46px, 5vw, 70px)/1.05 var(--font-d); font-variant-numeric: lining-nums; letter-spacing: -.02em; padding-bottom: 2px; }
.stat-l { color: var(--muted); font-size: 15px; line-height: 1.45; min-width: 0; overflow-wrap: anywhere; hyphens: auto; }
.stats-compact { margin-top: 14px; }
.stats-compact .stat { gap: 8px; padding: 18px 20px; border-radius: 20px; }
.stats-compact .stat-n { font-size: 34px; }

/* -------------------------------------------------- services, features
   Boxes on wide screens; on a phone (see the 640 px block) plain rows with a
   line. Numbers only where the order is real (journey, architecture). */
.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.svc { padding: 24px; border-radius: var(--r-md); display: grid; gap: 10px; align-content: start; }
.feats { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 14px; }
.feat { padding: 22px; border-radius: var(--r-md); display: grid; gap: 10px; align-content: start; transition: transform .4s var(--spring); }
@media (hover: hover) { .feat:hover { transform: translateY(-3px); } }
.svc p, .feat p, .step p, .arch-item p, .tl p { color: var(--muted); font-size: 15px; line-height: 1.55; }
.svc .chips { margin-top: auto; padding-top: 6px; }
.svc .chip { font-size: 12px; }
.mini-arch { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.mini-col { padding: 22px; border-radius: var(--r-md); display: grid; gap: 8px; align-content: start; }
.mini-col p { color: var(--muted); font-size: 15px; }
.mini-n {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; margin-right: 10px;
  background: var(--ink); color: var(--bg); font: 600 13px/1 var(--font-b);
}
.about-teaser { display: grid; grid-template-columns: minmax(0, 340px) 1fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
.frame { padding: 10px; border-radius: 34px; }
.frame img { border-radius: 25px; width: 100%; }

/* ------------------------------------------------------------ contact
   The address is the main button; copy and CV are second. */
.contact-card { padding: clamp(24px, 4.5vw, 56px); border-radius: var(--r-lg); }
.contact-links { display: grid; gap: 14px; margin-top: 8px; justify-items: start; }
.copy-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.contact-label { font: 600 12px/1.4 var(--font-b); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); min-width: 90px; }
.contact-value { font: 500 clamp(20px, 2vw, 26px)/1.25 var(--font-d); font-variant-numeric: lining-nums; overflow-wrap: anywhere; }
.contact-mail { height: auto; min-height: 48px; max-width: 100%; padding: 10px 20px; line-height: 1.25; overflow-wrap: anywhere; text-align: left; }
.copy-btn { height: 38px; padding: 0 14px; font-size: 14px; }
.refs { margin-top: 18px; font-size: 14px; color: var(--muted); }

/* ------------------------------------------------------------- project */
.p-hero { position: relative; padding: 14px var(--gutter) 0; }
.p-card {
  position: relative; overflow: hidden; isolation: isolate; max-width: 1480px; margin: 0 auto;
  height: min(78vh, 800px); min-height: 440px; border-radius: 40px;
  border: 1px solid var(--lg-edge); box-shadow: var(--lg-shadow-up); background: var(--bg-2);
  view-transition-name: card;
}
.p-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; view-transition-name: card-img; }
.p-shade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(20, 16, 12, .28)); }
/* kicker, title, then the status: the same order as on the card */
.p-head {
  position: absolute; left: clamp(14px, 2.4vw, 32px); bottom: clamp(14px, 2.4vw, 32px); z-index: 1;
  max-width: min(760px, calc(100% - 28px)); padding: clamp(16px, 1.8vw, 24px); border-radius: 30px;
  display: grid; gap: 8px; --lg-fill: var(--lbl-fill);
  view-transition-name: card-label;
}
.p-head .kicker { color: var(--muted); }
.p-title { font: 500 clamp(40px, 4.6vw, 68px)/.92 var(--font-d); font-variant-numeric: lining-nums; letter-spacing: -.025em; text-wrap: balance; }

/* Section index: "back to the work" first (it stays in view when the bar scrolls), then the sections. */
.p-index {
  position: sticky; top: 82px; z-index: 40; display: flex; align-items: center; gap: 2px;
  width: fit-content; max-width: calc(100% - 2 * var(--gutter)); margin: 18px auto 0; padding: 5px 6px;
  border-radius: 999px; overflow-x: auto; scrollbar-width: none;
  --lg-fill: var(--lbl-fill); border-color: var(--lg-edge);
  view-transition-name: p-index;
}
.p-index::-webkit-scrollbar { display: none; }
.p-index::after { display: none; }   /* the rim would scroll with the content */
.seg {
  flex: none; padding: 8px 14px; border-radius: 999px; text-decoration: none; font: 500 14px/1.2 var(--font-b);
  color: var(--muted); background: transparent; border: 0; cursor: pointer; transition: background .25s, color .25s;
}
.seg:hover { color: var(--ink); }
.seg.is-on, .seg[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.seg:focus-visible { outline-offset: -3px; }
.seg.is-on:focus-visible, .seg[aria-pressed="true"]:focus-visible { outline-color: var(--accent-ink); outline-offset: -5px; }
.p-back {
  position: sticky; left: -6px; z-index: 1; display: inline-flex; align-items: center; gap: 6px;   /* -6px: over the bar's own padding */
  color: var(--ink); font-weight: 600; padding-left: 10px; margin-right: 4px;
  background: var(--lbl-a); box-shadow: -10px 0 0 var(--lbl-a), 8px 0 8px -6px var(--lbl-a);   /* covers what scrolls under it */
}

.p-what { display: grid; gap: 22px; margin-top: clamp(48px, 7vw, 88px); }
.project h2 { font-size: clamp(32px, 3.4vw, 48px); }   /* one size for every section of a case */
.p-lead { font: 500 clamp(22px, 2vw, 30px)/1.38 var(--font-d); font-variant-numeric: lining-nums; max-width: 46ch; text-wrap: pretty; }
.meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 10px 0 0; max-width: 980px; }
.meta div { padding: 12px 18px; border-radius: 22px; }
/* one "label over value" style: 12 px, the same spacing everywhere */
.meta dt, .intro-grid dt, .doc-facts dt { font: 600 12px/1.4 var(--font-b); letter-spacing: .08em; text-transform: uppercase; }
.meta dt, .doc-facts dt { color: var(--muted); }
.meta dd { margin: 4px 0 0; font: 500 16px/1.4 var(--font-b); }
.intro-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 6px 0 0; }
.intro-grid div { padding: 20px 22px; border-radius: 24px; display: grid; gap: 8px; align-content: start; }
.intro-grid dt { color: var(--accent-text); }
.intro-grid dd { margin: 0; font-size: 16px; line-height: 1.55; }
/* "Result" reads like its neighbours; a blue line marks it */
.intro-grid .is-result::before {
  content: ""; position: absolute; left: 0; top: 20px; bottom: 20px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--accent);
}
.res-lines { display: grid; gap: 8px; }
.p-links { margin-top: 2px; }
.products, .cases { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.product, .case { padding: 24px; border-radius: 30px; display: grid; gap: 14px; align-content: start; }
.product-d { color: var(--muted); }
/* the status of a product or a site looks like the status on a card */
.product > p.chip, .case-body > p.chip {
  justify-self: start; width: fit-content; padding: 0; border: 0; border-radius: 0; background: none;
  font: 600 12px/1.3 var(--font-b); letter-spacing: .07em; text-transform: uppercase; color: var(--accent-text);
}
.dots { display: grid; gap: 10px; }
.dots li { position: relative; padding-left: 18px; font-size: 15px; line-height: 1.5; }
.dots li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-text); }
.case { padding: 12px 12px 22px; }
.case-body { display: grid; gap: 10px; padding: 0 10px; }
.case-body .btn { width: fit-content; margin-top: 4px; }
.case h3 a { text-decoration: none; }

.g-strip {
  display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter);
  padding: 6px var(--gutter) 24px; scrollbar-width: thin;
}
.g-item { flex: none; scroll-snap-align: start; padding: 8px; border-radius: 28px; max-width: 86vw; }
.g-item img { height: clamp(220px, 34vw, 380px); width: auto; max-width: calc(86vw - 16px); object-fit: cover; border-radius: 21px; }
.g-item figcaption { font-size: 13px; color: var(--muted); padding: 10px 8px 4px; max-width: 46ch; }

.story { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(20px, 4vw, 64px); }
.story-body { display: grid; gap: 14px; color: var(--muted); font-size: 18px; }
.layers { display: grid; gap: 8px; counter-reset: l; margin-top: 6px; }
.layers li { counter-increment: l; padding: 12px 16px 12px 52px; border-radius: var(--r-sm); color: var(--ink); font-size: 16px; }
.layers li::before { content: counter(l); position: absolute; left: 14px; top: 12px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 9px; background: var(--ink); color: var(--bg); font: 600 12px/1 var(--font-b); }
.stack-row { display: grid; gap: 16px; }
.links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.next {
  display: grid; grid-template-columns: 112px 1fr auto; gap: 20px; align-items: center;
  padding: 10px 22px 10px 10px; border-radius: 32px; text-decoration: none; transition: transform .5s var(--spring);
}
.next-media img { width: 112px; height: 112px; object-fit: cover; border-radius: 24px; }
.next-text { display: grid; gap: 4px; }
.next-title { font: 500 clamp(30px, 3.2vw, 44px)/1.02 var(--font-d); font-variant-numeric: lining-nums; text-wrap: balance; }
.next-go { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--bg); }
@media (hover: hover) { .next:hover { transform: translateY(-4px); } }
.next:active { transform: scale(.985); transition-duration: .1s; }

/* mock ups for client sites */
.mock { border-radius: 22px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--bg-2); }
.mock-phone { display: grid; place-items: center; background: linear-gradient(160deg, var(--m3), var(--m1)); }
.mock-phone img { height: 90%; width: auto; border-radius: 18px; border: 4px solid #1d1b18; object-fit: cover; object-position: top; }
.mock-browser { display: grid; grid-template-rows: 28px 1fr; border: 1px solid var(--line); }
.mk-bar { display: flex; align-items: center; gap: 6px; padding: 0 10px; background: rgba(127, 127, 127, .14); }
.mk-bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(127, 127, 127, .45); }
.mk-url { margin-left: 10px; height: 12px; flex: 1; max-width: 50%; border-radius: 6px; background: rgba(127, 127, 127, .22); }
.mk-body { padding: 14px; display: grid; gap: 12px; align-content: start; }
.mk-nav { display: flex; gap: 8px; align-items: center; }
.mk-nav span { height: 8px; width: 34px; border-radius: 4px; background: rgba(127, 127, 127, .35); }
.mk-nav .mk-logo { width: 22px; height: 22px; border-radius: 6px; margin-right: auto; }
.mk-nav .mk-logo.round { border-radius: 50%; }
.mk-nav .mk-cta { width: 56px; height: 18px; border-radius: 9px; }
.mk-hero { display: grid; gap: 8px; padding: 14px 0; }
.mk-h { height: 16px; width: 80%; border-radius: 6px; background: rgba(127, 127, 127, .45); }
.mk-h.short { width: 55%; }
.mk-btn { width: 90px; height: 22px; border-radius: 11px; margin-top: 6px; }
.mk-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mk-cards span { height: 48px; border-radius: 8px; background: rgba(127, 127, 127, .2); }
.mock-clinic .mk-body { background: linear-gradient(180deg, #e9f3f1, #f8fbfa); }
.mock-clinic .mk-logo, .mock-clinic .mk-cta, .mock-clinic .mk-btn { background: #1f7a6d; }
.mock-clinic .mk-h { background: #23413c; opacity: .75; }
.mock-clinic .mk-cards span { background: #cfe5e0; }
.mock-artist .mk-body { background: #f4f1ea; }
.mock-artist .mk-logo { background: #1b1b1b; }
.mk-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mk-gallery span { aspect-ratio: 4 / 5; border-radius: 4px; }
.mk-gallery .a1 { background: linear-gradient(135deg, #d9643a, #f2c14e); }
.mk-gallery .a2 { background: linear-gradient(160deg, #20415c, #6aa6b8); }
.mk-gallery .a3 { background: linear-gradient(120deg, #2c2c2c, #b9b2a5); }
.mk-gallery .a4 { background: linear-gradient(200deg, #6b8f71, #e8e1c8); }
.mk-gallery .a5 { background: linear-gradient(140deg, #8c2f39, #e7a977); }
.mk-gallery .a6 { background: linear-gradient(170deg, #3b3355, #c9b8d8); }

/* ------------------------------------------------- carousel glass stacks */
.cs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 36px 26px; }
.cs-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cstack { display: grid; gap: 14px; min-width: 0; overflow: clip; overflow-clip-margin: 24px; }
.cstack[hidden] { display: none; }
/* "Show more": eight stacks on wide screens, four up to tablets */
.js .cs-grid.is-limited .cstack.x8 { display: none; }
@media (max-width: 1000px) { .js .cs-grid.is-limited .cstack.x4 { display: none; } }
/* No JS: a plain scroll-snap track. */
.cs-deck { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: 24px; }
.cs-deck:focus-visible { outline-offset: 6px; border-radius: 24px; }
.cs-fig { flex: 0 0 100%; scroll-snap-align: start; border-radius: 24px; overflow: hidden; border: 1px solid var(--lg-edge); }
.cs-fig img { width: 100%; height: 100%; object-fit: cover; }
/* With JS: slides pile up as a glass stack, the top one turns away. It can be
   dragged with a finger or a mouse, so no image drag, selection or iOS menu. */
.js .cs-deck {
  display: block; position: relative; aspect-ratio: 4 / 5; overflow: visible; margin: 18px 18px 0 0;
  touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.js .cs-fig {
  position: absolute; inset: 0; box-shadow: var(--lg-shadow); background: linear-gradient(160deg, var(--bg-2), var(--line));
  opacity: 0; transform: translate3d(22px, -22px, 0) scale(.88); pointer-events: none;
  transition: transform .8s var(--spring), opacity .6s var(--ease);
}
.js .cs-fig img { -webkit-user-drag: none; }
.js .cs-fig:not([data-pos]):nth-child(1), .js .cs-fig[data-pos="0"] { opacity: 1; transform: none; z-index: 3; pointer-events: auto; }
.js .cs-fig:not([data-pos]):nth-child(2), .js .cs-fig[data-pos="1"] { opacity: .9; transform: translate3d(9px, -9px, 0) scale(.96) rotate(1.6deg); z-index: 2; }
.js .cs-fig:not([data-pos]):nth-child(3), .js .cs-fig[data-pos="2"] { opacity: .6; transform: translate3d(18px, -18px, 0) scale(.92) rotate(3.2deg); z-index: 1; }
.js .cs-fig[data-pos="out"] {
  opacity: 0; transform: translate3d(-14%, 4%, 0) rotate(-6deg) scale(.96); z-index: 4;
  transition: transform .8s var(--spring), opacity .35s var(--ease);
}
/* focus ring inside the top slide: an outline outside would be clipped (Safari has no overflow-clip-margin) */
.js .cs-deck:focus-visible { outline: none; }
.js .cs-deck:focus-visible .cs-fig[data-pos="0"],
.js .cs-deck:focus-visible .cs-fig:not([data-pos]):first-child { outline: 3px solid var(--accent); outline-offset: -3px; }
@media (hover: hover) and (pointer: fine) { .js .cs-deck { cursor: grab; } .js .cs-deck:active { cursor: grabbing; } }
.cs-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 10px 10px 16px; border-radius: 22px; }
.cs-meta { min-width: 0; }
.cs-meta h3 { font-size: 15px; line-height: 1.25; }
.cs-en { font-size: 12px; color: var(--muted); font-style: italic; margin-top: 2px; }
.tag { font-size: 12px; color: var(--muted); margin-top: 2px; }
.cs-ctrl { display: flex; align-items: center; gap: 4px; flex: none; }
.cs-ctrl .pill { width: 34px; height: 34px; }
.cs-count { font: 500 12px/1 var(--font-b); font-variant-numeric: tabular-nums; color: var(--muted); min-width: 38px; text-align: center; }
html:not(.js) .cs-ctrl { display: none; }
/* filters and the Pause button share one row */
.cs-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 30px; }
.cs-tools:empty { display: none; }
.cs-pause[hidden], .cs-more[hidden] { display: none; }
.cs-pause .i-play, .cs-pause.is-paused .i-pause { display: none; }
.cs-pause.is-paused .i-play { display: inline-flex; }
.cs-pause > span { display: inline-flex; }
.filters { display: flex; width: fit-content; max-width: 100%; gap: 2px; padding: 5px; border-radius: 999px; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
html:not(.js) .filters { display: none; }

/* ------------------------------------------------------------ marketing */
.jump-wrap { margin-top: clamp(28px, 4vw, 44px); }
.jump { display: flex; flex-wrap: wrap; gap: 8px; }
.jump .seg { color: var(--ink); border: 1px solid var(--line-strong); }
.jump .seg:hover { border-color: var(--ink); }
.vids { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px; align-items: start; }
.vframe { padding: 8px; border-radius: 30px; }
.vframe video, .vframe img { width: 100%; border-radius: 23px; background: #000; }
.vframe img { background: none; }
.vframe figcaption { font-size: 14px; padding: 10px 8px 4px; color: var(--muted); }
.lang-note { margin: -12px 0 24px; font-size: 14px; color: var(--muted); }

.page-hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr); gap: clamp(28px, 5vw, 80px); align-items: center; padding-top: clamp(48px, 8vw, 110px); }
.ph-art { transform: rotate(2.5deg); max-width: 420px; justify-self: end; view-transition-name: card; }
.ph-art img { view-transition-name: card-img; }
/* Engineering: the architecture diagram is proof, so it gets the full width and opens full size. */
.page-hero.is-wide { grid-template-columns: 1fr; }
.page-hero.is-wide .ph-art { max-width: none; justify-self: stretch; transform: none; padding: 8px; }
.page-hero.is-wide .ph-art img { border-radius: var(--r-md); }
.ph-zoom { position: relative; display: block; }
.zoom-badge {
  position: absolute; right: 12px; bottom: 12px; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; color: var(--ink); background: var(--lbl-a);
  border: 1px solid var(--lg-edge); box-shadow: var(--lg-shadow);
}

/* --------------------------------------------------------- engineering */
.arch { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.arch-col { padding: 20px; border-radius: 28px; display: grid; gap: 14px; align-content: start; }
.arch-h { display: flex; align-items: center; font-size: 18px; }
.arch-col ul { display: grid; gap: 8px; }
.arch-item { padding: 14px 16px; border-radius: var(--r-sm); background: var(--lg-bg); border: 1px solid var(--lg-edge); }
.arch-item h4 { font-size: 15px; margin-bottom: 4px; }
.arch-item p { font-size: 14px; }
.selfcheck { margin-top: 14px; padding: 18px 22px; border-radius: 22px; color: var(--muted); }
.journey { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.step { padding: 22px; border-radius: var(--r-md); display: grid; gap: 8px; align-content: start; }
.step p.kicker { font-size: 12px; line-height: 1.4; color: var(--accent-text); }
.stack-split { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 16px; align-items: start; }
.bring { padding: 26px; border-radius: 28px; display: grid; gap: 12px; }
.bring h3 { font: 500 30px/1.05 var(--font-d); font-variant-numeric: lining-nums; letter-spacing: -.01em; }
.bring p { color: var(--muted); font-size: 15px; }
.table-wrap { overflow-x: auto; border-radius: var(--r-md); padding: 6px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 13px 16px; border-bottom: 1px solid var(--line); }
thead th { font: 600 12px/1.4 var(--font-b); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
tbody th { font-weight: 600; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }

/* --------------------------------------------------------------- about */
.toolbox { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.tool { padding: 24px; border-radius: var(--r-md); display: grid; gap: 14px; align-content: start; }
.tool h3 { font-size: 18px; }
.about-body { display: grid; gap: 4px; min-width: 0; }
.about-body .stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 18px 0; }
.about-body .stat { padding: 16px 18px; border-radius: 20px; }
.about-body .stat-n { font-size: clamp(28px, 3vw, 38px); }
.about-hero { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(28px, 5vw, 80px); align-items: start; padding-top: clamp(40px, 6vw, 90px); }
.about-text { display: grid; gap: 18px; }
.about-text .hero-h1 { margin-top: 4px; font-size: clamp(48px, 6.4vw, 96px); }
.about-text .links { margin-top: 0; }
.about-p { color: var(--muted); font-size: 18px; max-width: 60ch; text-wrap: pretty; }
.frame.big { transform: rotate(-1.5deg); }
.timeline { display: grid; gap: 12px; }
.tl { padding: 18px 22px; border-radius: 24px; display: grid; gap: 4px; }
.tl-period { font: 600 12px/1.4 var(--font-b); letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); }
.tl-org { color: var(--muted); }

.nf { padding-top: clamp(56px, 10vw, 140px); }
.nf-card { padding: clamp(24px, 5vw, 64px); border-radius: 40px; display: grid; gap: 16px; max-width: 860px; }

/* ------------------------------------------------------- documentation */
.doc-hero { padding-top: clamp(40px, 6vw, 84px); }
.doc-hero h1 { margin-top: 12px; font-size: clamp(46px, 7vw, 96px); line-height: 1; overflow-wrap: anywhere; }
.doc-lead { margin-top: 18px; max-width: 56ch; font-size: 19px; color: var(--muted); text-wrap: pretty; }
.doc-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.doc-block { margin-top: clamp(36px, 5vw, 72px); }
.doc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.doc-card { display: grid; gap: 12px; align-content: start; padding: 26px; border-radius: var(--r-md); }
.doc-card h2 { font-size: 40px; margin: 0; }
.doc-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 18px; margin: 0; padding: 24px; border-radius: var(--r-md); }
.doc-facts dd { margin: 6px 0 0; }
.doc-shot { margin: 16px 0 0; padding: 8px; border-radius: var(--r-md); }
.doc-shot img { display: block; width: 100%; height: auto; border-radius: 19px; }
.doc-grid { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); align-items: start; }
.doc-toc { position: sticky; top: 100px; padding: 20px; border-radius: 22px; }
.doc-toc ul { margin: 10px 0 0; }
.doc-toc a { display: block; padding: 7px 0; text-decoration: none; }
.doc-toc a:hover { text-decoration: underline; }
.doc-main { max-width: 68ch; }
.doc-sec { display: grid; gap: 14px; margin-bottom: 52px; }
.doc-sec h2 { margin: 0; font-size: clamp(30px, 3.4vw, 44px); line-height: 1.1; }
.doc-steps, .doc-list { display: grid; gap: 9px; margin: 0; padding-left: 22px; }
.doc-steps { list-style: decimal; }
.doc-list { list-style: disc; }
.doc-steps li, .doc-list li { overflow-wrap: anywhere; }
.doc-list li::marker, .doc-steps li::marker { color: var(--accent-text); }
.doc-checked { font-size: 14px; }

/* -------------------------------------------------------------- footer */
.foot { margin-top: clamp(80px, 10vw, 140px); }
.foot-inner { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; justify-content: space-between; padding-top: 28px; padding-bottom: 44px; border-top: 1px solid var(--line); font-size: 14px; }
.foot-brand { display: inline-flex; align-items: center; gap: 10px; font: 600 19px/1 var(--font-d); }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* expand fallback (FLIP clone) */
.expand-clone { position: fixed; z-index: 90; margin: 0; object-fit: cover; transform-origin: 0 0; pointer-events: none; border-radius: var(--radius); box-shadow: var(--lg-shadow-up); }

/* ============================================================== widths */
@media (min-width: 1001px) {
  /* the hero already shows the first project: the grid starts with the second */
  .cards > .card-li:first-child { display: none; }
  .card-li:not(.is-big):not(.is-wide) .card-label { left: 8px; right: 8px; bottom: 8px; padding: 10px 12px 11px; border-radius: var(--r-sm); }
  .card-li:not(.is-big):not(.is-wide) .card-title { font-size: 21px; }
  .card-li:not(.is-big):not(.is-wide) .card-status { letter-spacing: .04em; }
  /* five items: three and two, not five narrow columns */
  .services:not(.cols-4), .feats.cols-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1181px) {
  .services.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 861px) and (max-width: 1180px) {
  .brand-name { display: none; }
  .nav a { padding-inline: 10px; white-space: nowrap; }
}
@media (max-width: 1180px) and (min-width: 641px) {
  .services.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 901px) {
  .selfcheck { padding-right: max(22px, calc(100% - 62ch)); }   /* about 80 characters a line */
  .products { align-items: start; }
  .product .stats-compact { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; }
  .product .stats-compact .stat { padding: 14px 16px; }
}
@media (max-width: 1100px) {
  .arch { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; }
  .hero-card { display: none; }   /* the grid right below starts with the same project */
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-li.is-big { grid-row: auto; }
  .card-li.is-big .card { height: auto; aspect-ratio: 16 / 10; }
  .services:not(.cols-4), .feats.cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* project cover on an upright tablet: 4:3, so the wide picture is not cut */
@media (min-width: 641px) and (max-width: 1100px) and (orientation: portrait) {
  .p-card { height: auto; min-height: 0; aspect-ratio: 4 / 3; }
}
@media (min-width: 641px) and (max-height: 500px) { .p-card { min-height: 0; } }
@media (max-width: 900px) {
  /* the menu opens from its button; hidden from Tab and readers while closed */
  .js .nav {
    position: absolute; top: calc(100% + 8px); left: var(--gutter); right: var(--gutter);
    display: flex; flex-direction: column; padding: 8px; border-radius: var(--r-md); margin: 0;
    background: var(--bg-2); border: 1px solid var(--lg-edge); box-shadow: var(--lg-shadow-up);
    visibility: hidden; opacity: 0; pointer-events: none;
    transform: translateY(-6px) scale(.96); transform-origin: top right;
    transition: opacity .2s var(--ease), transform .26s var(--spring), visibility 0s linear .26s;
  }
  .js .nav.is-open {
    visibility: visible; opacity: 1; pointer-events: auto; transform: none;
    transition: opacity .2s var(--ease), transform .26s var(--spring), visibility 0s;
  }
  .js .nav a { padding: 13px 16px; font-size: 17px; color: var(--ink); }
  .js .menu-btn { display: inline-flex; }
  .js .nav + .tools { margin-left: auto; }
  html:not(.js) .bar-inner { flex-wrap: wrap; border-radius: 28px; }
  html:not(.js) .nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .page-hero, .about-hero, .about-teaser, .story, .intro-grid, .stack-split { grid-template-columns: 1fr; }
  .ph-art { justify-self: start; max-width: 300px; }
  .frame.big { max-width: 380px; }
  .about-teaser .frame { max-width: 320px; }
  .meta { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .doc-grid { grid-template-columns: minmax(0, 1fr); }
  .doc-toc { position: static; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  h2, .project h2, .doc-sec h2 { font-size: 32px; line-height: 1.1; }   /* a clear step under the H1 */
  .brand-name { display: none; }
  .hero-h1 { font-size: clamp(40px, 11vw, 52px); }
  .hero-roles { line-height: 1.45; }
  .hero-cta .btn { flex: 1 1 auto; min-height: 48px; }

  .cards { grid-template-columns: 1fr; gap: 16px; }
  .card-li.is-big, .card-li.is-wide { grid-column: auto; }
  .card, .card-li.is-big .card, .card-li.is-wide .card { aspect-ratio: 4 / 3; }   /* a shorter page, the label still reads */
  .card-label, .is-big .card-label {
    left: 12px; right: auto; bottom: 12px; max-width: calc(100% - 24px);
    padding: 10px 14px 11px; border-radius: var(--r-sm);
  }
  .card-label .card-sub { contain: inline-size; }   /* the hidden description does not widen the label */
  .card-status { font-size: 12px; letter-spacing: .07em; }
  .card-go { opacity: 1; transform: none; }

  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 16px 16px 14px; gap: 8px; border-radius: 22px; }
  .stat-n { font-size: 38px; }
  .stats-compact .stat-n { font-size: 30px; }
  /* an odd last number: number and label side by side on a full row */
  .stats > .stat:last-child:nth-child(odd) { grid-column: 1 / -1; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 16px; }

  /* long lists: rows with a line instead of boxes */
  .rows { gap: 0; border-bottom: 1px solid var(--line-strong); }
  .rows > li {
    padding: 18px 0 20px; border: 0; border-top: 1px solid var(--line-strong); border-radius: 0;
    background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .rows > li::after { display: none; }
  .feats.rows { margin-top: 6px; }
  /* the tags under "What I do" as one grey line */
  .rows .chips { display: block; padding-top: 2px; }
  .rows .chip { display: inline; padding: 0; border: 0; font-size: 14px; color: var(--muted); }
  .rows .chip + .chip::before { content: " · "; white-space: pre; }

  /* project */
  .p-hero { padding-top: 10px; }
  .p-card { height: auto; min-height: 0; display: flex; flex-direction: column; background: var(--bg-2); border-radius: 30px; }
  .p-img { position: relative; inset: auto; height: auto; aspect-ratio: 16 / 10; object-position: left top; }
  .p-shade { display: none; }
  .p-head {   /* one frame: status and title right under the picture */
    position: relative; left: auto; bottom: auto; max-width: none; margin: 0; padding: 18px 18px 20px;
    border: 0; border-radius: 0; box-shadow: none; background: none; -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .p-head::after { display: none; }
  .p-title { font-size: clamp(40px, 12vw, 54px); }
  .p-index { top: 72px; margin-inline: var(--gutter); }   /* right under the bar, no gap */
  .p-lead { font-size: 21px; line-height: 1.4; }
  /* role and result before the long introduction */
  .p-what > h2 { order: -2; }
  .p-what > .intro-grid { order: -1; }
  .next { grid-template-columns: 76px 1fr; padding-right: 14px; }
  .next-media img { width: 76px; height: 76px; border-radius: var(--r-sm); }
  .next-go { display: none; }
  /* the gallery shows the whole picture; tall ones stop at 380 px */
  .g-strip { align-items: flex-start; }
  .g-item img { width: auto; height: auto; max-width: calc(86vw - 16px); max-height: 380px; object-fit: contain; }
  .product .stats-compact { grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)); }
  .product .stats-compact .stat {   /* numbers without boxes inside the box */
    background: none; box-shadow: none; border: 0; border-radius: 0;
    border-top: 1px solid var(--line-strong); padding: 12px 0 4px;
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .product .stats-compact .stat::after { display: none; }
  .product .stats-compact > .stat:last-child:nth-child(odd) { grid-column: auto; grid-template-columns: minmax(0, 1fr); align-items: start; column-gap: 0; }

  /* carousels and video */
  .cs-grid, .cs-grid-4 { grid-template-columns: 1fr; gap: 30px; }
  .vids { grid-template-columns: 1fr 1fr; gap: 12px; }
  .vframe { padding: 6px; border-radius: 22px; }
  .vframe video, .vframe img { border-radius: 17px; }
  .filters { flex-wrap: wrap; border-radius: var(--r-md); width: 100%; }
  .ph-art { max-width: 240px; }
  .page-hero.is-wide .ph-art { max-width: none; }
  .is-marketing .page-hero .ph-art { display: none; }   /* the first screen is the text and the work */

  /* engineering: rows inside the column cards, not boxes in boxes */
  .arch { grid-template-columns: 1fr; }
  .arch-col { padding: 16px; gap: 10px; }
  .arch-col ul { gap: 0; }
  .arch-item { background: none; border: 0; border-radius: 0; padding: 12px 0; border-top: 1px solid var(--line-strong); }
  .arch-item:first-child { border-top: 0; padding-top: 4px; }
  .arch-item h4 { font-size: 16px; font-weight: 600; }
  .table-wrap { padding: 0; background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; overflow: visible; }
  .table-wrap::after { display: none; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap th, .table-wrap td { display: block; }
  .table-wrap thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table-wrap tr {
    margin-bottom: 12px; padding: 14px 18px; border-radius: 22px; border: 1px solid var(--lg-edge);
    background: linear-gradient(150deg, var(--lg-bg), var(--lg-bg-2));
    -webkit-backdrop-filter: blur(24px) saturate(1.8); backdrop-filter: blur(24px) saturate(1.8);
  }
  .table-wrap th, .table-wrap td { padding: 6px 0; border: 0; }
  .table-wrap td::before { content: attr(data-label); display: block; font: 600 11px/1.4 var(--font-b); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

  /* about: a lower photo without tilt, so the name, the H1 and the start of the text show */
  .about-hero .frame.big { transform: none; max-width: none; }
  .about-hero .frame.big img { aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 24%; }
  .services.cols-4, .services.cols-5, .services:not(.cols-4), .feats.cols-5 { grid-template-columns: minmax(0, 1fr); }

  /* contact and footer */
  .copy-row { gap: 6px 12px; }
  .contact-label { min-width: 0; flex-basis: 100%; }
  .foot-inner { flex-direction: column; align-items: flex-start; gap: 4px; }
  .foot-links { gap: 0 20px; }

  /* docs */
  .doc-card h2 { font-size: 28px; }
  .doc-links { display: grid; grid-template-columns: minmax(0, 1fr); }

  /* text at least 16 px; small uppercase labels and captions stay smaller on purpose */
  .card-desc, .stat-l, .svc p, .feat p, .step p, .arch-item p, .tl p, .tl-org, .mini-col p,
  .product-d, .story-body, .about-p, .section-lead, .bring p, .selfcheck, .intro-grid dd, .dots li,
  table, .table-wrap td, .table-wrap th, .muted, .hero-roles, .lang-note, .hero-contact, .cs-meta h3 { font-size: 16px; }
  .vframe figcaption, .g-item figcaption, .refs, .foot-inner { font-size: 15px; }
  .chip, .chips .chip, .eyebrow { font-size: 14px; }
  .cs-en, .tag { font-size: 13px; }
}
/* "Status" and "Period" of a project side by side on a phone */
@media (min-width: 341px) and (max-width: 640px) {
  .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .meta > div { box-shadow: none; padding: 14px 16px; }
  .meta > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
/* the two hero buttons side by side from 380 px, so the work starts higher */
@media (min-width: 380px) and (max-width: 640px) {
  .hero-cta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .hero-cta .btn { padding: 0 10px; gap: 6px; white-space: nowrap; min-width: 0; }
}
/* the first name next to RN where the bar has room */
@media (min-width: 420px) and (max-width: 640px) {
  .brand-short { display: inline; font-size: 20px; }
  .brand { gap: 8px; }
}
@media (max-width: 380px) {
  .vids { grid-template-columns: 1fr; }
  .cta { padding: 0 12px; font-size: 13px; }
}
@media (max-width: 360px) {
  .bar-inner { gap: 6px; padding-left: 6px; }
  .tools { gap: 4px; }
  .cta { padding: 0 10px; }
}
/* under 353 px the language button leaves the bar and is a row in the menu */
@media (max-width: 352px) {
  .lang { display: none; }
  .js .nav .nav-lang { display: block; }
}
/* low screens (phone on its side, big zoom): the bars do not stick */
@media (max-height: 500px) {
  .bar { position: relative; top: 0; }
  .p-index { position: static; }
  body::after { display: none; }
}

/* =============================================================== input */
/* Touch screens and narrow windows: every tap target at least 44 px. */
@media (pointer: coarse), (max-width: 640px) {
  .pill, .btn { min-height: 44px; }
  .pill.round, .cs-ctrl .pill { width: 44px; height: 44px; }
  .bar-inner { padding: 6px 6px 6px 8px; }
  .brand { min-height: 44px; }
  .mark { width: 44px; height: 44px; border-radius: 14px; font-size: 14px; }
  .seg { min-height: 44px; padding: 12px 16px; }
  .p-index { padding: 4px 6px; }
  .hero-contact a { min-height: 44px; }
  .foot-links a, .foot-inner a { display: inline-flex; align-items: center; min-height: 44px; }
  .contact-value { display: inline-flex; align-items: center; min-height: 44px; }
  .copy-btn { height: 44px; }
  .case h3 a, .links a { min-height: 44px; display: inline-flex; align-items: center; }
}

/* ========================================================= preferences */
@media (prefers-reduced-transparency: reduce) {
  .lg, .pill, .btn, .card-go, .table-wrap tr { -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  .lg, .pill, .btn { border-color: var(--ink); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .lg::after, .pill::after, .btn::after { display: none; }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  body::after { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
/* Reduced motion: nothing moves, things only fade. */
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  html { scroll-behavior: auto; }
  .mesh i { animation: none; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .card-media img { transform: scale(1.04); }
  .card:hover, .next:hover, .feat:hover { transform: none; }
  .hero-card .card:hover { transform: rotate(1.5deg); }
  /* instead of shrinking on press: a short dim */
  .pill:active, .btn:active, .seg:active, .nav a:active, .next:active, .card:active { transform: none; opacity: .7; }
  .hero-card .card:active { transform: rotate(1.5deg); }
  /* the menu fades; visibility switches at once so the first link can take focus */
  .js .nav, .js .nav.is-open { transform: none; }
  .js .nav { transition: opacity .2s ease, visibility 0s linear .2s !important; }
  .js .nav.is-open { transition: opacity .2s ease !important; }
  /* slides fade in place */
  .js .cs-fig, .js .cs-fig[data-pos="out"] { transition: opacity .2s ease !important; }
  .js .cs-fig[data-pos="out"], .js .cs-fig[data-pos="rest"] { transform: none !important; }
  body::after { transition: none; }
}
