/* ===========================================================================
   tkhnv.com design system
   One stylesheet for every page. Page-specific styles live in
   /assets/css/pages/<slug>.css and are listed in the page front matter.
   Documentation with HTML snippets: docs/SYSTEM.md, live showcase: /en/_system/

   Contents
   1  Fonts
   2  Tokens
   3  Base
   4  Typography      .t-display .t-h1 .t-h2 .t-h3 .t-lead .t-body .t-body-sm .t-caption .t-meta .t-section .t-hero-sub
   5  Layout          .container .section .case-grid .case-text .case-aside
   6  Buttons         .btn
   7  Tags            .tag
   8  Header          .site-header .site-nav .site-lang
   9  Footer          .site-footer
   10 Plates & media  .plate .media .frame .caption
   11 Slider, pair, bento
   12 Cards           .outcomes/.outcome .stat .case-card .next-case
   13 Case parts      .case-intro .case-meta .case-toc .case-hero
   14 Home parts      .hero .cv-row .popover
   15 Motion          .reveal, reduced motion
   =========================================================================== */

/* ---------- 1. Fonts (self-hosted Inter, subsets split by unicode-range) ---------- */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/inter-500-cyrillic-ext.woff2") format("woff2"); unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/inter-500-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/inter-500-greek-ext.woff2") format("woff2"); unicode-range: U+1F00-1FFF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/inter-500-greek.woff2") format("woff2"); unicode-range: U+0370-03FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/inter-500-latin-ext.woff2") format("woff2"); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/inter-500-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2070, U+2074-207E, U+2080-208E, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/inter-500-vietnamese.woff2") format("woff2"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/inter-400-cyrillic-ext.woff2") format("woff2"); unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/inter-400-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/inter-400-greek-ext.woff2") format("woff2"); unicode-range: U+1F00-1FFF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/inter-400-greek.woff2") format("woff2"); unicode-range: U+0370-03FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/inter-400-latin-ext.woff2") format("woff2"); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/inter-400-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2070, U+2074-207E, U+2080-208E, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/inter-400-vietnamese.woff2") format("woff2"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 900; font-display: swap; src: url("../fonts/inter-900-cyrillic-ext.woff2") format("woff2"); unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 900; font-display: swap; src: url("../fonts/inter-900-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 900; font-display: swap; src: url("../fonts/inter-900-greek-ext.woff2") format("woff2"); unicode-range: U+1F00-1FFF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 900; font-display: swap; src: url("../fonts/inter-900-greek.woff2") format("woff2"); unicode-range: U+0370-03FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 900; font-display: swap; src: url("../fonts/inter-900-latin-ext.woff2") format("woff2"); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 900; font-display: swap; src: url("../fonts/inter-900-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2070, U+2074-207E, U+2080-208E, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 900; font-display: swap; src: url("../fonts/inter-900-vietnamese.woff2") format("woff2"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB; }

/* ---------- 2. Tokens ----------
   Breakpoints (media queries cannot use variables, so they are repeated):
     mobile  < 810px      tablet 810-1199px      desktop >= 1200px */
:root {
  /* colour */
  --color-text: rgb(33, 33, 33);          /* #212121 headings, primary */
  --color-text-body: rgb(102, 102, 102);  /* #666 long text */
  --color-text-muted: #6f6f6f;            /* secondary, meta (AA on white and plate) */
  --color-bg: #fff;
  --color-plate: #f7f7f7;                 /* muted plate */
  --color-plate-hover: #f0f0f0;
  --color-border: rgba(0, 0, 0, .08);
  --color-focus: #674ff1;
  --color-on-dark: #fff;

  /* type */
  --font: "Inter", "Helvetica Neue", Arial, sans-serif;
  --fw: 500;                              /* everything is 500; 400 only for .t-section, 900 only for .btn--lg */
  --ls-heading: -0.04em;

  /* radii */
  --radius-plate: 24px;                   /* <810 */
  --radius-card: 24px;
  --radius-xl: 32px;                      /* plate >= 810, hero bento plate */
  --radius-pill: 999px;

  /* spacing */
  --pad: 24px;                            /* container side padding (legacy home: 24px on mobile) */
  --gap: 8px;                             /* grids, pairs, sliders */
  --gap-lg: 24px;                         /* home bento / screen strips on desktop */
  --section-gap: 64px;                    /* 64 mobile / 96 tablet / 150 desktop (home rhythm) */
  --header-h: 56px;

  /* type scale (mobile first, re-set in media queries below) */
  --fs-display: 46px;  --lh-display: 48px;
  --fs-h1: 28px;       --lh-h1: 32px;
  --fs-h2: 24px;       --lh-h2: 30px;
  --fs-h3: 19px;       --lh-h3: 25px;
  --fs-lead: 18px;
  --fs-section: 40px;  --lh-section: 48px;
  --fs-hero-sub: 24px; --lh-hero-sub: 26.4px;

  --plate-radius: var(--radius-plate);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --container: 1184px;                    /* home content width: 128px side offset at 1440 (token max 1200) */
  --case-text-w: 720px;
  --case-aside-w: 280px;
}
@media (min-width: 810px) {
  :root {
    --pad: 40px;
    --section-gap: 96px;
    --header-h: 64px;
    --plate-radius: var(--radius-xl);
    --fs-display: 52px; --lh-display: 57.2px;
    --fs-h1: 44px;      --lh-h1: 49px;
    --fs-h2: 36px;      --lh-h2: 40px;
    --fs-h3: 22px;      --lh-h3: 28px;
    --fs-lead: 22px;
    --fs-section: 52px; --lh-section: 62.4px;
    --fs-hero-sub: 32px; --lh-hero-sub: 35.2px;
  }
}
@media (min-width: 1200px) {
  :root { --pad: max(40px, calc((100vw - var(--container)) / 2)); --section-gap: 150px; --fs-h1: 52px; --lh-h1: 57px; --fs-lead: 24px; }
}

/* ---------- 3. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; color-scheme: light; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font);
  font-weight: var(--fw);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, video, svg { display: block; max-width: 100%; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
/* 28.11: text links. Primary colour, never underlined (not even on hover). Buttons, nav, cards keep their own styles. */
:root { --bar-bg: rgba(255, 255, 255, .92); }
/* 28.11: header is fixed (not sticky) so it and the case TOC bar move as one unit; body reserves its height */
body { padding-top: var(--header-h); }
:root { --color-link: rgb(0, 153, 255); --color-link-hover: rgb(0, 122, 214); }
:where(p, li, dd, td, figcaption, .cv-text, .t-body, .case-facts, .popover__text) a:not(.btn) { color: var(--color-link); text-decoration: none; transition: color .2s; }
:where(p, li, dd, td, figcaption, .cv-text, .t-body, .case-facts, .popover__text) a:not(.btn):hover { color: var(--color-link-hover); text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; border-radius: 6px; }
[id] { scroll-margin-top: calc(var(--header-h) + 24px); }
.skip-link {
  position: absolute; left: 16px; top: -64px; z-index: 100;
  background: var(--color-text); color: #fff; padding: 10px 16px; border-radius: 12px; text-decoration: none;
}
.skip-link:focus { top: 12px; }
.icon { width: 1em; height: 1em; flex: none; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- 4. Typography ----------
   Headings use Inter 500, letter-spacing -0.04em. Use classes, not tag defaults:
   the tag (h1..h3) is chosen for the document outline, the class for the look. */
.t-display, .t-h1, .t-h2, .t-h3, .t-section {
  font-weight: var(--fw);
  letter-spacing: var(--ls-heading);
  text-wrap: balance;
}
.t-display { font-size: var(--fs-display); line-height: var(--lh-display); }
.t-h1      { font-size: var(--fs-h1); line-height: var(--lh-h1); }
.t-h2      { font-size: var(--fs-h2); line-height: var(--lh-h2); }
.t-h3      { font-size: var(--fs-h3); line-height: var(--lh-h3); letter-spacing: -0.02em; }
.t-lead    { font-size: var(--fs-lead); line-height: 1.4; letter-spacing: -0.02em; color: var(--color-text-muted); text-wrap: pretty; }
.t-body    { font-size: 17px; line-height: 27px; color: var(--color-text-body); text-wrap: pretty; }
.t-body-sm { font-size: 15px; line-height: 24px; color: var(--color-text-body); }
.t-caption, .caption { font-size: 13px; line-height: 18px; color: var(--color-text-muted); }
.t-meta    { font-size: 15px; line-height: 24px; color: var(--color-text-muted); }
.t-body + .t-body { margin-top: 16px; }
.t-h2 + .t-body, .t-h2 + .t-lead { margin-top: 20px; }
/* home section / case title: grey prefix line "#2_OneTwoTrip>" + dark title line.
   Owner direction 28.11: Inter 500, -0.04em, 52px (legacy export measured 400/normal; we follow the direction).
   <h2 class="t-section"><span class="t-section__idx">#2_OneTwoTrip&gt;</span> Bus &amp; Train Orders</h2> */
.t-section { font-weight: var(--fw); font-size: var(--fs-section); line-height: var(--lh-section); letter-spacing: var(--ls-heading); color: var(--color-text); }
.t-section__idx { display: block; color: var(--color-text-muted); }
.t-section__idx--inline { display: inline; }
/* legacy home hero sub line: "5+ years of experience in traveltech ..." */
.t-hero-sub { font-size: var(--fs-hero-sub); line-height: var(--lh-hero-sub); letter-spacing: -0.04em; color: var(--color-text-muted); text-wrap: balance; }
.caption { margin: 14px 4px 0; }

/* ---------- 5. Layout ---------- */
.container { width: min(100% - var(--pad) * 2, var(--container)); margin-inline: auto; }
.container--text { width: min(100% - var(--pad) * 2, var(--case-text-w)); }

.section { margin-top: var(--section-gap); }
.section--flush { margin-top: 0; }
.section__head { margin-bottom: 32px; }
@media (min-width: 810px) { .section__head { margin-bottom: 48px; } }

/* .case-text: reading column (max 720px) for section headings and paragraphs inside a case. */
.case-text { max-width: var(--case-text-w); }
.case-section { margin-top: var(--section-gap); }
.case-section__head { margin-bottom: 32px; }
@media (min-width: 810px) { .case-section__head { margin-bottom: 48px; } }

/* ---------- 6. Buttons ----------
   .btn                 base (44px, 16px text)
   .btn--primary        dark fill        .btn--secondary  #f7f7f7 fill
   .btn--outline        1px border
   .btn--pill           fully rounded    (default radius is 16px)
   .btn--sm 36px        .btn--lg  legacy home CTA (71px, 24px/900, radius 24, uppercase)
   .btn--block          full width */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px;
  border: 0; border-radius: var(--radius-pill); /* 28.11: every button is a pill */
  font-size: 16px; line-height: 24px; font-weight: var(--fw); letter-spacing: -0.01em;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .25s var(--ease), color .25s var(--ease), transform .25s var(--ease), border-color .25s;
}
.btn:active { transform: scale(.98); }
.btn--primary { background: var(--color-text); color: var(--color-on-dark); }
.btn--primary:hover { background: #000; }
.btn--secondary { background: var(--color-plate); color: var(--color-text); }
.btn--secondary:hover { background: var(--color-plate-hover); }
.btn--outline { background: transparent; color: var(--color-text); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .16); }
.btn--outline:hover { box-shadow: inset 0 0 0 1px var(--color-text); }
.btn--pill { border-radius: var(--radius-pill); }
.btn--sm { min-height: 36px; padding: 0 14px; font-size: 14px; line-height: 20px; }
.btn--sm.btn--pill { border-radius: var(--radius-pill); }
.btn--lg {
  min-height: 72px; padding: 0 32px; border-radius: 24px;
  font-size: 24px; line-height: 24px; font-weight: 900; letter-spacing: 0; text-transform: uppercase;
}
@media (max-width: 809.98px) { .btn--lg { font-size: 20px; padding: 0 24px; width: 100%; white-space: normal; text-align: center; } }
.btn--block { display: flex; width: 100%; }

/* ---------- 7. Tags / chips ----------
   .tag (static label)   .tag--solid  .tag--outline  .tag--sm
   wrap several in .tags */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: var(--radius-pill);
  background: var(--color-plate); color: var(--color-text);
  font-size: 14px; line-height: 20px; letter-spacing: -0.01em; white-space: nowrap;
}
.tag--solid { background: var(--color-text); color: #fff; }
.tag--outline { background: transparent; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .16); }
.tag--sm { height: 26px; padding: 0 10px; font-size: 13px; }

/* ---------- 8. Header ----------
   .site-header                 sticky, blurred white (default: logo left, nav right)
   .site-header--center         legacy home: logo + nav as one centred cluster
   .site-header--minimal        logo only (404)
   <810px: nav collapses into a burger menu (data-menu-toggle, handled by site.js) */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50; height: var(--header-h);
  background: var(--bar-bg);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), transform .35s var(--ease);
}
/* 28.11: hides on scroll down, returns on scroll up (site.js) */
.site-header.is-hidden { transform: translateY(-100%); }
.header-hidden .case-toc.is-visible { transform: translateY(calc(-1 * var(--header-h))); }
@media (prefers-reduced-motion: reduce) { .site-header, .case-toc { transition: none; } }
.site-header.is-scrolled, .site-header.is-open { border-bottom-color: transparent; }
.site-header__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.site-header__logo { display: block; line-height: 0; }
.site-header__logo img { height: 18px; width: auto; }
@media (min-width: 810px) { .site-header__logo img { height: 20px; } }
.site-header--center .site-header__inner { justify-content: center; gap: 24px; }
.site-header--center .site-nav { gap: 24px; }
.site-header--center .site-nav__link { white-space: nowrap; }
/* 28.11 v2: the header is a floating glass pill from the start (>= 810px); a touch more shadow once scrolled. */
@media (min-width: 810px) {
  .site-header { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .site-header--center .site-header__inner {
    width: fit-content; height: 48px; margin-top: 8px; padding: 0 6px 0 22px; gap: 20px; border-radius: 999px;
    background: var(--bar-bg); -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .05), 0 4px 16px rgba(0, 0, 0, .04);
    transition: box-shadow .3s var(--ease);
  }
  .site-header.is-scrolled .site-header__inner { box-shadow: 0 0 0 1px rgba(0, 0, 0, .05), 0 10px 30px rgba(0, 0, 0, .10); }
  .site-header--center .site-nav { gap: 2px; }
  .site-header--center .site-nav__link { padding: 0 14px; line-height: 36px; border-radius: 999px; color: var(--color-text-muted); transition: background .2s, color .2s; }
  .site-header--center .site-nav__link:hover { background: rgba(0, 0, 0, .05); color: var(--color-text); }
  .site-header--center .site-lang { margin-left: 6px; height: 36px; min-width: 44px; background: var(--color-text); color: #fff; }
}


.site-nav { display: flex; align-items: center; gap: 20px; }
@media (min-width: 810px) { .site-nav { gap: 32px; } }
.site-nav__link {
  font-size: 15px; line-height: 30px; letter-spacing: -0.2px;
  color: var(--color-text-muted); text-decoration: none; transition: color .2s;
}
.site-nav__link:hover, .site-nav__link[aria-current] { color: var(--color-text); }
.site-lang {
  display: inline-flex; align-items: center; justify-content: center;
  height: 28px; min-width: 40px; padding: 0 10px; border-radius: var(--radius-pill);
  font-size: 13px; letter-spacing: .02em; text-decoration: none;
  background: var(--color-plate); color: var(--color-text); transition: background .2s;
}
.site-lang:hover { background: var(--color-plate-hover); }

.site-header__burger { display: none; }
@media (max-width: 809.98px) {
  .js .site-header__burger {
    display: grid; place-content: center; gap: 6px; width: 44px; height: 44px; margin-right: -10px;
    background: none; border: 0; cursor: pointer;
  }
  .site-header__burger span { display: block; width: 22px; height: 2px; border-radius: 2px; background: var(--color-text); transition: transform .3s var(--ease); }
  .site-header.is-open .site-header__burger span:first-child { transform: translateY(4px) rotate(45deg); }
  .site-header.is-open .site-header__burger span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .js .site-nav {
    position: fixed; z-index: 49; inset: var(--header-h) 0 0 0;
    flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 4px;
    padding: 24px var(--pad); background: #fff;
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .3s var(--ease), transform .3s var(--ease), visibility 0s .3s;
  }
  .js .site-header.is-open .site-nav { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .js .site-nav__link { font-size: 28px; line-height: 1.2; letter-spacing: -0.03em; color: var(--color-text); padding: 10px 0; }
  .js .site-lang { margin-top: 16px; height: 36px; min-width: 52px; font-size: 15px; }
  html.menu-open { overflow: hidden; }
  .site-header--center .site-header__inner { justify-content: space-between; }
  .js .site-header--center .site-nav__link { text-transform: none; }
}

/* ---------- 9. Footer ----------
   One footer for every page: Telegram CTA + social links + legal line. id="contacts".
   Legacy home contacts block @1440: title 52px, CTA 346x71 (radius 24, 24px/900),
   four 260x42 link cells, 48px between them. */
.site-footer { margin-top: var(--section-gap); padding: 0; scroll-margin-top: 0; }
/* 28.11 footer v2: dark card, big title, white pill CTA, social chips, giant muted wordmark. No dividers. */
/* 28.11 v3: full-bleed dark band (like the grey media bands); content sits on the page grid, rounded top only */
.site-footer > .container { width: 100%; max-width: none; padding-inline: 0; }
.footer-card { position: relative; overflow: hidden; background: #161616; color: #fff; border-radius: 32px 32px 0 0; padding: 48px 0 0; }
.footer-card > * { width: min(var(--container, 1184px), 100% - 2 * var(--pad)); margin-inline: auto; }
@media (min-width: 810px) { .footer-card { padding-top: 96px; border-radius: 40px 40px 0 0; } }
.footer-card__top { display: grid; gap: 40px; }
@media (min-width: 1000px) { .footer-card__top { grid-template-columns: 1.1fr 1fr; align-items: end; gap: 48px; } }
.footer-card__title { margin: 0; font-weight: var(--fw); font-size: var(--fs-section); line-height: var(--lh-section); letter-spacing: var(--ls-heading); }
/* index sits inline like every section title (#6_Design System>) */
.footer-card__idx { display: inline; color: rgba(255,255,255,.45); font-size: inherit; letter-spacing: inherit; margin: 0; }
.footer-card__actions { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.footer-cta { display: inline-flex; align-items: center; gap: 12px; height: 72px; padding: 0 32px; border-radius: 999px; background: #fff; color: #161616; font-size: 22px; letter-spacing: -0.02em; text-decoration: none; transition: transform .3s var(--ease), background .2s; }
.footer-cta:hover .icon { transform: translate(2px, -2px); }
.footer-cta .icon { transition: transform .3s var(--ease); }
.footer-card__or { margin: 16px 0 0; font-size: 14px; color: rgba(255,255,255,.5); }
.footer-socials { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.footer-socials a { display: inline-flex; align-items: baseline; gap: 8px; padding: 10px 16px; border-radius: 999px; background: rgba(255,255,255,.08); color: #fff; text-decoration: none; font-size: 15px; transition: background .2s; }
.footer-socials a, .footer-socials a:hover { color: #fff; }
.footer-socials a:hover { background: rgba(255,255,255,.16); }
.footer-socials__handle { color: rgba(255,255,255,.5); font-size: 14px; }
.footer-card__bottom { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 56px; font-size: 14px; color: rgba(255,255,255,.5); }
.footer-card__bottom a { color: inherit; text-decoration: none; transition: color .2s; }
.footer-card__bottom a:hover { color: #fff; }
.footer-card__mark { margin: 8px 0 0; font-weight: 900; font-size: 25vw; line-height: .78; letter-spacing: -0.06em; color: rgba(255,255,255,.06); white-space: nowrap; text-align: center; user-select: none; pointer-events: none; transform: translateY(12%); }
.footer-card > .footer-card__mark { width: 100%; font-size: 23.5vw; text-align: center; margin-inline: 0; }
@media (min-width: 1700px) { .footer-card > .footer-card__mark { font-size: 400px; } }

/* ---------- 10. Plates & media ----------
   (.band, the full-bleed surface, is the primary one and is defined in section 11; .plate is the secondary rounded card)
   .plate            #f7f7f7 rounded surface (radius 24 mobile / 32 from 810)
   .plate--pad       padding 24 / 48 / 64     .plate--white  white + hairline
   .plate--bleed     full viewport width, rounded top/bottom (legacy home sections)
   .media            image/video with a fixed aspect ratio: .media--16x10 .media--4x3 .media--1x1 .media--3x4 .media--9x16
                     (or style="--ar: 21/9"). .media--contain keeps the whole picture. .media--round = radius 24.
   .frame            a "screen" lifted off the plate: white, rounded top, soft shadow (hero shot)
   .caption          small grey caption under a plate/media */
.plate { position: relative; background: var(--color-plate); border-radius: var(--plate-radius); overflow: hidden; isolation: isolate; }
.plate--pad { padding: 16px; }
@media (min-width: 810px) { .plate--pad { padding: 48px; } }
@media (min-width: 1200px) { .plate--pad { padding: 64px; } }
.plate--white { background: #fff; box-shadow: inset 0 0 0 1px var(--color-border); }
.plate--bleed { width: 100%; border-radius: 0 0 24px 24px; padding-block: 24px; }
@media (min-width: 810px) { .plate--bleed { border-radius: var(--radius-xl); padding-block: 48px; } }

.media { position: relative; margin: 0; aspect-ratio: var(--ar, 16 / 10); overflow: hidden; background: var(--color-plate); }
.media > img, .media > video, .media > picture, .media > picture img { width: 100%; height: 100%; object-fit: cover; }
.media--16x10 { --ar: 16 / 10; } .media--16x9 { --ar: 16 / 9; } .media--4x3 { --ar: 4 / 3; }
.media--1x1 { --ar: 1 / 1; } .media--3x4 { --ar: 3 / 4; } .media--9x16 { --ar: 9 / 16; }
.media--phone { --ar: 300 / 650; }
.media--contain > img, .media--contain > video { object-fit: contain; }
.media--round { border-radius: var(--radius-card); }
.plate > .media { background: transparent; }

.frame {
  border-radius: 12px 12px 0 0; overflow: hidden; background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .05), 0 30px 80px -20px rgba(33, 33, 33, .28), 0 12px 24px -12px rgba(33, 33, 33, .12);
}
@media (min-width: 810px) { .frame { border-radius: 16px 16px 0 0; } }
.frame img { width: 100%; height: auto; max-width: none; }

/* .band: THE media surface of the home style. Full-bleed #f7f7f7 strip, edge to edge of the viewport
   (place it directly in <main>, not inside .container). Fill it with a .container + .slider--screens
   (phone row), a .bento, a .pair or one .media. .band--round adds the legacy 32px corners. */
.band { position: relative; width: 100%; background: var(--color-plate); padding-block: 32px; overflow: clip; /* clip, not hidden: keeps position: sticky working inside bands */ isolation: isolate; margin-top: var(--section-gap); }
@media (min-width: 810px) { .band { padding-block: 48px; } }
.band--round { border-radius: 0 0 24px 24px; }
@media (min-width: 810px) { .band--round { border-radius: var(--radius-xl); } }
.band--tight { margin-top: 32px; }
.band > .caption { margin-inline: var(--pad); }

/* ---------- 11. Slider, pair, bento ---------- */
/* .slider: horizontal scroll-snap strip. Children are the slides.
   --slide-w sets the slide width (default 88% of the strip, next one peeks).
   .slider--bleed   goes edge to edge of the viewport, keeps the container's inset (use inside .container)
   .slider--screens phone screenshots 300x650, radius 24 (legacy home case strips)
   .slider--mobile  slider only below 810px; from 810 children lay out as a wrapped grid/flex row */
.slider {
  --slide-w: 88%;
  display: flex; gap: var(--gap); overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.slider::-webkit-scrollbar { display: none; }
.slider > * { flex: 0 0 var(--slide-w); min-width: 0; scroll-snap-align: center; scroll-snap-stop: always; }
.slider--start > * { scroll-snap-align: start; }
.slider--bleed {
  margin-inline: calc(50% - 50vw);
  /* --pad is the grid's side offset at every width, so content and snapping both start on the grid (28.11) */
  padding-inline: var(--pad);
  scroll-padding-inline: var(--pad);
}
.slider--screens { --slide-w: 300px; gap: var(--gap-lg); }
.slider--screens > * { aspect-ratio: 300 / 650; border-radius: 24px; overflow: hidden; background: #fff; }
.slider--screens img, .slider--screens video { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 809.98px) { .slider--screens { --slide-w: 66%; gap: var(--gap); } }
@media (min-width: 810px) {
  .slider--mobile { display: grid; overflow: visible; scroll-snap-type: none; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); }
  .slider--mobile > * { flex: none; }
}
/* 28.11: no arrow controls on sliders (owner decision). Swipe, wheel and drag only. */
.slider-controls { display: none !important; }
.slider-controls { display: flex; gap: 8px; margin-top: 16px; }
.slider-controls button {
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--color-plate); color: var(--color-text); display: grid; place-items: center; font-size: 20px;
  transition: background .2s, opacity .2s;
}
.slider-controls button:hover { background: var(--color-plate-hover); }
.slider-controls button[disabled] { opacity: .35; cursor: default; }

/* .pair: two equal blocks side by side (gap 8). Below 810px it becomes a slider (slide 88%, peek). */
.pair { display: flex; gap: var(--gap); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.pair::-webkit-scrollbar { display: none; }
.pair > * { flex: 0 0 88%; min-width: 0; scroll-snap-align: center; scroll-snap-stop: always; }
@media (min-width: 810px) {
  .pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; scroll-snap-type: none; }
  .pair > * { flex: none; }
}
.pair--bleed { margin-inline: calc(50% - 50vw); padding-inline: var(--pad); scroll-padding-inline: var(--pad); }
@media (min-width: 810px) { .pair--bleed { margin-inline: 0; padding-inline: 0; } }

/* .bento: 12-column grid, gap 8. Items choose width and height:
   .span-4 .span-6 .span-8 .span-12   (columns)       .row-2 .row-3 (rows of --bento-row, default 200px)
   .bento--gap-lg uses 24px (legacy home). Below 810px: one column, items min-height 240px;
   add .bento--slider to turn the mobile layout into a horizontal slider instead. */
.bento { --bento-row: 200px; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: var(--bento-row); gap: var(--gap); }
.bento--gap-lg { gap: var(--gap-lg); }
.bento__item { position: relative; background: var(--color-plate); border-radius: var(--radius-card); overflow: hidden; min-width: 0; grid-column: span 12; }
.bento__item > img, .bento__item > video { width: 100%; height: 100%; object-fit: cover; }
.bento__item--white { background: #fff; box-shadow: inset 0 0 0 1px var(--color-border); }
.bento__item--pad { padding: 24px; }
.span-4 { grid-column: span 4; } .span-6 { grid-column: span 6; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
.row-2 { grid-row: span 2; } .row-3 { grid-row: span 3; }
@media (min-width: 810px) and (max-width: 1199.98px) { .bento { --bento-row: 160px; } }
@media (min-width: 1200px) { .bento { --bento-row: 220px; } }
@media (max-width: 809.98px) {
  .bento { grid-template-columns: 1fr; grid-auto-rows: minmax(240px, auto); }
  .bento > * { grid-column: auto; grid-row: auto; }
  .bento .row-2, .bento .row-3 { min-height: 360px; }
  .bento--slider { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: calc(50% - 50vw); padding-inline: var(--pad); scroll-padding-inline: var(--pad); }
  .bento--slider::-webkit-scrollbar { display: none; }
  .bento--slider > * { flex: 0 0 calc(88vw - 24px); height: calc((88vw - 24px) * 1.25); scroll-snap-align: center; scroll-snap-stop: always; }
}
@media (min-width: 810px) { .bento__item--span-mobile-only { display: none; } }

/* ---------- 12. Cards ---------- */
/* outcomes: quiet row of result items in the home style, no cards, no ticks.
   <ul class="outcomes"><li class="outcome"><b class="outcome__title">..</b><span class="outcome__text">..</span></li>
   2 columns on mobile, 4 from 810px. */
.outcomes { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 16px; margin-top: 48px; }
@media (min-width: 810px) { .outcomes { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 48px; margin-top: 64px; } }
.outcome { display: flex; flex-direction: column; gap: 6px; padding-top: 16px; }
.outcome__title { font-weight: var(--fw); font-size: 16px; line-height: 21px; letter-spacing: -0.02em; }
.outcome__text { font-size: 14px; line-height: 20px; color: var(--color-text-muted); }
/* stat: big value + label (quiet, same grid as .outcomes). Use only for real numbers (not for OTT). */
.stat { display: flex; flex-direction: column; gap: 6px; padding-top: 16px; }
.stat__value { font-weight: var(--fw, 500); font-size: 40px; line-height: 44px; letter-spacing: var(--ls-heading); }
@media (min-width: 810px) { .stat__value { font-size: 56px; line-height: 60px; } }
.stat__label { font-size: 14px; line-height: 20px; color: var(--color-text-muted); }

/* case-card: link card for the case list on the home page.
   <a class="case-card" href=""><div class="case-card__media plate">...</div><div class="case-card__body">...</div></a>
   Wrap several in .case-list (1 column, 2 from 810px; .case-list--3 for three). */
.case-list { display: grid; grid-template-columns: 1fr; gap: 32px var(--gap-lg); }
@media (min-width: 810px) { .case-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } .case-list--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.case-card { display: flex; flex-direction: column; gap: 16px; text-decoration: none; }
.case-card__media { aspect-ratio: 4 / 3; border-radius: var(--plate-radius); overflow: hidden; background: var(--color-plate); }
.case-card__media img, .case-card__media video { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.case-card:hover .case-card__media img, .case-card:hover .case-card__media video { transform: scale(1.03); }
.case-card__body { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: start; }
.case-card__eyebrow { grid-column: 1 / -1; font-size: 14px; line-height: 20px; color: var(--color-text-muted); }
.case-card__title { font-size: var(--fs-h3); line-height: var(--lh-h3); letter-spacing: -0.03em; }
.case-card__text { grid-column: 1; font-size: 15px; line-height: 22px; color: var(--color-text-muted); }
.case-card__arrow {
  grid-row: 2; grid-column: 2; width: 40px; height: 40px; border-radius: 50%; background: var(--color-text); color: #fff;
  display: grid; place-items: center; transition: transform .4s var(--ease);
}
.case-card:hover .case-card__arrow { transform: translateX(4px); }
.case-card .tags { grid-column: 1 / -1; margin-top: 8px; }

/* next-case: closing card of every case page */
.next-case-wrap { margin-top: var(--section-gap); }
.next-case {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  background: var(--color-plate); border-radius: var(--plate-radius); padding: 32px 24px; text-decoration: none;
  transition: background .3s var(--ease);
}
@media (min-width: 810px) { .next-case { padding: 56px 48px; } }
.next-case:hover { background: var(--color-plate-hover); }
.next-case > div { min-width: 0; }
.next-case strong { overflow-wrap: anywhere; }
.next-case small { display: block; font-size: 14px; line-height: 20px; color: var(--color-text-muted); margin-bottom: 8px; }
.next-case strong { font-weight: var(--fw); letter-spacing: var(--ls-heading); font-size: var(--fs-h2); line-height: var(--lh-h2); }
.next-case__arrow { flex: none; width: 48px; height: 48px; border-radius: 50%; background: var(--color-text); color: #fff; display: grid; place-items: center; transition: transform .4s var(--ease); }
.next-case__arrow .icon { width: 20px; height: 20px; }
.next-case:hover .next-case__arrow { transform: translateX(6px); }

/* ---------- 13. Case page parts (home style) ----------
   Case page = case-head (title, meta columns, description) + sections (H2 + text) + full-bleed .band media.
   .case-head      the home case block: .t-section title, then .cv-row with meta fields and description + button
   .case-statement one big dark sentence (24/30) before the description
   .case-toc       minimal sticky strip under the header (site.js shows it after the head scrolls away) */
.case-head { padding-top: 48px; }
@media (min-width: 810px) { .case-head { padding-top: 96px; } }
.case-head .cv-row { margin-top: 32px; padding: 0; }
@media (min-width: 810px) { .case-head .cv-row { margin-top: 48px; } }
.case-statement { font-size: 20px; line-height: 26px; letter-spacing: -0.03em; color: var(--color-text); text-wrap: balance; }
@media (min-width: 810px) { .case-statement { font-size: 24px; line-height: 30px; } }
.case-head .cv-text { color: var(--color-text-muted); }
.case-head .btn { margin-top: 8px; justify-self: start; }

.case-toc {
  position: fixed; z-index: 40; top: var(--header-h); left: 0; right: 0;
  background: var(--bar-bg); -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px);

  opacity: 0; transform: translateY(-6px); pointer-events: none; visibility: hidden;
  transition: opacity .3s var(--ease), transform .35s var(--ease), visibility 0s .3s;
}
.case-toc.is-visible { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition-delay: 0s; }
.case-toc__inner { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-block: 8px; }
@media (min-width: 810px) {
  .case-toc { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; top: calc(var(--header-h) + 4px); }
  .case-toc__inner { width: fit-content; max-width: calc(100% - 2 * var(--pad)); padding: 6px; border-radius: 999px;
    background: var(--bar-bg); -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, .08), 0 0 0 1px rgba(0, 0, 0, .04); }
}
.case-toc__inner::-webkit-scrollbar { display: none; }
.case-toc a {
  flex: none; display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: var(--radius-pill);
  font-size: 14px; text-decoration: none; color: var(--color-text-muted); transition: color .2s, background .2s;
}
.case-toc a:hover { color: var(--color-text); }
.case-toc a.is-active { color: #fff; background: var(--color-text); }
.js .case-toc ~ * { }
.case-hero { margin-top: var(--section-gap); padding-block: 0; }
/* hero band with a parallax page screenshot (data-parallax on .case-hero__frame) */
.case-hero__plate { aspect-ratio: 1 / 1.05; padding: 24px 12px 0; }
@media (min-width: 810px) { .case-hero__plate { aspect-ratio: auto; height: 600px; padding: 56px 56px 0; } }
@media (min-width: 1200px) { .case-hero__plate { height: 700px; padding: 72px 0 0; } .case-hero__plate > .case-hero__frame { width: min(100% - 2 * var(--pad), 1000px); margin-inline: auto; } }
.case-hero__frame { width: 190%; will-change: transform; transform: translate3d(0, calc(var(--p, 0) * -64px + var(--reveal-y, 0px)), 0); }
@media (min-width: 810px) { .case-hero__frame { width: 100%; } }

/* ---------- 14. Home parts ---------- */
/* hero (legacy @1440: section 362px high, title top 128px, 52/57 centred; sub 32/35 grey;
   avatar 58px, app icons 32px inline) */
.hero { padding: 96px 0 48px; text-align: center; }
@media (min-width: 810px) { .hero { padding: 128px 0 48px; } }
.hero__title { text-wrap: balance; }
.hero__sub { margin-top: 24px; }
.hero__avatar { display: inline-block; width: 1.1em; height: 1.1em; border-radius: 50%; vertical-align: -0.2em; margin-left: .15em; object-fit: cover; }
.hero__icon { display: inline-block; width: 32px; height: 32px; border-radius: 8px; vertical-align: -9px; margin: 0 2px; }

/* cv-row: two columns (379px + 757px, 48px gap at 1440).
   left: .cv-row__meta (role list or fields)   right: .cv-row__body (text blocks with a grey label) */
.cv-row { display: grid; grid-template-columns: 1fr; gap: 24px; padding: 24px 0; }
@media (min-width: 810px) { .cv-row { grid-template-columns: minmax(0, 379fr) minmax(0, 757fr); gap: 48px; } }
.cv-row__meta { display: grid; gap: 16px; align-content: start; }
.cv-row__meta--fields { grid-template-columns: 1fr 1fr; gap: 24px 16px; }
.cv-row__meta--fields dd { margin: 0; }
.cv-row__body { display: grid; gap: 24px; align-content: start; }
.cv-item__period, .cv-label { font-size: 16px; line-height: 24px; color: var(--color-text-muted); }
.cv-item__role, .cv-value, .cv-text { font-size: 16px; line-height: 24px; color: var(--color-text); }
.cv-text + .cv-text { margin-top: 24px; }
.cv-list li { position: relative; padding-left: 1.2em; }
.cv-list li::before { content: "•"; position: absolute; left: .2em; }

/* popover: card that points at a trigger (hero tags). Hover/focus on >= 810px, tap on mobile (bottom sheet).
   <span class="has-popover" data-popover>
     <button class="hero__icon-btn" aria-describedby="pop-1">...</button>
     <span class="popover" role="tooltip" id="pop-1">
       <span class="popover__head"><img ...><b>Title</b></span><span class="popover__meta">Meta</span><span class="popover__text">Text</span>
     </span></span> */
.has-popover { position: relative; display: inline-block; }
.popover {
  position: absolute; z-index: 30; left: 50%; bottom: calc(100% + 14px); width: 280px; padding: 16px;
  display: flex; flex-direction: column; gap: 6px; text-align: left; white-space: normal;
  background: #fff; color: var(--color-text); border-radius: 20px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .05), 0 24px 48px -12px rgba(33, 33, 33, .22), 0 8px 16px -8px rgba(33, 33, 33, .12);
  font-size: 15px; line-height: 21px; letter-spacing: -0.01em; font-weight: var(--fw);
  opacity: 0; visibility: hidden; transform: translate(-50%, 6px) scale(.96); transform-origin: 50% 100%;
  transition: opacity .2s var(--ease), transform .25s var(--ease), visibility 0s .25s;
  pointer-events: none;
}
.popover::after { /* arrow pointing at the trigger */
  content: ""; position: absolute; left: 50%; top: 100%; width: 14px; height: 14px; background: #fff;
  transform: translate(-50%, -7px) rotate(45deg); border-radius: 0 0 4px 0;
  box-shadow: 3px 3px 6px -2px rgba(33, 33, 33, .08);
}
.popover__head { display: flex; align-items: center; gap: 10px; font-size: 17px; line-height: 22px; letter-spacing: -0.02em; }
.popover__head img { width: 28px; height: 28px; border-radius: 8px; }
.popover__meta { color: var(--color-text-muted); font-size: 13px; line-height: 18px; }
.popover__text { color: var(--color-text-body); }
@media (min-width: 810px) {
  .has-popover:hover .popover, .has-popover:focus-within .popover, .has-popover.is-open .popover {
    opacity: 1; visibility: visible; transform: translate(-50%, 0) scale(1); transition-delay: 0s; pointer-events: auto;
  }
}
@media (max-width: 809.98px) {
  .popover { position: fixed; left: 16px; right: 16px; bottom: 16px; width: auto; transform: translateY(16px); transform-origin: 50% 100%; padding: 20px; border-radius: 24px; }
  .popover::after { display: none; }
  .has-popover.is-open .popover { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; pointer-events: auto; }
}

/* popover refinements (28.11, home): hover bridge, placement below the trigger, link in the head.
   <span class="has-popover" data-popover data-placement="bottom">; default stays above the trigger. */
.popover::before { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 18px; }
.popover__head a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.popover__head a:hover { color: var(--color-link); }
.has-popover[data-placement="bottom"] .popover { bottom: auto; top: calc(100% + 14px); transform: translate(-50%, -6px) scale(.96); transform-origin: 50% 0; }
.has-popover[data-placement="bottom"] .popover::before { top: -18px; }
.has-popover[data-placement="bottom"] .popover::after { top: 0; transform: translate(-50%, -7px) rotate(45deg); border-radius: 4px 0 0 0; box-shadow: -3px -3px 6px -2px rgba(33, 33, 33, .08); }
@media (min-width: 810px) {
  .has-popover[data-placement="bottom"]:hover .popover, .has-popover[data-placement="bottom"]:focus-within .popover, .has-popover[data-placement="bottom"].is-open .popover { transform: translate(-50%, 0) scale(1); }
}
@media (max-width: 809.98px) {
  .has-popover[data-placement="bottom"] .popover { top: auto; bottom: 16px; transform: translateY(16px); }
  .popover::before { display: none; }
  .has-popover[data-placement="bottom"].is-open .popover { transform: none; }
}
.site-nav__emoji { margin-right: 4px; }

/* ---------- 15. Motion ----------
   .reveal fades/rises in once when it enters the viewport (site.js adds .is-in). Needs <html class="js">. */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }
.js .case-hero__frame.reveal { transform: translate3d(0, calc(var(--p, 0) * -64px + 48px), 0); }
.js .case-hero__frame.reveal.is-in { transform: translate3d(0, calc(var(--p, 0) * -64px), 0); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .case-hero__frame.reveal.is-done { transition: none; }
video[data-autoplay] { background: var(--color-plate); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal, .js .case-hero__frame.reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .case-hero__frame { transform: none !important; }
  .case-card:hover img, .case-card:hover video { transform: none; }
}

/* 28.11: case head facts line (role · platforms · team), replaces the heavy left meta grid */
.case-facts { margin-top: 16px; font-size: var(--font-size-caption, 14px); line-height: 20px; color: var(--color-text-secondary, #777); }

/* 28.11: clean UI, no divider lines between rows/blocks; use spacing instead. Product UI inside demos may keep its own lines. */

/* ===========================================================================
   16. Look & feel v1 (28.11). One interaction language for every control.
   - Dark fill  (primary buttons, lang pill, active chips): hover = pure black + lift + soft shadow
   - Light fill (secondary buttons, chips, white CTA):       hover = one step darker + lift
   - Ghost      (nav links, TOC links):                      hover = faint grey pill, text to dark
   - Blue only for inline text links. Press = scale .97. Focus = blue ring.
   Motion: ease-out-expo for entrances, soft spring for small UI, 60ms stagger for groups.
   =========================================================================== */
:root {
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);
  --lift: none;            /* 28.11: no lifting buttons, hover changes colour only */
  --lift-shadow: none;
  --ghost-hover: rgba(0, 0, 0, .05);
}
/* dark fills */
.btn--primary, .site-header--center .site-lang, .case-toc a.is-active, .next-case__arrow {
  transition: background .25s var(--ease-out), color .25s var(--ease-out), transform .35s var(--ease-spring), box-shadow .35s var(--ease-out);
}
.btn--primary:hover, .site-header--center .site-lang:hover { background: #000; color: #fff; transform: var(--lift); box-shadow: var(--lift-shadow); }
.case-toc a.is-active:hover { background: #000; color: #fff; }
/* light fills */
.btn--secondary, .footer-cta, .footer-socials a { transition: background .25s var(--ease-out), color .25s var(--ease-out), transform .35s var(--ease-spring), box-shadow .35s var(--ease-out); }
.btn--secondary:hover { background: var(--color-plate-hover); color: var(--color-text); transform: var(--lift); }
.footer-cta:hover { background: #e6e6e6; color: #161616; }
.footer-socials a:hover { transform: var(--lift); }
/* ghost */
.case-toc a:not(.is-active):hover, .site-header--center .site-nav__link:hover { background: var(--ghost-hover); color: var(--color-text); }
/* press + focus */
.btn:active, .site-lang:active, .footer-cta:active, .footer-socials a:active, .case-toc a:active, .site-nav__link:active { transform: scale(.97); transition-duration: .1s; }
:where(a, button, [tabindex]):focus-visible { outline: 2px solid var(--color-link); outline-offset: 3px; }
/* icons inside controls nudge toward their direction */
.btn .icon, .footer-cta .icon, .next-case__arrow .icon { transition: transform .35s var(--ease-spring); }
.btn:hover .icon, .footer-cta:hover .icon { transform: translate(2px, -2px); }
/* mobile TOC bar: no line, soft shadow only */
@media (max-width: 809.98px) { .case-toc { border: 0; box-shadow: 0 6px 16px rgba(0, 0, 0, .06); } }

/* ---- entrances (28.11 v2: one ordered sequence) ----
   LOAD (CSS only, no JS needed, finishes inside ~1.1s):
     header pill 0s -> title .08s -> tags .2s (35ms steps) -> lede .34s -> body text .4s (40ms steps) -> buttons (last body child) -> outcomes .6s
     -> first media: site.js gives anything already in view at load a delay of .62s+ (class .is-load, shorter transitions)
   SCROLL: a section goes heading, text (case-text children, 90ms steps), then media (group children left to right, 60ms steps, +.12s).
   Nothing is animated twice: a group inside .reveal / .case-head / .hero is not staggered on its own. */
.js .reveal { opacity: 0; transform: translateY(32px) scale(.985); filter: blur(4px); transition: opacity .8s var(--ease-out), transform 1s var(--ease-out), filter .55s var(--ease-out); }
.js .reveal.is-in { opacity: 1; transform: none; filter: none; }
.js .reveal.is-load { transition-duration: .55s; }
/* a text block reveals heading, then paragraphs; the wrapper itself stays put */
.js .case-text.reveal { opacity: 1; transform: none; filter: none; transition: none; }
.js .case-text.reveal > * { opacity: 0; transform: translateY(24px); filter: blur(3px); transition: opacity .7s var(--ease-out), transform .9s var(--ease-out), filter .5s var(--ease-out); transition-delay: calc(var(--d, 0s) + var(--k, 0) * 90ms); }
.js .case-text.reveal.is-in > * { opacity: 1; transform: none; filter: none; }
.js .case-text.reveal.is-load > * { transition-duration: .5s; }
.case-text > :nth-child(2), .case-head__row > :nth-child(2), .cv-row__body > :nth-child(2) { --k: 1; }
.case-text > :nth-child(3), .cv-row__body > :nth-child(3) { --k: 2; }
.case-text > :nth-child(4), .cv-row__body > :nth-child(4) { --k: 3; }
.case-text > :nth-child(n+5), .cv-row__body > :nth-child(n+5) { --k: 4; }
/* staggered groups. Hidden by CSS from the first paint (no flash); site.js adds .is-in (and --i, .stagger) */
.js :is(.bento, .pair, .slider, .home-bento, .home-track:not(:has(> .home-bento)), .footer-socials, .outcomes, .case-tags, .w3-links, .h-cv__actions, .case-links, .site-footer__links, .cv-row__meta):not(.case-head *):not(.hero *):not(.reveal *) > * {
  transition: opacity var(--td, .7s) var(--ease-out), transform calc(var(--td, .7s) + .1s) var(--ease-out); transition-delay: calc(var(--d, 0s) + min(var(--i, 0), 8) * 60ms);
}
.js :is(.bento, .pair, .slider, .home-bento, .home-track:not(:has(> .home-bento)), .footer-socials, .outcomes, .case-tags, .w3-links, .h-cv__actions, .case-links, .site-footer__links, .cv-row__meta):not(.case-head *):not(.hero *):not(.reveal *):not(.is-in) > * { opacity: 0; transform: translate(calc(var(--dx, 0) * 28px), 24px); }
.stagger.is-load { --td: .4s; }
/* home bento on desktop: the column wrappers are display:contents, so the cells themselves are the items */
@media (min-width: 810px) {
  .js .home-bento:not(.case-head *):not(.hero *):not(.reveal *) > .home-bento__col > * { transition: opacity var(--td, .7s) var(--ease-out), transform calc(var(--td, .7s) + .1s) var(--ease-out); transition-delay: calc(var(--d, 0s) + min(var(--i, 0), 8) * 60ms); }
  .js .home-bento:not(.case-head *):not(.hero *):not(.reveal *):not(.is-in) > .home-bento__col > * { opacity: 0; transform: translate(calc(var(--dx, 0) * 28px), 24px); }
  .js .stagger.is-done > .home-bento__col > * { transition-property: background-color, color, box-shadow, transform, opacity; transition-duration: .25s; transition-delay: 0s; }
}
/* once a group has played, hand the children back to their own hover transitions */
.js .stagger.is-done > * { transition-property: background-color, color, box-shadow, transform, opacity; transition-duration: .25s; transition-delay: 0s; }
/* header, then the hero/case head */
@keyframes drop-in { from { opacity: 0; transform: translateY(-14px) scale(.98); } to { opacity: 1; transform: none; } }
.js .site-header--center .site-header__inner { animation: drop-in .45s var(--ease-out) backwards; }
@keyframes rise-in { from { opacity: 0; transform: translateY(20px); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
/* grid items: --dx is -1 (left half), 0 (centre) or 1 (right half), set by site.js; they enter from their own side, moving inward */
@keyframes rise-in-x { from { opacity: 0; transform: translate(calc(var(--dx, 0) * 28px), 20px); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
.js .hero__title, .js .case-head > .t-section { animation: rise-in .5s var(--ease-out) .05s backwards; }
.js .hero__sub { animation: rise-in .45s var(--ease-out) .14s backwards; }
.js .case-tags li { animation: rise-in .45s var(--ease-out) backwards; animation-delay: calc(.2s + var(--k, 0) * 35ms); }
.js .case-head__lede { animation: rise-in .5s var(--ease-out) .34s backwards; }
.js .case-head .cv-row__body > * { animation: rise-in .5s var(--ease-out) backwards; animation-delay: calc(.4s + var(--k, 0) * 40ms); }
.js .case-head .outcomes li { animation: rise-in-x .45s var(--ease-out) backwards; animation-delay: calc(.56s + var(--k, 0) * 25ms); }
.js .case-head > :not(.t-section):not(.case-tags):not(.cv-row):not(.outcomes) { animation: rise-in .45s var(--ease-out) .56s backwards; }
.case-tags > :nth-child(2), .outcomes > :nth-child(2) { --k: 1; } .case-tags > :nth-child(3), .outcomes > :nth-child(3) { --k: 2; }
.case-tags > :nth-child(4), .outcomes > :nth-child(4) { --k: 3; } .case-tags > :nth-child(n+5) { --k: 4; } .outcomes > :nth-child(n+5) { --k: 4; }
/* media in bands zoom-settle when revealed */
.js .band .reveal img, .js .home-band .reveal img { transform: scale(1.04); transition: transform 1.2s var(--ease-out); }
.js .band .reveal.is-in img, .js .home-band .reveal.is-in img { transform: none; }
.js .band .reveal.is-load img { transition-duration: .7s; }
/* page transitions between pages (View Transitions, where supported) */
@view-transition { navigation: auto; }
.site-header { view-transition-name: site-header; }
::view-transition-old(root) { animation: vt-out .2s ease-out both; }
::view-transition-new(root) { animation: vt-in .25s ease-out both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .js .reveal, .js .case-text.reveal > *, .js .home-bento__col > *, .js :is(.bento, .pair, .slider, .home-bento, .home-track, .footer-socials, .outcomes, .case-tags, .w3-links, .h-cv__actions, .case-links, .site-footer__links, .cv-row__meta) > * { opacity: 1 !important; transform: none !important; filter: none !important; transition: none !important; }
  .js .hero__title, .js .hero__sub, .js .case-head *, .js .site-header__inner { animation: none !important; }
  .js .band .reveal img, .js .home-band .reveal img { transform: none !important; transition: none !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* 17. Case head v2 (28.11): big title, fact tags, lede + body columns, outcome tiles */
.case-head--v2 .t-section { font-size: clamp(40px, 6vw, 80px); line-height: 1.02; letter-spacing: -0.045em; }
.case-tags { list-style: none; margin: 28px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.case-tags li { display: inline-flex; align-items: center; min-height: 36px; padding: 0 16px; border-radius: 999px; background: var(--color-plate); color: var(--color-text); font-size: 15px; line-height: 20px; }
.case-tags li:first-child { background: var(--color-text); color: #fff; }
.case-head--v2 .case-head__row { margin-top: 56px; display: grid; gap: 24px; }
@media (min-width: 1000px) { .case-head--v2 .case-head__row { grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; } }
.case-head__lede .case-statement { margin: 0; font-size: clamp(24px, 2.6vw, 34px); line-height: 1.18; letter-spacing: -0.03em; color: var(--color-text); }
.case-head--v2 .cv-row__body { display: grid; gap: 16px; }
.case-head--v2 .cv-row__body .cv-text { margin: 0; font-size: 17px; line-height: 27px; }
.case-head--v2 .outcomes { margin-top: 56px; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.case-head--v2 .outcome { padding: 24px; border-radius: 24px; background: var(--color-plate); gap: 8px; }
.case-head--v2 .outcome__title { font-size: 18px; line-height: 24px; }

/* 18. Header rest state (28.11): flat on the page at the top; lifts into the glass pill on hover or once scrolled */
@media (min-width: 810px) {
  .site-header--center .site-header__inner {
    background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none;
    transition: background .35s var(--ease-out), box-shadow .45s var(--ease-out), transform .45s var(--ease-spring), -webkit-backdrop-filter .35s, backdrop-filter .35s;
  }
  .site-header--center .site-header__inner:hover,
  .site-header--center .site-header__inner:focus-within,
  .site-header.is-scrolled .site-header__inner {
    background: var(--bar-bg); -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .05), 0 10px 30px rgba(0, 0, 0, .10);
  }
  .site-header--center .site-header__inner:hover { transform: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, .05), 0 14px 36px rgba(0, 0, 0, .12); }
}

/* 19. Footer composition v2 (28.11): top-aligned title and CTA, compact wordmark flush with the bottom edge */
@media (min-width: 1000px) { .footer-card__top { align-items: start; } }
.footer-card { padding-bottom: 0; }
.footer-card__title { font-size: clamp(40px, 5vw, 72px); line-height: 1.02; letter-spacing: -0.045em; }
.footer-card__bottom { margin-top: 72px; }
.footer-card > .footer-card__mark { margin-top: 24px; line-height: .74; transform: translateY(14%); color: rgba(255, 255, 255, .055); }
.site-footer { padding-bottom: 0 !important; margin-bottom: 0; }

/* lede column: statement, then muted paragraphs on an even rhythm */
.case-head--v2 .case-head__lede { display: flex; flex-direction: column; gap: 16px; }
.case-head--v2 .case-head__lede > * { margin: 0 !important; }
.case-head--v2 .case-head__lede .case-statement { margin-bottom: 8px !important; }
.case-head--v2 .case-head__lede .cv-text { font-size: 17px; line-height: 27px; color: var(--color-text-muted); max-width: 620px; }

/* 20. AI layer (28.11 v2): gradient contour is the AI signature. One panel per case (tools on top,
   summary unfolds below), the AI button in the header with a popover, tiles on the home page. */
@property --ai-angle { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
:root { --ai-grad: conic-gradient(from var(--ai-angle), #7c5cff, #00b3ff, #2ee6a6, #ffb020, #ff5c8a, #7c5cff); }
@keyframes ai-spin { to { --ai-angle: 360deg; } }
@keyframes ai-twinkle { 0%, 100% { transform: scale(1) rotate(0); } 45% { transform: scale(1.18) rotate(12deg); } 60% { transform: scale(.96) rotate(-4deg); } }
@keyframes ai-shimmer { to { background-position: -200% 0; } }
.ai-contour, .ai-panel, .ai-card, .site-ai { position: relative; isolation: isolate; }
.ai-panel::before, .ai-card::after, .site-ai::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: var(--ai-grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: ai-spin 6s linear infinite;
}

/* buttons */
.ai-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-tool { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: #fff; color: var(--color-text); font: inherit; font-size: 14px; line-height: 1; text-decoration: none; white-space: nowrap; cursor: pointer; box-shadow: 0 0 0 1px rgba(0,0,0,.06); transition: background .25s var(--ease-out), color .25s, transform .35s var(--ease-spring), box-shadow .3s var(--ease-out); }
.ai-tool:hover { color: var(--color-text); background: #ececec; box-shadow: 0 0 0 1px rgba(0,0,0,.06); }
.ai-tool:active { transform: scale(.97); transition-duration: .1s; }
.ai-tool.is-on, .ai-tool.is-done { background: var(--color-text); color: #fff; }
.ai-tool svg, .ai-tool img { flex: none; display: block; }

/* case panel */
.ai-panel { border-radius: 24px; background: var(--color-plate); padding: 20px; }
.ai-panel::before { opacity: .75; transition: opacity .3s; }
.ai-panel:hover::before, .ai-panel.is-open::before { opacity: 1; }
.ai-panel__head { display: flex; align-items: baseline; gap: 8px; margin: 0 0 16px; }
/* "AI" set like the TKHNV logo: Inter 900, tight, gradient fill; the spark sits right on the letters */
.ai-mark { display: inline-flex; align-items: flex-start; gap: 1px; font-weight: 900; font-size: 30px; line-height: 1; letter-spacing: -.04em; }
.ai-mark b { font-weight: 900; background: linear-gradient(100deg, #7c5cff 0%, #00a3ff 45%, #ff5c8a 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ai-mark svg { width: 14px; height: 14px; margin-top: -3px; color: #7c5cff; order: 2; animation: ai-twinkle 2.4s var(--ease-out) infinite; }
.ai-panel__title { font-size: 30px; line-height: 1; font-weight: 900; letter-spacing: -.04em; color: var(--color-text); }
.ai-panel__meta { margin-left: auto; font-size: 14px; color: var(--color-text-muted); }
.ai-tool--read { background: var(--color-text); color: #fff; box-shadow: none; }
.ai-tool--read:hover { background: #000; color: #fff; }
.ai-tool--read.is-on, .ai-tool--read.is-on:hover { background: #fff; color: var(--color-text); box-shadow: 0 0 0 1px rgba(0,0,0,.06); }
.ai-panel__body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .55s var(--ease-out); }
.ai-panel.is-open .ai-panel__body { grid-template-rows: 1fr; }
.ai-panel__inner { overflow: hidden; min-height: 0; }
.ai-panel .ai-panel__list { margin: 0; padding: 20px 0 4px 20px; display: grid; gap: 12px; max-width: none; font-size: 15px; line-height: 24px; color: var(--color-text-body, var(--color-text)); list-style: decimal; }
.ai-panel .ai-panel__list li { padding-left: 4px; color: inherit; font-size: inherit; line-height: inherit; }
.ai-panel .ai-panel__list li::before { content: none; }
.ai-panel .ai-panel__list li::marker { color: #7c5cff; font-weight: 500; }
.ai-thinking { display: none; align-items: center; gap: 10px; margin: 20px 0 4px; font-size: 15px; }
.ai-thinking::before { content: ""; width: 18px; height: 18px; border-radius: 50%; background: var(--ai-grad); -webkit-mask: radial-gradient(circle, transparent 5px, #000 6px); mask: radial-gradient(circle, transparent 5px, #000 6px); animation: ai-spin 1s linear infinite; }
.ai-thinking { background: linear-gradient(90deg, #999 0%, #212121 40%, #999 80%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: ai-shimmer 1.1s linear infinite; }
.ai-panel.is-thinking .ai-thinking { display: flex; }
.ai-panel.is-thinking .ai-panel__list { display: none; }
/* writing: items appear as they are typed, with a gradient caret */
.js .ai-panel:not(.is-ready) .ai-panel__list > li, .js .ai-panel.is-writing .ai-panel__list > li:not(.is-on):not(.is-typed) { display: none; }
.ai-panel__list > li.is-on::after { content: ""; display: inline-block; width: 8px; height: 16px; margin-left: 2px; vertical-align: -2px; border-radius: 2px; background: linear-gradient(#7c5cff, #00a3ff); animation: ai-caret .8s steps(2) infinite; }
.ai-panel__list > li.is-on, .ai-panel__list > li.is-typed { animation: rise-in .4s var(--ease-out) backwards; }
@keyframes ai-caret { 50% { opacity: 0; } }
@media (max-width: 809.98px) { .ai-mark, .ai-panel__title { font-size: 26px; } .ai-panel { padding: 16px; } }
.w3-summary, .tr-summary { margin-top: 0; }
.case-head--v2 .ai-panel { margin-top: 8px; }
.tr-head .ai-panel, .case-head .ai-panel { scroll-margin-top: calc(var(--header-h) + 24px); }

/* header AI button + popover */
.site-ai { display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 14px 0 11px; border: 0; border-radius: 999px; background: #fff; color: var(--color-text); font: inherit; font-size: 15px; font-weight: 900; letter-spacing: -.02em; cursor: pointer; transition: transform .35s var(--ease-spring), box-shadow .3s var(--ease-out); }
.site-ai svg { color: #7c5cff; transition: transform .5s var(--ease-spring); }
.site-ai:hover { background: #f3f0ff; }
.site-ai:hover svg, .site-ai[aria-expanded="true"] svg { transform: rotate(72deg) scale(1.12); }
.site-ai:active { transform: scale(.96); }
.site-header--center .site-ai { margin-left: -12px; }
@media (max-width: 809.98px) { .site-ai { margin-left: auto; margin-right: 8px; height: 34px; } .site-header--center .site-ai { margin-left: auto; } }
.ai-pop { position: fixed; z-index: 60; width: min(380px, calc(100vw - 24px)); padding: 20px; border-radius: 24px; background: rgba(255,255,255,.94); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); box-shadow: 0 0 0 1px rgba(0,0,0,.05), 0 24px 60px rgba(0,0,0,.16);
  opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.97); transform-origin: top right; transition: opacity .25s var(--ease-out), transform .45s var(--ease-spring), visibility 0s .25s; }
.ai-pop.is-open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.ai-pop__title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 17px; font-weight: 500; letter-spacing: -.01em; }
.ai-pop__title svg { color: #7c5cff; }
.ai-pop__text { margin: 8px 0 16px; font-size: 14px; line-height: 21px; color: var(--color-text-muted); }
.ai-pop .ai-tool { background: var(--color-plate); box-shadow: none; }
.ai-pop .ai-tool:hover { background: #efefef; box-shadow: none; }
.ai-pop .ai-tool.is-on, .ai-pop .ai-tool.is-done { background: var(--color-text); }
.ai-pop__links { display: flex; flex-wrap: wrap; gap: 16px; margin: 16px 0 0; font-size: 14px; }
.ai-pop__links a { color: var(--color-link); text-decoration: none; }
.ai-pop.is-open > * { animation: rise-in .5s var(--ease-out) backwards; }
.ai-pop.is-open > :nth-child(2) { animation-delay: .04s; } .ai-pop.is-open > :nth-child(3) { animation-delay: .08s; } .ai-pop.is-open > :nth-child(4) { animation-delay: .12s; }

/* home "Talk to this portfolio" */
.ai-band { margin-top: var(--section-gap); }
.ai-card { border-radius: 32px; padding: 48px; background: var(--color-plate); overflow: hidden; display: grid; gap: 40px; align-items: center; }
.ai-card::before { content: ""; position: absolute; inset: -40%; z-index: -1; background: conic-gradient(from var(--ai-angle), rgba(124,92,255,.16), rgba(0,179,255,.12), rgba(46,230,166,.12), rgba(255,176,32,.10), rgba(255,92,138,.12), rgba(124,92,255,.16)); filter: blur(60px); animation: ai-spin 14s linear infinite; }
.ai-card::after { padding: 2px; }
@media (min-width: 1000px) { .ai-card { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 56px; padding: 56px; } }
.ai-card .t-section { margin: 0; }
.ai-card__text p { margin: 20px 0 0; max-width: 520px; font-size: 17px; line-height: 27px; color: var(--color-text-muted); }
.ai-card__text .ai-card__hint { margin-top: 12px; font-size: 15px; line-height: 23px; color: var(--color-text-muted); opacity: .85; }
.ai-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ai-tile { position: relative; display: grid; grid-template-rows: auto 1fr auto; gap: 4px; min-height: 148px; padding: 20px; border: 0; border-radius: 24px; background: rgba(255,255,255,.82); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: var(--color-text); font: inherit; text-align: left; text-decoration: none; cursor: pointer; box-shadow: 0 0 0 1px rgba(0,0,0,.04); transition: transform .45s var(--ease-spring), box-shadow .35s var(--ease-out), background .25s; }
.ai-tile:hover { color: var(--color-text); background: #fff; }
.ai-tile:active { transform: scale(.98); transition-duration: .1s; }
.ai-tile__icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 20px; border-radius: 14px; background: var(--color-plate); transition: transform .5s var(--ease-spring); }
.ai-tile__icon img, .ai-tile__icon svg { width: 24px; height: 24px; }
.ai-tile:hover .ai-tile__icon { transform: rotate(-8deg) scale(1.08); }
.ai-tile__title { align-self: end; font-size: 18px; font-weight: 500; letter-spacing: -.01em; }
.ai-tile__title.is-done { color: #7c5cff; }
.ai-tile__sub { font-size: 14px; line-height: 20px; color: var(--color-text-muted); }
.js .ai-card.reveal .ai-tile { opacity: 0; transform: translateY(16px) scale(.98); }
.ai-card.reveal.is-in .ai-tile, .reveal.is-in .ai-card .ai-tile { opacity: 1; transform: none; transition: opacity .6s var(--ease-out), transform .8s var(--ease-spring); }
.reveal.is-in .ai-card .ai-tile:nth-child(2) { transition-delay: .07s; } .reveal.is-in .ai-card .ai-tile:nth-child(3) { transition-delay: .14s; } .reveal.is-in .ai-card .ai-tile:nth-child(4) { transition-delay: .21s; }
@media (max-width: 809.98px) { .ai-card { padding: 28px 20px 20px; border-radius: 24px; } .ai-tile { min-height: 124px; padding: 16px; } .ai-tile__icon { margin-bottom: 12px; } .ai-tile__title { font-size: 16px; } }
@media (prefers-reduced-motion: reduce) { .ai-panel::before, .ai-card::before, .ai-card::after, .site-ai::before, .ai-panel__star svg, .ai-thinking { animation: none; } }

/* 21. QA fixes (28.11) */
@media (max-width: 809.98px) {
  /* backdrop-filter on the header made it the containing block of the fixed menu */
  .js .site-header.is-open { -webkit-backdrop-filter: none; backdrop-filter: none; background: #fff; }
  .js .site-nav { height: calc(100dvh - var(--header-h)); }
}
body { overflow-x: clip; }
.ai-panel .ai-panel__body .ai-panel__list { padding-top: 16px; }
.ai-tool--read { padding-left: 12px; }
.ai-tool--read .ai-mark { font-size: 15px; letter-spacing: -.02em; gap: 0; background: linear-gradient(100deg, #b6a4ff, #5cc8ff 50%, #ff8fb1); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ai-tool--read .ai-mark svg { width: 9px; height: 9px; margin-top: -2px; color: #b6a4ff; }
.ai-tool--read.is-on .ai-mark { background: linear-gradient(100deg, #7c5cff, #00a3ff 50%, #ff5c8a); -webkit-background-clip: text; background-clip: text; }
.ai-tool--read.is-on .ai-mark svg { color: #7c5cff; }
.site-ai { gap: 0; padding: 0 12px 0 14px; align-items: center; }
.site-ai svg { width: 10px; height: 10px; margin: -9px 0 0 1px; }
.site-ai:hover svg, .site-ai[aria-expanded="true"] svg { transform: rotate(72deg) scale(1.2); }
.ai-panel .ai-tools { gap: 6px; }
.ai-panel .ai-tool { padding: 0 12px; gap: 6px; }
/* panel without the grey plate: white card, gradient contour, grey pills like the link buttons */
.ai-panel { background: #fff; padding: 12px; border-radius: 26px; }
.ai-panel .ai-tool:not(.ai-tool--read) { background: var(--color-plate); box-shadow: none; }
.ai-panel .ai-tool:not(.ai-tool--read):hover { background: var(--color-plate-hover); }
.ai-panel .ai-tool.is-on:not(.ai-tool--read), .ai-panel .ai-tool.is-done:not(.ai-tool--read) { background: var(--color-text); color: #fff; }
.ai-panel .ai-tool--read.is-on { background: var(--color-plate); box-shadow: none; }
.ai-tool--icon { width: 36px; padding: 0 !important; justify-content: center; }
.ai-panel .ai-panel__list { padding: 12px 12px 8px 32px; }
.ai-panel .ai-thinking { margin: 16px 12px 8px; }
/* "Ask [Claude][ChatGPT]" as one pill */
.ai-ask { display: inline-flex; align-items: center; gap: 2px; height: 36px; padding: 0 3px 0 14px; border-radius: 999px; background: var(--color-plate); font-size: 14px; }
.ai-ask__label { margin-right: 6px; color: var(--color-text); }
.ai-panel .ai-ask .ai-tool--icon { width: 30px; height: 30px; background: #fff; }
.ai-panel .ai-ask .ai-tool--icon:hover { background: #ececec; }
/* 20b. "AI overview" block (28.11 v3, after Google's AI overview): white card, gradient contour,
   title with a gradient spark, round actions of one size, summary types itself, Ask field. */
.ai-ov { padding: 20px 24px 16px; border-radius: 28px; background: #fff; }
.ai-ov__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ai-ov__title { display: inline-flex; align-items: center; gap: 10px; margin: 0; font-size: 18px; line-height: 24px; font-weight: 500; letter-spacing: -.01em; }
.ai-ov__spark { flex: none; animation: ai-twinkle 2.6s var(--ease-out) infinite; }
.ai-ov__acts { display: flex; gap: 6px; }
.ai-round { width: 40px; height: 40px; padding: 0 !important; justify-content: center; border-radius: 50%; }
.ai-round span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ai-ov .ai-round { background: var(--color-plate); box-shadow: none; color: var(--color-text); }
.ai-ov .ai-round:hover { background: var(--color-plate-hover); }
.ai-ov .ai-round.is-on, .ai-ov .ai-round.is-done { background: var(--color-text); color: #fff; }
.ai-ov__body { margin-top: 14px; }
.ai-ov .ai-panel__list { margin: 0; padding: 0 0 0 20px; display: grid; gap: 10px; font-size: 16px; line-height: 25px; color: var(--color-text); list-style: decimal; }
.ai-ov .ai-thinking { margin: 4px 0; }
.ai-ov:not(.is-open) .ai-panel__list > li.is-extra { display: none; }
.ai-ov:not(.is-open) .ai-ov__body { -webkit-mask: linear-gradient(#000 70%, transparent); mask: linear-gradient(#000 70%, transparent); }
.ai-ov.is-writing .ai-ov__body, .ai-ov.is-thinking .ai-ov__body { -webkit-mask: none; mask: none; }
.ai-ov__more { display: inline-flex; align-items: center; gap: 6px; height: 40px; margin: 8px 0 0; padding: 0 16px; border: 0; border-radius: 999px; background: var(--color-plate); color: var(--color-text); font: inherit; font-size: 15px; cursor: pointer; transition: background .2s; }
.ai-ov__more:hover { background: var(--color-plate-hover); }
.ai-ov__more svg { transition: transform .45s var(--ease-spring); }
.ai-ov.is-open .ai-ov__more svg { transform: rotate(180deg); }
.ai-ov__ask { display: flex; align-items: center; gap: 6px; margin-top: 16px; padding: 4px 4px 4px 20px; border-radius: 999px; background: var(--color-plate); transition: box-shadow .25s var(--ease-out), background .25s; }
.ai-ov__ask:focus-within { background: #fff; box-shadow: 0 0 0 1.5px #7c5cff, 0 6px 20px rgba(124,92,255,.12); }
.ai-ov__ask input { flex: 1; min-width: 0; height: 40px; border: 0; background: none; font: inherit; font-size: 15px; color: var(--color-text); outline: none; }
.ai-ov__ask input::placeholder { color: var(--color-text-muted); }
.ai-ov__send { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: #fff; cursor: pointer; transition: background .2s; }
.ai-ov__send:hover { background: #ececec; }
.ai-ov__ask:focus-within .ai-ov__send { background: var(--color-plate); }
.ai-ov__send img { width: 18px; height: 18px; }
@media (max-width: 809.98px) { .ai-ov { padding: 16px 16px 12px; border-radius: 24px; } .ai-ov .ai-panel__list { font-size: 15px; line-height: 24px; } }
.ai-ov:not(.is-ready) .ai-ov__more { display: none; }
.ai-ov.is-writing .ai-ov__more { opacity: .4; pointer-events: none; }
/* Ask row: field + two labelled buttons of the same 40px height */
.ai-ov__ask { flex-wrap: wrap; gap: 6px; padding: 0; background: none; border-radius: 0; }
.ai-ov__ask:focus-within { background: none; box-shadow: none; }
.ai-ov__field { flex: 1 1 180px; display: flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 999px; background: var(--color-plate); transition: background .25s, box-shadow .25s var(--ease-out); cursor: text; }
.ai-ov__field:focus-within { background: #fff; box-shadow: 0 0 0 1.5px #7c5cff, 0 6px 20px rgba(124,92,255,.12); }
.ai-ov__send { display: inline-flex; gap: 8px; width: auto; padding: 0 16px 0 14px; border-radius: 999px; background: var(--color-plate); color: var(--color-text); font: inherit; font-size: 15px; white-space: nowrap; }
.ai-ov__send:hover, .ai-ov__ask:focus-within .ai-ov__send:hover { background: var(--color-plate-hover); }
.ai-ov__ask:focus-within .ai-ov__send { background: var(--color-plate); }
.ai-ov__more { font-size: 15px; }
.ai-ov__field { flex-basis: 100%; }
.ai-ov__send { flex: 1 1 0; justify-content: center; }
/* compact: collapsed overview shows ~4 lines, Ask row is one line */
.ai-ov__body { position: relative; }
.ai-ov:not(.is-open) .ai-panel__list > li.is-extra { display: list-item; }
.ai-ov:not(.is-open) .ai-ov__body { max-height: 108px; overflow: hidden; -webkit-mask: linear-gradient(#000 45%, transparent); mask: linear-gradient(#000 45%, transparent); }
.ai-ov.is-thinking .ai-ov__body { max-height: none; }
.ai-ov .ai-panel__list { font-size: 15px; line-height: 24px; }
.ai-ov__more { height: 32px; margin-top: 4px; padding: 0 12px; font-size: 14px; }
.ai-ov__ask { flex-wrap: nowrap; margin-top: 14px; }
.ai-ov__field { flex: 1 1 0; min-width: 0; }
.ai-ov__send { flex: none; }
@media (max-width: 520px) { .ai-ov__ask { flex-wrap: wrap; } .ai-ov__field { flex-basis: 100%; } .ai-ov__send { flex: 1 1 0; } }
/* no input: Show more on the left, Ask buttons on the right, one row */
.ai-ov__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.ai-ov__foot .ai-ov__more { margin: 0; height: 40px; padding: 0 14px; }
.ai-ov__foot .ai-ov__more[hidden] + .ai-ov__ask { margin-left: auto; }
.ai-ov__foot .ai-ov__ask { margin: 0; flex-wrap: nowrap; }
@media (max-width: 520px) { .ai-ov__foot .ai-ov__ask { width: 100%; } .ai-ov__foot .ai-ov__send { flex: 1 1 0; } }
/* head actions: labelled pills with OTT DS icons */
.ai-ov .ai-pill { height: 40px; padding: 0 14px 0 12px; gap: 6px; background: var(--color-plate); box-shadow: none; color: var(--color-text); font-size: 14px; }
.ai-ov .ai-pill:hover { background: var(--color-plate-hover); }
.ai-ov .ai-pill.is-on, .ai-ov .ai-pill.is-done { background: var(--color-text); color: #fff; }
.ai-ov__head { flex-wrap: wrap; row-gap: 10px; }

/* 21b. Final design pass (28.11). Shared layout fixes; the AI layer above is untouched. */
/* bleed sliders: the first slide sits on the content grid, the strip runs to the band edge on both sides */
.slider--bleed { padding-inline: var(--pad); scroll-padding-inline: var(--pad); } /* % in scroll-padding is of the scrollport, not the parent: use --pad (the grid offset) */
/* case head grid: columns never grow past the container (a wide child used to push RU W3 to 380px at 375) */
.case-head__row > * { min-width: 0; }
.case-head .cv-row__body { grid-template-columns: minmax(0, 1fr); }
/* phone-width chapter strip: runs edge to edge and fades out at the sides instead of being cut */
@media (max-width: 809.98px) {
  .case-toc__inner {
    width: 100%; max-width: none; padding-inline: var(--pad); scroll-padding-inline: var(--pad);
    -webkit-mask: linear-gradient(90deg, transparent, #000 var(--pad), #000 calc(100% - 40px), transparent);
            mask: linear-gradient(90deg, transparent, #000 var(--pad), #000 calc(100% - 40px), transparent);
  }
  .case-toc__inner::after { content: ""; flex: 0 0 16px; }
  /* footer CTA stays one line on phones */
  .footer-cta { width: 100%; height: 64px; justify-content: space-between; padding: 0 24px 0 28px; font-size: 19px; white-space: nowrap; }
}
/* 22. No shadows (28.11, owner): floating bars and popovers are separated by a hairline only */
@media (min-width: 810px) {
  .site-header--center .site-header__inner:hover,
  .site-header--center .site-header__inner:focus-within,
  .site-header.is-scrolled .site-header__inner,
  .site-header.is-scrolled .site-header__inner:hover { box-shadow: 0 0 0 1px rgba(0, 0, 0, .07); }
}
@media (max-width: 809.98px) { .case-toc { box-shadow: 0 0 0 1px rgba(0, 0, 0, .07); } }
.popover { box-shadow: 0 0 0 1px rgba(0, 0, 0, .08) !important; }
.ai-pop { box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }
.ai-ov__field:focus-within { box-shadow: 0 0 0 1.5px #7c5cff; }
@media (min-width: 810px) { .case-toc__inner { box-shadow: 0 0 0 1px rgba(0, 0, 0, .07); } }
.has-popover .popover::after { box-shadow: none !important; }
.hero--home .hero__icon-btn:hover .hero__icon, .hero--home .hero__icon-btn:focus-visible .hero__icon { box-shadow: none !important; }
.hero--home .hero__avatar:hover { filter: none !important; }
.hero--home .hero__icon[src*="icon-medtech"] { box-shadow: 0 0 0 1px rgba(0, 0, 0, .08) !important; }
.cv-page__photo { box-shadow: none !important; }
/* home AI card: contour only, like the case AI overview (no gradient fill) */
.ai-card { background: #fff; }
.ai-card::before { content: none; }
.ai-tile { background: var(--color-plate); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; }
.ai-tile:hover { background: var(--color-plate-hover); }
.ai-tile__icon { background: #fff; }
/* header AI: a quiet nav item (28.11): link colour like Work/CV/Contact, colour only in the spark;
   the gradient contour shows on hover and while the popover is open */
.site-ai { background: transparent; color: var(--color-text-muted); font-weight: var(--fw); font-size: 15px; letter-spacing: -0.2px; padding: 0 12px 0 14px; transition: color .2s, background .2s; }
.site-ai::before { opacity: 0; transition: opacity .3s var(--ease-out); }
.site-ai:hover, .site-ai[aria-expanded="true"] { color: var(--color-text); background: transparent; }
.site-ai:hover::before, .site-ai[aria-expanded="true"]::before { opacity: 1; }

/* header order and weight (28.11): Work · CV · Contact · AI · RU; the language pill is light, not a black mass */
@media (min-width: 810px) {
  .site-header--center .site-nav { display: contents; }
  .site-header--center .site-header__inner { gap: 2px; }
  .site-header--center .site-header__logo { margin-right: 18px; }
  .site-header--center .site-ai { order: 1; margin-left: 0; }
  .site-header--center .site-lang { order: 2; margin-left: 6px; }
}
.site-header--center .site-lang, .site-header--center .site-lang:hover { background: var(--color-plate); color: var(--color-text); box-shadow: none; transform: none; }
.site-header--center .site-lang:hover { background: var(--color-plate-hover); }
.ai-pop__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ai-pop__grid .ai-tool { height: 40px; justify-content: center; }
.ai-pop { width: min(440px, calc(100vw - 24px)); }
.btn__icon, .btn > img { flex: none; display: block; }
/* chips: one shared component (28.11). One line, pill; if a chip ever has to wrap (narrow phones) it becomes
   a rounded block with even padding instead of a squashed ellipse. */
.case-tags li { white-space: nowrap; line-height: 20px; padding-block: 8px; min-height: 36px; box-sizing: border-box; }
@media (max-width: 520px) { .case-tags li { white-space: normal; border-radius: 18px; } }
/* scroll chaining (28.11): inner demo scrollers hand the wheel back to the page at their ends, never trap it */
.phone__scroll, .h-pf__sc { overscroll-behavior: auto !important; }

/* shared row of link buttons in a case head (w3-links / tr-links are the same thing per page) */
.case-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
.case-head .case-links + .ai-panel, .case-head .case-links + details { margin-top: 16px; }
/* home AI section uses the home grid (28.11): pill buttons; Claude logo on the dark button sits on a white disc */
.h-ai__actions .btn img, .h-ai__actions .btn svg { width: 18px; height: 18px; flex: none; }
.h-ai__actions .btn--primary img { background: #fff; border-radius: 50%; padding: 2px; box-sizing: content-box; width: 16px; height: 16px; }
.h-ai__actions .btn.is-done { background: var(--color-text); color: #fff; }
.h-ai__actions { margin-left: 0 !important; margin-top: 32px; }
/* AI charm without fills (28.11): gradient only in the "AI>" word and in thin contours */
.ai-grad-text { background: linear-gradient(100deg, #7c5cff 0%, #00a3ff 35%, #2ee6a6 55%, #ff5c8a 80%, #7c5cff 100%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: ai-flow 8s linear infinite; }
@keyframes ai-flow { to { background-position: -200% 0; } }
.h-ai__actions .btn { position: relative; isolation: isolate; }
.h-ai__actions .btn::after { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none; background: var(--ai-grad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity .3s var(--ease-out); animation: ai-spin 6s linear infinite; }
.h-ai__actions .btn:hover::after, .h-ai__actions .btn:focus-visible::after { opacity: 1; }
.h-ai__actions .btn--primary { background: #fff; color: var(--color-text); }
.h-ai__actions .btn--primary::after { opacity: 1; }
.h-ai__actions .btn--primary:hover { background: var(--color-plate); color: var(--color-text); }
.h-ai__actions .btn--primary img { background: none; padding: 0; width: 18px; height: 18px; }
@media (prefers-reduced-motion: reduce) { .ai-grad-text, .h-ai__actions .btn::after { animation: none; } }
#ai .ai-ov { margin-top: 32px; }
.popover__go { display: inline-block; margin-top: 8px; font-size: 14px; color: var(--color-link); text-decoration: none; }

/* ---------- 17. Compare (28.11) ----------
   Two screens of the same size stacked in .compare__stage, a Before/After segmented pill above it (.compare__toggle).
   Switching wipes the "after" layer in left to right (or out right to left) with clip-path, 700ms ease-out-expo, a 1px light
   edge rides the wipe front. Dragging across the stage scrubs, release snaps to the nearer state. site.js drives it.
   Markup:
   <div class="compare" data-compare style="--compare-ar: 1968 / 1124">
     <div class="compare__toggle" role="radiogroup" aria-label="..."><span class="compare__thumb"></span>
       <button type="button" role="radio" aria-checked="true" data-state="before">Before</button>
       <button type="button" role="radio" aria-checked="false" data-state="after">After</button></div>
     <div class="compare__stage">
       <div class="compare__layer compare__layer--before">...</div>
       <div class="compare__layer compare__layer--after">...</div>
       <span class="compare__edge"></span></div>
   </div> */
.compare { --cmp: 0%; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.compare__toggle { position: relative; display: inline-flex; padding: 3px; border: 1px solid rgba(0, 0, 0, .07); border-radius: 999px; background: #fff; }
.compare__toggle button { position: relative; z-index: 1; height: 32px; padding: 0 18px; border: 0; border-radius: 999px; background: none; color: #777; font: 500 15px/32px "Inter", sans-serif; letter-spacing: -0.01em; cursor: pointer; transition: color .25s var(--ease-out); }
.compare__toggle button:hover { color: #212121; }
.compare__toggle button[aria-checked="true"] { color: #fff; }
.compare__thumb { position: absolute; z-index: 0; left: 0; top: 3px; width: 0; height: 32px; border-radius: 999px; background: #212121; transition: transform .55s var(--ease-spring), width .55s var(--ease-spring); }
.compare__stage { position: relative; width: 100%; aspect-ratio: var(--compare-ar, 16 / 10); border-radius: 24px; overflow: hidden; isolation: isolate; background: #fff; user-select: none; -webkit-user-select: none; }
/* the whole band (or the block) scrubs the wipe; site.js adds .compare-zone */
.compare-zone { cursor: ew-resize; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.compare-zone .compare__toggle { cursor: default; }
.compare__layer { position: absolute; inset: 0; overflow: hidden; }
.compare__layer > img { display: block; width: 100%; height: auto; max-width: none; pointer-events: none; -webkit-user-drag: none; }
.compare__layer--after { clip-path: inset(0 calc(100% - var(--cmp)) 0 0); }
.compare__edge { position: absolute; z-index: 2; top: 0; bottom: 0; left: var(--cmp); width: 2px; margin-left: -1px; background: linear-gradient(90deg, rgba(0, 0, 0, .1) 50%, rgba(255, 255, 255, .95) 50%); opacity: 0; transition: opacity .2s; pointer-events: none; }
.compare.is-moving .compare__edge { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .compare__thumb { transition: none; } }
/* popover head: icon + name with the period right under it (28.11) */
.popover__name { display: flex; flex-direction: column; gap: 0; }
.popover__name .popover__meta { margin: 0; font-size: 13px; line-height: 17px; letter-spacing: 0; }
.popover__head img { width: 36px; height: 36px; border-radius: 10px; }
/* button sizes (28.11): two sizes only. L = 48px for buttons in content (CTA, links in case heads, CV actions),
   M = 40px for tools inside cards and panels (AI overview, popovers, chips-as-buttons). */
.btn { min-height: 48px; padding: 0 24px; }
.btn--sm { min-height: 40px; padding: 0 16px; }
/* phones: the AI overview footer never overflows; "Ask" drops off first (28.11) */
.ai-ask-word { font-style: normal; }
@media (max-width: 520px) {
  .ai-ov__foot .ai-ov__ask { width: 100%; }
  .ai-ov__foot .ai-ov__send { flex: 1 1 0; min-width: 0; padding: 0 12px; }
  .ai-ov__head .ai-pill { padding: 0 12px; }
}
@media (max-width: 420px) { .ai-ask-word { display: none; } }
@media (max-width: 520px) {
  .ai-ov__acts { width: 100%; }
  .ai-ov__acts .ai-pill { flex: 1 1 0; min-width: 0; justify-content: center; }
}
@media (max-width: 520px) { .ai-pop__grid { grid-template-columns: 1fr; } }
/* auto-drifting strips on mouse/trackpad devices are not wheel scrollers: the page always gets the wheel (28.11) */
/* external buttons: a small arrow up-right after the label, a touch lighter; it nudges on hover (28.11) */
.btn__ext { margin-left: -4px; margin-right: -4px; opacity: .6; transition: transform .25s var(--ease-out), opacity .2s; }
.btn:hover .btn__ext { opacity: .9; transform: translate(2px, -2px); }
/* AI overview loading state (28.11): shimmer lines hold the collapsed height, the spark turns while it thinks and writes */
.ai-skel { display: none; }
.ai-ov.is-thinking .ai-skel { display: grid; gap: 12px; margin-top: 14px; }
.ai-skel i { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, #f1f1f1 0%, #e2e2e2 40%, #f1f1f1 80%); background-size: 200% 100%; animation: ai-shimmer 1.1s linear infinite; }
.ai-skel i:nth-child(1) { width: 94%; } .ai-skel i:nth-child(2) { width: 81%; } .ai-skel i:nth-child(3) { width: 58%; animation-delay: .1s; }
.ai-ov.is-thinking .ai-ov__body, .ai-ov:not(.is-open).is-writing .ai-ov__body { min-height: 108px; max-height: 108px; }
.ai-ov.is-thinking .ai-ov__spark, .ai-ov.is-writing .ai-ov__spark { animation: ai-spark 1.6s var(--ease-out) infinite; }
@keyframes ai-spark { 0% { transform: rotate(0) scale(1); } 50% { transform: rotate(90deg) scale(.82); } 100% { transform: rotate(180deg) scale(1); } }
.ai-ov.is-thinking .ai-ov__more { display: none; }
.ai-ov .ai-panel__list > li { animation: none; }
@media (prefers-reduced-motion: reduce) { .ai-skel i, .ai-ov .ai-ov__spark { animation: none !important; } }
/* the white medtech tile keeps its hairline on hover (28.11) */
.hero--home .hero__icon-btn:hover .hero__icon[src*="icon-medtech"], .hero--home .hero__icon-btn:focus-visible .hero__icon[src*="icon-medtech"] { box-shadow: 0 0 0 1px rgba(0, 0, 0, .1) !important; }
/* case heads on shorter screens: less air above the title so the AI overview fits the first screen (28.11) */
@media (min-width: 810px) and (max-height: 880px) {
  .case-head { padding-top: 40px; }
  .case-head .cv-row { margin-top: 32px; }
}
html[lang="ru"] .case-head .ai-ask-word { display: none; }   /* RU: "Спросить" makes the row wrap; the logos say who you ask (28.11) */
/* bands on case pages are rounded like the home bands: 32 px, 24 px on phones (29.11).
   A band that continues the one above (.band--follow) joins it without a seam. */
main .band { border-radius: 24px; }
@media (min-width: 810px) { main .band { border-radius: 32px; } }
main .band:has(+ .band--follow) { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
main .band--follow { border-top-left-radius: 0; border-top-right-radius: 0; }
/* phones (29.11): content buttons span the column like native actions; a single one takes the full width,
   a pair splits it evenly, a group of external links goes two per row. Panel and small buttons keep their size. */
@media (max-width: 559.98px) {
  main .btn:not(.btn--sm) { flex: 1 1 100%; width: 100%; justify-content: center; }
  main :is(.h-cv__actions, .cv-page__actions) { display: flex; flex-wrap: wrap; gap: 8px; }
  main :is(.h-cv__actions, .cv-page__actions) > .btn:not(.btn--sm) { flex: 1 1 0; width: auto; min-width: 0; }
  main :is(.case-links, .w3-links, .tr-links) { display: flex; flex-wrap: wrap; gap: 8px; }
  main :is(.case-links, .w3-links, .tr-links) > .btn:not(.btn--sm) { flex: 1 1 calc(50% - 4px); width: auto; min-width: max-content; padding-inline: 12px; }   /* a label too long for half a row takes the whole row instead of spilling (29.11) */
}
@media (max-width: 559.98px) {
  main .cv-page__actions > .btn:not(.btn--sm) { flex: 1 1 100%; padding-inline: 24px; }   /* three different lengths: one per row */
  main :is(.case-links, .w3-links, .tr-links) > .btn:not(.btn--sm) { padding-inline: 16px; }
}

/* narrow phones (320–359, 29.11): the footer CTA and the home CV buttons fit without spilling */
@media (max-width: 359.98px) {
  .footer-card__top { grid-template-columns: minmax(0, 1fr); }
  .footer-cta { padding: 0 20px 0 22px; font-size: 17px !important; }
  main .h-cv__actions > .btn:not(.btn--sm) { flex: 1 1 100%; }
}

/* 23. Mobile menu sheet + RU | EN switch (29.11, concept A «Шторка», menu-sheet.js) */
.ms-ico { display: inline-block; width: 18px; height: 18px; flex: none; background: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.lang-seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 999px; background: var(--color-plate); font-size: 13px; letter-spacing: .02em; }
.lang-seg__thumb { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.06); transform: translateX(calc(var(--x, 0) * 100%)); transition: transform .45s var(--ease-spring); }
.lang-seg__opt { position: relative; display: grid; place-items: center; height: 28px; padding: 0 10px; color: var(--color-text-muted); text-decoration: none; transition: color .25s; }
.lang-seg__opt.is-cur, .lang-seg a.lang-seg__opt:hover { color: var(--color-text); }
.lang-seg.is-go .lang-seg__opt.is-cur { color: var(--color-text-muted); } .lang-seg.is-go a.lang-seg__opt { color: var(--color-text); }
.lang-seg--big { font-size: 16px; letter-spacing: -0.01em; } .lang-seg--big .lang-seg__opt { height: 40px; }
@media (min-width: 810px) { .ms-scrim, .ms-sheet { display: none !important; } }
@media (max-width: 809.98px) { .has-sheet .site-nav { display: none !important; } }
.ms-scrim { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.22); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; visibility: hidden; transition: opacity .35s var(--ease-out), visibility 0s .35s; }
.ms-scrim.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }
.ms-sheet { position: fixed; z-index: 71; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); padding: 10px 20px 20px; border-radius: 32px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.04); text-align: center;
  visibility: hidden; transform: translateY(calc(100% + 24px)); transition: transform .55s var(--ease-out), visibility 0s .55s; }
.ms-sheet.is-open { visibility: visible; transform: none; transition-delay: 0s; }
.ms-grab { display: block; width: 36px; height: 5px; margin: 0 auto 14px; border-radius: 3px; background: #e2e2e2; }
.ms-list { display: flex; flex-direction: column; align-items: center; }
.ms-link { padding: 10px 0; font-size: 32px; line-height: 36px; letter-spacing: -0.03em; color: var(--color-text); text-decoration: none; }
.ms-link:hover { color: var(--color-text); }
.ms-contacts { display: flex; gap: 8px; margin: 18px 0 0; }
.ms-chip { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 999px; background: var(--color-plate); color: var(--color-text); font-size: 16px; text-decoration: none; transition: background .2s, transform .35s var(--ease-spring); }
.ms-chip:hover { background: var(--color-plate-hover); color: var(--color-text); }
.ms-chip:active, .ms-link:active { transform: scale(.97); }
.ms-foot { margin-top: 8px; }
.ms-sheet :is(.ms-link, .ms-contacts, .ms-foot) { opacity: 0; transform: translateY(18px); filter: blur(6px); transition: opacity .3s, transform .5s var(--ease-out), filter .4s; }
.ms-sheet.is-open :is(.ms-link, .ms-contacts, .ms-foot) { opacity: 1; transform: none; filter: none; transition-delay: calc(.08s + var(--n, 4) * .05s); }
.ms-sheet.is-open .ms-foot { transition-delay: .3s; }
@media (prefers-reduced-motion: reduce) { .ms-sheet, .ms-sheet *, .lang-seg__thumb { transition: none !important; } }

/* language in the footer (29.11, Apple-style): the other language, named in itself, with a globe */
.footer-lang { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; margin-top: 4px; font-size: 15px; color: rgba(255,255,255,.5); text-decoration: none; transition: color .2s; }
.footer-lang:hover { color: #fff; }
.footer-lang__ico { width: 16px; height: 16px; background: currentColor; -webkit-mask: url(/assets/img/icons/globe.svg) center / contain no-repeat; mask: url(/assets/img/icons/globe.svg) center / contain no-repeat; }
/* one horizontal: on wide screens the language sits in the bottom row, under the contacts column (same grid as the top) */
.footer-lang--row { display: none; }
@media (min-width: 1000px) {
  .footer-lang--stack { display: none; }
  .footer-card__bottom { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
  .footer-card__bottom > * { grid-row: 1; }
  .footer-lang--row { display: inline-flex; grid-column: 2; justify-self: start; margin: 0; font-size: inherit; }
  .footer-card__bottom > :last-child { grid-column: 2; justify-self: end; }
}

/* 24. Chapter dock (29.11, toc-dock.js): the chapter strip lives at the bottom. Desktop: a floating dock, the current
   chapter dark. Phone: a pill with the current chapter that opens the chapter sheet. */
.has-dock .case-toc { top: auto; bottom: calc(16px + env(safe-area-inset-bottom)); background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; transform: translateY(12px); }
.has-dock .case-toc.is-visible { opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(12px); }
.has-dock.dock-on .case-toc.is-visible { opacity: 1; visibility: visible; pointer-events: auto; transform: none; }
.has-dock.header-hidden .case-toc.is-visible { transform: none; }
.has-dock .case-toc__inner { width: fit-content; max-width: calc(100% - 2 * var(--pad)); margin-inline: auto; padding: 5px; gap: 2px; border-radius: 999px;
  background: rgba(255,255,255,.86); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); box-shadow: 0 0 0 1px rgba(0,0,0,.07); }
.has-dock .case-toc a.is-cur, .has-dock .case-toc a.is-cur:hover { color: #fff; background: var(--color-text); }
.has-dock .case-toc a.is-active:not(.is-cur) { color: var(--color-text-muted); background: none; }
.dock-pill { display: none; }
@media (max-width: 809.98px) {
  .has-dock .case-toc { display: none; }
  .dock-pill { position: fixed; z-index: 45; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom)); display: inline-flex; align-items: center; gap: 8px; height: 44px; max-width: calc(100% - 48px); padding: 0 18px 0 16px; border: 0; border-radius: 999px;
    background: rgba(255,255,255,.88); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); box-shadow: 0 0 0 1px rgba(0,0,0,.07);
    font: inherit; font-size: 15px; color: var(--color-text); cursor: pointer;
    opacity: 0; visibility: hidden; transform: translate(-50%, 16px); transition: opacity .3s var(--ease-out), transform .5s var(--ease-out), visibility 0s .3s; }
  .dock-on .dock-pill { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition-delay: 0s; }
  .dock-pill:active { transform: translate(-50%, 0) scale(.97); }
  .dock-pill__t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
.dock-sheet { max-height: 75dvh; overflow-y: auto; }
.dock-sheet__list { display: flex; flex-direction: column; align-items: center; padding-bottom: 4px; }
.dock-sheet__link { padding: 8px 0; font-size: 26px; line-height: 32px; letter-spacing: -0.03em; color: #a3a3a3; text-decoration: none;
  opacity: 0; transform: translateY(14px); transition: opacity .3s, transform .5s var(--ease-out), color .2s; }
.dock-sheet__link:hover, .dock-sheet__link.is-cur { color: var(--color-text); }
.dock-sheet.is-open .dock-sheet__link { opacity: 1; transform: none; transition-delay: calc(.05s + var(--n) * .03s); }
@media (min-width: 810px) { .dock-sheet, .dock-scrim { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .dock-sheet__link { transition: none !important; } }
