/* ==========================================================================
   components.css · Paatni portfolio design system · v0.2
   Needs tokens.css first. Cascade layers keep specificity predictable:
   reset < base < type < components < utilities. Unlayered page CSS wins over
   all of them, so scope page rules with their own prefix.
   Rules: radius is always 0 · state selectors accept a forcing class
   (.is-hover .is-focus .is-active .is-disabled) so docs can show every state.
   Red = emphasis. Blue = what you can act on or type into.
   ========================================================================== */

@layer reset, base, type, components, utilities;

/* ---------- reset ------------------------------------------------------ */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; border-radius: var(--radius-default); }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ul, ol, pre { margin: 0; }
  img, svg, video, canvas { display: block; max-inline-size: 100%; }
  /* A photo keeps its own ratio: when the column is narrower than the image, the height follows the width instead of the height attribute. */
  img { block-size: auto; }
  button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
  button { background: none; border: 0; padding: 0; cursor: pointer; }
  textarea { resize: none; }
  [hidden] { display: none !important; }
}

/* ---------- base ------------------------------------------------------- */
@layer base {
  /* Hidden hover cards and tooltips keep their box while invisible; clip so they can never widen the page on a phone.
     (clip, not hidden: no scroll container, so position: sticky still works.) Shown cards are moved on screen by script. */
  html { overflow-x: clip; }
  body {
    min-block-size: 100dvh;
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    font: var(--text-body);
    letter-spacing: var(--text-body-ls);
    font-synthesis: none; /* never fake a weight or a style */
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }
  ::selection { background: var(--color-highlight-testimonial); color: var(--color-text-primary); }
  :focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-ring-offset); }
  :focus:not(:focus-visible) { outline: none; }
  .is-focus { outline: var(--focus-ring); outline-offset: var(--focus-ring-offset); }
  a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
  /* Text link: one pattern for every link in text and every link-style button.
     At rest: the text's own colour, a faint line under it, weight --link-weight.
     On hover or focus: the faint line slides out to the right while a blue line slides in from the left on exactly
     the same line (both are drawn the same way, so they always sit at the same height), the text turns blue and gains
     a little weight, and the icon slides out and back in. When an icon follows the words, wrap the words in
     .link__text so the lines run under the words only. */
  :is(.link, :where(p, li, dd, blockquote, figcaption) a:not([class])) {
    --link-lines: linear-gradient(var(--color-accent-2-text), var(--color-accent-2-text)) 0 calc(100% - 0.04em) / 0% 2px no-repeat,
      linear-gradient(var(--link-rest), var(--link-rest)) 100% calc(100% - 0.04em) / 100% 1px no-repeat;
    --link-rest: color-mix(in srgb, var(--color-text-primary) 30%, transparent);
    color: inherit; font-weight: var(--link-weight); text-decoration: none; background: var(--link-lines);
    transition: background-size var(--motion-duration-base) var(--motion-easing-out), color var(--motion-duration-fast) var(--motion-easing-standard), font-weight var(--motion-duration-fast) var(--motion-easing-standard), letter-spacing var(--motion-duration-fast) var(--motion-easing-standard);
  }
  .link:has(> .link__text) { background: none; }
  .link__text { background: var(--link-lines); transition: background-size var(--motion-duration-base) var(--motion-easing-out); }
  :is(.link, :where(p, li, dd, blockquote, figcaption) a:not([class])):is(:hover, :focus-visible, .is-hover) { color: var(--color-accent-2-text); font-weight: var(--link-weight-hover); letter-spacing: var(--link-hover-tracking); }
  :is(.link:not(:has(> .link__text)), :where(p, li, dd, blockquote, figcaption) a:not([class])):is(:hover, :focus-visible, .is-hover),
  .link:is(:hover, :focus-visible, .is-hover) > .link__text { background-size: 100% 2px, 0% 1px; }
  :is(.link, :where(p, li, dd, blockquote, figcaption) a:not([class])) .icon { display: inline-block; vertical-align: -0.14em; margin-inline-start: 0.3em; }
  :is(.link, :where(p, li, dd, blockquote, figcaption) a:not([class])):is(:hover, :focus-visible, .is-hover) .icon:is([data-dir="up-right"], :not([data-dir])) { animation: icon-xy var(--motion-duration-slow) var(--motion-easing-out); }
  :is(.link, :where(p, li, dd, blockquote, figcaption) a:not([class])):is(:hover, :focus-visible, .is-hover) .icon[data-dir="right"] { animation: icon-x var(--motion-duration-slow) var(--motion-easing-out); }
  hr { border: 0; border-block-start: var(--border-subtle); margin: 0; }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
  }
}

/* ---------- type ------------------------------------------------------- */
@layer type {
  :where(h1), .t-h1 { font: var(--text-h1); letter-spacing: var(--text-h1-ls); }
  :where(h2), .t-h2 { font: var(--text-h2); letter-spacing: var(--text-h2-ls); }
  :where(h3), .t-h3 { font: var(--text-h3); letter-spacing: var(--text-h3-ls); }
  :where(h4), .t-h4 { font: var(--text-h4); letter-spacing: var(--text-h4-ls); }
  :where(h5), .t-h5 { font: var(--text-h5); letter-spacing: var(--text-h5-ls); }
  :where(h6), .t-h6 { font: var(--text-h6); letter-spacing: var(--text-h6-ls); }
  :where(h1, h2, h3, h4, h5, h6, .t-h1, .t-h2, .t-h3, .t-h4, .t-h5, .strength__title, .card-project__title, .testimonial__name) { text-wrap: balance; }
  .t-display { font: var(--text-display); letter-spacing: var(--text-display-ls); text-wrap: balance; }
  .t-body-lg { font: var(--text-body-lg); letter-spacing: var(--text-body-lg-ls); }
  .t-body { font: var(--text-body); letter-spacing: var(--text-body-ls); }
  .t-body-sm { font: var(--text-body-sm); letter-spacing: var(--text-body-sm-ls); }
  .t-caption { font: var(--text-caption); letter-spacing: var(--text-caption-ls); }
  .t-button { font: var(--text-button); letter-spacing: var(--text-button-ls); }
  .t-label { font: var(--text-label); letter-spacing: var(--text-label-ls); }
  .t-meta { font: var(--text-meta); letter-spacing: var(--text-meta-ls); }
  .t-mono-ui { font: var(--text-mono-ui); letter-spacing: var(--text-mono-ui-ls); }
  .t-data-xl { font: var(--text-data-xl); letter-spacing: var(--text-data-xl-ls); font-variant-numeric: tabular-nums; }
  .t-data-md { font: var(--text-data-md); letter-spacing: var(--text-data-md-ls); font-variant-numeric: tabular-nums; }
  :where(p) { max-inline-size: var(--measure-body); }
  :where(p, li, dd, figcaption, blockquote) { text-wrap: pretty; }
  /* Emphasis in body copy is weight (semibold) or a true Geist italic, never a second typeface. */
  :where(strong, b) { font-weight: var(--weight-semibold); }
  :where(em, i) { font-style: italic; }
  /* Pixel accent: a few letters or one word that works in your favour. One weight, no italic.
     Never a sentence, never a link, never body copy. */
  .px { font-family: var(--font-pixel); font-weight: 400; font-style: normal; letter-spacing: 0; font-synthesis: none; }
  :where(code, kbd, samp) { font-family: var(--font-mono); font-size: 0.9em; }
  .t-secondary { color: var(--color-text-secondary); }
  .t-tertiary { color: var(--color-text-tertiary); }
  .t-accent { color: var(--color-accent-text); }
}

/* ---------- components ------------------------------------------------- */
@layer components {

  /* icons: conventional shapes, square caps, mitred joins, currentColor */
  .icon { inline-size: var(--icon-md); block-size: var(--icon-md); flex: none; fill: none; stroke: currentColor; stroke-width: var(--icon-stroke); stroke-linecap: square; stroke-linejoin: miter; }
  .icon--sm { inline-size: var(--icon-sm); block-size: var(--icon-sm); }
  .icon--lg { inline-size: var(--icon-lg); block-size: var(--icon-lg); }

  /* motion primitives */
  @keyframes fade-in { from { opacity: 0; } }
  @keyframes rise-in { from { opacity: 0; transform: translateY(var(--motion-rise-distance)); } }
  @keyframes blink { 50% { opacity: 0; } }
  @keyframes px-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.15; } }
  @keyframes skeleton { to { background-position: -200% 0; } }

  .cursor-block::after { content: ""; display: inline-block; inline-size: 0.55em; block-size: 1em; margin-inline-start: 0.2em; vertical-align: -0.14em; background: currentColor; animation: blink var(--motion-cursor-blink) steps(1) infinite; }
  .px-loader { --s: 4px; display: inline-grid; grid-template-columns: repeat(3, var(--s)); gap: 2px; }
  .px-loader i { inline-size: var(--s); block-size: var(--s); background: currentColor; animation: px-blink 1200ms steps(1) infinite; }
  .px-loader i:nth-child(1) { animation-delay: 0ms; }
  .px-loader i:nth-child(2) { animation-delay: 130ms; }
  .px-loader i:nth-child(3) { animation-delay: 260ms; }
  .px-loader i:nth-child(6) { animation-delay: 390ms; }
  .px-loader i:nth-child(9) { animation-delay: 520ms; }
  .px-loader i:nth-child(8) { animation-delay: 650ms; }
  .px-loader i:nth-child(7) { animation-delay: 780ms; }
  .px-loader i:nth-child(4) { animation-delay: 910ms; }
  .px-loader i:nth-child(5) { animation-delay: 1040ms; }
  @media (prefers-reduced-motion: reduce) {
    .cursor-block::after, .px-loader i, .rec__dot, .skeleton, .cursor-label__caret { animation: none; }
  }

  /* ---- button ---------------------------------------------------------
     variants: primary · secondary · accent · blue · ghost · command · icon
     states:   hover · focus-visible · active · disabled · busy           */
  .btn {
    --btn-bg: transparent; --btn-fg: var(--color-text-primary); --btn-bd: var(--color-border-strong); --btn-shadow: none; --btn-move: 0px 0px;
    position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
    min-block-size: var(--control-md); padding-inline: var(--space-5);
    font: var(--text-button); letter-spacing: var(--text-button-ls);
    color: var(--btn-fg); background: var(--btn-bg); border: var(--border-width-hairline) solid var(--btn-bd); box-shadow: var(--btn-shadow);
    translate: var(--btn-move); text-decoration: none; white-space: nowrap; cursor: pointer; user-select: none;
    transition: background-color var(--motion-duration-fast) var(--motion-easing-standard), border-color var(--motion-duration-fast) var(--motion-easing-standard), color var(--motion-duration-fast) var(--motion-easing-standard), box-shadow var(--motion-duration-base) var(--motion-easing-out), translate var(--motion-duration-base) var(--motion-easing-out);
  }
  .btn:hover { color: var(--btn-fg); text-decoration: none; }
  .btn:is(:hover, .is-hover) { --btn-bg: var(--color-state-hover); }
  .btn:is(:active, .is-active) { --btn-bg: var(--color-state-active); --btn-move: 1px 1px; --btn-shadow: none; }
  /* Icons: on hover the icon slides out in its direction and back in from the opposite side, so it always ends
     centred on the label's line. The label and the button never move because of the icon. */
  .btn__icon { flex: none; }
  .btn:is(:hover, .is-hover, :focus-visible) .btn__icon:is([data-dir="right"], [data-dir="left"]) { animation: icon-x var(--motion-duration-slow) var(--motion-easing-out); }
  .btn:is(:hover, .is-hover, :focus-visible) .btn__icon[data-dir="left"] { animation-direction: reverse; }
  .btn:is(:hover, .is-hover, :focus-visible) .btn__icon[data-dir="down"] { animation: icon-y var(--motion-duration-slow) var(--motion-easing-out); }
  .btn:is(:hover, .is-hover, :focus-visible) .btn__icon:is([data-dir="up-right"], :not([data-dir])) { animation: icon-xy var(--motion-duration-slow) var(--motion-easing-out); }
  @keyframes icon-x { 0% { translate: 0 0; opacity: 1; } 42% { translate: 0.7em 0; opacity: 0; } 43% { translate: -0.7em 0; opacity: 0; } 100% { translate: 0 0; opacity: 1; } }
  @keyframes icon-y { 0% { translate: 0 0; opacity: 1; } 42% { translate: 0 0.7em; opacity: 0; } 43% { translate: 0 -0.7em; opacity: 0; } 100% { translate: 0 0; opacity: 1; } }
  @keyframes icon-xy { 0% { translate: 0 0; opacity: 1; } 42% { translate: 0.6em -0.6em; opacity: 0; } 43% { translate: -0.6em 0.6em; opacity: 0; } 100% { translate: 0 0; opacity: 1; } }

  .btn--primary { --btn-bg: var(--color-bg-inverse); --btn-fg: var(--color-text-inverse); --btn-bd: var(--color-bg-inverse); }
  .btn--primary:is(:hover, .is-hover) { --btn-bg: var(--color-bg-inverse); --btn-shadow: var(--elevation-signal-md); --btn-move: -2px -2px; }
  .btn--primary:is(:active, .is-active) { --btn-bg: var(--color-bg-inverse); --btn-move: 0px 0px; --btn-shadow: none; }
  .btn--accent { --btn-bg: var(--color-accent); --btn-fg: var(--color-on-accent); --btn-bd: var(--color-accent); }
  .btn--accent:is(:hover, .is-hover) { --btn-bg: var(--color-accent-hover); --btn-bd: var(--color-accent-hover); }
  .btn--accent:is(:active, .is-active) { --btn-bg: var(--color-accent-active); --btn-bd: var(--color-accent-active); }
  .btn--blue { --btn-bg: var(--color-accent-2); --btn-fg: var(--color-on-accent-2); --btn-bd: var(--color-accent-2); }
  .btn--blue:is(:hover, .is-hover) { --btn-bg: var(--color-accent-2-hover); --btn-bd: var(--color-accent-2-hover); }
  .btn--blue:is(:active, .is-active) { --btn-bg: var(--color-accent-2-active); --btn-bd: var(--color-accent-2-active); }
  .btn--ghost { --btn-bd: transparent; padding-inline: var(--space-3); font-weight: var(--link-weight); }
  .btn--ghost .btn__label { padding-block: 0.3em; background: linear-gradient(var(--color-accent-2-text), var(--color-accent-2-text)) 0 100% / 0% 2px no-repeat; transition: background-size var(--motion-duration-base) var(--motion-easing-out); }
  .btn--ghost:is(:hover, .is-hover, :focus-visible) { --btn-fg: var(--color-accent-2-text); font-weight: var(--link-weight-hover); letter-spacing: var(--link-hover-tracking); }
  .btn--ghost:is(:hover, .is-hover, :focus-visible) .btn__label { background-size: 100% 2px; }
  .btn--command { --btn-shadow: var(--elevation-hard-md); font: var(--text-mono-ui); letter-spacing: var(--text-mono-ui-ls); }
  .btn--command:is(:hover, .is-hover) { --btn-bg: transparent; --btn-shadow: var(--elevation-blue-md); }
  .btn--command:is(:active, .is-active) { --btn-move: 4px 4px; --btn-shadow: 0 0 0 var(--color-accent-2); }
  .btn--command .cursor-block::after { background: var(--color-accent-2); }
  .btn--icon { inline-size: var(--control-md); padding: 0; }
  .btn--sm { min-block-size: var(--control-sm); padding-inline: var(--space-4); }
  .btn--sm.btn--icon { inline-size: var(--control-sm); padding: 0; }
  .btn--lg { min-block-size: var(--control-lg); padding-inline: var(--space-6); }
  .btn:is(:disabled, [aria-disabled="true"], .is-disabled) { --btn-bg: transparent; --btn-fg: var(--color-text-disabled); --btn-bd: var(--color-border-subtle); --btn-shadow: none; --btn-move: 0px 0px; border-style: dashed; pointer-events: none; cursor: not-allowed; }
  .btn[aria-busy="true"] { pointer-events: none; }
  .btn[aria-busy="true"] .btn__label { opacity: 0.6; }

  /* ---- chip, key, placeholder, plate ---------------------------------- */
  .chip { display: inline-flex; align-items: center; gap: var(--space-1); min-block-size: 1.75rem; padding-inline: var(--space-2); border: var(--border-default); font: var(--text-meta); color: var(--color-text-secondary); text-decoration: none; }
  :is(a, button).chip { cursor: pointer; background: none; font: var(--text-meta); }
  :is(a, button).chip:hover { color: var(--color-text-primary); border-color: var(--color-border-strong); background: var(--color-state-hover); }
  /* status: what a project is (shipped, prototype, concept, independently built), said plainly on every card and case study */
  .chip--status { justify-self: start; inline-size: fit-content; gap: var(--space-2); color: var(--color-text-primary); }
  .chip--status::before { content: ''; flex: none; inline-size: 6px; block-size: 6px; background: var(--color-accent-2); }
  .kbd { display: inline-grid; place-items: center; min-inline-size: 1.75rem; block-size: 1.75rem; padding-inline: 0.4rem; border: var(--border-default); border-block-end-width: 2px; background: var(--color-bg-tertiary); color: var(--color-text-secondary); font: 500 var(--text-floor)/1 var(--font-mono); }
  .ph { display: inline-block; padding-inline: 0.4em; border: 1px dashed var(--color-border-default); background: var(--color-bg-secondary); color: var(--color-text-tertiary); font: var(--text-meta); }

  /* ---- segmented control (theme switch) ------------------------------ */
  .seg { display: inline-flex; border: var(--border-strong); }
  .seg > button { min-block-size: var(--control-sm); padding-inline: var(--space-3); font: var(--text-mono-ui); color: var(--color-text-secondary); }
  .seg > button + button { border-inline-start: var(--border-default); }
  .seg > button:hover { background: var(--color-state-hover); color: var(--color-text-primary); }
  .seg > button[aria-pressed="true"] { background: var(--color-bg-inverse); color: var(--color-text-inverse); }

  /* ---- frame, guides, section utility line ------------------------------
     The content column is centred with air on both sides. Dotted guides run
     down its edges; every section opens with a dotted utility line.        */
  .frame { position: relative; inline-size: min(100% - 2 * var(--layout-margin), var(--layout-content-width)); margin-inline: auto; }
  .frame--guides::before, .frame--guides::after { content: ""; position: absolute; z-index: 3; inset-block: 0; inline-size: 1px; background: var(--rule-dotted-v); pointer-events: none; } /* above anything that runs to the rails, such as the logo ticker */
  .frame--guides::before { inset-inline-start: 0; }
  .frame--guides::after { inset-inline-end: 0; }
  .frame__pad { padding-inline: var(--layout-frame-pad); }
  .section-line { display: flex; align-items: center; gap: var(--space-4); padding-block: var(--space-4); font: var(--text-meta); color: var(--color-text-tertiary); }
  .section-line__label { color: var(--color-text-primary); }
  .section-line__rule { flex: 1 1 1.5rem; min-inline-size: 1.5rem; block-size: 1px; background: var(--rule-dotted-h); }
  .section-line__meta { min-inline-size: 0; text-align: end; }
  .rule-h { block-size: 1px; background: var(--rule-dotted-h); }
  .rule-v { inline-size: 1px; background: var(--rule-dotted-v); }

  /* ---- dock: bottom-centre, icons only, label on hover or focus ------- */
  .dock { position: fixed; inset-inline: 0; inset-block-end: max(var(--space-4), env(safe-area-inset-bottom)); z-index: var(--z-dock); display: flex; justify-content: center; pointer-events: none; }
  .dock__list { pointer-events: auto; display: flex; margin: 0; padding: var(--space-1); list-style: none; background: var(--color-bg-primary); border: var(--border-strong); box-shadow: var(--elevation-hard-md); }
  .dock--static { position: static; }
  .dock__item { position: relative; }
  .dock__link { position: relative; display: grid; place-items: center; inline-size: var(--control-md); block-size: var(--control-md); color: var(--color-text-secondary); text-decoration: none; transition: color var(--motion-duration-fast) var(--motion-easing-standard), background-color var(--motion-duration-fast) var(--motion-easing-standard); }
  .dock__link:is(:hover, :focus-visible, .is-hover) { color: var(--color-text-primary); background: var(--color-state-hover); }
  .dock__link:is([aria-current="true"], [aria-current="page"], [aria-current="location"]) { color: var(--color-text-primary); }
  .dock__link .icon { stroke-width: var(--icon-stroke-light); transition: stroke-width var(--motion-duration-fast) var(--motion-easing-standard); }
  .dock__link:is([aria-current="true"], [aria-current="page"], [aria-current="location"], [aria-pressed="true"], :hover, :focus-visible, .is-hover, .dock__link--action) .icon { stroke-width: var(--icon-stroke); }
  .dock__link:is([aria-current="true"], [aria-current="page"], [aria-current="location"])::after { content: ""; position: absolute; inset-inline: 0.7rem; inset-block-end: 0.25rem; block-size: 2px; background: var(--color-accent); }
  @media (max-width: 63.99em) { .dock__item--palette { display: none; } }
  .dock__label { position: absolute; inset-block-end: calc(100% + 0.9rem); inset-inline-start: 50%; translate: -50% 6px; padding: var(--space-1) var(--space-2); background: var(--color-bg-inverse); color: var(--color-text-inverse); font: var(--text-meta); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity var(--motion-duration-base) var(--motion-easing-out), translate var(--motion-duration-base) var(--motion-easing-out); }
  .dock__link:is(:hover, :focus-visible, .is-hover) .dock__label { opacity: 1; translate: -50% 0; }
  .dock__link[aria-expanded="true"] .dock__label { opacity: 0; } /* its panel is open above it; the tooltip would peek out under the panel */
  .dock__sep { inline-size: 1px; margin-block: var(--space-2); margin-inline: var(--space-1); background: var(--color-border-subtle); }
  @media (hover: none) { .dock__label { display: none; } }
  /* Phones: the dock folds into one Menu button at the bottom centre; it opens a drawer (script toggles .is-open on .dock)
     listing every item with its label: theme, Home, the sections, Resume and the chatbot ("Yap with my AI"). */
  .dock__menu { display: none; }
  @media (max-width: 35.99em) {
    .dock { flex-direction: column; align-items: center; }
    .dock__menu { pointer-events: auto; display: inline-flex; align-items: center; gap: var(--space-2); min-block-size: 3rem; padding-inline: var(--space-5); background: var(--color-bg-primary); border: var(--border-strong); box-shadow: var(--elevation-hard-md); color: var(--color-text-primary); font: var(--text-button); cursor: pointer; }
    .dock__list { position: absolute; inset-inline: var(--space-4); inset-block-end: calc(100% + var(--space-2)); display: grid; grid-template-columns: minmax(0, 1fr); padding: var(--space-2); visibility: hidden; opacity: 0; translate: 0 1rem; clip-path: inset(100% 0 0 0);
      transition: translate var(--motion-duration-base) var(--motion-easing-out), clip-path var(--motion-duration-base) var(--motion-easing-out), opacity var(--motion-duration-fast) linear, visibility 0s linear var(--motion-duration-base); }
    .dock.is-open .dock__list { visibility: visible; opacity: 1; translate: 0 0; clip-path: inset(0 0 0 0); transition-delay: 0s; }
    .dock__item, .dock__item--section { display: block; }
    .dock__item--palette { display: none; } /* no Command K without a keyboard */
    .dock__link { display: flex; align-items: center; inline-size: 100%; justify-content: flex-start; gap: var(--space-3); padding-inline: var(--space-3); }
    .theme-toggle .dock__link { inline-size: var(--control-md); justify-content: center; padding-inline: 0; }
    .dock__label { display: inline; position: static; translate: none; opacity: 1; padding: 0; background: none; color: inherit; font: var(--text-button); }
    .dock__link:is([aria-current="true"], [aria-current="page"], [aria-current="location"])::after { inset-inline: 0 auto; inset-block: 25%; inline-size: 2px; block-size: auto; }
    .dock__sep { inline-size: auto; block-size: 1px; margin: var(--space-1) 0; }
  }
  /* Theme: a sun and a crescent moon, both always visible. A short blue line sits under the active one and slides to the other. */
  .theme-toggle { position: relative; display: flex; }
  .theme-toggle__btn[aria-pressed="true"] { color: var(--color-text-primary); }
  .theme-toggle__line { position: absolute; inset-block-end: 0.3rem; inset-inline-start: calc((var(--control-md) - 1.4rem) / 2); inline-size: 1.4rem; block-size: 2px; background: var(--color-accent-2-border); pointer-events: none; transition: translate var(--motion-duration-base) var(--motion-easing-out); }
  :root[data-theme="dark"] .theme-toggle__line { translate: var(--control-md) 0; }
  /* Command K is an action, not a place: it carries the accent colour and has no divider before it. */
  .dock__link--action { inline-size: auto; grid-auto-flow: column; gap: var(--space-2); padding-inline: var(--space-3); background: var(--color-accent); color: var(--color-on-accent); }
  .dock__kbd { font: var(--text-button); white-space: pre; }
  .dock__link--action:is(:hover, :focus-visible, .is-hover) { background: var(--color-accent-hover); color: var(--color-on-accent); }

  /* ---- command palette (Cmd/Ctrl + K) --------------------------------
     plain-language label leads; the terminal command is the quiet line    */
  .palette { position: fixed; inset: 0; z-index: var(--z-palette); display: grid; justify-items: center; align-content: start; padding: min(16vh, 8rem) var(--space-4) var(--space-4); }
  .palette__scrim { position: absolute; inset: 0; background: var(--color-scrim); -webkit-backdrop-filter: blur(var(--blur-scrim)); backdrop-filter: blur(var(--blur-scrim)); animation: fade-in var(--motion-duration-base) var(--motion-easing-out) both; }
  .palette__panel { position: relative; inline-size: min(100%, 38rem); background: var(--color-bg-primary); border: var(--border-strong); box-shadow: var(--elevation-hard-md); animation: rise-in var(--motion-duration-base) var(--motion-easing-out) both; }
  .palette__search { display: flex; align-items: center; gap: var(--space-3); padding-inline: var(--space-4); block-size: var(--control-lg); border-block-end: var(--border-subtle); color: var(--color-text-tertiary); }
  .palette__input { flex: 1; min-inline-size: 0; block-size: 100%; border: 0; background: none; outline: none; font: var(--text-body); color: var(--color-text-primary); caret-color: var(--color-accent-2); }
  .palette__input::placeholder { color: var(--color-text-tertiary); opacity: 1; }
  .palette__list { margin: 0; padding: var(--space-2); list-style: none; max-block-size: min(52vh, 24rem); overflow: auto; }
  .palette__group { padding: var(--space-3) var(--space-3) var(--space-1); font: var(--text-label); color: var(--color-text-tertiary); }
  .palette__item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--space-3); padding: var(--space-3); border-inline-start: 2px solid transparent; color: var(--color-text-secondary); cursor: pointer; }
  .palette__item[aria-selected="true"] { background: var(--color-state-hover); border-inline-start-color: var(--color-accent-2); color: var(--color-text-primary); }
  .palette__text { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; min-inline-size: 0; }
  .palette__label { font: var(--text-body); color: var(--color-text-primary); }
  .palette__cmd { font: var(--text-meta); color: var(--color-text-tertiary); }
  .palette__enter { opacity: 0; }
  .palette__item[aria-selected="true"] .palette__enter { opacity: 1; }
  .palette__empty { padding: var(--space-6) var(--space-4); color: var(--color-text-secondary); }
  .palette__foot { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); padding: var(--space-3) var(--space-4); border-block-start: var(--border-subtle); font: var(--text-meta); color: var(--color-text-tertiary); }
  .palette__foot span { display: inline-flex; align-items: center; gap: var(--space-2); }

  /* ---- section heading: title left, count or note right -------------- */
  .section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-2) var(--space-6); padding-block-end: var(--space-5); background: var(--rule-dotted-h) bottom / 100% 1px no-repeat; }
  .section-head__title { font: var(--text-h2); letter-spacing: var(--text-h2-ls); }
  .section-head__meta { font: var(--text-meta); color: var(--color-text-tertiary); }

  /* ---- project card --------------------------------------------------- */
  .card-project { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: var(--space-6); padding-block-end: var(--space-12); color: inherit; text-decoration: none; background: var(--rule-dotted-h) bottom / 100% 1px no-repeat; }
  .card-project:last-child { padding-block-end: 0; background: none; }
  /* The media slot never crops. A real image shows at its own ratio, shrunk to the column. Empty, it waits for your image. */
  .card-project__hero { display: block; }
  .card-project__hero img { display: block; inline-size: 100%; block-size: auto; }
  .card-project__hero--empty { aspect-ratio: var(--ratio-media); background: var(--color-bg-tertiary); }
  /* On phones the slot is 3:5, portrait. Send 3:5 images and nothing is cropped; any other ratio is cropped to fill. */
  @media (max-width: 47.99em) { .card-project__hero--empty, .card-project__hero--image { aspect-ratio: 3 / 5; } .card-project__hero--image img { block-size: 100%; object-fit: cover; } }
  /* Hero film: a launch film in the hero. 16:9 on tablets and up, 9:16 on phones (each its own cut, never cropped). Muted
     until the visitor asks. Three buttons sit together at the bottom right inside the hero: Pause / Play (Pause while it
     plays), then Replay (from the start, always there), then Sound (only when the film has a sound track). The rest of the hero
     stays part of the card's link (pointer events pass through to it). Script: [data-hero-video]. */
  .card-project__hero--video { z-index: 2; aspect-ratio: var(--hero-wide, 16 / 9); background: var(--color-bg-tertiary); pointer-events: none; }
  @media (max-width: 35.99em) { .card-project__hero--video { aspect-ratio: var(--hero-tall, 9 / 16); } }
  .card-project__video { display: block; inline-size: 100%; block-size: 100%; object-fit: cover; }
  .card-project__hold { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; } /* the current frame, held while a lower-quality file takes over */
  .card-project__hold[hidden] { display: none; }
  .hero-video__ctrls { position: absolute; inset-block-end: var(--space-3); inset-inline-end: var(--space-3); display: flex; gap: var(--space-2); pointer-events: auto; }
  .hero-video__ctrls > [hidden] { display: none; }
  /* over moving pictures the buttons are solid, not outlines: page colour, hairline border, the usual hover and press */
  .hero-video__ctrls .btn { --btn-bg: var(--color-bg-primary); }
  .hero-video__ctrls .btn:is(:hover, .is-hover) { --btn-bg: var(--color-bg-secondary); }
  .hero-video__ctrls .btn:is(:active, .is-active) { --btn-bg: var(--color-bg-tertiary); }
  .card-project:hover { color: inherit; }
  .card-project__body { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-6) var(--space-12); }
  /* grouping: the title and its line belong together (no gap; the title's own leading is the space), the CTA is a separate
     group, twice as far below (measured optically: about 17px then 34px on desktop, 13px then 26px on phones) */
  .card-project__head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; align-content: start; }
  .card-project__status { margin-block-end: var(--space-4); }
  .card-project__desc { margin-block-start: clamp(0.375rem, 0.35rem + 0.19vw, 0.55rem); } /* v0.9: 1.5x the old air (measured 25 / 50 px at 1440, 19.5 / 39 at 390) */
  .card-project__meta { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-3) var(--space-4); margin: 0; font: var(--text-meta); } /* phones: label and value side by side, rows apart by more than their own leading */
  .card-project__meta > div { display: contents; }
  .card-project__meta dd { margin: 0; }
  .card-project__meta dt { color: var(--color-text-tertiary); }
  .card-project__meta dd { color: var(--color-text-secondary); }
  .card-project__title { font: var(--text-h3); letter-spacing: var(--text-h3-ls); max-inline-size: var(--measure-heading); }
  .card-project__desc { font: var(--text-body); color: var(--color-text-secondary); max-inline-size: 52ch; }
  /* phones: more air between film, chip, title, text, facts and button, so the card reads as steps, not a block */
  @media (max-width: 47.99em) { .card-project { gap: var(--space-8); } .card-project__status { margin-block-end: var(--space-5); } .card-project__desc { margin-block-start: var(--space-4); } .card-project__body { row-gap: var(--space-8); } .card-project__meta { gap: var(--space-4) var(--space-5); } }
  /* desktop and tablet: title and description side by side, bottom aligned; then the links; then the facts on an aligned
     grid, each label above its value, four columns: project, type, industry, context, then role and timeline from the left
     on a second row; the buttons come last, under the facts (his call, 8 Nov). After the base rules, so it wins. */
  @media (min-width: 48em) {
    .card-project__body { row-gap: clamp(1.875rem, 1.72rem + 0.95vw, 2.6rem); }
    .card-project__head { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-areas: "status desc" "title desc"; grid-template-rows: 1fr auto; column-gap: clamp(2rem, 1rem + 4vw, 5rem); align-items: end; }
    .card-project__head > .card-project__status { grid-area: status; align-self: end; } /* sits on the title, the description beside both */ .card-project__head > .card-project__title { grid-area: title; } .card-project__head > .card-project__desc { grid-area: desc; margin-block-start: 0; }
    .card-project__meta { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-6) clamp(1.5rem, 0.5rem + 2.5vw, 3rem); }
    .card-project__meta > div { display: grid; align-content: start; gap: var(--space-1); }
  }
  /* The whole card is one link: the title's anchor is stretched over it, so a click anywhere opens the case study.
     The blue button is the same link drawn as a button, not a second control. A second action (.card-project__second)
     sits above the stretched link and opens its own destination. */
  .card-project { position: relative; cursor: pointer; }
  .card-project__stretch { padding-block-end: 0.06em; color: inherit; text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0% 2px no-repeat; transition: background-size var(--motion-duration-base) var(--motion-easing-out), color var(--motion-duration-fast) var(--motion-easing-standard); }
  .card-project__stretch::after { content: ""; position: absolute; inset: 0; z-index: 1; }
  .card-project__stretch:focus-visible { outline: none; }
  .card-project:has(.card-project__stretch:focus-visible) { outline: var(--focus-ring); outline-offset: 0.75rem; }
  .card-project:is(.is-title, .is-hover) .card-project__stretch, .card-project:has(.card-project__stretch:focus-visible) .card-project__stretch { background-size: 100% 2px; } /* only while the pointer is on the title's own words (script: .is-title); the title keeps its colour, an underline draws in */
  .card-project__cta { pointer-events: none; }
  .card-project:is(.is-cta, .is-hover, :has(.card-project__stretch:focus-visible)) .card-project__cta { --btn-bg: var(--color-accent-2-hover); --btn-bd: var(--color-accent-2-hover); }
  .card-project:is(.is-cta, .is-hover) .card-project__cta .btn__icon[data-dir="right"] { animation: icon-x var(--motion-duration-slow) var(--motion-easing-out); }
  .card-project:is(.is-cta, .is-hover) .card-project__cta .btn__icon:not([data-dir]) { animation: icon-xy var(--motion-duration-slow) var(--motion-easing-out); }
  .card-project__second { position: relative; z-index: 2; inline-size: fit-content; font: var(--text-button); font-weight: var(--link-weight); }
  .card-project__second:is(:hover, :focus-visible) { font-weight: var(--link-weight-hover); }

  /* ---- KPI: four numbers, read left to right. Each one rises, counts up, then its frame is drawn, and only then
         does the next begin (script arms the row, then adds .is-on for the number, .is-said for its line and .is-framed, in order). Without script all four simply show. ---- */
  @property --frame { syntax: "<number>"; inherits: false; initial-value: 1; }
  .kpi-row { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { --frame: 1; position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); align-content: start; padding: var(--space-6) var(--space-4) var(--space-6) 0;
    background: var(--rule-dotted-h) top left / calc(100% * var(--frame)) 1px no-repeat, var(--rule-dotted-h) bottom left / 0 1px no-repeat;
    transition: --frame var(--motion-kpi-frame) var(--motion-easing-out); }
  .kpi:nth-last-child(-n+2) { background-size: calc(100% * var(--frame)) 1px, calc(100% * var(--frame)) 1px; } /* phones: the second row also closes the box */
  .kpi:nth-child(even) { padding-inline: var(--space-4) 0; }
  .kpi:nth-child(even)::before { content: ""; position: absolute; inset-block: var(--space-6); inset-inline-start: 0; inline-size: 1px; background: var(--rule-dotted-v); transform-origin: top; transform: scaleY(var(--frame)); transition: transform var(--motion-kpi-frame) var(--motion-easing-out); }
  .kpi > * { transition: opacity var(--motion-rise-duration) var(--motion-easing-out), translate var(--motion-rise-duration) var(--motion-easing-out); }
  /* hidden only in a row the script has armed: without script, or if it fails, the numbers simply show */
  .kpi-row.is-armed .kpi:not(.is-on) > .kpi__value, .kpi-row.is-armed .kpi:not(.is-said) > :not(.kpi__value) { opacity: 0; translate: 0 var(--motion-rise-distance); }
  .kpi-row.is-armed .kpi:not(.is-framed) { --frame: 0; }
  @keyframes reveal-failsafe { to { opacity: 1; translate: 0 0; } }
  @keyframes frame-failsafe { to { --frame: 1; } }
  .kpi__value { font: var(--text-data-xl); letter-spacing: var(--text-data-xl-ls); font-variant-numeric: tabular-nums; }
  .kpi__label { font: var(--text-body-sm); color: var(--color-text-secondary); max-inline-size: 28ch; text-wrap: pretty; }
  @media (min-width: 48em) {
    .kpi-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .kpi, .kpi:nth-child(even) { padding: var(--space-6); background-size: calc(100% * var(--frame)) 1px, calc(100% * var(--frame)) 1px; }
    .kpi:first-child { padding-inline-start: 0; }
    .kpi:last-child { padding-inline-end: 0; }
    .kpi:nth-child(n+2)::before { content: ""; position: absolute; inset-block: var(--space-6); inset-inline-start: 0; inline-size: 1px; background: var(--rule-dotted-v); transform-origin: top; transform: scaleY(var(--frame)); transition: transform var(--motion-kpi-frame) var(--motion-easing-out); }
  }

  /* ---- strength card: a pixel illustration on top, the heading and body
         grouped at the bottom. 3:5 on every device. Not a link, so no arrow,
         no cursor label, no hover lift.                                       */
  .strengths { display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-rows: 1fr; gap: var(--space-6); justify-content: center; } /* every row as tall as the tallest card */
  .strengths > .strength { align-self: stretch; } /* so all four take the height of the tallest (Idea-to-Market) card */
  @media (max-width: 35.99em) { .strengths { grid-auto-rows: auto; } .strengths > .strength { aspect-ratio: auto; justify-content: flex-start; gap: 1.75rem; } .strength__art { flex: none; } .strength__art .pxart { inline-size: min(100%, 10rem); } } /* phones: art to title 2 x title to text, measured */
  @media (max-width: 35.99em) { .strengths > .strength { padding: var(--space-8) var(--space-6); } .strength__content { gap: var(--space-3); } .strength__text { line-height: 1.7; } } /* phones: the card breathes */
  @media (min-width: 36em) { .strengths { grid-template-columns: repeat(2, minmax(0, 22rem)); } }
  @media (min-width: 70em) { .strengths { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
  .strength { container-type: inline-size; display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-5); inline-size: 100%; max-inline-size: 22rem; justify-self: center; aspect-ratio: 3 / 5; padding: var(--card-pad) var(--card-pad) calc(var(--card-pad) * var(--card-bottom-ratio)); background: var(--color-bg-secondary); border: var(--border-subtle); }
  .strength__art { flex: 1 0 auto; display: grid; place-items: start center; min-block-size: 0; } /* optical centre sits a touch above the geometric one */
  .strength__art .pxart { inline-size: min(100%, 15rem); max-block-size: 100%; }
  .strength__content { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
  .strength__title { font: 700 1.375rem / 1.1 var(--font-display); letter-spacing: -0.025em; } /* 22px, bold: clearly above the 14px body */
  .strength__text { font: 400 0.875rem / 1.55 var(--font-body); color: var(--color-text-secondary); text-wrap: balance; } /* the card is a column: art on top, heading and body pinned to the bottom, so the last line is level across cards */
  /* Pixel art: square cells on a grid, drawn in the system's own colours so it follows the theme. */
  .pxart { display: block; inline-size: 100%; block-size: auto; shape-rendering: crispEdges; }
  .pxart .pk { fill: var(--color-text-primary); }
  .pxart .pr { fill: var(--color-accent); }
  .pxart .pb { fill: var(--color-accent-2); }
  .pxart .pl { fill: var(--color-border-subtle); }
  .pxart .pw { fill: var(--color-bg-primary); }

  /* About's "Design Engineer": an underline, and three pixel friends (Claude Code, Grok, GPT) peeking over the word from
     behind it. Hover or a tap (.is-out) swipes the underline away and brings them up one by one to stand on the word and say
     hello; leaving waves them back one by one and the underline springs home. Script sets the bot states (.is-up, .is-happy,
     .is-wave, .is-saying), --de-cap (how far below the line box's top the capitals start: they stand there, never over a
     letter) and --o (the word's scroll reveal). The stage clips only below that line, so heads and bubbles are never cut. */
  .de { --bot: 1.75em; position: relative; white-space: nowrap; }
  .de__line { position: absolute; inset-inline: 0; inset-block-end: -0.08em; block-size: 2px; background: currentColor; opacity: var(--o, 1); transform-origin: 0 50%;
    transition: transform 720ms var(--motion-easing-spring); }
  .de.is-out .de__line { transform: scaleX(0); transition: transform 360ms var(--motion-easing-in); }
  .de__stage { position: absolute; inset-inline: 0; inset-block-end: calc(100% - var(--de-cap, 0.24em)); block-size: var(--bot); display: flex; justify-content: space-evenly;
    pointer-events: none; opacity: var(--o, 1); clip-path: inset(-10em -10em 0 -10em); }
  .de-bot { position: relative; inline-size: var(--bot); block-size: var(--bot); pointer-events: auto; transform: translateY(var(--peek, 60%)); transition: transform 560ms var(--motion-easing-spring); }
  .de-bot--gpt { --peek: 37%; } /* its eyes sit lower, under the beret: it peeks a little higher to show them */
  .de-bot.is-up { transform: none; }
  .de-bot__art { display: block; inline-size: 100%; block-size: 100%; overflow: visible; }
  .de-bot .po { fill: #d97757; } .de-bot .pe { fill: #1f1e1d; } .de-bot .pu { fill: #1d7af2; } .de-bot .ps { fill: #f4a3a3; }
  /* faces: open eyes that blink now and then */
  .de-bot :is(.b-eyes-blink, .b-eyes-happy, .b-smile, .b-arm-a, .b-arm-b) { opacity: 0; }
  .de-bot .b-eyes-open { animation: de-blink 4.2s steps(1, end) calc(var(--i) * -1.4s) infinite; }
  .de-bot .b-eyes-blink { animation: de-blink-on 4.2s steps(1, end) calc(var(--i) * -1.4s) infinite; }
  /* a friend with no mouth smiles with its eyes */
  .de-bot.is-happy:not(:has(.b-smile)) :is(.b-eyes-open, .b-eyes-blink) { opacity: 0; animation: none; }
  .de-bot.is-happy:not(:has(.b-smile)) .b-eyes-happy { opacity: 1; }
  .de-bot:is(.is-happy, .is-wave) .b-smile { opacity: 1; }
  /* waving goodbye: happy eyes, the arm swings between two frames */
  .de-bot.is-wave :is(.b-eyes-open, .b-eyes-blink, .b-arm-rest) { opacity: 0; animation: none; }
  .de-bot.is-wave .b-eyes-happy { opacity: 1; }
  .de-bot.is-wave :is(.b-arm-a, .b-arm-b) { animation: px-swap 0.44s steps(1, end) infinite; }
  .de-bot.is-wave .b-arm-b { animation-delay: -0.22s; }
  .de-bot--noarms.is-wave .de-bot__art { transform-origin: 50% 100%; animation: de-rock 0.44s steps(1, end) infinite; } /* no arms: it rocks to wave */
  @keyframes de-blink { 94% { opacity: 1; } 95%, 99% { opacity: 0; } }
  @keyframes de-blink-on { 94% { opacity: 0; } 95%, 99% { opacity: 1; } }
  @keyframes de-rock { 0% { rotate: -7deg; } 50% { rotate: 7deg; } }
  /* what they say: a small bubble above each, kept on screen by the script (--nx) */
  .de-bot__say { position: absolute; inset-block-end: calc(100% + 0.3em); inset-inline-start: 50%; z-index: 1; padding: 0.25em 0.6em 0.3em; font: 500 0.5em / 1.2 var(--font-mono); letter-spacing: 0; white-space: nowrap;
    color: var(--color-text-primary); background: var(--color-bg-primary); border: 1.5px solid currentColor; border-radius: 0.7em; box-shadow: 2px 2px 0 currentColor; pointer-events: none;
    translate: calc(-50% + var(--nx, 0px)) 0.4em; scale: 0.6; opacity: 0; transform-origin: 50% 100%;
    transition: opacity 160ms linear, scale 380ms var(--motion-easing-spring), translate 380ms var(--motion-easing-spring); }
  .de-bot__say:empty { display: none; }
  .de-bot.is-saying .de-bot__say { opacity: 1; scale: 1; translate: calc(-50% + var(--nx, 0px)) 0; }
  @media (prefers-reduced-motion: reduce) { :is(.de__line, .de-bot, .de-bot__say) { transition: none; } .de-bot :is(.b-eyes-open, .b-eyes-blink), .de-bot--noarms .de-bot__art { animation: none; } }
  /* pixel icons in running text (About's skills): a strip of 8 frames of 12 cells, one frame a step (steps() must match
     --frames); the first frame is the still. The icon and its words never part at a line break. */
  .pxi-word { white-space: nowrap; }
  .pxi { display: inline-block; inline-size: 1.3em; block-size: 1.3em; margin-inline-end: 0.3em; vertical-align: -0.26em; overflow: hidden; }
  .pxi-strip { animation: pxi-run 2.6s steps(8, end) infinite; }
  .pxi--interface .pxi-strip { animation-delay: -0.9s; } .pxi--code .pxi-strip { animation-delay: -1.7s; }
  @keyframes pxi-run { to { transform: translateX(calc(var(--frames) * var(--cell) * -1px)); } }
  /* small prints in a sentence (About's dogs): fanned and overlapping. Hover, focus or a tap on any one brings all three up
     close together, fanned side by side; script lays the fan out (--nx per print, --kk the scale that fits) and keeps it on screen */
  .pets { --k: 3.2; display: inline-flex; vertical-align: -0.5em; margin-inline-end: 0.1em; }
  .pet { position: relative; display: block; block-size: 1.7em; margin-inline-start: -0.45em; border: 2px solid var(--paper); border-radius: 3px; background: var(--paper);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.25), 0 4px 10px -4px rgb(0 0 0 / 0.35); rotate: var(--r, 0deg); transform-origin: 50% 100%; outline-offset: 3px; cursor: zoom-in;
    transition: translate 440ms var(--motion-easing-out) var(--d, 0ms), scale 480ms cubic-bezier(0.3, 1.35, 0.5, 1) var(--d, 0ms), rotate 440ms var(--motion-easing-out) var(--d, 0ms), box-shadow 440ms var(--motion-easing-out); }
  .pet:first-child { margin-inline-start: 0; }
  .pet:nth-child(1) { --r: -8deg; --fan: -4deg; } .pet:nth-child(2) { --r: 4deg; --fan: 0deg; z-index: 1; } .pet:nth-child(3) { --r: -3deg; --fan: 4deg; }
  .pet img { display: block; block-size: 100%; inline-size: auto; border-radius: 1px; }
  .pets:is(:hover, :focus-within, .is-near) .pet { --d: calc(var(--i) * 45ms); z-index: calc(3 + var(--i)); translate: var(--nx, 0px) -0.4em; scale: var(--kk, var(--k)); rotate: var(--fan); cursor: zoom-out;
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.2), 0 6px 14px -6px rgb(0 0 0 / 0.45); }
  @media (prefers-reduced-motion: reduce) { .pxi-strip { animation: none; } .pet { transition: none; } }

  /* ---- cursor label: a blinking block, then it widens into a black box
         and types its words. JS drives the three states.                 */
  .cursor-label { position: fixed; inset: 0 auto auto 0; z-index: var(--z-cursor); display: block; block-size: 1.5rem; inline-size: 0.75rem; padding-inline: 0; overflow: hidden; background: var(--color-accent-2); color: var(--color-text-inverse); font: var(--text-mono-ui); white-space: pre; pointer-events: none; opacity: 0; transition: inline-size var(--motion-duration-base) var(--motion-easing-out), block-size var(--motion-duration-base) var(--motion-easing-out), padding var(--motion-duration-base) var(--motion-easing-out), background-color var(--motion-duration-base) var(--motion-easing-standard), opacity var(--motion-duration-fast) var(--motion-easing-out); }
  .cursor-label.is-caret { opacity: 1; animation: blink var(--motion-cursor-blink) steps(1) infinite; }
  .cursor-label.is-open { opacity: 1; animation: none; inline-size: var(--cl-w, 12rem); block-size: var(--cl-h, 2.25rem); padding-block: var(--space-2); padding-inline: var(--space-3); background: var(--color-bg-inverse); } /* one or two lines: script sets --cl-w and --cl-h from the text */
  .cursor-label__caret { display: inline-block; vertical-align: -0.18em; inline-size: 0.55em; block-size: 1.05em; margin-inline-start: 0.15em; background: var(--color-accent-2); animation: blink var(--motion-cursor-blink) steps(1) infinite; }
  @media (hover: none), (pointer: coarse) { .cursor-label { display: none; } }

  /* ---- selection frame (Figma-like), blue because you can act on it ---- */
  .sel { position: relative; display: inline-block; padding: 0 0.3em; outline: 1px solid var(--color-accent-2-border); outline-offset: 0; }
  .sel > i { position: absolute; inline-size: 7px; block-size: 7px; background: var(--color-bg-primary); border: 1px solid var(--color-accent-2-border); pointer-events: none; }
  .sel > i:nth-of-type(1) { inset: -4px auto auto -4px; }
  .sel > i:nth-of-type(2) { inset: -4px -4px auto auto; }
  .sel > i:nth-of-type(3) { inset: auto auto -4px -4px; }
  .sel > i:nth-of-type(4) { inset: auto -4px -4px auto; }
  .sel__bar { position: absolute; inset-block-end: calc(100% + 0.75rem); inset-inline-start: 50%; translate: -50% 0; z-index: var(--z-raised); display: none; align-items: center; background: var(--color-bg-primary); border: var(--border-strong); box-shadow: var(--elevation-hard-sm); font: var(--text-mono-ui); font-style: normal; font-weight: 400; letter-spacing: 0; white-space: nowrap; }
  .sel:is(:hover, :focus-within, .is-open) > .sel__bar { display: flex; }
  /* invisible bridge over the gap so the pointer can travel from the phrase to the bar without losing hover */
  .sel__bar::before { content: ""; position: absolute; inset-inline: 0; inset-block-start: 100%; block-size: 0.75rem; }
  .sel__bar > button { display: grid; place-items: center; min-inline-size: var(--control-sm); block-size: var(--control-sm); padding-inline: var(--space-2); color: var(--color-text-secondary); font: inherit; }
  .sel__bar > button + button, .sel__bar > .dropdown + button { border-inline-start: var(--border-subtle); }
  .sel__bar > button:hover:not(:disabled) { background: var(--color-state-hover); color: var(--color-text-primary); }
  .sel__bar > button[aria-pressed="true"] { background: var(--color-bg-inverse); color: var(--color-text-inverse); }
  .sel__bar > button:disabled { color: var(--color-text-disabled); cursor: not-allowed; }
  .sel__bar .dropdown__list { inset-block-start: auto; inset-block-end: calc(100% + 4px); } /* the bar sits above the phrase, so its list opens upward */
  /* the toolbar's colour dots; scoped to the bar so they never touch the specimen's colour swatches (.sw) */
  .sel__bar .sw { display: block; inline-size: 0.8rem; block-size: 0.8rem; border: 1px solid var(--color-border-strong); }
  .sel__bar .sw--blue { background: var(--color-accent-2); }
  .sel__bar .sw--red { background: var(--color-accent); }
  /* Drip word ("Design Engineer"): the letters stay in ink; red and blue melt off them, drawn by script on a canvas behind.
     Dark theme: the drips rise. Light theme: they fall. Calm at rest; on hover they stretch, sway and run wild near the pointer.
     They reach about 0.9em above and below, so they only brush the lines around. Touch and reduced motion: one still frame. */
  .drip-text { position: relative; isolation: isolate; white-space: nowrap; font-weight: var(--weight-semibold); }
  .drip-text__cv { position: absolute; inset: -0.95em -0.3em; inline-size: calc(100% + 0.6em); block-size: calc(100% + 1.9em); z-index: -1; pointer-events: none; }
  /* Drip reveal: an image arrives through drips (accent: red and blue; mono: black in light, white in dark). Script-only overlay. */
  .drip-reveal { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; pointer-events: none; }
  .card-project__hero { position: relative; }

  /* ---- logo tile: a company's logo on white, in both themes, at an optically balanced size.
         Each logo carries its balanced size (--lw, --lh, px in a 128x56 box); --s scales the whole tile. ---- */
  .logo-tile { --s: 1; display: inline-grid; place-items: center; flex: none; inline-size: calc((128px + 2 * var(--space-4)) * var(--s)); block-size: calc((56px + 2 * var(--space-3)) * var(--s)); background: #fff; }
  .logo-tile img { display: block; inline-size: calc(var(--lw) * 1px * var(--s)); block-size: calc(var(--lh) * 1px * var(--s)); }
  .logo-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }

  /* ---- ticker: logos travel left to right inside a dotted band, a dotted rule between each.
         Pauses on hover and focus, and with its own button; reduced motion: still, scroll by hand. ---- */
  /* the caption above the band says plainly whose logos these are (the companies and schools of the people he worked with),
     so a credential never reads as a client */
  .ticker-block { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
  .ticker__label { font: var(--text-meta); color: var(--color-text-tertiary); }
  .ticker { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; background: var(--rule-dotted-h) top / 100% 1px no-repeat, var(--rule-dotted-h) bottom / 100% 1px no-repeat; }
  .ticker__viewport { overflow: hidden; }
  .ticker__track { display: flex; inline-size: max-content; margin: 0; padding: 0; list-style: none; animation: ticker-ltr var(--ticker-duration, 70s) linear infinite; }
  .ticker__item { display: grid; place-items: center; padding: var(--space-5) var(--space-6); background: var(--rule-dotted-v) right / 1px 60% no-repeat; }
  .ticker:is(:hover, :focus-within, .is-paused) .ticker__track { animation-play-state: paused; }
  @keyframes ticker-ltr { from { transform: translate3d(-50%, 0, 0); } to { transform: translate3d(0, 0, 0); } }
  @media (prefers-reduced-motion: reduce) { .ticker__track { animation: none; } .ticker__viewport { overflow-x: auto; } }
  /* ---- postcard: the closing "offer letter", sent by the visitor to Abhishek ------------------------------------------
     A printed postcard with two sides, after a riso travel card. Front: a red halftone panel, "Sent by you, visitor, to
     me" over a bold OFFER LETTER, and a pixel Delhi skyline cut out like a sticker (Qutub Minar, India Gate and its flame,
     the Lotus Temple) that is alive: a paper plane crosses, birds flap, windows, flame and sun flicker. Back: paper, a
     logo block, a perforated stamp box, a divider and ruled lines. data-state (script): front -> back (turned over) ->
     sent (the stamp lands, a postmark cancels it with today's date, the address types itself, one line after another).
     Without script the back shows, filled in. Fine pointers tilt it toward the cursor and a light follows the pointer.
     Fixed colours: a printed object, the same in both themes. Script: .postcard. ---- */
  .postcard { --pc-red: #d5273c; --pc-dot: #b51c30; --pc-cream: #f4ebd9; --pc-paper: #f7f4ec; --pc-ink: #17171f; --pc-blue: #2e5bff; --pc-mark: #2b3f9e;
    --rx: 0deg; --ry: 0deg; position: relative; inline-size: 100%; perspective: 1600px; color: var(--pc-ink); }
  .postcard__tilt, .postcard__card { inline-size: 100%; }
  .postcard__tilt { position: relative; transform: rotateX(var(--rx)) rotateY(var(--ry)); transform-style: preserve-3d; transition: transform 450ms var(--motion-easing-out), opacity var(--motion-duration-slow) var(--motion-easing-out), translate var(--motion-duration-slower) var(--motion-easing-out); }
  .postcard__card { position: relative; display: grid; aspect-ratio: 3 / 5; transform-style: preserve-3d; transition: transform 1000ms cubic-bezier(0.3, 0.7, 0.15, 1); }
  /* the card and its faces share one plane: clicks go to the faces only, or a tilted card can swallow a click meant for the message or the stamp */
  .postcard__card { pointer-events: none; }
  .postcard__face { pointer-events: auto; }
  @media (max-width: 35.99em) { .postcard__card { aspect-ratio: auto; block-size: 90vh; block-size: 90svh; } } /* phones: 90% of the screen's height */
  @media (min-width: 36em) { .postcard__card { aspect-ratio: 1.4 / 1; } }
  @media (min-width: 64em) { .postcard__card { aspect-ratio: 1.8 / 1; } }
  @media (min-width: 80em) { .postcard__card { aspect-ratio: 2 / 1; } }
  .postcard:not([data-state]) .postcard__card, .postcard:is([data-state="back"], [data-state="sent"]) .postcard__card { transform: rotateY(180deg); }
  .postcard__face { grid-area: 1 / 1; position: relative; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: var(--pc-paper);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 28px 50px -22px rgba(0, 0, 0, 0.6); }
  .postcard__back { transform: rotateY(180deg); }
  /* paper grain, then the light: a soft spot that follows the pointer and a long sheen */
  .postcard__face::before { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0.3; mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.42 0 0 0 0 0.3 0 0 0 0.4 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"); }
  /* sunlight on a printed card: one faint straight reflection that slides against the tilt (tilt left, it moves right).
     The same light in both themes: the card is a printed object. */
  @property --sx { syntax: "<percentage>"; inherits: true; initial-value: 32%; }
  .postcard { --sx: 32%; transition: --sx 450ms var(--motion-easing-out); }
  .postcard__face::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
    background: linear-gradient(105deg, rgba(255, 255, 255, 0) calc(var(--sx) - 22%), rgba(255, 255, 255, 0.025) calc(var(--sx) - 15%), rgba(255, 255, 255, 0.075) calc(var(--sx) - 8%), rgba(255, 255, 255, 0.13) var(--sx), rgba(255, 255, 255, 0.075) calc(var(--sx) + 8%), rgba(255, 255, 255, 0.025) calc(var(--sx) + 15%), rgba(255, 255, 255, 0) calc(var(--sx) + 22%)); } /* wide and soft: no hard centre */

  /* front */
  .postcard__front { padding: clamp(0.5rem, 1.3vw, 1rem); }
  .postcard__panel { position: relative; display: flex; flex-direction: column; block-size: 100%; overflow: hidden; color: var(--pc-cream);
    background: radial-gradient(circle at 1px 1px, var(--pc-dot) 0.9px, transparent 1.3px) 0 0 / 5px 5px, var(--pc-red); }
  .postcard__head { position: relative; z-index: 1; display: grid; justify-items: start; gap: var(--space-2); padding: clamp(1rem, 3vw, 2.25rem) clamp(1rem, 3.5vw, 2.75rem) 0; }
  .postcard__kicker { font: italic 500 clamp(0.875rem, 0.75rem + 0.45vw, 1.125rem) / 1.2 var(--font-display); }
  .postcard__title { font: 800 clamp(1.75rem, 1.1rem + 2vw, 2.25rem) / 0.95 var(--font-display); letter-spacing: 0.01em; text-transform: uppercase; text-shadow: 0.07em 0.07em 0 var(--pc-ink); }
  .postcard__sub { font: var(--text-mono-ui); font-size: 1rem; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.92; } /* 16 px */
  /* the scene takes the height the heading leaves; the skyline stands at its foot, sized by the card's width, so it always spans
     edge to edge and nothing of it is ever cropped (each SVG carries its own aspect ratio and column count) */
  .postcard__scene { position: relative; flex: 1 1 auto; min-block-size: 0; display: flex; flex-direction: column; justify-content: flex-end; }
  .pc-scene { display: block; flex: none; inline-size: 100%; block-size: auto; max-block-size: 100%; image-rendering: pixelated; }
  .pc-tall { display: none; }
  @media (max-width: 35.99em) { .pc-scene--wide { display: none; } .pc-tall { display: flex; flex-direction: column; flex: 1 1 auto; min-block-size: 0; } }
  /* phones: the sky is its own layer of sprites on the skyline's pixel grid (--pc-u: the card's width over the skyline's columns).
     Across, each sprite sits on that grid (--x); down, at a share of whatever sky there is (--y): a tall phone gets more sky, not a zoom */
  .pc-tall__sky { position: relative; flex: 1 1 auto; min-block-size: 0; container: pc-sky / size; }
  .pc-sprite { --pc-u: calc(100cqi / var(--cols)); position: absolute; inset-inline-start: calc(var(--x) * var(--pc-u)); inset-block-start: var(--y);
    inline-size: calc(var(--w) * var(--pc-u)); block-size: calc(var(--h) * var(--pc-u)); overflow: visible; image-rendering: pixelated; }

  /* back */
  .postcard__back { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 1px minmax(0, 1fr) auto auto; gap: var(--space-4); padding: clamp(1rem, 3vw, 2.5rem) clamp(1rem, 3.5vw, 3rem) clamp(0.75rem, 2vw, 1.5rem); }
  .postcard__brand { grid-column: 1; grid-row: 1; align-self: start; display: grid; justify-items: start; gap: 0.45em; margin: 0; text-transform: uppercase; }
  .postcard__name { font: 800 clamp(1.125rem, 0.85rem + 1vw, 1.75rem) / 1 var(--font-display); letter-spacing: 0.01em; white-space: nowrap; }
  .postcard__role { font: 600 clamp(0.625rem, 0.55rem + 0.3vw, 0.8125rem) / 1.2 var(--font-display); letter-spacing: 0.08em; opacity: 0.7; }
  .postcard__stampbox { grid-column: 2; grid-row: 1 / span 2; position: relative; inline-size: clamp(4.25rem, 2.8rem + 5vw, 7.5rem); aspect-ratio: 120 / 150; justify-self: end; }
  .postcard__stampbox::before { content: ""; position: absolute; inset: 0; border: 2px dotted color-mix(in srgb, var(--pc-ink) 45%, transparent); transition: opacity 200ms linear 450ms; }
  .postcard[data-state="sent"] .postcard__stampbox::before { opacity: 0; } /* the empty box goes once the stamp covers it */
  .pc-stamp { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; transform: rotate(4deg); filter: drop-shadow(1px 2px 1px rgba(0, 0, 0, 0.28)); overflow: visible; }
  .pc-stamp text { font-family: var(--font-display); fill: var(--pc-ink); }
  .pc-stamp__name { font-size: 11.5px; font-weight: 800; letter-spacing: 0.02em; }
  .pc-stamp__value { font-size: 30px; font-weight: 800; fill: var(--pc-red) !important; }
  .postcard__postmark { position: absolute; inset-block-start: 38%; inset-inline-end: 52%; inline-size: 250%; color: var(--pc-mark); opacity: 0.82; pointer-events: none; }
  .postcard__divider { grid-column: 1 / -1; grid-row: 2; align-self: center; block-size: 1px; background: color-mix(in srgb, var(--pc-ink) 35%, transparent); }
  .postcard__address { grid-column: 1 / -1; grid-row: 4; align-self: end; display: grid; gap: var(--space-2); font: 500 clamp(0.8125rem, 0.7rem + 0.4vw, 1.0625rem) / 1.25 var(--font-mono); }
  .postcard__to { margin: 0; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.8em; opacity: 0.75; }
  .postcard__lines { display: grid; margin: 0; padding: 0; list-style: none; }
  .postcard__lines li { display: flex; align-items: flex-end; min-block-size: 2.4em; padding-block-end: 0.3em; border-block-end: 1px solid color-mix(in srgb, var(--pc-ink) 45%, transparent); }
  .postcard__link { color: var(--pc-ink); text-decoration: none; }
  .postcard__link:is(:hover, :focus-visible) { text-decoration: underline; text-decoration-color: var(--pc-blue); text-decoration-thickness: 2px; text-underline-offset: 0.28em; outline: none; }
  .postcard__platform { font-weight: 700; }
  .postcard__note { grid-column: 1 / -1; grid-row: 3; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: var(--space-2); min-block-size: 4.5em; cursor: text; }
  .postcard:not([data-state="sent"]) .postcard__note { visibility: hidden; }
  .postcard__note:focus-within { outline: 1px dashed color-mix(in srgb, var(--pc-ink) 35%, transparent); outline-offset: 0.5rem; }
  .postcard__msg { inline-size: 100%; block-size: 100%; min-block-size: 3.2em; padding: 0; border: 0; resize: none; background: transparent; color: var(--pc-ink); caret-color: var(--pc-blue); font: 500 clamp(0.8125rem, 0.7rem + 0.4vw, 1.0625rem) / 1.6 var(--font-mono); outline: none; }
  .postcard__msg::placeholder { color: transparent; }
  .postcard__msg { transition: opacity 240ms steps(3, end) 900ms; }
  .postcard:not([data-state="sent"]) .postcard__msg { opacity: 0; transition: none; }
  @media (hover: none), (pointer: coarse), (max-width: 63.99em) { .postcard[data-state="sent"] .postcard__msg::placeholder { color: color-mix(in srgb, var(--pc-ink) 40%, transparent); } }
  @media (pointer: coarse) { .postcard__msg { font-size: 1rem; } }
  .postcard[data-state="sent"] .postcard__front { pointer-events: none; }
  /* once a message is written, the card can be turned to its front and back again (.is-turned); nothing replays */
  .postcard[data-state="sent"].is-turned .postcard__card { transform: none; }
  .postcard[data-state="sent"] .postcard__stampbox { cursor: pointer; }
  .postcard[data-state="sent"] .postcard__stampbox:focus-visible { outline: var(--focus-ring); outline-offset: 0.25rem; }
  .postcard__msg:focus::placeholder { color: color-mix(in srgb, var(--pc-ink) 40%, transparent); }
  /* "Mail to Abhishek": the primary button, in the card's own ink (the same in both themes); it springs in with the first letter typed */
  .postcard__sends { display: flex; flex-wrap: wrap; gap: var(--space-2); }
  .postcard__sends:not(:has(> :not([hidden]))) { display: none; }
  .postcard__mail { --color-bg-inverse: var(--pc-ink); --color-text-inverse: var(--pc-paper); }
  .postcard__mail--alt { --btn-bg: transparent; --btn-fg: var(--pc-ink); --btn-bd: var(--pc-ink); }
  .postcard__mail:not([hidden]) { animation: pc-mail-in 520ms cubic-bezier(0.3, 1.4, 0.5, 1) both; }
  .postcard__mail[hidden] { display: none; }
  @keyframes pc-mail-in { from { opacity: 0; transform: translate3d(0, 0.6rem, 0) scale(0.92); } }
  .postcard__url { grid-column: 1 / -1; grid-row: 5; margin: 0; text-align: center; font: 500 0.625rem / 1 var(--font-mono); letter-spacing: 0.14em; opacity: 0.5; }
  @media (min-width: 36em) {
    .postcard__back { grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr); grid-template-rows: auto 1fr auto; column-gap: clamp(1.25rem, 3.5vw, 3rem); row-gap: var(--space-3); }
    .postcard__brand { grid-column: 1; grid-row: 1; }
    .postcard__stampbox { grid-column: 3; grid-row: 1; }
    .postcard__divider { grid-column: 2; grid-row: 1 / span 2; align-self: stretch; inline-size: 1px; block-size: auto; margin-block: clamp(3rem, 2rem + 4vw, 6.5rem) var(--space-2); }
    .postcard__address { grid-column: 3; grid-row: 2; align-self: center; }
    .postcard__note { grid-column: 1; grid-row: 2; align-self: stretch; padding-block-start: var(--space-6); }
    .postcard__url { grid-column: 1 / -1; grid-row: 3; justify-self: center; }
  }

  /* the whole card is one control until it is sent; then the links take over */
  .postcard__hit { position: absolute; inset: 0; z-index: 4; padding: 0; border: 0; background: transparent; cursor: pointer; }
  .postcard__hit:focus-visible { outline: var(--focus-ring); outline-offset: 0.5rem; }
  .postcard__hint { display: none; position: absolute; z-index: 5; inset-block-end: var(--space-3); inset-inline-end: var(--space-3); margin: 0; padding: var(--space-1) var(--space-2); background: var(--pc-ink); color: #fff; font: var(--text-mono-ui); pointer-events: none; }
  @media (hover: none) { .postcard__hint { display: block; } }

  /* back, before it is sent: an empty stamp box and empty lines; sending lands the stamp, thunks the postmark, types the lines */
  .postcard .postcard__type { display: inline-block; clip-path: inset(0 0 0 0); white-space: pre; }
  .postcard:is([data-state="front"], [data-state="back"]) .postcard__type { clip-path: inset(0 100% 0 0); }
  .postcard[data-state="sent"] .postcard__type { transition: clip-path calc(var(--n) * 42ms) steps(var(--n), end) calc(var(--d) * 1ms); }
  .postcard:is([data-state="front"], [data-state="back"]) .pc-stamp { opacity: 0; transform: translate(-10%, -40%) rotate(-16deg) scale(1.6); }
  .postcard[data-state="sent"] .pc-stamp { transition: transform 520ms cubic-bezier(0.3, 1.45, 0.5, 1) 200ms, opacity 140ms linear 200ms; }
  /* a click takes the stamp off (it lifts and fades, the dotted box shows again); the next click lands it back */
  .postcard.is-unstamped .pc-stamp { opacity: 0; transform: translate(-10%, -40%) rotate(-16deg) scale(1.6); transition: transform 420ms cubic-bezier(0.5, 0, 0.75, 0), opacity 180ms linear 240ms; }
  .postcard.is-unstamped .postcard__stampbox::before { opacity: 1; }
  .postcard:is([data-state="front"], [data-state="back"]) .postcard__postmark { opacity: 0; scale: 1.5; }
  .postcard[data-state="sent"] .postcard__postmark { transition: opacity 120ms linear 760ms, scale 260ms cubic-bezier(0.3, 1.6, 0.5, 1) 760ms; }
  .postcard__postmark .pm-wave { stroke-dasharray: 260; stroke-dashoffset: 0; }
  .postcard:is([data-state="front"], [data-state="back"]) .postcard__postmark .pm-wave { stroke-dashoffset: 260; }
  .postcard[data-state="sent"] .postcard__postmark .pm-wave { transition: stroke-dashoffset 700ms var(--motion-easing-out) 980ms; }

  /* entrance: the card settles in, then the skyline rises out of the street in pixel steps and the sky comes alive */
  .postcard.is-armed:not(.is-in) .postcard__tilt { opacity: 0; translate: 0 2rem; }
  .postcard .pc-land { transition: transform 900ms steps(9, end) 250ms; }
  .postcard.is-armed:not(.is-in) .pc-land { transform: translateY(36px); }
  .postcard :is(.pc-sun, .pc-cloud, .pc-birds, .pc-plane, .pc-jet, .pc-kite, .pc-auto) { transition: opacity 400ms steps(4, end) 1100ms; }
  .postcard.is-armed:not(.is-in) :is(.pc-sun, .pc-cloud, .pc-birds, .pc-plane, .pc-jet, .pc-kite, .pc-auto) { opacity: 0; }
  .postcard:not(.is-in) :is(.pc-scene, .pc-tall, .pc-stamp) * { animation-play-state: paused !important; }

  /* pixel colours */
  .pc-k { fill: var(--pc-ink); } .pc-c { fill: var(--pc-cream); } .pc-d { fill: #d9c9a8; } .pc-w { fill: #fbf8f1; } .pc-b { fill: var(--pc-blue); } .pc-B { fill: #2449d8; }
  .pc-y { fill: #ffc93c; } .pc-o { fill: #ff7a1a; } .pc-g { fill: #22994f; } .pc-G { fill: #16663a; } .pc-f { fill: #f2dcb0; } .pc-t { fill: #c47a3a; } .pc-T { fill: #9c5a26; } .pc-paper { fill: #fffdf8; }
  /* pixel motion: two-frame flickers (.pc-fa / .pc-fb take turns), the plane crossing, drifting clouds */
  .pc-fa, .pc-fb { animation: pc-blink var(--pc-t, 1s) steps(1, end) infinite; }
  .pc-fb { animation-delay: calc(var(--pc-t, 1s) / -2); }
  @keyframes pc-blink { 50% { opacity: 0; } }
  .pc-rays { --pc-t: 1.6s; } .pc-birds { --pc-t: 0.5s; } .pc-lights { --pc-t: 2.6s; } .pc-flame { --pc-t: 0.34s; } .pc-steam { --pc-t: 0.8s; } .pc-spark { --pc-t: 1.3s; }
  .pc-plane { animation: pc-fly 18s steps(150, end) infinite; }
  @keyframes pc-fly { from { transform: translateX(-8px); } to { transform: translateX(142px); } }
  /* phones: the plane crosses the whole sky, one pixel a step, from just off the left edge to just off the right */
  .pc-jet { animation: pc-cross 14s steps(70, end) infinite; }
  @keyframes pc-cross { from { translate: calc(var(--w) * var(--pc-u) * -1) 0; } to { translate: 100cqi 0; } }
  /* the kite: string and tail flick between two frames while it floats a pixel up and across */
  .pc-kite { --pc-t: 1.2s; }
  .pc-sway { animation: pc-float 2.6s steps(1, end) infinite; }
  @keyframes pc-float { 50% { transform: translate(1px, -1px); } }
  /* the auto rickshaw drives the street end to end, one pixel a step (the column count and its width come from the SVG) */
  .pc-auto { animation: pc-drive 14s steps(148, end) infinite; }
  .pc-scene--tall .pc-auto { animation-duration: 7s; animation-timing-function: steps(68, end); }
  @keyframes pc-drive { to { transform: translateX(calc((var(--cols) + var(--auto-w)) * 1px)); } }
  .pc-wheels { --pc-t: 0.3s; } .pc-puff { --pc-t: 0.6s; }
  .pc-bob { animation: pc-bob 1.1s steps(2, end) infinite; }
  @keyframes pc-bob { to { transform: translateY(-2px); } }
  .pc-cloud--1 { animation: pc-drift 26s steps(10, end) infinite alternate; }
  .pc-cloud--2 { animation: pc-drift 34s steps(10, end) infinite alternate-reverse; }
  @keyframes pc-drift { to { transform: translateX(10px); } }
  @media (prefers-reduced-motion: reduce) {
    .postcard *, .postcard__tilt, .postcard__card { transition: none !important; animation: none !important; }
    .postcard__tilt { transform: none !important; }
    .pc-fb { opacity: 0; }
    .postcard.is-armed:not(.is-in) :is(.postcard__tilt, .pc-land, .pc-sun, .pc-cloud, .pc-birds, .pc-plane) { opacity: 1; transform: none; translate: none; }
  }

  /* ---- dropdown: shows the current value, opens a list of options ------ */
  .dropdown { position: relative; display: inline-flex; }
  .dropdown__trigger { display: flex; align-items: center; gap: var(--space-2); min-block-size: var(--control-sm); padding-inline: var(--space-3); font: var(--text-mono-ui); color: var(--color-text-primary); }
  .dropdown__trigger:hover { background: var(--color-state-hover); }
  .dropdown__trigger .icon { transition: rotate var(--motion-duration-base) var(--motion-easing-out); }
  .dropdown__trigger[aria-expanded="true"] .icon { rotate: 180deg; }
  .dropdown__list { position: absolute; inset-block-start: calc(100% + 4px); inset-inline-start: 0; z-index: var(--z-tooltip); display: block; min-inline-size: 100%; margin: 0; padding: var(--space-1); background: var(--color-bg-primary); border: var(--border-strong); box-shadow: var(--elevation-hard-sm); animation: rise-in var(--motion-duration-base) var(--motion-easing-out) both; }
  .dropdown__option { display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); padding: var(--space-2) var(--space-3); white-space: nowrap; cursor: pointer; font-size: 1rem; }
  .dropdown__option .icon { visibility: hidden; }
  .dropdown__option[aria-selected="true"] .icon { visibility: visible; color: var(--color-accent-2-text); }
  .dropdown__option[data-active] { background: var(--color-state-hover); }

  /* ---- testimonial: no border. Who is speaking first, then the words,
         with the proof phrase swept in a Pixel marker.                   */
  .testimonials { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-8); }
  .testimonial { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-6); align-items: end; }
  .testimonial__photo { display: block; inline-size: min(100%, 20rem); }
  /* Every screen: the next testimonial comes every 5 s and a 20-block pixel bar under the photo fills toward it. */
  .testimonial__timer, .testimonial__timer::after { --blk: repeating-linear-gradient(90deg, var(--b) 0 calc(5% - 3px), transparent calc(5% - 3px) 5%); } /* each resolves its own --b */
  .testimonial__timer { position: relative; display: block; align-self: start; inline-size: min(100%, 20rem); block-size: 6px; margin-block-start: calc(var(--space-3) - var(--space-6)); --b: var(--color-border-subtle); background: var(--blk); }
  .testimonial__timer::after { content: ""; position: absolute; inset: 0; --b: var(--color-accent); background: var(--blk); clip-path: inset(0 100% 0 0); }
  .testimonial__timer.is-running::after { animation: testi-timer 5s steps(20, end) forwards; }
  @keyframes testi-timer { to { clip-path: inset(0 0 0 0); } }
  .testimonial__photo img { display: block; inline-size: 100%; block-size: auto; }
  /* One block for name, designation and words. The last baseline, not the line box, meets the photo's bottom edge. */
  .testimonial__content { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-6); }
  /* Side by side only where the photo can be as tall as the tallest block (script sets --testi-h, --testi-gap, --testi-drop); otherwise stacked. */
  @media (min-width: 48em) {
    .testimonial:not(.is-stacked) { grid-template-columns: var(--testi-h, 17rem) minmax(0, 1fr); column-gap: var(--testi-gap, var(--space-10)); }
    .testimonial:not(.is-stacked) .testimonial__photo { grid-column: 1; grid-row: 1; inline-size: 100%; }
    .testimonial:not(.is-stacked) .testimonial__timer { grid-column: 1; grid-row: 2; inline-size: 100%; } /* side by side: the bar sits under the photo */
    .testimonial:not(.is-stacked) .testimonial__content { grid-column: 2; grid-row: 1; }
    .testimonial:not(.is-stacked) .testimonial__content { margin-block-end: calc(-1 * var(--testi-drop, 0.3em)); }
  }
  .testimonial__who { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-1); }
  .testimonial__name { font: var(--text-h5); letter-spacing: var(--text-h5-ls); }
  .testimonial__role { font: var(--text-meta); color: var(--color-text-tertiary); }
  .testimonial__project { font: var(--text-meta); color: var(--color-text-secondary); } /* "Worked with me on ...": ties the words to one project */
  .testimonial__project:empty { display: none; } /* no project named yet: no line, no gap */
  .testimonial__quote { font: var(--text-h4); font-weight: var(--weight-regular); letter-spacing: -0.015em; text-wrap: pretty; }
  .testimonial.is-compact .testimonial__quote { font: var(--text-h5); font-weight: var(--weight-regular); letter-spacing: -0.01em; } /* script: a long quote steps down one size so the photo can still match the tallest block */
  .hl { font-family: var(--font-pixel); font-weight: 400; font-style: normal; color: var(--color-text-primary); padding-inline: 0.12em; background: linear-gradient(var(--color-highlight-testimonial), var(--color-highlight-testimonial)) no-repeat left center / 0% 100%; transition: background-size var(--motion-reveal-duration) var(--motion-easing-out) 250ms; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
  .is-in .hl, .hl.is-in { background-size: 100% 100%; }
  .testimonial__nav { display: flex; flex-wrap: wrap; gap: var(--space-2); padding-block-start: var(--space-5); background: var(--rule-dotted-h) top / 100% 1px no-repeat; }
  .testimonial__pick { display: block; padding-block-end: var(--space-1); border-block-end: 3px solid transparent; transition: border-color var(--motion-duration-base) var(--motion-easing-standard), translate var(--motion-duration-base) var(--motion-easing-out); }
  .testimonial__pick img { display: block; block-size: 3.5rem; inline-size: auto; max-inline-size: none; }
  .testimonial__pick:hover { translate: 0 -2px; }
  .testimonial__pick[aria-pressed="true"] { border-color: var(--color-accent); }

  /* ---- gallery + lightbox: photos at their own ratio, never cropped ----- */
  /* Every photo is on the page, no scrolling sideways: rows of three (.gallery__row), each row one height and every photo
     at its own shape (--r = width / height sets its share of the row). Phones and tablets: two columns, each photo at its own shape. */
  .gallery__track { display: grid; gap: var(--space-8); }
  .gallery__row { display: flex; align-items: flex-start; gap: var(--layout-gutter); }
  .gallery__item { flex: var(--r, 1) 1 0%; min-inline-size: 0; display: flex; flex-direction: column; gap: var(--space-3); margin: 0; text-align: start; color: inherit; overflow-wrap: anywhere; }
  .gallery__open { display: block; padding: 0; cursor: pointer; }
  .gallery__open img { display: block; inline-size: 100%; block-size: auto; }
  @media (max-width: 63.99em) {
    .gallery__track { display: block; columns: 2; column-gap: var(--layout-gutter); }
    .gallery__row { display: contents; }
    .gallery__item { break-inside: avoid; margin-block-end: var(--space-6); }
  }
  @media (max-width: 35.99em) { .gallery__track { columns: 1; } .gallery__item { margin-block-end: var(--space-8); } } /* phones: one photo under another */
  .gallery__no { color: var(--color-text-tertiary); margin-inline-end: var(--space-2); }
  .gallery__name { font: var(--text-mono-ui); }
  .gallery__desc { font: var(--text-body-sm); color: var(--color-text-secondary); }
  .gallery__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: var(--space-3); margin-block-end: var(--space-5); } /* shuffle, then See All Photos beside it */
  .lightbox { position: fixed; inset: 0; z-index: var(--z-modal); display: grid; place-items: center; padding: var(--space-4); }
  .lightbox__scrim { position: absolute; inset: 0; background: var(--color-scrim); -webkit-backdrop-filter: blur(var(--blur-scrim)); backdrop-filter: blur(var(--blur-scrim)); animation: fade-in var(--motion-duration-base) var(--motion-easing-out) both; }
  .lightbox__panel { position: relative; inline-size: min(100%, 60rem, (100dvh - 11rem) * 1.6); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); padding: var(--space-4) var(--space-4) calc(var(--space-4) * var(--card-bottom-ratio)); background: var(--color-bg-primary); border: var(--border-strong); box-shadow: var(--elevation-hard-md); animation: rise-in var(--motion-duration-base) var(--motion-easing-out) both; }
  /* the photo sits out of flow, so a tall portrait can never stretch the frame past the viewport */
  .lightbox__stage { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #000; }
  .lightbox__stage img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: contain; }
  .lightbox__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
  .lightbox__nav { display: flex; align-items: center; gap: var(--space-2); }
  .lightbox__count { font: var(--text-mono-ui); color: var(--color-text-tertiary); white-space: nowrap; }
  @media (max-width: 35.99em) { .lightbox__bar { flex-direction: column; align-items: stretch; } .lightbox__nav { justify-content: space-between; } }

  /* ---- social links, hover card, email copy, postcard ------------------ */
  .social-list { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-6); margin: 0; padding: 0; list-style: none; }
  .social-item { position: relative; }
  .social { display: inline-flex; align-items: center; gap: var(--space-2); min-block-size: var(--control-md); font: var(--text-body); text-decoration: none; }
  .social:hover { text-decoration: underline; text-decoration-color: var(--color-accent-2); text-underline-offset: 0.3em; }
  .hovercard { position: absolute; inset-block-start: calc(100% + 0.25rem); inset-inline-start: 0; z-index: var(--z-tooltip); inline-size: min(19rem, calc(100vw - 2rem)); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-2) var(--space-4); align-items: start; padding: var(--space-4) var(--space-4) calc(var(--space-4) * var(--card-bottom-ratio)); background: var(--color-bg-primary); border: var(--border-strong); box-shadow: var(--elevation-hard-md); visibility: hidden; opacity: 0; translate: var(--shift, 0px) -6px; transition: opacity var(--motion-duration-base) var(--motion-easing-out), translate var(--motion-duration-base) var(--motion-easing-out), visibility 0s linear var(--motion-duration-base); }
  .hovercard--up { inset-block-start: auto; inset-block-end: calc(100% + 0.25rem); translate: var(--shift, 0px) 6px; }
  .social-item:is(:hover, :focus-within, .is-hover, .is-open) .hovercard { visibility: visible; opacity: 1; translate: var(--shift, 0px) 0; transition-delay: 0s; }
  .hovercard::before { content: ""; position: absolute; inset-inline: 0; inset-block-end: 100%; block-size: 0.5rem; }
  .hovercard--up::before { inset-block-end: auto; inset-block-start: 100%; }
  /* a profile card floating over the page (the letter's X, LinkedIn and Instagram lines): the letter hides whatever leaves
     its face, so the card shows here instead, placed by the script beside the line (--fx, --fy) and kept on screen */
  .card-float { position: fixed; inset: var(--fy, 0) auto auto var(--fx, 0); z-index: var(--z-tooltip); visibility: hidden; opacity: 0; translate: 0 6px; pointer-events: none;
    transition: opacity var(--motion-duration-fast) var(--motion-easing-out), translate var(--motion-duration-fast) var(--motion-easing-out), visibility 0s linear var(--motion-duration-fast); }
  .card-float.is-on { visibility: visible; opacity: 1; translate: 0 0; pointer-events: auto; transition-delay: 0s; }
  .card-float .hovercard { position: static; visibility: visible; opacity: 1; translate: none; transition: none; }
  .card-float .hovercard::before { display: none; }
  .hovercard__platform { grid-column: 1 / -1; font: var(--text-meta); color: var(--color-text-tertiary); }
  .hovercard__avatar { inline-size: 3.5rem; block-size: auto; background: var(--color-bg-tertiary); }
  .hovercard__name { font: var(--text-h6); }
  .hovercard__handle { font: var(--text-meta); color: var(--color-text-tertiary); }
  .hovercard__bio { grid-column: 1 / -1; font: var(--text-body-sm); color: var(--color-text-secondary); }
  .hovercard__link { grid-column: 1 / -1; justify-self: start; }
  /* The footer's X, LinkedIn and Instagram cards each wear their platform's own profile hover card: its type stack, colours,
     radii, shadow and buttons, in light and dark. Position, timing and show/hide stay with .hovercard above. */
  .hovercard:is(.hovercard--x, .hovercard--linkedin, .hovercard--instagram) { display: block; padding: 0; border: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-weight: 400; letter-spacing: normal; text-align: start; -webkit-font-smoothing: antialiased; }
  .hovercard :is(.hc-x__follow, .hc-li__btn, .hc-ig__follow):focus-visible { outline: 2px solid var(--color-focus, #1d9bf0); outline-offset: 2px; }
  /* X: its profile header in a card: the banner (3:1), the round photo over the banner's edge in a ring of the card's colour,
     Follow at the right, name (heavy), handle, bio, then location and link; white or black, 16 px corners, X's soft glow */
  .hovercard--x { inline-size: min(20rem, calc(100vw - 2rem)); overflow: hidden; border-radius: 16px; background: light-dark(#fff, #000); color: light-dark(#0f1419, #e7e9ea); font-size: 15px; line-height: 20px;
    box-shadow: light-dark(rgb(101 119 134 / 0.2), rgb(255 255 255 / 0.2)) 0 0 15px, light-dark(rgb(101 119 134 / 0.15), rgb(255 255 255 / 0.15)) 0 0 3px 1px; }
  .hc-x__banner { display: block; inline-size: 100%; block-size: auto; aspect-ratio: 3 / 1; }
  .hc-x__body { padding: 0 16px 16px; }
  .hc-x__top { display: flex; justify-content: space-between; align-items: flex-end; margin-block: -38px 6px; }
  .hc-x__avatar { position: relative; display: block; inline-size: 68px; block-size: 68px; border-radius: 50%; border: 4px solid light-dark(#fff, #000); box-sizing: content-box; }
  .hc-x__follow { display: inline-flex; align-items: center; min-block-size: 34px; padding-inline: 16px; border-radius: 9999px; background: light-dark(#0f1419, #eff3f4); color: light-dark(#fff, #0f1419); font-size: 15px; font-weight: 700; text-decoration: none; transition: background-color 200ms; }
  .hc-x__follow:hover { background: light-dark(#272c30, #d7dbdc); color: light-dark(#fff, #0f1419); text-decoration: none; }
  .hc-x__name { font-size: 19px; font-weight: 800; line-height: 24px; letter-spacing: -0.01em; }
  .hc-x__handle { color: light-dark(#536471, #71767b); }
  .hc-x__bio { margin-block-start: 12px; }
  .hc-x__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-block-start: 12px; color: light-dark(#536471, #71767b); }
  .hc-x__meta svg { flex: none; inline-size: 18px; block-size: 18px; fill: currentColor; }
  .hc-x__meta svg:not(:first-child) { margin-inline-start: 10px; }
  .hc-x__url { color: #1d9bf0; }
  /* LinkedIn: 8 px corners, the profile banner, a round photo over it, name, headline, location, a blue Connect pill */
  .hovercard--linkedin { inline-size: min(20rem, calc(100vw - 2rem)); overflow: hidden; border-radius: 8px; background: light-dark(#fff, #1b1f23); color: light-dark(rgb(0 0 0 / 0.9), rgb(255 255 255 / 0.9)); font-size: 14px; line-height: 20px;
    box-shadow: 0 0 0 1px light-dark(rgb(140 140 140 / 0.2), rgb(255 255 255 / 0.12)), 0 4px 12px rgb(0 0 0 / 0.25); }
  .hc-li__banner { display: block; inline-size: 100%; block-size: auto; aspect-ratio: 4 / 1; }
  .hc-li__body { padding: 0 16px 16px; }
  .hc-li__avatar { position: relative; display: block; inline-size: 72px; block-size: 72px; margin-block: -36px 8px; border-radius: 50%; border: 2px solid light-dark(#fff, #1b1f23); box-sizing: content-box; }
  .hc-li__name { font-size: 16px; font-weight: 600; line-height: 24px; }
  .hc-li__headline { margin-block-start: 2px; }
  .hc-li__meta { margin-block-start: 4px; font-size: 12px; line-height: 16px; color: light-dark(rgb(0 0 0 / 0.6), rgb(255 255 255 / 0.6)); }
  .hc-li__bio { margin-block-start: 8px; color: light-dark(rgb(0 0 0 / 0.75), rgb(255 255 255 / 0.75)); }
  .hc-li__btn { display: inline-flex; align-items: center; gap: 4px; min-block-size: 32px; margin-block-start: 12px; padding: 6px 16px; border-radius: 9999px; background: light-dark(#0a66c2, #71b7fb); color: light-dark(#fff, #000); font-size: 16px; font-weight: 600; line-height: 20px; text-decoration: none; transition: background-color 167ms; }
  .hc-li__btn:hover { background: light-dark(#004182, #a8d4ff); color: light-dark(#fff, #000); text-decoration: none; }
  .hc-li__btn svg { inline-size: 16px; block-size: 16px; fill: currentColor; }
  /* Instagram: its profile header in a card: the photo in the story ring at the left; the username with a blue Follow beside it,
     then name and category; the bio and the link below; white or Instagram's dark grey, 12 px corners, a soft shadow */
  .hovercard.hovercard--instagram { inline-size: min(22rem, calc(100vw - 2rem)); padding: 20px; border-radius: 12px; background: light-dark(#fff, #262626); color: light-dark(#000, #f5f5f5); font-size: 14px; line-height: 18px;
    box-shadow: 0 0 0 1px light-dark(rgb(0 0 0 / 0.06), rgb(255 255 255 / 0.08)), 0 6px 20px light-dark(rgb(0 0 0 / 0.14), rgb(0 0 0 / 0.55)); }
  .hc-ig__head { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; gap: 6px 18px; }
  .hc-ig__ring { grid-row: 1 / span 2; padding: 3px; border-radius: 50%; background: linear-gradient(45deg, #feda75, #fa7e1e 25%, #d62976 50%, #962fbf 75%, #4f5bd5); }
  .hc-ig__avatar { display: block; inline-size: 70px; block-size: 70px; border-radius: 50%; border: 3px solid light-dark(#fff, #262626); box-sizing: content-box; }
  .hc-ig__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; align-self: end; }
  .hc-ig__user { font-size: 16px; font-weight: 600; line-height: 20px; }
  .hc-ig__who { align-self: start; }
  .hc-ig__name { font-weight: 600; }
  .hc-ig__cat { color: light-dark(#737373, #a8a8a8); }
  .hc-ig__bio { margin-block-start: 16px; }
  .hc-ig__link { display: flex; align-items: center; gap: 4px; margin-block-start: 6px; color: light-dark(#00376b, #e0f1ff); font-weight: 600; }
  .hc-ig__link svg { flex: none; inline-size: 14px; block-size: 14px; fill: currentColor; }
  .hc-ig__follow { display: inline-flex; align-items: center; justify-content: center; min-block-size: 32px; padding-inline: 16px; border-radius: 8px; background: #0095f6; color: #fff; font-size: 14px; font-weight: 600; text-decoration: none; transition: background-color 150ms; }
  .hc-ig__follow:hover { background: #1877f2; color: #fff; text-decoration: none; }
  .copy-wrap { position: relative; display: inline-block; }

  /* ---- tooltip (hover and focus; Esc dismisses via JS) ----------------- */
  [data-tip] { position: relative; }
  [data-tip]::after { content: attr(data-tip); position: absolute; inset-block-end: calc(100% + 0.5rem); inset-inline-start: 50%; translate: -50% 6px; padding: var(--space-1) var(--space-2); background: var(--color-bg-inverse); color: var(--color-text-inverse); font: var(--text-meta); white-space: nowrap; opacity: 0; pointer-events: none; z-index: var(--z-tooltip); transition: opacity var(--motion-duration-base) var(--motion-easing-out) 200ms, translate var(--motion-duration-base) var(--motion-easing-out) 200ms; }
  [data-tip]:is(:hover, :focus-visible, .is-tip):not([data-tip-off])::after { opacity: 1; translate: -50% 0; }
  @media (hover: none) { [data-tip]:not(.is-tip)::after { display: none; } }

  /* ---- chat --------------------------------------------------------------- */
  .chat { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; inline-size: min(100%, 36rem); max-block-size: min(80dvh, 44rem); background: var(--color-bg-primary); border: var(--border-strong); box-shadow: var(--elevation-hard-md); }
  .chat__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); padding: var(--space-4); border-block-end: var(--border-subtle); }
  .chat__title { font: 600 1.375rem/1.15 var(--font-display); letter-spacing: -0.025em; max-inline-size: 18ch; text-wrap: balance; }
  .chat__sub { margin-block-start: var(--space-1); font: var(--text-body-sm); color: var(--color-text-secondary); max-inline-size: 38ch; }
  .chat__log { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: var(--space-4); padding: var(--space-4); overflow: auto; }
  .suggest-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
  /* a suggested question: a plain row with an arrow in front and a dotted rule under it; on hover the words turn
     primary, a blue line draws under them and the arrow steps forward. No box. */
  .suggest { display: flex; align-items: baseline; gap: var(--space-3); padding: var(--space-3) 0; border: 0; background: var(--rule-dotted-h) bottom / 100% 1px no-repeat; text-align: start; font: var(--text-body-sm); color: var(--color-text-secondary); cursor: pointer; transition: color var(--motion-duration-fast) var(--motion-easing-standard); }
  .suggest > .icon { order: -1; flex: none; translate: 0 0.15em; color: var(--color-accent-2-text); transition: translate var(--motion-duration-base) var(--motion-easing-out); }
  .suggest > span { background: linear-gradient(var(--color-accent-2-text), var(--color-accent-2-text)) 0 100% / 0% 1px no-repeat; transition: background-size var(--motion-duration-base) var(--motion-easing-out); }
  .suggest:is(:hover, :focus-visible, .is-hover) { color: var(--color-text-primary); }
  .suggest:is(:hover, :focus-visible, .is-hover) > .icon { translate: 4px 0.15em; }
  .suggest:is(:hover, :focus-visible, .is-hover) > span { background-size: 100% 1px; }
  .msg { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); max-inline-size: 92%; animation: rise-in var(--motion-duration-base) var(--motion-easing-out) backwards; } /* not "both": a kept transform would trap its cards inside the scrolling log */
  .msg__who { font: var(--text-label); color: var(--color-text-tertiary); }
  .msg__body { padding: var(--space-3) var(--space-4); border: var(--border-default); background: var(--color-bg-secondary); font: var(--text-body-sm); }
  .msg--user { justify-self: end; }
  .msg--user .msg__body { background: var(--color-bg-inverse); border-color: var(--color-bg-inverse); color: var(--color-text-inverse); }
  .msg__sources { display: flex; flex-wrap: wrap; gap: var(--space-2); }
  .msg__reach { gap: var(--space-1) var(--space-5); }
  .msg__reach .social { font: var(--text-body-sm); min-block-size: 2rem; }
  /* ...and only exist while open (Chrome counts even a hidden fixed card in the log's scroll height): display flips with the fade */
  .chat .hovercard { position: fixed; inset: var(--cy, 0px) auto auto var(--cx, 0px); display: none; translate: 0 6px; transition-property: opacity, translate, visibility, display; transition-behavior: allow-discrete; }
  .chat .social-item:is(:hover, :focus-within, .is-hover, .is-open) .hovercard { display: block; translate: 0 0; }
  @starting-style { .chat .social-item:is(:hover, :focus-within, .is-hover, .is-open) .hovercard { opacity: 0; translate: 0 6px; } }
  .chat .hovercard::before { display: none; }
  .msg__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
  .msg__listen { min-block-size: 2.25rem; padding-inline: var(--space-3); }
  .msg__listen[aria-pressed="true"] { background: var(--color-bg-inverse); border-color: var(--color-bg-inverse); color: var(--color-text-inverse); }
  .alert__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-block-start: var(--space-3); }
  .composer { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); padding: var(--space-3) var(--space-3) calc(var(--space-3) * var(--card-bottom-ratio)); border-block-start: var(--border-subtle); }
  .composer__row { display: flex; align-items: flex-end; gap: var(--space-2); }
  .composer__input { flex: 1; min-inline-size: 0; min-block-size: var(--control-md); max-block-size: 9rem; padding: 0.7rem var(--space-3); border: var(--border-default); background: var(--color-bg-primary); font: var(--text-body-sm); color: var(--color-text-primary); caret-color: var(--color-accent-2); }
  .composer__input::placeholder { color: var(--color-text-tertiary); opacity: 1; }
  .composer__input:hover { border-color: var(--color-border-strong); }
  .composer__input:focus-visible { outline: var(--focus-ring); outline-offset: 0; border-color: var(--color-border-strong); }
  .composer__hint { font: var(--text-meta); color: var(--color-text-tertiary); }
  @media (hover: none), (pointer: coarse), (max-width: 63.99em) { .composer__hint { display: none; } } /* no keyboard shortcuts to explain on phones and tablets */
  .composer__status { display: flex; align-items: center; gap: var(--space-2); font: var(--text-meta); color: var(--color-text-secondary); }
  .rec { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: var(--space-3); min-block-size: var(--control-md); padding: 0 var(--space-3); border: 1px solid var(--color-accent-border); background: var(--color-accent-subtle); }
  .rec__dot { inline-size: 0.75rem; block-size: 0.75rem; background: var(--color-accent); animation: blink 1.2s steps(1) infinite; }
  .rec__meter { display: flex; align-items: center; gap: 2px; block-size: 1.5rem; color: var(--color-text-primary); }
  .rec__meter i { inline-size: 3px; block-size: var(--lvl, 20%); background: currentColor; }
  .rec__time { font: var(--text-mono-ui); font-variant-numeric: tabular-nums; }
  .rec__actions { display: flex; gap: var(--space-1); }
  .fallback { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); padding: var(--space-4) var(--space-4) calc(var(--space-4) * var(--card-bottom-ratio)); border: 1px dashed var(--color-border-default); background: var(--color-bg-secondary); }
  .fallback__text { font: var(--text-body-sm); color: var(--color-text-secondary); }
  .fallback__links { display: flex; flex-wrap: wrap; gap: var(--space-2); }

  /* ---- resume preview shell --------------------------------------------- */
  /* the resume frame: one A4 page of the real resume (its own page, which draws itself as wide as the frame) */
  .resume__frame { position: relative; aspect-ratio: var(--ratio-resume); overflow: hidden; border: var(--border-default); background: #fff; } /* paper stays white in both themes */
  .resume__frame > iframe { position: absolute; inset: 0; inline-size: 1px; min-inline-size: 100%; block-size: 100%; border: 0; } /* 1px + min 100%: iOS Safari would otherwise size the frame to its content */

  /* ---- feedback: alert, toast, skeleton, empty ----------------------------- */
  .alert { --_c: var(--color-border-strong); --_bg: var(--color-bg-secondary); display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: var(--space-3); padding: var(--space-4) var(--space-4) calc(var(--space-4) * var(--card-bottom-ratio)); background: var(--_bg); border: var(--border-default); border-inline-start: 4px solid var(--_c); animation: rise-in var(--motion-duration-base) var(--motion-easing-out) both; }
  .alert--success { --_c: var(--color-success); --_bg: var(--color-success-subtle); }
  .alert--warning { --_c: var(--color-warning); --_bg: var(--color-warning-subtle); }
  .alert--error { --_c: var(--color-error); --_bg: var(--color-error-subtle); }
  .alert--info { --_c: var(--color-info); --_bg: var(--color-info-subtle); }
  .alert__icon { color: var(--_c); margin-block-start: 2px; }
  .alert__title { font: 600 1rem/1.3 var(--font-display); }
  .alert__text { font: var(--text-body-sm); color: var(--color-text-secondary); }
  .alert__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-block-start: var(--space-3); }
  .alert__close { display: grid; place-items: center; inline-size: var(--control-sm); block-size: var(--control-sm); margin: calc(-1 * var(--space-2)) calc(-1 * var(--space-2)) 0 0; color: var(--color-text-secondary); }
  .alert__close:hover { background: var(--color-state-hover); color: var(--color-text-primary); }
  .alert.is-leaving > * { animation: none; opacity: 0; transform: translateY(-4px); transition: opacity calc(var(--motion-leave-duration) * var(--motion-text-share)) var(--motion-easing-in), transform calc(var(--motion-leave-duration) * var(--motion-text-share)) var(--motion-easing-in); }
  .alert.is-leaving { transition-delay: calc(var(--motion-leave-duration) * var(--motion-text-delay)); opacity: 0; transform: translateY(calc(var(--motion-leave-distance) * -1)); transition: opacity var(--motion-leave-duration) var(--motion-easing-in), transform var(--motion-leave-duration) var(--motion-easing-in); }
  .toast { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); background: var(--color-bg-inverse); color: var(--color-text-inverse); font: var(--text-mono-ui); white-space: nowrap; box-shadow: var(--elevation-hard-sm); animation: rise-in var(--motion-duration-base) var(--motion-easing-out) both; }
  .toast--anchored { position: absolute; inset-block-end: calc(100% + 0.5rem); inset-inline-start: 0; z-index: var(--z-toast); }
  .toast-region { position: fixed; inset-inline: 0; inset-block-end: calc(var(--dock-clearance) + 0.5rem); z-index: var(--z-toast); display: flex; justify-content: center; pointer-events: none; }
  .skeleton { display: block; min-block-size: 1em; background: linear-gradient(90deg, var(--color-bg-tertiary) 0 40%, var(--color-state-active) 50%, var(--color-bg-tertiary) 60% 100%) 0 0 / 200% 100%; animation: skeleton 1.8s steps(18) infinite; }
  .empty { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); justify-items: start; padding: var(--space-6) var(--space-6) calc(var(--space-6) * var(--card-bottom-ratio)); border: 1px dashed var(--color-border-default); background: var(--color-bg-secondary); }
  .empty__title { font: var(--text-mono-ui); }
  .empty__text { font: var(--text-body-sm); color: var(--color-text-secondary); max-inline-size: 44ch; }

  /* ---- form field ------------------------------------------------------------- */
  .field { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
  .field__label { font: var(--text-body-sm); }
  .field__control { min-block-size: var(--control-md); padding: 0 var(--space-3); background: var(--color-bg-primary); border: var(--border-default); font: var(--text-body); color: var(--color-text-primary); caret-color: var(--color-accent-2); }
  .field__control::placeholder { color: var(--color-text-tertiary); opacity: 1; }
  .field__control:is(:hover, .is-hover) { border-color: var(--color-border-strong); }
  .field__control:is(:focus-visible, .is-focus) { outline: var(--focus-ring); outline-offset: 0; border-color: var(--color-border-strong); }
  .field__control:disabled { border-style: dashed; border-color: var(--color-border-subtle); color: var(--color-text-disabled); cursor: not-allowed; }
  .field__hint { font: var(--text-meta); color: var(--color-text-tertiary); }
  .field[data-invalid] .field__control { border-color: var(--color-error); border-inline-start-width: 4px; }
  .field__error { display: flex; align-items: center; gap: var(--space-2); font: var(--text-body-sm); color: var(--color-error); }

  /* ---- hero composition and the name wordmark ---------------------------
     A red (or blue) rectangle behind your photo, the photo never cropped or
     clipped, and the name set huge underneath. The rectangle scrolls faster
     than the photo.                                                       */
  .hero-stack { position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1fr); --photo-w: 82%; --photo-ratio: 3 / 4; --box-dx: 12%; --box-dy: -5%; }
  .hero-stack > * { grid-area: 1 / 1; justify-self: start; }
  /* The rectangle is the same size and ratio as its photo, set behind it and offset, so the pair stays in proportion at every width.
     JS sets --shift: the rectangle rises above the photo as you scroll down and drops below it as you scroll back up. */
  .hero-stack__block { z-index: -1; inline-size: var(--photo-w); aspect-ratio: var(--photo-ratio); align-self: end; background: var(--color-accent); will-change: transform; transform: translate3d(var(--box-dx), calc(var(--box-dy) - var(--shift, 0px)), 0); }
  .hero-stack__block::after { content: ""; position: absolute; inset: 0; background-image: var(--texture-grain); mix-blend-mode: multiply; opacity: 0.3; pointer-events: none; }
  .hero-stack--blue .hero-stack__block { background: var(--color-accent-2); }
  .wordmark { display: grid; grid-template-columns: minmax(0, 1fr); font: var(--text-wordmark); letter-spacing: var(--text-wordmark-ls); white-space: nowrap; user-select: none; }
  .wordmark > span { display: block; padding-inline-end: 0.06em; } /* the tight tracking pulls the last letter's ink past its box */
  .wordmark > span:last-child { justify-self: end; }
  .wordmark--heavy { font-weight: var(--weight-heavy); }
  .wordmark--pixel { font-family: var(--font-pixel); font-weight: 400; letter-spacing: -0.035em; line-height: 0.9; }

  /* ---- footer ------------------------------------------------------------------ */
  .site-foot { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-10); padding-block: var(--space-12) var(--space-8); padding-inline: var(--layout-frame-pad); } /* the same air off the dotted guides as every section */
  .site-foot__grid { display: grid; gap: var(--space-6) var(--space-8); grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); padding-block-start: var(--space-6); background: var(--rule-dotted-h) top / 100% 1px no-repeat; }
  .site-foot__col { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); align-content: start; font: var(--text-body-sm); }
  .site-foot__col h3 { font: var(--text-label); color: var(--color-text-tertiary); letter-spacing: var(--text-label-ls); }
  .site-foot__col :is(a:not(.social, .hovercard a), .site-foot__copy) { justify-self: start; text-decoration: none; font-weight: var(--link-weight); background: linear-gradient(var(--color-accent-2-text), var(--color-accent-2-text)) 0 100% / 0% 2px no-repeat; transition: background-size var(--motion-duration-base) var(--motion-easing-out), color var(--motion-duration-fast) var(--motion-easing-standard), font-weight var(--motion-duration-fast) var(--motion-easing-standard), letter-spacing var(--motion-duration-fast) var(--motion-easing-standard); }
  .site-foot__col :is(a:not(.social, .hovercard a), .site-foot__copy):is(:hover, :focus-visible) { color: var(--color-accent-2-text); font-weight: var(--link-weight-hover); letter-spacing: var(--link-hover-tracking); background-size: 100% 2px; }
  .site-foot__copy { padding: 0 0 0.1em; border: 0; font: inherit; font-weight: var(--link-weight); color: inherit; text-align: start; cursor: pointer; overflow-wrap: anywhere; }
  .social-list--col { flex-direction: column; align-items: flex-start; gap: 0; } /* only the link, not the empty space beside it, opens the card */
  .site-foot__col .social { font: var(--text-body-sm); min-block-size: 2rem; }
  /* footer: a card opens beside its link, rising from the link's foot, so it never covers the links above it */
  .site-foot .hovercard--up { inset-block-end: 0; inset-inline-start: calc(100% + 0.75rem); }
  .site-foot .hovercard--up::before { inset: 0 100% 0 auto; inline-size: 0.75rem; block-size: auto; }


  /* ---- motion: a box and its words move as one ----------------------------
     The box leads. Its words start a fifth of the way in, use the same easing
     and land with the box, so text never beats against its container. Wrap the
     words in .m-text. Exits run the other way round: the words go first, the
     box follows. Same tokens everywhere, so every box shares one tempo.      */
  @keyframes box-in { from { opacity: 0; transform: translate3d(0, var(--motion-rise-distance), 0); } }
  @keyframes text-in { from { opacity: 0; transform: translate3d(0, calc(var(--motion-rise-distance) * 0.5), 0); } }
  @keyframes box-out { to { opacity: 0; transform: translate3d(0, calc(var(--motion-leave-distance) * -1), 0); } } /* the box leaves upward, the same way its words do */
  @keyframes text-out { to { opacity: 0; transform: translate3d(0, calc(var(--motion-leave-distance) * -0.4), 0); } }
  @keyframes box-press { 40% { transform: scale(0.965); } }
  .m-box { backface-visibility: hidden; will-change: transform, opacity; }
  .m-text { display: block; backface-visibility: hidden; }
  .m-box.is-entering { animation: box-in var(--motion-rise-duration) var(--motion-easing-out) both; animation-delay: calc(var(--i, 0) * var(--motion-rise-stagger)); }
  .m-box.is-entering > .m-text { animation: text-in calc(var(--motion-rise-duration) * var(--motion-text-share)) var(--motion-easing-out) both; animation-delay: calc(var(--i, 0) * var(--motion-rise-stagger) + var(--motion-rise-duration) * var(--motion-text-delay)); }
  .m-box.is-leaving { animation: box-out var(--motion-leave-duration) var(--motion-easing-in) both; animation-delay: calc(var(--motion-leave-duration) * var(--motion-text-delay)); }
  .m-box.is-leaving > .m-text { animation: text-out calc(var(--motion-leave-duration) * var(--motion-text-share)) var(--motion-easing-in) both; }
  .m-box[data-reveal] > .m-text { opacity: 0; transform: translate3d(0, calc(var(--motion-rise-distance) * 0.5), 0); transition: opacity calc(var(--motion-reveal-duration) * var(--motion-text-share)) var(--motion-easing-out) calc(var(--motion-reveal-duration) * var(--motion-text-delay)), transform calc(var(--motion-reveal-duration) * var(--motion-text-share)) var(--motion-easing-out) calc(var(--motion-reveal-duration) * var(--motion-text-delay)); }
  .m-box[data-reveal].is-in > .m-text { opacity: 1; transform: none; }
  /* morph: a state change in place. The box presses, the old words roll up and out, the new ones roll in. */
  .m-morph { display: inline-grid; }
  .m-morph > .m-text { grid-area: 1 / 1; transition: opacity calc(var(--motion-morph-duration) * var(--motion-text-share)) var(--motion-easing-standard), transform var(--motion-morph-duration) var(--motion-easing-out); }
  .m-morph > .m-text:first-child { opacity: 1; transform: none; }
  .m-morph > .m-text:last-child { opacity: 0; transform: translate3d(0, 0.45em, 0); transition-delay: calc(var(--motion-morph-duration) * var(--motion-text-delay)); }
  .m-morph.is-on > .m-text:first-child { opacity: 0; transform: translate3d(0, -0.45em, 0); }
  .m-morph.is-on > .m-text:last-child { opacity: 1; transform: none; }
  .m-pressing { animation: box-press calc(var(--motion-morph-duration) * 1.15) var(--motion-easing-out); }
  /* Alerts, toasts and chat messages already rise as boxes; their contents now follow the same way. */
  :is(.alert, .toast, .msg) { backface-visibility: hidden; }
  :is(.alert, .toast, .msg) > * { animation: text-in calc(var(--motion-duration-base) * var(--motion-text-share)) var(--motion-easing-out) backwards; animation-delay: calc(var(--motion-duration-base) * var(--motion-text-delay)); }

  /* ---- photos: never cropped, cut out or filtered --------------------------
     A photo is an <img> at width 100% and height auto (or one shared height
     and width auto). No object-fit, no aspect-ratio on the image, no clipping
     ancestor, no greyscale. It is only shrunk, at its own ratio.            */

  /* Lift: the hover and press language for anything you can open. A hard blue
     shadow under the photo, like the command button. */
  .card-project__hero, .gallery__open { transition: translate var(--motion-duration-base) var(--motion-easing-out), box-shadow var(--motion-duration-base) var(--motion-easing-out); }
  :is(.card-project, .gallery__item):is(:hover, .is-hover) :is(.card-project__hero, .gallery__open),
  .card-project:focus-visible .card-project__hero,
  .gallery__open:focus-visible { translate: -4px -4px; box-shadow: var(--elevation-blue-md); }
  :is(.card-project, .gallery__item):is(:active, .is-active) :is(.card-project__hero, .gallery__open) { translate: 0 0; box-shadow: none; }

  /* Dither: photos answer the pointer with pixels. A canvas sits over the
     photo and is empty at rest: a dissolve when the photo arrives or swaps, a
     blue ring that follows the pointer, a ripple on tap or click.           */
  .dither { position: relative; display: block; }
  .dither__canvas { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; pointer-events: none; image-rendering: pixelated; }
  .js .dither:not(.is-in) > img { visibility: hidden; animation: dither-failsafe 0s linear 3s forwards; }
  @keyframes dither-failsafe { to { visibility: visible; } }

  .hero-stack__photo { inline-size: var(--photo-w); align-self: end; }
  .hero-stack__photo img { display: block; inline-size: 100%; block-size: auto; }

  /* ---- tech stack: logos only. The name shows on hover, focus or tap and is
         always the accessible label. Brand colours, except where a brand is
         too pale or too dark for the theme, then ink or paper.            */
  .stack { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; background: var(--rule-dotted-v) left / 1px 100% no-repeat, var(--rule-dotted-h) top / 100% 1px no-repeat; }
  /* 4, 5 and 10 columns all divide 20 logos into whole rows. Keep the count divisible, or adjust. */
  @media (min-width: 48em) { .stack { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
  @media (min-width: 64em) { .stack { grid-template-columns: repeat(10, minmax(0, 1fr)); } }
  .stack__item { background: var(--rule-dotted-v) right / 1px 100% no-repeat, var(--rule-dotted-h) bottom / 100% 1px no-repeat; }
  .stack__btn { position: relative; display: grid; place-items: center; inline-size: 100%; aspect-ratio: 1; color: var(--logo, var(--color-text-primary)); cursor: default; }
  .stack__btn:focus-visible { outline-offset: -6px; }
  .stack__btn[data-tip]::after { inset-block-end: calc(50% + 2.1rem); }
  .stack__logo { inline-size: calc(2.5rem * var(--s, 1)); block-size: calc(2.5rem * var(--s, 1)); fill: currentColor; }
  @keyframes logo-pulse { 0%, 100% { transform: scale(1); } 38% { transform: scale(1.12); } }
  .stack__logo.is-pulse { animation: logo-pulse var(--motion-ripple-duration) var(--motion-easing-out); }
  @media (hover: none) { .stack__btn[data-tip]::after { display: block; } }
  /* phones (4 columns): the edge logos' names open inward, so they never run past the screen */
  @media (max-width: 47.99em) {
    .stack__item:nth-child(4n + 1) .stack__btn[data-tip]::after { inset-inline-start: 0; translate: 0 6px; }
    .stack__item:nth-child(4n) .stack__btn[data-tip]::after { inset-inline-start: auto; inset-inline-end: 0; translate: 0 6px; }
    .stack__item:is(:nth-child(4n + 1), :nth-child(4n)) .stack__btn[data-tip]:is(:hover, :focus-visible, .is-tip)::after { translate: 0 0; }
  }

  /* ---- accordion: questions are compact rows with a plus on the right; one answer open at a time.
         The panel eases open (grid rows 0fr to 1fr) and the script reveals the answer line by line.
         Without script every answer is simply shown. ---- */
  .accordion { display: grid; grid-template-columns: minmax(0, 1fr); }
  .acc__item { --frame: 1; background: var(--rule-dotted-h) top left / calc(100% * var(--frame)) 1px no-repeat; transition: --frame var(--motion-kpi-frame) var(--motion-easing-out); }
  .acc__item:last-child { background: var(--rule-dotted-h) top left / calc(100% * var(--frame)) 1px no-repeat, var(--rule-dotted-h) bottom left / calc(100% * var(--frame)) 1px no-repeat; }
  .js .acc__item:not(.is-in) { --frame: 0; animation: frame-failsafe 0s linear 5s forwards; }
  .acc__trigger { display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); inline-size: 100%; padding-block: var(--space-5); text-align: start; font: var(--text-h5); letter-spacing: var(--text-h5-ls); color: var(--color-text-primary); cursor: pointer; }
  .acc__text { max-inline-size: 40ch; text-wrap: balance; }
  .acc__icon { position: relative; flex: none; inline-size: 1.25rem; block-size: 1.25rem; color: var(--color-text-secondary); transition: color var(--motion-duration-fast) var(--motion-easing-standard), rotate var(--motion-duration-base) var(--motion-easing-out); }
  .acc__icon i { position: absolute; inset-inline: 0; inset-block-start: calc(50% - 1px); block-size: 2px; background: currentColor; transition: transform var(--motion-duration-base) var(--motion-easing-out); }
  .acc__icon i:last-child { transform: rotate(90deg); }
  .acc__trigger:is(:hover, :focus-visible) .acc__icon { color: var(--color-text-primary); }
  .acc__item.is-open .acc__icon { color: var(--color-accent-2-text); rotate: 180deg; }
  .acc__item.is-open .acc__icon i:last-child { transform: rotate(90deg) scaleX(0); }
  .acc__panel { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows var(--motion-duration-slow) var(--motion-easing-out), visibility 0s linear var(--motion-duration-slow); }
  .acc__item.is-open .acc__panel { grid-template-rows: 1fr; visibility: visible; transition-delay: 0s; }
  .acc__body { min-block-size: 0; overflow: hidden; }
  .acc__a { color: var(--color-text-secondary); max-inline-size: 66ch; padding-block-end: var(--space-6); text-wrap: pretty; }
  .acc__a .ln { display: block; }
  html:not(.js) .acc__panel { grid-template-rows: 1fr; visibility: visible; }

  /* ---- back to home: fixed at the bottom right of the frame on case-study pages. On narrower screens it sits above the dock. ---- */
  .back-home { position: fixed; z-index: var(--z-sticky); inset-block-end: max(var(--space-4), env(safe-area-inset-bottom)); inset-inline-end: calc(max(var(--layout-margin), 50vw - var(--layout-content-width) / 2) + var(--layout-frame-pad)); display: inline-flex; align-items: center; gap: var(--space-2); min-block-size: var(--control-md); padding-inline: var(--space-4); background: var(--color-bg-primary); border: var(--border-strong); box-shadow: var(--elevation-hard-sm); font: var(--text-button); color: var(--color-text-primary); text-decoration: none; transition: translate var(--motion-duration-base) var(--motion-easing-out), box-shadow var(--motion-duration-base) var(--motion-easing-out); }
  .back-home:is(:hover, :focus-visible) { translate: -2px -2px; box-shadow: var(--elevation-blue-md); }
  .back-home .icon { transition: translate var(--motion-duration-base) var(--motion-easing-out); }
  .back-home:is(:hover, :focus-visible) .icon { translate: -3px 0; }
  @media (max-width: 63.99em) {
    body[data-page="page"] .dock { justify-content: flex-start; align-items: flex-start; padding-inline-start: var(--space-4); }
    body[data-page="page"] .back-home { inset-inline-end: var(--space-4); animation: back-in 700ms var(--motion-easing-out) 350ms both; }
  }
  @media (max-width: 35.99em) { body[data-page="page"] .dock__menu { animation: dock-left 700ms var(--motion-easing-out) 150ms both; } body[data-page="page"] .back-home { min-block-size: 3rem; } }
  @media (min-width: 36em) and (max-width: 63.99em) { body[data-page="page"] .dock__list { animation: dock-left 700ms var(--motion-easing-out) 150ms both; } body[data-page="page"] .back-home { min-block-size: calc(var(--control-md) + 2 * var(--space-1) + 2 * var(--border-width-hairline)); } /* as tall as the dock bar */ }
  @media (min-width: 36em) and (max-width: 47.99em), (min-width: 64em) and (max-width: 71.99em) { body[data-page="page"] .back-home > span { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } } /* arrow only where the dock leaves little room (576-767 px; 1024-1151 px beside the wider cmd + K dock) */
  @keyframes dock-left { from { translate: calc(50vw - 50% - var(--space-4)) 0; } }

  /* ---- dock: its entrance, then tucked away while reading ---------------------------------------------------------------
     Entrance (script adds .is-in): the bar opens out from its middle, its dividers and underlines draw, every icon draws its
     own lines in, left to right, and the hard shadow lands last. On the home page it waits until the hero has fully arrived;
     without the script everything shows after 6 s. Then scrolling down tucks it below the screen (.is-away) and scrolling
     up brings it back; the first time it goes, a blue alert says so (.nav-alert). */
  @media (prefers-reduced-motion: no-preference) {
    .js .dock .icon { stroke-dasharray: 120; stroke-dashoffset: 0; transition: stroke-dashoffset 900ms cubic-bezier(0.45, 0, 0.2, 1) var(--d, 0ms), opacity 240ms linear var(--d, 0ms), stroke-width var(--motion-duration-fast) var(--motion-easing-standard); }
    .js .dock :is(.dock__sep, .theme-toggle__line, .dock__kbd, .dock__menu > span) { transition: scale 460ms var(--motion-easing-out) var(--d, 0ms), opacity 320ms linear var(--d, 0ms), translate var(--motion-duration-base) var(--motion-easing-out); }
    .js .dock:not(.is-in) .icon { stroke-dashoffset: 120; opacity: 0; animation: dock-icon-failsafe 0s linear 6s forwards; }
    .js .dock:not(.is-in) .dock__sep { scale: 1 0; animation: dock-part-failsafe 0s linear 6s forwards; }
    .js .dock:not(.is-in) .theme-toggle__line { scale: 0 1; animation: dock-part-failsafe 0s linear 6s forwards; }
    .js .dock:not(.is-in) :is(.dock__kbd, .dock__menu > span) { opacity: 0; animation: dock-part-failsafe 0s linear 6s forwards; }
    @media (min-width: 36em) {
      .js .dock .dock__list { transition: clip-path 620ms cubic-bezier(0.65, 0, 0.35, 1), box-shadow 360ms var(--motion-easing-out) var(--shadow-d, 1100ms); }
      .js .dock:not(.is-in) .dock__list { clip-path: inset(0 50% 0 50%); box-shadow: 0 0 0 transparent; animation: dock-box-failsafe 0s linear 6s forwards; }
    }
    @media (max-width: 35.99em) {
      .js .dock .dock__menu { transition: clip-path 560ms cubic-bezier(0.65, 0, 0.35, 1), box-shadow 360ms var(--motion-easing-out) 760ms; }
      .js .dock:not(.is-in) .dock__menu { clip-path: inset(0 50% 0 50%); box-shadow: 0 0 0 transparent; animation: dock-box-failsafe 0s linear 6s forwards; }
    }
    .dock { transition: translate 560ms cubic-bezier(0.6, 0, 0.2, 1); }
  }
  @keyframes dock-icon-failsafe { to { stroke-dashoffset: 0; opacity: 1; } }
  @keyframes dock-part-failsafe { to { scale: 1 1; opacity: 1; } }
  @keyframes dock-box-failsafe { to { clip-path: inset(0 0 0 0); box-shadow: var(--elevation-hard-md); } }
  .dock.is-away { translate: 0 calc(100% + var(--space-8) + env(safe-area-inset-bottom)); }
  /* the alert: the blue accent with its own ink (white on it: 5.9:1 light, 5.2:1 dark, AA at any size); bold 19 px.
     Two balanced lines, left aligned, a close button at the right; it goes after 6 s (the white line under it counts down),
     the count pauses while the pointer or focus is on it */
  .nav-alert { position: fixed; inset-inline: 0; inset-block-end: max(var(--space-4), env(safe-area-inset-bottom)); z-index: var(--z-toast); inline-size: min(34rem, calc(100vw - 2rem)); margin-inline: auto;
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: var(--space-3); padding: var(--space-4) var(--space-3) var(--space-4) var(--space-5);
    background: var(--color-accent-2); color: var(--color-on-accent-2); box-shadow: var(--elevation-hard-md); translate: 0 calc(100% + var(--space-8)); opacity: 0; transition: translate 520ms cubic-bezier(0.2, 0.9, 0.25, 1), opacity 200ms linear; }
  .nav-alert.is-on { translate: 0 0; opacity: 1; }
  .nav-alert[hidden] { display: none; }
  .nav-alert__text { margin: 0; font: 700 1.1875rem / 1.3 var(--font-sans); letter-spacing: -0.01em; text-wrap: balance; text-align: start; }
  .nav-alert__close { display: grid; place-items: center; inline-size: 2.25rem; block-size: 2.25rem; margin: -0.3rem -0.1rem 0 0; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; }
  .nav-alert__close .icon { stroke-width: 2px; }
  .nav-alert__close:hover { background: rgb(from currentColor r g b / 0.16); }
  .nav-alert__close:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
  .nav-alert__timer { position: absolute; inset-inline: 0; inset-block-end: 0; block-size: 3px; background: currentColor; transform-origin: 0 50%; }
  .nav-alert.is-on .nav-alert__timer { animation: nav-alert-timer 6s linear forwards; }
  .nav-alert.is-paused .nav-alert__timer { animation-play-state: paused; }
  @keyframes nav-alert-timer { to { scale: 0 1; } }
  @media (prefers-reduced-motion: reduce) { .nav-alert { transition: none; } .nav-alert__timer { display: none; } }
  @keyframes back-in { from { translate: calc(100% + var(--space-8)) 0; } }
  @media (prefers-reduced-motion: reduce) { body[data-page="page"] :is(.dock__menu, .dock__list, .back-home) { animation: none; } }

  /* ---- shelves: the books he wants to finish and the games he wants to play, after cali.so's bookshelf ---------------------
     A subsection of About: a dotted hairline, a subheading, then two wooden shelves side by side (books left, games right;
     one under the other below 64em). Every book and game is a 3D object at its real size (1 px per mm): a cover on the
     front, a spine on the side. Standing ones show their spines; one per shelf stands open, cover out. Some games lie in
     stacks. A tap opens a standing one; a second tap brings it close to the screen, where it tilts toward the pointer and a
     line of light crosses it (the postcard's own hover); a third tap puts it back. A tap on a case in a stack lifts the cases
     above it and brings that one close. Four pixel agents build the shelves as the page scrolls (script: #shelves); without
     the script, or with reduced motion, the shelves are simply there. ---- */
  .s-shelves { position: relative; margin-block-start: var(--space-16); --fill: 1; --shade: 1;
    --wood-front-top: light-dark(#cfb797, #604a39); --wood-front-bottom: light-dark(#9d7957, #39261b); --wood-top-front: light-dark(#dccbb0, #6b5848); --wood-top-back: light-dark(#c4ae91, #4f3c2f);
    --wood-grain: light-dark(rgb(71 42 17 / 0.08), rgb(0 0 0 / 0.16)); --wood-shadow: light-dark(rgb(27 22 17), rgb(0 0 0)); }
  .s-shelves__pin { position: relative; display: grid; align-content: center; gap: var(--space-8); }
  .s-shelves.is-pinned { block-size: calc(100svh + var(--build-run, 320svh)); }
  .s-shelves.is-pinned .s-shelves__pin { position: sticky; inset-block-start: 0; min-block-size: 100svh; padding-block: var(--space-12); grid-template-rows: auto minmax(0, 1fr); align-content: stretch; }
  .s-shelves.is-pinned .s-shelves__row { align-self: center; }
  .s-shelves.is-pinned.is-done { block-size: auto; }
  .s-shelves.is-pinned.is-done .s-shelves__pin { position: relative; }
  .s-shelves__title { font: var(--text-h5); letter-spacing: var(--text-h5-ls); text-wrap: balance; margin: 0; padding-block-start: var(--space-6); background: var(--rule-dotted-h) top / 100% 1px no-repeat; }
  .s-shelves__row { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-16); align-items: end; } /* nothing clips here: a case held close reaches past the shelf (the page edge is clipped by html, and the script keeps it on screen) */
  @media (min-width: 64em) { .s-shelves__row { grid-template-columns: auto minmax(0, 1fr); column-gap: clamp(3rem, 6vw, 6rem); } }

  /* a shelf: its row of objects drawn at real size and scaled down (never up) to fit, like a photo; then the plank */
  .shelf { --s: 1; position: relative; display: grid; min-inline-size: 0; }
  .shelf__board { position: relative; }
  .shelf__viewport { position: relative; z-index: 2; inline-size: calc(var(--stage-w, 320px) * var(--s)); block-size: calc(var(--stage-h, 200px) * var(--s)); }
  .shelf__stage { position: absolute; inset-block-end: 0; inset-inline-start: 0; inline-size: var(--stage-w, 320px); block-size: var(--stage-h, 200px); transform: scale(var(--s)); transform-origin: 0 100%; }
  .shelf__items { position: absolute; inset-block-end: 0; inset-inline-start: 16px; display: flex; align-items: flex-end; gap: 1px; margin: 0; padding: 0; list-style: none; }
  .s-shelves:not(.is-built) .shelf__items { pointer-events: none; } /* objects still waiting, invisible, above their places must not catch the pointer meant for About */
  .shelf__plank { position: relative; z-index: 1; display: block; block-size: 12px; border-radius: 1px 1px 2px 2px;
    clip-path: inset(-12px calc((1 - var(--fill)) * 100%) -48px -12px);
    background: radial-gradient(ellipse 22% 38% at 12% 22%, transparent 0 92%, var(--wood-grain) 93% 95%, transparent 96%), radial-gradient(ellipse 32% 42% at 67% 70%, transparent 0 93%, var(--wood-grain) 94% 96%, transparent 97%), linear-gradient(92deg, transparent 0 8%, var(--wood-grain) 14%, transparent 22% 54%, var(--wood-grain) 61%, transparent 72%), linear-gradient(180deg, var(--wood-front-top), var(--wood-front-bottom));
    box-shadow: inset 0 1px 0 light-dark(rgb(255 255 255 / 0.28), rgb(255 255 255 / 0.1)), inset 0 -1px 0 light-dark(rgb(51 28 10 / 0.2), rgb(0 0 0 / 0.48)), 1px 3px 3px -2px rgb(from var(--wood-shadow) r g b / calc(0.3 * var(--shade))), 3px 10px 16px -8px rgb(from var(--wood-shadow) r g b / calc(0.42 * var(--shade))), 6px 24px 34px -18px rgb(from var(--wood-shadow) r g b / calc(0.36 * var(--shade))); }
  .shelf__plank::before { content: ""; position: absolute; inset-inline: 0; inset-block-start: -6px; block-size: 6px; clip-path: polygon(0.6% 0, 99.4% 0, 100% 100%, 0 100%);
    background: radial-gradient(ellipse 28% 70% at 23% 45%, transparent 0 90%, var(--wood-grain) 91% 93%, transparent 94%), linear-gradient(91deg, transparent 0 16%, var(--wood-grain) 25%, transparent 34% 67%, var(--wood-grain) 75%, transparent 83%), linear-gradient(180deg, var(--wood-top-front), var(--wood-top-back)); }
  .shelf__plank::after { content: ""; position: absolute; inset-inline: 0; inset-block-end: -2px; block-size: 2px; border-radius: 0 0 2px 2px; background: linear-gradient(180deg, rgb(from var(--wood-shadow) r g b / calc(0.24 * var(--shade))), rgb(from var(--wood-shadow) r g b / calc(0.08 * var(--shade)))); }
  /* the wireframe the agents draw (the plank's front, then its top), with selection handles like a design tool */
  .shelf__wire { position: absolute; z-index: 3; inset-inline: 0; inset-block-end: 0; inline-size: 100%; block-size: 18px; overflow: visible; pointer-events: none; opacity: var(--wire, 0); fill: none; stroke: var(--color-accent-2); stroke-width: 1; vector-effect: non-scaling-stroke; }
  .shelf__wire rect.hd { fill: var(--color-bg-primary); stroke-width: 1; opacity: var(--handles, 0); }
  .shelf__caption { margin: var(--space-5) 0 0; text-align: center; font: var(--text-body); color: var(--color-text-secondary); opacity: var(--cap, 1); }
  .shelf__caption a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 0.35em; }
  .shelf__caption a:is(:hover, :focus-visible) { color: var(--color-text-primary); }

  /* one object (a game case or a book): a frame as wide as what shows, a button, a pose (placement), a tilt, the 3D box.
     Its size comes inline: --w cover width, --h height, --t thickness, in px. */
  .gcase { --turn: 90deg; --lean: var(--lean0, 0deg); position: relative; flex: none; margin-inline-start: var(--gap, 0px); inline-size: var(--t); block-size: var(--h); transform: rotate(var(--lean)); transform-origin: var(--lean-o, 50%) 100%; transition: inline-size var(--shelf-ms, 620ms) var(--shelf-ease, cubic-bezier(0.22, 0.9, 0.22, 1)), transform var(--shelf-ms, 620ms) var(--shelf-ease, cubic-bezier(0.22, 0.9, 0.22, 1)), translate 420ms cubic-bezier(0.3, 0.7, 0.2, 1), rotate 420ms cubic-bezier(0.3, 0.7, 0.2, 1); }
  .gcase.is-open { --turn: 0deg; --lean: 0deg; inline-size: var(--w); }
  .gcase::after { content: ""; position: absolute; z-index: -1; inset-block-end: -3px; inset-inline-start: -2px; inline-size: calc(100% + 4px); block-size: 8px; border-radius: 50%; background: radial-gradient(closest-side, rgb(from var(--wood-shadow) r g b / 0.42), rgb(from var(--wood-shadow) r g b / 0.14) 55%, transparent); pointer-events: none; }
  .gcase__btn { position: absolute; inset: 0; display: block; padding: 0; border: 0; background: none; color: inherit; perspective: 1400px; cursor: pointer; transition: translate 180ms var(--motion-easing-out); }
  .gcase__btn:focus-visible { outline: var(--focus-ring); outline-offset: 3px; }
  @media (hover: hover) and (pointer: fine) { .is-built .gcase:not(.is-open, .gcase--flat) .gcase__btn:hover { translate: 0 -6px; } }
  .gcase__pose { position: absolute; inset-block-start: 0; inset-inline-start: 0; inline-size: var(--t); block-size: var(--h); transform-style: preserve-3d; transform-origin: 0 0; --k: 1.55; --lift: calc(var(--h) * 0.2);
    transform: translate(0, 0) rotate(0deg) scale(1); transition: transform 680ms cubic-bezier(0.22, 0.9, 0.22, 1); }
  .gcase__tilt { position: absolute; inset: 0; transform-style: preserve-3d; transform-origin: calc(var(--w) / 2) 50%; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform 450ms var(--motion-easing-out); }
  .gcase__box { position: absolute; inset-block-start: 0; inset-inline-start: 0; inline-size: var(--w); block-size: var(--h); transform-style: preserve-3d; transform-origin: 0 50%; transform: rotateY(var(--turn)); transition: transform var(--shelf-ms, 620ms) var(--shelf-ease, cubic-bezier(0.22, 0.9, 0.22, 1)); }
  .gcase__face { position: absolute; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
  /* close to the screen: bigger, lifted above the shelf, tilting toward the pointer with a line of light across it */
  .gcase.is-near { z-index: 6; }
  .gcase.is-near .gcase__pose { transform: translate(calc((var(--w) - var(--w) * var(--k)) / 2 + var(--nx, 0px)), calc(var(--h) - var(--h) * var(--k) - var(--lift))) rotate(0deg) scale(var(--k)); }
  .gcase.is-near .gcase__btn { cursor: zoom-out; }
  /* lying in a stack: the same object turned on its side, spine out; the cases above lift when one is drawn out */
  .gstack { flex: none; margin: 0 6px 0 calc(6px + var(--gap, 0px)); list-style: none; }
  .gstack__list { display: flex; flex-direction: column-reverse; margin: 0; padding: 0; list-style: none; } /* first in the list lies at the bottom */
  .gcase--flat { inline-size: var(--h); block-size: var(--t); transform: none; transform-origin: 100% 100%; }
  .gcase--flat .gcase__pose { transform: translate(0, var(--t)) rotate(-90deg) scale(1); }
  .gcase--flat.is-near { --turn: 0deg; }
  .gcase--flat.is-near .gcase__pose { transform: translate(calc(var(--h) / 2 - var(--w) * var(--k) / 2 + var(--nx, 0px)), calc(var(--t) - var(--h) * var(--k) - var(--lift))) rotate(0deg) scale(var(--k)); }
  .gcase--flat.is-lifted { translate: 0 calc(var(--t) * -1.6); rotate: -2.5deg; }
  .gcase--flat::after { display: none; }
  .gstack__list > .gcase--flat:first-child::after { display: block; }

  /* the front: for a game, the printed cover under clear plastic (rim: photographed in its case); for a book, the cover */
  .gcase__front { inset: 0; transform: translateZ(var(--t)); border-radius: 3px 5px 5px 3px; overflow: hidden; background: var(--case, #1f3d8a); box-shadow: 0 0 0 0.5px rgb(0 0 0 / 0.35), 1px 2px 3px -1px rgb(0 0 0 / 0.25), 4px 10px 18px -9px rgb(0 0 0 / 0.4); }
  .gcase__front img { position: absolute; inset: 1.6% 1.8% 1.6% 4.2%; inline-size: 94%; block-size: 96.8%; object-fit: fill; display: block; }
  .gcase__front::after { content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(90deg, rgb(0 0 0 / 0.38) 0, rgb(0 0 0 / 0.1) 2.6%, rgb(255 255 255 / 0.22) 3.4%, rgb(0 0 0 / 0.16) 4.4%, transparent 6%),
      linear-gradient(118deg, rgb(255 255 255 / 0.16) 0%, rgb(255 255 255 / 0.04) 28%, transparent 42%, transparent 62%, rgb(255 255 255 / 0.07) 78%, transparent 92%); }
  .gcase[data-rim] .gcase__front { border-radius: calc(var(--w) * 0.03); background: none; }
  .gcase[data-rim] .gcase__front img, .gcase--book .gcase__front img { inset: 0; inline-size: 100%; block-size: 100%; }
  .gcase[data-rim] .gcase__front::after { background: linear-gradient(118deg, rgb(255 255 255 / 0.14) 0%, rgb(255 255 255 / 0.03) 28%, transparent 42%, transparent 62%, rgb(255 255 255 / 0.06) 78%, transparent 92%); }
  .gcase--book .gcase__front { border-radius: 1px 3px 3px 1px; background: var(--spine-bg); }
  .gcase--book .gcase__front::after { background: linear-gradient(90deg, rgb(0 0 0 / 0.22) 0, rgb(255 255 255 / 0.12) 1.6%, transparent 3.5%), linear-gradient(118deg, rgb(255 255 255 / 0.1) 0%, transparent 38%); }
  /* the postcard's light, on the one held close: one soft straight reflection that slides against the tilt */
  .gcase__front::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity 300ms, --sx 450ms var(--motion-easing-out);
    background: linear-gradient(105deg, rgb(255 255 255 / 0) calc(var(--sx, 32%) - 22%), rgb(255 255 255 / 0.04) calc(var(--sx, 32%) - 15%), rgb(255 255 255 / 0.12) calc(var(--sx, 32%) - 8%), rgb(255 255 255 / 0.2) var(--sx, 32%), rgb(255 255 255 / 0.12) calc(var(--sx, 32%) + 8%), rgb(255 255 255 / 0.04) calc(var(--sx, 32%) + 15%), rgb(255 255 255 / 0) calc(var(--sx, 32%) + 22%)); }
  .gcase.is-near .gcase__front::before { opacity: 1; }
  .gcase.is-near .gcase__front { box-shadow: 0 0 0 0.5px rgb(0 0 0 / 0.35), 0 18px 40px -12px rgb(0 0 0 / 0.5), 0 40px 80px -30px rgb(0 0 0 / 0.45); }

  /* the spine: a scan of the real one behind clear plastic, or drawn (header, title reading downward, foot) */
  .gcase__spine { inset-block: 0; inset-inline-start: 0; inline-size: var(--t); transform-origin: 0 50%; transform: rotateY(-90deg); border-radius: 2px; overflow: hidden; display: flex; flex-direction: column; align-items: center; background: var(--spine-bg, #111); color: var(--spine-ink, #fff); box-shadow: inset 0 0 0 0.5px rgb(0 0 0 / 0.35); }
  .gcase__spine::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgb(0 0 0 / 0.26), rgb(255 255 255 / 0.1) 30%, rgb(255 255 255 / 0.18) 52%, rgb(0 0 0 / 0.06) 78%, rgb(0 0 0 / 0.3)); }
  .gcase__spine--scan img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: fill; display: block; }
  .gcase__band { flex: none; display: flex; flex-direction: column; align-items: center; gap: calc(var(--t) * 0.3); inline-size: 100%; block-size: 22%; padding-block-start: calc(var(--t) * 0.32); background: var(--band-bg); color: var(--band-ink); border-block-end: 1px solid var(--band-rule); overflow: hidden; }
  .gcase__band svg { flex: none; display: block; inline-size: 56%; block-size: auto; fill: currentColor; }
  .gcase__band .gcase__plat { inline-size: 30%; }
  .gcase__title { flex: 1; min-block-size: 0; display: flex; align-items: center; justify-content: center; gap: 0.5em; inline-size: 100%; overflow: hidden; writing-mode: vertical-rl; padding-block: 0.6em; font: var(--title-font, 700 calc(var(--t) * 0.7) / 1 var(--font-sans)); letter-spacing: var(--title-ls, 0.04em); text-transform: var(--title-case, uppercase); white-space: nowrap; color: var(--spine-ink); }
  .gcase__title b { font-weight: inherit; }
  .gcase__title small { font-size: 0.42em; letter-spacing: 0.24em; opacity: 0.9; }
  .gcase__code { flex: none; padding-block: calc(var(--t) * 0.3); font: 500 calc(var(--t) * 0.2) / 1.15 var(--font-sans); letter-spacing: 0.02em; text-align: center; opacity: 0.85; }
  .gcase--book .gcase__spine { border-radius: 1px; }
  .gcase--book .gcase__title { padding-block: 0.9em 0.4em; }
  .gcase__by { flex: none; padding-block: 0 0.7em; writing-mode: vertical-rl; font: 500 calc(min(var(--t), 16px) * 0.5) / 1 var(--font-sans); letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.75; white-space: nowrap; }
  .gcase__back { inset: 0; transform: rotateY(180deg); background: var(--case, #1f3d8a); border-radius: 5px 3px 3px 5px; }
  .gcase--book .gcase__back { background: var(--spine-bg); }
  .gcase[data-platform="ps5"] { --band-bg: #fff; --band-ink: #000; --band-rule: #2c3f8f; --case: linear-gradient(135deg, #4d8bff, #1f5fe0 55%, #3f7dff); }
  .gcase[data-platform="ps4"] { --band-bg: #1450a3; --band-ink: #fff; --band-rule: #fff; --case: linear-gradient(135deg, #4d8bff, #1f5fe0 55%, #3f7dff); }
  .gcase[data-platform="ps3"] { --band-bg: #0e0c0d; --band-ink: #fff; --band-rule: #c41c33; --case: linear-gradient(135deg, #f4f5f7, #d9dce2 55%, #eef0f3); }

  /* the agents: four pixel cursors, each with a tag saying what it is doing; a copy of the plank; the nails */
  .agents { position: absolute; inset-block: 0; inset-inline-start: calc(-1 * var(--agents-x, 0px)); inline-size: var(--agents-w, 100%); z-index: 8; overflow: clip; pointer-events: none; } /* the screen's width, clipped: cursors parked off screen never widen the page */
  .agent { position: absolute; inset-block-start: 0; inset-inline-start: 0; display: block; opacity: 0; will-change: transform; }
  .agent svg { display: block; inline-size: 24px; block-size: auto; shape-rendering: crispEdges; transform-origin: 2px 2px; transition: scale 90ms; }
  .agent.is-press svg { scale: 0.82; }
  .agent__tag { position: absolute; inset-block-start: 26px; inset-inline-start: 14px; padding: 2px 6px 3px; background: var(--agent); color: #fff; font: 500 11px / 1.2 var(--font-mono); white-space: nowrap; box-shadow: 2px 2px 0 rgb(0 0 0 / 0.18); }
  .agent__tag b { font-weight: 700; margin-inline-end: 0.4em; }
  .agent:is(.agent--1, .agent--3) .agent__tag { inset-inline: auto calc(100% - 4px); } /* the holders' tags sit left, the hammerers' right */
  .agent--1 { --agent: var(--color-accent); } .agent--2 { --agent: var(--color-accent-2); } .agent--3 { --agent: light-dark(#17783a, #2fa866); } .agent--4 { --agent: light-dark(#17171f, #5b5b66); }
  .agent .px-fill { fill: var(--agent); } .agent .px-line { fill: light-dark(#0b0b0f, #f4f1ea); }
  .agents__ghost { position: absolute; inset-block-start: 0; inset-inline-start: 0; block-size: 12px; opacity: 0; outline: 1px dashed var(--color-accent-2); outline-offset: 3px; transform-origin: 0 0; }
  .nail { position: absolute; inset-block-start: 0; inset-inline-start: 0; opacity: 0; }
  .nail__shank { position: absolute; inset-inline-start: 0; inset-block-start: -1.5px; inline-size: var(--len, 24px); block-size: 3px; border-radius: 1px; background: linear-gradient(180deg, #d9dce2, #7d828c); transform-origin: 0 50%; rotate: -38deg; }
  .nail__head { position: absolute; inset-inline-start: var(--hx, 0px); inset-block-start: var(--hy, 0px); inline-size: 9px; block-size: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #f4f6fa, #9aa0aa 60%, #5d626c); box-shadow: 0 1px 1.5px rgb(0 0 0 / 0.45); }
  @media (prefers-reduced-motion: reduce) { .gcase, .gcase__box, .gcase__pose, .gcase__tilt, .gcase__btn { transition: none; } }

  /* ---- words that rise: a heading's words (or a question's) lift in one after another as it scrolls into view ---- */
  .hw { display: inline-block; }
  .js [data-words]:not([data-split]) { visibility: hidden; animation: rise-failsafe 0s linear 2.5s forwards; }
  .js [data-words][data-split] .hw { transition: opacity var(--motion-reveal-duration) var(--motion-easing-out), transform var(--motion-reveal-duration) var(--motion-easing-out); transition-delay: calc(var(--i, 0) * var(--motion-words-stagger)); }
  .js [data-words][data-split]:not(.is-in) .hw { opacity: 0; transform: translate3d(0, 0.4em, 0); }
  /* what the script reveals (Cube rise) stays hidden until the script is ready, so nothing flashes; without script it is plain content */
  .js:not(.is-ready) [data-rise] { visibility: hidden; animation: rise-failsafe 0s linear 2.5s forwards; }
  @keyframes rise-failsafe { to { visibility: visible; } }
}

/* ---------- utilities ----------------------------------------------------- */
@layer utilities {
  .sr-only { position: absolute; inline-size: 1px; block-size: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
  .hatch { background-image: var(--texture-hatch); color: var(--color-border-default); }
  .divider { border: 0; border-block-start: var(--border-subtle); }
  /* Main sections are separated by one continuous hairline; items inside a section use the dotted rule. */
  .hairline { block-size: 1px; background: var(--color-border-default); }
  .divider--dashed { border-block-start: 1px dashed var(--color-border-default); }
  /* The hero block: solid colour with grain, the only large accent surface. */
  .signal-block { position: relative; background: var(--color-accent); isolation: isolate; }
  .signal-block::after { content: ""; position: absolute; inset: 0; background-image: var(--texture-grain); mix-blend-mode: multiply; opacity: 0.3; pointer-events: none; }
  .blue-block { position: relative; background: var(--color-accent-2); isolation: isolate; }
  .blue-block::after { content: ""; position: absolute; inset: 0; background-image: var(--texture-grain); mix-blend-mode: multiply; opacity: 0.3; pointer-events: none; }
  /* Motion: entrance (stagger with --i), in-view reveal, word spans for scroll reveal */
  .rise { animation: rise-in var(--motion-rise-duration) var(--motion-easing-out) both; animation-delay: calc(var(--i, 0) * var(--motion-rise-stagger)); }
  [data-reveal] { opacity: 0; transform: translateY(var(--motion-rise-distance)); transition: opacity var(--motion-reveal-duration) var(--motion-easing-out), transform var(--motion-reveal-duration) var(--motion-easing-out); }
  [data-reveal].is-in { opacity: 1; transform: none; }
  .scroll-words .w { opacity: var(--o, var(--reveal-muted-opacity)); }
}

/* ==========================================================================
   pxart-motion.css · strength-card pixel art: green cells, entrance, idle.
   Merge into components.css inside @layer components, after the .pxart
   colour rules (it replaces the .pxart .pg line). Needs the SVG groups in
   partials/strengths.html:
     .px-in     the whole illustration; rises out of the bottom of its own box
     .px-bob    the subject; floats up one cell and back (stars and the
                background grid sit outside it and stay still)
     .px-a / .px-b  two frames of one detail; .px-b starts hidden (opacity="0")
       .px-wave   flag cloth        .px-flame  rocket flame
     .px-blink  the end anchor's centre cell (Visual Craft)
     .px-boot-r / -g / -b  the lens subpixels (Pixel Perfection)
   Script adds .is-in to the .strength card once it is in view. Without
   script (no .js on <html>) nothing is hidden and nothing moves; if script
   never adds .is-in the art is shown after 5s anyway. Reduced motion:
   nothing moves, the art shows as drawn.
   Every move is a whole cell (1 viewBox unit = 1 cell) on steps(), so the art
   never leaves its grid; idle details recolour cells in place instead of
   stacking cells, so no colour can peek out at an edge.
   ========================================================================== */
@layer components {
  /* Green, for RGB pixels inside illustrations only. Was an unused grey.
     Same lightness as the red on light cards; a step brighter on black. */
  .pxart .pg { fill: light-dark(#1e8f4a, #22994f); }

  @media (prefers-reduced-motion: no-preference) {
    /* cards that arrive together start a beat apart */
    .strength { --px-wait: 0ms; --px-rise: 720ms; --px-landed: calc(var(--px-wait) + var(--px-rise)); }
    .strength:nth-child(4n+2) { --px-wait: 110ms; }
    .strength:nth-child(4n+3) { --px-wait: 220ms; }
    .strength:nth-child(4n+4) { --px-wait: 330ms; }

    /* entrance: waits one art-height below, clipped by the svg's own box */
    .js .strength:not(.is-in) .px-in { transform: translateY(24px); animation: px-failsafe 0s linear 5s forwards; }
    .strength.is-in .px-in { animation: px-rise var(--px-rise) steps(1, end) var(--px-wait) both; }

    /* idle: a one-cell float once landed, plus one small detail each */
    .strength.is-in .px-bob { animation: px-bob 3.2s steps(1, end) var(--px-landed) infinite; }
    .px-wave { --px-t: 1.6s; }
    .px-flame { --px-t: 0.5s; }
    .strength.is-in :is(.px-a, .px-b) { animation: px-swap var(--px-t) steps(1, end) infinite; }
    .strength.is-in .px-b { animation-delay: calc(var(--px-t) / -2); }
    .strength.is-in .px-blink > path { animation: px-hollow 1.6s infinite; }
    .strength.is-in .px-boot-r > path { animation: px-boot-r 5.6s var(--px-landed) infinite backwards; }
    .strength.is-in .px-boot-g > path { animation: px-boot-g 5.6s var(--px-landed) infinite backwards; }
    .strength.is-in .px-boot-b > path { animation: px-boot-b 5.6s var(--px-landed) infinite backwards; }
  }

  /* rises in shrinking steps (a pixel ease-out), overshoots one cell, lands */
  @keyframes px-rise {
    0% { transform: translateY(24px); }
    12% { transform: translateY(17px); }
    24% { transform: translateY(11px); }
    36% { transform: translateY(7px); }
    48% { transform: translateY(4px); }
    60% { transform: translateY(2px); }
    70% { transform: translateY(1px); }
    80%, 100% { transform: translateY(0); }
    90% { transform: translateY(-1px); }
  }
  @keyframes px-failsafe { to { transform: none; } }
  @keyframes px-bob { 50% { transform: translateY(-1px); } }
  @keyframes px-swap { 0% { opacity: 1; } 50%, 100% { opacity: 0; } }
  /* Recolour, then snap back to the cell's own class colour (the missing 100% keyframe). */
  @keyframes px-hollow { 0%, 50% { fill: var(--color-bg-primary); animation-timing-function: step-start; } }
  /* The lens pixel arrives switched off, then red, green and blue light in turn and hold; it refreshes every 5.6s. */
  @keyframes px-boot-r { 0%, 6% { fill: var(--color-border-subtle); animation-timing-function: step-start; } }
  @keyframes px-boot-g { 0%, 12% { fill: var(--color-border-subtle); animation-timing-function: step-start; } }
  @keyframes px-boot-b { 0%, 18% { fill: var(--color-border-subtle); animation-timing-function: step-start; } }

  /* ---- resume preview (/resume/) ---------------------------------------
     Each resume: its title, one line on which roles it is for, its .resume__frame and its Download Resume button. Two columns from 48em, one below the other on
     phones. Subgrid keeps the two sheets and the two buttons level whatever the length of the lines above them. */
  .resumes { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: var(--space-6); }
  .resume-card { display: grid; grid-row: span 3; grid-template-rows: subgrid; align-content: start; }
  .resume-card + .resume-card { margin-block-start: var(--space-10); }
  @media (min-width: 48em) { .resumes { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(2rem, 1rem + 3vw, 4rem); } .resume-card + .resume-card { margin-block-start: 0; } }
  .resume-card__head { display: grid; align-content: start; gap: var(--space-2); }
  .resume-card__title { font: var(--text-h3); letter-spacing: var(--text-h3-ls); }
  .resume-card__text { font: var(--text-body); color: var(--color-text-secondary); max-inline-size: 52ch; text-wrap: pretty; }
  .resume-card .s-row { margin: 0; }
}
