/* ============================================================
   Shared styles — status pill + button system + distance footer
   ============================================================ */

:root {
  /* Serif pair: Instrument Serif for the big display lines, Newsreader for everything else. */
  --font-display: "Instrument Serif", Georgia, serif;
  --font-serif: "Newsreader", Georgia, serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* Color tokens, two layers. Raw values live only in the primitive layer;
     the semantic layer may only reference primitives. Adopted by new CSS
     first; older styles still use raw values until the site-wide pass. */

  /* Primitive */
  --whale-100: #ffffff;   /* palette C: white (was Pantone 663 C White Whale) */
  --silver-300: #f1f1f1;  /* palette C: light grey band (was Pantone 5455 C Silver Grey) */
  /* Ink ramp (palette C, 2026-10-29): neutral near-black to white. Kept the ganache-* names so every page follows. */
  --ganache-50: #fafafa;
  --ganache-100: #f5f5f5;
  --ganache-200: #e8e8e8;
  --ganache-300: #d4d4d4;
  --ganache-400: #a8a8a8;
  --ganache-500: #6b6b6b;
  --ganache-600: #555555;
  --ganache-700: #333333;
  --ganache-800: #222222;
  --ganache-900: #111111;
  --ganache-950: #0a0a0a;
  --green-700: #2e7d46;
  --green-500: #37a05a;
  --strava-orange: #fc4c02; /* Temporary route colour until the site accent is chosen */
  --brand-blue: #1F3FD0; /* palette C accent: run routes and scribbles */
  --white: #fff;
  --black: #000;

  /* Semantic */
  --color-surface: var(--whale-100);
  --color-surface-muted: var(--silver-300);
  --color-surface-inverse: var(--ganache-950);
  --color-surface-hover: color-mix(in srgb, var(--ganache-900) 6%, transparent);
  --color-content: var(--ganache-900);
  --color-content-body: var(--ganache-700);
  --color-content-muted: var(--ganache-500);
  --color-content-inverse: var(--whale-100);
  --color-background-strong: var(--ganache-900);
  --color-background-strong-hover: var(--ganache-800);
  --color-border-muted: var(--ganache-400);
  --color-border-subtle: color-mix(in srgb, var(--ganache-900) 15%, transparent);
  --color-scrim: color-mix(in srgb, var(--black) 60%, transparent);
  --color-status-positive: var(--green-700);
  --color-status-positive-accent: var(--green-500);
  --route-stroke: var(--strava-orange);

  /* Motion */
  --motion-duration-fast: 160ms;
  --motion-duration-base: 280ms;
  --motion-ease-out: cubic-bezier(.2, .8, .2, 1);
  --motion-ease-in: cubic-bezier(.4, 0, 1, 1);
}

/* No fi / fl ligatures anywhere: "Chofi" should read as separate letters. */
html { font-variant-ligatures: no-common-ligatures; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; /* iOS Safari: no automatic text enlarging */ }

/* ------------------------------------------------------------
   Buttons — one system, two weights.
   .btn-primary: filled, brand-dark. The one action per screen
     that most matters — never more than one visible at a time.
   .btn-secondary: outlined in a lighter step of the same Ganache
     ramp as the primary (border-muted = ganache-400), so it's
     provably the same family. Hover snaps the border/text to
     full primary.
   Use these classes instead of re-typing the utility strings —
   that's what caused buttons to drift out of sync
   before this existed.
   ------------------------------------------------------------ */
.btn { display: inline-block; padding: 8px 16px; font-size: 14px; transition: color .15s ease, background-color .15s ease, border-color .15s ease; }
.btn-primary { background: var(--color-background-strong); color: var(--color-content-inverse); }
.btn-primary:hover { background: var(--color-background-strong-hover); }
.btn-primary:focus-visible { outline: 2px solid var(--color-content); outline-offset: 4px; }
.btn-secondary { border: 1px solid var(--color-border-muted); color: var(--color-content-body); }
.btn-secondary:hover { border-color: var(--color-content); color: var(--color-content); }

.status { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 13px; color: var(--color-status-positive); }
.status .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--color-status-positive-accent); animation: pulse 1.8s ease-out infinite; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--color-status-positive-accent) 55%, transparent); }
  70%  { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) { .status .dot { animation: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-status-positive-accent) 18%, transparent); } }

/* Shared hand-drawn arrow used by the footer and site links. */
.site-arrow-svg { display: inline-block; flex: 0 0 auto; width: 28px; height: 14px; overflow: visible; vertical-align: middle; transition: translate .2s ease; }
.site-arrow-svg--inline { width: .9em; height: .45em; }
.site-arrow-svg--metric { width: 28px; height: 14px; margin-inline: .12em; }
.site-arrow-svg--up-right { rotate: -45deg; }
.site-arrow-svg--left { transform: rotate(180deg); }
a:hover .site-arrow-svg:not(.site-arrow-svg--left), button:hover .site-arrow-svg:not(.site-arrow-svg--left) { translate: 4px 0; }
a:hover .site-arrow-svg--left, button:hover .site-arrow-svg--left { translate: -4px 0; }
/* Shared site footer (homepage and every case study): a thin line, a running-km line, and the homepage's
   "Get in touch" link. Page background, full-width homepage container; colours only from tokens. */
.site-footer { display: flex; flex-direction: column; gap: 20px; margin: 160px var(--home-gutter) 0; padding: 28px 0 64px; border-top: 1px solid var(--home-line); }
.km-line { margin: 0; color: var(--home-muted); font-size: 15px; line-height: 1.6; }
.km-line .km { color: var(--color-content); font-family: "IBM Plex Mono", var(--mono); }
/* same look as the homepage's .home-footer__link */
.footer-cta { display: inline-flex; align-items: center; align-self: flex-start; gap: 14px; color: var(--color-content); font-family: var(--font-serif); font-size: clamp(30px, 4vw, 52px); line-height: 1; text-decoration: none; }
.footer-cta:hover { color: var(--home-accent); }
.footer-cta:focus-visible { outline: 2px solid var(--home-accent); outline-offset: 5px; }

/* Hand-drawn underline (scribble.js) on nav links and "Get in touch". */
:root { --scribble: #1F3FD0; }
:root[data-theme="dark"] { --scribble: #7E96F5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --scribble: #7E96F5; } }
.site-nav a, .nh-nav a, .footer-cta .scribble-text, [data-scribble] { position: relative; }
.scribble { position: absolute; left: -2%; top: 92%; width: 104%; height: .62em; min-height: 13px; overflow: visible; pointer-events: none; }
.scribble path { fill: none; stroke: var(--scribble); stroke-width: 3px; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; stroke-dasharray: 1 1; stroke-dashoffset: 1; transition: stroke-dashoffset .55s cubic-bezier(.3, .7, .3, 1); }
.footer-cta .scribble path { stroke-width: 4.5px; }
.is-scribbled .scribble path { stroke-dashoffset: 0; }
@media (prefers-reduced-motion: reduce) { .scribble path { transition: none; } }
.footer-links { display: flex; gap: 24px; margin: 0; font-size: 15px; }
.footer-links a { color: var(--home-muted); text-decoration: none; }
.footer-links a:hover { color: var(--color-content); text-decoration: underline; text-underline-offset: 4px; }

/* Case study closer: the other case studies as one typographic list, set like a gig poster with upright
   and italic names in turn. Kept smaller than the footer's "Get in touch" so the two don't compete. */
.more-work { margin: 112px var(--home-gutter) 0; padding-top: 28px; border-top: 1px solid var(--home-line); text-align: center; }
.more-work__label { margin: 0 0 20px; color: var(--home-muted); font-size: 14px; letter-spacing: .02em; }
.more-work__list { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 0; padding: 0; list-style: none; }
.more-work__link { position: relative; display: inline-block; color: var(--color-content); text-decoration: none; }
.more-work__link:focus-visible { outline: 2px solid var(--home-accent); outline-offset: 6px; }
.more-work__name { position: relative; z-index: 1; font-family: var(--font-serif); font-size: clamp(28px, 3.2vw, 46px); font-weight: 400; line-height: 1.1; letter-spacing: -.015em; transition: color .3s ease; }
.more-work__list li:nth-child(even) .more-work__name { font-style: italic; }
.more-work__cover { position: absolute; z-index: 0; top: 50%; left: calc(100% - 40px); width: clamp(180px, 16vw, 240px); aspect-ratio: 4 / 3; overflow: hidden; border-radius: 6px; opacity: 0; transform: translateY(-40%) scale(.94) rotate(-2deg); transition: opacity .4s ease, transform .55s cubic-bezier(.22, 1, .36, 1); pointer-events: none; }
.more-work__cover video, .more-work__cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (hover: hover) {
  .more-work__list:hover .more-work__name { color: var(--home-muted); }
  .more-work__link:hover .more-work__name, .more-work__link:focus-visible .more-work__name { color: var(--color-content); }
  .more-work__link:hover .more-work__cover, .more-work__link:focus-visible .more-work__cover { z-index: 2; opacity: 1; transform: translateY(-50%) scale(1) rotate(-2deg); }
}
@media (hover: none) { .more-work__cover { display: none; } }
@media (prefers-reduced-motion: reduce) { .more-work__name, .more-work__cover { transition: none; } }
@media (max-width: 760px) { .more-work { margin-top: 96px; padding-top: 24px; } }
@media (max-width: 720px) {
  .site-footer { gap: 16px; margin-top: 96px; padding: 24px 0 48px; }
  .km-line { font-size: 14px; }
}

#unfurl { scroll-margin-top: 120px; }

/* Writing page is a dark page built on the inverse tokens. In dark mode those tokens flip to light,
   so pin them back to the dark surface + light text to keep the page dark in both themes. */
:root[data-theme="dark"] .writing-page { --color-surface-inverse: var(--color-surface); --color-content-inverse: var(--color-content); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .writing-page { --color-surface-inverse: var(--color-surface); --color-content-inverse: var(--color-content); }
}

/* Writing page entrance. <html>.writing-intro is set by an inline head
   script (skipped under reduced motion) so nothing paints in its final
   state before canvas-explore.js takes over. */
.writing-intro [data-canvas-focus] h1:not([data-intro-split]) {
  opacity: .12;
  filter: blur(4px);
  animation: writing-intro-failsafe 0s 4s forwards; /* if JS never runs */
}
.writing-intro [data-canvas-hint] {
  opacity: 0;
  animation: writing-intro-failsafe 0s 8s forwards;
}
@keyframes writing-intro-failsafe { to { opacity: 1; filter: none; } }
.intro-word { display: inline-block; white-space: nowrap; }
.intro-char { display: inline-block; }

/* Frosted-glass headers: a see-through background plus a strong backdrop blur, so content scrolling underneath
   reads as soft colour rather than being hidden by a solid bar. Shared by every page header. */
:root { --header-glass-tint: 40%; }
/* The header itself is clear and borderless. Two stacked blur layers stay inside the header: a light blur that fades
   out toward the bottom edge, and a strong blur only near the top. Small steps between blur levels avoid the ghosted,
   double-image band that one heavy blur fading straight to sharp produces (a "progressive blur"). */
header.header-glass.header-glass, header.case-opener-header.is-past-hero { background-color: transparent; border-color: transparent; }
:is(header.header-glass, header.case-opener-header.is-past-hero)::before,
:is(header.header-glass, header.case-opener-header.is-past-hero)::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; }
:is(header.header-glass, header.case-opener-header.is-past-hero)::before {
  background: color-mix(in srgb, var(--header-glass-surface, var(--color-surface)) var(--header-glass-tint), transparent);
  -webkit-backdrop-filter: blur(4px) saturate(140%); backdrop-filter: blur(4px) saturate(140%);
  -webkit-mask-image: linear-gradient(to bottom, #000 45%, transparent);
          mask-image: linear-gradient(to bottom, #000 45%, transparent);
}
:is(header.header-glass, header.case-opener-header.is-past-hero)::after {
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  -webkit-mask-image: linear-gradient(to bottom, #000 20%, transparent 70%);
          mask-image: linear-gradient(to bottom, #000 20%, transparent 70%);
}

/* Shared header and cross-page transitions. */
@view-transition { navigation: auto; }
.site-logo { display: block; line-height: 0; }
.site-logo img { display: block; width: auto; filter: var(--logo-filter); }
.site-nav { display: flex; font: 400 15px/1.2 'Instrument Sans', sans-serif; letter-spacing: .01em; }
.site-nav a { text-decoration: none; }
.site-header__right { display: flex; align-items: center; gap: 28px; }
.theme-toggle { width: 44px; height: 44px; padding: 0; border: 0; border-radius: 0; background: transparent; color: inherit; font: inherit; font-size: 16px; line-height: 1; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.theme-toggle:hover { opacity: .7; }
.theme-toggle:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.site-logo { view-transition-name: site-logo; }
.site-nav { view-transition-name: site-nav; }
.theme-toggle { view-transition-name: theme-toggle; }
::view-transition-group(site-logo),
::view-transition-group(site-nav),
::view-transition-group(theme-toggle) { animation-duration: 300ms; animation-timing-function: cubic-bezier(.2,0,0,1); }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 200ms; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
}
:root { --logo-filter: none; }
:root[data-theme="dark"] { --logo-filter: invert(1) brightness(1.1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --logo-filter: invert(1) brightness(1.1); } }
.site-header[data-header="home"] { box-sizing: border-box; width: 100%; max-width: 100%; position: relative; display: flex; flex-direction: column; align-items: center; gap: 24px; padding: 40px 40px 0; }
.site-header[data-header="home"] .site-header__right { box-sizing: border-box; width: 100%; min-width: 0; justify-content: center; }
.site-header[data-header="home"] .site-logo img { height: 52px; }
.site-header[data-header="home"] .site-nav { box-sizing: border-box; width: 100%; gap: 8px 36px; flex-wrap: wrap; justify-content: center; }
.site-header[data-header="home"] .theme-toggle { position: absolute; top: 40px; right: 40px; }
.site-header[data-header="compact"] { box-sizing: border-box; width: 100%; max-width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 24px 40px; }
.site-header[data-header="compact"] .site-logo img { height: 36px; }
.site-header[data-header="compact"] .site-nav { gap: 28px; }
.site-header[data-header="compact"].case-opener-header { margin-bottom: -92px; }
header[data-queen-hero-header] + main { margin-top: -92px; }
.site-header[data-header="compact"] .theme-toggle { flex: 0 0 44px; }
.site-header[data-header="compact"] .site-nav a { color: inherit; }
.site-header[data-header="compact"] .theme-toggle { color: inherit; }
.site-header[data-header="compact"] .site-logo img { filter: var(--header-logo-filter, var(--logo-filter)); }
.case-opener-header--dark .site-logo img,
.case-opener-header--cream .site-logo img,
header[data-queen-hero-header][data-over-hero] .site-logo img { --header-logo-filter: invert(1) brightness(1.1); }
.case-opener-header.is-past-hero .site-logo img,
/* Queen's inline header script toggles [data-over-hero] instead of .is-past-hero */
header[data-queen-hero-header]:not([data-over-hero]) .site-logo img { --header-logo-filter: var(--logo-filter); }
.site-header[data-header="home"] { border: 0; background: transparent; }
/* Over a case study cover the header sits on the cover itself, so no frost there. */
:is(header.case-opener-header:not(.is-past-hero), header[data-queen-hero-header][data-over-hero])::before,
:is(header.case-opener-header:not(.is-past-hero), header[data-queen-hero-header][data-over-hero])::after { display: none; }
.writing-page > header { --header-glass-surface: var(--color-surface-inverse); }
.writing-page .site-logo img { --logo-filter: invert(1) brightness(1.1); }
.home-intro { margin-top: 0; padding-top: 0; }

/* Keep the opportunity label readable on the blue homepage introduction. */
.home-intro-status { color: var(--color-content-body); }

/* Homepage layout: Hero C + one featured and four supporting case studies. */
:root {
  --home-gutter: clamp(20px, 4vw, 48px);
  --home-line: color-mix(in srgb, var(--color-content) 15%, transparent);
  --home-muted: var(--color-content-muted);
  --home-accent: var(--ganache-900);
  color-scheme: light;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
  --whale-100: #0e0e0f;
  --silver-300: #1a1a1c;
  --ganache-50: #131314;
  --ganache-100: #18181a;
  --ganache-200: #2a2a2d;
  --ganache-300: #3d3d41;
  --ganache-400: #6e6e73;
  --ganache-500: #9a9a9a;
  --ganache-600: #b4b4b4;
  --ganache-700: #d4d4d4;
  --ganache-800: #e4e4e4;
  --ganache-900: #f2f2f2;
  --ganache-950: #fafafa;
  --color-surface: #0e0e0f;
  --color-surface-muted: #1a1a1c;
  --color-surface-inverse: #f2f2f2;
  --color-content: #f2f2f2;
  --color-content-body: #d4d4d4;
  --color-content-muted: #9a9a9a;
  --color-content-inverse: #0e0e0f;
  --color-background-strong: #f2f2f2;
  --color-background-strong-hover: #d4d4d4;
  --color-border-muted: #6e6e73;
  --home-line: #2a2a2d;
  --home-accent: var(--ganache-900);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --whale-100: #0e0e0f;
    --silver-300: #1a1a1c;
    --ganache-50: #131314;
    --ganache-100: #18181a;
    --ganache-200: #2a2a2d;
    --ganache-300: #3d3d41;
    --ganache-400: #6e6e73;
    --ganache-500: #9a9a9a;
    --ganache-600: #b4b4b4;
    --ganache-700: #d4d4d4;
    --ganache-800: #e4e4e4;
    --ganache-900: #f2f2f2;
    --ganache-950: #fafafa;
    --color-surface: #0e0e0f;
    --color-surface-muted: #1a1a1c;
    --color-surface-inverse: #f2f2f2;
    --color-content: #f2f2f2;
    --color-content-body: #d4d4d4;
    --color-content-muted: #9a9a9a;
    --color-content-inverse: #0e0e0f;
    --color-background-strong: #f2f2f2;
    --color-background-strong-hover: #d4d4d4;
    --color-border-muted: #6e6e73;
    --home-line: #2a2a2d;
    --home-accent: var(--ganache-900);
    color-scheme: dark;
  }
}
.home-hero a:focus-visible, .home-hero button:focus-visible, .home-work a:focus-visible { outline: 2px solid var(--home-accent); outline-offset: 4px; }
.home-hero { margin-top: 0; min-height: 78svh; padding: clamp(24px, 4vh, 48px) var(--home-gutter) clamp(48px, 7vh, 76px); overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: clamp(36px, 5vh, 60px); background: var(--color-surface); }
.home-hero__visual { position: relative; width: 100%; height: auto; flex: 0 0 auto; }
.home-hero__display { position: relative; z-index: 1; }
.home-hero__line { margin: 0; font-family: var(--font-display); font-size: clamp(72px, 14.5vw, 250px); font-weight: 400; line-height: .95; letter-spacing: -.03em; white-space: nowrap; }
.home-hero__intro { display: grid; grid-template-columns: minmax(0, 8fr) auto; align-items: end; gap: 36px; }
.home-hero__statement { max-width: 27em; margin: 0; font-family: var(--font-serif); font-size: clamp(22px, 2.3vw, 36px); font-weight: 400; line-height: 1.15; }
.home-hero__statement sup { margin-left: .08em; font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: .4em; line-height: 0; vertical-align: super; }
.home-hero__statement sup a { color: var(--home-muted); text-decoration: none; }
.home-hero__statement sup a:hover { color: var(--home-accent); }

/* Homepage "run": hover / focus / tap reveals one route (run-route.js). Absolutely positioned so it never shifts the layout. */
.home-hero__intro { position: relative; }
.run-route__trigger { padding: 0; border: 0; background: none; color: inherit; font: inherit; line-height: inherit; cursor: default; text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: transparent; text-underline-offset: .14em; transition: text-decoration-color 150ms ease; }
.run-route__trigger.is-ready { cursor: pointer; text-decoration-color: var(--home-line); }
.run-route__trigger.is-ready:hover, .run-route__trigger[aria-expanded="true"] { text-decoration-color: var(--route-stroke); }
.run-route__trigger:focus-visible { outline: 2px solid var(--home-accent); outline-offset: 4px; }
.run-route { position: absolute; z-index: 3; top: 0; left: 0; display: flex; align-items: flex-start; gap: 18px; padding: 6px 16px 10px 0; background: var(--color-surface); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 150ms ease, visibility 0s linear 150ms; }
.run-route.is-open { opacity: 1; visibility: visible; transition: none; }
.run-route__map { flex: 0 0 auto; display: block; overflow: visible; }
.run-route__map path { fill: none; stroke: var(--route-stroke); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: var(--run-route-length); stroke-dashoffset: var(--run-route-length); }
.run-route.is-open .run-route__map path { animation: run-route-draw 500ms ease-out forwards; }
.run-route__info { display: grid; gap: 6px; padding-top: 2px; font-family: Inter, ui-sans-serif, system-ui, sans-serif; white-space: nowrap; }
.run-route__stats { display: grid; gap: 6px; margin: 0; }
.run-route__stats dt { color: var(--home-muted); font-size: 10px; font-weight: 500; letter-spacing: .08em; line-height: 1.4; text-transform: uppercase; }
.run-route__stats dd { margin: 0; color: var(--color-content); font-size: 17px; font-weight: 600; line-height: 1.2; }
.run-route__city { margin: 2px 0 0; color: var(--color-content-body); font-size: 13px; line-height: 1.3; }
.run-route__stats > div, .run-route__city { opacity: 0; transform: translateY(4px); }
.run-route.is-open .run-route__stats > div, .run-route.is-open .run-route__city { animation: run-route-rise 250ms var(--motion-ease-out) forwards; }
.run-route.is-open .run-route__stats > div:nth-child(1) { animation-delay: 300ms; }
.run-route.is-open .run-route__stats > div:nth-child(2) { animation-delay: 400ms; }
.run-route.is-open .run-route__stats > div:nth-child(3) { animation-delay: 500ms; }
.run-route.is-open .run-route__city { animation-delay: 600ms; }
.run-route.is-static .run-route__map path { animation: none; stroke-dashoffset: 0; }
.run-route.is-static .run-route__stats > div, .run-route.is-static .run-route__city { animation: none; opacity: 1; transform: none; }
@keyframes run-route-draw { to { stroke-dashoffset: 0; } }
@keyframes run-route-rise { to { opacity: 1; transform: none; } }
.home-hero__status { display: inline-flex; align-items: center; gap: 10px; justify-self: end; margin: 0 0 4px; padding: 10px 14px; border: 1px solid var(--home-line); border-radius: 999px; color: var(--color-content); font-size: 13px; white-space: nowrap; }
.home-status-dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--color-status-positive-accent); animation: pulse 1.8s ease-out infinite; }
@media (prefers-reduced-motion: reduce) { .home-status-dot { animation: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-status-positive-accent) 18%, transparent); } }
.home-hero__details { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 5fr); align-items: end; gap: 32px; }
.home-hero__based { margin: 0; color: var(--home-muted); font-size: 15px; line-height: 1.6; }
.home-hero__past { color: var(--color-border-muted); }
.home-clock { margin-left: .2em; color: var(--color-content); font-variant-numeric: tabular-nums; }
.home-hero__aside { justify-self: end; max-width: 44ch; text-align: right; color: var(--home-muted); font-size: 15px; line-height: 1.6; }
.home-hero__aside p { margin: 0 0 18px; }
.home-hero__aside strong { color: var(--color-content); }
.home-hero__aside a:not(.home-hero__cta) { color: var(--color-content); text-decoration-color: var(--home-line); text-underline-offset: 4px; }
.home-hero__aside a:not(.home-hero__cta):hover { color: var(--home-accent); }
.home-hero__actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.home-hero__cta { display: inline-flex; align-items: center; gap: 12px; padding: 13px 19px; border-radius: 999px; background: var(--color-background-strong); color: var(--color-content-inverse); font-size: 15px; text-decoration: none; transition: background-color 180ms ease; }
.home-hero__cta:hover { background: var(--home-accent); }
.home-arrow { transition: translate .2s ease; }
.home-work { margin: clamp(64px, 10vh, 120px) var(--home-gutter) clamp(80px, 12vh, 144px); }
.home-work__heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: clamp(24px, 4vh, 40px); padding-top: 20px; border-top: 1px solid var(--home-line); }
.home-work__heading h2 { margin: 0; font-family: var(--font-serif); font-size: clamp(30px, 3vw, 44px); font-weight: 400; line-height: 1; }
.home-work__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(40px, 6vw, 72px); max-width: 720px; margin-inline: auto; }
/* Breakpoints: <720 one column full width; 720-1099 one column capped at 720; >=1100 two columns. */
@media (min-width: 1100px) { .home-work__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(40px, 5vw, 80px); row-gap: clamp(56px, 6vw, 88px); max-width: 1200px; } }
.home-work__item { position: relative; display: block; min-width: 0; color: inherit; text-decoration: none; }
.home-work__item:nth-child(1) { --work-glow: #7a2e2a; }
.home-work__item:nth-child(2) { --work-glow: #d9952b; }
.home-work__item:nth-child(3) { --work-glow: #2b4c9b; }
.home-work__item:nth-child(4) { --work-glow: #d48e8e; }
.home-work__item:nth-child(5) { --work-glow: #4f6b4c; }
.home-work__cover { aspect-ratio: 4 / 3; overflow: visible; border: 0; border-radius: 0; background: transparent; transition: filter 180ms ease; }
.home-work__cover > video, .home-work__cover:not(.icham-cover) > img, .home-work__cover .cover-stack { display: block; width: 100%; height: 100%; object-fit: cover; }
.home-work__cover:not(.icham-cover) > img { object-fit: cover; }
.home-work__item:hover .home-work__cover, .home-work__item:focus-visible .home-work__cover { filter: drop-shadow(0 12px 34px color-mix(in srgb, var(--work-glow) 42%, transparent)); }
.home-work__caption { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-top: 14px; }
.home-work__caption h3 { margin: 0; font-family: var(--font-serif); font-size: clamp(22px, 2vw, 30px); font-weight: 400; line-height: 1.1; text-decoration-thickness: 1px; text-underline-offset: .15em; }
.home-work__description { max-width: 58ch; margin: 8px 0 0; color: var(--home-muted); font-size: 14px; line-height: 1.55; }
.home-work__item:hover .home-work__caption h3 { text-decoration: underline; }
.home-footer { margin: 0 var(--home-gutter); padding: 28px 0 clamp(40px, 7vh, 72px); border-top: 1px solid var(--home-line); }
.home-footer__link { display: inline-flex; align-items: center; gap: 14px; color: var(--color-content); font-family: var(--font-serif); font-size: clamp(30px, 4vw, 52px); line-height: 1; text-decoration: none; }
.home-footer__link:hover { color: var(--home-accent); }
.home-footer__link:focus-visible { outline: 2px solid var(--home-accent); outline-offset: 5px; }
@media (max-width: 720px) {
  .site-header[data-header="home"] { padding: 24px 20px 0; gap: 20px; }
  .site-header[data-header="home"] .site-logo img { height: 44px; }
  .site-header[data-header="home"] .site-nav { gap: 6px 20px; font-size: 14px; }
  .site-header[data-header="home"] .theme-toggle { top: 20px; right: 20px; }
  .site-header[data-header="compact"] { padding: 16px 20px; }
  .site-header[data-header="compact"] .site-logo img { height: 32px; }
  .site-header[data-header="compact"] .site-nav { gap: 8px; font-size: 12px; }
  .site-header[data-header="compact"].case-opener-header { margin-bottom: -76px; }
  header[data-queen-hero-header] + main { margin-top: -76px; }
}
@media (max-width: 760px) {
  .home-hero { box-sizing: border-box; width: 100vw; min-width: 0; min-height: auto; padding-top: 22px; padding-bottom: 44px; gap: 30px; }
  .home-hero__visual { box-sizing: border-box; width: calc(100vw - 40px); max-width: calc(100vw - 40px); min-width: 0; height: auto; }
  .home-hero__display { position: relative; z-index: 1; width: 100%; height: auto; }
  .home-hero__line { width: 100%; min-width: 0; font-size: clamp(38px, 13.8vw, 64px); }
  .home-hero__intro, .home-hero__details { display: block; width: calc(100vw - 40px); max-width: calc(100vw - 40px); min-width: 0; }
  .home-hero__intro > *, .home-hero__details > * { min-width: 0; }
  .home-hero__statement { box-sizing: border-box; display: block; width: 100%; max-width: none; margin-bottom: 22px; font-size: clamp(20px, 5.2vw, 24px); overflow-wrap: anywhere; }
  .home-hero__status { margin: 0 0 22px; }
  .run-route { right: 0; padding-right: 0; padding-bottom: 16px; }
  .home-hero__status { justify-self: start; }
  .home-hero__details { gap: 22px; }
  .home-hero__based, .home-hero__aside { box-sizing: border-box; display: block; width: 100%; max-width: 100%; overflow-wrap: anywhere; }
  .home-hero__based { margin-bottom: 22px; }
  .home-hero__aside { justify-self: stretch; max-width: none; text-align: left; }
  .home-hero__actions { justify-content: flex-start; }
  .home-work { margin-top: 56px; }
  .home-work__grid { grid-template-columns: minmax(0, 1fr); row-gap: 34px; }
  .home-work__item { grid-column: 1; }
  .home-work__cover { border-radius: 0; }
  .home-work__caption { align-items: flex-start; gap: 12px; }
  .home-work__caption h3 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .home-hero__cta, .site-arrow-svg { transition: none; }
  a:hover .site-arrow-svg, button:hover .site-arrow-svg { translate: none; }
}


/* Case-study opening: a shared editorial rhythm with each project's own visual mood. */
.case-opener-header { border: 0; background: transparent; }
.case-opener-header--light { color: #34292a; }
.case-opener-header--dark { color: #fff; }
.case-opener-header--cream { color: #f8f0d9; }
.case-opener-header.is-past-hero { color: var(--ganache-900); }
.case-opener {
  --opener-bg: var(--ganache-50);
  --opener-ink: var(--ganache-900);
  --opener-muted: color-mix(in srgb, var(--opener-ink) 68%, transparent);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(42px, 7vh, 76px) clamp(24px, 5vw, 80px) clamp(44px, 6vh, 68px);
  /* --opener-glow continues the cover video's own vignette out into the section. */
  background: radial-gradient(ellipse 60% 55% at var(--opener-glow-at, 50% 64%), var(--opener-glow, var(--opener-bg)) 0%, var(--opener-bg) 85%);
  color: var(--opener-ink);
}
.case-opener--with-header { padding-top: calc(clamp(42px, 7vh, 76px) + 92px); }
/* Covers end where the video ends, as Queen's does: no band below the media. */
.case-opener.case-opener--unfurl, .case-opener.case-opener--icham, .case-opener.case-opener--addx { padding-bottom: 0; }
.case-opener--unfurl { --opener-bg: #ece5df; --opener-ink: #34292a; }
.case-opener--addx { --opener-bg: #132a52; --opener-ink: #fff;
  /* The ADDX video is lit from the upper left and falls to near-black on the right; the section follows the same light. */
  background: radial-gradient(ellipse 40% 45% at 42% 48%, #2b5188 0%, transparent 75%), linear-gradient(to right, #1a3260 0%, #172e59 40%, #0d192f 74%, #0b1528 100%); }
.case-opener--beauty { --opener-bg: #0f131f; --opener-glow: #1a2134; --opener-ink: #f8f0d9; }
.case-opener--icham { --opener-bg: #d4d9df; --opener-ink: #27333d; }
/* ICHAM cover: positions are lifted from the Figma frame (2400x1800 stage) as % of the 4:3 stage, so the mountains keep
   their exact joins with the page screenshot at any width. Left/right sit behind the page, the bottom range in front.
   The bottom range is mirrored at both ends so it keeps running when the viewport is wider than the stage. */
.case-opener--icham { overflow-x: clip; }
.case-opener--icham .case-opener__media.icham-cover { -webkit-mask-image: none; mask-image: none; }
.icham-cover img { position: absolute; display: block; height: auto; max-width: none; }
.home-work__cover.icham-cover { position: relative; overflow: hidden; background: #d4d9df; }
.icham-cover__page { left: 6.5417%; top: 17.667%; width: 86.917%; border-radius: 24px 24px 0 0; }
.icham-contact-frame { position: relative; left: 50%; isolation: isolate; width: min(calc(100vw - 48px), 560px); transform: translateX(-50%); }
.icham-contact-frame__screen { position: relative; z-index: 1; width: 100%; aspect-ratio: 3024 / 4300; overflow: hidden; border: 1px solid rgb(39 51 61 / .22); border-radius: 24px 24px 0 0; -webkit-mask-image: linear-gradient(to bottom, #000 92%, transparent 100%); mask-image: linear-gradient(to bottom, #000 92%, transparent 100%); }
.icham-contact-frame__screen > img { display: block; width: 100%; height: auto; }
.icham-before__stage { position: relative; width: min(100%, 560px); margin-inline: auto; overflow: hidden; aspect-ratio: 16 / 9; border-radius: 16px; background: var(--color-surface); }
.icham-before__slide { position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity 400ms ease; }
.icham-before__slide.is-active { opacity: 1; }
.icham-before__slide img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.icham-before__controls { display: flex; justify-content: center; gap: 0; width: min(100%, 560px); margin: 8px auto 0; }
.icham-before__controls button { display: grid; place-items: center; width: 24px; height: 32px; margin-inline: -4px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.icham-before__controls button::before { width: 7px; height: 7px; border-radius: 50%; background: var(--color-content-muted); opacity: .4; content: ""; transition: opacity 200ms ease, scale 200ms ease; }
.icham-before__controls button[aria-pressed="true"]::before { background: var(--color-content); opacity: 1; scale: 1.25; }
.icham-before__controls button:focus-visible { outline: 2px solid var(--color-content); outline-offset: 1px; }
.icham-before__caption { min-height: 3.5em; width: min(100%, 560px); margin: 8px auto 0; color: var(--color-content-muted); font-size: 14px; line-height: 1.7; text-align: left; }
.icham-before__caption p { margin: 0; }
.icham-before__caption strong { color: var(--color-content); font-weight: 600; }
.icham-cover__mtn--left { left: -10%; top: 48.667%; width: 27.625%; --o: .7;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 40%), linear-gradient(#000 70%, transparent); -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 40%), linear-gradient(#000 70%, transparent); mask-composite: intersect; }
.icham-cover__mtn--right { left: 65.083%; top: 45.167%; width: 36%; --o: .7;
  -webkit-mask-image: linear-gradient(to right, #000 70%, transparent), linear-gradient(#000 70%, transparent); -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, #000 70%, transparent), linear-gradient(#000 70%, transparent); mask-composite: intersect; }
.icham-cover__mtn--far-left { left: -37.75%; top: 41.2%; width: 33.6%; --o: .45; scale: -1 1;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 28%, #000 85%, transparent), linear-gradient(#000 52%, transparent 76%); -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 28%, #000 85%, transparent), linear-gradient(#000 52%, transparent 76%); mask-composite: intersect; }
.icham-cover__mtn--far-right { left: 98.88%; top: 57.6%; width: 25.8%; --o: .45; scale: -1 1;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 15%, #000 60%, transparent), linear-gradient(#000 82%, transparent); -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 15%, #000 60%, transparent), linear-gradient(#000 82%, transparent); mask-composite: intersect; }
.icham-cover__mtn--left, .icham-cover__mtn--right, .icham-cover__mtn--far-left, .icham-cover__mtn--far-right { opacity: var(--o); }
.icham-cover__range { position: absolute; inset: 0; pointer-events: none; }
.icham-cover__mtn--bottom { left: -50.375%; top: 75.389%; width: 151.042%; }
.icham-cover__mtn--mirror-r { left: 100.667%; transform: scaleX(-1); }
.icham-cover__mtn--mirror-l { left: -201.417%; transform: scaleX(-1); }
.icham-cover.is-armed .icham-cover__mtn--left { opacity: 0; transform: translateX(45%); }
.icham-cover.is-armed .icham-cover__mtn--right { opacity: 0; transform: translateX(-45%); }
.icham-cover.is-armed .icham-cover__mtn--far-left { opacity: 0; transform: translateX(-110%); } /* `scale: -1 1` flips the local x axis, so signs are inverted */
.icham-cover.is-armed .icham-cover__mtn--far-right { opacity: 0; transform: translateX(110%); }
.icham-cover.is-armed .icham-cover__range { opacity: 0; transform: translateY(8%); clip-path: inset(0 45% 0 45%); }
.icham-cover.is-playing .icham-cover__mtn--left, .icham-cover.is-playing .icham-cover__mtn--right { opacity: var(--o); transform: none; transition: opacity 1.8s ease-out, transform 2.6s cubic-bezier(.16, .84, .3, 1); }
.icham-cover.is-playing .icham-cover__mtn--far-left, .icham-cover.is-playing .icham-cover__mtn--far-right { opacity: var(--o); transform: none; transition: opacity 2s ease-out .25s, transform 2.8s cubic-bezier(.16, .84, .3, 1) .25s; }
.icham-cover.is-playing .icham-cover__range { opacity: 1; transform: none; clip-path: inset(0 -100vw -2% -100vw); transition: opacity 1.6s ease-out .4s, transform 2.6s cubic-bezier(.16, .84, .3, 1) .4s, clip-path 2.8s cubic-bezier(.16, .84, .3, 1) .4s; }
.case-opener__inner { width: min(100%, 1320px); margin-inline: auto; text-align: center; }
.case-opener__eyebrow {
  margin: 0 0 14px;
  color: var(--opener-muted);
  font: 500 11px/1.2 Inter, sans-serif;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.case-opener__eyebrow--inverse { color: rgb(250 247 241 / 68%); }
.case-opener__title {
  max-width: 22ch;
  margin: 0 auto;
  font-family: var(--font-display);
  font-size: clamp(42px, 5.4vw, 82px);
  font-weight: 400;
  line-height: .99;
  letter-spacing: -.025em;
  text-wrap: balance;
}
.case-opener__support {
  max-width: 46ch;
  margin: 16px auto 0;
  color: var(--opener-muted);
  font: 400 clamp(17px, 1.8vw, 24px)/1.45 var(--font-serif);
  text-wrap: balance;
}
.case-opener__media {
  position: relative;
  width: min(100%, 1180px, calc(68svh * 4 / 3));
  aspect-ratio: 4 / 3;
  margin: clamp(28px, 4vw, 44px) auto 0;
  -webkit-mask-image: var(--case-hero-fade-x), var(--case-hero-fade-y);
  -webkit-mask-composite: source-in;
  mask-image: var(--case-hero-fade-x), var(--case-hero-fade-y);
  mask-composite: intersect;
}
.case-opener__media > video,
.case-opener__stack > video,
.case-opener__stack > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.case-opener__stack { position: relative; width: 100%; height: 100%; }
/* Unfurl cover: the video's own backdrop is a blurred meadow. Keep only its sky (where the bubbles float) and the phone,
   and lay the sharp meadow (asset/unfurl/unfurl-cover-meadow.jpg, sky tinted to the video's) full width behind it,
   its horizon lined up with the grass inside the phone. --hb is the meadow's height; 0.73 is where its horizon sits. */
.case-opener--unfurl .case-opener__media { container-type: inline-size; -webkit-mask-image: none; mask-image: none; }
.case-opener--unfurl .case-opener__media > video {
  -webkit-mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1600 1200' preserveAspectRatio='none'><defs><linearGradient id='y' x2='0' y2='1'><stop offset='0' stop-opacity='0'/><stop offset='.06' stop-opacity='1'/><stop offset='.5' stop-opacity='1'/><stop offset='.58' stop-opacity='0'/></linearGradient><linearGradient id='x'><stop offset='0' stop-color='%23fff' stop-opacity='0'/><stop offset='.1' stop-color='%23fff'/><stop offset='.9' stop-color='%23fff'/><stop offset='1' stop-color='%23fff' stop-opacity='0'/></linearGradient><mask id='m'><rect width='1600' height='1200' fill='url(%23x)'/></mask></defs><rect width='1600' height='1200' fill='url(%23y)' mask='url(%23m)'/><rect x='585' y='141' width='429' height='882' rx='24'/></svg>") 0 0 / 100% 100% no-repeat;
          mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1600 1200' preserveAspectRatio='none'><defs><linearGradient id='y' x2='0' y2='1'><stop offset='0' stop-opacity='0'/><stop offset='.06' stop-opacity='1'/><stop offset='.5' stop-opacity='1'/><stop offset='.58' stop-opacity='0'/></linearGradient><linearGradient id='x'><stop offset='0' stop-color='%23fff' stop-opacity='0'/><stop offset='.1' stop-color='%23fff'/><stop offset='.9' stop-color='%23fff'/><stop offset='1' stop-color='%23fff' stop-opacity='0'/></linearGradient><mask id='m'><rect width='1600' height='1200' fill='url(%23x)'/></mask></defs><rect width='1600' height='1200' fill='url(%23y)' mask='url(%23m)'/><rect x='585' y='141' width='429' height='882' rx='24'/></svg>") 0 0 / 100% 100% no-repeat;
}
.case-opener--unfurl .case-opener__media::before {
  --hb: max(56.25vw, calc((30cqw + 40px) / .27));
  content: ""; position: absolute; z-index: -1; left: 50%; top: -240px; bottom: -120px; width: 100vw; translate: -50% 0;
  filter: blur(3px) saturate(.85); /* soft enough to stay behind the phone and bubbles */
  background: url("asset/unfurl/unfurl-cover-meadow.jpg") center calc(240px + var(--horizon, 45cqw) - .73 * var(--hb)) / auto var(--hb) no-repeat;
}

.case-opener__stack > video,
.case-opener__stack > img { position: absolute; inset: 0; }
.case-thesis {
  max-width: 760px;
  margin: 56px auto 0;
  color: var(--ganache-800);
  font: italic 400 clamp(24px, 2.2vw, 32px)/1.4 var(--font-serif);
  text-align: center;
  text-wrap: pretty;
}
.case-meta {
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid var(--ganache-200);
  font-size: 14px;
}
@media (max-width: 639px) {
  .case-opener { padding: 38px 20px 42px; }
  .case-opener--with-header { padding-top: 94px; }
  .case-opener__eyebrow { margin-bottom: 12px; }
  .case-opener__title { max-width: 17ch; font-size: clamp(40px, 10vw, 54px); }
  .case-opener__support { margin-top: 12px; }
  .case-opener__media { width: min(100%, calc(68svh * 4 / 3)); margin-top: 28px; }
  .icham-before__caption { min-height: 0; }
  .case-thesis { margin-top: 44px; font-size: 24px; }
  .case-meta { margin-top: 32px; }
}

/* About hero: "Chofi is a ___." with the role cycling in about-roles.js (prototype: docs/about/about-roles.html).
   Title size follows the prototype's clamp but stops at 108px so "designer" fits the 928px content column.
   Below 640px the role always sits on its own line, so the title height never changes between words. */
.about-title { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: min(clamp(44px, 8vw, 128px), 108px); line-height: 1; letter-spacing: -.01em; white-space: nowrap; font-variant-ligatures: none; /* keep "fi" in Chofi as two letters */ }
.about-sub { margin: .6em 0 0; font-size: clamp(22px, 2.6vw, 38px); line-height: 1.2; color: var(--color-content-muted); }
.about-roles-slot { display: inline-block; overflow: hidden; vertical-align: bottom; white-space: nowrap; padding: 0 0 .2em; margin-bottom: -.2em; }
.about-roles-slot .ch { display: inline-block; }
@media (max-width: 639px) { .about-title-role { display: block; } }

/* Queen FIG 01: the three static department illustrations fade up left to right, 200ms apart,
   when the figure scrolls into view (.is-in, set in queen.html). Reduced motion: shown as is. */
.queen-dept { opacity: 0; transform: translateY(20px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.queen-dept:nth-child(2) { transition-delay: .2s; }
.queen-dept:nth-child(3) { transition-delay: .4s; }
.queen-depts.is-in .queen-dept { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .queen-dept { opacity: 1; transform: none; transition: none; }
}
/* The department drawings are black line art on transparent PNGs; in dark mode, invert them to light lines
   (slightly below full white so they sit with the #ededeb text instead of glaring). */
:root[data-theme="dark"] .queen-dept__art { filter: invert(.92); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .queen-dept__art { filter: invert(.92); }
}

/* Queen mega menu video: the 3000×1688 source has a light backdrop, shadow and frame around the screen.
   Crop to the screen only (x 310–2690, y 177–1510 → 2380×1333) without re-encoding: the figure takes the
   screen's ratio, the video is scaled up and shifted so the screen fills it, and the radius matches the
   screen's own ~45px corners (45/2380 wide, 45/1333 tall). */
.queen-screen-crop { position: relative; aspect-ratio: 2380 / 1333; overflow: hidden; border-radius: 1.9% / 3.4%; }
.queen-screen-crop video { position: absolute; left: -13.025%; top: -13.278%; width: 126.05%; height: 126.63%; max-width: none; display: block; }

/* Queen problem section: clip carousel of three TV episodes (behaviour spec in clip-carousel.js).
   Designed on a 1600×900 canvas and scaled to the column width; radius matches the page's rounded-2xl figures. */
.clip-carousel { --cc-radius: 16px; }
.clip-carousel{position:relative;width:100%;aspect-ratio:16/9;margin:0;border-radius:var(--cc-radius,12px);overflow:hidden;background:#0F0F0F}
.clip-carousel .cc-stage{position:absolute;left:0;top:0;width:1600px;height:900px;transform-origin:0 0;overflow:hidden}
.clip-carousel .cc-strip{position:absolute;left:0;top:0;height:100%;will-change:transform}
.clip-carousel .cc-item{position:absolute;top:247px;width:720px;height:406px;border-radius:12px;overflow:hidden;background:#000;filter:grayscale(1) brightness(.45);transform:scale(1);transform-origin:50% 50%;transition-property:filter,transform;transition-duration:var(--cc-d,900ms);transition-timing-function:cubic-bezier(.7,0,.2,1)}
.clip-carousel .cc-item.is-on{filter:none;transform:scale(1.2)}
.clip-carousel .cc-item video,.clip-carousel .cc-item img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block}
.clip-carousel .cc-cover{opacity:1}
.clip-carousel .cc-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.clip-carousel { margin-top: 2rem; }

/* ADDX proof galleries use native horizontal scrolling with snap points, so they swipe on touch screens
   and remain trackpad/keyboard-scrollable on desktop without autoplay or carousel controls. */
.case-hscroll-wrap { position: relative; left: 50%; width: 100vw; max-width: 100vw; transform: translateX(-50%); }
.case-hscroll__hint { display: flex; justify-content: flex-end; gap: 10px; margin: 0 5vw 12px; color: var(--ganache-500); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.case-hscroll__hint span { font-size: 16px; line-height: 1; }
.case-hscroll { display: flex; gap: clamp(16px, 2vw, 28px); overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: x mandatory; scroll-padding-inline: 5vw; padding: 0 5vw 18px; -webkit-overflow-scrolling: touch; scrollbar-color: color-mix(in srgb, var(--ganache-500) 40%, transparent) transparent; scrollbar-width: thin; }
.case-hscroll:focus-visible { outline: 2px solid var(--ganache-500); outline-offset: 3px; }
.case-hscroll__slide { flex: 0 0 min(86vw, 1080px); min-width: 0; margin: 0; scroll-snap-align: start; }
.case-hscroll__slide--wide { flex-basis: min(90vw, 1320px); }
.case-hscroll__slide--desktop { flex-basis: min(78vw, 1080px); }
.case-hscroll__slide--portrait { flex-basis: min(62vw, 680px); }
.case-hscroll__slide img { display: block; width: 100%; height: auto; border-radius: 0; }
.case-hscroll__slide--portrait img { aspect-ratio: 4 / 5; object-fit: cover; }
.case-hscroll__slide figcaption { margin-top: 12px; color: var(--ganache-500); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
@media (min-width: 1500px) { .case-hscroll { padding-inline: max(5vw, calc((100vw - 1320px) / 2)); scroll-padding-inline: max(5vw, calc((100vw - 1320px) / 2)); } }

/* Brand applications: an airy, overlapping collage revealed in a gentle stagger as it enters view. */
.addx-application-showcase { position: relative; left: 50%; width: 100vw; max-width: 100vw; height: clamp(720px, 64.6vw, 1084px); transform: translateX(-50%); overflow: clip; }
.addx-application-piece { position: absolute; margin: 0; opacity: 1; transform: none; transition: opacity 850ms cubic-bezier(.2,.75,.25,1), transform 1000ms cubic-bezier(.2,.75,.25,1); transition-delay: var(--application-delay, 0ms); }
.addx-application-piece img { display: block; width: 100%; height: auto; border-radius: 0; }
.addx-application-piece--campaign { z-index: 2; top: 12%; left: 18.2%; width: min(48vw, 800px); --application-delay: 0ms; }
.addx-application-piece--flags { z-index: 3; top: 25%; right: 5.2%; width: min(29vw, 490px); --application-delay: 140ms; }
.addx-application-piece--letterhead { z-index: 1; /* butts against the campaign image: its top + its exact height (1448 × 812), 1px tuck to hide the seam */ top: calc(12% + min(48vw, 800px) * 812 / 1448 - 1px); left: 27.1%; width: min(43.9vw, 738px); --application-delay: 250ms; }
.addx-application-piece--notebook { z-index: 5; top: 7%; left: 62.5%; width: min(9.1vw, 160px); --application-delay: 370ms; filter: drop-shadow(0 2px 3px rgb(7 21 42 / .18)) drop-shadow(0 18px 26px rgb(7 21 42 / .28)); }
.addx-application-piece--tablet { z-index: 6; top: 42.9%; left: 9.1%; width: min(12.3vw, 210px); --application-delay: 500ms; filter: drop-shadow(0 14px 20px rgb(7 21 42 / .22)); }
.addx-application-piece--tablet img { box-sizing: border-box; border: 2px solid #111; border-radius: 12px; }
.addx-application-showcase.is-pending .addx-application-piece--campaign { opacity: 0; transform: translateY(64px); }
.addx-application-showcase.is-pending .addx-application-piece--flags { opacity: 0; transform: translate(70px, 58px); }
.addx-application-showcase.is-pending .addx-application-piece--notebook { opacity: 0; transform: translateY(-48px) rotate(2deg); }
.addx-application-showcase.is-pending .addx-application-piece--tablet { opacity: 0; transform: translate(-58px, 46px) rotate(-2deg); }
.addx-application-showcase.is-pending .addx-application-piece--letterhead { opacity: 0; transform: translateY(56px) rotate(-1deg); }
.addx-application-showcase.is-visible .addx-application-piece { opacity: 1; transform: translate(0, 0) rotate(0); }
@media (max-width: 700px) {
  .addx-application-showcase { height: 205vw; min-height: 760px; max-height: 1000px; }
  .addx-application-piece--campaign { top: 8%; left: 4%; width: 87vw; }
  .addx-application-piece--flags { top: 39%; right: 0; width: 44vw; }
  .addx-application-piece--letterhead { top: calc(8% + 87vw * 812 / 1448 - 1px); left: 35%; width: 64vw; }
  .addx-application-piece--notebook { top: 2%; left: 70%; width: 25vw; }
  .addx-application-piece--tablet { top: 46%; left: 4%; width: 31vw; }
}
@media (prefers-reduced-motion: reduce) { .addx-application-piece { transition: none; } .addx-application-showcase.is-pending .addx-application-piece { opacity: 1; transform: none; } }

/* ICHAM outcome: give the reported lead count the same editorial emphasis as other case study metrics. */
.icham-outcome-metric { text-align: center; }
.icham-outcome-metric__value { margin: 0; color: var(--color-content); font: 400 clamp(44px, 6vw, 72px)/.95 var(--font-display); }
.icham-outcome-metric__label { max-width: 32ch; margin: 10px auto 0; color: var(--color-content-muted); font-size: 13px; line-height: 1.5; text-wrap: balance; }

/* ADDX 2021 mobile site: two still screens with numbered pins in the gutter and dashed leaders to each problem.
   Selecting a note (or pin) highlights it and fades the rest (addx-flaws.js). Matches Queen's .ba--app look. */
.addx-flaws__phones { display: grid; grid-template-columns: repeat(2, minmax(0, 236px)); justify-content: center; gap: 24px; }
/* One size smaller than the redesigned phones (200 vs 250), like the Queen funnel wireframe, so the old site reads as context. */
.addx-flaws .phone-screen { max-width: 200px; margin-inline: 0; }
.addx-flaws__stage { position: relative; padding-right: 36px; }
.addx-flaws__leaders { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.addx-flaws__leaders path { fill: none; stroke: var(--color-content-muted); stroke-width: 1; stroke-dasharray: 3 3; }
.addx-flaws__leaders circle { fill: #18181b; stroke: #fff; stroke-width: 1.5; }
.addx-flaws__pin { position: absolute; right: 0; transform: translateY(-50%); display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: var(--color-content); color: var(--color-surface); font: 500 11px/1 Inter, sans-serif; cursor: pointer; transition: opacity .2s; }
.addx-flaws__pin:focus-visible { outline: 2px solid var(--color-content); outline-offset: 3px; }
.addx-flaws__leaders g { transition: opacity .2s; }
.addx-flaws[data-selected] .addx-flaws__pin[aria-pressed="false"] { opacity: .18; }
.addx-flaws[data-selected] .addx-flaws__leaders g:not(.is-selected) { opacity: .18; }
.addx-flaws .ba__notes ol { list-style: none; padding: 0; }
.addx-flaws .ba__notes li { display: block; }
.addx-flaws .ba__num { border-color: var(--color-content); background: var(--color-content); color: var(--color-surface); }
.addx-flaws__note { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 12px; border: 0; border-radius: 8px; background: transparent; color: var(--color-content-muted); font: inherit; font-size: 14px; line-height: 1.7; text-align: left; cursor: pointer; transition: opacity .2s; }
.addx-flaws__note:focus-visible { outline: 2px solid var(--color-content); outline-offset: 3px; }
.addx-flaws[data-selected] .addx-flaws__note[aria-pressed="false"] { opacity: .25; }
@media (max-width: 639px) {
  .addx-flaws__phones { gap: 12px; }
  .addx-flaws__stage { padding-right: 28px; }
  .addx-flaws__note { padding: 10px 8px; }
}
@media (prefers-reduced-motion: reduce) { .addx-flaws__note, .addx-flaws__pin, .addx-flaws__leaders g { transition: none; } }

/* ADDX Advantage closing video: breaks out of the text column to 1100px (~85vw), where its centre phone is 250px wide. */
.addx-adv-video, .icham-home-video, .icham-news-video { position: relative; left: 50%; width: min(100vw - 40px, 1100px); margin-inline: 0; transform: translateX(-50%); }
/* The recording opens on a full-bleed photo, so the frame is a rounded card (24px, like the brand photo cards). */
.addx-adv-video video, .icham-home-video video, .icham-news-video video { border-radius: 24px; }
@media (max-width: 640px) { .addx-adv-video video, .icham-home-video video, .icham-news-video video { border-radius: 16px; } }

/* ADDX brand book wall: whole guideline pages on a neutral field, so the ADDX blue stays with the pages themselves.
   Three rows with different starting points bleed off both edges; below 640px each row scrolls sideways. */
.addx-book-wall { --w: clamp(240px, 24vw, 420px); --p: 1; --gap: clamp(12px, 1.4vw, 22px); position: relative; left: 50%; width: 100vw; margin: 0; transform: translateX(-50%); overflow: hidden; display: grid; gap: var(--gap); padding-block: clamp(32px, 5vw, 80px); background: var(--ganache-200); }
.addx-book-wall__row { display: flex; gap: var(--gap); width: max-content; }
.addx-book-wall__row:nth-child(1) { margin-left: 12vw; }
.addx-book-wall__row:nth-child(2) { margin-left: -2vw; }
.addx-book-wall__row:nth-child(3) { margin-left: 18vw; }
.addx-book-wall__row img { flex: none; display: block; width: var(--w); height: auto; aspect-ratio: 16 / 9; box-shadow: 0 16px 36px -22px rgb(0 0 0 / .35);
  /* Each page rises over 40% of the scroll range from its own start (--d) and distance (--dist), easing out (fast, then settling). */
  --pi: clamp(0, calc((var(--p) - var(--d, 0)) / .4), 1); transform: translateY(calc((1 - var(--pi)) * (1 - var(--pi)) * var(--dist, 220px))); opacity: calc(.1 + .9 * var(--pi)); will-change: transform; }
@media (max-width: 640px) {
  .addx-book-wall { --w: 72vw; }
  .addx-book-wall__row:nth-child(n) { width: auto; margin-left: 0; padding-inline: 20px; overflow-x: auto; scrollbar-width: none; }
}


/* Case study hero: the cover video's vignette and grain carry out into the whole section,
   and the video's edges fade into it so its rectangle never shows (also used by .case-opener__media). */
:root {
  --case-hero-fade-x: linear-gradient(to right, transparent, #000 9%, #000 91%, transparent);
  --case-hero-fade-y: linear-gradient(to bottom, transparent, #000 9%, #000 91%, transparent);
}
.case-hero-glow { background: radial-gradient(ellipse 60% 55% at 50% 66%, #433630 0%, #3d302a 45%, #362b25 85%); }
.case-hero-grain { isolation: isolate; }
.case-hero-grain::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .35; mix-blend-mode: soft-light; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.case-hero-media { -webkit-mask-image: var(--case-hero-fade-x), var(--case-hero-fade-y); -webkit-mask-composite: source-in; mask-image: var(--case-hero-fade-x), var(--case-hero-fade-y); mask-composite: intersect; }

/* Phone screen mockups (Queen and later case studies): no frame and no backdrop. A soft shadow
   separates the white screen from the page; dark mode already contrasts, so it drops the shadow. */
.phone-screen { display: block; width: 100%; max-width: 250px; /* same width as the paired before / after phones */ margin-inline: auto; border-radius: 20px; }
@media (max-width: 640px) { .phone-screen:not(.app-scroll) { max-width: 50vw; /* a single phone takes half the screen width on mobile */ } }
/* Phone and desktop screen recordings share one soft shadow so white pages separate from the light page background; a faint hairline instead in dark mode. */
.phone-screen, .desktop-screen { box-shadow: 0 1px 2px color-mix(in srgb, var(--ganache-900) 8%, transparent), 0 16px 40px -12px color-mix(in srgb, var(--ganache-900) 22%, transparent); }
:root[data-theme="dark"] :is(.phone-screen, .desktop-screen) { box-shadow: 0 0 0 1px rgb(255 255 255 / .08); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(.phone-screen, .desktop-screen) { box-shadow: 0 0 0 1px rgb(255 255 255 / .08); } }

/* Queen AI Q&A reader funnel: two phone skeletons. Only the AI questions keep their real pink look,
   everything else is grey skeleton so the eye lands on the questions. Static on purpose. */
.qa-funnel { --qa-phone-h: 542px; /* 250 × 542 = real iPhone proportion (393 × 852) */ --qa-ai-bottom: 103px; /* distance from phone bottom to the AI block heading */ display: grid; grid-template-columns: 76px minmax(0, 200px) minmax(0, 116px) minmax(0, 200px); justify-content: center; /* one size smaller than the phone mockups (250), so it reads as a diagram */ align-items: start; column-gap: 12px; }
.qa-funnel__col { min-width: 0; }
.qa-phone { width: 250px; max-width: none; zoom: var(--qa-zoom, .8); height: var(--qa-phone-h); box-sizing: border-box; overflow: hidden; border: 1.5px solid #d4d4d8; background: #fff; box-shadow: none; /* wireframe: a data diagram, not the shipped UI (that is FIG 06b) */ }
.qa-phone__bar { height: 32px; }
.qa-phone__body { display: flex; flex-direction: column; gap: 7px; height: calc(100% - 32px); box-sizing: border-box; padding: 14px 14px 18px; }
.qa-sk { display: block; flex: none; height: 7px; width: 100%; border-radius: 4px; background: #e0e0e3; }
.qa-sk--short { width: 62%; }
.qa-sk--title { height: 11px; }
.qa-sk--img { height: 46px; border-radius: 6px; margin-block: 3px; }
.qa-ad { display: grid; flex: none; place-items: center; height: 36px; border-radius: 6px; background: #e6e6e9; color: #a7a7ab; font: 500 8px/1 Inter, sans-serif; letter-spacing: .18em; }
.qa-ad--short { height: 28px; }
.qa-share { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 10px; }
.qa-share .qa-sk { width: 46px; }
.qa-share b { width: 13px; height: 13px; border-radius: 50%; background: #e0e0e3; }
.qa-feedback { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 6px; }
.qa-feedback .qa-sk { width: 58%; }
.qa-feedback span { display: flex; gap: 22px; }
.qa-feedback b { width: 38px; height: 7px; border-radius: 4px; background: #e0e0e3; }
.qa-back { align-self: center; width: 64px; height: 20px; margin-top: 10px; border-radius: 4px; background: #cfcfd3; }
.qa-label { margin-top: 4px; color: #8f8f94; font: 500 8px/1 Inter, sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.qa-related { display: flex; flex: none; gap: 7px; align-items: center; }
.qa-related i { width: 30px; height: 22px; border-radius: 4px; background: #e0e0e3; }
.qa-related b { flex: 1; height: 7px; border-radius: 4px; background: #e0e0e3; }
.qa-ai { display: flex; flex-direction: column; gap: 6px; margin-top: auto; }
.qa-ai-head { display: flex; align-items: center; justify-content: center; gap: 3px; margin-bottom: 2px; text-align: center; color: #222; font: 600 9px/1.4 "Noto Sans TC", system-ui, sans-serif; }
.qa-ai-icon { width: 12.25px; height: 14px; flex: none; fill: none; stroke: #222; stroke-width: 3; stroke-linecap: round; }
.qa-ai-icon__handle { stroke-width: 5; }
.qa-ai-icon__lines { stroke-width: 2.4; }
.qa-ai-icon__plus { stroke-width: 1.7; }
.qa-ai-icon__fill { fill: #222; stroke: none; }
/* AI question bubble, from the Figma component (329 × 40pt) scaled to the 250px mockup (× .584):
   pill with a tail off the bottom-right corner, arrow on a lighter pink disc. */
.qa-bubble { position: relative; align-self: flex-end; max-width: 92%; min-height: 23px; box-sizing: border-box; display: flex; align-items: center; padding: 3px 21px 3px 8px; border-radius: 12px 12px 0 12px; background: #ffd5da; color: #222; font: 400 8.6px/1.3 "Noto Sans TC", system-ui, sans-serif; letter-spacing: .03em;  color: transparent; user-select: none; /* text only sizes the bubble */ }
.qa-bubble::before { content: ""; position: absolute; right: -6px; bottom: 0; width: 8px; height: 7px; background: #ffd5da; clip-path: polygon(0 0, 100% 100%, 0 100%); }
.qa-bubble::after { content: ""; position: absolute; right: 4px; top: 50%; width: 15px; height: 15px; translate: 0 -50%; border-radius: 50%; background: #ffe8eb url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23222' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 11.5 11.5 4.5M6 4.5h5.5V10'/%3E%3C/svg%3E") center / 9px no-repeat; }
/* Pressed state (the tapped question), same as in the demo video */
.qa-bubble--pressed, .qa-bubble--pressed::before { background: #18181b; }
.qa-bubble--pressed::after { background: #808082 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2318181b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 11.5 11.5 4.5M6 4.5h5.5V10'/%3E%3C/svg%3E") center / 9px no-repeat; }
.qa-q-title { display: block; flex: none; width: 82%; height: 11px; border-radius: 4px; background: #d2d2d6; }
.qa-ai-line { display: block; width: 56px; height: 6px; border-radius: 3px; background: #cfcfd3; }
.qa-funnel__label { height: 44px; margin: 0; color: var(--color-content); font: 500 24px/1 var(--font-serif); text-align: center; }
.qa-funnel .qa-funnel__label { font-size: 20px; } /* the funnel is one size smaller than the before / after phones */
.qa-funnel__depth { position: relative; height: calc(var(--qa-phone-h) * var(--qa-zoom, .8)); margin-top: 44px; }
.qa-funnel__track { position: absolute; top: calc(32px * var(--qa-zoom, .8)); bottom: 0; right: 0; width: 3px; border-radius: 2px; background: color-mix(in srgb, var(--color-content) 8%, transparent); }
.qa-funnel__fill { position: absolute; inset: 0 0 calc(var(--qa-ai-bottom) * var(--qa-zoom, .8)) 0; border-radius: 2px; background: linear-gradient(var(--color-content-muted), color-mix(in srgb, var(--color-content-muted) 20%, transparent)); }
.qa-funnel__mark { position: absolute; right: 12px; bottom: calc(var(--qa-ai-bottom) * var(--qa-zoom, .8)); translate: 0 50%; color: var(--color-content); font: 400 24px/1 var(--font-display); text-align: right; white-space: nowrap; }
.qa-funnel__mark::after { content: ""; position: absolute; right: -12px; top: 12px; width: 9px; height: 1px; background: var(--color-content-muted); }
.qa-funnel__top { position: absolute; right: 12px; top: calc(32px * var(--qa-zoom, .8)); color: var(--color-content-muted); font: 400 16px/1 var(--font-display); text-align: right; }
.qa-funnel__top small { display: block; margin-top: 3px; font: 400 10px/1.25 Inter, sans-serif; }
.qa-funnel__mark small { display: block; margin-top: 4px; color: var(--color-content-muted); font: 400 10px/1.25 Inter, sans-serif; white-space: normal; }
.qa-funnel__arrow { position: relative; height: calc(var(--qa-phone-h) * var(--qa-zoom, .8)); margin-top: 44px; }
.qa-funnel__arrow svg { width: 100%; height: 100%; overflow: visible; }
.qa-funnel__head { position: absolute; right: 2px; top: 89%; width: 7px; height: 7px; border-top: 1.5px solid var(--color-border-muted); border-right: 1.5px solid var(--color-border-muted); translate: 0 -50%; rotate: 45deg; }
.qa-funnel__tap { position: absolute; left: 50%; top: 89%; translate: -50% -100%; margin-top: -6px; padding: 0; color: var(--color-content-muted); font: 500 11px/1 Inter, sans-serif; letter-spacing: .08em; }
.qa-funnel__arrow path { fill: none; stroke: var(--color-border-muted); stroke-width: 1.5; stroke-dasharray: 4 4; }
.qa-funnel__num { margin: 22px 0 0; color: var(--color-content); font: 400 clamp(30px, 3.4vw, 40px)/1 var(--font-display); }
.qa-funnel__cap { margin: 8px 0 0; color: var(--color-content-muted); font-size: 13px; line-height: 1.5; }
.qa-funnel__cap-extra { display: none; }
@media (max-width: 639px) {
  /* Phones stay side by side and shrink as a whole (zoom set by the script in queen.html);
     the depth bar moves into the 2.0% caption. */
  .qa-funnel { grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr); column-gap: 0; }
  .qa-funnel__depth { display: none; }
  .qa-funnel__label { height: 30px; font-size: 18px; }
  .qa-funnel .qa-funnel__label { font-size: 16px; }
  .qa-funnel__arrow { margin-top: 30px; }
  .qa-funnel__tap { font-size: 9px; }
  .qa-funnel__num { margin-top: 16px; font-size: 28px; }
  .qa-funnel__cap { font-size: 12px; }
  .qa-funnel__cap-extra { display: inline; }
}

/* Queen FIG 06b: AI block before / after. Phones keep the Figma (375pt) layout; --u is one design point at the
   current column width (100cqw / 375). Not CSS zoom: iOS Safari zooms the boxes but not the text. Labels reuse .qa-funnel__label. */
.ba__phones { display: grid; grid-template-columns: minmax(0, 250px) minmax(0, 116px) minmax(0, 250px); justify-content: center; /* same phone width and gap as the funnel (FIG 06c) */ }
[data-ba-col="after"] { grid-column: 3; }
.ba__col { min-width: 0; transition: opacity .3s ease; }
.ba[data-playing="before"] [data-ba-col="after"], .ba[data-playing="after"] [data-ba-col="before"] { opacity: .4; }
.ba__btn { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ba__btn:focus { outline: none; }
.ba__btn { container-type: inline-size; }
.ba-phone { --u: calc(100cqw / 375); width: 100%; height: calc(813 * var(--u)); overflow: hidden; background: #fff; text-align: left; transition: translate .25s ease; }
.ba__btn:hover .ba-phone { translate: 0 -4px; }
.ba__btn:focus-visible .ba-phone { outline: 2px solid var(--color-content); outline-offset: 6px; }
.ba__hint { display: block; margin-top: 14px; color: var(--color-content-muted); font: 500 12px/1 Inter, sans-serif; letter-spacing: .04em; text-align: center; }
.ba__btn:hover .ba__hint { color: var(--color-content); }
.ba-phone__bar { display: block; height: calc(48 * var(--u)); background: #e8c1c2 url("asset/queen/queen-ai-qa-header.png") center / 100% 100% no-repeat; }
.ba-phone__body { display: flex; flex-direction: column; gap: calc(10 * var(--u)); padding: calc(24 * var(--u)) calc(16 * var(--u)); }
.ba-sk { display: block; height: calc(7 * var(--u)); border-radius: calc(4 * var(--u)); background: #f0f0f2; }
.ba-sk--short { width: 62%; }
.ba-sk--short + .ba-sk { margin-top: calc(10 * var(--u)); }
.ba-ad { display: grid; place-items: center; align-self: center; width: calc(300 * var(--u)); height: calc(250 * var(--u)); margin-top: calc(30 * var(--u)); border-radius: calc(10 * var(--u)); background: #f0f0f2; color: #a1a1aa; font: 500 calc(13 * var(--u))/1 Inter, sans-serif; letter-spacing: .08em; }
.ba-ai { display: flex; flex-direction: column; gap: calc(16 * var(--u)); margin-top: calc(22 * var(--u)); /* + the 10pt body gap = 32pt below the ad */ }
.ba-phone--after .ba-ai { margin-top: calc(50 * var(--u)); /* 60pt below the ad */ }
.ba-head { display: flex; align-items: center; gap: calc(4 * var(--u)); color: #18181b; font: 600 calc(16 * var(--u))/1.5 "Noto Sans TC", system-ui, sans-serif; }
.ba-phone--after .ba-head { justify-content: center; }
.ba-icon { width: calc(21 * var(--u)); height: calc(24 * var(--u)); }
.ba-caret { position: relative; display: inline-block; width: 0; height: 1em; vertical-align: -.1em; }
.ba-caret::after { content: ""; position: absolute; left: calc(1 * var(--u)); top: -.1em; width: calc(2 * var(--u)); height: 1.2em; background: #18181b; animation: ba-blink .4s steps(1) infinite; }
@keyframes ba-blink { 50% { opacity: 0; } }
.ba-bubble { position: relative; align-self: flex-end; display: flex; align-items: center; gap: calc(10 * var(--u)); box-sizing: border-box; width: calc(320 * var(--u)); margin-right: calc(9 * var(--u)); padding: calc(8 * var(--u)) calc(16 * var(--u)); border-radius: calc(20 * var(--u)) calc(20 * var(--u)) 0 calc(20 * var(--u)); background: #ffd5da; color: #18181b; font: 400 calc(16 * var(--u))/calc(24 * var(--u)) "Noto Sans TC", system-ui, sans-serif; letter-spacing: .04em; }
.ba-bubble::before { content: ""; position: absolute; right: calc(-9 * var(--u)); bottom: 0; width: calc(11 * var(--u)); height: calc(9 * var(--u)); background: #ffd5da; clip-path: polygon(0 0, 100% 100%, 0 100%); }
.ba-phone--after .ba-bubble { width: auto; max-width: calc(320 * var(--u)); padding-right: calc(12 * var(--u)); }
.ba-arrow { flex: none; width: calc(24 * var(--u)); height: calc(24 * var(--u)); border-radius: 50%; background: rgb(255 255 255 / .45) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2318181b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 11.5 11.5 4.5M6 4.5h5.5V10'/%3E%3C/svg%3E") center / calc(14 * var(--u)) no-repeat; }
.ba__notes { max-width: 560px; margin: 48px auto 0; }
.ba__notes li { display: flex; gap: 12px; }
.ba__notes strong { color: var(--color-content); font-weight: 600; }
.ba__num { flex: none; display: grid; place-items: center; width: 22px; height: 22px; margin-top: 1px; border: 1px solid var(--color-border-muted); border-radius: 50%; color: var(--color-content-muted); font: 500 11px/1 Inter, sans-serif; }

/* Queen FIG 08a: app homepage before / after. Same phone size as FIG 06b. Content keeps the 375pt design layout in
   --u units (one design point at the frame width, as in FIG 06b); the body scrolls inside while header and nav stay pinned. */
.app-scroll { container-type: inline-size; aspect-ratio: 856 / 1660; /* same height as the demo recordings */ overflow-x: hidden; overflow-y: auto; background: #fff; scrollbar-width: none; }
.app-scroll::-webkit-scrollbar, .app-banners::-webkit-scrollbar, .app-strip::-webkit-scrollbar { display: none; }
.app-scroll__inner { --u: calc(100cqw / 375); width: 100%; }
.app-scroll__inner img { display: block; max-width: none; }
.app-scroll__header, .app-scroll__body > img, .app-scroll__nav img { width: 100%; height: auto; }
/* 16pt of white above the logo row and below the nav labels, minus what each capture already has. */
.app-scroll__header { position: sticky; top: 0; z-index: 2; padding-top: calc(12.5 * var(--u)); background: #fff; }
[data-ba-col="after"] .app-scroll__header { padding-top: calc(12 * var(--u)); }
.app-scroll__body { position: relative; }
.app-scroll__nav { position: sticky; bottom: 0; z-index: 2; padding-bottom: calc(13 * var(--u)); background: #fff; }
[data-ba-col="after"] .app-scroll__nav { padding-bottom: calc(7.5 * var(--u)); }
/* Desktop counterpart of .app-scroll: a long page capture that scrolls inside a fixed 16:10 screen (autoplay: desktop-autoscroll.js). */
.desktop-scroll { overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; background: #fff; scrollbar-width: none; }
.desktop-scroll::-webkit-scrollbar { display: none; }
.desktop-scroll img { display: block; width: 100%; height: auto; }
.desktop-scroll:focus-visible { outline: 2px solid var(--color-content); outline-offset: 6px; }
.app-scroll:focus-visible { outline: 2px solid var(--color-content); outline-offset: 6px; }
.app-scroll__hint { margin: 14px 0 0; color: var(--color-content-muted); font: 500 12px/1 Inter, sans-serif; letter-spacing: .04em; text-align: center; }
@media (max-width: 640px) { .app-scroll__hint { margin-top: 10px; font-size: 11px; } }
/* Interactive layer over the After capture (Figma y 132–539): banner row, shortcut tabs and their cards. */
.app-home-ui { position: absolute; inset: 0 0 auto; height: calc(407 * var(--u)); padding-top: calc(12 * var(--u)); background: #fbf9f8; color: #18181b; font-family: "Noto Sans TC", "PingFang TC", system-ui, sans-serif; letter-spacing: calc(.25 * var(--u)); }
.app-banners, .app-strip { display: flex; overflow-x: auto; scrollbar-width: none; }
.app-banners { gap: calc(16 * var(--u)); height: calc(210 * var(--u)); margin-bottom: calc(-10 * var(--u)); padding: 0 calc(16 * var(--u)) calc(10 * var(--u)); scroll-snap-type: x mandatory; }
.app-banner { position: relative; flex: none; width: calc(300 * var(--u)); height: calc(200 * var(--u)); overflow: hidden; border-radius: calc(10 * var(--u)); box-shadow: 0 calc(4 * var(--u)) calc(10 * var(--u)) rgb(0 0 0 / .1); scroll-snap-align: center; }
.app-banner img { width: 100%; height: 100%; object-fit: cover; }
.app-banner--quiz::after { content: ""; position: absolute; inset: 0; background: linear-gradient(219.43deg, transparent 23.24%, rgb(0 0 0 / .3) 56.01%); }
.app-banner--quiz p { position: absolute; z-index: 1; left: calc(16 * var(--u)); bottom: calc(16 * var(--u)); margin: 0; color: #fff; font-size: calc(13 * var(--u)); font-weight: 700; line-height: calc(18 * var(--u)); letter-spacing: calc(.03 * var(--u)); }
.app-banner--quiz strong { display: block; margin-bottom: calc(2 * var(--u)); font-size: calc(20 * var(--u)); line-height: calc(28 * var(--u)); letter-spacing: calc(.05 * var(--u)); }
.app-chips { display: flex; gap: calc(12 * var(--u)); margin-top: calc(12 * var(--u)); padding: 0 calc(16 * var(--u)); }
.app-chip { height: calc(32 * var(--u)); padding: calc(8 * var(--u)) calc(10 * var(--u)); border: 0; border-radius: calc(999 * var(--u)); background: #ffd5da; color: #18181b; font: 500 calc(12 * var(--u))/calc(16 * var(--u)) "Noto Sans TC", "PingFang TC", system-ui, sans-serif; letter-spacing: calc(.25 * var(--u)); cursor: pointer; }
.app-chip[aria-selected="true"] { background: #18181b; color: #fff; }
.app-chip:focus-visible { outline: calc(2 * var(--u)) solid #18181b; outline-offset: calc(2 * var(--u)); }
.app-strip { gap: calc(16 * var(--u)); padding: calc(12 * var(--u)) calc(16 * var(--u)); }
.app-strip[hidden] { display: none; }
.app-card { flex: none; display: flex; gap: calc(12 * var(--u)); height: calc(120 * var(--u)); padding-left: calc(12 * var(--u)); border-radius: calc(10 * var(--u)); background: #fff; filter: drop-shadow(0 calc(4 * var(--u)) calc(5 * var(--u)) rgb(0 0 0 / .1)); }
.app-card__copy { display: flex; flex-direction: column; justify-content: space-between; width: calc(160 * var(--u)); padding: calc(12 * var(--u)) 0; }
.app-card__copy p { margin: 0; font-size: calc(12 * var(--u)); line-height: calc(16 * var(--u)); word-break: break-word; }
.app-card__copy b { font-weight: 500; }
.app-card__cta { display: inline-flex; align-self: flex-start; align-items: center; gap: calc(10 * var(--u)); height: calc(32 * var(--u)); padding: calc(4 * var(--u)) calc(12 * var(--u)); border: calc(1 * var(--u)) solid #18181b; border-radius: calc(999 * var(--u)); font-size: calc(12 * var(--u)); font-weight: 500; line-height: calc(16 * var(--u)); }
.app-card__img { width: calc(120 * var(--u)); height: calc(120 * var(--u)); border-radius: 0 calc(10 * var(--u)) calc(10 * var(--u)) 0; object-fit: cover; }
@media (prefers-reduced-motion: reduce) {
  .ba__btn { cursor: default; }
  .ba__hint { visibility: hidden; }
  .ba-phone, .ba__col { transition: none; }
  .ba__btn:hover .ba-phone { translate: none; }
}
@media (max-width: 639px) {
  .ba__phones { grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr); }
  .ba__hint { margin-top: 10px; font-size: 11px; }
}

/* Shared header theme control. Inherits the hero/header's current text color. */
.site-theme-toggle {
  display: inline-grid;
  place-items: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  margin-block: -4px; /* keep the header at 56px so case study covers (pulled up 56px) reach the top edge */
  padding: 0;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 17px;
  cursor: pointer;
}
.site-theme-toggle:hover { opacity: .7; }
.site-theme-toggle:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
@media (max-width: 480px) {
  header nav { gap: 8px !important; font-size: 12px !important; }
  .site-theme-toggle { flex-basis: 28px; width: 28px; height: 28px; font-size: 15px; }
}

/* Case study entrance: opacity only, without changing layout or product motion. */
.case-reveal-pending { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .case-reveal-pending { opacity: 1; } }
@media print { .case-reveal-pending { opacity: 1; } }

/* Shared case-study rhythm: standalone figures have 48px before and after on mobile, 56px from 640px up.
   Keep hero media, captions, device contents and section boundaries independent. */
body[data-case-videos] main section > figure,
body[data-case-videos] main section > figure + :is(p, aside, figure, h3) {
  margin-top: 48px;
}
@media (min-width: 640px) {
  body[data-case-videos] main section > figure,
  body[data-case-videos] main section > figure + :is(p, aside, figure, h3) {
    margin-top: 56px;
  }
}

/* UNFURL flowers: early direction row. */
.unfurl-early__row { display: flex; justify-content: center; gap: clamp(12px, 3vw, 32px); margin-top: 20px; }
.unfurl-early__row img { width: clamp(88px, 20vw, 160px); height: auto; }

/* UNFURL result wall: same scroll rise as the ADDX brand book wall (addx-book-wall.js sets --p, --d, --dist on the inner layer).
   Extrovert row over introvert row on a neutral field, every card with the soft site shadow; the wall fades out toward the
   left and right edges. */
.unfurl-wall { --w: clamp(150px, 14vw, 210px); --gap: clamp(14px, 1.6vw, 24px); position: relative; left: 50%; width: 100vw; margin: 0; transform: translateX(-50%); overflow: hidden; padding-block: clamp(40px, 6vw, 88px); background: #f3f2ef; }
.unfurl-wall__tilt { --p: 1; display: grid; justify-content: center; gap: var(--gap);
  /* every card shows; the wall only fades out where it meets the screen edges */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent); mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent); }
.unfurl-wall__row { display: flex; gap: var(--gap); }
.unfurl-wall__row img { flex: none; display: block; width: var(--w); height: auto; aspect-ratio: 513 / 990; border-radius: 12px;
  box-shadow: 0 1px 2px rgb(52 41 42 / .06), 0 18px 40px -20px rgb(52 41 42 / .28);
  --pi: clamp(0, calc((var(--p) - var(--d, 0)) / .4), 1); transform: translateY(calc((1 - var(--pi)) * (1 - var(--pi)) * var(--dist, 220px))); opacity: calc(.1 + .9 * var(--pi)); will-change: transform; }
:root[data-theme="dark"] .unfurl-wall { background: #26231f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .unfurl-wall { background: #26231f; } }
@media (max-width: 640px) {
  .unfurl-wall { --w: 40vw; }
}

/* UNFURL "same flower, two temperaments": one flower at a time slides across a fixed centre line. --x (0 → 1) moves it from the
   cool side to the warm side; --cut is where the line falls inside the flower, so the warm layer shows only left of the line. */
.unfurl-temper { --art: clamp(220px, 30vw, 360px); --travel: calc(1.15 * var(--art)); margin-bottom: 40px; }
/* Stage: labels row (40px), flower, then the name. Each label sits over the spot where the flower rests on that side. */
.unfurl-temper__stage { position: relative; display: grid; height: calc(40px + var(--art) + 56px + 36px); overflow: hidden; }
.unfurl-temper__labels { position: absolute; top: 0; left: 50%; z-index: 2; display: grid; grid-template-columns: 1fr 1fr; width: calc(2 * var(--travel)); margin: 0; transform: translateX(-50%); color: var(--color-content-muted); font: 500 11px/1 Inter, sans-serif; letter-spacing: .2em; text-align: center; text-transform: uppercase; }
/* The line runs from under the labels to just past the flower, leaving clear space above the name. */
.unfurl-temper__line { position: absolute; z-index: 2; top: 24px; bottom: calc(56px - 12px + 36px); left: 50%; width: 1px; background: var(--color-content); opacity: .35; }
.unfurl-temper__item { grid-area: 1 / 1; margin: 0; padding-top: 40px; --x: 0; }
.unfurl-temper__art { position: relative; width: var(--art); aspect-ratio: 1; margin-left: calc(50% + (.5 - var(--x)) * var(--travel) - var(--art) / 2); }
.unfurl-temper__art img { position: absolute; inset: 0; width: 100%; height: 100%; }
.unfurl-temper__warm { clip-path: inset(0 calc(100% - var(--cut, 0px)) 0 0); }
.unfurl-temper__item figcaption { height: 36px; margin-top: 56px; color: var(--color-content); font: 400 22px/36px var(--font-serif); text-align: center; }
.unfurl-temper__item figcaption em { font-size: 1.6em; font-style: italic; }
@media (max-width: 640px) { .unfurl-temper { --art: 46vw; } }
@media (prefers-reduced-motion: reduce) {
  .unfurl-temper__labels, .unfurl-temper__line { display: none; }
  .unfurl-temper__stage { height: auto; overflow: visible; gap: 32px; }
  .unfurl-temper__item, .unfurl-temper__item[hidden] { display: block; grid-area: auto; }
  .unfurl-temper__art { display: grid; grid-template-columns: 1fr 1fr; width: min(100%, 520px); aspect-ratio: 2 / 1; margin-inline: auto; }
  .unfurl-temper__art img { position: static; }
  .unfurl-temper__warm { clip-path: none; order: -1; }
}
