/* George Turp, portfolio
   Quiet single-column layout. 680px column, 8px spacing scale,
   one type family. Body sits at regular (400); weight climbs to 600 for
   names and headings, the contrast between the two carries the
   hierarchy, kept light like the Cami reference. */

:root {
  /* ---------- Neutral ramp (primitives) ----------
     --gray-N: N is ink coverage over white paper, round((255 - value) / 255 * 100).
     0 = paper, 100 = pure black. One scale drives text, surfaces and borders. */
  --gray-0:  #ffffff;
  --gray-2:  #fafafa;
  --gray-4:  #f5f5f5;
  --gray-8:  #ebebeb;
  --gray-10: #e6e6e6;
  --gray-15: #d9d9d9;
  --gray-22: #c7c7c7; /* iOS's own opaque separator, #C6C6C8, on our ramp */
  --gray-30: #b3b3b3;
  --gray-55: #727272;
  --gray-75: #404040;
  --gray-85: #262626;
  --gray-92: #141414;

  /* ---------- Semantic aliases (reference these in components) ---------- */
  --text-strong:    var(--gray-92); /* headings, max ink */
  --text-lead:      var(--gray-85); /* lead paragraph */
  --text:           var(--gray-75); /* body copy */
  --text-muted:     var(--gray-55); /* secondary */
  --text-faint:     var(--gray-30); /* faint, disabled, metadata */
  --text-inverse:   var(--gray-2);  /* text on dark surfaces */
  --surface:        var(--gray-0);  /* cards, raised */
  --canvas:         var(--gray-0);  /* page background (pure white) */
  --surface-active: var(--gray-8);  /* pressed / active */
  --surface-quiet:  var(--gray-4);  /* tinted blocks set into prose: quotes, verdicts */
  --surface-hover:  rgb(0 0 0 / 0.03);
  --ink:            var(--gray-92); /* dark fills: pills */
  --border:         var(--gray-15);
  --border-subtle:  var(--gray-10);

  /* contribution scale, GitHub Primer's canonical light-mode greens, the
     five activity levels (0 empty → 4 busiest). Off the gray ramp on purpose:
     this is the one accent, and matching GitHub exactly makes the graph read
     as the real thing. Referenced only by .ghx__cell. */
  --contrib-0: #ebedf0;
  --contrib-1: #9be9a8;
  --contrib-2: #40c463;
  --contrib-3: #30a14e;
  --contrib-4: #216e39;
  /* the Snake easter egg's apple + game-over flash, GitHub Primer danger red,
     the one warm note, reserved to that hidden game only */
  --snake-food: #d1242f;
  /* Lydia's pale sky, the ground the scratch tickets sat on in the app. Off the
     gray ramp for the same reason as the two above: it is a borrowed brand
     colour reproduced for one recreation, not part of this site's palette.
     Referenced only by .scratch__prize. */
  --lydia-sky: #e6f2fe;

  /* Beam accent: the glow that breathes around the "Must read!" badge.
     Ported from the border-beam library, 1.3.0, preset size:"pulse-outside" +
     colorVariant:"sunset" + strength:0.7, resolved at theme:"light" to suit
     the white surface. Nothing rotates: eight warm spikes sit around the pill
     and breathe, each on its own period, so the halo drifts and never repeats
     cleanly. Referenced solely by .badge--mustread and its parts.

     The eight sunset colours are the library's own palette, reproduced
     verbatim. They sit OFF the gray ramp for the same reason --snake-food and
     --lydia-sky do: they are a borrowed palette used in one place, not part of
     this site's neutral system, so they get no ink-percentage primitive and no
     semantic alias. Ordered as the library lays them out, clockwise from the
     top-left spike. */
  --beam-sunset-1: rgb(255, 80, 50);   /* top-left,     red-orange */
  --beam-sunset-2: rgb(255, 60, 60);   /* top-right,    red */
  --beam-sunset-3: rgb(255, 140, 50);  /* right,        orange */
  --beam-sunset-4: rgb(255, 90, 70);   /* lower-right,  coral */
  --beam-sunset-5: rgb(255, 100, 80);  /* bottom-right, salmon */
  --beam-sunset-6: rgb(255, 160, 40);  /* bottom-left,  amber */
  --beam-sunset-7: rgb(255, 120, 60);  /* left,         tangerine */
  --beam-sunset-8: rgb(255, 200, 50);  /* upper-left,   gold */

  /* Beam motion + intensity. 1.3.0 splits one master dial from a weight per
     layer, so the three layers rebalance without touching colour. Names follow
     the library's own so the port stays greppable. */
  --beam-breathe:        2.3s;     /* the breathe unit the periods scale from */
  --beam-strength:       0.7;      /* master, 0 (off) → 1 (full) */
  --beam-stroke-opacity: 1;        /* the coloured stroke on the pill's edge */
  --beam-inner-opacity:  1;        /* the core glow blooming just outside it */
  --beam-bloom-opacity:  1;        /* the wide halo beyond that */
  /* Geometry. The library sizes its spikes against a 350x140 reference card and
     scales them by the real element, clamped to [0.35, 4]. A 72x20 pill lands
     under the floor on both axes, so both scales pin to 0.35. --beam-drift
     carries the same 0.35 onto the wander distance: left at the library's raw
     +/-19px the spikes would walk clean off a pill this small and the glow
     would flicker rather than breathe. */
  --pulse-glow-sx:       0.35;
  --pulse-glow-sy:       0.35;
  --beam-drift:          0.35;
  --beam-core-inset:     -10px;    /* library defaults; shrink both to pull the */
  --beam-bloom-inset:    -30px;    /* halo in tighter around the pill */
  --beam-core-blur:      6px;
  --beam-bloom-blur:     15px;

  /* type, fluid scale: interpolates with viewport so nothing jumps on
     resize. Each clamp is min (narrow screens) → preferred (vw-based) →
     max (desktop). Tuned a step down from the earlier scale, smaller
     renders quieter and more refined, closer to the Cami reference. */
  --font: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --2xs: clamp(0.6875rem, 0.66rem + 0.11vw, 0.75rem);    /* 11 → 12 */
  --xs: clamp(0.75rem, 0.72rem + 0.11vw, 0.8125rem);     /* 12 → 13 */
  --sm: clamp(0.8125rem, 0.79rem + 0.12vw, 0.875rem);   /* 13 → 14 */
  --base: clamp(0.875rem, 0.85rem + 0.14vw, 0.9375rem); /* 14 → 15 */
  --lg: clamp(1rem, 0.92rem + 0.4vw, 1.1875rem);        /* 16 → 19 */
  --xl: clamp(1.125rem, 0.98rem + 0.72vw, 1.375rem);    /* 18 → 22 */
  --2xl: clamp(1.5rem, 1.35rem + 0.6vw, 1.75rem);       /* 24 → 28 */

  /* shape */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-pill: 1000px;

  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 2px 4px -1px rgb(0 0 0 / 0.03),
            0 4px 8px -2px rgb(0 0 0 / 0.03), 0 8px 16px -4px rgb(0 0 0 / 0.04),
            0 16px 32px -8px rgb(0 0 0 / 0.06);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);

  /* Custom pointer: recent.design's exact cursor SVG (their --presence-local-cursor),
     a rounded arrow with a baked white outline + soft drop-shadow, hotspot at its
     tip (5,4). To recolour, change the fill%3D%22black%22 below (e.g. %23000 -> an
     accent; %23 is an encoded #). Trailing `auto` is the no-support fallback. */
  --cursor: url("data:image/svg+xml,%3Csvg%20width%3D%2228%22%20height%3D%2228%22%20viewBox%3D%220%200%2028%2028%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20filter%3D%22url(%23shadow)%22%3E%3Cpath%20d%3D%22M5.08814%205.36283L10.4791%2020.7254C10.781%2021.5857%2011.9824%2021.6263%2012.3417%2020.7884L15.0192%2014.5442C15.1203%2014.3083%2015.3083%2014.1203%2015.5442%2014.0192L21.7884%2011.3417C22.6263%2010.9824%2022.5857%209.78096%2021.7254%209.47907L6.36285%204.08812C5.57154%203.81044%204.81046%204.57152%205.08814%205.36283Z%22%20fill%3D%22black%22%20stroke%3D%22white%22%20stroke-width%3D%222.05556%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3Cfilter%20id%3D%22shadow%22%20x%3D%220%22%20y%3D%220%22%20width%3D%2227.4224%22%20height%3D%2227.4221%22%20filterUnits%3D%22userSpaceOnUse%22%20color-interpolation-filters%3D%22sRGB%22%3E%3CfeFlood%20flood-opacity%3D%220%22%20result%3D%22BackgroundImageFix%22%2F%3E%3CfeColorMatrix%20in%3D%22SourceAlpha%22%20type%3D%22matrix%22%20values%3D%220%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200%22%20result%3D%22hardAlpha%22%2F%3E%3CfeOffset%20dy%3D%221%22%2F%3E%3CfeGaussianBlur%20stdDeviation%3D%222%22%2F%3E%3CfeComposite%20in2%3D%22hardAlpha%22%20operator%3D%22out%22%2F%3E%3CfeColorMatrix%20type%3D%22matrix%22%20values%3D%220%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.25%200%22%2F%3E%3CfeBlend%20mode%3D%22normal%22%20in2%3D%22BackgroundImageFix%22%20result%3D%22effect1_dropShadow%22%2F%3E%3CfeBlend%20mode%3D%22normal%22%20in%3D%22SourceGraphic%22%20in2%3D%22effect1_dropShadow%22%20result%3D%22shape%22%2F%3E%3C%2Ffilter%3E%3C%2Fdefs%3E%3C%2Fsvg%3E") 5 4, auto;
}

/* Hairlines are drawn at 0.5px so a dense screen can paint half a pixel. It
   cannot: WebKit floors the border to one device pixel, which on a 3x phone is
   a third of a CSS pixel, and a third of a pixel of --gray-10 is not there.
   Measured on an iPhone at 3x: every edge of a card came back as exactly one
   pixel of #e6e6e6, top, right, bottom and left alike, and the strokes read as
   missing rather than drawn. Widening them is the wrong answer, a 1px border
   becomes three device pixels and stops being a hairline at all.

   iOS has the same constraint and solves it the same way: its own separators
   are one device pixel, at #C6C6C8. So the line keeps its width and takes the
   ink, matching what the platform draws beside it. Overridden at the token, so
   every hairline on the site is corrected at once and no component needs to
   know. --border keeps its own value: this is the subtle tier catching up. */
@media (pointer: coarse) {
  :root { --border-subtle: var(--gray-22); }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Custom cursor, recent.design's technique: a plain CSS `cursor: url()` on the
   root (exact native tracking, no lag). Interactive elements keep their own
   pointer/grab/text cursors below, so affordance survives, matching recent. */
html { cursor: var(--cursor); }
input, textarea, [contenteditable="true"] { cursor: text; }

html, body {
  /* hidden hovercards paint past the right edge; clip stops them from
     widening the layout viewport on phones (clip ≠ hidden: no new
     scroll container) */
  overflow-x: clip;
}

body {
  font-family: var(--font);
  font-size: var(--base);
  font-weight: 400;
  line-height: 1.25;
  color: var(--text);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;   /* macOS/iOS: thinner, smoother strokes */
  -moz-osx-font-smoothing: grayscale;    /* Firefox on macOS: match */
  text-rendering: optimizeLegibility;    /* kerning + ligatures */
  font-optical-sizing: auto;             /* Inter's optical size tracks the size */
}

a { color: inherit; text-decoration: none; }

/* ---------- Top scroll veil ---------- */
/* A fixed band at the top of the viewport that softens content as it scrolls
   under it: a light backdrop-blur masked so its strength tapers to zero, layered
   over a canvas-colour wash so text also fades into the page ground. Because the
   shell reserves 112px of empty top inset, the veil has nothing behind it at
   scroll-top and stays invisible until you scroll, so it reads as an effect that
   engages on scroll without any JS listener. */
.top-fade {
  position: fixed;
  inset: 0 0 auto 0;
  height: clamp(64px, 11vh, 104px);
  z-index: 40;
  pointer-events: none;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  background: linear-gradient(
    to bottom,
    var(--canvas) 0%,
    color-mix(in srgb, var(--canvas) 55%, transparent) 42%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 28%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 28%, transparent 100%);
}
/* the blur can distract when a user has asked for calm; drop it, keep the wash */
@media (prefers-reduced-motion: reduce) {
  .top-fade { -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* Tame the document scrollbar: a slim, token-tinted thumb that floats in a
   canvas gutter, so the page's main scrollbar stops shouting but stays grabbable.
   The transparent border + padding-box clip is what gives the thumb its inset. */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
html::-webkit-scrollbar { width: 11px; }
html::-webkit-scrollbar-track { background: transparent; }
html::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
  border: 3px solid var(--canvas);
  background-clip: padding-box;
}
html::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ---------- Shell + column ---------- */
/* Cami's two-container layout: an outer shell carries the flat 24px side
   gutter and 112px top inset and centres its child; the inner column caps
   the measure at 576px (Tailwind max-w-xl). */
.shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 112px 24px;
}
.col {
  width: 100%;
  max-width: 576px;
  display: flex;
  flex-direction: column;
  gap: 44px;
}

/* ---------- Intro ---------- */
.intro { display: flex; flex-direction: column; gap: 20px; }

.intro__header { display: flex; align-items: center; gap: 14px; }

.avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  background: var(--text);
  color: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--sm);
  letter-spacing: 0.02em;
  object-fit: cover;
}

.intro__titles { display: flex; flex-direction: column; gap: 4px; }

.intro__name { font-size: var(--base); font-weight: 600; letter-spacing: -0.02em; }

.intro__tagline { font-size: var(--sm); color: var(--text-muted); letter-spacing: -0.02em; }

.prose { display: flex; flex-direction: column; gap: 14px; }

.prose__text {
  font-size: var(--sm);
  line-height: 1.5;
  color: var(--text); /* body copy; the lead paragraph steps up to --text-lead */
  letter-spacing: -0.02em;
  text-wrap: pretty;
}

/* Lead paragraph carries the hierarchy through color, not size -
   and its opening sentence steps up once more, to near-black ink. */
.prose__text--lead { color: var(--text-lead); } /* a touch darker than --text-1, not full black */
.prose__ink { color: var(--text-strong); }

/* Highlighted inline links (companies / projects). Highlight is CSS-only and
   the link text stays a single contiguous node, so nothing reflows on hover. */
.lnk {
  color: var(--text-lead); /* one shade darker than body for stronger contrast */
  font-variation-settings: "wght" 520;
  text-decoration: underline;
  text-decoration-color: transparent; /* underline only on hover/focus */
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
  border-radius: 3px;
  transition: text-decoration-color 0.18s var(--ease), color 0.18s var(--ease);
}
.lnk:hover,
.lnk:focus-visible { text-decoration-color: currentColor; }

/* An inline brand link: a monochrome logo that rides the fluid type scale like
   the .kw icons, sitting flat in the text at the body ink. On hover the whole
   mark and word darken to near-black (the .kw hover ink) and the word takes the
   .lnk underline. The mark is fill=currentColor, so it follows the link colour.
   Used for Amplitude in the KYC study. */
.amp {
  display: inline-flex;
  align-items: baseline;
  color: inherit;
  border-radius: 3px;
  transition: color 0.2s var(--ease);
}
.amp:hover,
.amp:focus-visible { color: var(--ink); }
.amp__icon {
  display: inline-block;
  /* em-sized so the mark scales with the clamp()ed type, like .kw__icon */
  width: 1.05em;
  height: 1.05em;
  margin-right: 0.2em;
  align-self: center;
}
.amp__icon svg { display: block; width: 100%; height: 100%; }
.amp__label {
  text-decoration: underline;
  text-decoration-color: transparent; /* underline only on hover/focus, like .lnk */
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
  transition: text-decoration-color 0.18s var(--ease);
}
.amp:hover .amp__label,
.amp:focus-visible .amp__label { text-decoration-color: currentColor; }

/* ---------- Hovercards ---------- */
.hovercard-host {
  position: relative;
  display: inline-grid;
  cursor: pointer;
  border-bottom: 1px dotted var(--text-faint);
  font-variation-settings: "wght" 400;
  transition: border-color 0.15s var(--ease),
              font-variation-settings 0.3s var(--ease);
}
/* cami's weight-hover ghost: a hidden copy at the hover weight holds the
   column width open, so the label bolds on hover with zero reflow */
.hovercard-host::after {
  content: attr(data-text);
  visibility: hidden;
  pointer-events: none;
  font-variation-settings: "wght" 600;
  height: 0;
  overflow: hidden;
}
.hovercard-host:hover,
.hovercard-host:focus-visible {
  border-bottom-color: var(--text-muted);
  font-variation-settings: "wght" 600;
}

.hovercard {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 0;
  width: 256px;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* clip the full-bleed banner to the rounded corners */
  background: var(--surface);
  border: 0.5px solid var(--border-subtle);
  border-radius: 16px;
  corner-shape: superellipse(1.5); /* match the link mini-cards */
  box-shadow: var(--shadow);
  opacity: 0;
  /* --hx is set by JS to keep the card inside the viewport */
  transform: translate(var(--hx, 0px), 6px) scale(0.97);
  transform-origin: bottom left;
  filter: blur(3px);
  pointer-events: none;
  /* exit: fast, accelerate away */
  transition: opacity 0.12s cubic-bezier(0.4, 0, 1, 1),
              transform 0.12s cubic-bezier(0.4, 0, 1, 1),
              filter 0.12s cubic-bezier(0.4, 0, 1, 1);
  z-index: 10;
}
/* Invisible hover bridge across the 12px gap between the trigger and the card.
   It hangs off the host, not the card: .hovercard is overflow:hidden (to clip
   the banner to its rounded corners), so a bridge parented to the card would be
   clipped away, which is what left the gap dead. Sits directly above the
   trigger, a touch wider than it and 2px into the card, so the pointer never
   crosses dead space on the way up. Only hittable while the card is open, so it
   never blocks neighbouring content. */
.hovercard-host::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: -24px;
  right: -24px;
  height: 14px;
  pointer-events: none;
  z-index: 10;
}
.hovercard-host:hover::before,
.hovercard-host:focus-visible::before,
.hovercard-host.is-open::before {
  pointer-events: auto;
}
.hovercard-host:hover .hovercard,
.hovercard-host:focus-visible .hovercard,
.hovercard-host.is-open .hovercard {
  opacity: 1;
  transform: translateX(var(--hx, 0px));
  filter: none;
  pointer-events: auto;
  /* enter: slower, decelerate in, slight settle */
  transition: opacity 0.22s cubic-bezier(0.2, 0, 0, 1),
              transform 0.22s cubic-bezier(0.3, 1.25, 0.4, 1),
              filter 0.22s cubic-bezier(0.2, 0, 0, 1);
  transition-delay: 0.1s;
}

/* X-style: a slim full-bleed banner strip up top, then padded text + CTA. */
.hovercard__banner {
  display: block;
  height: 48px;
  background: linear-gradient(135deg, var(--surface-active), var(--border-subtle));
  background-size: cover;
  background-position: center;
  /* the diagonal reveal wipe from the link cards; --banner-reveal rests at 1
     (fully shown) and the animation drives it 0 -> 1 on open */
  -webkit-mask-image: linear-gradient(105deg, #000 calc(var(--banner-reveal, 1) * 150% - 45%),
                      transparent calc(var(--banner-reveal, 1) * 150% - 10%));
          mask-image: linear-gradient(105deg, #000 calc(var(--banner-reveal, 1) * 150% - 45%),
                      transparent calc(var(--banner-reveal, 1) * 150% - 10%));
}
.hovercard__banner img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hovercard-host:hover .hovercard__banner,
.hovercard-host:focus-visible .hovercard__banner {
  animation: banner-reveal 1.25s cubic-bezier(0.6, 0, 0.35, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  .hovercard__banner { -webkit-mask-image: none; mask-image: none; }
  .hovercard-host:hover .hovercard__banner,
  .hovercard-host:focus-visible .hovercard__banner { animation: none; }
}
.hovercard__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
}
.hovercard__text {
  font-size: var(--xs);
  line-height: 1.35;
  color: var(--text-muted);
}
/* CTA matches the link mini-cards' .lcx__cta pill */
.hovercard__cta {
  position: relative;
  overflow: hidden; /* clip the open shine to the pill */
  cursor: pointer; /* the CTA is the only click target on the card */
  align-self: flex-end; /* bottom-right, like the email card's Chat button */
  padding: 5px 12px;
  border-radius: 999px;
  font-size: var(--2xs);
  font-variation-settings: "wght" 500;
  white-space: nowrap;
  background: var(--ink);
  color: #fff;
  transition: opacity 0.15s var(--ease);
}
.hovercard__cta:hover { opacity: 0.9; }
/* one-time light sweep on open, like the link cards' CTA */
.hovercard-host:hover .hovercard__cta::after,
.hovercard-host:focus-visible .hovercard__cta::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 34%, rgba(255, 255, 255, 0.5) 50%, transparent 66%);
  transform: translateX(-130%) skewX(-14deg);
  animation: cta-shine 1s cubic-bezier(0.35, 0, 0.2, 1) 0.3s 1 both;
}
@media (prefers-reduced-motion: reduce) {
  .hovercard-host:hover .hovercard__cta::after,
  .hovercard-host:focus-visible .hovercard__cta::after { display: none; }
}
/* Quiet, non-interactive twin of the CTA for a stat whose case study has not
   shipped yet: same pill footprint, bottom-right, but muted (no ink fill, no
   pointer) so it reads as a status, not an action. */
.hovercard__soon {
  align-self: flex-end;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: var(--2xs);
  font-variation-settings: "wght" 500;
  white-space: nowrap;
  background: var(--surface-active);
  color: var(--text-muted);
  border: 0.5px solid var(--border-subtle);
}

/* ---------- Inline keyword ---------- */
/* A word that sits quiet in the sentence, then on hover blooms:
   ink deepens to near-black, weight goes bold, it scales up, and its
   hand-drawn icon comes alive (each icon animates for real, drawing,
   flashing, orbiting, fanning, not just a scale-and-rotate).

   Zero layout shift (credit @writenicecode): a hidden ghost copy holds the
   word's width in normal flow, while the visible face is absolutely centered
   over it, so growing to bold/scale overflows symmetrically and never
   reflows the line. The icon reserves a fixed box and only transforms. */
.kw {
  display: inline-flex;
  align-items: baseline;
  cursor: default;
  color: inherit; /* sit flat in the paragraph; only the icon adds emphasis */
  transition: color 0.3s var(--ease);
}
.kw:hover,
.kw:focus-visible,
.kw.is-live { color: var(--ink); outline: none; }

.kw__icon {
  display: inline-block;
  /* em-sized so the icons ride the same fluid type scale as the words -
     they grow and shrink with the clamp()ed font sizes across viewports */
  width: 1.15em;
  height: 1.15em;
  margin-right: 0.18em;
  align-self: center;
  opacity: 0.32;
  /* fixed size: on activation only the colour darkens (opacity + ink), the icon
     never resizes; its own inner parts still animate (boat sails, orbits spin) */
  transition: opacity 0.3s var(--ease);
}
.kw:hover .kw__icon,
.kw:focus-visible .kw__icon,
.kw.is-live .kw__icon {
  opacity: 1;
}

.kwi { display: block; width: 100%; height: 100%; overflow: visible; }

/* Pencil: writes, the body rocks along the line while a scribble
   draws itself underneath via stroke-dashoffset. */
.kwi__pencil { transform-box: view-box; transform-origin: 20% 85%; }
.kwi__scribble {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
}
.kw:hover .kwi__pencil,
.kw:focus-visible .kwi__pencil,
.kw.is-live .kwi__pencil {
  animation: kwi-write 1.6s ease-in-out infinite;
}
.kw:hover .kwi__scribble,
.kw:focus-visible .kwi__scribble,
.kw.is-live .kwi__scribble {
  animation: kwi-scribble 1.6s ease-in-out infinite;
}
/* pen sweeps right as it draws, returns left as the line clears, loops */
@keyframes kwi-write {
  0%   { transform: translate(-1.5px, 0.6px) rotate(-6deg); }
  50%  { transform: translate(2.4px, 0.2px) rotate(3deg); }
  100% { transform: translate(-1.5px, 0.6px) rotate(-6deg); }
}
/* draw the scribble on, hold, then fade out (offset resets while invisible) */
@keyframes kwi-scribble {
  0%   { stroke-dashoffset: 1; opacity: 0; }
  14%  { opacity: 1; }
  50%  { stroke-dashoffset: 0; opacity: 1; }
  78%  { stroke-dashoffset: 0; opacity: 1; }
  96%  { stroke-dashoffset: 0; opacity: 0; }
  100% { stroke-dashoffset: 1; opacity: 0; }
}

/* Sailboat: while you hover, the hull rocks and bobs on the swell and
   the water underneath actually drifts past, a loop of sea. */
.kwi__boat { transform-box: view-box; transform-origin: 50% 78%; }
.kw:hover .kwi__boat,
.kw:focus-visible .kwi__boat,
.kw.is-live .kwi__boat {
  animation: kwi-sail 1.9s ease-in-out infinite;
}
.kw:hover .kwi__sea,
.kw:focus-visible .kwi__sea,
.kw.is-live .kwi__sea {
  animation: kwi-sea 1.3s linear infinite;
}
@keyframes kwi-sail {
  0%, 100% { transform: rotate(-4.5deg); }
  50%      { transform: translateY(-0.6px) rotate(4.5deg); }
}
/* one full wave period, so the loop is seamless */
@keyframes kwi-sea {
  to { transform: translateX(-5.4px); }
}

/* Atom: three orbits spin at different speeds while the nucleus
   breathes, runs for as long as you hover. */
.kwi__orbit { transform-box: view-box; transform-origin: center; }
.kwi__nucleus { transform-box: view-box; transform-origin: center; }
.kw:hover .kwi__orbit--a,
.kw:focus-visible .kwi__orbit--a,
.kw.is-live .kwi__orbit--a { animation: kwi-spin 1.6s linear infinite; }
.kw:hover .kwi__orbit--b,
.kw:focus-visible .kwi__orbit--b,
.kw.is-live .kwi__orbit--b { animation: kwi-spin 2.4s linear infinite reverse; }
.kw:hover .kwi__orbit--c,
.kw:focus-visible .kwi__orbit--c,
.kw.is-live .kwi__orbit--c { animation: kwi-spin 3.4s linear infinite; }
.kw:hover .kwi__nucleus,
.kw:focus-visible .kwi__nucleus,
.kw.is-live .kwi__nucleus { animation: kwi-pulse 1.2s ease-in-out infinite; }
@keyframes kwi-spin { to { transform: rotate(360deg); } }
@keyframes kwi-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.45); }
}

/* Layers: the three UI sheets fan apart like cards being spread and
   settle back, over and over, a continuous shuffle. The base transition
   smooths the return to rest when you stop hovering. */
.kwi__layer {
  transform-box: view-box;
  transform-origin: center;
  fill: var(--canvas);
  transition: transform 0.45s cubic-bezier(0.3, 1.45, 0.4, 1);
}
.kw:hover .kwi__layer--back,
.kw:focus-visible .kwi__layer--back,
.kw.is-live .kwi__layer--back { animation: kwi-fan-back 2s ease-in-out infinite; }
.kw:hover .kwi__layer--mid,
.kw:focus-visible .kwi__layer--mid,
.kw.is-live .kwi__layer--mid { animation: kwi-fan-mid 2s ease-in-out infinite; }
.kw:hover .kwi__layer--front,
.kw:focus-visible .kwi__layer--front,
.kw.is-live .kwi__layer--front { animation: kwi-fan-front 2s ease-in-out infinite; }
@keyframes kwi-fan-back {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50%      { transform: translate(1.7px, -1.7px) rotate(6deg); }
}
@keyframes kwi-fan-mid {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(0.2px, -0.2px); }
}
@keyframes kwi-fan-front {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50%      { transform: translate(-1.7px, 1.7px) rotate(-6deg); }
}

/* Next.js: the brand mark (matching the Toolbox glyph) turns a single coin-flip
   on hover, edge-on through the middle then back to face, a quick build lap that
   settles at rest. rotateY with no perspective reads as a clean 2D flip. */
.kwi--next { transform-box: view-box; transform-origin: center; }
.kw:hover .kwi--next,
.kw:focus-visible .kwi--next,
.kw.is-live .kwi--next { animation: kwi-flip 0.7s var(--ease); }
@keyframes kwi-flip { from { transform: rotateY(0); } to { transform: rotateY(360deg); } }

.kw__text { position: relative; display: inline-block; }
.kw__ghost,
.kw__face { white-space: nowrap; }
.kw__face { font-weight: 500; }
/* Ghost reserves a mid-weight width: the rest state has barely any slack
   around the word, and the bold hover state overflows the box by only
   ~1px per side, into whitespace, never reflowing the line. */
.kw__ghost { visibility: hidden; font-weight: 560; }
.kw__face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(1);
  transform-origin: 50% 80%;
  transition: font-weight 0.3s var(--ease),
              transform 0.35s cubic-bezier(0.3, 1.4, 0.4, 1);
}
.kw:hover .kw__face,
.kw:focus-visible .kw__face {
  font-weight: 700;
  transform: scale(1.03);
}

/* ---------- Sign-off ---------- */
/* "Enjoy," then a hand-written signature. The signature is a single-stroke
   SVG path that draws itself with stroke-dashoffset, real pen motion,
   flourish underline last. Hover replays it. */
.signoff {
  display: flex;
  flex-direction: column;
  align-self: flex-end;   /* right edge of the column */
  align-items: flex-end;
  margin-top: -86px;      /* rise onto the links' row (cancels the col gap) */
  position: relative;
  z-index: 1;             /* under the sticky links (z 90): scrolls behind them */
}

.signature {
  width: 132px;
  height: auto;
  color: var(--text-strong);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.signature__stroke { stroke-dasharray: 1; stroke-dashoffset: 0; }

html.intro-on .signature__stroke {
  animation: sign-draw 1.5s cubic-bezier(0.45, 0, 0.3, 1) 2450ms backwards;
}
html.intro-on .signature__stroke--2 {
  animation-duration: 0.45s;
  animation-delay: 3950ms;
  animation-timing-function: cubic-bezier(0.3, 0, 0.2, 1);
}
/* Replay on hover, separate name so it can retrigger after the intro run. The
   trigger is a JS-owned class, not :hover, so leaving mid-draw never snaps the
   stroke back: JS holds .is-signing until animationend, letting the pen finish
   gracefully. See initSignature in script.js. */
.signature.is-signing .signature__stroke {
  animation: sign-redraw 1.5s cubic-bezier(0.45, 0, 0.3, 1) both;
}
.signature.is-signing .signature__stroke--2 {
  animation-duration: 0.45s;
  animation-delay: 1.5s;
  animation-timing-function: cubic-bezier(0.3, 0, 0.2, 1);
}
@keyframes sign-draw {
  from { stroke-dashoffset: 1; }
  to   { stroke-dashoffset: 0; }
}
@keyframes sign-redraw {
  from { stroke-dashoffset: 1; }
  to   { stroke-dashoffset: 0; }
}

/* ---------- Link bar ---------- */
/* The footer links, sitting below the intro as plain text, exactly like
   the footer row. They ride along stuck to the top of the viewport, and
   only there do they earn their pill: background, border and shadow fade
   in as the links slide together. When the footer scrolls into view the
   bar fades out upward and the footer's own links fade in, one set of
   links, handed from chrome to page. */
/* The Elsewhere links are a sticky, direct child of the column, so on scroll
   they pin to the top and compact into a pill. The signature (.signoff, next
   sibling) is pulled up onto their row and sits behind them (lower z-index),
   staying in flow so it scrolls away as the links stay put. */
.linkbar {
  position: sticky;
  top: 12px;
  z-index: 90;
  align-self: flex-start;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 4px 0;
  border: 0.5px solid transparent;
  border-radius: var(--r-pill);
  background: transparent;
  box-shadow: none;
  transition: opacity 0.25s var(--ease),
              transform 0.25s cubic-bezier(0.2, 0, 0, 1),
              gap 0.3s cubic-bezier(0.2, 0, 0, 1),
              padding 0.3s cubic-bezier(0.2, 0, 0, 1),
              background 0.3s var(--ease),
              border-color 0.3s var(--ease),
              box-shadow 0.3s var(--ease);
}
/* pinned: links compact into a floating pill */
.linkbar.is-stuck {
  gap: 2px;
  padding: 4px;
  background: var(--surface);
  border-color: var(--border-subtle);
  box-shadow: var(--shadow);
}
/* at the footer, hand the links over to the footer's own copy */
.linkbar.is-away { opacity: 0; transform: translateY(-10px); pointer-events: none; }

.linkbar__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  border-radius: var(--r-pill);
  font-size: var(--sm);
  color: var(--text-muted);
  transition: color 0.15s var(--ease), padding 0.3s cubic-bezier(0.2, 0, 0, 1);
}
/* cami-style superellipse chip, painted behind the label so the flex row
   never reflows on hover; the stuck pill uses its own background instead */
.linkbar__link::before {
  content: "";
  position: absolute;
  inset: 1px -8px;
  border-radius: 9px;
  corner-shape: superellipse(1.5);
  background: var(--surface-hover);
  opacity: 0;
  transition: opacity 0.15s var(--ease);
  z-index: -1;
}
.linkbar:not(.is-stuck) .linkbar__link:hover::before { opacity: 1; }
.linkbar.is-stuck .linkbar__link { padding: 6px 12px; border-radius: var(--r-pill); } /* full pill when stuck; the superellipse read lopsided at this height */
.linkbar__link:hover { color: var(--text); }
.linkbar.is-stuck .linkbar__link:hover { background: var(--surface-hover); }
.linkbar__link:active { transform: scale(0.96); }

/* brand marks (injected by JS) trail each link, footer and bar alike. A fixed
   16px box centres a 12px mark, so every mark shares a 2px optical inset and
   edge-filling glyphs never read as cropped. */
.brand {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-faint);
  transition: color 0.15s var(--ease);
}
/* The mark element is 15px, but the padded -2 -2 20 20 viewBox insets the
   artwork so the visible glyph is 12px sitting ~2px off the box edge. Because
   the painted pixels never reach the element edge, no sub-pixel/compositing
   clip can shave them, so it renders identically at rest and on hover.
   On hover the glyph scales to 14px (14/12); the box stays a fixed 16px so
   nothing reflows. */
.brand__mark {
  width: 15px;
  height: 15px;
  display: block;
}
/* Scale the path, not the <svg>: WebKit resolves transform-origin on a viewBox'd
   svg against the wrong box, so scaling the svg drifts from a corner. fill-box
   pins the origin to the artwork's own bbox centre, so it grows dead-centre in
   every engine. The padded viewBox leaves room for the grown path (no clip). */
.brand__mark path {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.2s cubic-bezier(0.3, 1.3, 0.4, 1);
}
a:hover .brand { color: var(--text); }
a:hover .brand__mark path { transform: scale(1.1667); } /* visible glyph 12px -> 14px */
.footer__link,
.linkbar__link { display: inline-flex; align-items: center; gap: 6px; }

/* footer links start hidden on pages with a linkbar (class set by JS),
   then stagger in as the bar hands over */
html.js .footer--fx .footer__link {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s var(--ease),
              transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              color 0.15s var(--ease);
}
html.js .footer--fx.is-reached .footer__link {
  opacity: 1;
  transform: none;
}
html.js .footer--fx.is-reached .footer__link:nth-child(2) { transition-delay: 40ms; }
html.js .footer--fx.is-reached .footer__link:nth-child(3) { transition-delay: 80ms; }
html.js .footer--fx.is-reached .footer__link:nth-child(4) { transition-delay: 120ms; }
html.js .footer--fx.is-reached .footer__link:nth-child(5) { transition-delay: 160ms; }

/* ---------- Blocks (Experience / Highlights) ---------- */
.block { display: flex; flex-direction: column; gap: 12px; }

.block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.block__title { font-size: var(--base); font-weight: 400; color: var(--text-muted); } /* explicit so an h2.block__title matches the p version, not the UA bold default */

.block__action {
  font-size: var(--base);
  color: var(--text-muted);
  transition: color 0.15s var(--ease);
}
.block__action:hover { color: var(--text); }

/* Experience rows */
.xp {
  list-style: none;
  display: flex;
  flex-direction: column;
}

/* Experience cards mirror the Highlights: a padded block, lit on hover, with a
   title line and a description, but with the role's dates trailing right. */
.xp__card {
  position: relative; /* anchor the stretched link + the coming-soon pill */
  display: flex;
  flex-direction: column;
  gap: 9px; /* space between the company name row and its description */
  padding: 12px 16px; /* 12px top/bottom => 24px between adjacent experiences */
  margin: 0 -16px;
  border-radius: var(--r-lg);
  transition: background 0.2s var(--ease), transform 0.25s cubic-bezier(0.2, 0, 0, 1), opacity 0.3s var(--ease);
}

/* --- Clickable company (has a case-study page). The stretched .xp__hit link
   turns the whole card into one target; only these lift, scale, and take a
   pointer. The whole row grows 1.1x from its centre on hover. --- */
.xp__hit { position: absolute; inset: 0; z-index: 2; border-radius: inherit; }
@media (hover: hover) {
  .xp__card--link:hover,
  .xp__card--link:focus-within { transform: scale(1.01); }
  .xp__card--link:hover .xp__tag { color: var(--text-muted); }
  .xp__card--link:hover .xp__name::after { transform: scaleX(1); } /* wipe the underline on card hover */
}
.xp__card--link:focus-within { background: var(--surface-hover); }
@media (prefers-reduced-motion: reduce) {
  .xp__card--link:hover,
  .xp__card--link:focus-within { transform: none; } /* keep the lift, drop the zoom */
}
/* Hovering a clickable company quiets every other row, so focus lands on the
   one being explored. Scoped to link cards so a "soon" hover doesn't dim. */
@media (hover: hover) {
  .xp:has(.xp__card--link:hover) .xp__card:not(:hover),
  .xp:has(.xp__card--link:focus-within) .xp__card:not(:focus-within) { opacity: 0.55; }
}

/* --- Company without a page yet. No lift, no pointer: on hover the card's text
   quiets and a "Coming soon" pill fades in over it. The pill text stays in the
   a11y tree (not aria-hidden), so the status is announced, not only shown. --- */
.xp__card--soon { cursor: default; }
/* ease the quiet-down so the grey fades in rather than snapping */
.xp__card--soon .xp__name,
.xp__card--soon .xp__co,
.xp__card--soon .xp__tag,
.xp__card--soon .xp__desc,
.xp__card--soon .xp__desc-lead { transition: color 0.3s var(--ease); }
.xp__soon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  padding: 4px 11px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: var(--text-inverse);
  font-size: var(--2xs);
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  z-index: 3;
  transition: opacity 0.35s var(--ease) 0.04s, transform 0.35s var(--ease) 0.04s;
}
@media (hover: hover) {
  .xp__card--soon:hover .xp__name,
  .xp__card--soon:hover .xp__co,
  .xp__card--soon:hover .xp__tag,
  .xp__card--soon:hover .xp__desc,
  .xp__card--soon:hover .xp__desc-lead { color: var(--text-faint); }
  .xp__card--soon:hover .xp__soon { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
/* Touch / no-hover: without a pointer the hover reveal above never fires, so the
   soon cards masquerade as active. JS adds .is-soon-lit as each card scrolls to
   the centre of the viewport (a moving "hover") and on tap, driving the exact
   same quiet-down + pill as the hover state. See initSoonReveal in script.js. */
.xp__card--soon.is-soon-lit .xp__name,
.xp__card--soon.is-soon-lit .xp__co,
.xp__card--soon.is-soon-lit .xp__tag,
.xp__card--soon.is-soon-lit .xp__desc,
.xp__card--soon.is-soon-lit .xp__desc-lead { color: var(--text-faint); }
.xp__card--soon.is-soon-lit .xp__soon { opacity: 1; transform: translate(-50%, -50%) scale(1); }
@media (prefers-reduced-motion: reduce) {
  .xp__soon,
  .xp__card--soon:hover .xp__soon,
  .xp__card--soon.is-soon-lit .xp__soon { transform: translate(-50%, -50%); }
}

.xp__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: var(--sm); /* 14px title row (name, company, dates) */
}

.xp__left {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 600; /* the company reads as the card title, like .hl__title */
}

/* product name leads in bold ink (the link); the company trails in muted text,
   two-tone like the reference, with a faint dot between */
.xp__co { font-weight: 400; color: var(--text-muted); }
.xp__co::before { content: "·"; margin: 0 0.42em; color: var(--text-faint); }

/* company-name link: an underline wipes in on hover, hover-capable pointers
   only, so a touch tap just follows the link with no animation to play */
.xp__name { color: inherit; text-decoration: none; position: relative; }
@media (hover: hover) {
  .xp__name::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 1.5px;
    border-radius: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1);
  }
  .xp__name:hover::after { transform: scaleX(1); }
}
@media (prefers-reduced-motion: reduce) {
  .xp__name::after { transition: none; } /* appear without the wipe */
}

.xp__icon {
  width: 18px;
  height: 18px;
  border-radius: var(--r-sm);
  flex-shrink: 0;
  background: var(--tint, var(--text-faint));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--2xs);
  font-weight: 600;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
/* real brand logos are self-contained app icons that fill the tile edge-to-edge */
.xp__icon--img { background: var(--surface); overflow: hidden; }
.xp__icon--img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.xp__tag { color: var(--text-faint); white-space: nowrap; transition: color 0.2s var(--ease); }
/* indent past the badge (icon width + its gap) so the copy lines up under the
   company name, not the logo */
.xp__desc { font-size: var(--xs); line-height: 1.4; color: var(--text-muted); padding-left: calc(18px + 12px); }
/* two-tone like the reference: the role leads in darker ink, the detail + metrics trail in muted */
.xp__desc-lead { color: var(--text); }

/* Highlights */
.hl {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.hl__card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  margin: 0 -16px;
  border-radius: var(--r-lg);
  transition: background 0.2s var(--ease);
}
.hl__card:hover { background: var(--surface-hover); }
.hl__card:active { transform: scale(0.99); transition: transform 0.1s ease-out; }

.hl__cover {
  width: 120px;
  height: 76px;
  border-radius: var(--r-md);
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--surface-active), var(--border-subtle));
  transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1);
}
/* logo cover: a square brand tile centred on its own ground, contained so the
   full mark shows inside the landscape cover box */
.hl__cover--logo {
  object-fit: contain;
  background: #000;
  display: block;
}
/* photo cover: a real landscape capture. The heroes are all 1200x628, so the
   box takes that ratio and cover fills it with no crop (rather than the base
   120x76, which would clip the sides). */
.hl__cover--photo {
  object-fit: cover;
  display: block;
  height: auto;
  aspect-ratio: 1200 / 628;
}
/* authored cover art: a designed motif on a tinted ground, for highlights that
   have no photo. Vector, so crisp at any DPI; colours come from the neutral
   ramp so it themes with the palette. currentColor drives the motif. */
.hl__cover--art { display: grid; place-items: center; overflow: hidden; }
.hl__cover--art svg { width: 100%; height: 100%; display: block; }
/* playground: light motif springing on a dark tile (a toggle mid-overshoot) */
.hl__cover--play { background: linear-gradient(140deg, var(--gray-85), var(--gray-92)); color: var(--gray-4); }
@media (hover: hover) {
  .hl__card:hover .hl__cover { transform: scale(1.02) translateY(-1px); }
  .hl__card:hover .arrow { transform: translate(2px, -2px); color: var(--text); }
}

.hl__title { font-size: var(--sm); font-weight: 600; line-height: 1.3; }
.hl__label { position: relative; } /* anchor for the wipe underline (text only) */
.hl__tail { color: var(--text-muted); white-space: nowrap; }
/* underline wipes in on card hover/focus, same as .xp__name */
@media (hover: hover) {
  .hl__label::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 1.5px;
    border-radius: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1);
  }
  .hl__card:hover .hl__label::after,
  .hl__card:focus-visible .hl__label::after { transform: scaleX(1); }
}
@media (prefers-reduced-motion: reduce) {
  .hl__label::after { transition: none; } /* appear without the wipe */
}

/* arrows nudge toward their destination on hover */
.arrow {
  display: inline-block;
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1), color 0.2s var(--ease);
}
.block__action:hover .arrow,
a.crumb-switch__item:hover .arrow,
.hovercard__link:hover .arrow { transform: translate(2px, -2px); }
.hl__desc { font-size: var(--xs); line-height: 1.4; color: var(--text-muted); }

/* Rolling logo wheel: an inline slot that rolls one partner mark up to the next
   every 1.5s, like a scroll wheel. The window clips a vertical track; JS steps
   the track and morphs the window width to each mark so the trailing copy
   glides rather than jumps. Marks sit a shade darker than the muted desc so
   they read as brand marks, not body text. Accessible name lives on .logowheel;
   the visual track is aria-hidden. */
.logowheel {
  display: inline-flex;
  overflow: hidden;
  height: 1.15em;
  vertical-align: middle; /* optically centre the logo marks on the copy's x-height */
  width: var(--lw-w, 3.2em);
  color: var(--text);
  transition: width 0.5s cubic-bezier(0.2, 0, 0, 1);
}
.logowheel__track {
  display: flex;
  flex-direction: column;
  transition: transform 0.5s cubic-bezier(0.2, 0, 0, 1);
  will-change: transform;
}
.logowheel__cell {
  height: 1.15em;
  flex-shrink: 0; /* the track gets stretched to the 1.15em window, and a block
                     image's min-content (0.92em) is shorter than a text line, so
                     without this the image cells shrink below the window and it
                     reveals the next mark underneath. Pin them to full height. */
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-weight: 600;
  letter-spacing: -0.01em;
}
/* real SVG/PNG marks normalise to the cap height; text placeholders keep their
   own size until the assets land */
.logowheel__cell svg,
.logowheel__cell img { height: 0.92em; width: auto; display: block; }
@media (prefers-reduced-motion: reduce) {
  /* no roll: JS swaps cells instantly, so drop the slide and width easing */
  .logowheel, .logowheel__track { transition: none; }
}

/* ---------- My stack ---------- */
/* A quiet row of tool glyphs under the heading. Each glyph is a fixed optical
   box so every brand mark shares one baseline regardless of its viewBox. They
   rest at muted ink, settle to full ink and lift a hair on hover. */
.tbx__stack {
  list-style: none;
  padding: 8px 0 0; /* breathing room between the head divider and the marks */
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(14px, 2.4vw, 22px);
}
.tbx__tool { position: relative; display: flex; }
.tbx__glyph {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--text-muted);
  transition: color 0.18s var(--ease), transform 0.18s var(--ease);
}
.tbx__brand { width: 20px; height: 20px; display: block; } /* 20px mark centred in the 32px box: a uniform 6px optical inset on every mark */
/* Rest muted; on hover settle to the tool's own brand colour (falling back to
   ink for marks whose brand is simply black), and lift a hair. */
/* any-hover (not hover) so an attached pointer, iPad trackpad or Pencil, gets the
   hover even though the iPad's primary input stays touch (hover: none there) */
@media (any-hover: hover) {
  .tbx__tool:hover .tbx__glyph { color: var(--brand, var(--ink)); transform: translateY(-2px) scale(1.08); }
}

/* Name tooltip: sits above the glyph, stays in the a11y tree so the mark carries
   its name even though it is only painted on hover. */
.tbx__name {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(3px);
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--text-inverse);
  font-size: var(--2xs);
  line-height: 1.3;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s var(--ease), transform 0.15s var(--ease);
}
@media (any-hover: hover) {
  .tbx__tool:hover .tbx__name { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .tbx__glyph, .tbx__name { transition: none; }
  .tbx__tool:hover .tbx__glyph { transform: none; }
}

/* ---------- Work reel ---------- */
/* A full-bleed horizontal scroller that breaks out of the centered column so
   the work spans the whole viewport. The row scrolls on its own (touch swipe,
   trackpad, or the arrows); html/body already clip overflow-x so 100vw here
   never adds a page-level horizontal scrollbar. */
.reel {
  --reel-h: clamp(196px, 30vh, 320px);
  --reel-pad: clamp(16px, 5vw, 48px);
  position: relative;
  width: 100vw;
  margin-inline: calc(50% - 50vw); /* break out of .col to full viewport width */
}
.reel__viewport {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--reel-pad);
  scrollbar-width: none;
  overscroll-behavior-x: contain; /* horizontal swipes don't page-navigate back */
}
/* No focus ring on the scroll region itself: it is full-bleed, so the global
   :focus-visible outline would draw a huge stroke around the whole reel. Arrow
   keys still page it (the handler catches events bubbling from the focused card
   links, which keep their own visible focus). */
.reel__viewport:focus,
.reel__viewport:focus-visible { outline: none; }
.reel__viewport::-webkit-scrollbar { display: none; }
.reel__track {
  list-style: none;
  display: flex;
  gap: 14px;
  /* start inset via padding. For the end inset we append a spacer flex item
     (::after) rather than trailing padding or a last-item margin, because
     WebKit/iOS drops both from a scroll container's scrollable area, leaving
     the last card stuck to the right edge. A real (pseudo) flex item is always
     counted, so the trailing gutter survives everywhere. */
  /* Centred once the cards stop filling the viewport, left-aligned the rest of
     the time: `safe` picks between the two, and a full-bleed strip hugging the
     left gutter on a wide display is the thing it prevents. Same rule on
     .case-reel__track, where it is commented in full. */
  justify-content: safe center;
  padding-inline-start: var(--reel-pad);
  padding-block: 3px; /* headroom for the hover lift's shadow */
}
.reel__track::after { content: ""; flex: 0 0 calc(var(--reel-pad) - 14px); } /* -14px: the flex gap already adds that before the spacer, so both insets match */
.reel__item { flex: 0 0 auto; scroll-snap-align: start; }
.reel__card { display: flex; flex-direction: column; gap: 10px; }

.reel__media {
  display: block;
  height: var(--reel-h);
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--surface-active), var(--border-subtle));
  box-shadow: inset 0 0 0 0.5px var(--border-subtle);
  transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.3s var(--ease);
}
/* Round the card widths to whole pixels so the cumulative row lands on an
   integer and the trailing gutter is exactly --reel-pad, not a sub-pixel off.
   aspect-ratio stays as the fallback where round() is unsupported. */
/* Wide tiles carry the project heroes, all landscape 1200x628, so the frame
   takes that exact ratio: object-fit: cover then fills it with no crop. Tall
   tiles stay 3:4 for the portrait placeholders. */
.reel__media--wide { aspect-ratio: 1200 / 628; width: round(calc(var(--reel-h) * 1200 / 628), 1px); }
.reel__media--tall { aspect-ratio: 3 / 4; width: round(calc(var(--reel-h) * 0.75), 1px); }
/* Square: for artwork shot as a pair of phones side by side, where a wide crop
   would slice the tops and bottoms off both handsets. */
.reel__media--square { aspect-ratio: 1 / 1; width: round(var(--reel-h), 1px); }
/* Real project hero fills the media frame; the frame matches the source ratio,
   so cover fills edge to edge without cropping. overflow hidden keeps it inside
   the rounded corners; the tint class underneath is the load-time fallback. */
.reel__media:has(.reel__img) { overflow: hidden; }
.reel__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: inherit;
}
/* placeholder tints (swap each for a real png/video/component later) */
.reel__media--1 { background: linear-gradient(150deg, #e7eef8, #cdd8ea); }
.reel__media--2 { background: linear-gradient(150deg, #e7f1ee, #cfe0da); }
.reel__media--3 { background: linear-gradient(150deg, #f2ece6, #e2d5c8); }
.reel__media--4 { background: linear-gradient(150deg, #eee9f6, #dcd2ec); }
.reel__media--5 { background: linear-gradient(150deg, #eaf0ea, #d5e0d3); }
.reel__media--6 { background: linear-gradient(150deg, #f4ebee, #e4d2da); }
/* scratch-cards feature tile: a faint blue→violet ground that nods to the
   beam accent it lights up on hover */
.reel__media--scratch { background: linear-gradient(150deg, #eef0fb, #ded7f3); }

@media (hover: hover) {
  .reel__card:hover .reel__media { transform: translateY(-3px); box-shadow: var(--shadow); }
}
.reel__card:active .reel__media { transform: translateY(-1px) scale(0.995); transition-duration: 0.1s; }
/* A card with nowhere to go: either the study has not shipped, or the work is
   live but has no write-up. Not a link, so it does not lift or take a pointer;
   the kind line carries the status or the fact in place of an invitation. */
.reel__card--soon { cursor: default; }
.reel__card--soon:hover .reel__media,
.reel__card--soon:active .reel__media { transform: none; box-shadow: inset 0 0 0 0.5px var(--border-subtle); }

/* --- Work that has not shipped yet, so the card carries a badge as well as the
   kind line. On a pointer the hero quiets and a "Coming soon" pill fades in
   over it, the same read as .xp__soon on the experience list: the card is
   plainly out of service rather than merely unclickable. The pill text stays in
   the a11y tree (not aria-hidden), so the status is announced, not only shown.
   Touch never fires hover, so there the same quiet-down and pill are simply the
   card's resting state: nothing to discover, the badge is just on. --- */
.reel__media:has(.reel__soon) { position: relative; }
.reel__soon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  padding: 4px 11px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: var(--text-inverse);
  font-size: var(--2xs);
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.35s var(--ease) 0.04s, transform 0.35s var(--ease) 0.04s;
}
@media (hover: hover) {
  .reel__card--soon:has(.reel__soon) .reel__img { transition: opacity 0.3s var(--ease); }
  /* the tint underneath the hero shows through, so the quiet-down reads as a
     wash over the artwork rather than a hole punched in the card */
  .reel__card--soon:has(.reel__soon):hover .reel__img { opacity: 0.45; }
  .reel__card--soon:hover .reel__soon { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@media (hover: none) {
  .reel__card--soon:has(.reel__soon) .reel__img { opacity: 0.45; }
  .reel__soon { opacity: 1; transform: translate(-50%, -50%); }
}
@media (prefers-reduced-motion: reduce) {
  .reel__soon,
  .reel__card--soon:hover .reel__soon { transform: translate(-50%, -50%); }
}

.reel__cap { display: flex; flex-direction: column; gap: 2px; padding-inline: 2px; }
.reel__title {
  font-size: var(--sm);
  font-weight: 600;
  color: var(--text);
  align-self: flex-start; /* shrink to the text so the wipe underline hugs it */
  position: relative;
}
/* underline wipes in on card hover/focus, same as .xp__name / .hl__label */
@media (hover: hover) {
  .reel__title::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 1.5px;
    border-radius: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1);
  }
  .reel__card:hover .reel__title::after,
  .reel__card:focus-visible .reel__title::after { transform: scaleX(1); }
}
@media (prefers-reduced-motion: reduce) {
  .reel__title::after { transition: none; } /* appear without the wipe */
}
.reel__kind { font-size: var(--xs); color: var(--text-faint); white-space: nowrap; }
/* On a phone the caption sits alone under a full-width card with nothing beside
   it to scale against, and the step down to --xs reads as fine print rather
   than as the second line of the title. At that width it matches the title's
   --sm and weight and colour carry the difference instead. Desktop keeps the
   step: there the captions sit in a row and the size contrast sorts them. */
@media (max-width: 600px) {
  .reel__kind { font-size: var(--sm); }
}

/* edge arrows, centred on the media band */
.reel__arrow {
  position: absolute;
  top: calc(var(--reel-h) / 2 + 3px);
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 0.5px solid var(--border-subtle);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
  z-index: 3;
  transition: opacity 0.25s var(--ease), background 0.18s var(--ease), transform 0.12s var(--ease);
}
.reel__arrow--prev { left: clamp(8px, 2vw, 20px); }
.reel__arrow--next { right: clamp(8px, 2vw, 20px); }
.reel__arrow:hover { background: var(--surface); }
.reel__arrow:active { transform: translateY(-50%) scale(0.9); }
.reel__arrow:focus-visible { outline: 2px solid var(--text-muted); outline-offset: 2px; }
/* hide whichever arrow points off the end of the scroll */
.reel.at-start .reel__arrow--prev,
.reel.at-end .reel__arrow--next { opacity: 0; pointer-events: none; }

/* ---------- Chrome ---------- */
.chrome { position: fixed; top: 20px; z-index: 100; }
/* Align the back button to the content column's left edge (680px, centred),
   flooring to the 24px shell gutter on narrow screens so it never runs off. */
/* Align the fixed chrome to the content column's edge (576px wide => 288px half) */
.chrome--topleft { left: max(24px, calc(50% - 288px)); }
.chrome--topright { right: max(24px, calc(50% - 288px)); }

.pill-wrap { position: relative; }

.name-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  font: 500 var(--base) var(--font);
  color: var(--text);
  background: var(--surface);
  border: 0.5px solid var(--border-subtle);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: background 0.15s var(--ease), transform 0.18s cubic-bezier(0.2, 0, 0, 1);
}
.name-pill:hover { background: var(--surface-hover); }
.name-pill:active { transform: scale(0.97); }

.name-pill__avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--text);
  color: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--xs);
}

.name-menu[hidden] { display: none; }

.name-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  padding: 4px;
  background: var(--surface);
  border: 0.5px solid var(--border-subtle);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  transform-origin: top left;
  animation: menu-in 0.2s cubic-bezier(0.3, 1.25, 0.4, 1);
}
.name-menu.is-closing {
  animation: menu-out 0.12s cubic-bezier(0.4, 0, 1, 1) forwards;
  pointer-events: none;
}

@keyframes menu-in {
  from { opacity: 0; transform: translateY(-4px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
@keyframes menu-out {
  to { opacity: 0; transform: translateY(-2px) scale(0.98); }
}

.name-menu__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  font-size: var(--base);
  transition: background 0.15s var(--ease);
  animation: item-in 0.25s cubic-bezier(0.2, 0, 0, 1) backwards;
}
.name-menu__item:nth-child(1) { animation-delay: 0ms; }
.name-menu__item:nth-child(2) { animation-delay: 25ms; }
.name-menu__item:nth-child(3) { animation-delay: 50ms; }
.name-menu__item:nth-child(4) { animation-delay: 75ms; }

@keyframes item-in {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: none; }
}

.name-menu__item:hover { background: var(--surface-hover); }
.name-menu__item:active { transform: scale(0.98); transition: transform 0.06s ease-out; }
.name-menu__hint { color: var(--text-faint); font-size: var(--sm); }

/* Tabs */
.tabs {
  position: relative;
  display: inline-flex;
  padding: 4px;
  background: var(--surface);
  border: 0.5px solid var(--border-subtle);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow);
}

.tabs__tab {
  position: relative;
  z-index: 1;
  padding: 6px 14px;
  font-size: var(--base);
  color: var(--text-muted);
  border-radius: var(--r-pill);
  transition: color 0.15s var(--ease);
}
.tabs__tab:hover { color: var(--text); }
.tabs__tab.is-active { color: var(--text); }

.tabs__tab:active { transform: scale(0.96); transition: transform 0.06s ease-out; }

.tabs__slider {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 0;
  background: var(--surface-active);
  border-radius: var(--r-pill);
  transition: left 0.25s cubic-bezier(0.2, 0, 0, 1), width 0.25s cubic-bezier(0.2, 0, 0, 1);
}

/* ---------- Playground (design.html) ---------- */
.col--design { max-width: 1120px; }

/* Playground header: breadcrumb-led and quiet, kept for consistency with the
   case studies. The grid below is the real content. */
.pg-head { display: flex; flex-direction: column; gap: 8px; }
.pg-title { font-size: var(--lg); font-weight: 640; letter-spacing: -0.02em; color: var(--text-strong); }
.pg-tagline { font-size: var(--sm); line-height: 1.5; color: var(--text-muted); max-width: 48ch; }

/* Masonry grid: CSS columns so tiles of different heights pack organically (the
   recent.design gallery feel) with no JS layout pass. Column count follows the
   available width off a fixed column measure. */
.lab {
  columns: 244px;
  column-gap: 16px;
}

.lab__tile {
  break-inside: avoid;
  margin: 0 0 16px;
  background: var(--surface);
  border: 0.5px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
@media (hover: hover) {
  .lab__tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border); }
}

.lab__label { font-size: var(--sm); color: var(--text-muted); }

.lab__stage {
  min-height: var(--h, 132px);
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: var(--canvas);
  overflow: hidden;
  position: relative;
}

.lab__note { font-size: var(--sm); line-height: 1.4; color: var(--text-faint); }

.toggle {
  width: 56px;
  height: 32px;
  border-radius: var(--r-pill);
  border: none;
  background: var(--border);
  cursor: pointer;
  padding: 3px;
  display: flex;
  align-items: center;
  transition: background 0.25s var(--ease);
}
.toggle[aria-checked="true"] { background: var(--text); }

.toggle__thumb {
  width: 26px;
  height: 26px;
  border-radius: var(--r-pill);
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.2);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), width 0.15s var(--ease);
}
.toggle:active .toggle__thumb { width: 32px; }
.toggle[aria-checked="true"] .toggle__thumb { transform: translateX(24px); }
.toggle[aria-checked="true"]:active .toggle__thumb { transform: translateX(18px); }

.hold {
  position: relative;
  border: 0.5px solid var(--border-subtle);
  background: var(--surface);
  color: var(--text);
  font: 500 var(--sm) var(--font);
  padding: 10px 18px;
  border-radius: var(--r-pill);
  cursor: pointer;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.hold:active { transform: scale(0.97); }

.hold__fill {
  position: absolute;
  inset: 0;
  background: var(--text);
  transform: scaleX(0);
  transform-origin: left;
}
.hold.is-holding .hold__fill { transform: scaleX(1); transition: transform 1.1s linear; }
.hold:not(.is-holding) .hold__fill { transition: transform 0.3s var(--ease); }
.hold__text { position: relative; z-index: 1; }
.hold.is-holding .hold__text, .hold.is-done .hold__text { color: #fff; }
.hold.is-done .hold__fill { transform: scaleX(1); }

.counter { display: flex; align-items: center; gap: 12px; }

.counter__btn {
  width: 32px;
  height: 32px;
  border-radius: var(--r-pill);
  border: 0.5px solid var(--border-subtle);
  background: var(--surface);
  color: var(--text);
  font-size: var(--base);
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.15s var(--ease);
}
.counter__btn:hover { background: var(--surface-hover); }
.counter__btn:active { transform: scale(0.9); }

.counter__value {
  display: flex;
  height: 28px;
  overflow: hidden;
  font: 500 22px/28px var(--font);
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.counter__digit {
  display: flex;
  flex-direction: column;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.counter__digit span { height: 28px; }

.throw {
  width: 104px;
  height: 72px;
  border-radius: var(--r-lg);
  background: var(--text);
  color: var(--surface);
  display: grid;
  place-items: center;
  font-size: var(--sm);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  box-shadow: var(--shadow);
  will-change: transform;
}
.throw:active { cursor: grabbing; }

.react-btn {
  border: 0.5px solid var(--border-subtle);
  background: var(--surface);
  color: var(--text);
  font: 500 var(--sm) var(--font);
  padding: 10px 18px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.15s var(--ease);
}
.react-btn:hover { background: var(--surface-hover); }
.react-btn:active { transform: scale(0.94); }

.burst-particle {
  position: absolute;
  pointer-events: none;
  font-size: var(--lg);
  left: 50%;
  top: 50%;
  will-change: transform, opacity;
}

/* Toast lives inside its own tile stage now (self-contained, gallery-friendly),
   pinned to the bottom of the stage and centred without a transform so its
   enter/exit keyframes own the transform. */
.toast {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  margin-inline: auto;
  width: max-content;
  max-width: calc(100% - 24px);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--text);
  color: var(--surface);
  font-size: var(--sm);
  font-weight: 500;
  padding: 9px 14px;
  border-radius: var(--r-pill);
  box-shadow: var(--shadow);
  animation: toast-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toast.is-leaving { animation: toast-out 0.3s var(--ease) forwards; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(14px) scale(0.92); }
  to   { opacity: 1; transform: none; }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(6px) scale(0.96); }
}

/* ---------- Segmented control ---------- */
.seg {
  position: relative;
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--surface-active);
  border: 0.5px solid var(--border-subtle);
  border-radius: var(--r-pill);
}
.seg__opt {
  position: relative;
  z-index: 1;
  border: none;
  background: none;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  font: 500 var(--xs) var(--font);
  color: var(--text-muted);
  transition: color 0.25s var(--ease);
}
.seg__opt.is-active { color: var(--text-strong); }
.seg__pill {
  position: absolute;
  z-index: 0;
  top: 3px;
  bottom: 3px;
  left: 0;
  width: 0;
  border-radius: var(--r-pill);
  background: var(--surface);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.10);
  transition: transform 0.42s cubic-bezier(0.34, 1.56, 0.64, 1), width 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- Progress ring ---------- */
.ring { position: relative; width: 88px; height: 88px; display: grid; place-items: center; }
.ring__svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring__track { stroke: var(--border-subtle); stroke-width: 4; }
.ring__bar {
  stroke: var(--text-strong);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}
.ring__pct {
  position: absolute;
  font: 600 var(--sm) var(--font);
  font-variant-numeric: tabular-nums;
  color: var(--text-strong);
}
.ring__unit { font-size: 0.7em; color: var(--text-muted); }

/* ---------- Tab underline ---------- */
.tabs { position: relative; display: inline-flex; gap: 4px; padding-bottom: 9px; }
.tabs__tab {
  border: none;
  background: none;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  font: 500 var(--xs) var(--font);
  color: var(--text-muted);
  transition: color 0.25s var(--ease);
}
.tabs__tab.is-active { color: var(--text-strong); }
.tabs__ink {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--text-strong);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- Equalizer ---------- */
.eq { display: flex; align-items: center; gap: 5px; height: 58px; }
.eq span {
  width: 5px;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(var(--text-strong), var(--text-muted));
  transform: scaleY(0.3);
  transform-origin: center bottom;
  animation: eq-bounce 1s ease-in-out infinite;
}
.eq span:nth-child(1) { animation-duration: 0.92s; animation-delay: -0.2s; }
.eq span:nth-child(2) { animation-duration: 1.28s; animation-delay: -0.6s; }
.eq span:nth-child(3) { animation-duration: 0.76s; animation-delay: -0.1s; }
.eq span:nth-child(4) { animation-duration: 1.5s;  animation-delay: -0.9s; }
.eq span:nth-child(5) { animation-duration: 0.88s; animation-delay: -0.4s; }
.eq span:nth-child(6) { animation-duration: 1.12s; animation-delay: -0.3s; }
.eq span:nth-child(7) { animation-duration: 0.68s; animation-delay: -0.7s; }
@keyframes eq-bounce {
  0%, 100% { transform: scaleY(0.22); }
  50%      { transform: scaleY(1); }
}

/* ---------- Skeleton to content ---------- */
.skel { position: relative; width: 172px; height: 52px; }
.skel__layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: opacity 0.5s var(--ease);
}
.skel__layer--real { opacity: 0; }
.skel.is-loaded .skel__layer--bones { opacity: 0; }
.skel.is-loaded .skel__layer--real { opacity: 1; }
.skel__avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
.skel__lines { display: flex; flex-direction: column; gap: 9px; flex: 1; }
.skel__lines span { height: 10px; border-radius: 5px; }
.skel__lines span:last-child { width: 58%; }
.skel__avatar,
.skel__lines span {
  background: linear-gradient(100deg, var(--surface-active) 30%, var(--border-subtle) 50%, var(--surface-active) 70%);
  background-size: 200% 100%;
  animation: skel-shimmer 1.4s linear infinite;
}
@keyframes skel-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}
.skel__pic {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--ink);
  color: var(--text-inverse);
  display: grid;
  place-items: center;
  font: 600 var(--xs) var(--font);
}
.skel__text { display: flex; flex-direction: column; gap: 3px; }
.skel__text b { font: 600 var(--sm) var(--font); color: var(--text-strong); }
.skel__text i { font: 400 var(--xs) var(--font); font-style: normal; color: var(--text-muted); }

/* ---------- Copy to clipboard ---------- */
.copy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0.5px solid var(--border-subtle);
  background: var(--surface);
  color: var(--text);
  font: 500 var(--sm) var(--font);
  padding: 9px 15px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.15s var(--ease);
}
.copy:hover { background: var(--surface-hover); }
.copy:active { transform: scale(0.95); }
.copy__icons { position: relative; width: 16px; height: 16px; flex-shrink: 0; }
.copy__ic {
  position: absolute;
  inset: 0;
  width: 16px;
  height: 16px;
  transition: opacity 0.25s var(--ease), transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.copy__ic--check { opacity: 0; transform: scale(0.4); color: var(--text-strong); }
.copy.is-copied .copy__ic--clip { opacity: 0; transform: scale(0.4); }
.copy.is-copied .copy__ic--check { opacity: 1; transform: scale(1); }

/* Calm the perpetual-motion tiles when the visitor asks for reduced motion; the
   JS auto-loop already stands down, so this just settles the CSS-only loops. */
@media (prefers-reduced-motion: reduce) {
  .eq span { animation: none; transform: scaleY(0.55); }
  .skel__avatar,
  .skel__lines span { animation: none; }
  .ring__bar { transition: none; }
}

/* ---------- Intro animation ---------- */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); filter: blur(10px); }
  to   { opacity: 1; transform: none; filter: none; }
}

html.intro-on .anim {
  animation: fade-up 0.9s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: var(--d, 0ms);
}

/* Once the copy has settled, each keyword winks its hover-bloom once -
   a self-demo that cues "these are interactive". Staggered via --kd. */
html.intro-on .kw__icon {
  animation: kw-wink-icon 1.15s cubic-bezier(0.34, 1.4, 0.5, 1) backwards;
  animation-delay: var(--kd, 1400ms);
}
html.intro-on .kw__face {
  animation: kw-wink-face 1.15s cubic-bezier(0.34, 1.4, 0.5, 1) backwards;
  animation-delay: var(--kd, 1400ms);
}
@keyframes kw-wink-icon {
  0%   { opacity: 0.32; transform: scale(0.78) rotate(-8deg); }
  42%  { opacity: 1;    transform: translateX(-0.09em) scale(0.9) rotate(0deg); }
  100% { opacity: 0.32; transform: scale(0.78) rotate(-8deg); }
}
@keyframes kw-wink-face {
  0%   { font-weight: 500; color: var(--text); transform: scale(1); }
  42%  { font-weight: 700; color: var(--text-strong);       transform: scale(1.03); }
  100% { font-weight: 500; color: var(--text); transform: scale(1); }
}

/* chrome joins the load choreography, drifting down as content drifts up */
@keyframes fade-down {
  from { opacity: 0; transform: translateY(-8px); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: none; }
}

html.intro-on .chrome {
  animation: fade-down 0.7s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
html.intro-on .chrome--topright { animation-delay: 80ms; }

/* per-tile stagger for the playground grid */
.lab__tile { --i: 0; }
html.intro-on .lab .lab__tile {
  animation: fade-up 0.7s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: calc(360ms + var(--i) * 60ms);
}

/* ---------- Page transitions (progressive enhancement) ---------- */
/* One continuous morph, not a cut: the outgoing page softens away (fade +
   blur + a hair of shrink) while the incoming page resolves out of blur, as
   if pulling into focus. The reveal handoff (script.js pagereveal) paints the
   destination's first screen up front so the morph lands on real content. */
@view-transition { navigation: auto; }

::view-transition-old(root) {
  animation: vt-out 0.42s cubic-bezier(0.4, 0, 0.2, 1) both;
}
::view-transition-new(root) {
  animation: vt-in 0.52s cubic-bezier(0.2, 0, 0, 1) both;
}
@keyframes vt-out {
  to { opacity: 0; filter: blur(10px); transform: scale(0.99); }
}
@keyframes vt-in {
  from { opacity: 0; filter: blur(12px); transform: scale(1.012) translateY(8px); }
}

/* the fixed chrome stays put while page content crossfades */
.chrome--topleft { view-transition-name: chrome-left; }
.chrome--topright { view-transition-name: chrome-right; }
/* When the chrome only exists on the arriving side (home has no back button),
   ease it in with the morph instead of letting it snap in. */
::view-transition-new(chrome-left):only-child,
::view-transition-new(chrome-right):only-child {
  animation: vt-chrome-in 0.52s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes vt-chrome-in {
  from { opacity: 0; transform: translateY(-6px); filter: blur(4px); }
}

/* ---------- Footer ---------- */
/* Colophon-style, after thomascochet & cami: status + links up top,
   copyright + build note underneath. */
.footer {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 8px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  font-size: var(--sm);
  letter-spacing: -0.02em;
  color: var(--text-muted);
}

.footer__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
}

.footer__links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.footer__link {
  position: relative;
  padding: 6px 0; /* match .linkbar__link exactly: gives the hover chip its full height and touch target */
  color: var(--text-muted);
  transition: color 0.15s var(--ease);
}
.footer__link::before {
  content: "";
  position: absolute;
  inset: 1px -8px;
  border-radius: 9px;
  corner-shape: superellipse(1.5);
  background: var(--surface-hover);
  opacity: 0;
  transition: opacity 0.15s var(--ease);
  z-index: -1;
}
.footer__link:hover::before { opacity: 1; }
.footer__link:hover { color: var(--text); }
.footer__link .arrow {
  display: inline-block;
  color: var(--text-faint);
  transition: transform 0.2s var(--ease), color 0.15s var(--ease);
}
.footer__link:hover .arrow { transform: translate(1px, -1px); color: var(--text-muted); }

.footer__base {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  flex-wrap: wrap;
  color: var(--text-faint);
}

/* ---------- Case study: live artifact page ---------- */
/* Not a slide deck about the work, the work itself, running. A focused hero,
   one real interactive prototype as the centrepiece, then short honest notes.
   The in-call demo below is driven by case-study.js off a single data-state. */

/* Call-signal accents. These sit off the neutral ink ramp on purpose: they
   carry meaning, not tone (green = answer/go, red = end/stop), so they live in
   their own small semantic family rather than as --gray-N primitives. */
:root {
  --signal-answer: #2fbf4e;
  --signal-answer-press: #26a642;
  --signal-end: #f0483b;
  --signal-end-press: #d63d31;
  /* The path that was taken. A ground rather than a fill, because the card
     carries a heading and a line of copy: --text-strong reads 16.5:1 on it and
     --text-muted 5.2:1, where the near-black slab it replaces made the chosen
     option the loudest thing on a slide whose subject is the two that were
     rejected. Green for the obvious reason, pale so it reads as a decision
     rather than a button. */
  --signal-chosen: #e8f6ed;
  --signal-chosen-edge: #b9dfc8;
  /* The finding that should have raised an alarm and did not. George picked
     the hue: it is the warning orange the capture UI itself used for an ID
     out of frame, so the deck flags the missed finding in the same colour the
     product flagged a bad capture. Note it is 2.39:1 on white, under the
     4.5:1 a body-size run of text wants, which is why it is used only on the
     deck, only on one line, and never as the sole carrier of meaning: that
     line is also the one the sentence underneath points at by number. */
  --signal-alert: #ff881f;
  /* The one data colour. Amplitude's series blue, which the .bklit charts
     already draw their line in; named for its source like --lydia-sky, and
     aliased by job. Used where a diagram marks the same kind of event the
     charts plot, so a ship on the deck's six-week plan and the ship marks on
     the six-week chart read as one axis of time. */
  --amplitude-blue: #1e61f0;
  --series: var(--amplitude-blue);
}

.col--case { max-width: 576px; gap: 44px; } /* match the homepage column width + section gap */

.back-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font: 500 var(--base) var(--font);
  color: var(--text);
  background: var(--surface);
  border: 0.5px solid var(--border-subtle);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow);
  transition: background 0.15s var(--ease), transform 0.18s cubic-bezier(0.2, 0, 0, 1);
}
/* opaque hover: the pill floats over body text, so a translucent tint would let
   the words behind it show through. --gray-4 is the same subtle darkening, solid. */
.back-pill:hover { background: var(--gray-4); }
.back-pill:active { transform: scale(0.96); }
.back-pill__arrow { transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1); }
.back-pill:hover .back-pill__arrow { transform: translateX(-3px); }

.case-hero { display: flex; flex-direction: column; gap: 16px; padding-top: 24px; }

/* Breadcrumb: quiet wayfinding back to the work index */
.case-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--sm);
  color: var(--text-faint);
}
.case-crumb a { color: var(--text-muted); transition: color 0.15s var(--ease); }
.case-crumb a:hover { color: var(--text); }
.case-crumb [aria-current] { color: var(--text-strong); } /* active crumb: darkest, top of the hierarchy */

/* ---- Breadcrumb company switcher ----
   A disclosure on the current-company crumb: the chevron button drops a list of
   the other companies. Built and behaves as a plain navigation disclosure. */
.crumb-switch { position: relative; display: inline-flex; }
.crumb-switch__btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font: inherit;
  font-weight: 500; /* one step heavier than the crumb text, to mark the active company */
  color: var(--text-strong); /* active company crumb reads darkest */
  background: none;
  border: 0;
  padding: 2px 3px;
  margin: -2px -3px; /* keep the visual baseline; the hit area grows, not the text */
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: color 0.15s var(--ease);
}
.crumb-switch__btn:hover { color: var(--text-strong); }
.crumb-switch__chev {
  width: 0.9em;
  height: 0.9em;
  color: var(--text-faint);
  transition: transform 0.2s var(--ease), color 0.15s var(--ease);
}
.crumb-switch__btn:hover .crumb-switch__chev { color: var(--text-muted); }
.crumb-switch__btn[aria-expanded="true"] .crumb-switch__chev { transform: rotate(180deg); color: var(--text-muted); }

.crumb-switch__menu {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  z-index: 60;
  min-width: 172px;
  margin: 0;
  padding: 5px;
  list-style: none;
  background: var(--surface);
  border: 0.5px solid var(--border-subtle);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden; /* out of the a11y tree when closed, still transitionable */
  transform: translateY(-6px) scale(0.98);
  transform-origin: top left;
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease), visibility 0.18s;
}
/* keyed off the attribute the JS drives, not off .crumb-switch, so the same menu
   can hang from any trigger (the breadcrumb crumb, the page-foot .case-next) */
[data-crumb-switch].is-open .crumb-switch__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.crumb-switch__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 9px;
  border-radius: var(--r-sm);
  font-size: var(--sm);
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
:is(a, button).crumb-switch__item:hover,
.crumb-switch__item.is-current:hover { background: var(--surface-hover); }
:is(a, button).crumb-switch__item:hover { color: var(--text-strong); }
/* a row that opens a submenu is a button, not a link: strip the control chrome
   so it sits on the same baseline as its sibling rows */
button.crumb-switch__item {
  font: inherit;
  width: 100%;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
}
.crumb-switch__item.is-current { font-weight: 600; color: var(--text-strong); cursor: pointer; }
.crumb-switch__item.is-soon { color: var(--text-faint); cursor: default; }
.crumb-switch__check { width: 14px; height: 14px; flex: none; color: var(--text-muted); }
/* the trailing slot resolves every row to one of three states: a check on the
   page you are on, a soon tag on what has not shipped, the top-right arrow on
   anything you can actually go to */
.crumb-switch__item .arrow { color: var(--text-faint); }
a.crumb-switch__item:hover .arrow { color: var(--text-muted); }
/* leading group: company logo + name, kept together on the left */
.crumb-switch__lead { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.crumb-switch__logo { width: 16px; height: 16px; flex: none; border-radius: var(--r-sm); object-fit: cover; }
.crumb-switch__tag {
  font-size: var(--xs); /* ~12px */
  font-weight: 500;
  text-transform: lowercase;
  color: var(--text-faint);
}
@media (prefers-reduced-motion: reduce) {
  .crumb-switch__menu,
  [data-crumb-switch].is-open .crumb-switch__menu { transform: none; }
}

.case-title {
  font-size: clamp(1.375rem, 1.2rem + 0.7vw, 1.5rem); /* 22 -> 24, in scale with the rest of the app */
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text-strong);
  text-wrap: balance;
}
.case-standfirst {
  font-size: var(--sm); /* match the intro's lead prose, for one type scale across the app */
  line-height: 1.5;
  color: var(--text-lead);
  letter-spacing: -0.02em;
  text-wrap: pretty;
}
.case-standfirst em { font-style: italic; color: var(--text-strong); }
/* Secondary intro paragraph: the breadth-and-metrics scope line, quieter than
   the lead standfirst. */
.case-scope {
  font-size: var(--sm);
  line-height: 1.6;
  letter-spacing: -0.01em;
  color: var(--text-muted);
  text-wrap: pretty;
}
.case-scope em { font-style: normal; color: var(--text-lead); }

/* Company hub hero: the title is the company mark + name; a small inline facts
   line sits right under it (role · years · scale · site), then a smaller
   tagline, then the description. Keeps the metadata from competing with the big
   Impact numbers below. */
.case-title--company {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px; /* +8px beyond the hero gap, between the breadcrumb and the title */
}
.case-title__alt { color: inherit; } /* former name, same colour as the current one */
.case-title__logo {
  width: 16px;
  height: 16px;
  border-radius: var(--r-sm);
  object-fit: cover;
  flex: none;
}
.case-facts {
  font-size: var(--sm);
  line-height: 1.5;
  color: var(--text-lead);
}
.case-facts__item { color: var(--text-lead); }
.case-facts__item:not(:last-child)::after {
  content: "·";
  margin: 0 0.5em;
  color: var(--text-faint);
}
a.case-facts__item {
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 2px;
  transition: color 0.15s var(--ease), text-decoration-color 0.15s var(--ease);
}
a.case-facts__item:hover { color: var(--text); text-decoration-color: var(--text-faint); }
.case-tagline {
  font-size: var(--base); /* match the intro name; less bold than a heading */
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.4;
  color: var(--text-lead);
  text-wrap: balance;
}
.case-tagline + .case-standfirst { margin-top: -8px; } /* 8px below the tagline (16px hero gap - 8px) */

.case-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.case-meta__cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  background: var(--surface);
  border: 0.5px solid var(--border-subtle);
  border-radius: var(--r-md);
}
/* Two columns on a phone, but on whole pixels.
   A 1fr track takes whatever half the column is, and half is often a fraction:
   an iPhone 15 Pro is 393pt wide, so the tracks come out 168.5px and the right
   box starts at x=200.5, which is 601.5 device pixels at 3x. Its left border
   then spans half a device pixel, WebKit rounds it away, and that one stroke
   vanishes while the other seven render. It only shows on widths whose halves
   are fractional, which is why 390, 402 and 430pt devices all look fine.
   So the tracks are rounded down to whole pixels and the one leftover pixel is
   pushed into the gap by space-between: both boxes then start on an integer and
   every stroke lands on the pixel grid. */
@media (max-width: 600px) {
  .case-meta {
    grid-template-columns: repeat(2, round(down, calc((100% - 8px) / 2), 1px));
    justify-content: space-between;
  }
}
.case-meta__cell dt { font-size: var(--xs); color: var(--text-faint); }
/* Leading, not the body default: a value that wraps to two lines ("Design (me)
   + Data + iOS/Android") sets the row height itself, and at 1.25 its last line
   box ends flush with the padding edge, no slack at all. Chrome rounds that
   away; iOS puts the descenders on the border and the box reads as cropped.
   1.45 gives the second line room above and below, and two-line values were
   too tight to read at 1.25 regardless. */
.case-meta__cell dd { font-size: var(--sm); line-height: 1.45; color: var(--text); }

/* ---- The live artifact ---- */
/* A soft-lit stage so the phone reads as the hero object on the page. */
.study-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: clamp(28px, 6vw, 56px) 20px;
  border-radius: var(--r-lg);
  background:
    radial-gradient(120% 90% at 50% 0%, var(--surface) 0%, var(--canvas) 70%);
  border: 0.5px solid var(--border-subtle);
}
.study-hint { font-size: var(--sm); color: var(--text-faint); text-align: center; }

/* Phone: dark bezel, real screen. Width is capped so it never dominates. */
.callphone { width: min(300px, 82%); }
.callphone__bezel {
  position: relative;
  background: var(--ink);
  border-radius: 40px;
  padding: 12px;
  box-shadow: 0 20px 50px -24px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.12);
}
.callphone__notch {
  position: absolute;
  top: 22px; left: 50%;
  transform: translateX(-50%);
  width: 84px; height: 22px;
  border-radius: var(--r-pill);
  background: var(--ink);
  z-index: 2;
}
.callphone__screen {
  position: relative;
  background: var(--text-inverse);
  border-radius: 30px;
  min-height: 452px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 52px 20px 26px;
  overflow: hidden;
}

/* Caller header owns the top: identity before controls. */
.call-caller {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  margin-bottom: auto;
}
.call-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  font-size: var(--lg);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-inverse);
  background: linear-gradient(150deg, var(--gray-55), var(--gray-85));
}
.call-name {
  font-size: var(--xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-strong);
}
.call-sub {
  font-size: var(--sm);
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.callphone[data-state="active"] .call-sub { color: var(--signal-answer-press); }
.callphone[data-state="declined"] .call-sub { color: var(--signal-end-press); }

/* Incoming: two round actions, pushed apart at the thumb line. */
.call-actions {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
  padding: 0 6px;
}
.call-round-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.call-round-wrap--end { margin: 0 auto; }
.call-round-label { font-size: var(--xs); color: var(--text-faint); }

.call-round {
  width: 62px; height: 62px;
  border: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.2s var(--ease), background 0.15s var(--ease);
}
.call-round:active { transform: scale(0.9); }
.call-round--answer { background: var(--signal-answer); box-shadow: 0 8px 20px -8px var(--signal-answer); }
.call-round--answer:hover { background: var(--signal-answer-press); }
.call-round--decline,
.call-round--end { background: var(--signal-end); box-shadow: 0 8px 20px -8px var(--signal-end); }
.call-round--decline:hover,
.call-round--end:hover { background: var(--signal-end-press); }
/* Decline / end phone icon points down, the universal "hang up" tilt. */
.call-round--decline svg,
.call-round--end svg { transform: rotate(135deg); }

/* Active: control grid then a centred end button. */
.call-controls {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.call-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px 8px;
}
.call-ctl {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: none;
  background: none;
  color: var(--text);
  cursor: pointer;
}
.call-ctl__icon {
  width: 58px; height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-active);
  color: var(--text);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
              background 0.15s var(--ease), color 0.15s var(--ease);
}
.call-ctl:active .call-ctl__icon { transform: scale(0.9); }
.call-ctl[aria-pressed="true"] .call-ctl__icon {
  background: var(--ink);
  color: var(--text-inverse);
}
.call-ctl__label { font-size: var(--xs); color: var(--text-faint); }

/* Controls spring in when the call goes live. */
.callphone[data-state="active"] .call-controls { animation: call-rise 0.42s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes call-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* Text sections stay narrow; index numbers give wayfinding */
.case-section { display: flex; flex-direction: column; gap: 10px; max-width: 560px; }
.case-index { font-size: var(--sm); color: var(--text-faint); font-variant-numeric: tabular-nums; }
.case-h2 { font-size: var(--lg); font-weight: 600; letter-spacing: -0.02em; color: var(--text-strong); }
/* A sub-beat inside a numbered section: body size, so it never competes with the
   numbered h2 above it, but carries heading ink and weight so the eye (and a
   crawler reading the outline) knows the block below belongs to that section. */
.case-h3 { font-size: var(--base); font-weight: 600; letter-spacing: -0.01em; color: var(--text-strong); }
.case-body { font-size: var(--base); line-height: 1.65; color: var(--text-lead); letter-spacing: -0.01em; text-wrap: pretty; }
.case-body em { font-style: italic; color: var(--text); }
/* An inline figure in running copy. Highlighted by ink alone, the darkest shade
   like a heading, never italic: italics read as emphasis, a number is not being
   emphasised, it is being made scannable. Use in place of <em> for metrics. */
.metric { color: var(--text-strong); font-weight: 600; font-style: normal; }
.case-body code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 0.9em;
  padding: 1px 5px;
  border-radius: var(--r-sm);
  background: var(--surface-active);
  color: var(--text);
}
.case-note {
  font-size: var(--sm);
  line-height: 1.6;
  color: var(--text-muted);
  padding-left: 14px;
  border-left: 2px solid var(--border);
}
/* A verdict: the one-line judgement that closes a beat ("it shipped, and here
   is what it was worth"). The lightest tint on the ramp, so it reads as lifted
   out of the prose without becoming a second voice. The ink stays .metric;
   this only draws the box around it. */
.case-verdict {
  background: var(--surface-quiet);
  border-radius: var(--r-lg);
  padding: 12px;
}

/* A bulleted list inside a case section: quiet dot markers at body ink, tuned
   to sit in the section's own 10px rhythm. */
.case-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.case-list li {
  position: relative;
  padding-left: 1.1em;
  font-size: var(--base);
  line-height: 1.5;
  color: var(--text-lead);
  letter-spacing: -0.01em;
  text-wrap: pretty;
}
.case-list li::before {
  content: "";
  position: absolute;
  left: 0.15em;
  top: 0.62em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-faint);
}

/* A quiet provenance line beneath a section: names where the evidence came
   from, one step smaller and fainter than the body. */
.case-source {
  font-size: var(--sm);
  color: var(--text-faint);
  letter-spacing: -0.01em;
}

/* ---- Next: the page-foot switcher ----
   The hand-off at the foot of a case study or a company page. It is the same
   disclosure as the breadcrumb switcher, so it borrows that component's menu
   and its [data-crumb-switch] behaviour wholesale; only the trigger and the
   drop direction are its own. A company page lists companies, a case study
   lists projects. */
.case-next {
  position: relative; /* anchors the menu */
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 0;
}
.case-next__kicker { font-size: var(--sm); color: var(--text-faint); }
.case-next__btn {
  align-self: flex-start; /* the hit area hugs the words, so the menu anchors to them, not to the column */
  gap: 6px;
  font-size: var(--lg); /* the chevron is sized in em, so it scales with the title */
  padding: 2px 4px;
  margin: -2px -4px;
}
.case-next__title {
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  position: relative; /* anchor for the wipe underline */
}
/* underline wipes in on hover/focus, same as .xp__name / .hl__label. Sits a
   touch lower than those: this text is --lg, so it needs the extra clearance
   under the descenders to read as the same optical gap. */
@media (hover: hover) {
  .case-next__title::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -3px;
    height: 1.5px;
    border-radius: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1);
  }
  .case-next__btn:hover .case-next__title::after,
  .case-next__btn:focus-visible .case-next__title::after { transform: scaleX(1); }
}
@media (prefers-reduced-motion: reduce) {
  .case-next__title::after { transition: none; } /* appear without the wipe */
}
/* the menu drops upward, not down: this sits at the foot of the page, where
   there is nothing below it but the footer */
.case-next__menu {
  top: auto;
  bottom: calc(100% + 4px);
  transform-origin: bottom left;
  transform: translateY(6px) scale(0.98);
  max-width: min(86vw, 320px);
}
[data-crumb-switch].is-open .case-next__menu { transform: translateY(0) scale(1); }
@media (prefers-reduced-motion: reduce) {
  .case-next__menu,
  [data-crumb-switch].is-open .case-next__menu { transform: none; }
}

/* ---- Cascading project menu ----
   Two levels in one panel: the companies, then that company's projects. Each
   company row is its own disclosure (a button with aria-expanded over the list
   nested beneath it), the same contract as the switcher it sits in, so this
   needs no ARIA menu semantics and tab order already runs company, its
   projects, next company.

   Given room, level two flies out beside level one, aligned to the row that
   opened it: the nesting makes that alignment pure CSS, no measuring. Without
   room, it drills in over level one and a back row returns. */
.casc__root,
.casc__panel { list-style: none; margin: 0; padding: 0; }
.casc__row { position: relative; } /* the flyout anchors to its own row */
.casc__chev {
  width: 14px;
  height: 14px;
  flex: none;
  color: var(--text-faint);
  transition: transform 0.2s var(--ease), color 0.15s var(--ease);
}
.casc__parent:hover .casc__chev { transform: translateX(2px); color: var(--text-muted); }
.casc__parent[aria-expanded="true"] { background: var(--surface-active); color: var(--text-strong); }
.casc__parent[aria-expanded="true"] .casc__chev { color: var(--text-muted); }
/* the company whose work you are reading: bolder, the way .is-current is, but
   without the check, since the chevron already owns the trailing slot */
.casc__parent.is-here { font-weight: 600; color: var(--text-strong); }
/* the back row leads with its chevron, so the lead group has no logo to space */
.casc__back-btn .crumb-switch__lead { gap: 4px; margin-left: -2px; color: var(--text-muted); }
.casc__back-btn .casc__chev { color: inherit; }
.casc__back-btn:hover .casc__chev { transform: translateX(-2px); }

.casc__panel { display: none; }
.casc__panel.is-open { display: block; }

/* Narrow: level two drills in over level one, which steps aside entirely. */
@media (max-width: 768px) {
  .casc__panel.is-open { animation: casc-in 0.2s var(--ease) both; }
  .casc.is-drilled .casc__row { display: none; }
  .casc.is-drilled .casc__row.is-active { display: block; }
  .casc.is-drilled .casc__row.is-active .casc__parent { display: none; }
}
@keyframes casc-in {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: none; }
}

/* Wide: level two is a second column beside the first, so level one never
   leaves and there is nothing to go back to. */
@media (min-width: 769px) {
  .casc__back { display: none; }
  .casc__panel {
    display: block;
    position: absolute;
    /* Offset from the row, which sits inside the menu's 5px padding and 0.5px
       border, so the first 6px only bring the panel level with the menu's outer
       edge. The 4px past that is the gap you actually see between the two. */
    left: calc(100% + 6px + 4px);
    top: -5px; /* pull back the menu's own padding so row and panel share a top edge */
    min-width: 190px;
    padding: 5px;
    background: var(--surface);
    border: 0.5px solid var(--border-subtle);
    border-radius: var(--r-md);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden; /* out of the a11y tree when closed, still transitionable */
    transform: translateX(-6px) scale(0.98);
    transform-origin: left center;
    transition: opacity 0.18s var(--ease), transform 0.18s var(--ease), visibility 0.18s;
  }
  .casc__panel.is-open { opacity: 1; visibility: visible; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .casc__panel { transition: none; }
  .casc__panel.is-open { animation: none; }
  .casc__chev { transition: none; }
}

/* ---------- Case study: results, features, figures ----------
   Shared vocabulary for company hubs (sumeria.html) and feature studies
   (sumeria-investing.html). The stat block sits high on the page on purpose:
   the outcome and its number are the first thing a reader (or an LLM) meets,
   before any prose. Everything reuses the two-tier neutral tokens. */

/* Results: NEUTRAL PLACEHOLDER, awaiting George's own metric-box design.
   Plain bold figure over a muted label, no card/box (deliberately not the
   reference's card style). A dl so screen readers pair figure with label. */
.case-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* two metrics per row */
  gap: 22px 24px;
}
.case-stat {
  display: flex;
  flex-direction: column;
  gap: 0;
}
/* Big text: the headline figure or comparison (e.g. "30% more sign-ups"),
   same type as the "Everyday money" tagline. */
.case-stat__num {
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.125rem); /* 17 -> 18 */
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--text-lead);
  text-wrap: pretty;
}
/* Small text: the detail below (e.g. "From EUR 100k to 130k"), same type as
   the description. */
/* An unwritten figure. Quiet enough to read as a blank waiting to be filled
   rather than a number that failed to load, and quiet enough that it never
   competes with the real figures beside it. Delete the modifier along with the
   brackets once the number lands. */
.case-stat--todo .case-stat__num,
.case-stat--todo .case-stat__label { color: var(--text-faint); }
.case-stat__label {
  font-size: var(--sm);
  line-height: 1.5;
  letter-spacing: -0.02em;
  color: var(--text-muted);
  text-wrap: pretty;
}
@media (max-width: 420px) {
  .case-stats { grid-template-columns: 1fr; } /* stack when a row of two gets cramped */
}

/* A metric that carries a hovercard reuses .hovercard-host, but the trigger is
   the whole cell, so drop the inline-text affordances (host underline, weight
   bold, width-hold ghost). The dotted underline moves onto the figure itself. */
.case-stat.hovercard-host {
  border-bottom: none;
  cursor: pointer;
  font-variation-settings: normal;
}
.case-stat.hovercard-host::after { content: none; }
/* The card floats above the trigger and is not itself a click target, only its
   CTA is, so it inherits the trigger's pointer cursor misleadingly. Reset it to
   default over the card body; the CTA sets its own pointer. */
.case-stat.hovercard-host .hovercard { cursor: default; }
.case-stat.hovercard-host:hover,
.case-stat.hovercard-host:focus-visible {
  border-bottom: none;
  font-variation-settings: normal;
}

/* Case studies reuse the homepage Highlights card (.hl). A forthcoming study is
   a non-interactive card: quieted, no pointer, no hover lift, "Coming soon" in
   the tail. */
.hl__card--soon { opacity: 0.55; cursor: default; }
.hl__card--soon:hover { background: transparent; }
.hl__card--soon:hover .hl__cover { transform: none; }

/* Figure: a real <figure> with an aspect-locked frame. Ships as an empty
   placeholder (a labelled dashed frame) so the layout is finished before the
   art lands; swap the <span> for an <img> with real alt text to fill it. */
.case-figure { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.case-figure__frame {
  aspect-ratio: 16 / 10;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface-active);
  box-shadow: 0 2px 16px rgb(0 0 0 / 0.05); /* super-light rest shadow; JS shifts it with the tilt */
}
.case-figure__frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.case-figure__frame--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border);
  background: var(--gray-2);
  color: var(--text-faint);
  font-size: var(--sm);
  letter-spacing: 0.01em;
}
.case-figure figcaption { font-size: var(--sm); line-height: 1.5; color: var(--text-muted); text-wrap: pretty; }
/* Prose picking up after a figure gets a clear break. The section's own 10px
   rhythm belongs to lines of the same thought, and at that distance the caption
   and the next paragraph read as one block: 22px on top of it makes 32px, so
   the caption stays attached to its image and the argument restarts. */
.case-section .case-figure + .case-body { margin-top: 22px; }
/* Captions centre under their image on a phone. At this width the image spans
   the full column, so a left-aligned caption reads as a stray paragraph rather
   than a label belonging to the picture above it. Balanced instead of pretty:
   centred text wants even line lengths, not just a protected last line. */
@media (max-width: 600px) {
  .case-figure figcaption,
  .case-reel__cap {
    text-align: center;
    text-wrap: balance;
  }
}

/* Portrait frame for phone-shaped captures. */
.case-figure__frame--tall { aspect-ratio: 9 / 16; max-width: 300px; margin-inline: auto; width: 100%; }

/* ---------- The scratch ticket ----------
   Figma's 343×120 foil is rendered on the canvas by scratch.js, with the
   prize in the DOM below it. The canvas lets its real texture scratch away. */
.scratch { display: flex; flex-direction: column; gap: 12px; }
/* Nothing inside the ticket is text you would want to copy, and a thumb dragged
   across a phone otherwise selects "Winner" or raises the long-press callout
   mid-scratch. Confined to the stage: the caption underneath is real prose and
   stays selectable. */
.scratch__stage {
  position: relative;
  width: 100%;
  max-width: 343px;
  aspect-ratio: 343 / 120;
  margin-inline: auto;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: none;
  background: var(--surface);
}
/* What the foil is hiding: the app's own ground, Lydia's pale sky tiled with
   the monogram. George's export already carries the colour and the staggered
   rows, so it is used whole rather than rebuilt from the loose mark; the
   colour is set underneath it too, so the panel is right even before the
   image has loaded. */
.scratch__prize {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
  background-color: var(--lydia-sky);
  background-image: url(/assets/logos/card-win-bg.png);
  background-repeat: repeat;
  background-size: 423px 130px; /* the export's own size: scaling it would soften the marks */
}
.scratch__amount { font-size: var(--xl); font-weight: 600; letter-spacing: -0.02em; color: var(--text-strong); }
/* The caption lives inside the block rather than as a <figcaption>, so it can
   sit centred directly under the controls instead of at the foot of the figure
   below the QR panel. */
.scratch__note { font-size: var(--sm); line-height: 1.5; color: var(--text-muted); text-align: center; text-wrap: pretty; }
.scratch__foil {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none; /* the drag is ours, not the page's */
  cursor: grab;
  transition: opacity 200ms cubic-bezier(0.4, 0, 1, 1);
}
.scratch__foil:active { cursor: grabbing; }
.scratch.is-revealed .scratch__foil { opacity: 0; pointer-events: none; }
/* The prize lands rather than appears: it is the payoff the whole section is
   about, so it gets the one bit of choreography on the page. */
.scratch.is-revealed .scratch__amount { animation: scratch-pop 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes scratch-pop {
  from { opacity: 0; transform: scale(0.82); }
  to { opacity: 1; transform: none; }
}
.scratch__controls { display: flex; gap: 8px; justify-content: center; align-items: center; }
.scratch__btn {
  font: inherit;
  font-size: var(--xs);
  color: var(--text-muted);
  background: var(--surface-quiet);
  border: 0.5px solid var(--border-subtle);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  transition: transform 60ms ease-out, background 60ms ease-out, color 60ms ease-out;
}
.scratch__btn:hover { background: var(--surface-active); color: var(--text); }
.scratch__btn:active { transform: scale(0.97); background: color-mix(in srgb, var(--text) 8%, transparent); }
.scratch__btn:not(:active) { transition-duration: 200ms; }
.scratch__btn:focus-visible { outline: 2px solid var(--text-muted); outline-offset: 2px; }
/* The win is announced, never printed: "Winner" on the card already says it,
   and on a phone the notification says it again. Kept in the DOM as a live
   region so assistive tech still hears the outcome. */
.scratch__status {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* A phone notification, borrowed from the Snake easter egg's score banner. The
   win in the real product arrived as a push, so the recreation ends the way the
   original did. Phones only: a desktop has no notification shade to imitate. */
.pushnote {
  position: fixed;
  /* Over the fixed page chrome (z 100), which the back pill sits in: a real
     push covers what is on screen, it does not slide under the app's own
     buttons. Still under the full-screen easter-egg overlays (z 300). */
  z-index: 200;
  left: 8px;
  right: 8px;
  top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 0.5px solid var(--border-subtle);
  border-radius: 18px;
  corner-shape: superellipse(1.5);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(calc(-100% - 16px)); /* parked above the screen edge */
  transition: opacity 0.3s var(--ease),
              transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none; /* it is a prop, not a control */
}
.pushnote.is-in { opacity: 1; transform: translateY(0); }
.pushnote__icon { width: 38px; height: 38px; flex: none; border-radius: 9px; corner-shape: superellipse(1.5); }
.pushnote__body { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.pushnote__title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: var(--xs);
  font-weight: 600;
  color: var(--text-strong);
}
/* The headline takes the room and truncates; the timestamp never shrinks, which
   is the way round a real banner does it. */
.pushnote__head { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pushnote__time { flex: none; font-weight: 400; color: var(--text-faint); }
.pushnote__msg { font-size: var(--sm); line-height: 1.3; color: var(--text); }
@media (prefers-reduced-motion: reduce) {
  .pushnote { transition-property: opacity; transition-duration: 0.2s; transform: none; }
  .pushnote.is-in { transform: none; }
}
/* "mobile" in the caption is a hovercard host: the QR sits in the same card the
   Sumeria hub uses for its stats, so the pattern is already familiar. It is a
   desktop-only flourish, see the coarse-pointer rule below. */
.hovercard--qr { width: auto; }
.hovercard--qr .hovercard__body { padding: 10px; }
.hovercard__qr {
  display: block;
  width: 132px;
  height: 132px;
  background: var(--surface);
}
/* On a touch screen the whole clause goes: the reader is holding the thing it
   recommends, and a caption that tells you to try it on mobile while you are on
   mobile reads as a page that has not noticed where it is. The full stop sits
   outside the span so the sentence closes cleanly either way. Dropped from the
   layout rather than hidden from sight, so the QR (and its hovercard, pointless
   without a hover) leaves the accessibility tree with it. */
@media (pointer: coarse) {
  .scratch__nudge { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .scratch.is-revealed .scratch__amount { animation: none; }
  .scratch__foil { transition: none; }
}

/* A full-bleed, horizontal scroll carousel of flow screens inside a case study,
   each screen captioned beneath it. It breaks out of the reading column to span
   the viewport, like the homepage work reel, and pages with the same arrow +
   at-start / at-end pattern (driven by initCaseReels). The arrows are real
   buttons, so keyboard users operate them directly. */
.case-reel {
  --creel-w: 190px;
  --creel-pad: clamp(16px, 5vw, 48px);
  position: relative;
  width: 100vw;
  margin-inline: calc(50% - 50vw); /* break out of .col--case to full width */
}
.case-reel__viewport {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--creel-pad);
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.case-reel__viewport::-webkit-scrollbar { display: none; }
.case-reel__track {
  list-style: none;
  display: flex;
  gap: 16px;
  margin: 0;
  /* `safe` is the whole point: plain `center` would centre the overflowing case
     too, pushing the first screens off the left edge where no scroll can reach
     them. Safe alignment falls back to start the moment the track overflows, so
     wide screens centre and narrow ones page as before. Browsers without the
     keyword drop the declaration and keep the old left-aligned behaviour. */
  justify-content: safe center;
  padding-inline-start: var(--creel-pad);
  padding-block: 3px;
}
/* trailing spacer as a real flex item so the end gutter survives on iOS */
.case-reel__track::after { content: ""; flex: 0 0 calc(var(--creel-pad) - 16px); }
.case-reel__item {
  flex: 0 0 var(--creel-w);
  width: var(--creel-w);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.case-reel__frame {
  aspect-ratio: 9 / 19.5;
  width: 100%;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface-active);
  box-shadow: 0 2px 16px rgb(0 0 0 / 0.05);
}
.case-reel__frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.case-reel__frame--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border);
  background: var(--gray-2);
  color: var(--text-faint);
  font-size: var(--sm);
  text-align: center;
  padding: 8px;
}
.case-reel__cap { font-size: var(--sm); line-height: 1.45; color: var(--text-muted); text-wrap: pretty; }
/* Arrows float over the frames, vertically centred on the phone image. */
.case-reel__arrow {
  position: absolute;
  top: calc(3px + var(--creel-w) * 19.5 / 9 / 2);
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 0.5px solid var(--border-subtle);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
  z-index: 3;
  transition: opacity 0.25s var(--ease), background 0.18s var(--ease), transform 0.12s var(--ease);
}
.case-reel__arrow--prev { left: clamp(8px, 2vw, 20px); }
.case-reel__arrow--next { right: clamp(8px, 2vw, 20px); }
.case-reel__arrow:hover { background: var(--surface); }
.case-reel__arrow:active { transform: translateY(-50%) scale(0.9); }
.case-reel__arrow:focus-visible { outline: 2px solid var(--text-muted); outline-offset: 2px; }
.case-reel.at-start .case-reel__arrow--prev,
.case-reel.at-end .case-reel__arrow--next { opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .case-reel__viewport { scroll-behavior: auto; } }

/* ---------- Lightbox ----------
   A tapped capture, shown over the page at whatever size the screen allows.
   On the case studies it is touch only (initLightbox never runs on a pointer
   device, where the captures are already large); the presentation deck
   reuses the same dialog and styles for any pointer, since a phone on a
   slide is small whatever the device. The element is a <dialog>, so the ::backdrop, the top layer
   and Escape come from the browser and not from a stack of z-indexes. */
.lightbox {
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  overflow: visible; /* the image starts life outside the dialog's own box */
}
/* Put back what `display: grid` above took away: the UA hides a closed dialog
   with display:none, and overriding display for the open state overrides it for
   the closed one too. Without this the closed dialog sits at the foot of the
   page, invisible but still laid out, and VoiceOver still finds its close
   button. Caught by reading the accessibility tree, not the screen. */
.lightbox:not([open]) { display: none; }
/* ::backdrop stays out of it: the dimming is .lightbox__scrim, a real element,
   so it can fade on its own timing while the image is still travelling. The
   page is meant to stay legible underneath, hence 40% rather than a blackout. */
.lightbox::backdrop { background: transparent; }
.lightbox__scrim {
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / 0.4);
  opacity: 0;
}
/* contain, not cover: a screenshot cropped to fit is a screenshot you cannot
   read, which is the whole reason the tap exists. Margin so it never sits edge
   to edge with the screen, radius so it reads as an object lifted off the page
   rather than a takeover, and both are what the entrance animates towards. */
.lightbox__img {
  display: block;
  position: relative;
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  object-fit: contain;
  border-radius: var(--r-lg);
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.28);
  will-change: transform;
}
.lightbox__close {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  opacity: 0; /* arrives just behind the image, animated in JS */
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--text);
  background: var(--surface);
  border: 0.5px solid var(--border-subtle);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow);
}
.lightbox__close:active { transform: scale(0.94); }
/* The dialog takes focus on open so the button does not; neither wants a ring
   for that. A ring on the button when it is genuinely tabbed to, though, yes. */
.lightbox:focus { outline: none; }
.lightbox__close:focus { outline: none; }
.lightbox__close:focus-visible { outline: 2px solid var(--text-muted); outline-offset: 2px; }
/* The capture answers the tap, so it does not look like flat art. Touch only,
   same as the lightbox itself. */
@media (pointer: coarse) {
  .is-zoomable { cursor: zoom-in; }
  .case-figure__frame:has(.is-zoomable):active,
  .case-reel__frame:has(.is-zoomable):active { transform: scale(0.994); }
  .case-figure__frame:has(.is-zoomable),
  .case-reel__frame:has(.is-zoomable) { transition: transform 0.16s var(--ease); }
}
@media (prefers-reduced-motion: reduce) {
  .lightbox { transition: none; }
  .case-figure__frame:has(.is-zoomable),
  .case-reel__frame:has(.is-zoomable) { transition: none; }
}

/* A Bklit-style analytics panel: a smooth curveNatural spline holding near 40%
   inside a highlighted 37-43% band, dual axis, dashed grid, faded edges. Reads
   like an embedded analytics widget; the line is Amplitude blue. */
.bklit {
  background: var(--surface);
  border: 0.5px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: 16px 16px 14px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bklit__title { font-size: var(--xs); font-weight: 500; color: var(--text-lead); letter-spacing: -0.01em; }
.bklit__plot { width: 100%; }
.bklit__plot svg { display: block; width: 100%; height: auto; }
.bklit__frame { fill: transparent; stroke: var(--border-subtle); }
.bklit__grid line { stroke: var(--border-subtle); stroke-width: 1; stroke-dasharray: 4 5; }
.bklit__band-line { stroke: rgb(30 97 240 / 0.32); stroke-width: 1; stroke-dasharray: 4 4; }
.bklit__axis { fill: var(--text-faint); font-size: 13px; font-variant-numeric: tabular-nums; }
/* The reference band's fill lives in the markup, not here: ids must be unique
   per document, so each chart declares its own gradient and points its rect at
   it. A fill here would win over the presentation attribute and drag every
   band back to the first chart's gradient. */
/* A moment on the time axis: a quiet vertical rule where something shipped,
   labelled above the plot so the line's steps are attributable, not just shape. */
.bklit__mark { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 4; }
.bklit__mark-label { fill: var(--text-muted); font-size: 12px; font-weight: 500; }
.bklit__line {
  fill: none;
  stroke: #1E61F0; /* Amplitude blue */
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

/* scroll reveals, content drifts up as it enters the viewport.
   Gated on html.js (set by script.js) so nothing hides without JS. */
html.js .reveal { opacity: 0; transform: translateY(16px); }
html.js .reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s cubic-bezier(0.2, 0, 0, 1),
              transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
/* Arrived via a page morph: the first screen is already in its resting state
   (marked by script.js pagereveal) so the transition animates it as one piece,
   with no second per-element stagger firing on top of the morph. */
html.js .reveal.reveal--now { transition: none; }

/* ---------- GitHub stats card ---------- */
/* Opens on hover of the GitHub footer link (tap on touch). Anchored above
   the link on desktop via --ax/--ay from JS; a centered sheet on phones. */
.ghx { position: fixed; inset: 0; z-index: 300; pointer-events: none; }

.ghx__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 0.2);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}

.ghx__card {
  position: absolute;
  left: var(--ax, 50%);
  top: var(--ay, 50%);
  transform: translate(-50%, calc(-100% - 12px)) translateY(8px) scale(0.95);
  width: min(340px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border: 0.5px solid var(--border-subtle);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  opacity: 0;
  filter: blur(3px);
  transition: opacity 0.15s cubic-bezier(0.4, 0, 1, 1),
              transform 0.15s cubic-bezier(0.4, 0, 1, 1),
              filter 0.15s cubic-bezier(0.4, 0, 1, 1);
}

/* only the card itself (and the phone backdrop) catch the pointer -
   the fixed wrapper must never block the page underneath */
.ghx.is-open .ghx__card { pointer-events: auto; }
.ghx.is-open .ghx__card {
  opacity: 1;
  transform: translate(-50%, calc(-100% - 12px));
  filter: none;
  transition: opacity 0.25s cubic-bezier(0.2, 0, 0, 1),
              transform 0.3s cubic-bezier(0.3, 1.3, 0.4, 1),
              filter 0.25s cubic-bezier(0.2, 0, 0, 1);
}

/* flipped: card hangs below its anchor (used under the stuck link bar) */
.ghx--below .ghx__card { transform: translate(-50%, 12px) translateY(-8px) scale(0.95); }
.ghx--below.is-open .ghx__card { transform: translate(-50%, 12px); }

.ghx__head { display: flex; align-items: center; gap: 12px; }
/* initials underneath; the real avatar image covers them when it loads
   (and removes itself on error) */
.ghx__avatar {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--text);
  color: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--sm);
  flex-shrink: 0;
  overflow: hidden;
}
.ghx__avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ghx__id { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
/* identity line matched to the link cards' .lcx__name (and the X @) */
.ghx__name { font-size: var(--sm); font-weight: 600; color: var(--text); line-height: 1.2; }
.ghx__handle { font-size: var(--xs); color: var(--text-muted); }
/* Follow button, matched to the link cards' CTA pill (bottom-right of the card) */
.ghx__visit {
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: var(--2xs);
  font-variation-settings: "wght" 500;
  white-space: nowrap;
  background: var(--ink);
  color: #fff;
  transition: opacity 0.15s var(--ease);
}
.ghx__visit:hover { opacity: 0.9; }
.ghx__card.is-playing .ghx__visit { display: none; } /* out of the way during Snake */

/* meta row above the graph: the contribution total at rest, and, while a
   Snake game runs, the live score + mute in its place */
.ghx__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
/* single contribution total, the count leads, the timeframe trails, sharing a
   baseline so they read as one line ("128 contributions · last year") */
.ghx__stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.ghx__num {
  font-size: var(--base);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}
.ghx__label { font-size: var(--xs); color: var(--text-faint); }

/* Snake score/status, hidden at rest, takes the row while playing */
.ghx__game {
  display: none;
  min-width: 0;
  font-size: var(--sm);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.ghx__card.is-playing .ghx__stat { display: none; }
.ghx__card.is-playing .ghx__game { display: block; }
.ghx__card.is-playing .ghx__mute { display: inline-flex; }

.ghx__graph {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 1fr);
  gap: 3px;
  /* press-and-drag paints across squares: claim the gesture from scroll and
     suppress text selection so the drag stays a clean paint stroke */
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.ghx__cell {
  aspect-ratio: 1;
  min-width: 0;
  border-radius: 2px;
  background: var(--contrib-0);
  transition: transform 0.12s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.12s ease;
}
.ghx__cell[data-lvl="1"] { background: var(--contrib-1); }
.ghx__cell[data-lvl="2"] { background: var(--contrib-2); }
.ghx__cell[data-lvl="3"] { background: var(--contrib-3); }
.ghx__cell[data-lvl="4"] { background: var(--contrib-4); }
/* hover: the square lifts above its neighbours with a soft ring, position +
   z-index so the scaled cell is never clipped by the ones around it */
.ghx__cell:hover {
  position: relative;
  z-index: 1;
  transform: scale(1.28);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(0, 0, 0, 0.06),
    inset 0 0 0 1px rgb(255, 255, 255); /* crisp white edge on the hovered square */
}

/* ---- Snake easter egg (five fast clicks) ----
   While .is-game is on, the grid becomes a playfield: every cell resets to the
   empty board colour, the hover lift is suppressed, and transitions are killed
   so each tick lands crisply. Snake/head/food paint via data-game, scoped
   under .is-game so they out-specify the data-lvl colours underneath, which
   stay intact and reappear the moment the class is removed. */
.ghx__graph.is-game .ghx__cell {
  background: var(--contrib-0);
  transition: none;
}
.ghx__graph.is-game .ghx__cell:hover { transform: none; box-shadow: none; }
.ghx__graph.is-game .ghx__cell[data-game="snake"] { background: var(--contrib-3); }
.ghx__graph.is-game .ghx__cell[data-game="head"]  { background: var(--contrib-4); }
.ghx__graph.is-game .ghx__cell[data-game="food"]  { background: var(--snake-food); }
/* game over: the whole snake flushes red */
.ghx__graph.is-gameover .ghx__cell[data-game="snake"],
.ghx__graph.is-gameover .ghx__cell[data-game="head"] { background: var(--snake-food); }

/* cells cascade in column by column, like the graph filling up */
.ghx.is-open .ghx__cell {
  animation: ghx-cell 0.4s cubic-bezier(0.2, 0, 0, 1) backwards;
  animation-delay: var(--gd, 0ms);
}
@keyframes ghx-cell {
  from { opacity: 0; transform: scale(0.4); }
  to   { opacity: 1; transform: none; }
}

/* mute toggle, only shown during a Snake game (sits at the far right of the
   meta row, opposite the score); hidden on the resting card */
.ghx__mute {
  flex: none;
  display: none;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin: -4px -4px -4px 0; /* larger hit area without nudging the layout */
  padding: 0;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--text-faint);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.ghx__mute:hover { color: var(--text-muted); background: var(--surface-active); }
/* keyboard focus only, mouse clicks blur the button (JS) so no ring sticks */
.ghx__mute:focus { outline: none; }
.ghx__mute:focus-visible {
  outline: 2px solid var(--text-muted);
  outline-offset: 1px;
}
/* show the speaker-on glyph by default, the muted glyph when pressed */
.ghx__mute .ghx__ic-off { display: none; }
.ghx__mute[aria-pressed="true"] { color: var(--text-muted); }
.ghx__mute[aria-pressed="true"] .ghx__ic-on { display: none; }
.ghx__mute[aria-pressed="true"] .ghx__ic-off { display: inline; }

/* ---- Score-15 celebration toast (Easter egg inside the Easter egg) ----
   A note from George. On desktop it's a small toast sitting inside .ghx, placed
   BEFORE the card in the DOM so it paints behind it (no z-index needed): JS
   anchors it centred 8px below the card, and it slides down out from behind.
   On phones it's a top-of-screen notification banner (see the media query). */
.ghx-toast {
  position: absolute;
  left: 50%; /* JS overrides with the card's centre in px */
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: min(320px, calc(100vw - 32px));
  padding: 10px 12px;
  background: var(--surface);
  border: 0.5px solid var(--border-subtle);
  border-radius: 14px;
  corner-shape: superellipse(1.5);
  box-shadow: var(--shadow);
  opacity: 0;
  /* start tucked up behind the card (its bottom flush with the card's) */
  transform: translate(-50%, calc(-100% - 8px)) scale(0.96);
  transition: opacity 0.28s var(--ease),
              transform 0.42s cubic-bezier(0.3, 1.2, 0.4, 1);
  pointer-events: none; /* never intercepts the game */
}
.ghx-toast.is-in { opacity: 1; transform: translate(-50%, 0) scale(1); } /* rests 8px below the card */

.ghx-toast__icon { width: 38px; height: 38px; flex: none; border-radius: 9px; corner-shape: superellipse(1.5); object-fit: cover; }
.ghx-toast__body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ghx-toast__title { display: none; } /* the app-name line reads as a notification only on phones */
.ghx-toast__msg { font-size: var(--sm); line-height: 1.3; color: var(--text); }

/* phones: no hover anchor, present it as a centered sheet over a dimmer */
@media (hover: none), (max-width: 600px) {
  .ghx.is-open .ghx__backdrop { opacity: 1; pointer-events: auto; }
  .ghx__card {
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) translateY(12px) scale(0.95);
  }
  .ghx.is-open .ghx__card { transform: translate(-50%, -50%); }

  /* Snake needs room: while a game runs the card fills the phone (8px inset,
     still centred by the same translate) so swipe-steering can't overshoot
     onto the backdrop and dismiss it. The graph becomes the playfield -
     flexing to fill the tall card, its cells dropping the square ratio to
     tile 1fr rows/columns. JS sizes the row count to match (see buildBoard). */
  .ghx.is-open .ghx__card.is-playing {
    width: calc(100vw - 16px);
    max-width: none;
    height: calc(100dvh - 16px);
    overflow: hidden;
  }
  .ghx__card.is-playing .ghx__graph {
    flex: 1;
    min-height: 0;
    grid-auto-columns: 1fr;
    gap: 4px;
  }
  .ghx__card.is-playing .ghx__cell { aspect-ratio: auto; }
  /* larger mute control on phones, easier to read/hit over the full-screen game
     (the 24px glyph needs the button to grow past its default 22px so it fits) */
  .ghx__mute { width: 28px; height: 28px; }
  .ghx__mute svg { width: 24px; height: 24px; }

  /* score-15 toast becomes a real-feeling notification: a banner that slides
     down from the top of the screen, above the full-screen game (z-index) */
  .ghx-toast {
    z-index: 5;
    left: 8px;
    right: 8px;
    top: 8px;
    width: auto;
    max-width: none;
    padding: 12px 14px;
    border-radius: 18px;
    transform: translateY(calc(-100% - 16px)); /* parked above the screen edge */
    transition: opacity 0.3s var(--ease),
                transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .ghx-toast.is-in { transform: translateY(0); }
  /* body fills the banner width so "now" can sit flush to the far right */
  .ghx-toast__body { flex: 1; }
  .ghx-toast__title {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: var(--xs);
    font-weight: 600;
    color: var(--text-strong);
  }
  .ghx-toast__time { font-weight: 400; color: var(--text-faint); }
}

/* reduced motion: keep the toast, drop the travel, fade in place, no slide */
@media (prefers-reduced-motion: reduce) {
  .ghx-toast { transition-property: opacity; transition-duration: 0.2s; }
}

/* ---------- Link mini-cards ---------- */
/* Rich identity cards for LinkedIn / X / Gmail, an animated banner
   (gradient + drifting mesh + sweeping gleam), an avatar tucked over it,
   name, one fact and one action. Recreated from cami's hover cards. */
.lcx { position: fixed; inset: 0; z-index: 300; pointer-events: none; }

.lcx__card {
  position: absolute;
  left: var(--ax, 50%);
  top: var(--ay, 50%);
  /* rests 8px below its open spot and shrunk, cami's --hc-slide + scale(.95) */
  transform: translate(-50%, calc(-100% - 10px)) translateY(8px) scale(0.95);
  transform-origin: 50% 100%;
  width: 256px;
  max-width: calc(100vw - 32px);
  overflow: hidden;
  background: var(--surface);
  border: 0.5px solid var(--border-subtle);
  border-radius: 16px;
  corner-shape: superellipse(1.5);
  box-shadow: var(--shadow);
  opacity: 0;
  /* exit: quick fade, cami's hover-card-out */
  transition: opacity 0.1s ease-out, transform 0.1s ease-out;
}
.lcx.is-open .lcx__card {
  pointer-events: auto;
  opacity: 1;
  transform: translate(-50%, calc(-100% - 10px));
  /* enter: cami's hover-card-in curve */
  transition: opacity 0.16s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}
.lcx--below .lcx__card {
  transform: translate(-50%, 10px) translateY(-8px) scale(0.95);
  transform-origin: 50% 0%;
}
.lcx--below.is-open .lcx__card { transform: translate(-50%, 10px); }

/* animatable custom prop for the banner wipe */
@property --banner-reveal { syntax: "<number>"; inherits: false; initial-value: 1; }

/* --- banner --- */
.lcx__banner {
  position: relative;
  height: 48px;
  width: 100%;
  overflow: hidden;
  background: #020202;
  --gl: 75 211 164; /* gleam accent, set per brand */
}
.banner-reveal {
  position: absolute;
  inset: 0;
  /* a soft diagonal band wipes the banner in on open */
  -webkit-mask-image: linear-gradient(105deg, #000 calc(var(--banner-reveal) * 150% - 45%),
                      transparent calc(var(--banner-reveal) * 150% - 10%));
          mask-image: linear-gradient(105deg, #000 calc(var(--banner-reveal) * 150% - 45%),
                      transparent calc(var(--banner-reveal) * 150% - 10%));
  animation: banner-reveal 1.25s cubic-bezier(0.6, 0, 0.35, 1) both;
}
@keyframes banner-reveal { from { --banner-reveal: 0; } to { --banner-reveal: 1; } }

.banner-mesh {
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: overlay;
  animation: banner-mesh-in 0.7s 0.16s both;
}
@keyframes banner-mesh-in { from { opacity: 0; } to { opacity: 1; } }
.banner-mesh__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(16px);
  transform: translate(-50%, -50%);
}
.banner-mesh__blob--1 { width: 108px; height: 108px; top: 30%; left: 18%; background: radial-gradient(circle, #ffffffe6, #0000 62%); animation: banner-mesh-1 6.67s ease-in-out infinite; }
.banner-mesh__blob--2 { width: 112px; height: 112px; top: 64%; left: 44%; background: radial-gradient(circle, #ffffffc7, #0000 62%); animation: banner-mesh-2 8.67s ease-in-out infinite; }
.banner-mesh__blob--3 { width: 108px; height: 108px; top: 30%; left: 68%; background: radial-gradient(circle, #ffffffd1, #0000 62%); animation: banner-mesh-3 7.33s ease-in-out infinite; }
.banner-mesh__blob--4 { width: 104px; height: 104px; top: 66%; left: 88%; background: radial-gradient(circle, #ffffffa8, #0000 62%); animation: banner-mesh-4 9.33s ease-in-out infinite; }
@keyframes banner-mesh-1 { 0%,100% { transform: translate(calc(100px - 50%), -50%) scale(1); } 25% { transform: translate(-50%, calc(55px - 50%)) scale(1.21); } 50% { transform: translate(calc(-50% - 100px), -50%) scale(1.42); } 75% { transform: translate(-50%, calc(-50% - 55px)) scale(1.21); } }
@keyframes banner-mesh-2 { 0%,100% { transform: translate(calc(-50% - 105px), -50%) scale(1); } 25% { transform: translate(-50%, calc(-50% - 50px)) scale(1.18); } 50% { transform: translate(calc(105px - 50%), -50%) scale(1.36); } 75% { transform: translate(-50%, calc(50px - 50%)) scale(1.18); } }
@keyframes banner-mesh-3 { 0%,100% { transform: translate(calc(90px - 50%), -50%) scale(1); } 25% { transform: translate(-50%, calc(70px - 50%)) scale(1.2); } 50% { transform: translate(calc(-50% - 90px), -50%) scale(1.4); } 75% { transform: translate(-50%, calc(-50% - 70px)) scale(1.2); } }
@keyframes banner-mesh-4 { 0%,100% { transform: translate(calc(-50% - 85px), -50%) scale(1); } 25% { transform: translate(-50%, calc(-50% - 65px)) scale(1.22); } 50% { transform: translate(calc(85px - 50%), -50%) scale(1.44); } 75% { transform: translate(-50%, calc(65px - 50%)) scale(1.22); } }

.banner-gleam-group { position: absolute; top: -25%; bottom: -25%; left: 0; width: 0; pointer-events: none; }
.banner-gleam-group > span { position: absolute; top: 0; bottom: 0; mix-blend-mode: overlay; filter: blur(13px) url(#banner-gleam-noise); }
.banner-gleam-glow { left: -120px; width: 368px; filter: blur(22px) url(#banner-gleam-noise);
  background: linear-gradient(90deg, #0000 0%, rgb(var(--gl) / 0.16) 28%, rgb(var(--gl) / 0.35) 50%, rgb(var(--gl) / 0.16) 72%, #0000 100%); }
.banner-gleam-main { left: -70px; width: 208px;
  background: linear-gradient(90deg, #0000 0%, rgb(var(--gl) / 0.27) 28%, rgb(var(--gl) / 0.6) 50%, rgb(var(--gl) / 0.27) 72%, #0000 100%); }
.banner-gleam-a { animation: banner-gleam-a 1.25s cubic-bezier(0.6, 0, 0.35, 1) both; }
.banner-gleam-b { animation: banner-gleam-b 1.25s cubic-bezier(0.45, 0, 0.55, 1) both; }
@keyframes banner-gleam-a { 0% { opacity: 0; transform: translate(-170px) skew(-15deg); } 16% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(340px) skew(-15deg); } }
@keyframes banner-gleam-b { 0% { opacity: 0; transform: translate(-230px) skew(-15deg); } 20% { opacity: 1; } 82% { opacity: 1; } 100% { opacity: 0; transform: translate(390px) skew(-15deg); } }

/* --- card body --- */
.lcx__body { padding: 12px; }
.lcx__body--banner { padding: 0 12px 12px; }
.lcx__row { display: flex; align-items: center; gap: 12px; }
.lcx__avatar {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  corner-shape: superellipse(1.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--base);
  font-variation-settings: "wght" 600;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--avatar-bg, var(--ink));
}
.lcx__avatar--pop { position: relative; z-index: 1; margin-top: -24px; box-shadow: 0 0 0 4px var(--surface); }
/* real headshot: circular (LinkedIn style), photo fills the tile */
.lcx__avatar--photo { border-radius: 50%; corner-shape: round; background: none; overflow: hidden; box-shadow: 0 0 0 1px var(--surface); }
.lcx__avatar--photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* flat banner (photo or clean gradient): no dark fallback behind it, so a light
   banner never flashes dark during the reveal wipe or shows a dark bottom edge */
.lcx__banner--flat { background: transparent; }
.lcx__id { min-width: 0; flex: 1; }
.lcx__body--banner .lcx__id { margin-top: 6px; }
.lcx__name {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--sm);
  font-weight: 600; /* font-weight (not variation-settings) so it reliably renders bold, matching .ghx__name */
  color: var(--text);
  line-height: 1.2;
}
.lcx__name > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lcx__badge { flex-shrink: 0; } /* verified badge, to the right of the handle */
/* full description, no clamp; 4px below the name */
.lcx__handle { margin-top: 4px; font-size: var(--xs); color: var(--text-muted); line-height: 1.35; }
.lcx__meta { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lcx__stat { font-size: var(--xs); color: var(--text-faint); }
.lcx__cta {
  position: relative;
  overflow: hidden; /* clip the load shine to the pill */
  flex-shrink: 0;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: var(--2xs);
  font-variation-settings: "wght" 500;
  white-space: nowrap;
  background: var(--cta-bg, var(--ink));
  color: var(--cta-fg, #fff);
  transition: opacity 0.15s var(--ease);
}
.lcx__cta:hover { opacity: 0.9; }
/* one-time light sweep across the button on card open, consistent across every
   card. The email --send button is already covered by the note's full-card
   shine, so it opts out here to avoid a double sweep. */
.lcx__cta:not(.lcx__cta--send)::after,
.ghx.is-open .ghx__visit::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 34%, rgba(255, 255, 255, 0.5) 50%, transparent 66%);
  transform: translateX(-130%) skewX(-14deg);
  animation: cta-shine 1s cubic-bezier(0.35, 0, 0.2, 1) 0.3s 1 both;
}
@keyframes cta-shine {
  0%   { transform: translateX(-130%) skewX(-14deg); }
  100% { transform: translateX(230%) skewX(-14deg); }
}

/* --- email draft card: an editable note whose Send pre-fills the visitor's
   own mail app with whatever it currently says --- */
.lcx__draft {
  position: relative; /* anchors the load shine */
  padding: 14px 16px 13px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.lcx__draft-paper { font-size: var(--sm); line-height: 1.5; color: var(--text); }
.lcx__draft-paper p { margin: 0; }
.lcx__draft-hi { color: var(--text-lead); font-variation-settings: "wght" 560; margin-bottom: 7px; }

/* the editable message, no field chrome at all, just an open caret to type
   into (overrides the global :focus-visible outline; the caret marks focus) */
.lcx__draft-msg,
.lcx__draft-msg:focus,
.lcx__draft-msg:focus-visible { outline: none; }
/* unfocused, a caret keeps blinking where the note trails off, an invitation
   to edit; the browser's real caret takes over on focus */
.lcx__draft-msg:not(:focus)::after {
  content: "";
  display: inline-block;
  width: 1.5px;
  height: 1.05em;
  margin-left: 1.5px;
  vertical-align: -0.18em;
  background: currentColor;
  animation: lcx-caret 1.05s steps(1) infinite;
}
@keyframes lcx-caret { 50% { opacity: 0; } }

.lcx__cta--send { align-self: flex-end; } /* bottom-right, like every card button */

/* load shine: a light streak sweeps across the note and on over the button,
   once, each time the card opens (it's rebuilt per open, so it replays) */
.lcx__shine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 45%;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.72), transparent);
  transform: translateX(-160%) skewX(-14deg);
  animation: lcx-shine 1.05s cubic-bezier(0.35, 0, 0.2, 1) 0.18s 1 both;
}
@keyframes lcx-shine {
  0%   { transform: translateX(-160%) skewX(-14deg); opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { transform: translateX(360%) skewX(-14deg); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .banner-reveal { -webkit-mask-image: none; mask-image: none; }
  .banner-mesh { opacity: 1; }
  .banner-reveal, .banner-mesh, .banner-mesh__blob,
  .banner-gleam-a, .banner-gleam-b { animation: none; }
  .lcx__shine { display: none; }
  .lcx__cta::after, .ghx.is-open .ghx__visit::after { display: none; }
  .lcx__draft-msg:not(:focus)::after { animation: none; }
}

/* ---------- Selection ---------- */
/* Highlighting sits under a soft gray, text stays dark and legible. */
::selection { background: var(--gray-15); color: var(--text-strong); }

/* Highlight-to-katakana pill: pops above the selection with a phonetic reading.
   Ink pill, inverse text, a Japanese font stack for the kana. Decorative and
   pointer-transparent; JS positions it (fixed) and toggles .is-on. */
/* One tooltip pill for the whole page: the katakana selection tip and the GitHub
   contribution-square hover tip share this so the hover experience is consistent.
   The kana tip layers a kana-friendly face on top; the GitHub tip keeps the Latin
   default. Both are fixed pills that sit centred above their anchor point. */
.kata-tip,
.gh-tip {
  position: fixed;
  z-index: 60;
  transform: translate(-50%, calc(-100% + 4px));
  padding: 5px 10px;
  max-width: 80vw;
  border-radius: 999px;
  background: var(--ink);
  color: var(--text-inverse);
  font-size: var(--2xs);
  line-height: 1.3;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: var(--shadow);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.14s var(--ease), transform 0.18s cubic-bezier(0.2, 0, 0, 1);
}
/* kana pill only: a face that renders katakana cleanly */
.kata-tip { font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif; }
/* the squares live inside the GitHub card overlay (z-index 300), so their tip
   has to clear it, unlike the kana tip which only rides body-text selections */
.gh-tip { z-index: 500; }
.kata-tip.is-on,
.gh-tip.is-on { opacity: 1; transform: translate(-50%, -100%); }
@media (prefers-reduced-motion: reduce) {
  .kata-tip,
  .gh-tip { transform: translate(-50%, -100%); transition: opacity 0.14s var(--ease); }
}

/* sonar ping spawned at the pointer on an empty-background click.
   The element is a ring-shaped lens: a radial mask limits it to an annular
   band, and backdrop-filter blurs whatever page content sits behind that band -
   so as it scales outward the wavefront visibly ripples/blurs the content it
   passes over. A faint tint keeps the ring readable over flat areas too. */
.sonar {
  position: fixed;
  z-index: 400;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform, opacity;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  background: radial-gradient(closest-side, transparent 52%, rgba(120, 120, 120, 0.12) 64%, transparent 82%);
  -webkit-mask: radial-gradient(closest-side, transparent 46%, #000 56%, #000 80%, transparent 92%);
  mask: radial-gradient(closest-side, transparent 46%, #000 56%, #000 80%, transparent 92%);
}

/* ---------- Focus / reduced motion ---------- */
:focus-visible { outline: 2px solid var(--text-muted); outline-offset: 2px; border-radius: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  ::view-transition-group(*),
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none !important; }
  /* keep the hover ring for feedback, but drop the scale so nothing moves */
  .ghx__cell:hover { transform: none; }
}

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
  .shell { padding: 80px 24px; } /* cami py-20 on small screens */
  .col { gap: 40px; }
  .hovercard { max-width: min(280px, calc(100vw - 48px)); }
  .hovercard__thumb { width: 100%; }

  .signature { width: 116px; }

  /* The narrow column can't fit the signature beside the links, on desktop it
     shares their row (to the right) and scrolls behind them, but here it just
     overlaps the last link. So stack it on its own line right above the
     Elsewhere row: flex `order` lifts it past the (still-sticky) linkbar, with
     the intro pinned above both. */
  .intro   { order: -2; }
  .signoff {
    order: -1;
    align-self: flex-start;   /* left edge, in line with the prose + links below */
    align-items: flex-start;
    margin-top: 0;            /* was -72px: don't rise onto the links' row */
    margin-bottom: -24px;     /* draw the links up snug beneath the signature */
  }

  .linkbar { top: 8px; gap: 6px 14px; }
  .linkbar__link { font-size: var(--sm); }

  /* case study */
  .shell:has(.col--case) { padding-top: 92px; } /* clear the fixed back button */
  .case-hero { padding-top: 0; }
  .case-next { padding: 16px 0; }

  /* fingers need bigger rows than cursors */
  .xp__card { padding: 12px 14px; margin: 0 -14px; }
  .hl__card { padding: 14px; margin: 0 -14px; }
}

/* ============================================================
   "Must read!" badge + border-beam
   A quiet white pill (grey text, 8px corners) sitting inside a warm glow
   that breathes. Ported from border-beam 1.3.0, preset "pulse-outside"
   with the sunset palette at strength 0.7. Nothing rotates: eight spikes
   sit around the pill on their own periods and swell, fade and wander,
   so the halo never repeats cleanly.

   The structure mirrors the library's <BorderBeam><Card/></BorderBeam>:
   .badge--mustread is the WRAPPER and paints nothing itself, .badge__card
   is the opaque pill. That split is load-bearing, not tidiness. The two
   glow layers sit at z-index -1, which in the wrapper's stacking context
   paints them above the wrapper's own background but below its content.
   Give the wrapper the white fill and the glow floods the pill; give it to
   the card and the glow can only show where it spills past the card's
   edge, which is the whole point of "outside".

     ::before       the core, a tight bloom just beyond the pill
     ::after        the coloured stroke riding the pill's own edge
     .badge__bloom  the wide halo past that
     .badge__card   the opaque pill, painted over all of it

   Colour comes from --beam-sunset-1..8, motion and weight from
   --beam-breathe/-strength and the three per-layer opacities.
   ============================================================ */

/* Every spike reads its size, wander and opacity from these, and they all
   INHERIT, so the three layers share one clock and stay in register. The
   library drives them from a shared 30fps requestAnimationFrame loop, to
   survive browsers without @property; here they are plain CSS animations,
   which needs no JS on a site that ships none, runs off the main thread
   and pauses itself with the rest of the page. The waveform matches: the
   library oscillates on a raised cosine, (1 - cos(2*PI*t)) / 2, and an
   ease-in-out keyframe running a → b → a over one period traces the same
   curve. w/h scale a spike, x/y wander it, gh breathes all their heights
   together, hue walks the whole colour circle.

   The library's four per-corner opacity oscillators are absent on purpose:
   at theme "light" their preset amplitude is 0, so they hold at 1 forever
   and only cost frames. */
@property --bb-w1  { syntax: "<number>"; inherits: true; initial-value: 1; }
@property --bb-h1  { syntax: "<number>"; inherits: true; initial-value: 1; }
@property --bb-w2  { syntax: "<number>"; inherits: true; initial-value: 1; }
@property --bb-h2  { syntax: "<number>"; inherits: true; initial-value: 1; }
@property --bb-w3  { syntax: "<number>"; inherits: true; initial-value: 1; }
@property --bb-h3  { syntax: "<number>"; inherits: true; initial-value: 1; }
@property --bb-x1  { syntax: "<length>"; inherits: true; initial-value: 0px; }
@property --bb-y1  { syntax: "<length>"; inherits: true; initial-value: 0px; }
@property --bb-x2  { syntax: "<length>"; inherits: true; initial-value: 0px; }
@property --bb-y2  { syntax: "<length>"; inherits: true; initial-value: 0px; }
@property --bb-x3  { syntax: "<length>"; inherits: true; initial-value: 0px; }
@property --bb-y3  { syntax: "<length>"; inherits: true; initial-value: 0px; }
@property --bb-gh  { syntax: "<number>"; inherits: true; initial-value: 1; }
@property --bb-hue { syntax: "<angle>";  inherits: true; initial-value: 0deg; }

.badge {
  display: inline-flex;
  align-items: center;
  font-size: var(--2xs);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
}

/* The wrapper. No fill, no border, no padding: it exists to anchor the glow
   and run the clock. overflow stays visible so the halo can leave the box. */
.badge--mustread {
  position: relative;
  isolation: isolate;
  overflow: visible;
  border-radius: var(--r-md);      /* 8px */
  /* Periods are the library's, each a multiple of the breathe unit. Coprime
     enough that the spikes drift apart and the loop never visibly restarts. */
  animation:
    bb-w1  calc(var(--beam-breathe) * 1.80) ease-in-out infinite,
    bb-h1  calc(var(--beam-breathe) * 2.52) ease-in-out infinite,
    bb-x1  calc(var(--beam-breathe) * 2.57) ease-in-out infinite,
    bb-y1  calc(var(--beam-breathe) * 2.57) ease-in-out infinite,
    bb-w2  calc(var(--beam-breathe) * 2.20) ease-in-out infinite,
    bb-h2  calc(var(--beam-breathe) * 1.62) ease-in-out infinite,
    bb-x2  calc(var(--beam-breathe) * 3.02) ease-in-out infinite,
    bb-y2  calc(var(--beam-breathe) * 3.02) ease-in-out infinite,
    bb-w3  calc(var(--beam-breathe) * 1.96) ease-in-out infinite,
    bb-h3  calc(var(--beam-breathe) * 2.80) ease-in-out infinite,
    bb-x3  calc(var(--beam-breathe) * 2.33) ease-in-out infinite,
    bb-y3  calc(var(--beam-breathe) * 2.33) ease-in-out infinite,
    bb-gh  calc(var(--beam-breathe) * 1.65) ease-in-out infinite,
    bb-hue calc(var(--beam-breathe) * 6.09) linear infinite;
}

/* The pill. Opaque, and last in paint order, so the two glow layers below it
   show only where they spill past this edge. */
.badge__card {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border-radius: var(--r-md);
  color: var(--text-strong);       /* dark text */
  background: var(--surface);      /* white, and it must stay opaque */
  /* 1.3.0's pulse-outside paints no hairline of its own: the coloured stroke
     rides the wrapped element's border rather than doubling it. This is that
     border, so it has to stay. */
  border: 0.5px solid var(--border);
  letter-spacing: 0.01em;
}

/* The eight spikes, shared by the stroke and the core. Sizes are the
   library's, scaled by --pulse-glow-sx/sy the way it scales them for a small
   element; positions sit on the perimeter and wander by --bb-x/y. */
.badge--mustread::before,
.badge--mustread::after {
  content: "";
  position: absolute;
  pointer-events: none;
  will-change: opacity, filter;
  background:
    radial-gradient(ellipse
      calc(80px * var(--bb-w1) * var(--pulse-glow-sx))
      calc(19px * var(--bb-h1) * var(--bb-gh) * var(--pulse-glow-sy))
      at calc(27%  + var(--bb-x1)) calc(0%   + var(--bb-y1)),
      var(--beam-sunset-1), transparent),
    radial-gradient(ellipse
      calc(74px * var(--bb-w2) * var(--pulse-glow-sx))
      calc(11px * var(--bb-h2) * var(--bb-gh) * var(--pulse-glow-sy))
      at calc(73%  + var(--bb-x2)) calc(-1%  + var(--bb-y2)),
      var(--beam-sunset-2), transparent),
    radial-gradient(ellipse
      calc(15px * var(--bb-w3) * var(--pulse-glow-sx))
      calc(44px * var(--bb-h3) * var(--bb-gh) * var(--pulse-glow-sy))
      at calc(100% + var(--bb-x3)) calc(33%  + var(--bb-y3)),
      var(--beam-sunset-3), transparent),
    radial-gradient(ellipse
      calc(19px * var(--bb-w1) * var(--pulse-glow-sx))
      calc(38px * var(--bb-h1) * var(--bb-gh) * var(--pulse-glow-sy))
      at calc(101% + var(--bb-x1)) calc(72%  + var(--bb-y1)),
      var(--beam-sunset-4), transparent),
    radial-gradient(ellipse
      calc(84px * var(--bb-w2) * var(--pulse-glow-sx))
      calc(13px * var(--bb-h2) * var(--bb-gh) * var(--pulse-glow-sy))
      at calc(67%  + var(--bb-x2)) calc(100% + var(--bb-y2)),
      var(--beam-sunset-5), transparent),
    radial-gradient(ellipse
      calc(60px * var(--bb-w3) * var(--pulse-glow-sx))
      calc(21px * var(--bb-h3) * var(--bb-gh) * var(--pulse-glow-sy))
      at calc(24%  + var(--bb-x3)) calc(101% + var(--bb-y3)),
      var(--beam-sunset-6), transparent),
    radial-gradient(ellipse
      calc(17px * var(--bb-w1) * var(--pulse-glow-sx))
      calc(40px * var(--bb-h1) * var(--bb-gh) * var(--pulse-glow-sy))
      at calc(0%   + var(--bb-x1)) calc(60%  + var(--bb-y1)),
      var(--beam-sunset-7), transparent),
    radial-gradient(ellipse
      calc(13px * var(--bb-w2) * var(--pulse-glow-sx))
      calc(32px * var(--bb-h2) * var(--bb-gh) * var(--pulse-glow-sy))
      at calc(-1%  + var(--bb-x2)) calc(28%  + var(--bb-y2)),
      var(--beam-sunset-8), transparent);
}

/* The stroke: the same spikes clipped to a 1px ring on the pill's own edge.
   Sits above the card, the one layer that is not "outside". */
.badge--mustread::after {
  inset: 0;
  z-index: 2;
  border-radius: var(--r-md);
  padding: 1px;
  clip-path: inset(0 round var(--r-md));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
          mask-composite: exclude;
  /* 1.96 is the library's light-theme weight. It overdrives past 1 on purpose,
     so the stroke still reads at full after strength scales it down. */
  opacity: calc(1.96 * var(--beam-stroke-opacity) * var(--beam-strength));
  filter: hue-rotate(var(--bb-hue)) brightness(1.7) saturate(0.6);
}

/* The core: the same spikes, unclipped, pushed just past the pill and blurred.
   z-index -1 puts it behind .badge__card, so only the spill shows. */
.badge--mustread::before {
  inset: var(--beam-core-inset);
  z-index: -1;
  border-radius: calc(var(--r-md) - var(--beam-core-inset));
  transform: scale(0.95, 0.9);
  opacity: calc(1.04 * var(--beam-inner-opacity) * var(--beam-strength));
  filter: blur(var(--beam-core-blur)) hue-rotate(var(--bb-hue))
          brightness(1.7) saturate(0.6);
}

/* The halo: wider, softer, and one spike lighter than the other two layers
   (the library drops the gold at this radius). Sizes are its bloom set, not
   the core set scaled up. */
.badge__bloom {
  position: absolute;
  inset: var(--beam-bloom-inset);
  z-index: -1;
  border-radius: calc(var(--r-md) - var(--beam-bloom-inset));
  pointer-events: none;
  will-change: transform;
  transform: scale(0.95, 0.9);
  background:
    radial-gradient(ellipse calc(110px * var(--pulse-glow-sx)) calc(30px * var(--pulse-glow-sy))
      at 27% 3%,   var(--beam-sunset-1), transparent),
    radial-gradient(ellipse calc(100px * var(--pulse-glow-sx)) calc(20px * var(--pulse-glow-sy))
      at 73% 1%,   var(--beam-sunset-2), transparent),
    radial-gradient(ellipse calc(26px  * var(--pulse-glow-sx)) calc(62px * var(--pulse-glow-sy))
      at 100% 33%, var(--beam-sunset-3), transparent),
    radial-gradient(ellipse calc(30px  * var(--pulse-glow-sx)) calc(56px * var(--pulse-glow-sy))
      at 101% 72%, var(--beam-sunset-4), transparent),
    radial-gradient(ellipse calc(120px * var(--pulse-glow-sx)) calc(22px * var(--pulse-glow-sy))
      at 67% 99%,  var(--beam-sunset-5), transparent),
    radial-gradient(ellipse calc(88px  * var(--pulse-glow-sx)) calc(32px * var(--pulse-glow-sy))
      at 24% 99%,  var(--beam-sunset-6), transparent),
    radial-gradient(ellipse calc(28px  * var(--pulse-glow-sx)) calc(58px * var(--pulse-glow-sy))
      at 0% 60%,   var(--beam-sunset-7), transparent);
  opacity: calc(0.42 * var(--beam-bloom-opacity) * var(--beam-strength));
  filter: blur(var(--beam-bloom-blur)) hue-rotate(var(--bb-hue))
          brightness(1.7) saturate(0.6);
}

/* On the hub project row, a 4px gap sits between the arrow icon and the badge. */
.hl__title .badge--mustread { margin-left: 12px; }

/* On the reel, the badge sits inline beside the project title. */
.reel__head { display: flex; align-items: center; gap: 10px; }

/* Each pair is the library's own a → b endpoints. Scales run raw; wander is
   multiplied by --beam-drift, since the raw values are tuned for a card many
   times this pill's size. */
@keyframes bb-w1 { 0%, 100% { --bb-w1: 0.640; } 50% { --bb-w1: 1.396; } }
@keyframes bb-h1 { 0%, 100% { --bb-h1: 1.324; } 50% { --bb-h1: 0.694; } }
@keyframes bb-w2 { 0%, 100% { --bb-w2: 1.360; } 50% { --bb-w2: 0.694; } }
@keyframes bb-h2 { 0%, 100% { --bb-h2: 0.712; } 50% { --bb-h2: 1.378; } }
@keyframes bb-w3 { 0%, 100% { --bb-w3: 0.784; } 50% { --bb-w3: 1.414; } }
@keyframes bb-h3 { 0%, 100% { --bb-h3: 1.270; } 50% { --bb-h3: 0.640; } }
@keyframes bb-gh { 0%, 100% { --bb-gh: 0.420; } 50% { --bb-gh: 1.580; } }

@keyframes bb-x1 {
  0%, 100% { --bb-x1: calc(-19.00px * var(--beam-drift)); }
  50%      { --bb-x1: calc( 17.10px * var(--beam-drift)); }
}
@keyframes bb-y1 {
  0%, 100% { --bb-y1: calc( 10.45px * var(--beam-drift)); }
  50%      { --bb-y1: calc(-13.30px * var(--beam-drift)); }
}
@keyframes bb-x2 {
  0%, 100% { --bb-x2: calc( 15.20px * var(--beam-drift)); }
  50%      { --bb-x2: calc(-17.10px * var(--beam-drift)); }
}
@keyframes bb-y2 {
  0%, 100% { --bb-y2: calc(-19.00px * var(--beam-drift)); }
  50%      { --bb-y2: calc( 12.35px * var(--beam-drift)); }
}
@keyframes bb-x3 {
  0%, 100% { --bb-x3: calc(-11.40px * var(--beam-drift)); }
  50%      { --bb-x3: calc( 19.00px * var(--beam-drift)); }
}
@keyframes bb-y3 {
  0%, 100% { --bb-y3: calc(-16.15px * var(--beam-drift)); }
  50%      { --bb-y3: calc(  8.55px * var(--beam-drift)); }
}

/* One full circle, so the palette is never pinned to fixed edges. Linear and
   unlooped at 0/360, unlike the others, which is why it is not a → b → a. */
@keyframes bb-hue { from { --bb-hue: 0deg; } to { --bb-hue: 360deg; } }

/* Reduced motion: the library stops every layer and leaves the glow standing,
   rather than removing it. The oscillators rest at 1 and the drift at 0, so
   what remains is the halo at its neutral size, unmoving. */
@media (prefers-reduced-motion: reduce) {
  .badge--mustread,
  .badge--mustread::before,
  .badge--mustread::after,
  .badge__bloom { animation: none !important; }
}
