/* ==========================================================================
   dmivanov.ru — global stylesheet
   Everything is a token: spacing, type, color. No clamp() — breakpoints step
   the values. Rounded to a 4 / 8px scale throughout.
   ========================================================================== */

:root {
  /* spacing — multiples of 4 */
  --space-hair: 4px;
  --space-tight: 8px;
  --space-snug: 12px;
  --space-small: 16px;
  --space-medium: 24px;
  --space-large: 32px;
  --space-xlarge: 40px;
  --space-2xlarge: 48px;
  --space-3xlarge: 64px;
  --space-4xlarge: 80px;
  --space-5xlarge: 96px;
  --space-6xlarge: 120px;
  --space-7xlarge: 160px;
  --space-8xlarge: 192px;

  /* type sizes — one scale, 4px grid, ~1.25 step: 12 · 14 · 16 · 20 · 24 · 32 · 40 · 48 · 64 · 80.
     No size exists off this list; the responsive steps below land on it too. */
  --text-size-h1: 64px;
  --text-size-h2: 48px;
  --text-size-h3: 40px;
  --text-size-h4: 32px;
  --text-size-h5: 24px;
  --text-size-h6: 20px;
  --text-size-label: 12px;
  --text-size-meta: 14px;
  --text-size-code: 14px;
  --text-size-body: 16px;
  --text-size-lead: 20px;
  --text-size-prose: 20px;
  --text-size-standfirst: 24px;
  --text-size-quote: 48px;
  --text-size-menu: 80px;
  --text-size-hero: clamp(64px, 13.5vw, 260px);

  --font-sans: "Inter", system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* layout */
  --page-max-width: 1920px;
  --page-gutter: 96px;
  --section-spacing: 88px;
  --prose-measure: 100ch;
  --doc-column-gap: 160px;
  --card-width: 360px;
  --gutter: 20px;
  --marquee-duration: 46s;
  --radius: 8px;
  --blur-shelf-height: 280px;
  --blur-shelf-intensity: 1;

  /* shadcn/ui neutral — light theme source palette */
  --neutral-50: #fafafa;
  --neutral-100: #f5f5f5;
  --neutral-200: #e5e5e5;
  --neutral-300: #d4d4d4;
  --neutral-400: #a3a3a3;
  --neutral-500: #737373;
  --neutral-600: #525252;
  --neutral-700: #404040;
  --neutral-800: #262626;
  --neutral-900: #171717;
  --neutral-950: #0a0a0a;

  /* color — light theme */
  --color-page: #fff;
  --color-ink: var(--neutral-950);
  --color-ink-muted: var(--neutral-500);
  --color-ink-idle: var(--neutral-300);
  --color-tagline: var(--neutral-400);
  --color-line: var(--neutral-200);
  --color-surface: var(--neutral-100);
  --color-accent: var(--neutral-700);
  --color-on-dark: var(--neutral-50);
  --color-contrast-light: var(--neutral-50);
  --color-contrast-dark: var(--neutral-950);

  /* Preserved warm light palette — previous page background: #f2f1ed.
     Rollback map: --color-page ← --color-light-warm-page;
     --color-ink ← --color-light-warm-ink; --color-ink-muted ← --color-light-warm-muted;
     --color-ink-idle ← --color-light-warm-idle; --color-line ← --color-light-warm-line;
     --color-surface ← --color-light-warm-surface; --color-accent ← --color-light-warm-accent;
     --color-on-dark ← --color-light-warm-on-dark. */
  --color-light-warm-page: #f2f1ed; /* Previous --color-page */
  --color-light-warm-ink: #111210; /* Previous --color-ink */
  --color-light-warm-muted: #686963; /* Previous --color-ink-muted */
  --color-light-warm-idle: #c5c4bd; /* Previous --color-ink-idle */
  --color-light-warm-line: #ccccc5; /* Previous --color-line */
  --color-light-warm-surface: rgba(17, 18, 16, .05); /* Previous --color-surface */
  --color-light-warm-accent: #ff4d2e; /* Previous --color-accent */
  --color-light-warm-on-dark: #f6f5f0; /* Previous --color-on-dark */

  /* motion */
  --ease-out-soft: cubic-bezier(.16, 1, .3, 1);
  --duration-fast: .25s;
  --duration-medium: .35s;
  --duration-slow: .6s;
}

/* The second selector covers the first frames, before the page component has
   written its theme: theme-boot.js marks the saved dark theme on <html>, so the
   page starts dark instead of fading in from white through its transition. */
[data-theme="dark"],
html[data-canvas-theme="dark"] .page:not([data-theme="light"]) {
  --color-page: var(--neutral-950);
  --color-ink: var(--neutral-50);
  --color-ink-muted: var(--neutral-400);
  --color-ink-idle: var(--neutral-700);
  --color-tagline: var(--neutral-600);
  --color-line: var(--neutral-800);
  --color-surface: var(--neutral-900);
  --color-accent: var(--neutral-300);
}

@media (max-width: 1440px) { :root { --page-gutter: 48px; --doc-column-gap: 96px; } }
@media (max-width: 1200px) {
  :root {
    --page-gutter: 24px; --section-spacing: 64px; --doc-column-gap: 64px;
    --text-size-h1: 48px; --text-size-h2: 40px; --text-size-h3: 32px; --text-size-h4: 24px; --text-size-h5: 20px; --text-size-h6: 16px;
    --text-size-quote: 40px; --text-size-menu: 64px;
  }
}
@media (max-width: 900px) {
  :root {
    --page-gutter: 32px; --section-spacing: 48px;
    --text-size-quote: 32px; --text-size-menu: 48px;
  }
}
@media (max-width: 1280px) { :root { --blur-shelf-intensity: .6; } }
@media (max-width: 768px) { :root { --blur-shelf-height: var(--space-7xlarge); --blur-shelf-intensity: .45; } }
@media (max-width: 600px) { :root { --blur-shelf-height: calc(var(--space-8xlarge) + var(--space-2xlarge)); --blur-shelf-intensity: .35; } }
@media (min-width: 481px) and (max-width: 600px) { :root { --blur-shelf-height: calc(var(--space-8xlarge) + var(--space-3xlarge) + var(--space-tight)); } }
@media (max-width: 600px) {
  :root {
    --text-size-h1: 40px; --text-size-h2: 32px; --text-size-h3: 24px; --text-size-h4: 20px; --text-size-h5: 18px; --text-size-h6: 16px;
    --page-gutter: 24px; --text-size-menu: 48px; --text-size-standfirst: 20px; --text-size-prose: 16px; }
}

/* --- base ---------------------------------------------------------------- */

* { box-sizing: border-box; }
/* canvas behind the fading-in page; theme-boot.js sets the attribute before
   first paint, so a dark page never flashes white while it loads */
html[data-canvas-theme="dark"] { background: var(--neutral-950); color-scheme: dark; }
/* colour transitions (page, cards, buttons…) would animate the component's
   first light render into the saved theme; hold them all until load */
html[data-theme-loading] .page,
html[data-theme-loading] .page *,
html[data-theme-loading] .page *::before,
html[data-theme-loading] .page *::after { transition: none !important; }
/* Parts loaded through <dc-import> (page tabs, section nav) render a beat after
   the page. Until they arrive the runtime shows an empty .sc-placeholder; keep
   the page hidden meanwhile so it appears whole, and the browser keeps the
   previous page on screen. Scoped to loading, so a failed import cannot hide
   the page for good (an import error fills the placeholder, so it is skipped). */
html[data-theme-loading] .page:has(.sc-placeholder:empty) { visibility: hidden; }
/* the raw component template; the runtime hides it too, but only once it runs */
x-dc { display: none; }
body { margin: 0; font-family: var(--font-sans); font-size: var(--text-size-body); line-height: 1.25; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a:hover { opacity: 1; }
button { color: inherit; font: inherit; }

/* ==========================================================================
   TEXT STYLES — the complete set. Reuse these; do not invent new sizes.
   ========================================================================== */

/* Eight roles, one rule each. The element and its class share the declaration,
   so <h2> and .text-section are the same style by construction. */

.text-hero { margin: 0; font-size: var(--text-size-hero); font-weight: var(--weight-semibold); line-height: .72; letter-spacing: -.075em; }
h1, .text-display { margin: 0; font-size: var(--text-size-h1); font-weight: var(--weight-bold); line-height: 1; letter-spacing: -.045em; text-wrap: pretty; }
h2, .text-section { margin: 0; font-size: var(--text-size-h2); font-weight: var(--weight-bold); line-height: 1.05; letter-spacing: -.04em; text-wrap: pretty; }
.text-quote { margin: 0; font-size: var(--text-size-quote); font-weight: var(--weight-bold); line-height: 1.05; letter-spacing: -.04em; text-wrap: pretty; }
h3, .text-title { margin: 0; font-size: var(--text-size-h3); font-weight: var(--weight-bold); line-height: 1.1; letter-spacing: -.035em; text-wrap: pretty; }
.text-lead { margin: 0; font-size: var(--text-size-lead); font-weight: var(--weight-semibold); line-height: 1.4; letter-spacing: -.02em; text-wrap: pretty; }
h4 { font-size: var(--text-size-h4); font-weight: var(--weight-bold); line-height: 1.15; letter-spacing: -.03em; }
.text-body { margin: 0; font-size: var(--text-size-prose); font-weight: var(--weight-regular); line-height: 1.6; text-wrap: pretty; }
.text-meta { margin: 0; font-size: var(--text-size-meta); font-weight: var(--weight-medium); line-height: 1.4; }
h5 { font-size: var(--text-size-h5); font-weight: var(--weight-bold); line-height: 1.25; letter-spacing: -.025em; }
.text-label { margin: 0; font-size: var(--text-size-label); font-weight: var(--weight-semibold); line-height: 1.4; letter-spacing: .04em; text-transform: uppercase; }
h6 { font-size: var(--text-size-h6); font-weight: var(--weight-bold); line-height: 1.3; letter-spacing: -.02em; }

h1, h2, h3, h4, h5, h6 { margin: 0; text-wrap: pretty; }
h1, h2, h3, h4, h5, h6, .text-display, .text-section, .text-title, .text-quote,
.page-tabs .page-tabs__tab, .row-list .row strong, .prose blockquote, .notfound__links a span {
  font-family: "Manrope", var(--font-sans);
  font-weight: 700;
}

p { margin: 0; font-size: var(--text-size-body); line-height: 1.5; text-wrap: pretty; }
small { font-size: var(--text-size-meta); line-height: 1.4; }
strong { font-weight: var(--weight-semibold); }

.scramble-text {
  display: inline-grid;
  position: relative;
}

.scramble-text__real,
.scramble-text__fx {
  grid-area: 1 / 1;
}

.scramble-text__fx {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.scramble-text[data-scramble-active="true"] .scramble-text__real {
  color: transparent;
}

.scramble-text--hover {
  display: block;
  max-width: 100%;
  position: relative;
}

.scramble-text--hover .scramble-text__real {
  display: block;
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-overflow: inherit;
  white-space: inherit;
}

.scramble-text--hover .scramble-text__fx {
  position: absolute;
  inset: 0;
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-overflow: inherit;
  white-space: inherit;
}

.is-muted { color: var(--color-ink-muted); }

/* --- rolling link (animation spans, nested) ------------------------------ */

.rolling-link { position: relative; }
.rolling-link .rolling-link__clip { display: inline-flex; overflow: hidden; vertical-align: top; height: 1.2em; line-height: 1.2; }
/* The characters slide under the cursor; keeping them out of hit testing lands
   press and release on the static clip, so a quick click always registers. */
.rolling-link .rolling-link__clip .rolling-link__track { display: inline-flex; width: max-content; pointer-events: none; }
.rolling-link .rolling-link__clip .rolling-link__track .rolling-link__char {
  display: block;
  flex-shrink: 0;
  white-space: pre;
  line-height: inherit;
  text-shadow: 0 1.3em 0 currentColor;
  backface-visibility: hidden;
  transform: translateY(0);
  transition: transform .55s var(--ease-out-soft);
}
.rolling-link:hover .rolling-link__clip .rolling-link__track .rolling-link__char,
.rolling-link:focus-visible .rolling-link__clip .rolling-link__track .rolling-link__char { transform: translateY(-1.3em); }

/* --- shell + page transition -------------------------------------------- */

/* Cross-document view transition between pages (Chromium, Safari 18.2+; other
   browsers just navigate). The old page drifts up, shrinks and fades while the
   new one slides in from below over it.
   Switched off on the site — the opt-in below is commented out, the rest is kept
   for reference. The effect lives on as the /experiments/page-transition demo.
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
*/
@keyframes page-leave { to { opacity: 0; transform: translateY(-10%) scale(.95); } }
@keyframes page-arrive { from { transform: translateY(10%); } }
::view-transition-old(root),
::view-transition-new(root) { mix-blend-mode: normal; animation-duration: 1.5s; animation-timing-function: cubic-bezier(.76, 0, .24, 1); animation-fill-mode: both; }
::view-transition-old(root) { animation-name: page-leave; }
::view-transition-new(root) { animation-name: page-arrive; }
/* the slide replaces the usual fade-in, so the new page arrives opaque */
html:active-view-transition .page { animation: none; }
/* the canvas shows around the shrinking old page; keep it in the page colour */
html:has(.page[data-theme="dark"])::view-transition { background: var(--neutral-950); }

@keyframes page-enter { from { opacity: 0; } to { opacity: 1; } }

.page {
  position: relative;
  min-height: 100dvh;
  background: var(--color-page);
  color: var(--color-ink);
  overflow-x: clip;
  transition: background .3s ease, color .3s ease;
  /* load fade switched off for review; restore to bring it back */
  /* animation: page-enter .4s ease both; */
}

.shell { width: 100%; max-width: var(--page-max-width); margin-inline: auto; padding-inline: var(--page-gutter); }

.site-header {
  position: fixed;
  inset: 0 auto auto 50%;
  z-index: 40;
  transform: translateX(-50%);
  inline-size: 100%;
  max-inline-size: var(--page-max-width);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-large);
  padding: var(--space-medium) var(--page-gutter);
  pointer-events: none;
}
.site-header a, .site-header button { pointer-events: auto; cursor: pointer; font-size: var(--text-size-lead); font-weight: var(--weight-semibold); letter-spacing: -.02em; }
.site-header__logo { display: inline-flex; align-items: center; gap: var(--space-snug); width: max-content; min-width: 0; }
.site-header__logo img { inline-size: 24px; block-size: 24px; object-fit: contain; }
.site-header__actions { display: flex; align-items: center; justify-self: end; gap: var(--space-small); }
.site-header__contact { border-bottom: 1px solid currentColor; padding-bottom: 2px; }
.site-header__actions button { display: grid; place-items: center; min-inline-size: 44px; min-block-size: 44px; border: 0; padding: 0; background: transparent; color: inherit; }
.site-header__actions i { display: block; font-size: var(--text-size-h5); line-height: 1; }
.site-header a[data-contrast="light"] { color: var(--color-contrast-light); }
.site-header a[data-contrast="dark"] { color: var(--color-contrast-dark); }

@media (max-width: 600px) {
  .site-header { gap: var(--space-tight); }
  .site-header__actions { gap: var(--space-hair); }
}

@media (max-width: 799px) {
  .site-header {
    display: grid;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    transition: opacity .3s ease, transform var(--duration-medium) var(--ease-out-soft);
  }
  .site-header[data-visible="false"] {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(calc(var(--space-small) * -1));
  }
}

.site-main {
  position: relative;
  padding-top: var(--space-4xlarge);
  padding-bottom: var(--space-4xlarge);
  /* rise-in on load switched off for review; restore these lines to bring it back
  opacity: 0;
  transform: translateY(var(--space-medium));
  transition: opacity .5s ease, transform var(--duration-slow) var(--ease-out-soft); */
}
/* .site-main[data-risen="true"] { opacity: 1; transform: none; } */
.site-main--doc { padding-top: var(--space-6xlarge); padding-bottom: var(--space-5xlarge); }
@media (max-width: 600px) {
  .site-main--article { padding-top: var(--space-4xlarge); padding-bottom: 0; }
}

.skip-link { position: fixed; z-index: 100; top: -80px; left: var(--space-small); padding: var(--space-snug) var(--space-small); border-radius: var(--radius); background: var(--color-ink); color: var(--color-page); font-weight: var(--weight-semibold); transition: top var(--duration-fast) ease; }
.skip-link:focus { top: var(--space-small); }

.tagline { max-width: 64ch; margin: 0 0 var(--space-2xlarge); color: var(--color-tagline); font-family: var(--font-sans); font-size: var(--text-size-lead); font-weight: var(--weight-regular); line-height: 1.4; letter-spacing: 0; text-wrap: pretty; }
@media (max-width: 799px) { .tagline { margin-bottom: var(--page-gutter); font-size: var(--text-size-lead); line-height: 1.4; } }
@media (max-width: 600px) {
  .tagline { margin-bottom: 0; font-size: var(--text-size-h6); line-height: var(--space-medium); }
}
@media (max-width: 480px) { .tagline { font-size: var(--text-size-h6); line-height: var(--text-size-lead); } }

.rule { width: 100vw; margin-inline: calc(50% - 50vw); border-top: 1px solid var(--color-line); }
.rule--spaced { margin-top: var(--section-spacing); }

.section { padding-block: var(--section-spacing); }
.section__heading { margin: 0 0 var(--space-xlarge); }
.experiments-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--gutter); row-gap: var(--space-2xlarge); }
.experiments-grid .work-card { width: auto; }
@media (max-width: 768px) { .experiments-grid { grid-template-columns: minmax(0, 1fr); } }
.experiments-section__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-large);
}
.experiments-section__header .section__heading { margin-bottom: var(--space-xlarge); }
.experiments-section__header .about-text__action { margin-top: 0; white-space: nowrap; }
/* the first band under the tabs sits closer to them */
.section--first { padding-top: var(--space-xlarge); }
/* a band whose content carries its own background ends flush with it */
.section.section--flush-end { padding-bottom: 0; }

/* --- page tabs ----------------------------------------------------------- */

.page-tabs { --page-tabs-text-size: var(--text-size-h1); --page-tabs-icon-size: 40px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-medium); padding-top: var(--space-xlarge); }
.page-tabs__links { display: flex; flex-wrap: nowrap; align-items: baseline; gap: var(--space-medium); min-width: 0; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.page-tabs__links::-webkit-scrollbar { display: none; }
.page-tabs__links .page-tabs__tab { flex: 0 0 auto; }
.page-tabs .page-tabs__tab { display: inline-flex; font-size: var(--page-tabs-text-size); font-weight: var(--weight-bold); letter-spacing: -.04em; line-height: 1.2; color: var(--color-ink-idle); transition: color var(--duration-fast) ease; }
.page-tabs .page-tabs__tab[data-active="true"] { color: var(--color-ink); }
.page-tabs__controls { position: relative; display: flex; align-items: center; }
.page-tabs__desktop-controls { display: flex; align-items: center; gap: var(--space-tight); }
.page-tabs__control { display: grid; place-items: center; min-inline-size: 44px; min-block-size: 44px; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; list-style: none; }
.page-tabs__control::-webkit-details-marker { display: none; }
.page-tabs__control i { display: block; font-size: var(--page-tabs-icon-size); line-height: 1; }
.page-tabs__control:focus-visible { outline: 2px solid var(--color-ink); outline-offset: 2px; }

/* keep the desktop tab and icon sizes until the tabs switch to the mobile layout */
@media (min-width: 800px) and (max-width: 1200px) {
  .page-tabs { --page-tabs-text-size: 64px; --page-tabs-icon-size: 40px; }
}

@media (min-width: 1440px) {
  .page-tabs { --page-tabs-text-size: 88px; --page-tabs-icon-size: 56px; }
  .page-tabs__control { min-inline-size: var(--space-3xlarge); min-block-size: var(--space-3xlarge); }
}

/* narrower large desktops: smaller tab text so the tabs keep room beside the controls */
@media (min-width: 1400px) and (max-width: 1600px) {
  .page-tabs { --page-tabs-text-size: 72px; }
}

@media (max-width: 799px) {
  .page-tabs {
    --page-tabs-text-size: 48px;
    display: flex;
    flex-wrap: nowrap;
    inline-size: calc(100% + (var(--page-gutter) * 2));
    margin-inline: calc(var(--page-gutter) * -1);
    padding-inline: var(--page-gutter);
    overflow-x: auto;
    overflow-y: visible;
    scroll-padding-inline: var(--page-gutter);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .page-tabs::-webkit-scrollbar { display: none; }
  .page-tabs__links,
  .page-tabs__controls { flex: 0 0 auto; }
  .page-tabs__links { gap: var(--space-medium); min-width: max-content; overflow: visible; }
}

@media (max-width: 600px) {
  .page-tabs { gap: var(--space-small); }
}

/* --- feed ---------------------------------------------------------------- */

.feed { display: flex; flex-direction: column; gap: var(--space-tight); padding-top: var(--space-xlarge); padding-bottom: var(--section-spacing); }
.feed .feed__row { display: grid; gap: var(--space-tight); }
.feed .feed__row--split { grid-template-columns: repeat(2, minmax(0, 1fr)); aspect-ratio: 3 / 1; }
.feed .feed__row--wide-left { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); aspect-ratio: 9 / 4; }
.feed .feed__row--wide-right { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); aspect-ratio: 9 / 4; }
.feed .feed__row--full { grid-template-columns: minmax(0, 1fr); aspect-ratio: 16 / 9; }
.feed .feed__tile { position: relative; display: block; inline-size: 100%; block-size: 100%; min-inline-size: 0; min-block-size: 0; padding: 0; border: 0; overflow: hidden; border-radius: var(--radius); background: var(--color-line); color: inherit; text-align: inherit; cursor: pointer; }
.feed .feed__tile img { display: block; inline-size: 100%; block-size: 100%; object-fit: cover; }
/* reveal (Js/feed-reveal.js): a tile turns in from 25° around its left edge, grows
   from 95% and fades in when its row scrolls into view; the tiles of one row start
   one after another. Tiles stay visible until the script marks the feed ready. */
.feed[data-reveal="ready"] .feed__tile {
  opacity: 0;
  transform: perspective(2000px) scale(.95) rotateY(25deg);
  transform-origin: 0% 50%;
  transition:
    opacity 1s var(--ease-out-soft) var(--reveal-delay, 0ms),
    transform 1.2s var(--ease-out-soft) var(--reveal-delay, 0ms);
}
.feed[data-reveal="ready"] .feed__tile[data-revealed="true"] { opacity: 1; transform: none; }
@media (max-width: 600px) {
  .site-main--tabs { padding-bottom: 0; }
  .section { padding-block: var(--space-3xlarge); }
  .experiments-section__header { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-medium); }
  .experiments-section__header .about-text__action { margin-bottom: var(--space-large); }
  .section--first,
  .feed { padding-top: var(--space-large); }
}
/* caption reads without hover, so the scrim and the padding are constant on all four sides */
.feed .feed__caption {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-small);
  padding: var(--space-small);
  color: var(--color-on-dark);
  background: linear-gradient(to top, color-mix(in srgb, var(--neutral-950) 78%, transparent), color-mix(in srgb, var(--neutral-950) 16%, transparent) 68%, transparent);
}
.feed .feed__caption p { font-size: var(--text-size-meta); font-weight: var(--weight-bold); letter-spacing: -.01em; }
.feed .feed__caption small { flex: 0 0 auto; color: color-mix(in srgb, var(--neutral-50) 72%, transparent); font-size: var(--text-size-label); }
@media (max-width: 1023px) { .feed .feed__caption { display: none; } }

.image-preview:not([open]) { display: none; }
.image-preview { --preview-surface: var(--color-page); --preview-ink: var(--color-ink); box-sizing: border-box; inline-size: 100%; max-inline-size: none; block-size: 100%; max-block-size: none; margin: 0; padding: var(--space-large); border: 0; display: grid; place-items: center; overflow: hidden; overscroll-behavior: none; background: var(--preview-surface); color: var(--preview-ink); }
.page[data-theme="dark"] .image-preview { --preview-surface: #fff; --preview-ink: var(--neutral-950); }
.image-preview::backdrop { background: color-mix(in srgb, var(--color-ink) 92%, transparent); }
.image-preview img { display: block; min-inline-size: 0; min-block-size: 0; inline-size: auto; max-inline-size: 100%; block-size: auto; max-block-size: calc(100dvh - var(--space-3xlarge)); margin: 0; object-fit: contain; touch-action: none; user-select: none; transform: translate3d(var(--preview-pan-x, 0), var(--preview-pan-y, 0), 0) scale(var(--preview-scale, 1)); transform-origin: center; will-change: transform; }
.image-preview button { position: fixed; z-index: 1; display: grid; place-items: center; inline-size: 44px; block-size: 44px; border: 1px solid var(--neutral-200); border-radius: 50%; background: var(--preview-surface); color: var(--preview-ink); cursor: pointer; box-shadow: 0 2px 8px rgb(3 7 18 / 12%); }
.image-preview button:not(.menu__close) i { font-size: var(--text-size-h5); line-height: 1; }
.image-preview .menu__close { background: var(--preview-surface); color: var(--preview-ink); }
.image-preview__navigation { inset-block-start: 50%; opacity: 0; pointer-events: none; transform: translateY(-50%); transition: opacity var(--duration-fast) ease; }
.image-preview:hover .image-preview__navigation, .image-preview:focus-within .image-preview__navigation { opacity: 1; pointer-events: auto; }
.image-preview__navigation--previous { inset-inline-start: var(--space-small); }
.image-preview__navigation--next { inset-inline-end: var(--space-small); }
@media (max-width: 600px) { .image-preview { padding: var(--space-medium); } .image-preview .image-preview__navigation { display: none; } }

/* --- works: marquee + rows ---------------------------------------------- */

@keyframes work-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.marquee { width: 100vw; margin-inline: calc(50% - 50vw); overflow: hidden; }
.marquee .marquee__track { display: flex; width: max-content; animation: work-marquee var(--marquee-duration) linear infinite; }
.marquee .marquee__group { display: flex; flex-shrink: 0; gap: var(--gutter); padding-right: var(--gutter); }

.work-card { --work-card-cue-size: var(--space-xlarge); width: min(58vw, 840px); flex: 0 0 auto; }
.work-card a { display: block; cursor: pointer; }
.work-card figure { position: relative; margin: 0; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius); background: var(--color-line); }
.work-card figure::before,
.work-card__cue {
  content: "";
  position: absolute;
  z-index: 1;
  inset-inline-end: var(--space-small);
  inset-block-end: var(--space-small);
  pointer-events: none;
  opacity: 0;
  transform-origin: bottom right;
  transform: scale(.86);
  transition: opacity var(--duration-fast) ease, transform var(--duration-medium) var(--ease-out-soft);
}
.work-card figure::before {
  inline-size: var(--work-card-cue-size);
  block-size: var(--work-card-cue-size);
  border-radius: 50%;
  background: var(--neutral-50);
}
.work-card__cue {
  display: grid;
  place-items: center;
  inline-size: var(--work-card-cue-size);
  block-size: var(--work-card-cue-size);
  color: var(--neutral-950);
  font-size: var(--text-size-body);
  line-height: 1;
}
.work-card__cue i {
  display: block;
  line-height: 1;
}
.work-card img { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(1); transition: transform .8s var(--ease-out-soft); }
.work-card a:hover img { transform: scale(1.025); }
.work-card a:hover figure::before,
.work-card a:hover .work-card__cue,
.work-card a:focus-visible figure::before,
.work-card a:focus-visible .work-card__cue { opacity: 1; transform: scale(1); }
.work-card a:focus-visible figure { outline: 2px solid var(--color-ink); outline-offset: 3px; }
.work-card__status { position: absolute; z-index: 2; top: 12px; right: 12px; padding: 8px 13px; border-radius: 999px; background: var(--color-page); color: var(--color-ink-muted); font-size: 10px; font-weight: 700; line-height: 1; letter-spacing: .12em; text-transform: uppercase; opacity: 0; pointer-events: none; transform: translateY(-6px); transition: opacity 180ms ease, transform 180ms ease; }
.work-card a:hover .work-card__status,
.work-card a:focus-visible .work-card__status { opacity: 1; transform: translateY(0); }
.work-card__meta { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-small); padding-top: var(--space-small); }
.work-card__meta h3 { font-size: var(--text-size-h5); letter-spacing: -.025em; }
.work-card__meta time { color: var(--color-ink-muted); font-size: var(--text-size-lead); }
.work-card--experiment figure { background: var(--neutral-900); color: var(--neutral-50); }
.work-card--experiment .experiment-card-preview {
  position: relative;
  inline-size: 100%;
  block-size: 100%;
  overflow: hidden;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--neutral-900) 88%, var(--color-accent)), var(--neutral-900));
}
.work-card--experiment .experiment-card-preview[data-experiment-light="true"]::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  pointer-events: none;
}
@media (max-width: 568px) {
  .work-card { --work-card-cue-size: var(--space-large); width: var(--card-width); }
}

.personal-projects { padding-block-start: var(--space-4xlarge); }
.personal-projects__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-tight); row-gap: var(--space-medium); margin: var(--space-medium) 0 0; padding: 0; list-style: none; }
.personal-projects__card a { display: block; }
.personal-projects__tile { position: relative; display: grid; place-items: center; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius); background: var(--color-surface); }
.personal-projects__icon { display: block; width: clamp(72px, 11vw, 142px); height: clamp(72px, 11vw, 142px); object-fit: contain; }
.personal-projects__card a:hover .work-card__status,
.personal-projects__card a:focus-visible .work-card__status { opacity: 1; transform: translateY(0); }
@media (max-width: 600px) {
  .personal-projects { padding-block-start: var(--space-3xlarge); }
}
@media (min-width: 768px) {
  .personal-projects__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
  .personal-projects__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* /experiments: experiments as pet-project cards — a tile on the card surface
   with the effect set in its middle, the title below — in rows of 1-2, 1-1-1,
   2-1. Every tile is as tall as a one-column tile is wide, so a wide card keeps
   the row height and gets the bigger preview. Cards swing in like the feed
   (Js/card-reveal.js). */
.personal-projects__grid--experiments { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--space-tight); row-gap: var(--experiment-row-gap); margin: 0; }
.experiment-featured-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--experiment-row-gap); margin: 0 0 var(--experiment-row-gap); padding: 0; list-style: none; }
.experiment-featured-grid .personal-projects__tile { aspect-ratio: 2 / 1; }
.personal-projects__card--experiment { width: auto; }
.experiment-cards { --experiment-row-gap: var(--space-3xlarge); --experiment-tile: calc((100cqi - 2 * var(--space-tight)) / 3); container-type: inline-size; }
.personal-projects__grid--experiments li[data-span="2"] { grid-column: span 2; }
.personal-projects__grid--experiments .personal-projects__tile { aspect-ratio: auto; block-size: var(--experiment-tile); }
.personal-projects__window {
  position: relative;
  width: 64%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  transition: transform var(--duration-slow) var(--ease-out-soft);
}
.personal-projects__window .experiment-card-preview { position: absolute; inset: 0; }
/* Dark type scenes sit on a tile of their own #171717 in both themes (the dark
   theme's card surface), so their window has no visible edge: it takes most of
   the tile and the lettering reads bigger. */
.personal-projects__card--experiment[data-blend="true"] .personal-projects__tile { background: var(--neutral-900); }
.personal-projects__card--experiment[data-blend="true"] .personal-projects__window { width: min(92%, calc(var(--experiment-tile) * .88 * 16 / 9)); }
.personal-projects__card--experiment a:hover .personal-projects__window,
.personal-projects__card--experiment a:focus-visible .personal-projects__window { transform: scale(1.04); }

@media (max-width: 1100px) {
  .personal-projects__grid--experiments { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .personal-projects__grid--experiments li[data-span="2"] { grid-column: auto; }
  .personal-projects__grid--experiments .personal-projects__tile { aspect-ratio: 1; block-size: auto; }
  .personal-projects__card--experiment[data-blend="true"] .personal-projects__window { width: 92%; }
}
@media (max-width: 900px) {
  .experiment-cards { --experiment-row-gap: var(--space-2xlarge); }
}
@media (max-width: 600px) {
  .experiment-cards { --experiment-row-gap: var(--space-large); }
  .personal-projects__grid--experiments { grid-template-columns: minmax(0, 1fr); }
  .experiment-featured-grid .personal-projects__tile { aspect-ratio: 1; }
  .personal-projects__window { width: 72%; }
}

/* reveal: the feed swing-in, per card; cards that come into view together
   start one after another */
.personal-projects__grid--experiments[data-reveal="ready"] .personal-projects__card {
  opacity: 0;
  transform: perspective(2000px) scale(.95) rotateY(25deg);
  transform-origin: 0% 50%;
  transition:
    opacity 1s var(--ease-out-soft) var(--reveal-delay, 0ms),
    transform 1.2s var(--ease-out-soft) var(--reveal-delay, 0ms);
}
.personal-projects__grid--experiments[data-reveal="ready"] .personal-projects__card[data-revealed="true"] { opacity: 1; transform: none; }
.experiment-featured-grid[data-reveal="ready"] .personal-projects__card {
  opacity: 0;
  transform: perspective(2000px) scale(.95) rotateY(25deg);
  transform-origin: 0% 50%;
  transition:
    opacity 1s var(--ease-out-soft) var(--reveal-delay, 0ms),
    transform 1.2s var(--ease-out-soft) var(--reveal-delay, 0ms);
}
.experiment-featured-grid[data-reveal="ready"] .personal-projects__card[data-revealed="true"] { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .personal-projects__window { transition: none; }
}

.row-list { position: relative; border-top: 1px solid var(--color-line); }
.row-list .row {
  position: relative;
  display: grid;
  grid-template-columns: 88px minmax(240px, 1fr) 152px 184px 48px;
  column-gap: var(--space-xlarge);
  row-gap: var(--space-medium);
  align-items: center;
  padding: var(--space-large) 0;
  border-bottom: 1px solid var(--color-line);
  transition: opacity var(--duration-fast) ease;
}
.row-list .row time, .row-list .row .row__meta { color: var(--color-ink-muted); font-size: var(--text-size-label); align-self: baseline; }
.row-list .row time { white-space: nowrap; }
.row-list .row .row__type,
.row-list .row .row__industry { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; justify-self: stretch; }
.row-list .row strong { min-width: 0; align-self: baseline; font-size: var(--text-size-h5); font-weight: var(--weight-bold); line-height: 1.1; letter-spacing: -.025em; text-wrap: balance; }
.row-list .row .row__arrow { align-self: baseline; justify-self: end; font-size: var(--text-size-h5); line-height: 1; transform: translateY(6px); }
.row-list .row .row__arrow i { display: block; }

/* hover preview: a small still of the project follows the row */
.row-list .row .row__preview {
  position: absolute;
  z-index: 5;
  top: 50%;
  right: 88px;
  width: 520px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--radius);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-50%) scale(.96);
  transition: opacity var(--duration-fast) ease, transform var(--duration-medium) var(--ease-out-soft);
}
.row-list .row .row__preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.row-list .row:hover .row__preview, .row-list .row:focus-visible .row__preview { opacity: 1; transform: translateY(-50%) scale(1); }
.row-list .row:hover .row__preview .work-card__status,
.row-list .row:focus-visible .row__preview .work-card__status { opacity: 1; transform: translateY(0); }

.row-list--articles .row { grid-template-columns: 108px minmax(220px, 1fr) 152px max-content 48px; }
.row-list--articles .row .row__industry { justify-self: end; text-align: end; }

@media (max-width: 900px) {
  .row-list .row { grid-template-columns: 72px minmax(0, 1.4fr) minmax(0, .8fr) minmax(0, .8fr) 32px; gap: var(--space-small); }
  .row-list--articles .row { grid-template-columns: 96px minmax(0, 1fr) max-content 32px; }
  .row-list--articles .row time { grid-column: 1; grid-row: 1; }
  .row-list--articles .row strong { grid-column: 2 / 4; grid-row: 1; }
  .row-list--articles .row .row__type { grid-column: 2; grid-row: 2; }
  .row-list--articles .row .row__industry { grid-column: 3; grid-row: 2; }
  .row-list--articles .row .row__arrow { grid-column: 4; grid-row: 1 / span 2; align-self: center; transform: none; }
  .row-list .row .row__preview { display: none; }
  .row-list .row strong { font-size: var(--text-size-h5); text-wrap: wrap; }
}

@media (max-width: 600px) {
  .row-list .row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; row-gap: var(--space-snug); }
  .row-list--articles .row { row-gap: var(--space-small); }
  .row-list--works .row { grid-template-columns: max-content minmax(0, 1fr) 44px; }
  .row-list .row time { grid-column: 1; grid-row: 1; }
  .row-list .row .row__arrow { grid-column: 3; grid-row: 1; align-self: center; transform: none; }
  .row-list .row strong { grid-column: 1 / -1; grid-row: 2; }
  .row-list .row .row__type { grid-column: 1; grid-row: 3; }
  .row-list .row .row__industry { grid-column: 2; grid-row: 3; }
  .row-list--articles .row .row__industry { grid-column: 2 / -1; }
  .row-list--works .row strong { font-size: calc(var(--text-size-h4) + var(--space-tight) - (var(--space-hair) / 2)); }
  .row-list--articles .row strong { font-size: var(--text-size-h3); }
}

/* media rows: preview, title with facts, excerpt and arrow in their own columns */
.row-list--media .row { grid-template-columns: minmax(0, 13fr) minmax(0, 9fr) minmax(0, 31fr) minmax(0, 7fr) minmax(0, 30fr) minmax(0, 7fr) 48px; grid-template-rows: auto 1fr; align-items: start; column-gap: 0; row-gap: 0; }
.row-list--media .row .row__media { grid-column: 1; grid-row: 1 / span 2; display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius); background: var(--color-line); }
.row-list--media .row .row__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.row-list--media .row strong { grid-column: 3; grid-row: 1; font-size: var(--text-size-h3); line-height: 1.05; letter-spacing: -.035em; text-wrap: pretty; }
.row-list--media .row .row__facts { grid-column: 3; grid-row: 2; align-self: end; display: flex; flex-wrap: wrap; column-gap: var(--space-xlarge); row-gap: var(--space-tight); padding-top: var(--space-2xlarge); }
.row-list--media .row .row__excerpt { grid-column: 5; grid-row: 1; color: var(--color-ink-muted); font-size: var(--text-size-body); line-height: 1.45; text-wrap: pretty; }
.row-list--media .row .row__arrow { grid-column: 7; grid-row: 1; align-self: start; font-size: var(--text-size-h3); transform: none; }
.row-list--media .row:last-of-type { border-bottom: 0; }
@media (max-width: 1100px) {
  .row-list--media .row { grid-template-columns: minmax(0, 28fr) minmax(0, 6fr) minmax(0, 66fr) 48px; grid-template-rows: auto auto 1fr; row-gap: var(--space-medium); }
  .row-list--media .row .row__media { grid-row: 1 / span 3; }
  .row-list--media .row .row__excerpt { grid-column: 3; grid-row: 2; }
  .row-list--media .row .row__facts { grid-row: 3; padding-top: 0; }
  .row-list--media .row .row__arrow { grid-column: 4; }
}
@media (max-width: 760px) {
  .row-list--media .row { grid-template-columns: minmax(0, 1fr) 32px; grid-template-rows: none; }
  .row-list--media .row .row__media { grid-column: 1 / -1; grid-row: 1; }
  .row-list--media .row strong { grid-column: 1; grid-row: 2; }
  .row-list--media .row .row__arrow { grid-column: 2; grid-row: 2; font-size: var(--text-size-h4); }
  .row-list--media .row .row__excerpt { grid-column: 1 / -1; grid-row: 3; }
  .row-list--media .row .row__facts { grid-column: 1 / -1; grid-row: 4; }
}

/* editorial rows: featured posts in one card-like panel — cover on the left, a large title with an arrow cue,
   tags with reading time and date last */
.row-list--editorial { padding: var(--space-xlarge) var(--space-4xlarge); border-top: 0; border-radius: var(--space-medium); background: var(--color-surface); }
.row-list--editorial .row { grid-template-columns: minmax(0, 3fr) minmax(0, 6fr) minmax(0, 3fr); align-items: stretch; column-gap: var(--space-xlarge); padding: var(--space-2xlarge) 0; }
.row-list--editorial .row .row__byline { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-hair); margin-top: var(--space-tight); }
.row-list--editorial .row .row__reading { font-size: var(--text-size-meta); }
.row-list--editorial .row .row__when { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-tight); color: var(--color-ink-muted); font-size: var(--text-size-meta); }
.row-list--editorial .row time { font-size: var(--text-size-meta); }
.row-list--editorial .row .row__tags { font-size: var(--text-size-meta); }
.row-list--editorial .row .row__body { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: var(--space-large); min-width: 0; }
.row-list--editorial .row strong { font-size: var(--text-size-h3); font-weight: var(--weight-medium); line-height: 1.1; letter-spacing: -.035em; text-wrap: pretty; }
.row-list--editorial .row .row__arrow { align-self: flex-start; justify-self: auto; font-size: var(--text-size-h4); transform: none; }
/* every cover is 5:4; the text is sized to fit beside it */
.row-list--editorial .row .row__media { justify-self: start; align-self: start; width: 100%; max-width: 400px; aspect-ratio: 5 / 4; overflow: hidden; border-radius: var(--radius); background: var(--color-line); }
.row-list--editorial .row .row__media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform var(--duration-slow) var(--ease-out-soft); }
.row-list--editorial .row:hover .row__media img, .row-list--editorial .row:focus-visible .row__media img { transform: scale(1.03); }
.row-list--editorial .row:last-of-type { border-bottom: 0; }
@media (max-width: 1100px) {
  /* the panel runs edge to edge; its padding keeps the rows on the page gutter */
  .row-list--editorial { margin-inline: calc(var(--page-gutter) * -1); padding: var(--section-spacing) var(--page-gutter); border-radius: 0; }
  .row-list--editorial .row:first-of-type { padding-top: 0; }
  .row-list--editorial .row:last-of-type { padding-bottom: 0; }
}
@media (max-width: 900px) {
  .row-list--editorial .row { grid-template-columns: minmax(0, 240px) minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: var(--space-medium); row-gap: var(--space-small); padding: var(--space-xlarge) 0; }
  .row-list--editorial .row .row__media { grid-column: 1; grid-row: 1 / span 2; }
  .row-list--editorial .row .row__byline { grid-column: 2; grid-row: 2; align-self: end; flex-direction: row; justify-content: space-between; margin-top: 0; }
  .row-list--editorial .row .row__body { grid-column: 2; grid-row: 1; gap: var(--space-medium); }
}
@media (max-width: 600px) {
  /* phones: the row reads like the "All" rows — date and arrow, title, tags and reading time */
  .row-list--editorial { padding-block: var(--space-3xlarge); }
  .row-list--editorial .row { grid-template-columns: minmax(0, 1fr) max-content; grid-template-rows: none; row-gap: var(--space-small); padding: var(--space-large) 0; }
  .row-list--editorial .row .row__body,
  .row-list--editorial .row .row__byline,
  .row-list--editorial .row .row__when { display: contents; }
  .row-list--editorial .row .row__media { grid-column: 1 / -1; grid-row: 1; max-width: none; margin-bottom: var(--space-small); }
  .row-list--editorial .row time { grid-column: 1; grid-row: 2; align-self: center; }
  .row-list--editorial .row .row__arrow { grid-column: 2; grid-row: 2; align-self: center; justify-self: end; font-size: var(--text-size-h5); }
  .row-list--editorial .row strong { grid-column: 1 / -1; grid-row: 3; padding-bottom: var(--space-small); }
  .row-list--editorial .row .row__tags { grid-column: 1; grid-row: 4; align-self: center; }
  .row-list--editorial .row .row__reading { grid-column: 2; grid-row: 4; align-self: center; justify-self: end; }
  .row-list--editorial .row .row__dot { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .row-list--editorial .row .row__media img { transition: none; }
}

/* --- article cards ------------------------------------------------------- */

/* Four cards on wide canvases; the intermediate breakpoint deliberately
   relaxes to three before restoring all four in a two-by-two grid at 960px. */
.card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gutter); }

@media (max-width: 1599px) {
  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .card-grid > .card:nth-child(n + 4) { display: none; }
}

@media (max-width: 960px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-grid > .card:nth-child(n + 4) { display: flex; }
}

@media (max-width: 600px) {
  .card-grid { grid-template-columns: minmax(0, 1fr); }
}

.card {
  display: flex;
  flex-direction: column;
  flex: 1 1 280px;
  min-width: 0;
  min-height: 420px;
  border-radius: var(--radius);
  background: var(--color-surface);
  overflow: hidden;
  cursor: pointer;
  transition: background var(--duration-fast) ease, transform var(--duration-medium) var(--ease-out-soft);
}
.card:hover { transform: translateY(-4px); }
/* title + excerpt occupy the flexible top block; every meta fact gets its own ruled line below */
.card .card__body { display: flex; flex: 1 1 auto; flex-direction: column; gap: var(--space-tight); padding: var(--space-large) var(--space-large) var(--space-3xlarge); }
.card .card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-small);
  min-height: 64px;
  padding: var(--space-medium) var(--space-large);
  border-top: 2px solid var(--color-page);
  font-size: var(--text-size-meta);
  line-height: 1.4;
}
.card .card__row dt { color: var(--color-ink); font-weight: var(--weight-medium); }
.card .card__row dd { margin: 0; color: var(--color-ink-muted); text-align: right; }
.card .card__meta { display: block; margin: 0; }
/* the published row swaps its date for the arrow on hover — the card's only affordance */
.card .card__row--swap { position: relative; }
.card .card__row--swap dt { margin-right: auto; transition: opacity var(--duration-fast) ease; }
.card .card__prompt {
  position: absolute;
  left: var(--space-large);
  color: var(--color-ink);
  font-weight: var(--weight-medium);
  opacity: 0;
  transition: opacity var(--duration-fast) ease;
}
.card:hover .card__row--swap dt, .card:focus-visible .card__row--swap dt { opacity: 0; }
.card:hover .card__prompt, .card:focus-visible .card__prompt { opacity: 1; }
.card .card__row--swap dd { margin-left: auto; text-align: right; }
.card .card__row--swap dd,
.card .card__row--swap .card__cta { transition: opacity var(--duration-fast) ease, transform var(--duration-medium) var(--ease-out-soft); }
.card .card__row--swap .card__cta { position: absolute; right: var(--space-large); }
.card:hover .card__row--swap dd, .card:focus-visible .card__row--swap dd { opacity: 0; transform: translateX(8px); }
/* published date and the hover arrow share the card's bottom line */
.card .card__footer { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-small); min-height: 64px; padding: var(--space-medium) var(--space-large); border-top: 1px solid var(--color-line); font-size: var(--text-size-meta); line-height: 1.4; }
.card .card__kicker { display: flex; align-items: center; gap: var(--space-snug); margin: 0; color: var(--color-ink-muted); }
/* card titles take the section role, tracked slightly tighter at card scale */
.card .card__title { font-size: var(--text-size-h4); letter-spacing: -.04em; text-align: left; }
.card .card__excerpt { color: var(--color-ink-muted); font-size: var(--text-size-prose); line-height: 1.45; text-wrap: pretty; }
.card-grid--articles .card__body { gap: var(--space-small); }
.card-grid--articles .card__title { font-size: var(--text-size-h5); }
.card-grid--articles .card__excerpt { font-size: var(--text-size-body); }
@media (max-width: 600px) {
  .card-grid--articles .card__body { padding: var(--space-medium) var(--space-medium) var(--space-2xlarge); }
  .card-grid--articles .card__row { padding-inline: var(--space-medium); }
  .card-grid--articles .card__title { font-size: var(--text-size-h4); }
}
@media (min-width: 1280px) {
  .card-grid--articles .card__excerpt { color: var(--color-ink-muted); font-size: var(--text-size-body); font-weight: var(--weight-regular); line-height: 1.4; }
}
/* the arrow is the only affordance: bottom line, on hover, no label */
.card .card__cta {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  height: 20px;
  font-size: var(--text-size-lead);
  line-height: 1;
  color: var(--color-ink);
  opacity: 0;
  transform: translate(-8px, 0);
  transition: opacity var(--duration-fast) ease, transform var(--duration-medium) var(--ease-out-soft);
}
.card:hover .card__cta, .card:focus-visible .card__cta { opacity: 1; transform: translate(0, 0); }

/* --- about: photo row ---------------------------------------------------- */

.photo-row { display: flex; flex-wrap: wrap; gap: var(--gutter); }
.photo-row .photo-row__item { flex: 0 1 calc((100% - var(--gutter)) / 2); min-width: 0; margin: 0; aspect-ratio: 1 / 1; overflow: hidden; border-radius: var(--radius); background: var(--color-line); }
.photo-row .photo-row__item img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* text column matches the first photo tile's width */
.about-text { display: flex; flex-direction: column; gap: var(--space-medium); width: calc((100% - var(--gutter)) / 2); margin-top: var(--space-3xlarge); }
.about-text p { margin: 0; font-size: var(--text-size-prose); line-height: 1.55; text-wrap: pretty; }
/* same treatment as the header's Let’s talk link */
.about-text__action { align-self: start; margin-top: var(--space-small); border-bottom: 1px solid currentColor; padding-bottom: 2px; font-size: var(--text-size-lead); font-weight: var(--weight-semibold); letter-spacing: -.02em; }
@media (max-width: 900px) { .about-text { gap: var(--space-medium); margin-top: var(--space-2xlarge); } }
@media (max-width: 1024px) { .about-text { width: 100%; } }
@media (max-width: 600px) { .photo-row .photo-row__item { flex-basis: 100%; } }

/* --- about: experience --------------------------------------------------- */

.exp-row { display: grid; grid-template-columns: 140px minmax(0, 1fr) max-content; gap: var(--space-tight) var(--space-medium); align-items: baseline; padding: var(--space-medium) 0; border-bottom: 1px solid var(--color-line); }
.exp-row time { grid-row: 1; color: var(--color-ink-muted); font-size: var(--text-size-label); }
.exp-row strong { grid-row: 1; font-size: var(--text-size-lead); font-weight: var(--weight-semibold); letter-spacing: -.02em; }
.exp-row .exp-row__role { grid-row: 1; color: var(--color-ink-muted); font-size: var(--text-size-meta); }
.exp-row .exp-row__note { grid-column: 2; grid-row: 2; max-width: 56ch; margin: 0; color: var(--color-ink-muted); font-size: var(--text-size-prose); line-height: 1.4; text-wrap: pretty; }
.exp-row .exp-row__details { grid-column: 2 / -1; grid-row: 3; max-width: 72ch; margin-block-start: var(--space-small); color: var(--color-ink-muted); font-size: var(--text-size-prose); line-height: 1.4; text-wrap: pretty; }
.exp-row__details p { margin: 0; }
.exp-row__details ul { margin: var(--space-tight) 0 var(--space-medium); padding-inline-start: 1.25em; }
.exp-row__details ul:last-child { margin-block-end: var(--space-small); }
.exp-row__details li + li { margin-block-start: var(--space-snug); }
.exp-row__details .exp-row__label { color: var(--color-ink); font-weight: var(--weight-medium); }
.exp-row__details ul + .exp-row__label { margin-block-start: var(--space-medium); }
.exp-row__projects { grid-column: 2 / -1; grid-row: 4; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gutter); margin: var(--space-large) 0 0; padding: 0; list-style: none; }
.exp-row__projects > li { min-width: 0; }
.exp-row__project-card .personal-projects__tile { margin: 0; aspect-ratio: 4 / 3; }
.exp-row__project-card .personal-projects__tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.exp-row__project-card .work-card__meta { display: block; padding-top: var(--space-snug); }
.exp-row__project-card .work-card__meta h3 { font-size: var(--text-size-body); line-height: 1.3; }
.exp-row__project-card .work-card__meta p { margin: 2px 0 0; color: var(--color-ink-muted); font-size: var(--text-size-meta); line-height: 1.4; }
#experience-heading + div .exp-row:last-child { border-bottom: 0; }
#experience-heading + div .exp-row { padding-block: var(--space-xlarge); }
#experience-heading + div .exp-row + .exp-row { padding-block-start: var(--space-3xlarge); }
@media (max-width: 900px) {
  .exp-row { grid-template-columns: minmax(0, 1fr); }
  .exp-row time, .exp-row strong, .exp-row .exp-row__role { grid-row: auto; }
  .exp-row .exp-row__note { grid-column: 1; grid-row: auto; }
  .exp-row .exp-row__details { grid-column: 1; grid-row: auto; }
  .exp-row .exp-row__projects { grid-column: 1; grid-row: auto; }
}
@media (max-width: 600px) {
  .exp-row__projects { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-medium) var(--space-tight); }
}
@media (max-width: 350px) {
  .exp-row__projects { grid-template-columns: minmax(0, 1fr); }
}

/* --- about: testimonials ------------------------------------------------- */

.testimonials__header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-medium) var(--space-large); margin-bottom: var(--space-3xlarge); }
.testimonials__header .section__heading { margin: 0; }
.testimonials__controls { display: flex; align-items: center; gap: var(--space-tight); }
.testimonials__counter { margin: 0 var(--space-small) 0 0; color: var(--color-ink-muted); font-size: var(--text-size-lead); font-variant-numeric: tabular-nums; }
.testimonials__arrow { display: grid; place-items: center; inline-size: 56px; block-size: 56px; padding: 0; border: 0; border-radius: 20px; background: var(--color-surface); color: var(--color-ink); cursor: pointer; transition: background var(--duration-fast) ease, color var(--duration-fast) ease; }
.testimonials__arrow i { display: block; font-size: var(--text-size-h5); line-height: 1; }
.testimonials__arrow:hover { background: var(--color-ink); color: var(--color-page); }
.testimonials__arrow:focus-visible { outline: 2px solid var(--color-ink); outline-offset: 2px; }
/* slides share one grid cell, so the block keeps the tallest slide's height */
.testimonials__slides { display: grid; }
/* mirrors the experience row: 140px label column, then the three project-card
   columns; gaps are tracks so the quote starts exactly at the second card */
.testimonial { grid-area: 1 / 1; display: grid; grid-template-columns: 140px var(--space-medium) minmax(0, 1fr) var(--gutter) minmax(0, 1fr) var(--gutter) minmax(0, 1fr); align-items: start; align-content: start; opacity: 0; visibility: hidden; transform: translateY(var(--space-small)); transition: opacity var(--duration-medium) ease, transform var(--duration-slow) var(--ease-out-soft), visibility 0s linear var(--duration-medium); }
.testimonial[data-active="true"] { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
/* a .work-card (same hover cue and zoom) sized to the testimonial grid; the end
   margin leaves room for the hanging « when the tile fills its columns */
.testimonial__project { grid-column: 1 / 4; width: auto; max-inline-size: 420px; margin-inline-end: var(--space-2xlarge); }
.testimonial__project .testimonial__tile { aspect-ratio: 4 / 3; }
.testimonial__body { grid-column: 5 / -1; margin: 0; }
.testimonial__quote { margin: 0; }
.testimonial__quote p { max-inline-size: 34ch; text-indent: -.5em; }
.testimonial__author { display: flex; align-items: center; gap: var(--space-small); margin-top: var(--space-2xlarge); }
.testimonial__avatar { display: grid; flex: 0 0 auto; place-items: center; inline-size: 56px; block-size: 56px; border-radius: var(--radius); background: var(--color-surface); color: var(--color-ink-muted); font-size: var(--text-size-meta); font-weight: var(--weight-semibold); object-fit: cover; }
.testimonial__author strong { display: block; font-size: var(--text-size-lead); font-weight: var(--weight-semibold); letter-spacing: -.02em; }
.testimonial__author small { display: block; margin-top: 2px; color: var(--color-ink-muted); font-size: var(--text-size-meta); }
/* per-slide copy of the counter, shown under the author on phones only */
.testimonial__counter { display: none; }
@media (max-width: 1200px) {
  .testimonial__project { width: calc((100% - var(--space-2xlarge)) * .75); }
}
@media (max-width: 900px) {
  .testimonials__counter { font-size: var(--text-size-body); }
  .testimonial { grid-template-columns: minmax(0, 1fr); }
  .testimonial__body { grid-column: 1; }
  .testimonial__project { display: none; }
  .testimonial__quote p { text-indent: 0; }
}
@media (max-width: 480px) {
  .testimonials__header { margin-bottom: var(--space-2xlarge); }
  .testimonials__counter { font-size: var(--text-size-meta); }
  .testimonials__controls .testimonials__counter { display: none; }
  .testimonial__counter { display: block; margin: var(--space-medium) 0 0; }
  .testimonials__arrow { inline-size: 44px; block-size: 44px; border-radius: 16px; }
  .testimonial__quote p { font-size: var(--text-size-h3); line-height: 1.3333; }
  .testimonials__arrow i { font-size: var(--text-size-h6); }
}
@media (prefers-reduced-motion: reduce) {
  .testimonial { transition: none; }
}

/* --- detail pages (article / case study) -------------------------------- */

.doc { display: flex; gap: var(--doc-column-gap); align-items: start; }
.doc .doc__column { order: 1; flex: 1 1 0; min-width: 0; max-width: var(--prose-measure); }
.doc > .doc__aside { order: 2; flex: 0 0 220px; inline-size: 220px; position: sticky; top: 104px; align-self: start; max-block-size: calc(100vh - 128px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.doc > .doc__aside::-webkit-scrollbar { display: none; }
.doc .doc__nav { display: flex; flex-direction: column; gap: var(--space-snug); padding-block-end: calc(var(--blur-shelf-height) + var(--space-large)); }
.doc .doc__nav a { display: block; padding: 2px 0; color: var(--color-ink-idle); font-size: var(--text-size-meta); font-weight: var(--weight-medium); line-height: 1.35; transition: color var(--duration-fast) ease; text-wrap: pretty; }
.doc .doc__nav a[data-active="true"] { color: var(--color-ink); }
@media (max-width: 1100px) { .doc > .doc__aside { display: none; } }
@media (max-width: 1000px) {
  .doc { flex-direction: column; gap: var(--space-2xlarge); }
  .doc .doc__column { order: 1; inline-size: 100%; }
}

.back-link { display: inline-flex; align-items: center; gap: var(--space-snug); margin-bottom: var(--space-2xlarge); color: var(--color-ink-muted); font-size: var(--text-size-meta); font-weight: var(--weight-medium); }
.back-link i { display: block; font-size: var(--text-size-body); }
/* Experiment pages keep the back link close to the title. */
.page--experiment .site-main--doc { padding-top: var(--space-5xlarge); }
.page--experiment .back-link { margin-bottom: var(--space-medium); }

.doc__kicker { margin: 0 0 var(--space-medium); color: var(--color-ink-muted); }
.doc__title { margin: 0 0 var(--space-2xlarge); max-width: 22ch; }

/* --- experiment detail --------------------------------------------------- */

.experiment-hero {
  margin-bottom: var(--space-2xlarge);
}
/* The experiments index leads with a larger title and sits closer to the grid. */
.experiment-hero--index { margin-bottom: 0; }
.experiment-hero--index .doc__title { font-size: clamp(var(--text-size-h1), 8vw, 88px); }
.experiment-hero__copy { min-width: 0; }
@media (min-width: 1200px) {
  .experiment-hero--index .experiment-hero__copy { padding-inline-end: 30%; }
}
.experiment-hero .doc__title { margin-bottom: 0; }
.experiment-hero__lead {
  margin: var(--space-medium) 0 0;
  color: var(--color-ink-muted);
  font-size: var(--text-size-lead);
  line-height: 1.4;
  letter-spacing: -.02em;
}
.experiment-actions {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-medium);
  padding-top: var(--gutter);
}
.experiment-button,
.experiment-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-tight);
  min-block-size: 44px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  background: var(--color-page);
  color: var(--color-ink);
  font-size: var(--text-size-meta);
  font-weight: var(--weight-semibold);
  line-height: 1;
  cursor: pointer;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease, border-color var(--duration-fast) ease, transform var(--duration-medium) var(--ease-out-soft);
}
.experiment-button { width: 100%; padding: 0 var(--space-small); }
.experiment-button--primary {
  border-color: var(--color-ink);
  background: var(--color-ink);
  color: var(--color-page);
}
.experiment-button:hover,
.experiment-reset:hover { transform: translateY(-2px); }
.experiment-button:focus-visible,
.experiment-reset:focus-visible,
.experiment-control input:focus-visible {
  outline: 2px solid var(--color-ink);
  outline-offset: 3px;
}
.experiment-button i,
.experiment-reset i { font-size: var(--text-size-body); line-height: 1; }
.experiment-text-link {
  display: inline-flex;
  width: max-content;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
  color: var(--color-ink);
  font-size: var(--text-size-meta);
  font-weight: var(--weight-semibold);
}

/* Two columns, like a case study: the wide column carries the stage and the
   notes, the narrow one carries the controls. */
.experiment-layout {
  --experiment-stage-height: clamp(460px, 52vw, 760px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 304px);
  column-gap: var(--gutter);
  align-items: start;
}
.experiment-layout > .experiment-stage-wrap { grid-column: 1; grid-row: 1; }
.experiment-layout > .experiment-notes { grid-column: 1; grid-row: 2; }
.experiment-layout > .experiment-aside { grid-column: 2; grid-row: 1 / span 2; }
@media (min-width: 1600px) {
  .experiment-layout { column-gap: var(--space-5xlarge); }
}
.experiment-aside {
  display: flex;
  flex-direction: column;
  gap: var(--space-small);
  min-width: 0;
}
.experiment-stage-wrap {
  position: relative;
  min-width: 0;
  block-size: var(--experiment-stage-height);
  overflow: hidden;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  background: var(--color-surface);
}
.experiment-stage {
  position: relative;
  block-size: 100%;
  overflow: hidden;
}
.experiment-replay {
  position: absolute;
  inset-block-end: var(--space-small);
  inset-inline-end: var(--space-small);
  z-index: 2;
  width: auto;
}

.experiment-controls {
  display: flex;
  flex-direction: column;
  gap: var(--space-medium);
  min-width: 0;
  padding: var(--gutter);
  border-radius: var(--radius);
  background: var(--color-surface);
}
.experiment-controls__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-small);
  padding-bottom: 0;
}
.experiment-controls__actions {
  display: flex;
  align-items: center;
  gap: var(--space-tight);
}
.experiment-controls__header h2 {
  font-size: var(--text-size-h5);
  letter-spacing: -.025em;
}
.experiment-collapse,
.experiment-reset {
  inline-size: 36px;
  min-block-size: 36px;
  padding: 0;
  border: 0;
  border-color: transparent;
  background: transparent;
}
.experiment-collapse {
  display: none;
}
.experiment-collapse i {
  display: block;
  transition: transform var(--duration-medium) var(--ease-out-soft);
}
.experiment-controls[data-open="true"] .experiment-collapse i {
  transform: rotate(180deg);
}
/* Two columns share rows: a slider next to a labelled field sits at the row's
   bottom, level with that field's input, instead of stretching to its height. */
.experiment-controls__body {
  display: grid;
  align-items: end;
  gap: var(--space-tight) var(--space-small);
}
.experiment-control {
  display: grid;
  gap: var(--space-hair);
}
.experiment-control label {
  color: var(--color-ink-muted);
  font-size: var(--text-size-meta);
  font-weight: var(--weight-medium);
}
.experiment-control__topline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-small);
}
.experiment-control input[type="text"] {
  inline-size: 100%;
  min-block-size: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0 var(--space-snug);
  background: var(--color-page);
  color: var(--color-ink);
  font: inherit;
  font-size: var(--text-size-meta);
}
.experiment-control__color {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  min-block-size: 44px;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--color-page);
}
.experiment-control__color:focus-within {
  outline: 2px solid var(--color-ink);
  outline-offset: 3px;
}
.experiment-control__color::before {
  display: none;
}
.experiment-control__picker {
  inline-size: 28px;
  block-size: 28px;
  margin-inline-start: var(--space-tight);
  border: 1px solid var(--color-line);
  border-radius: 2px;
  padding: 0;
  overflow: hidden;
  background: var(--swatch-color);
  cursor: pointer;
}
.experiment-control .experiment-control__picker:focus,
.experiment-control .experiment-control__picker:focus-visible,
.experiment-control .experiment-control__hex:focus,
.experiment-control .experiment-control__hex:focus-visible {
  outline: 0;
}
.experiment-control__picker::-webkit-color-swatch-wrapper { padding: 0; }
.experiment-control__picker::-webkit-color-swatch { border: 0; }
.experiment-control__hex {
  inline-size: 100%;
  min-block-size: 44px;
  border: 1px solid transparent;
  border-radius: 0;
  padding: 0 var(--space-snug) 0 var(--space-tight);
  background: transparent;
  color: var(--color-ink);
  font-family: var(--font-mono);
  font-size: var(--text-size-label);
  text-align: left;
  text-transform: lowercase;
}
/* Pill slider: the whole field is the track, the label and the value sit
   inside it, the fill shows the value and a thin line marks its edge. The
   native range input stays underneath for keyboard and screen readers. */
.experiment-slider {
  --slider-edge: calc(1px + var(--slider-fill, 0) * (100% - 2px));
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-small);
  min-block-size: 44px;
  padding: 0 var(--space-snug);
  overflow: hidden;
  border-radius: var(--radius);
  background:
    linear-gradient(to right, color-mix(in srgb, var(--color-ink) 7%, transparent) var(--slider-edge), transparent 0),
    var(--color-page);
  cursor: ew-resize;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.experiment-slider:has(input:focus-visible) {
  outline: 2px solid var(--color-ink);
  outline-offset: 3px;
}
.experiment-slider input[type="range"] {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  margin: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: inherit;
  pointer-events: none;
}
.experiment-slider input[type="range"]:focus-visible { outline: 0; }
.experiment-slider input[type="range"]::-webkit-slider-runnable-track {
  block-size: 100%;
  border-radius: 0;
  background: transparent;
}
.experiment-slider input[type="range"]::-webkit-slider-thumb {
  inline-size: 2px;
  block-size: 44px;
  margin-block-start: 0;
  border: 0;
  border-radius: 0;
  appearance: none;
  -webkit-appearance: none;
  background: color-mix(in srgb, var(--color-ink) 22%, transparent);
  transition: background var(--duration-fast) ease;
}
.experiment-slider input[type="range"]::-moz-range-track {
  block-size: 100%;
  border-radius: 0;
  background: transparent;
}
.experiment-slider input[type="range"]::-moz-range-thumb {
  inline-size: 2px;
  block-size: 44px;
  border: 0;
  border-radius: 0;
  background: color-mix(in srgb, var(--color-ink) 22%, transparent);
}
.experiment-slider:hover input[type="range"]::-webkit-slider-thumb,
.experiment-slider[data-dragging="true"] input[type="range"]::-webkit-slider-thumb { background: var(--color-ink); }
.experiment-slider:hover input[type="range"]::-moz-range-thumb,
.experiment-slider[data-dragging="true"] input[type="range"]::-moz-range-thumb { background: var(--color-ink); }
.experiment-slider__label,
.experiment-slider__value {
  position: relative;
  pointer-events: none;
  white-space: nowrap;
}
.experiment-slider__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.experiment-control .experiment-slider__label {
  color: var(--color-ink);
  font-size: var(--text-size-meta);
  font-weight: var(--weight-medium);
}
.experiment-slider__value {
  color: var(--color-ink);
  font-family: var(--font-mono);
  font-size: var(--text-size-label);
  font-variant-numeric: tabular-nums;
}
.experiment-slider__value span { color: var(--color-ink-muted); }

.experiment-notes {
  max-width: var(--prose-measure);
  margin-block-start: var(--space-2xlarge);
  padding-block: 0;
}
.experiment-notes__body {
  display: grid;
  gap: var(--space-medium);
}

@media (max-width: 1100px) {
  .experiment-layout { grid-template-columns: minmax(0, 1fr); }
  .experiment-layout > .experiment-stage-wrap,
  .experiment-layout > .experiment-notes,
  .experiment-layout > .experiment-aside { grid-column: 1; grid-row: auto; }
  .experiment-layout > .experiment-aside { margin-block-start: var(--space-small); gap: 0; }
  .experiment-actions { padding-top: var(--space-small); }
  .experiment-controls__body { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .experiment-hero { gap: var(--space-large); }
  .experiment-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  .experiment-button { inline-size: 100%; }
  .experiment-text-link { justify-self: start; }
  .experiment-stage-wrap { block-size: 420px; }
  .experiment-controls { padding: var(--space-medium); }
}

@media (max-width: 768px) {
  .experiment-collapse { display: grid; place-items: center; }
  .experiment-aside {
    gap: 0;
  }
  .experiment-controls {
    gap: 0;
    padding: var(--space-snug) var(--gutter);
  }
  .experiment-controls__body {
    grid-template-columns: minmax(0, 1fr);
    margin-top: 0;
    overflow: hidden;
    max-block-size: 0;
    opacity: 0;
    transition: max-block-size var(--duration-medium) var(--ease-out-soft), opacity var(--duration-fast) ease, margin-top var(--duration-medium) var(--ease-out-soft);
  }
  .experiment-controls[data-open="true"] .experiment-controls__body {
    margin-top: var(--space-medium);
    max-block-size: 900px;
    opacity: 1;
  }
  .experiment-actions {
    align-items: center;
  }
  .experiment-text-link {
    justify-self: center;
  }
}

@media (max-width: 480px) {
  .experiment-layout { row-gap: var(--space-snug); }
  .experiment-controls { padding-block: var(--space-tight); }
  .experiment-actions { padding-top: var(--space-snug); }
}

.prose { color: var(--color-ink); }
.prose a[href] { text-decoration-line: underline; text-decoration-thickness: from-font; text-underline-offset: .18em; text-decoration-skip-ink: auto; }
.prose .is-muted { color: var(--color-ink); }
.prose .prose__standfirst { margin: 0 0 var(--space-large); font-size: var(--text-size-standfirst); line-height: 1.45; letter-spacing: -.01em; text-wrap: pretty; }
.prose section { padding-top: var(--space-2xlarge); scroll-margin-block-start: 104px; }
@media (min-width: 601px) {
  .prose--blog section:is(#intro, #factor-1, #factor-2, #factor-3, #factor-4, #factor-5, #factor-6, #factor-7, #factor-8, #factor-9, #factor-10, #factor-11, #factor-12, #factor-13, #factor-14, #factor-15) { padding-top: 0; }
}
.prose #overview { padding-top: 0; }
.page--weguide .prose #product { padding-top: 0; }
.page--weguide .fact-grid { margin-top: var(--space-2xlarge); margin-bottom: var(--space-large); }
.page--vehiclecare .site-main--doc { padding-top: var(--space-5xlarge); }
.page--vehiclecare .prose #product { padding-top: 0; }
.page--vehiclecare .fact-grid { margin-top: var(--space-2xlarge); }
.page--vehiclecare .fact { flex-basis: calc((100% - (var(--space-snug) * 2)) / 3); }
@media (max-width: 600px) {
  .site-main--case,
  .page--vehiclecare .site-main--case { padding-top: var(--space-4xlarge); padding-bottom: 0; }
}
@media (max-width: 600px) { .page--vehiclecare .fact { flex-basis: 100%; } }
.page--burncare .fact-grid { margin-top: var(--space-large); }
.page--burncare .fact { flex-basis: calc((100% - (var(--space-snug) * 2)) / 3); }
@media (max-width: 600px) { .page--burncare .fact { flex-basis: 100%; } }
.prose h2 { margin: 0 0 var(--space-medium); }
.prose h3 { margin: var(--space-large) 0 var(--space-snug); }
.prose h4 { margin: var(--space-medium) 0 var(--space-tight); }
.prose p { margin: 0 0 var(--space-medium); font-size: var(--text-size-prose); line-height: 1.6; text-wrap: pretty; }
.prose ol, .prose ul { margin: var(--space-medium) 0; padding-left: var(--space-medium); font-size: var(--text-size-prose); line-height: 1.6; }
.prose li { margin-bottom: var(--space-hair); }
.prose blockquote { margin: var(--space-4xlarge) 0; padding: 0; font-size: var(--text-size-quote); font-weight: var(--weight-bold); line-height: 1; letter-spacing: -.045em; text-wrap: balance; }
.prose blockquote.blockquote--body { font-family: var(--font-sans); font-size: var(--text-size-prose); font-weight: var(--weight-regular); line-height: 1.6; letter-spacing: normal; text-wrap: pretty; }
.prose blockquote.blockquote--body p:last-child { margin-bottom: 0; }
.prose .quote { margin: var(--space-3xlarge) 0; }
.prose .quote blockquote { margin: 0; }
.prose .quote figcaption { margin-top: var(--space-small); color: var(--color-ink-muted); font-size: var(--text-size-meta); }
.prose .quote figcaption strong { color: var(--color-ink); font-weight: var(--weight-semibold); }
.prose figure { margin: var(--space-4xlarge) 0; }
.prose figure > div { aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius); background: var(--color-line); }
.prose--blog figure > div { position: relative; }
.prose--blog figure > div::after { content: ""; position: absolute; inset: 0; border: 1px solid color-mix(in srgb, var(--color-ink) 8%, transparent); border-radius: inherit; pointer-events: none; }
.prose figure.case-figure--four-three > div { aspect-ratio: 4 / 3; }
.prose figure.case-figure--banner > div { aspect-ratio: 1280 / 662; }
.prose figure.case-figure--extension > div { aspect-ratio: 1280 / 717; }
.prose figure.case-figure--screenflow > div { aspect-ratio: 1680 / 1474; }
.prose figure.case-figure--cover { margin-top: 0; }
.prose figure img { display: block; width: 100%; height: 100%; object-fit: cover; }
.prose figure.prose-figure--natural > div { aspect-ratio: auto; }
.prose figure.prose-figure--natural img { height: auto; }
.prose figure video { display: block; width: 100%; height: 100%; object-fit: cover; }
.prose figure img[role="button"] { cursor: zoom-in; }
.prose figure img[role="button"]:focus-visible { outline: 3px solid var(--color-accent); outline-offset: -3px; }
.prose figcaption { margin-top: var(--space-small); color: var(--color-ink-muted); font-size: var(--text-size-label); }
.prose .icon-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-snug); margin: var(--space-4xlarge) 0; }
.prose .icon-comparison__item { min-inline-size: 0; margin: 0; }
.prose .icon-comparison__item > div { aspect-ratio: 299 / 224; }
@media (max-width: 600px) {
  .prose section { padding-top: var(--space-medium); }
  .prose figure { margin-block: var(--space-xlarge); }
  .prose .icon-comparison { grid-template-columns: 1fr; margin-block: var(--space-xlarge); }
}
/* standalone component: works outside .prose too (404, styleguide) */
.prose__code { padding: var(--space-medium); border-radius: var(--radius); background: var(--color-surface); overflow-x: auto; }
.prose__code pre { margin: 0; font-family: var(--font-mono); font-size: var(--text-size-code); line-height: 1.6; color: var(--color-ink); }
.prose .prose__code { margin: var(--space-large) 0; }
.prose blockquote.prose__code--quote { padding: var(--space-medium); }
.prose__code--quote pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.prose__code--quote code { font-family: inherit; }
.prose sup { font-size: var(--text-size-label); vertical-align: super; }
.prose sup a { color: var(--color-accent); }
.prose .prose__notes { padding-top: var(--space-2xlarge); margin-top: var(--space-large); border-top: 1px solid var(--color-line); }
/* deliberate exception: the notes heading wears the label role, not h2 */
.prose .prose__notes h2 { font-size: var(--text-size-meta); font-weight: var(--weight-semibold); letter-spacing: .04em; text-transform: uppercase; color: var(--color-ink-muted); }
.prose .prose__notes p { margin: 0; color: var(--color-ink-muted); font-size: var(--text-size-meta); }

.fact-grid { --fact-grid-gap: var(--space-snug); display: flex; flex-wrap: wrap; align-content: start; gap: var(--fact-grid-gap); margin: 0 0 var(--space-large); }
.prose #role > .fact-grid { margin-top: var(--space-large); }
.fact { display: flex; flex: 1 1 calc((100% - var(--fact-grid-gap)) / 2); flex-direction: column; gap: var(--space-hair); padding: var(--gutter); border-radius: var(--radius); background: var(--color-surface); }
.fact dt { color: var(--color-ink-muted); }
.fact dd { margin: 0; font-size: var(--text-size-lead); font-weight: var(--weight-semibold); letter-spacing: -.02em; line-height: 1.3; text-wrap: pretty; }
.fact dd.fact__nowrap { white-space: nowrap; }
@media (max-width: 600px) {
  .fact-grid { --fact-grid-gap: var(--space-tight); }
  .fact { flex: 1 0 100%; }
}

.case-study__contribution { padding-top: var(--space-2xlarge); }
.prose section:has(> blockquote:last-child) + .case-study__contribution { padding-top: 0; }

.metric-grid { --metric-grid-gap: var(--space-snug); display: flex; flex-wrap: wrap; gap: var(--metric-grid-gap); margin-bottom: var(--space-large); }
@media (min-width: 901px) { .page--zutobi .metric { flex-basis: calc((100% - (var(--metric-grid-gap) * 2)) / 3); } }
@media (max-width: 600px) { .metric-grid { --metric-grid-gap: var(--space-tight); } }
.metric-grid--spaced { margin-block: var(--space-3xlarge); }
.metric { display: flex; flex: 1 1 200px; flex-direction: column; gap: var(--space-snug); padding: var(--space-medium); border-radius: var(--radius); background: var(--color-surface); }
.metric strong { font-size: var(--text-size-h2); line-height: .9; letter-spacing: -.05em; font-weight: var(--weight-bold); }
.metric p { margin: 0; color: var(--color-ink-muted); font-size: var(--text-size-meta); line-height: 1.4; text-wrap: pretty; }

/* rolling metric digits (Js/odometer.js): the real value keeps the layout and the
   accessible text; the reels are drawn over it. A reel is a 1em window on a strip
   of 0–9 twice; the negative margin keeps the metric's own .9 line height. */
.odometer { display: inline-grid; }
.odometer__real, .odometer__fx { grid-area: 1 / 1; }
.odometer__real { color: transparent; }
.odometer__fx { display: inline-flex; align-items: flex-start; margin-block: -.05em; line-height: 1; white-space: pre; pointer-events: none; }
.odometer__reel { position: relative; display: inline-block; height: 1em; overflow: hidden; }
.odometer__sizer { visibility: hidden; }
.odometer__strip { position: absolute; inset: 0 0 auto; display: flex; flex-direction: column; align-items: center; will-change: transform; }
.odometer__strip span { display: block; height: 1em; }

.prose .impact-icons { display: flex; flex-wrap: wrap; gap: var(--space-snug); padding: 0; margin: 0 0 var(--space-large); list-style: none; color: var(--color-ink); }
.prose #impact > .impact-icons { margin-top: var(--space-large); }
.impact-icons li { display: flex; flex: 1 1 200px; flex-direction: column; align-items: flex-start; gap: var(--space-hair); min-block-size: clamp(10rem, 16vw, 12rem); margin-bottom: 0; padding: var(--space-medium); border-radius: var(--radius); background: var(--color-surface); }
.impact-icons i { margin-bottom: auto; font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1; }
.impact-icons__title { font-size: var(--text-size-lead); line-height: 1.15; letter-spacing: -.02em; }
.impact-icons p { margin: 0; color: var(--color-ink-muted); font-size: var(--text-size-meta); line-height: 1.4; text-wrap: pretty; }

/* --- footer -------------------------------------------------------------- */

.site-footer { position: relative; padding-block: var(--space-5xlarge) var(--space-medium); container-type: inline-size; overflow: hidden; }
.site-footer__grid { display: grid; grid-template-columns: minmax(0, 70%) minmax(0, 20%) minmax(0, 10%); column-gap: 0; row-gap: var(--space-2xlarge); width: 100%; margin: var(--space-5xlarge) 0 0; }
.site-footer__grid > div { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-tight); }
.site-footer__grid > div:first-child { gap: var(--space-hair); }
.site-footer__grid a { width: max-content; font-size: var(--text-size-lead); font-weight: var(--weight-semibold); letter-spacing: -.02em; }
.site-footer__copyright { margin: var(--space-hair) 0 0; color: var(--color-ink-muted); }
.site-footer__wordmark { --footer-wordmark-gap: var(--space-3xlarge); width: 100%; max-width: 100%; margin: var(--footer-wordmark-gap) 0 0; white-space: nowrap; font-size: var(--text-size-hero); font-weight: var(--weight-semibold); line-height: .78; letter-spacing: -.12em; }
@media (max-width: 600px) {
  .site-footer { padding-top: var(--space-medium); }
}

/* responsive footer, driven by the footer's own width */
@container (max-width: 760px) {
  .site-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-2xlarge); margin-top: var(--space-3xlarge); }
  .site-footer__grid > div:nth-child(2) { grid-column: 1; grid-row: 1; }
  .site-footer__grid > div:nth-child(3) { grid-column: 2; grid-row: 1; }
  .site-footer__grid > div:first-child { grid-column: 1 / -1; grid-row: 2; }
  .site-footer__wordmark { --footer-wordmark-gap: calc(var(--space-6xlarge) + var(--space-hair)); }
}
@container (max-width: 560px) { .site-footer__wordmark { --footer-wordmark-gap: calc(var(--space-5xlarge) + var(--space-tight)); } }

/* --- decorative layers --------------------------------------------------- */

@keyframes blur-shelf-glow { from { background-position: 0 0; } to { background-position: 200% 0; } }
@keyframes footer-glow-spectrum { from { filter: hue-rotate(0deg); } to { filter: hue-rotate(360deg); } }

.footer-glow {
  position: absolute;
  z-index: 0;
  bottom: -4%;
  left: 45%;
  width: min(1599px, 100vw);
  height: min(148px, 53%);
  background: linear-gradient(90deg, #ff6d1b, #ffee55, #5bff89, #4d8aff, #6b5fff, #ff64f9, #ff6565);
  background-size: 200% 100%;
  filter: blur(4rem);
  opacity: .64;
  pointer-events: none;
  transform: translateX(-50%);
  animation: blur-shelf-glow 2s linear infinite;
}

.blur-shelf { position: fixed; z-index: 30; inset: auto -64px 0; height: var(--blur-shelf-height); overflow: clip; contain: paint; pointer-events: none; }
.blur-shelf > div { position: absolute; inset: 0; }
.blur-shelf > div:nth-child(1) { backdrop-filter: blur(calc(2px * var(--blur-shelf-intensity))) saturate(108%); -webkit-backdrop-filter: blur(calc(2px * var(--blur-shelf-intensity))) saturate(108%); mask-image: linear-gradient(to bottom, transparent 0%, #000 20%, #000 34%, transparent 52%); -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 20%, #000 34%, transparent 52%); }
.blur-shelf > div:nth-child(2) { backdrop-filter: blur(calc(4px * var(--blur-shelf-intensity))) saturate(108%); -webkit-backdrop-filter: blur(calc(4px * var(--blur-shelf-intensity))) saturate(108%); mask-image: linear-gradient(to bottom, transparent 14%, #000 32%, #000 48%, transparent 66%); -webkit-mask-image: linear-gradient(to bottom, transparent 14%, #000 32%, #000 48%, transparent 66%); }
.blur-shelf > div:nth-child(3) { backdrop-filter: blur(calc(8px * var(--blur-shelf-intensity))) saturate(108%); -webkit-backdrop-filter: blur(calc(8px * var(--blur-shelf-intensity))) saturate(108%); mask-image: linear-gradient(to bottom, transparent 30%, #000 48%, #000 62%, transparent 80%); -webkit-mask-image: linear-gradient(to bottom, transparent 30%, #000 48%, #000 62%, transparent 80%); }
.blur-shelf > div:nth-child(4) { backdrop-filter: blur(calc(14px * var(--blur-shelf-intensity))) saturate(114%); -webkit-backdrop-filter: blur(calc(14px * var(--blur-shelf-intensity))) saturate(114%); mask-image: linear-gradient(to bottom, transparent 46%, #000 64%, #000 78%, transparent 94%); -webkit-mask-image: linear-gradient(to bottom, transparent 46%, #000 64%, #000 78%, transparent 94%); }
.blur-shelf > div:nth-child(5) { backdrop-filter: blur(calc(24px * var(--blur-shelf-intensity))) saturate(120%); -webkit-backdrop-filter: blur(calc(24px * var(--blur-shelf-intensity))) saturate(120%); mask-image: linear-gradient(to bottom, transparent 62%, #000 80%, #000 100%, transparent 100%); -webkit-mask-image: linear-gradient(to bottom, transparent 62%, #000 80%, #000 100%, transparent 100%); }

@media (max-width: 600px) {
  .footer-glow { bottom: -4%; left: 45%; width: min(1599px, 100vw); height: min(148px, 53%); }
}

@media (hover: none) and (pointer: coarse) {
  .site-footer { isolation: isolate; }
  .site-footer .footer-glow {
    background: transparent;
    filter: none;
    animation: none;
  }
  .site-footer .footer-glow::before {
    content: "";
    position: absolute;
    inset: -96px;
    background:
      radial-gradient(ellipse 52% 72% at 15% 72%, rgb(255 109 27 / 80%), transparent 100%),
      radial-gradient(ellipse 48% 72% at 42% 72%, rgb(255 238 85 / 75%), transparent 100%),
      radial-gradient(ellipse 50% 76% at 68% 72%, rgb(91 255 137 / 75%), transparent 100%),
      radial-gradient(ellipse 48% 72% at 96% 72%, rgb(77 138 255 / 72%), transparent 100%),
      radial-gradient(ellipse 48% 72% at 82% 72%, rgb(255 100 249 / 55%), transparent 100%);
    animation: footer-glow-spectrum 4s linear infinite;
  }
  .page--notfound .footer-glow {
    bottom: -4%;
    left: 50%;
    width: min(1599px, 100vw);
    height: min(148px, 53%);
    border-radius: 999px;
    background: transparent;
    filter: none;
    overflow: hidden;
    transform: translateX(-50%) translateZ(0);
    animation: none;
    mask-image: radial-gradient(ellipse at center, #000 0 34%, transparent 74%);
    -webkit-mask-image: radial-gradient(ellipse at center, #000 0 34%, transparent 74%);
  }

  .page--notfound .footer-glow::before {
    content: "";
    position: absolute;
    inset: -24px -16px;
    background: linear-gradient(90deg, #ff6d1b, #ffee55, #5bff89, #4d8aff, #6b5fff, #ff64f9, #ff6565);
    background-size: 200% 100%;
    filter: blur(52px);
    transform: translateZ(0);
  }
}

@media (max-width: 568px) {
  .site-footer .site-footer__wordmark { margin-bottom: calc(var(--space-4xlarge) + var(--space-tight)); }
  .site-footer .footer-glow { bottom: calc(-4% + var(--space-4xlarge) + var(--space-tight)); height: min(400px, 53%); }
}

.grain {
  position: fixed;
  z-index: 95;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: .04;
  image-rendering: pixelated;
}

/* The same noise reads much stronger on the dark page, so it is dialled down there. */
.page[data-theme="dark"] .grain { opacity: .03; }

/* --- FAB + overlay menu -------------------------------------------------- */

.fab {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: var(--space-large);
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: var(--color-ink);
  color: var(--color-page);
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .18);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(var(--space-small)) scale(.85);
  transition: opacity .3s ease, transform var(--duration-medium) var(--ease-out-soft);
}
.fab[data-visible="true"] { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0) scale(1); }
.fab[data-contrast="light"],
.mobile-floating-nav__contact[data-contrast="light"] { background: var(--color-contrast-light); color: var(--color-contrast-dark); }
.mobile-floating-nav__logo[data-contrast="light"] img { border-color: var(--color-contrast-light); }
.fab[data-contrast="dark"],
.mobile-floating-nav__contact[data-contrast="dark"] { background: var(--color-contrast-dark); color: var(--color-contrast-light); }
.mobile-floating-nav__logo[data-contrast="dark"] img { border-color: var(--color-contrast-dark); }
.fab[data-open="true"] { background: #fff; color: var(--neutral-950); }
.fab__icon { display: grid; place-items: center; font-size: var(--text-size-h5); line-height: 1; }
.fab__icon i { grid-area: 1 / 1; display: block; line-height: 1; transition: opacity var(--duration-fast) ease, transform var(--duration-fast) ease; }
.fab__icon-close,
.fab[data-open="true"] .fab__icon-menu { opacity: 0; transform: scale(.6); }
.fab[data-open="true"] .fab__icon-close { opacity: 1; transform: scale(1); }

.mobile-floating-nav { display: contents; }
.mobile-floating-nav__center { display: contents; }
.mobile-floating-nav__logo,
.mobile-floating-nav__contact,
.mobile-floating-nav__end { display: none; }

@media (max-width: 799px) {
  .mobile-floating-nav {
    position: fixed;
    z-index: 85;
    inset-inline: var(--page-gutter);
    bottom: var(--space-large);
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    align-items: end;
    gap: var(--space-tight);
    opacity: 0;
    pointer-events: none;
    transform: translateY(var(--space-small));
    transition: opacity .3s ease, transform var(--duration-medium) var(--ease-out-soft);
  }
  .mobile-floating-nav[data-visible="true"] { opacity: 1; pointer-events: auto; transform: translateY(0); }
  .mobile-floating-nav[data-open="true"] .mobile-floating-nav__logo,
  .mobile-floating-nav[data-open="true"] .mobile-floating-nav__end { opacity: 0; pointer-events: none; }
  .mobile-floating-nav[data-open="true"] .fab { opacity: 0; pointer-events: none; transition: none; }
  .mobile-floating-nav__center { display: flex; align-items: end; justify-content: end; }
  .mobile-floating-nav__end { display: flex; align-items: end; justify-content: end; gap: var(--space-tight); transition: opacity var(--duration-fast) ease; }
  .mobile-floating-nav__logo,
  .mobile-floating-nav__contact {
    display: grid;
    place-items: center;
    inline-size: 56px;
    block-size: 56px;
    flex: 0 0 auto;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .18);
  }
  .mobile-floating-nav__logo { background: transparent; box-shadow: none; transition: opacity var(--duration-fast) ease; }
  .mobile-floating-nav__contact {
    inline-size: auto;
    min-inline-size: 104px;
    padding-inline: var(--space-medium);
    border-radius: 20px;
    background: var(--color-ink);
    color: var(--color-page);
    font-size: var(--text-size-body);
    font-weight: var(--weight-semibold);
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
  }
  .mobile-floating-nav__logo img {
    inline-size: 56px;
    block-size: 56px;
    border: 2px solid var(--color-ink);
    border-radius: 20px;
    box-sizing: border-box;
    object-fit: cover;
  }
  .mobile-floating-nav .fab {
    position: static;
    left: auto;
    bottom: auto;
    flex: 0 0 auto;
    inline-size: 56px;
    block-size: 56px;
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }
  .mobile-floating-nav .fab { inline-size: 56px; block-size: 56px; }
}

@media (max-width: 360px) {
  .mobile-floating-nav {
    inset-inline: var(--space-small);
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: var(--space-tight);
  }
  .mobile-floating-nav__end { gap: var(--space-tight); }
  .mobile-floating-nav__contact { min-inline-size: 96px; padding-inline: var(--space-small); }
}

.menu {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-snug);
  padding: var(--space-5xlarge) var(--space-medium);
  background: var(--neutral-950);
  color: var(--color-on-dark);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .28s ease;
}
.menu[data-open="true"] { opacity: 1; visibility: visible; pointer-events: auto; }
.menu .menu__link { color: var(--color-on-dark); font-family: "Manrope", var(--font-sans); font-size: var(--text-size-menu); font-weight: var(--weight-semibold); line-height: 1; letter-spacing: -.045em; }
.menu .menu__social { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-medium); margin-top: var(--space-large); }
.menu .menu__social a { color: var(--neutral-400); font-size: var(--text-size-body); }
.menu__close { position: fixed; left: calc(50% - 28px); bottom: var(--space-large); display: grid; place-items: center; width: 56px; height: 56px; padding: 0; border: 1px solid rgba(246, 245, 240, .3); border-radius: 20px; background: var(--color-on-dark); color: var(--neutral-950); cursor: pointer; }
.menu__close i { display: block; font-size: var(--text-size-lead); line-height: 1; }

/* --- 404 ----------------------------------------------------------------- */

.notfound { display: flex; flex-direction: column; gap: var(--space-3xlarge); padding: var(--space-xlarge) 0 var(--space-4xlarge); }
/* the digits are the page's image: full-bleed, clipped by the section edge */
.notfound__digits {
  margin: 0 0 calc(var(--space-large) * -1);
  font-size: var(--text-size-hero);
  font-weight: var(--weight-bold);
  line-height: .8;
  letter-spacing: -.08em;
  color: var(--color-surface);
  user-select: none;
}
.notfound__body { display: flex; flex-direction: column; gap: var(--space-medium); max-width: 62ch; }
.notfound__code { max-width: 34ch; }
.notfound__lead { color: var(--color-ink-muted); font-size: var(--text-size-prose); line-height: 1.55; text-wrap: pretty; }
.notfound__anchor { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-large); }
.notfound__anchor .prose__code { flex: 1 1 360px; max-width: 520px; margin: 0; }
.notfound__hint { flex: 1 1 240px; max-width: 34ch; color: var(--color-ink-muted); font-size: var(--text-size-meta); line-height: 1.5; text-wrap: pretty; }

.notfound__links { display: flex; flex-wrap: wrap; gap: var(--gutter); }
.notfound__links a {
  display: flex;
  flex: 1 1 200px;
  flex-direction: column;
  gap: var(--space-tight);
  padding: var(--space-medium);
  border-radius: var(--radius);
  background: var(--color-surface);
  transition: transform var(--duration-medium) var(--ease-out-soft);
}
.notfound__links a:hover { transform: translateY(-4px); }
.notfound__links a span { font-size: var(--text-size-h5); font-weight: var(--weight-bold); letter-spacing: -.025em; }
.notfound__links a small { color: var(--color-ink-muted); }
@media (max-width: 600px) { .notfound__links a { flex-basis: 100%; } }

.page--notfound { display: flex; flex-direction: column; isolation: isolate; }
.page--notfound .notfound {
  position: relative;
  z-index: 1;
  display: grid;
  flex: 1;
  inline-size: 100%;
  max-inline-size: var(--page-max-width);
  margin-inline: auto;
  align-content: center;
  justify-items: center;
  min-block-size: 0;
  padding-block: var(--space-6xlarge);
  overflow: visible;
}
.page--notfound .notfound__title {
  --notfound-title-size: clamp(40px, 8.889vw, 128px);
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--color-ink);
  font-family: "Manrope", var(--font-sans);
  font-size: var(--notfound-title-size);
  font-weight: 700;
  line-height: var(--notfound-title-size);
  letter-spacing: clamp(-8px, -.556vw, -2.5px);
  text-align: center;
}
.page--notfound .notfound__title span { display: block; }
.page--notfound .notfound__whoops { min-inline-size: 7ch; }
.page--notfound .notfound__nav {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-xlarge);
  margin-block-start: var(--space-medium);
}
.page--notfound .notfound__nav a {
  color: var(--color-ink);
  font-size: var(--text-size-lead);
  font-weight: var(--weight-semibold);
  line-height: 1;
  letter-spacing: -.04em;
}
.page--notfound .notfound__nav .rolling-link__char:nth-child(2) { transition-delay: 18ms; }
.page--notfound .notfound__nav .rolling-link__char:nth-child(3) { transition-delay: 36ms; }
.page--notfound .notfound__nav .rolling-link__char:nth-child(4) { transition-delay: 54ms; }
.page--notfound .notfound__nav .rolling-link__char:nth-child(5) { transition-delay: 72ms; }
.page--notfound .notfound__nav .rolling-link__char:nth-child(6) { transition-delay: 90ms; }
.page--notfound .notfound__nav .rolling-link__char:nth-child(7) { transition-delay: 108ms; }
.page--notfound .notfound__nav .rolling-link__char:nth-child(8) { transition-delay: 126ms; }
.page--notfound .notfound__glow {
  position: fixed;
  z-index: 0;
  bottom: -4%;
  left: 50%;
  inline-size: min(1599px, 100vw);
}
.page--notfound .notfound__blur { z-index: 2; }

@media (max-width: 600px) {
  .page--notfound .notfound { padding-block: var(--space-6xlarge); }
}

@media (max-width: 320px) {
  .page--notfound .notfound__nav { flex-direction: column; align-items: center; gap: var(--space-medium); }
}

@media (prefers-reduced-motion: reduce) {
  .site-footer .footer-glow, .page--notfound .footer-glow { animation: none; }
  .work-card figure::before,
  .work-card__cue { transition: none; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* --- styleguide --------------------------------------------------------- */

.sg-block { display: flex; flex-direction: column; gap: var(--space-large); margin-bottom: var(--space-3xlarge); }
.sg-block__label { margin: 0; color: var(--color-ink-muted); font-size: var(--text-size-label); text-transform: uppercase; letter-spacing: .08em; }

.sg-swatches { display: flex; flex-wrap: wrap; gap: var(--gutter); margin: 0; }
.sg-swatch { display: flex; flex: 1 1 160px; flex-direction: column; gap: var(--space-tight); }
.sg-swatch__chip { height: 96px; border-radius: var(--radius); border: 1px solid var(--color-line); }
.sg-swatch dt { font-size: var(--text-size-meta); font-weight: var(--weight-medium); }
.sg-swatch dd { margin: 0; color: var(--color-ink-muted); font-size: var(--text-size-meta); }

.sg-type { display: flex; flex-direction: column; }
.sg-type__row { display: flex; flex-direction: column; gap: var(--space-tight); padding: var(--space-medium) 0; border-bottom: 1px solid var(--color-line); }
.sg-type__row > small { color: var(--color-ink-muted); font-size: var(--text-size-label); text-transform: uppercase; letter-spacing: .08em; }

.sg-scale { display: flex; flex-direction: column; gap: var(--space-snug); }
.sg-scale__row { display: flex; align-items: center; gap: var(--space-medium); }
.sg-scale__row > small { flex: 0 0 120px; color: var(--color-ink-muted); font-size: var(--text-size-meta); }
.sg-scale__bar { height: 12px; border-radius: 2px; background: var(--color-ink); }
.sg-scale__row > span { color: var(--color-ink-muted); font-size: var(--text-size-meta); }

.sg-radii { display: flex; flex-wrap: wrap; gap: var(--gutter); }
.sg-radii figure { display: flex; flex: 1 1 140px; flex-direction: column; gap: var(--space-tight); margin: 0; }
.sg-radii div { height: 96px; background: var(--color-surface); }
.sg-radii figcaption { color: var(--color-ink-muted); font-size: var(--text-size-meta); }

.sg-rules { display: flex; flex-direction: column; gap: var(--space-medium); max-width: 90ch; margin: 0; padding: 0; list-style: none; counter-reset: sg-rule; }
.sg-rules li { position: relative; padding-left: var(--space-2xlarge); font-size: var(--text-size-prose); line-height: 1.5; color: var(--color-ink-muted); text-wrap: pretty; counter-increment: sg-rule; }
.sg-rules li::before { content: counter(sg-rule); position: absolute; left: 0; top: 0; color: var(--color-ink); font-size: var(--text-size-meta); font-weight: var(--weight-semibold); }
.sg-rules strong { color: var(--color-ink); }
.sg-rules code { font-family: var(--font-mono); font-size: var(--text-size-code); }

/* streaming placeholders: keep the reserved space, drop the grey box and shimmer */
.sc-placeholder,
.sc-placeholder.sc-streaming,
html.sc-dc-streaming .sc-placeholder,
.sc-interp.sc-missing,
html.sc-dc-streaming .sc-interp.sc-missing { background: transparent !important; border-color: transparent !important; }
.sc-placeholder::before,
.sc-interp.sc-missing::before,
html.sc-dc-streaming .sc-placeholder::before,
html.sc-dc-streaming .sc-interp.sc-missing::before { display: none !important; content: none !important; animation: none !important; }

/* styleguide: motion + inventory */
.sg-ease { display: block; background: var(--color-surface); border-color: var(--color-line); position: relative; overflow: hidden; }
.sg-ease::after { content: ""; position: absolute; left: var(--space-small); bottom: var(--space-small); width: 24px; height: 24px; border-radius: 50%; background: var(--color-ink); transition: transform var(--duration-slow) var(--ease-out-soft); }
.sg-swatch:hover .sg-ease::after { transform: translate(calc(100% + var(--space-large)), calc(var(--space-large) * -1)); }
.sg-ease--curve::before { content: ""; position: absolute; inset: var(--space-small); border-left: 1px solid var(--color-line); border-bottom: 1px solid var(--color-line); }

.sg-demo { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--gutter); }
.sg-demo .sg-demo__card { flex: 0 1 360px; min-height: 0; }
.sg-demo .sg-demo__rows { flex: 1 1 360px; }

.sg-inventory { display: flex; flex-direction: column; margin: 0; }
.sg-inventory__row { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 300px) minmax(0, 1fr); gap: var(--space-tight) var(--space-large); padding: var(--space-medium) 0; border-bottom: 1px solid var(--color-line); }
.sg-inventory__row dt { font-size: var(--text-size-lead); font-weight: var(--weight-semibold); letter-spacing: -.02em; }
.sg-inventory__row dd { margin: 0; color: var(--color-ink-muted); font-size: var(--text-size-meta); line-height: 1.5; text-wrap: pretty; }
@media (max-width: 900px) {
  .sg-inventory__row { grid-template-columns: minmax(0, 1fr); }
}

/* Portfolio images trailing the pointer on the 404 page (Js/notfound-trail.js). */
.notfound__trail {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.notfound__trail-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 150px;
  height: auto;
  border-radius: var(--radius);
  opacity: 0;
  transform: translate(-50%, -50%);
  user-select: none;
}
@media (prefers-reduced-motion: reduce) {
  .notfound__trail { display: none; }
}
@media (max-width: 600px) {
  .page--notfound .notfound { padding-inline: var(--page-gutter); }
  .page--notfound .notfound__title { --notfound-title-size: clamp(32px, 8.5vw, 40px); letter-spacing: -.05em; }
  .page--notfound .notfound__nav { gap: 20px; }
  .page--notfound .notfound__nav a { font-size: 20px; }
}

.page--notfound .notfound {
  display: flex;
  flex: 1;
  align-items: flex-start;
  justify-content: flex-start;
  padding: clamp(92px, 10vw, 152px) var(--page-gutter) var(--space-2xlarge);
}
.page--notfound .notfound__title {
  text-align: start;
  --notfound-title-size: clamp(40px, 4.45vw, 72px);
  letter-spacing: clamp(-4px, -.28vw, -1.8px);
}
.page--notfound .notfound__whoops { min-inline-size: 0; }
@media (max-width: 700px) {
  .page--notfound .notfound__title { --notfound-title-size: clamp(36px, 10vw, 48px); }
}

/* ==========================================================================
   Product landing template
   Reuses the site tokens and chrome; only the product content blocks are new.
   ========================================================================== */

.site-main--product { padding-top: 0; padding-bottom: var(--space-6xlarge); }
.product-page { --product-media-glow: linear-gradient(90deg, #ff6d1b, #ffee55, #5bff89, #4d8aff, #6b5fff, #ff64f9, #ff6565); }

/*
  Product media follows the active theme through its fallbacks. Set any of
  these variables on .product-page or an individual media block to keep a
  custom value unchanged in both themes:
  --product-media-backdrop, --product-media-background, --product-media-color.
*/

.product-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-block: var(--space-6xlarge);
}

.product-hero__content { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 920px; text-align: center; }
.product-hero__kicker { margin-bottom: var(--space-medium); color: var(--color-ink-muted); }
.product-hero__title { max-width: none; }
.product-hero__summary {
  max-width: 58ch;
  margin-top: var(--space-medium);
  color: var(--color-ink-muted);
  font-size: var(--text-size-lead);
  line-height: 1.4;
}
.product-hero__media {
  display: grid;
  place-items: center;
  width: 100%;
  max-width: none;
  aspect-ratio: 1586 / 992;
  margin: var(--space-3xlarge) 0 0;
  padding: var(--space-4xlarge);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--product-media-backdrop, var(--color-surface));
}
.product-hero__media > .product-image-placeholder {
  height: auto;
  max-height: 100%;
  aspect-ratio: 16 / 9;
  background: var(--product-media-background, var(--color-page));
}

.product-image-placeholder {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: var(--space-small);
  width: 100%;
  height: 100%;
  min-height: inherit;
  background: var(--product-media-background, var(--color-surface));
  color: var(--product-media-color, var(--color-ink-muted));
  text-align: center;
}
.product-image-placeholder i { font-size: var(--text-size-h3); line-height: 1; }
.product-image-placeholder span { font-size: var(--text-size-meta); font-weight: var(--weight-semibold); line-height: 1.4; }

.product-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-snug); margin-top: var(--space-large); }
.product-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-tight);
  min-height: 52px;
  padding: var(--space-snug) var(--space-medium);
  border: 1px solid var(--color-ink);
  border-radius: var(--space-snug);
  font-size: var(--text-size-body);
  font-weight: var(--weight-semibold);
  line-height: 1;
  white-space: nowrap;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease, transform var(--duration-fast) var(--ease-out-soft);
}
.product-button i { font-size: var(--text-size-lead); line-height: 1; }
.product-button--primary { background: var(--color-ink); color: var(--color-page); }
.product-button--secondary { background: transparent; color: var(--color-ink); }
.product-button:hover { transform: translateY(-2px); }
.product-button:active { transform: translateY(1px); }
.product-button:focus-visible { outline: 3px solid var(--color-ink); outline-offset: 3px; }

.product-section { padding-block: var(--space-6xlarge); }
.product-section--inactive,
.rule--inactive { display: none; }
.product-section__intro { max-width: 1040px; margin: 0 auto var(--space-3xlarge); text-align: center; }
.product-section__intro .section__heading { max-width: 24ch; margin: 0 auto var(--space-medium); }
.product-section__intro > p { max-width: 64ch; margin-inline: auto; color: var(--color-ink-muted); font-size: var(--text-size-lead); line-height: 1.5; }

.product-outcomes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--space-xlarge);
  row-gap: var(--space-xlarge);
}
.product-outcomes__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  min-height: 0;
}
.product-outcomes__item > i {
  display: grid;
  place-items: center;
  width: var(--text-size-h3);
  height: var(--text-size-h3);
  margin-bottom: var(--space-medium);
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--color-ink);
  font-size: var(--text-size-h3);
  line-height: 1;
}
.product-outcomes__item h3 { max-width: 22ch; margin: 0 0 var(--space-tight); font-size: var(--text-size-lead); line-height: 1.3; }
.product-outcomes__item p { max-width: 42ch; color: var(--color-ink-muted); font-size: var(--text-size-body); line-height: 1.5; }

.product-gallery {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 600px);
  align-items: start;
  gap: clamp(80px, 9vw, 160px);
}
.product-gallery__content { display: flex; flex-direction: column; min-width: 0; }
.product-gallery__intro { margin-bottom: var(--space-3xlarge); }
.product-gallery__intro .section__heading { max-width: 16ch; margin: 0 0 var(--space-medium); }
.product-gallery__intro > p { max-width: 42ch; color: var(--color-ink-muted); font-size: var(--text-size-lead); line-height: 1.5; }
.product-gallery__tabs { display: block; }
.product-gallery__item { position: relative; border-top: 1px solid var(--color-line); }
.product-gallery__item:last-child { border-bottom: 1px solid var(--color-line); }
.product-gallery__item::before {
  position: absolute;
  top: -1px;
  left: 0;
  z-index: 1;
  width: 0;
  height: 2px;
  background: var(--color-ink);
  content: "";
}
.product-gallery__tab {
  position: relative;
  display: block;
  width: 100%;
  padding: var(--space-medium) 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--color-ink-muted);
  font: inherit;
  font-size: var(--text-size-lead);
  font-weight: var(--weight-semibold);
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  transition: color var(--duration-fast) ease;
}
.product-gallery__tab:hover,
.product-gallery__item[data-active="true"] .product-gallery__tab { color: var(--color-ink); }
.product-gallery__item[data-active="true"] .product-gallery__tab { padding-bottom: var(--space-small); }
.product-gallery__item[data-active="true"]::before { animation: product-gallery-progress 5.2s linear both; }
.product-gallery[data-paused="true"] .product-gallery__item[data-active="true"]::before { width: 100%; animation: none; }
.product-gallery__tab:focus-visible { z-index: 1; outline: 3px solid var(--color-ink); outline-offset: 3px; }
.product-gallery__answer {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows var(--duration-medium) var(--ease-out-soft), opacity var(--duration-fast) ease;
}
.product-gallery__item[data-active="true"] .product-gallery__answer { grid-template-rows: 1fr; opacity: 1; }
.product-gallery__answer-inner { min-height: 0; overflow: hidden; }
.product-gallery__answer p { max-width: 42ch; margin: 0; padding-bottom: var(--space-medium); color: var(--color-ink-muted); line-height: 1.5; }
.product-gallery__visual {
  position: relative;
  justify-self: end;
  width: 100%;
  max-width: 600px;
  min-width: 0;
  aspect-ratio: 5 / 6;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--product-media-backdrop, var(--color-surface));
}
.product-gallery__visual::after {
  position: absolute;
  z-index: 1;
  right: -10%;
  bottom: 0;
  left: -10%;
  height: 50%;
  background: var(--product-media-glow);
  filter: blur(3rem);
  opacity: .42;
  pointer-events: none;
  content: "";
}
.product-gallery__frame {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: var(--space-3xlarge);
  opacity: 0;
  transform: scale(1.025);
  transition: opacity 420ms ease, transform 700ms var(--ease-out-soft);
}
.product-gallery__image {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--product-media-background, var(--color-page));
}
.product-gallery__frame[data-active="true"] { z-index: 2; opacity: 1; transform: scale(1); }

@keyframes product-gallery-progress {
  from { width: 0; }
  to { width: 100%; }
}

.product-workflow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--space-xlarge); row-gap: 0; margin: 0; padding: 0; list-style: none; }
.product-workflow li { display: grid; grid-row: span 3; grid-template-rows: subgrid; min-width: 0; }
.product-workflow li:nth-child(1),
.product-workflow li:nth-child(4) { grid-column: span 2; }
.product-workflow li:nth-child(2),
.product-workflow li:nth-child(3) { grid-column: span 1; }
.product-workflow li:nth-child(n + 3) { margin-top: var(--space-4xlarge); }
.product-workflow__media { align-self: stretch; width: 100%; height: auto; aspect-ratio: 16 / 9; margin: 0 0 var(--space-medium); border-radius: var(--radius); overflow: hidden; background: var(--product-media-backdrop, var(--color-surface)); }
.product-workflow__media .product-image-placeholder { height: 100%; }
.product-workflow__media--layered {
  position: relative;
  display: grid;
  place-items: center;
  padding: var(--space-xlarge);
}
.product-workflow__media--layered .product-workflow__image {
  position: relative;
  z-index: 2;
  width: 78%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--product-media-background, var(--color-page));
}
.product-workflow h4 { margin: 0 0 var(--space-small); }
.product-workflow p { max-width: 38ch; color: var(--color-ink-muted); }

.product-audience { display: block; }
.product-audience__groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gutter); }
.product-audience__groups article { display: flex; flex-direction: column; min-width: 0; min-height: 280px; padding: var(--space-large); border-radius: var(--radius); background: var(--color-surface); }
.product-audience__groups i { display: block; margin-bottom: auto; font-size: var(--text-size-h3); line-height: 1; }
.product-audience__groups h4 { margin: 0 0 var(--space-small); }
.product-audience__groups p { color: var(--color-ink-muted); }

.product-section--faq { display: block; }
.product-faq { width: 100%; max-width: 960px; margin-inline: auto; border-top: 1px solid var(--color-line); interpolate-size: allow-keywords; }
.product-faq details { border-bottom: 1px solid var(--color-line); }
.product-faq details::details-content {
  block-size: 0;
  overflow: clip;
  opacity: 0;
  transition:
    block-size var(--duration-medium) var(--ease-out-soft),
    opacity var(--duration-fast) ease,
    content-visibility var(--duration-medium) allow-discrete;
}
.product-faq details[open]::details-content { block-size: auto; opacity: 1; }
.product-faq summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-large);
  min-height: 88px;
  padding-block: var(--space-small);
  cursor: pointer;
  font-size: var(--text-size-lead);
  font-weight: var(--weight-semibold);
  list-style: none;
}
.product-faq summary::-webkit-details-marker { display: none; }
.product-faq summary:focus-visible { outline: 3px solid var(--color-ink); outline-offset: 3px; }
.product-faq__icons { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--color-line); border-radius: 50%; }
.product-faq__icons i { grid-area: 1 / 1; font-size: var(--text-size-lead); transition: opacity var(--duration-fast) ease, transform var(--duration-fast) var(--ease-out-soft); }
.product-faq__icons .ph-minus { opacity: 0; transform: rotate(-90deg); }
.product-faq details[open] .product-faq__icons .ph-plus { opacity: 0; transform: rotate(90deg); }
.product-faq details[open] .product-faq__icons .ph-minus { opacity: 1; transform: none; }
.product-faq details > p { width: 100%; max-width: 100%; padding: 0 0 var(--space-large); color: var(--color-ink-muted); font-size: var(--text-size-body); line-height: 1.6; }

.product-download {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: var(--space-3xlarge);
  padding: var(--space-5xlarge) var(--space-4xlarge);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-ink);
  text-align: center;
}
.product-download__media {
  width: 80px;
  height: 80px;
  margin: 0 0 var(--space-large);
  border-radius: var(--space-medium);
  overflow: hidden;
  background: var(--product-media-background, var(--color-page));
}
.product-download h2 { max-width: 20ch; margin-inline: auto; }
.product-download p { max-width: 50ch; margin: var(--space-medium) auto 0; color: var(--color-ink-muted); font-size: var(--text-size-lead); }
.product-button--download { margin-top: var(--space-large); border-color: var(--color-ink); background: var(--color-ink); color: var(--color-page); }
.product-button--download:focus-visible { outline-color: var(--color-ink); }

@media (max-width: 1200px) {
  .product-gallery { grid-template-columns: minmax(0, 1fr) minmax(360px, 42vw); gap: var(--space-4xlarge); }
  .product-gallery__visual { max-width: 520px; }
  .product-download { padding: var(--space-3xlarge); }
}

@media (max-width: 1024px) {
  .product-gallery__intro .section__heading { max-width: none; }
}

@media (max-width: 900px) {
  .product-hero { padding-block: var(--space-6xlarge) var(--space-4xlarge); }
  .product-hero__media { padding: var(--space-3xlarge); }
  .product-section { padding-block: var(--space-4xlarge); }
  .product-gallery { grid-template-columns: minmax(0, 1fr); }
  .product-gallery__visual { justify-self: stretch; max-width: none; }
  .product-outcomes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .product-workflow { grid-template-columns: minmax(0, 1fr); gap: var(--space-xlarge); }
  .product-workflow li:nth-child(n) { display: block; grid-column: auto; grid-row: auto; margin-top: 0; }
  .product-workflow__media { height: auto; aspect-ratio: 16 / 9; }
  .product-audience__groups { grid-template-columns: minmax(0, 1fr); }
  .product-audience__groups article { min-height: 240px; }
}

@media (max-width: 600px) {
  .site-main--product { padding-bottom: var(--space-4xlarge); }
  .product-hero { padding-block: var(--space-5xlarge) var(--space-3xlarge); }
  .product-hero__kicker { margin-bottom: var(--space-small); }
  .product-hero__summary { margin-top: var(--space-small); font-size: var(--text-size-body); }
  .product-hero__media { margin-top: var(--space-large); padding: var(--space-medium); }
  .product-actions { margin-top: var(--space-medium); }
  .product-section { padding-block: var(--space-3xlarge); }
  .product-section__intro { margin-bottom: var(--space-xlarge); }
  .product-section__intro > p { font-size: var(--text-size-body); }
  .product-gallery { gap: var(--space-xlarge); }
  .product-gallery__intro { margin-bottom: var(--space-xlarge); }
  .product-gallery__intro > p { font-size: var(--text-size-body); }
  .product-gallery__tab { padding-block: var(--space-snug); font-size: var(--text-size-body); }
  .product-gallery__answer p { padding-bottom: var(--space-medium); }
  .product-gallery__frame { padding: var(--space-large); }
  .product-workflow__media--layered { padding: var(--space-small); }
  .product-workflow__media--layered .product-workflow__image { width: 84%; }
  .product-outcomes__item > i { margin-bottom: var(--space-medium); }
  .product-audience__groups article { min-height: 220px; padding: var(--space-medium); }
  .product-faq summary { min-height: 76px; gap: var(--space-small); font-size: var(--text-size-body); }
  .product-download { gap: var(--space-large); margin-top: var(--space-large); padding: var(--space-large); }
  .product-download__media { width: 64px; height: 64px; margin-bottom: 0; border-radius: var(--space-snug); }
  .product-download p { font-size: var(--text-size-body); }
  .product-workflow p { line-height: 1.4; text-wrap: pretty; }
}

@media (max-width: 520px) {
  .product-outcomes { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 480px) {
  .product-actions { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; }
  .product-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .product-button,
  .product-faq details::details-content,
  .product-faq__icons i,
  .product-gallery__tab,
  .product-gallery__answer,
  .product-gallery__frame { transition: none; }
  .product-gallery__item[data-active="true"]::before { width: 100%; animation: none; }
}
