/* ==========================================================================
   Portfolio — design system
   Everything is driven by the tokens in :root. Change those to rebrand.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Fonts — self-hosted from ../fonts/
   Redaction, the base (un-degraded) cut, used for display type only.
   The halftone gradations (Redaction_10 … _100) are present in fonts/ but
   deliberately not declared — see the note at the foot of this block.
   -------------------------------------------------------------------------- */

@font-face {
  font-family: "Redaction";
  src: url("../fonts/Redaction-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Redaction";
  src: url("../fonts/Redaction-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Redaction";
  src: url("../fonts/Redaction-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* A declared @font-face costs nothing until something renders in it — the
   browser only fetches a cut it actually needs. Headings are weight 400, so
   in practice this page downloads Regular, plus Italic for the hero emphasis. */

/* The halftone gradations, coarsest (100) through finest (10). Regular only:
   headings are weight 400 and neither effect renders bold or italic.

   The hero rests on Redaction 10. The coarser cuts exist only as transient
   states — the load-in sweep and the cursor-proximity falloff — so they are
   fetched lazily by js/main.js, and not at all for visitors who have asked
   for reduced motion. */

@font-face {
  font-family: "Redaction 100";
  src: url("../fonts/Redaction_100-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Redaction 70";
  src: url("../fonts/Redaction_70-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Redaction 50";
  src: url("../fonts/Redaction_50-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Redaction 35";
  src: url("../fonts/Redaction_35-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Redaction 20";
  src: url("../fonts/Redaction_20-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Redaction 10";
  src: url("../fonts/Redaction_10-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}

/* Body and mono faces, self-hosted rather than pulled from Google Fonts: that
   request hands every visitor's IP to Google, which EU courts have ruled
   needs consent. These are Google's own latin subsets (U+0000-00FF and
   common punctuation), so Italian accents are in; anything rarer falls back
   to the system face. Inter is variable, one file for every weight. Licences
   in fonts/OFL-*.txt. */
@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter-latin.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/IBMPlexMono-Regular-latin.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/IBMPlexMono-Medium-latin.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}

:root {
  /* --- Color: light theme ------------------------------------------------
     Black and white with a ladder of neutral greys, no hue anywhere. The page
     is not pure white: #f2f2f2 takes the glare off a full-screen sheet while
     still reading as white. Pure black is kept for --accent, the one value
     that has to stand out from the ink; the ink itself sits a step above it.
     The dark theme is the same ladder turned over, on a pure black page. */
  --bg:            #f2f2f2;
  --bg-sunk:       #e6e6e6;
  --surface:       #fafafa;
  --ink:           #111111;
  --ink-soft:      #4d4d4d;
  --ink-faint:     #7f7f7f;
  --rule:          #dcdcdc;
  /* The case's dividers — under the title, over each chapter, round the
     stats. Solid, never a blend, and a clear step darker
     than --rule: a case sits over the blurred home, whose covers turn the
     background lavender or teal, and #dcdcdc has about the luminance of
     those tints, so it dissolved into a grey nobody could see. */
  --divider:       #b8b8b8;
  /* The globe's ink sits a step past --ink-faint, closer to the page than any
     other text colour. It is a field of dense glyphs behind the headline, so
     it has to read as texture rather than as type — at --ink-soft it competed
     with the copy over it. Each theme moves it *towards* its own background:
     lighter here, darker in the dark theme, so the two feel equally quiet. */
  --globe-ink:     #b8b8b8;
  /* With no hue, the accent is the extreme of the ladder: pure black here,
     pure white in dark — one step past --ink, so a hover from ink to accent
     still moves. --accent-pure is the same value used as a fill, with
     --on-accent (the page's opposite) as the type on top of it. */
  --accent:        #000000;
  --accent-pure:   #000000;
  --on-accent:     #ffffff;
  --accent-soft:   #e6e6e6;
  /* The Experience logo tiles. Not overridden in dark, on purpose: the
     tile is a white app-icon plate that carries other people's colours, and
     a logo made for white has to stay on white in both themes. --logo-mark
     is the ink of the globe drawn on that plate for the Freelance row. */
  --logo-tile:     #ffffff;
  --logo-mark:     #111111;
  --shadow:        0 1px 2px rgba(0, 0, 0, .06), 0 12px 32px -12px rgba(0, 0, 0, .18);

  /* Display headings take the accent, the strongest value on the page. The
     emphasis inside one cannot be "the other colour" any more — in black and
     white the only other thing is a grey — so it drops to --ink-soft. */
  --heading:       var(--accent);
  --heading-em:    var(--ink-soft);

  /* --- Type -------------------------------------------------------------- */
  --font-display: "Redaction", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  /* The hero rests on the finest halftone cut rather than the clean face */
  --font-hero: "Redaction 10", "Redaction", "Iowan Old Style", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* --- Space & motion ---------------------------------------------------- */
  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --measure: 62ch;
  /* La misura e' in ch, quindi vale solo insieme al corpo su cui la si
     risolve: 62ch a 17px e 62ch a 18px sono due colonne diverse. Il corpo
     della prosa e' un token proprio perche' anche le figure devono
     risolvere la misura nello stesso contesto tipografico. */
  --prose-size: clamp(1rem, .97rem + .3vw, 1.125rem);
  --radius: 4px;
  --radius-tile: 1rem;
  /* The squircle on the small chrome — the nav pill, the theme toggle, the
     close cross's hover frame. A superellipse corner where the browser can
     draw one (corner-shape, Chromium for now): it bulges out further than a
     circular arc of the same radius, so it takes a larger radius to read as
     soft. Elsewhere the same boxes get a plain rounded corner, smaller, so
     the two land on about the same silhouette. */
  --squircle-s: .625rem;    /* ~36px boxes: theme toggle, close frame */
  --squircle-l: .75rem;     /* the nav pill, ~41px tall */
  /* Page-transition curtain. It exists to be seen for half a second, so it
     is the page's opposite: black over the light page, the light theme's
     off-white (not pure white) over the dark one. */
  --curtain: #111111;
  --ease: cubic-bezier(.22, 1, .36, 1);
  /* Calmer curve for the side nav: --ease races out of the gate and settles
     hard, which reads as a snap. This one is even at both ends. */
  --ease-soft: cubic-bezier(.4, 0, .2, 1);
  /* The frame round the viewport: a band of the accent, square to the screen
     outside, with a squircle opening. Three sides are --frame-w; the bottom is
     a deeper chin, --statusbar-h, which carries the location and clock. Every
     fixed piece of chrome offsets itself by these so it sits in the opening.
     --frame-r is how far each corner's curve runs along the edge, not a
     radius: the curve is a squircle, which reads like a circle of about
     0.43x that. */
  --frame-w:     clamp(.625rem, .4rem + 1vw, 1rem);
  --statusbar-h: 2.25rem;
  --frame-r:     clamp(2rem, 1.4rem + 2.4vw, 3.5rem);
  --frame:       var(--accent);

  /* --- Lightbox ----------------------------------------------------------
     The viewer is drawn as a macOS window, so the three traffic lights keep
     Apple's own colours in both themes: recoloured, they stop reading as a
     window. --scrim is what the page dims to behind it. */
  --mac-close:     #ff5f57;
  --mac-min:       #febc2e;
  --mac-max:       #28c840;
  --scrim:         rgba(0, 0, 0, .55);
  --shadow-window: 0 0 0 1px rgba(0, 0, 0, .08), 0 40px 90px -24px rgba(0, 0, 0, .45);
}

/* The ladder turned over. The page is pure black, so nothing can sit below
   it: --bg-sunk, which is a step darker in light, is a step *lifted* here —
   it still reads as a recess against the panels, just not against the page.
   The ink is held off pure white (#e6e6e6) so body copy doesn't halo on the
   black; pure white is kept for the accent and the headings. */
[data-theme="dark"] {
  --bg:            #000000;
  --bg-sunk:       #0d0d0d;
  --surface:       #141414;
  --ink:           #e6e6e6;
  --ink-soft:      #9a9a9a;
  --ink-faint:     #656565;
  --rule:          #262626;
  --divider:       #3d3d3d;
  --globe-ink:     #373737;
  --accent:        #ffffff;
  --accent-pure:   #ffffff;
  --on-accent:     #000000;
  --accent-soft:   #1f1f1f;
  --shadow:        0 1px 2px rgba(0, 0, 0, .45), 0 12px 32px -12px rgba(0, 0, 0, .65);
  --curtain:       #f2f2f2;
  --scrim:         rgba(0, 0, 0, .72);
  --shadow-window: 0 0 0 1px rgba(255, 255, 255, .08), 0 40px 90px -24px rgba(0, 0, 0, .8);
}

@supports (corner-shape: superellipse(2)) {
  :root {
    --squircle-s: .875rem;
    --squircle-l: 1.0625rem;
  }
}

/* ==========================================================================
   Base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

/* Nothing may push the page sideways. `clip` rather than `hidden` — `hidden`
   on a scroll container silently breaks position: sticky, which the header
   depends on. */
html, body { overflow-x: clip; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1rem, .95rem + .2vw, 1.0625rem);
  line-height: 1.65;
  letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased;
  transition: background-color .4s var(--ease), color .4s var(--ease);
  /* The frame's chin covers the last strip of the viewport; without this the
     end of the contact section would sit under it. */
  padding-bottom: var(--statusbar-h);
}

/* The frame. Above all the chrome except the status bar that lives in its
   chin (190), below the curtain (200), which is the page's opposite and
   would only show a seam against it.

   The squircle is a clip-path shape(): the whole viewport filled with the
   accent, and the opening cut out of it with the even-odd rule. Each corner
   is one cubic with *both* control points on the corner itself, which makes
   its curvature zero where it meets the straight edge — the curve eases out
   of the line instead of starting to bend all at once, which is the whole
   difference between a squircle and a rounded rectangle.

   Without shape() it falls back to a plain rounded opening: the element is
   the opening and the band is its spread shadow, which keeps the outside
   square (a border-radius on a border would round both). */
body::after {
  content: "";
  position: fixed;
  inset: var(--frame-w) var(--frame-w) var(--statusbar-h);
  z-index: 180;
  border-radius: calc(var(--frame-r) * .43);
  box-shadow: 0 0 0 100vmax var(--frame);
  pointer-events: none;
  transition: box-shadow .4s var(--ease), background-color .4s var(--ease);
}
@supports (clip-path: shape(from 0 0, line to 1px 1px)) {
  body::after {
    --l: var(--frame-w);
    --t: var(--frame-w);
    --r: calc(100% - var(--frame-w));
    --b: calc(100% - var(--statusbar-h));
    inset: 0;
    border-radius: 0;
    box-shadow: none;
    background: var(--frame);
    clip-path: shape(evenodd from 0 0,
      line to 100% 0, line to 100% 100%, line to 0 100%, close,
      move to var(--l) calc(var(--t) + var(--frame-r)),
      line to var(--l) calc(var(--b) - var(--frame-r)),
      curve to calc(var(--l) + var(--frame-r)) var(--b) with var(--l) var(--b) / var(--l) var(--b),
      line to calc(var(--r) - var(--frame-r)) var(--b),
      curve to var(--r) calc(var(--b) - var(--frame-r)) with var(--r) var(--b) / var(--r) var(--b),
      line to var(--r) calc(var(--t) + var(--frame-r)),
      curve to calc(var(--r) - var(--frame-r)) var(--t) with var(--r) var(--t) / var(--r) var(--t),
      line to calc(var(--l) + var(--frame-r)) var(--t),
      curve to var(--l) calc(var(--t) + var(--frame-r)) with var(--l) var(--t) / var(--l) var(--t),
      close);
  }
}

img, svg, video { display: block; max-width: 100%; height: auto; }

a { color: inherit; }

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -.025em;
}

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

/* Selection inverts: the accent as a fill, the page's opposite on top. */
::selection { background: var(--accent-pure); color: var(--on-accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: .75rem 1.25rem;
  background: var(--ink);
  color: var(--bg);
  font-size: .875rem;
}
.skip-link:focus { left: var(--frame-w); top: var(--frame-w); }

/* ==========================================================================
   Display headings
   Every heading set in display type, grouped here rather than repeated in
   each component so the three cannot drift apart.

   The colour is `--heading`, which is the accent: pure black on the light
   page, pure white on the dark one — a step stronger than the body ink.
   ========================================================================== */

.hero__title,
.display-2,
.case-title { color: var(--heading); }

/* ==========================================================================
   Layout primitives
   ========================================================================== */

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

.section { padding-block: clamp(4.5rem, 11vw, 9.5rem); }
.section--tight { padding-block: clamp(3rem, 7vw, 6rem); }
.section + .section { padding-top: 0; }
/* The marquee supplies the gap on both sides of itself */
.marquee + .section { padding-top: 0; }

.rule {
  height: 1px;
  border: 0;
  margin: 0;
  background: var(--rule);
}

/* Read by assistive tech, not drawn. The case studies' chapter names live
   here since the side-nav pill took over the job of showing them: the pill
   and a label at the head of the section said the same word twice. They stay
   real h2s so the outline and the heading levels below them are unchanged. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Side navigation
   A pill fixed to the left edge showing the section currently in view.
   Clicking grows *the pill itself* into the full list: one continuous box
   that changes height and nothing else, with the sections inside it. There
   is no second panel dropped below — see .sidenav__shell.
   Its width is one value for both states, measured across the label and the
   links together, so nothing moves sideways when it opens and the pill never
   twitches while the halftone resolves.
   ========================================================================== */

.sidenav {
  /* One source of truth for the pill's box. The label window, the collapsed
     height of the shell and the swipe distance all derive from these, so the
     closed pill is exactly one label tall however the type changes. */
  --pill-pad-y: .6rem;
  --pill-pad-x: 1rem;
  --pill-font: 1.0625rem;
  --pill-line: 1.15;
  --pill-h: calc(var(--pill-font) * var(--pill-line) + var(--pill-pad-y) * 2 + 2px);
  position: fixed;
  z-index: 60;
  left: calc(var(--frame-w) + clamp(.75rem, 2vw, 1.75rem));
  top: 50%;
  transform: translateY(-50%);
}

/* The nav's own height is pinned to the *collapsed* pill and never changes:
   the shell grows out of it and is allowed to overflow. That keeps
   translateY(-50%) above a constant, so opening the menu cannot drift the
   pill up the screen — which is exactly what happened when the growing box
   was the one being centred. align-items decides which way the growth
   spills: down from the top edge here, up from the bottom edge on phones. */
.sidenav__panel {
  display: flex;
  align-items: flex-start;
  height: var(--pill-h);
}

/* --- The box -------------------------------------------------------------
   Pill and menu are the same element. Height is the only thing that
   animates; width is max-content across both the label and the links, so it
   is identical open or closed. Closed, it is exactly the toggle tall and the
   list below is simply clipped. */

/* The radius is *one constant value*, not an animation: a squircle corner
   (--squircle-l), the same while the pill is one label tall and while it is
   grown into the list, so opening it only adds height.
   Do not animate this from 999px. A radius larger than the box is scaled
   down by the browser to fit, and that scaling is recomputed every frame
   against a height that is itself changing: the *used* radius swells to
   something far bigger than either end of the animation mid-way through, and
   the corners eat into the labels. */
.sidenav__shell {
  width: max-content;
  height: var(--pill-h);
  border: 1px solid var(--rule);
  border-radius: var(--squircle-l);
  corner-shape: superellipse(2);
  overflow: hidden;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  transition: height .55s var(--ease-soft);
}

/* --nav-open-h is measured in JS from the toggle and list; auto is the
   fallback if that never runs — correct, just not animated.
   The box grows downward out of a vertically centred pill, so the room it
   has is half the viewport. A long stage list on a short window would
   otherwise run off the bottom edge; past that point it scrolls inside the
   box rather than escaping it — see [data-settled] below. */
.sidenav[data-open="true"] .sidenav__shell {
  height: var(--nav-open-h, auto);
  max-height: calc(50vh - 1rem);
  max-height: calc(50dvh - 1rem);
}

/* Scrolling is switched on only once the box has finished growing. While it
   is growing it is by definition shorter than its content, so a live
   overflow-y would flash a scrollbar in and out on every open — and steal
   width from the labels as it came and went. JS sets data-settled when the
   height transition is done. */
.sidenav[data-open="true"][data-settled="true"] .sidenav__shell {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

/* --- The pill row --------------------------------------------------------
   No border or background of its own any more; the shell owns the box. Its
   height is the shell's inner height, so the closed shell shows this row and
   nothing else. space-between pins the chevron to the right edge whenever a
   long link makes the box wider than the label needs. */

.sidenav__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  gap: .75rem;
  width: 100%;
  height: calc(var(--pill-h) - 2px);
  padding: 0 var(--pill-pad-x);
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

/* Hairline between the current section and the list once the box is open, so
   the pill row reads as the menu's header. Drawn as a pseudo-element rather
   than a border: a border would add a pixel to the height JS measured. */
.sidenav__toggle::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--rule);
  opacity: 0;
  transition: opacity .3s var(--ease-soft);
}
.sidenav[data-open="true"] .sidenav__toggle::after { opacity: 1; }

/* The window labels slide through. It stretches to the pill row's full
   height, not just the line box, so a swipe travels the whole pill rather
   than a single line of text. Width is set once in JS to the widest section
   name and then never changes, so the label cannot clip itself mid-swipe. */
.sidenav__current {
  position: relative;
  display: block;
  /* --accent, come i titoli: il valore piu' forte della scala, un gradino
     sopra l'inchiostro. */
  color: var(--accent);
  /* The pill row's inner height, stated rather than stretched, so the words'
     height: 100% has a definite box to resolve against. */
  height: calc(var(--pill-h) - 2px);
  overflow: hidden;
  font-family: var(--font-hero);
  font-size: var(--pill-font);
  line-height: var(--pill-line);
  letter-spacing: -.01em;
  white-space: nowrap;
}

/* Stacked so the outgoing and incoming labels can cross at the same time.
   Full height with the text centred, so translateY(100%) is a whole pill of
   travel rather than a single line. Width stays auto — the JS measures it. */
.sidenav__word {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  display: flex;
  align-items: center;
  white-space: nowrap;
  transition: transform .5s var(--ease-soft), opacity .5s var(--ease-soft);
}

.sidenav__chev {
  width: .7rem;
  height: .7rem;
  flex: none;
  color: var(--ink-faint);
  transition: transform .55s var(--ease-soft);
}
.sidenav[data-open="true"] .sidenav__chev { transform: rotate(90deg); }

/* --- The list, inside the same box ---------------------------------------
   In normal flow: it is simply clipped by the shell until the shell is tall
   enough to show it, which is what makes the pill *become* the menu instead
   of spawning one. visibility (not display) keeps the links out of the tab
   order while closed without changing the height JS measures. The fade lags
   the box slightly on the way open so the height reads first. */

.sidenav__list {
  padding-block: .3rem .45rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s var(--ease-soft), visibility .3s;
}
.sidenav[data-open="true"] .sidenav__list {
  opacity: 1;
  visibility: visible;
  transition-delay: .12s;
}

.sidenav__list ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Same horizontal padding as the pill row, so every section name lines up
   under the label above it. */
.sidenav__link {
  display: block;
  position: relative;
  padding: .35rem var(--pill-pad-x);
  font-size: .875rem;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
  transition: color .25s var(--ease-soft), background-color .25s var(--ease-soft);
}
.sidenav__link:hover { color: var(--ink); background: var(--bg-sunk); }

/* The shell clips its children, so the global ring — 2px at a 3px outward
   offset — would be cut off on every side. Both controls draw theirs inward
   instead. The pill row inherits the shell's radius, so its ring follows the
   box as it eases from pill to rounded rect. */
.sidenav__toggle { border-radius: inherit; }
.sidenav__toggle:focus-visible,
.sidenav__link:focus-visible { outline-offset: -3px; }

.sidenav__link[aria-current="true"] { color: var(--ink); }
/* Sits in the left padding rather than in the text flow, so the current
   section's label stays aligned with all the others. */
.sidenav__link[aria-current="true"]::before {
  content: "";
  position: absolute;
  left: .4rem;
  top: 50%;
  width: .3rem;
  height: .3rem;
  margin-top: -.15rem;
  border-radius: 50%;
  background: var(--accent);
}

/* --- Theme toggle: fixed to the top right --------------------------------- */

/* The case study's close (.article__close, below) wears the same box, so the
   two corners of the window read as one pair of controls. */
.theme-toggle {
  position: fixed;
  z-index: 60;
  top: calc(var(--frame-w) + clamp(.75rem, 2vw, 1.75rem));
  right: calc(var(--frame-w) + clamp(.75rem, 2vw, 1.75rem));
}
.theme-toggle,
.article__close {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: var(--squircle-s);
  corner-shape: superellipse(2);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  color: var(--ink-soft);
  cursor: pointer;
  transition: color .25s var(--ease-soft), border-color .25s var(--ease-soft);
}
.theme-toggle:hover,
.article__close:hover { color: var(--ink); border-color: var(--ink-faint); }
.theme-toggle svg,
.article__close svg { width: 1rem; height: 1rem; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* --- Small screens -------------------------------------------------------
   Centred on the left edge would sit over body copy on a phone, so the pill
   drops to the bottom-left and the box grows upward out of it instead. */

@media (max-width: 46rem) {
  .sidenav {
    top: auto;
    bottom: calc(var(--statusbar-h) + clamp(.5rem, 2vw, .75rem));
    transform: none;
    --pill-pad-y: .55rem;
    --pill-pad-x: .9rem;
    --pill-font: 1rem;
  }
  /* Two halves of the same move: the panel pins the shell's *bottom* edge so
     the extra height goes upward, and the shell stacks the list above the
     pill row so the row itself stays exactly where it was. Tab order is
     unaffected — only the visual order reverses. */
  .sidenav__panel { align-items: flex-end; }
  .sidenav__shell { display: flex; flex-direction: column-reverse; }
  /* Anchored to the bottom, so the room it has is the viewport less the
     offset it sits at — not half of it. */
  .sidenav[data-open="true"] .sidenav__shell {
    max-height: calc(100vh - 4.5rem - var(--statusbar-h) - var(--frame-w));
    max-height: calc(100dvh - 4.5rem - var(--statusbar-h) - var(--frame-w));
  }
  /* The list is above the pill row now, so the hairline moves to its top. */
  .sidenav__toggle::after { bottom: auto; top: 0; }
}

/* ==========================================================================
   Status bar
   Set into the frame's chin: the place on the left, the local time in Milan
   on the right, in the frame's opposite colour. It has no surface of its
   own — the frame behind it is the bar. The colon pulses once a second,
   driven from js/main.js so each pulse lands on a real second.
   ========================================================================== */

.statusbar {
  position: fixed;
  z-index: 190;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--statusbar-h);
  /* Lined up with the opening's side edges, not the content gutter: this is
     chrome for the window, not part of the page's column. */
  padding-inline: var(--frame-w);
  font-family: var(--font-mono);
  font-size: .6875rem;
  letter-spacing: .08em;
  color: var(--on-accent);
  font-variant-numeric: tabular-nums;
  transition: color .4s var(--ease);
}
.statusbar__place { text-transform: uppercase; }
.statusbar__colon { display: inline-block; }

/* No JS: nothing can track sections or measure the open height, so the box
   just stands open at its natural size. */
html:not([data-js]) .sidenav__panel { height: auto; }
html:not([data-js]) .sidenav__shell { height: auto; }
html:not([data-js]) .sidenav__list { opacity: 1; visibility: visible; }
html:not([data-js]) .sidenav__toggle::after { opacity: 1; }
html:not([data-js]) .sidenav__chev { display: none; }

/* ==========================================================================
   Hero
   ========================================================================== */

/* Top padding replaces the space the old sticky header used to hold. Bottom
   is 0 because the marquee below supplies its own symmetric margin — see the
   logo marquee block. */
.hero { padding-block: clamp(5.5rem, 12vw, 9rem) 0; }

/* One column until there is room for two. `minmax(0, …)` rather than a bare
   `1fr`: an `fr` track refuses to shrink below its content, and the headline
   is display type — it would push the page sideways on a phone. */
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2.75rem, 7vw, 4rem);
  align-items: center;
}

/* Wide enough for two: a twelve-track rail, and the two items are placed on
   it by hand so their spans *cross*. The text holds tracks 1–7, the globe
   starts at 5 — the three tracks they share are the overlap. A gap would be
   meaningless between items that deliberately sit on top of each other, so
   there isn't one; the spans do the spacing.

   Both are in row 1, so `align-items: center` on the grid centres the text
   against the globe's height rather than the other way round. */
@media (min-width: 56rem) {
  .hero__grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0;
  }

  /* On top, and the only thing in the overlap that should take a pointer:
     the column's box reaches over the globe, so left as-is it would swallow
     drags across a wide band of empty space. Turning it off here and back on
     for the text itself keeps the copy selectable and hands everything else
     to the globe underneath. */
  .hero__col {
    grid-area: 1 / 1 / 2 / 8;
    position: relative;
    z-index: 1;
    pointer-events: none;
  }
  .hero__title,
  .hero__about { pointer-events: auto; }

  /* Anchored to the start of its span so the extra width grows leftward,
     into the text, rather than off to the right.

     The mask dissolves the edge that runs under the headline: without it the
     ASCII competes with the type it sits behind, and with it the overlap
     reads as depth. It is on the whole element rather than the characters
     alone, so the pin fades with the map instead of hanging over it — and
     34% is roughly the two shared tracks as a fraction of the globe. */
  .globe {
    /* Starts a track further left than it used to. The span is what actually
       caps the width — `100%` here is the eight tracks, and it binds well
       before the rem value does — so widening the span is what makes the
       globe bigger, and it deepens the overlap in the same move. */
    grid-area: 1 / 5 / 2 / 13;
    justify-self: start;
    margin-inline: 0;
    /* Overruns its own span, so the globe runs off the right of the screen
       the way it runs off both sides on a phone. The vh term is the real
       limit: it keeps the hero inside the fold on a short laptop, and it is
       usually the one that binds. */
    width: min(130%, 62rem, 110vh);
    /* Not square any more — the bottom is cropped here too. Cropping harder
       is what buys the extra width: the hero's height is globe height plus
       padding, so a shorter box can be a wider one and still clear the fold. */
    aspect-ratio: 1 / .72;

    /* Two masks, intersected: the vertical one sinks the bottom out of the
       layout exactly as on mobile, the horizontal one holds the globe off
       the headline it sits behind. `intersect` is the standard keyword and
       `source-in` its WebKit spelling — both are needed.
       The horizontal one has three stops, not two. Ramping straight to full
       opacity meant it got there *exactly* where the headline ends — the last
       line of type sitting over the densest ASCII on the globe, which is the
       worst place to put it. It reaches ~55% across the overlap instead and
       only finishes well clear of the text.

       33% is where the three shared tracks end as a fraction of the globe, so
       it has to be re-derived whenever the width or the span changes. */
    -webkit-mask-image: linear-gradient(90deg, transparent 0, rgba(0, 0, 0, .55) 33%, #000 52%),
                        linear-gradient(180deg, #000 60%, transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0, rgba(0, 0, 0, .55) 33%, #000 52%),
                        linear-gradient(180deg, #000 60%, transparent 100%);
    -webkit-mask-composite: source-in;
            mask-composite: intersect;
  }
}

.hero__title {
  font-family: var(--font-hero);
  font-size: clamp(2.75rem, 8.5vw, 7.5rem);
  line-height: .95;
  letter-spacing: -.03em;
  max-width: 16ch;
}

/* --- Split title ----------------------------------------------------------
   JS splits the headline into words and characters so the proximity effect
   can address one letter at a time. Words stay inline-block so wrapping still
   happens at spaces and never mid-word. Character widths are pinned in JS at
   the resting cut, so swapping a gradation can never reflow the line. */

/* Words are inline-block so the line wraps at spaces, never mid-word — but
   that also means a single word wider than the screen cannot break at all
   and would push the page sideways. max-width caps it and lets the characters
   inside wrap as a last resort on very narrow viewports. */
[data-split] .word {
  display: inline-block;
  max-width: 100%;
}
[data-split] .char { display: inline-block; text-align: center; }

/* Display type must be able to break inside a long word rather than overflow */
.hero__title,
.display-2,
.case-title,
.contact__mail,
.stat__value {
  overflow-wrap: anywhere;
  min-width: 0;
}

/* --- Halftone states ------------------------------------------------------
   font-family is not an animatable property, so every swap is discrete: JS
   sets data-cut and each value selects a gradation. The selectors match both
   the title itself (the load-in sweep moves the whole headline at once) and
   its characters (proximity moves them independently).

   Each stack falls back to the base "Redaction" cut, so a gradation that
   fails to load degrades to the clean face rather than dropping to Georgia.
   No data-cut = the resting state, Redaction 10, via --font-hero. */

/* Generic on purpose: the hero headline, its individual characters, and the
   contact email all opt in the same way. Declared after .hero__title so
   that an explicit cut wins over the resting --font-hero at equal specificity. */

[data-cut="100"] { font-family: "Redaction 100", "Redaction", Georgia, serif; }
[data-cut="70"]  { font-family: "Redaction 70",  "Redaction", Georgia, serif; }
[data-cut="50"]  { font-family: "Redaction 50",  "Redaction", Georgia, serif; }
[data-cut="35"]  { font-family: "Redaction 35",  "Redaction", Georgia, serif; }
[data-cut="20"]  { font-family: "Redaction 20",  "Redaction", Georgia, serif; }
[data-cut="10"]  { font-family: "Redaction 10",  "Redaction", Georgia, serif; }

/* --- Load-in --------------------------------------------------------------
   Hidden only when JS is present, so a no-JS visitor sees the hero normally
   instead of a blank column. html[data-js] is set by the inline head script;
   html[data-loaded] is set by main.js once the fonts have settled. */

.hero__reveal { transition: opacity .9s var(--ease), transform .9s var(--ease); }

html[data-js]:not([data-loaded]) .hero__reveal {
  opacity: 0;
  transform: translateY(14px);
}

/* Title is first now; the about block follows it in. The globe is also a
   second child (of the grid), so it inherits that delay — then takes its own
   slightly longer one at equal specificity, and lands last. */
html[data-loaded] .hero__reveal:nth-child(2) { transition-delay: .12s; }
html[data-loaded] .globe.hero__reveal { transition-delay: .26s; }
/* Always the other colour of the pair, whichever way round the theme has it. */
.hero__title em {
  font-style: italic;
  color: var(--heading-em);
}

.hero__lede {
  margin-top: clamp(1.75rem, 4vw, 2.75rem);
  max-width: 52ch;
  font-size: clamp(1.0625rem, 1rem + .5vw, 1.375rem);
  line-height: 1.5;
  color: var(--ink-soft);
}

/* "About me" block sitting under the hero title */
.hero__about { margin-top: clamp(1.75rem, 4vw, 2.75rem); }

.hero__about-label {
  margin: 0 0 .75rem;
  font-family: var(--font-mono);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* The lede supplies its own top margin when standalone; inside the About
   block the wrapper's margin-top already provides the offset, so zeroing this
   keeps the gap under the headline at one value rather than two stacked. */
.hero__about .hero__lede { margin-top: 0; margin-bottom: 0; }

/* "Now building" pill under the lede, linking out to the side project.
   Same language as .cv-link (squircle, --surface fill, --rule edge, up-right
   arrow), a touch larger because it sits in the hero; the product's own
   icon on the left is the one coloured thing in it, on purpose. */
/* The lede's bottom margin is zeroed above, so this margin alone is the gap
   (an inline-flex box would not collapse with it; they used to stack to 40px).
   Block-level flex at fit-content, so no line box adds a strut either. */
.hero__now {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: .55em;
  max-width: 100%;
  margin-top: clamp(.875rem, 1.8vw, 1.25rem);
  padding: .4rem .8rem .4rem .45rem;
  border: 1px solid var(--rule);
  border-radius: var(--squircle-s);
  background: var(--surface);
  font-size: .875rem;
  line-height: 1.35;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color .3s var(--ease), border-color .3s var(--ease);
}
.hero__now strong { font-weight: 600; color: var(--ink); }
.hero__now:hover,
.hero__now:focus-visible { color: var(--ink); border-color: var(--divider); }
.hero__now:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@supports (corner-shape: superellipse(2)) {
  .hero__now { corner-shape: superellipse(2); }
}

.hero__now-mark {
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: .375rem;
}
.hero__now-arrow {
  flex: none;
  width: .7em;
  height: .7em;
  transition: transform .4s var(--ease);
}
.hero__now:hover .hero__now-arrow,
.hero__now:focus-visible .hero__now-arrow { transform: translate(2px, -2px); }


/* ==========================================================================
   ASCII globe
   The box is square and the renderer fits a disc inside it; everything about
   the image itself — grid size, characters, the pin's position — is computed
   in main.js. This block only has to hold the shape still and set the type,
   because the type *is* the resolution: the script measures a character and
   derives the grid from it, so changing the font size here changes how
   finely the world is drawn.
   ========================================================================== */

/* Mobile first, and on a phone the globe is *cropped*, not shrunk. A full
   square at the width of the screen is around 335px of circle on top of a
   headline and a lede — it pushed the whole thing past the fold and left the
   globe stranded below it.

   So the box is kept full width but made shorter than it is wide. main.js
   draws the disc from the width alone, so the globe stays big and the bottom
   of it falls outside the box; the mask then dissolves that cut rather than
   leaving a hard horizon. The equator sits around 80% down the box, inside
   the fade, which is what makes it read as the globe sinking out of the
   layout instead of being clipped by it. */
.globe {
  position: relative;
  /* Wider than the column it sits in, and centred on it by the symmetric
     negative margins (-22.5 + 145 - 22.5 = 100). The disc runs off both
     edges of the screen, which is the point — the globe reads as something
     large passing behind the page rather than an object sitting on it.
     `overflow-x: clip` on html/body means the overhang costs no scrollbar. */
  width: 145%;
  margin-inline: -22.5%;
  /* Half as tall as it is wide, so the crop lands on the equator: the widest
     line of the globe is the last thing you see before the fade takes it. */
  aspect-ratio: 1 / .5;
  -webkit-mask-image: linear-gradient(180deg, #000 42%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 42%, transparent 100%);
  /* Areas outside the gradient must be transparent, not a repeat of it —
     otherwise the pin can reappear below the fade when it swings low. */
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  /* Claim horizontal gestures for spinning, leave vertical ones to the page.
     Same bargain the logo marquee strikes, for the same reason. */
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.globe[data-dragging="true"] { cursor: grabbing; }

.globe__ascii {
  margin: 0;
  /* line-height 1 keeps the cell exactly as tall as the type, which is what
     makes the character grid square enough to hold a circle. */
  font-family: var(--font-mono);
  /* The type size *is* the resolution — main.js measures a character and
     derives the grid from it, so a smaller size means more, finer cells
     rather than the same picture shrunk. This lands near 100 characters
     across, which is where the coastlines start to show real detail. */
  font-size: clamp(.5rem, 1.15vw, .8rem);
  line-height: 1;
  white-space: pre;
  color: var(--globe-ink);
  /* The glyphs carry the image; letting them be selected only ever produces
     a screenful of punctuation. */
  user-select: none;
  -webkit-user-select: none;
}

/* --- The pin -------------------------------------------------------------
   Not part of the character grid: a real element the script moves to the
   projected position each frame, so it stays a crisp dot at any grid size
   however coarse, and fades out as it turns past the limb. The place it
   marks is carried by the container's aria-label, not by a caption. */

.globe__pin {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  pointer-events: none;
  will-change: transform;
  transition: opacity .2s linear;
}

.globe__pin-dot {
  position: absolute;
  top: 0;
  left: 0;
  width: .4rem;
  height: .4rem;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 .28rem color-mix(in srgb, var(--accent) 20%, transparent);
}


/* Nothing renders it without JS, and an empty square is worse than no square */
html:not([data-js]) .globe { display: none; }


/* ==========================================================================
   Buttons & links
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .8rem 1.4rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: .9375rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: transform .25s var(--ease), background-color .25s var(--ease), color .25s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn svg { width: .9rem; height: .9rem; }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule);
}
.btn--ghost:hover { border-color: var(--ink); }

/* Text link with an animated arrow */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .9375rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink);
}
.link-arrow svg {
  width: .85rem;
  height: .85rem;
  transition: transform .3s var(--ease);
}
.link-arrow:hover svg { transform: translateX(4px); }

/* ==========================================================================
   Work — showcase column
   One centred column, one project to a screen. The object sits straight on
   the page with no card behind it; size comes from the viewport's height so
   a project always fits the screen it is given, and --s on each card trims
   it for visual weight (a lone mark wants less canvas than two phones).

   The section stays in the page's own scroll. dmcg.co gives its column an
   inner scroller, but this page has a hero above and four sections below,
   and a nested scroller mid-page traps the wheel. The edge blur is what
   sells the effect, and that can be fixed to the viewport just as well.
   ========================================================================== */

.showcase {
  --showcase-size: min(62vh, 62svh, 84vw);
  position: relative;
  padding-block: clamp(4rem, 14vh, 9rem);
}

.showcase__list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(3rem, 22vh, 14rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.showcase__item { width: 100%; display: flex; justify-content: center; }

/* Stepped, after Kristin's "Simple snapping page sections with CSS" pen: the
   browser's own mandatory snap, not a wheel handler. Native snap reads the
   trackpad's momentum the way the OS does, which no script managed — the JS
   stepper before this one was either too eager or ate the second flick.

   The page itself is the snap container (the pen uses an inner scroller; a
   nested scroller mid-page traps the wheel, see the header of this block).
   Every card is a stop the scroll can't skip (`scroll-snap-stop: always`), so
   one flick is one project. The other sections are stops too, or mandatory
   would pull the page back to the nearest card from anywhere; one taller
   than the viewport (Experience) scrolls freely inside, as the spec has it.
   Gated with :has so the case pages never snap. */
html:has(.showcase) {
  scroll-snap-type: y mandatory;
  scroll-padding-top: var(--frame-w);
  scroll-padding-bottom: var(--statusbar-h);
}
.showcase__card {
  scroll-snap-align: center;
  scroll-snap-stop: always;
}
.hero,
.section { scroll-snap-align: start; }
.contact { scroll-snap-align: end; }

.showcase__card {
  /* Per-card weight, overridden inline in index.html */
  --s: 1;
  position: relative;
  display: block;
  width: calc(var(--showcase-size) * var(--s));
  aspect-ratio: 1;
  color: inherit;
  text-decoration: none;
}

/* Transparent cut-outs: contained, never cropped, and no surface of their
   own — the page is the background. */
.showcase__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform .9s var(--ease);
}
.showcase__card:hover .showcase__img { transform: scale(1.02); }

/* A cut-out that can't read on both #f2f2f2 and #000 ships as a pair: the
   card carries both images and the theme shows one. Lia is the case — its
   headline is black on light and white on dark. The hidden one is lazy, so
   it is only fetched when the visitor switches theme. */
.showcase__img--dark { display: none; }
[data-theme="dark"] .showcase__img--light { display: none; }
[data-theme="dark"] .showcase__img--dark { display: block; }

/* Stand-in for the old full-bleed covers until the cut-outs land: the cover
   is laid in the middle of the square as a card, so its own background reads
   as the object instead of being cropped to an arbitrary square. Delete the
   modifier from a card in index.html as its transparent export arrives. */
.showcase__card--cover .showcase__img {
  inset: auto 0;
  top: 50%;
  height: auto;
  max-height: 100%;
  translate: 0 -50%;
  border-radius: var(--radius-tile);
  box-shadow: var(--shadow);
}

/* The name is in the markup for assistive tech, for keyboard focus and for
   touch, which has no cursor to carry the pill. With a mouse it is hidden
   and the pill does the job. */
.showcase__name {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 1rem;
  text-align: center;
  font-size: .9375rem;
  line-height: 1.3;
  color: var(--ink-soft);
}
@media (hover: hover) and (pointer: fine) {
  .showcase__name {
    opacity: 0;
    transition: opacity .3s var(--ease);
  }
  .showcase__card:focus-visible .showcase__name { opacity: 1; }
}

/* --- Edge blur -------------------------------------------------------------
   Three stacked backdrop blurs per edge, each masked to its own band of a
   gradient, so the blur deepens towards the edge in steps instead of
   switching on at a line. Sits inside the frame's opening and under the
   fixed chrome (60), so the nav and toggle stay sharp over it.

   It belongs to the work section only. main.js tracks, on scroll, how much of
   each band lies over the section: the blur is clipped to that part, so the
   marquee above and About below are never blurred, and its opacity is that
   share of the band, so it fades out as the section's edge crosses the band
   instead of switching off.

   Opacity and clip go on the spans, never on .showcase__edge: an opacity
   below 1 (or a clip-path) on a *parent* makes it a backdrop root, and the
   blurs inside it then see only that empty parent — the blur vanishes at
   once rather than fading. That was the first version's snap. */
.showcase__edge {
  --edge-o: 0;
  --edge-clip-top: 0px;
  --edge-clip-bottom: 0px;
  position: fixed;
  left: var(--frame-w);
  right: var(--frame-w);
  z-index: 50;
  height: clamp(4rem, 12vh, 7rem);
  pointer-events: none;
}
.showcase__edge--top { top: var(--frame-w); }
.showcase__edge--bottom { bottom: var(--statusbar-h); }

.showcase__edge span {
  position: absolute;
  inset: 0;
  opacity: var(--edge-o);
  clip-path: inset(var(--edge-clip-top) 0 var(--edge-clip-bottom) 0);
}
.showcase__edge span:nth-child(1) { backdrop-filter: blur(1.5px); -webkit-backdrop-filter: blur(1.5px); }
.showcase__edge span:nth-child(2) { backdrop-filter: blur(5px);   -webkit-backdrop-filter: blur(5px); }
.showcase__edge span:nth-child(3) { backdrop-filter: blur(14px);  -webkit-backdrop-filter: blur(14px); }

/* Masks are written for the top edge (opaque at the top, i.e. at the edge)
   and flipped for the bottom one. */
.showcase__edge--top span:nth-child(1) { mask-image: linear-gradient(to top, transparent 0%, #000 25%, #000 50%, transparent 75%); }
.showcase__edge--top span:nth-child(2) { mask-image: linear-gradient(to top, transparent 25%, #000 50%, #000 75%, transparent 100%); }
.showcase__edge--top span:nth-child(3) { mask-image: linear-gradient(to top, transparent 50%, #000 75%, #000 100%); }
.showcase__edge--bottom span:nth-child(1) { mask-image: linear-gradient(to bottom, transparent 0%, #000 25%, #000 50%, transparent 75%); }
.showcase__edge--bottom span:nth-child(2) { mask-image: linear-gradient(to bottom, transparent 25%, #000 50%, #000 75%, transparent 100%); }
.showcase__edge--bottom span:nth-child(3) { mask-image: linear-gradient(to bottom, transparent 50%, #000 75%, #000 100%); }

/* --- Cursor pill -----------------------------------------------------------
   Frosted, follows the pointer: the work cards' name and client/year on the
   home, OPEN IMAGE and the file over a case's screenshots. One component for
   both, driven by followPill() in main.js, which positions it by transform;
   the element itself sits at the top left of the viewport. Above the case
   layer (55) and the side nav (60). */
.cursor-pill {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 70;
  display: flex;
  align-items: baseline;
  gap: .6em;
  padding: .45rem .85rem;
  border-radius: 999px;
  /* Opaque enough that the meta line holds its contrast over saturated
     artwork: at 55% a purple cover bled through and the grey sank into it. */
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 8%, transparent), var(--shadow);
  font-size: .875rem;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  scale: .9;
  transition: opacity .25s var(--ease), scale .25s var(--ease);
}
.cursor-pill.is-on { opacity: 1; scale: 1; }
.cursor-pill__name { color: var(--ink); }
.cursor-pill__meta { color: var(--ink-soft); }

@media (prefers-reduced-motion: reduce) {
  .showcase__card:hover .showcase__img { transform: none; }
}

/* --- Case-study stage ------------------------------------------------------
   The chapter label sits beside the heading instead of above it, and the prose
   runs under the heading instead of next to it.

   minmax(0, …): a bare fr track refuses to shrink below its content, so an
   image or a long word forces the column wider than the viewport — the usual
   cause of sideways scroll on phones. */
.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

/* --- The case column -------------------------------------------------------
   A case is one column the width of its text, title to close: the hero, every
   chapter, the hairlines that open them, the figures. It used to be a 2fr/10fr
   grid whose left track had held a chapter label; once the side-nav pill took
   the label over, that track was an empty margin and the hairlines ran across
   it to the window's edges, twice as wide as the paragraph under them.
   The width is the prose measure, so the shell takes the prose size: 62ch
   resolves in the font it is set on, and the body's 1.0625rem would leave the
   column 6% short of the text inside it. */
.case-hero,
.shell:has(> .stage) {
  max-width: calc(var(--measure) + var(--gutter) * 2);
  font-size: var(--prose-size);
}

/* A chapter opens on a hairline, the same one that sits under the case
   title above the facts: column wide, then the heading under it. It replaced
   the mono label that used to sit in the left column — that label repeated
   the side-nav pill word for word. Only chapters get it, which is what the
   id says: the video and the wall figure are stages in sections of their
   own with no id, and they are not chapters. */
.section[id] > .stage {
  border-top: 1px solid var(--divider);
  padding-top: clamp(2rem, 4vw, 3.5rem);
}

/* Only when there is a heading to sit under. #outcome has prose alone. */
.stage__body > .display-2 + .prose { margin-top: clamp(1.5rem, 3vw, 2.25rem); }

/* Figures sit inside the text column, under the prose, so the label column
   stays a clean margin all the way down the page. */
.stage__body > .prose + .figure-stack { margin-top: clamp(2.5rem, 5vw, 4rem); }

/* E il ritorno al testo dopo una figura. Serve da quando un caso mette una
   figura *fra* due paragrafi invece che in fondo (lo storyboard di Lia, sotto
   il primo paragrafo dell'approccio): lì il secondo .prose è un fratello
   successivo dello stack e senza questa regola si incollava alla didascalia.
   Stesso valore della regola sopra: il ritmo verticale non cambia a seconda
   di quale dei due elementi viene prima. */
.stage__body > .figure-stack + .prose { margin-top: clamp(2.5rem, 5vw, 4rem); }

.display-2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.5rem);
  line-height: 1.02;
  max-width: 18ch;
}

.prose {
  max-width: var(--measure);
  color: var(--ink-soft);
  font-size: var(--prose-size);
}
.prose strong { color: var(--ink); font-weight: 500; }

/* The first inline link in body copy anywhere on the site, so it needs saying:
   the base rule is `a { color: inherit }`, which inside a paragraph would make
   a link indistinguishable from the sentence around it. It takes the same step
   up that `strong` takes — soft body ink to full --ink — and keeps its
   underline, held back to --rule so it marks the link without striping the
   paragraph. Hover goes to --accent, the same "this is interactive" move the
   work tiles and socials already make. */
.prose a {
  color: var(--ink);
  text-decoration-color: var(--rule);
  text-underline-offset: .18em;
  transition: color .25s var(--ease), text-decoration-color .25s var(--ease);
}
.prose a:hover,
.prose a:focus-visible {
  color: var(--accent);
  text-decoration-color: currentColor;
}

/* ==========================================================================
   Work experience & education
   One row per place: name and role on the left, years and a chevron on the
   right. The chevron folds the description and the links to the cases
   together (links outside the fold were tried and dropped the same day, on
   request). WeSchool, the row with the cases, starts open; the rest start
   closed. The fold is a native <details>, so it opens and closes with no
   JS, by keyboard, and stays readable with CSS off.

   Replaced on 2026-11-12, on request, the three-column row with the role
   centred: once the rows carried descriptions and links the centred role
   floated free of everything under it. Rows start closed, so the section
   reads as a short list again.
   ========================================================================== */

/* Titolo di sezione vero, non l'eyebrow: `.display-2` lo mette nel gruppo
   --heading, quindi segue il tema come tutti gli altri titoli. max-width
   sciolto perché 18ch spezzerebbe "Work Experience &" lasciando la congiunzione
   a fine riga. */
.cv__title {
  margin: 0;
  max-width: none;
}

/* Title and the Download CV pill on one row; the pill wraps under the title
   when there isn't room beside it. The gap under the row was the title's. */
.cv__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .875rem 1.5rem;
  margin: 0 0 clamp(1.75rem, 3.5vw, 2.75rem);
}

.cv {
  margin: 0;
  padding: 0;
  list-style: none;
  /* La riga sopra la prima voce; ogni voce porta la propria sotto. */
  border-top: 1px solid var(--rule);
  /* Lets the open/close below transition to and from height: auto. */
  interpolate-size: allow-keywords;
  /* One gentle in-out curve for everything the fold moves: height,
     chevron, text. --ease races out and stops dead, which read as a snap
     on a short drop like this one (2026-11-12, on request). */
  --fold: .55s;
  --fold-ease: cubic-bezier(.45, 0, .2, 1);
}

.cv__row { border-bottom: 1px solid var(--rule); }

/* The whole head is the button, not just the chevron: a target the width of
   the row. Under 46rem the role drops under the name, so name, years and
   chevron keep one line. */
.cv__head {
  display: grid;
  /* The chevron's track has a fixed width, so a row without one keeps
     its years aligned with the rest. */
  grid-template-columns: minmax(0, 1fr) auto .875rem;
  grid-template-areas: "org years chev" "role role role";
  gap: .15rem .75rem;
  /* Centred, not on the baseline: the logo tile is the name's first box,
     so a baseline row lined up on the tile's foot and lifted the name. */
  align-items: center;
  padding-block: clamp(.85rem, 1.6vw, 1.15rem);
  list-style: none;
}
summary.cv__head { cursor: pointer; }
.cv__head::-webkit-details-marker { display: none; }
.cv__head:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.cv__org {
  grid-area: org;
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  font-weight: 500;
  color: var(--ink);
  transition: color .3s var(--ease);
}

/* The place's own icon on a white squircle with a grey edge, like an app
   icon. Square icons with their own background fill it edge to edge and
   the squircle clips their corners; a transparent mark (IED) is inset so
   the white shows round it. Taken from each site's apple-touch-icon,
   Facile.it's through Google's favicon service because its site turns
   scripted requests away (2026-11-12). */
.cv__logo {
  --tile: 1.75rem;
  flex: none;
  position: relative;
  width: var(--tile);
  height: var(--tile);
  border: 1px solid var(--rule);
  border-radius: var(--squircle-s);
  background: var(--logo-tile);
  overflow: hidden;
}
@supports (corner-shape: superellipse(2)) {
  .cv__logo { corner-shape: superellipse(2); }
}
.cv__logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cv__logo--inset img { padding: 14%; object-fit: contain; }
/* Freelance has no logo of its own: a line globe, drawn inline. */
.cv__logo--glyph svg {
  display: block;
  width: 100%;
  height: 100%;
  padding: 18%;
  color: var(--logo-mark);
}

.cv__role {
  grid-area: role;
  color: var(--ink-soft);
}
/* Under 46rem the role sits under the name: it starts where the name's
   text does, not under the tile. */
@media (max-width: 45.99rem) {
  .cv__role { padding-left: calc(1.75rem + .65rem); }
}

/* Mono come le altre etichette del sito, ma non più un dato secondario: sta
   sull'inchiostro pieno e in medium, così regge il proprio lato della riga
   invece di svanire. nowrap perché un intervallo spezzato a metà
   ("2018 ·" / "2021") è illeggibile. */
.cv__years {
  grid-area: years;
  font-family: var(--font-mono);
  font-size: .8125rem;
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--ink);
  white-space: nowrap;
}

.cv__chevron {
  grid-area: chev;
  align-self: center;
  width: .875rem;
  height: .875rem;
  color: var(--ink-soft);
  transition: transform var(--fold) var(--fold-ease), color .3s var(--ease);
}
.cv__item[open] .cv__chevron { transform: rotate(180deg); }
summary.cv__head:hover .cv__org,
summary.cv__head:hover .cv__chevron { color: var(--accent); }

@media (min-width: 46rem) {
  .cv__head {
    grid-template-columns: max-content minmax(0, 1fr) auto .875rem;
    grid-template-areas: "org role years chev";
    column-gap: 1rem;
  }
  /* Description and links start where the name does, not under the tile. */
  .cv__detail { padding-left: calc(1.75rem + .65rem); }
}

/* Open and close by height where the browser can animate <details>
   (::details-content, Chromium); elsewhere it simply snaps. */
@supports selector(::details-content) {
  .cv__item::details-content {
    block-size: 0;
    overflow: clip;
    transition:
      block-size var(--fold) var(--fold-ease),
      content-visibility var(--fold) allow-discrete;
  }
  .cv__item[open]::details-content { block-size: auto; }
}

/* The text doesn't ride the edge of the growing box: it comes into focus
   once the room is there, the same blur-to-sharp the rest of the site uses.
   On close it goes first and fast, so the box never shuts on visible text. */
.cv__detail {
  opacity: 0;
  filter: blur(4px);
  translate: 0 -.35rem;
  transition:
    opacity .22s var(--fold-ease),
    filter .22s var(--fold-ease),
    translate .22s var(--fold-ease);
}
.cv__item[open] .cv__detail {
  opacity: 1;
  filter: none;
  translate: 0 0;
  transition:
    opacity .45s var(--fold-ease) .15s,
    filter .45s var(--fold-ease) .15s,
    translate .45s var(--fold-ease) .15s;
}
@starting-style {
  .cv__item[open] .cv__detail { opacity: 0; filter: blur(4px); translate: 0 -.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  .cv__item::details-content,
  .cv__chevron,
  .cv__detail,
  .cv__item[open] .cv__detail { transition: none; }
}

/* What was done there, then the cases. The paragraph runs the full width
   of the row: held to the reading measure it sat in the left half of a
   full-width row and read as cramped (2026-11-12, on request). */
.cv__detail {
  display: grid;
  gap: .85rem;
  padding-bottom: clamp(1rem, 2vw, 1.4rem);
}

.cv__text {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.55;
  text-wrap: pretty;
}

/* The cases as small pills: first cards (they outweighed the text), then
   underlined links at body size (still too loud next to the row's own
   facts), now this (2026-11-12, on request). The arrow says "another page";
   it opens in the overlay like any case link on the home (main.js article
   overlay). */
.cv__work {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.cv-link {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  padding: .3rem .7rem .3rem .8rem;
  border: 1px solid var(--rule);
  /* A squircle like the rest of the site's chrome, not a round pill. */
  border-radius: var(--squircle-s);
  background: var(--surface);
  font-size: .8125rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink);
  text-decoration: none;
  transition: color .3s var(--ease), border-color .3s var(--ease);
}
.cv-link:hover,
.cv-link:focus-visible {
  color: var(--accent);
  border-color: var(--divider);
}
.cv-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
@supports (corner-shape: superellipse(2)) {
  .cv-link { corner-shape: superellipse(2); }
}

.cv-link__icon {
  flex: none;
  width: .7em;
  height: .7em;
  transition: transform .4s var(--ease);
}
.cv-link:hover .cv-link__icon,
.cv-link:focus-visible .cv-link__icon { transform: translate(2px, -2px); }

/* Under "Let's get in touch", centred by the column it sits in. */
.contact__cv { margin-top: clamp(1.25rem, 3vw, 2rem); }

/* Definition-list style service listing */
.services { margin: 0; }
.service {
  display: grid;
  gap: .5rem 2rem;
  padding: 1.75rem 0;
  border-top: 1px solid var(--rule);
}
@media (min-width: 46rem) {
  .service {
    grid-template-columns: 1.5rem minmax(0, 1fr) minmax(0, 1.2fr);
    align-items: baseline;
  }
}
.service__num {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--ink-faint);
}
.service__name {
  font-size: 1.25rem;
  letter-spacing: -.015em;
}
.service__body {
  margin: 0;
  font-size: .9375rem;
  color: var(--ink-soft);
}

/* ==========================================================================
   Logo marquee
   Driven from main.js rather than a CSS keyframe: hover eases the speed down
   and the track can be dragged or swiped, neither of which a CSS animation
   can express. No top/bottom rules — the edge fade is the only boundary.
   ========================================================================== */

/* The band owns the space on both sides of itself. Previously the gap above
   came from the hero's bottom padding and the gap below from the next
   section's top padding — two different clamps, so it read lopsided. Both
   neighbours are zeroed and this symmetric margin sets the rhythm instead. */
.marquee {
  /* One interval for the whole strip. The set's trailing padding is the same
     value as its internal gap on purpose: the sets sit flush against each
     other in the track, so that padding *is* the space between the last logo
     of one set and the first of the next. Give it anything smaller and the
     logos bunch together every time the loop wraps, which reads as a stutter
     in an otherwise even rhythm. Change this one value, not the two below. */
  --marquee-gap: clamp(4rem, 9vw, 8rem);
  overflow: hidden;
  /* Tighter above than below: the hero's globe already runs on past the
     copy and leaves its own air, so the full gap read as a hole. */
  margin-block: clamp(1rem, 3vw, 2.5rem) clamp(3.5rem, 9vw, 7rem);
  padding-block: .75rem;
  /* Horizontal fade so items enter and leave without a hard cut */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  /* Claim horizontal gestures, leave vertical page scrolling alone */
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.marquee[data-dragging="true"] { cursor: grabbing; }

.marquee__track {
  display: flex;
  width: max-content;
  will-change: transform;
}

.marquee__set {
  display: flex;
  align-items: center;
  gap: var(--marquee-gap);
  margin: 0;
  padding: 0 var(--marquee-gap) 0 0;
  list-style: none;
}

.marquee__item { display: flex; align-items: center; }

/* The logo files are authored white on transparent, so they are used as a
   *mask* rather than as an image: the shape comes from the file and the colour
   from `--ink`. That gives the strip the page's own ink in both themes —
   near-black on the light sheet, near-white on the dark one — from a single
   asset. A filter cannot produce an arbitrary colour; a mask can, so the
   strip follows the ink token wherever it is retuned. */
.marquee__logo {
  display: block;
  flex: none;                        /* mai comprimere: la larghezza è il ratio */
  height: clamp(1.4rem, 2.4vw, 1.9rem);
  background: var(--ink);
  opacity: .45;
  transition: opacity .3s var(--ease);
  pointer-events: none;   /* the drag belongs to the container, not the logo */
  -webkit-mask-image: var(--logo);
          mask-image: var(--logo);
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: center;
          mask-position: center;
  -webkit-mask-size: contain;
          mask-size: contain;
}

/* Artwork e proporzioni, una riga ciascuno.

   L'artwork è un data URI, non un percorso a img/logos/, e non è un vezzo: una
   mask-image esterna è soggetta alle regole di origine, e sotto file:// ogni
   file è un'origine opaca. La maschera non carica, l'elemento risulta
   mascherato del tutto, e il marquee sparisce — è successo esattamente così.
   Un data URI appartiene al documento e non ha quel problema, né aperto da
   disco né servito via http.

   Conseguenza da conoscere: i file in img/logos/ non alimentano più il sito
   direttamente, ne sono la *sorgente*. Dopo averne modificato uno:
       node tools/inline-logo-masks.js
   che rigenera le sei righe qui sotto ed è idempotente.

   L'elemento è vuoto: altezza + aspect-ratio sono l'unica cosa che gli dà una
   larghezza, e senza il ratio ogni logo collassa a zero. */
.marquee__logo--caffeina { --logo: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 38' xmlns='http://www.w3.org/2000/svg' width='200' height='38' fill='none'%3E%3Cg fill='%23fff' clip-path='url(%23a)'%3E%3Cpath d='M14.64 10.698h10.532a4.105 4.105 0 0 1 4.108 4.11c-.008.96-.475 1.972-.905 2.616L14.64 38V27.294l6.14-9.218a.477.477 0 0 0-.4-.736h-5.265a.48.48 0 0 1-.475-.476v-6.158h-.008l-6.14 9.218a.477.477 0 0 0 .4.736h5.265c.26 0 .475.215.475.476v6.166H4.108A4.105 4.105 0 0 1 0 23.192c0-.967.475-1.972.904-2.616L14.64 0zm184.08 4.126q-1.232-1.945-3.488-3.006-2.253-1.104-5.219-1.104c-1.618 0-3.12.26-4.507.79q-2.072.803-3.626 2.216a8.35 8.35 0 0 0-2.207 3.267l4.729 2.3c.445-1.088 1.134-1.955 2.077-2.607.974-.675 2.077-1.02 3.319-1.02 1.326 0 2.384.36 3.181 1.066.82.675 1.234 1.534 1.234 2.562v.782l-7.159 1.165c-1.886.292-3.449.798-4.683 1.504-1.234.705-2.154 1.595-2.744 2.653-.583 1.028-.882 2.209-.882 3.536s.338 2.607 1.02 3.673q1.011 1.544 2.874 2.385 1.85.842 4.369.844c1.326 0 2.537-.177 3.625-.537a10.1 10.1 0 0 0 2.921-1.588c.345-.283.667-.598.973-.935v2.523H200V19.288c0-1.71-.422-3.198-1.28-4.464m-4.507 10.653a5.86 5.86 0 0 1-.797 3.013q-.747 1.37-2.162 2.163c-.912.499-1.977.752-3.181.752q-1.414-.002-2.391-.706c-.613-.506-.927-1.166-.927-1.994s.283-1.541.843-2.078q.837-.794 2.56-1.104l6.055-1.028zm-22.88-13.613c-1.356-.767-2.92-1.15-4.683-1.15s-3.212.383-4.507 1.15a6.05 6.05 0 0 0-2.299 2.331v-2.952h-5.435v24.05h5.787V21.19c0-1.059.207-1.971.613-2.738a4.36 4.36 0 0 1 1.725-1.772c.736-.445 1.579-.66 2.522-.66s1.809.215 2.522.66a4.37 4.37 0 0 1 1.724 1.772q.611 1.151.613 2.737v14.104h5.795V19.817q0-2.695-1.15-4.732a8.05 8.05 0 0 0-3.227-3.221m-27.179 23.437h5.787V11.243h-5.787zm0-26.758h5.787V2.354h-5.787zm-6.6 5.66a10.5 10.5 0 0 0-3.664-2.561c-1.418-.622-3.066-.928-4.951-.928q-3.356 0-6.101 1.633c-1.794 1.09-3.227 2.577-4.285 4.464-1.035 1.855-1.548 3.995-1.548 6.41 0 2.417.513 4.456 1.548 6.374 1.027 1.917 2.476 3.428 4.331 4.555 1.854 1.12 4.024 1.68 6.492 1.68q2.481-.002 4.514-.752c1.38-.506 2.576-1.196 3.58-2.078.996-.89 1.732-1.902 2.207-3.052l-4.683-2.301a6.05 6.05 0 0 1-2.207 2.255q-1.378.841-3.365.843c-1.326 0-2.499-.314-3.534-.936-1.004-.613-1.77-1.487-2.299-2.607a7.2 7.2 0 0 1-.568-2.3h17.315c.123-.323.192-.706.223-1.143q.092-.668.092-1.289c0-1.618-.269-3.121-.797-4.51a11.4 11.4 0 0 0-2.3-3.757m-14.418 6.281c.092-.506.23-.982.407-1.419.506-1.173 1.226-2.063 2.169-2.653.943-.614 2.016-.928 3.227-.928s2.338.314 3.227.928c.912.62 1.556 1.465 1.939 2.523.192.483.307.997.353 1.549zM113.44 1.825c-1.855 0-3.464.338-4.813 1.02a7.5 7.5 0 0 0-3.181 2.96q-1.104 1.9-1.104 4.64v.798h-4.239v5.176h4.239v18.882h5.787V16.418h5.35v-5.176h-5.35v-.798q0-1.815 1.058-2.653 1.06-.883 3.005-.882c.206 0 .429.015.659.046.268 0 .544.03.843.092v-5a9 9 0 0 0-1.104-.13 8 8 0 0 0-1.15-.093m-16.64 0c-1.855 0-3.465.338-4.814 1.02a7.5 7.5 0 0 0-3.18 2.96q-1.104 1.9-1.104 4.64v.798h-4.247v5.176h4.247V35.3h5.787V16.418h5.35v-5.176h-5.35v-.798q0-1.815 1.057-2.653 1.06-.883 3.005-.882c.207 0 .43.015.66.046.267 0 .543.03.842.092v-5a8 8 0 0 0-1.103-.13 8 8 0 0 0-1.15-.093m-20.826 9.993c-1.502-.736-3.234-1.104-5.212-1.104-1.617 0-3.12.26-4.507.79-1.387.536-2.59 1.273-3.625 2.216a8.2 8.2 0 0 0-2.208 3.267l4.73 2.3a5.67 5.67 0 0 1 2.077-2.607c.973-.675 2.077-1.02 3.311-1.02 1.326 0 2.391.36 3.18 1.066.829.675 1.243 1.534 1.243 2.562v.782l-7.16 1.165c-1.885.292-3.449.798-4.683 1.504-1.241.705-2.153 1.595-2.744 2.653-.59 1.028-.881 2.209-.881 3.536s.337 2.607 1.012 3.673q1.023 1.544 2.874 2.385c1.242.56 2.698.844 4.377.844 1.326 0 2.537-.177 3.625-.537a10 10 0 0 0 2.913-1.588 8.6 8.6 0 0 0 .973-.935v2.523h5.48V19.288q-.002-2.565-1.28-4.464-1.24-1.945-3.495-3.006m-1.011 13.659a5.9 5.9 0 0 1-.797 3.013c-.499.913-1.227 1.634-2.17 2.163q-1.367.75-3.18.752c-.943 0-1.733-.238-2.384-.706-.621-.506-.928-1.166-.928-1.994s.276-1.541.836-2.078q.842-.794 2.567-1.104l6.056-1.028zm-32.239-8.528c1.004-.622 2.139-.928 3.403-.928 1.357 0 2.545.368 3.58 1.104a6 6 0 0 1 2.253 2.922l5.082-2.209c-.475-1.442-1.25-2.684-2.345-3.712-1.058-1.058-2.33-1.886-3.802-2.477q-2.21-.929-4.775-.928c-2.384 0-4.538.545-6.454 1.634a12 12 0 0 0-4.461 4.463q-1.633 2.832-1.633 6.412c0 2.385.544 4.54 1.633 6.457a12.33 12.33 0 0 0 4.46 4.51c1.917 1.088 4.063 1.633 6.455 1.633q2.608.002 4.813-.882c1.472-.621 2.737-1.457 3.802-2.523q1.587-1.636 2.3-3.674l-5.082-2.3q-.667 1.853-2.208 2.96c-1.035.736-2.238 1.104-3.625 1.104q-1.898.002-3.404-.928-1.46-.93-2.299-2.561c-.56-1.09-.843-2.347-.843-3.758s.283-2.669.843-3.758 1.326-1.948 2.3-2.561z'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='a'%3E%3Cpath fill='%23fff' d='M0 0h200v38H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E"); aspect-ratio: 200 / 38; }
.marquee__logo--cosmico  { --logo: url("data:image/svg+xml,%3Csvg viewBox='0 0 279 64' xmlns='http://www.w3.org/2000/svg' width='279' height='64' fill='none'%3E%3Cmask id='a' width='278' height='64' x='0' y='0' maskUnits='userSpaceOnUse' style='mask-type:luminance'%3E%3Cpath fill='%23fff' d='M277.324 0H0v64h277.324z'/%3E%3C/mask%3E%3Cg fill='%23fff' mask='url(%23a)'%3E%3Cpath d='M63.41 31.999c0-12.996 8.873-19.55 18.777-19.55 9.143 0 16.071 5.408 17.099 13.325H91.82c-.542-4.206-4.546-7.1-9.63-7.1-6.6 0-11.58 4.64-11.58 13.325s4.975 13.268 11.58 13.268c5.196 0 9.2-2.895 9.849-7.044h7.143c-.757 7.917-7.685 13.325-16.987 13.325-10.064 0-18.776-6.554-18.776-19.55zm38.894 5.351c0-8.19 5.952-14.198 14.286-14.198s14.231 6.008 14.231 14.198-5.952 14.198-14.231 14.198-14.286-6.007-14.286-14.198m21.804 0c0-4.97-3.028-8.412-7.518-8.412s-7.573 3.442-7.573 8.412 3.027 8.412 7.573 8.412 7.518-3.442 7.518-8.412m9.469 4.588h6.059c.271 2.621 2.271 4.258 5.251 4.258 2.597 0 4.326-1.31 4.326-2.947 0-6.116-14.931-.274-14.931-11.906 0-4.805 4.167-8.19 9.792-8.19 6.386 0 10.769 3.55 11.04 8.901h-6.06c-.379-2.569-2.705-3.88-4.813-3.88-2.382 0-3.952 1.094-3.952 2.952 0 5.95 15.151-.603 15.151 11.85 0 5.186-4.167 8.572-10.549 8.572s-10.984-3.716-11.306-9.61zm26.509-18.348h6.654v4.311c1.35-2.786 4.059-4.753 7.9-4.753 4.326 0 7.302 1.858 8.493 5.244 1.247-2.84 4.709-5.244 9.036-5.244 5.9 0 9.685 4.315 9.685 10.157v17.8h-6.602V35.328c0-3.88-2.004-6.446-5.195-6.446-3.569 0-5.788 2.566-5.788 6.446v15.777h-6.602V35.328c0-3.88-2-6.446-5.195-6.446-3.517 0-5.732 2.566-5.732 6.446v15.777h-6.654zm55.127-6.887c0 2.119-1.699 3.832-3.795 3.832h-.622c-2.099 0-3.796-1.717-3.796-3.832 0-2.119 1.701-3.832 3.796-3.832h.622c2.1 0 3.795 1.717 3.795 3.832m-7.409 6.888h6.653v27.518h-6.653zm11.147 13.759c0-7.865 5.359-14.198 13.852-14.198 6.871 0 12.442 4.15 13.039 10.487h-6.6c-.488-2.73-3.14-4.697-6.277-4.697-4.596 0-7.086 3.603-7.086 8.412s2.541 8.412 7.195 8.412c3.139 0 5.573-1.802 6.223-4.536h6.709c-.869 6.008-6.168 10.322-13.203 10.322-8.493 0-13.852-6.333-13.852-14.198zm29.857 0c0-8.19 5.953-14.198 14.283-14.198 8.331 0 14.231 6.008 14.231 14.198s-5.953 14.198-14.231 14.198c-8.279 0-14.283-6.007-14.283-14.198m21.805 0c0-4.97-3.029-8.412-7.522-8.412s-7.574 3.442-7.574 8.412 3.033 8.412 7.574 8.412 7.522-3.442 7.522-8.412M18.5 31.999c0-7.35 5.925-13.325 13.203-13.325v-6.225c-10.697 0-19.37 8.754-19.37 19.55s8.673 19.549 19.37 19.549v-6.224c-7.282 0-13.202-5.98-13.202-13.325m26.411-.002c0-7.358-5.912-13.325-13.202-13.325v26.654c7.29 0 13.202-5.967 13.202-13.325z'/%3E%3Cpath d='M6.167 31.998c0-14.234 11.434-25.774 25.537-25.774V0C14.223 0 0 14.355 0 31.998s14.223 31.998 31.704 31.998v-6.224c-14.103 0-25.54-11.54-25.54-25.778z'/%3E%3C/g%3E%3C/svg%3E");  aspect-ratio: 279 / 64; }
.marquee__logo--facile   { --logo: url("data:image/svg+xml,%3Csvg viewBox='0 0 236 64' xmlns='http://www.w3.org/2000/svg' width='236' height='64' fill='none'%3E%3Cg fill='%23fff' clip-path='url(%23a)'%3E%3Cpath d='M115.149 33.8c0-7.788-6.325-9.258-12.872-9.258-3.126 0-6.325.514-8.79 1.91-1.176.698-2.169 1.58-2.941 2.756v-3.857h-5.407v-1.213c0-2.498 1.287-2.756 3.347-2.756.809 0 1.58.037 2.427.147v-6.355c-1.434-.037-2.942-.147-4.376-.147-7.724 0-10.482 2.424-10.482 10.36h-4.376v5.842h4.376v21.713h9.047V31.229h4.56a10 10 0 0 0-.44 2.645h8.458c.441-2.352 2.023-3.453 4.524-3.453 1.876 0 4.376.808 4.376 2.865 0 1.69-.846 2.242-2.39 2.536-6.29 1.285-16.072.588-16.072 9.552 0 5.694 4.156 8.34 9.415 8.34 3.31 0 6.767-.956 9.084-3.38.11.918.221 1.763.515 2.608h9.084c-1.066-2.167-1.066-4.74-1.066-7.054zM100.88 48.13c-2.023 0-3.788-.919-3.788-3.123 0-2.168 1.691-3.013 3.714-3.49 1.949-.515 4.303-.699 5.59-1.47.258 5.657-1.176 8.083-5.516 8.083'/%3E%3Cpath d='M129.934 46.806c-3.824 0-5.369-3.674-5.369-7.238 0-3.82.809-8.12 5.848-8.12 2.28 0 4.376 1.654 4.413 3.968h8.79c-.625-7.274-6.767-10.874-13.608-10.874-8.863 0-14.453 6.282-14.453 15.026 0 8.45 6.178 14.107 14.453 14.107 7.319 0 13.093-4.262 13.865-11.646h-8.789c-.442 2.976-2.023 4.777-5.15 4.777m23.538-31.816h-9.047v6.906h9.047zm0 10.36h-9.047v27.554h9.047zm11.511-10.36h-9.047v37.915h9.047zm15.668 9.589c-8.128 0-14.895 6.062-14.895 14.511 0 9.259 6.105 14.66 15.115 14.66 6.179 0 12.063-2.756 13.718-9.148h-8.459c-.846 2.02-2.978 3.012-5.149 3.012-3.825 0-5.994-2.498-6.179-6.282h20.265c.404-9.332-4.524-16.753-14.417-16.753zm-5.848 11.72c.515-3.344 2.648-5.622 5.848-5.622 3.015 0 5.222 2.535 5.369 5.621zm30.819 6.76h-9.893v9.883h9.893zm11.621-28.069h-9.047v6.906h9.047z'/%3E%3Cpath d='M236 31.192V25.35h-5.59v-8.34h-9.047v8.34H208.16v27.554h9.047V31.193h4.156v12.27c0 7.496 1.949 9.737 9.673 9.737 1.655 0 3.309-.22 4.928-.257v-6.65c-.809 0-1.581.11-2.354.11-1.949 0-3.236-.477-3.236-2.645V31.229H236zM64.066 37.805V24.689C64.066 11.059 52.996 0 39.352 0H24.677C11.033 0 0 11.058 0 24.652V39.31C0 52.941 11.033 64 24.677 64h48.105c.037.037-8.716-2.535-8.716-26.195M22.876 53.05c-4.083 0-7.577-1.984-9.82-5.143-1.36-1.947-2.133-4.189-2.133-6.797V22.96c0-4.114 2.023-7.604 5.149-9.809 1.986-1.36 4.193-2.094 6.767-2.094h18.204c4.12 0 7.613 2.02 9.82 5.144 1.36 1.947 2.133 4.188 2.133 6.797v16.238c0 5.07.294 9.663.809 13.851z'/%3E%3Cpath d='m20.669 30.053-2.649 5.62a33.47 33.47 0 0 0 28.43 0l-2.649-5.62a27.12 27.12 0 0 1-23.132 0'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='a'%3E%3Cpath fill='%23fff' d='M0 0h236v64H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");   aspect-ratio: 236 / 64; }
.marquee__logo--grenke   { --logo: url("data:image/svg+xml,%3Csvg viewBox='0 0 225 66' xmlns='http://www.w3.org/2000/svg' width='225' height='66' fill='none'%3E%3Cg fill='%23fff' clip-path='url(%23a)'%3E%3Cpath d='M129.364 7.73c-10.516 0-18.055 7.73-18.055 19.027V50.54h7.738V26.36c0-7.135 3.968-11.694 10.317-11.694s10.516 4.559 10.516 11.694v23.982h7.54V26.558c.198-11.099-7.342-18.829-18.056-18.829M35.516 13.08c-3.968-3.567-8.929-5.549-14.286-5.549C9.325 7.531 0 17.045 0 29.333s9.325 21.604 21.23 21.604c5.357 0 10.318-1.982 14.286-5.55-.595 7.532-6.548 13.478-14.286 13.478-3.174 0-5.754-.991-8.135-2.775l-5.357 5.35C11.508 64.414 16.071 66 21.23 66c12.302 0 21.826-9.514 21.826-21.604V7.531h-7.54zM21.627 43.803c-7.738 0-13.889-6.343-13.889-14.469s6.15-14.468 13.889-14.468 13.889 6.342 13.889 14.468-6.15 14.468-13.889 14.468M48.809 25.37v24.972h7.54V25.37c0-6.738 3.57-10.702 9.325-10.702.198 0 .198 0 .396-.199l-6.15-6.144c-6.746 2.379-11.111 8.523-11.111 17.045M160.913 0h-7.54v50.342h7.54zm20.833 15.856-5.357-5.351-13.492 16.054c-.595.793-.793 1.387-.793 2.378s.396 1.982.992 2.775l15.674 18.63h9.921l-18.056-21.405zm26.985 20.81.396.199 15.08-18.037c.992-1.189 1.587-3.963-.595-6.144-3.572-3.369-8.731-5.351-14.088-5.351-12.103 0-21.428 9.513-21.428 21.802s9.325 21.802 21.428 21.802c5.159 0 9.722-1.784 13.492-4.757l-5.158-5.153c-1.985 1.585-4.564 2.774-8.135 2.774-7.738 0-13.691-6.342-13.691-14.666s6.151-14.667 13.691-14.667c2.579 0 4.96.793 6.746 1.982l-12.5 14.865zM90.079 7.531c-11.905 0-21.429 9.514-21.429 21.802s9.326 21.802 21.429 21.802c4.96 0 9.722-1.784 13.492-4.757l-5.159-5.153C96.428 42.81 93.85 44 90.277 44c-7.738 0-13.889-6.343-13.889-14.667s5.953-14.667 13.89-14.667c2.579 0 4.96.793 6.745 1.982L84.325 31.711l4.96 4.955.397.199 15.08-18.037c.992-1.189 1.587-3.963-.596-6.144-3.571-3.17-8.73-5.153-14.087-5.153'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='a'%3E%3Cpath fill='%23fff' d='M0 0h225v66H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");   aspect-ratio: 225 / 66; }
.marquee__logo--passione { --logo: url("data:image/svg+xml,%3Csvg viewBox='0 0 208 64' xmlns='http://www.w3.org/2000/svg' width='208' height='64' fill='none'%3E%3Cg fill='%23fff' clip-path='url(%23a)'%3E%3Cpath d='M14.961 18.641c.753-.878 1.134-2.16 1.134-3.854s-.491-2.888-1.475-3.6q-1.476-1.065-4.593-1.064H6.423v9.837h4.247q3.154-.001 4.291-1.319m4.633-11.51q2.974 2.617 2.976 8.04 0 5.422-3.057 7.937-3.055 2.515-9.325 2.514H6.423v8.165H.11V4.519h9.994q6.511 0 9.486 2.617m42.818 3.215q-.91.773-.908 2.052 0 1.277 1.114 2.03 1.114.756 5.14 1.782 4.026 1.028 6.254 3.075c1.485 1.371 2.223 3.366 2.223 5.989s-.953 4.752-2.85 6.383c-1.903 1.631-4.403 2.452-7.51 2.452-4.477 0-8.507-1.714-12.096-5.153l3.765-4.773q4.57 4.145 8.457 4.145 1.739-.002 2.73-.774c.663-.514.994-1.216.994-2.093 0-.878-.351-1.58-1.054-2.094q-1.047-.772-4.166-1.568-4.936-1.215-7.222-3.163c-1.526-1.299-2.284-3.335-2.284-6.113q0-4.169 2.891-6.425 2.892-2.26 7.223-2.26 2.83-.001 5.666 1.003 2.83 1.006 4.94 2.846l-3.198 4.773q-3.68-2.89-7.61-2.888-1.578.001-2.489.774m25.799 0q-.91.773-.909 2.052 0 1.277 1.115 2.03 1.113.756 5.14 1.782 4.026 1.028 6.253 3.075c1.486 1.371 2.224 3.366 2.224 5.989q-.002 3.935-2.856 6.383c-1.902 1.631-4.402 2.452-7.504 2.452-4.477 0-8.507-1.714-12.096-5.153l3.764-4.773q4.572 4.145 8.458 4.145 1.739-.002 2.73-.774c.663-.514.994-1.216.994-2.093 0-.878-.352-1.58-1.054-2.094q-1.048-.772-4.166-1.568c-3.293-.81-5.697-1.865-7.223-3.163-1.525-1.299-2.283-3.335-2.283-6.113q0-4.169 2.89-6.425 2.893-2.26 7.223-2.26 2.83-.001 5.667 1.003 2.832 1.006 4.934 2.846l-3.197 4.773q-3.683-2.89-7.604-2.888-1.581.001-2.49.774m25.503-5.838h-6.314v29.268h6.314zm28.604 14.466q.001-3.913-2.429-6.68c-1.616-1.844-3.609-2.763-5.968-2.763q-3.54 0-5.968 2.763c-1.616 1.844-2.429 4.067-2.429 6.68q-.001 3.917 2.429 6.658 2.427 2.742 5.968 2.743 3.538 0 5.968-2.743 2.43-2.741 2.429-6.658m2.143 10.761c-2.86 2.888-6.379 4.337-10.56 4.337q-6.27.001-10.56-4.337-4.292-4.331-4.292-10.782c0-4.3 1.431-7.89 4.292-10.783q4.29-4.332 10.56-4.332t10.56 4.332q4.292 4.332 4.292 10.783t-4.292 10.782m29.414-25.227h6.311v29.268h-6.311l-13.475-18.34v18.34h-6.31V4.513h5.909l13.876 18.839zm33.667 0v5.818h-14.083v6.03h12.662v5.568h-12.662V28H208v5.781h-20.834V4.513zM33.897 21.721l3.558-8.502 3.519 8.502h-7.082zm11.343-5.833-10.9-11.28-12.178 29.167h6.716l2.63-6.32h11.855l2.63 6.32h6.716L45.24 15.883zM40.495 0h-6.108l-.04.099 10.896 11.276zM14.62 55.56c.603.81.904 1.834.904 3.064q.001 2.479-1.766 3.813c-1.175.893-2.891 1.335-5.145 1.335H0V44.694h8.096c2.063 0 3.659.431 4.783 1.304 1.125.872 1.692 2.083 1.692 3.63q-.001 1.497-.658 2.587a4.37 4.37 0 0 1-1.767 1.667c1.05.307 1.878.868 2.475 1.673M2.575 46.907v6.108H7.86q1.987-.002 3.057-.774c.712-.52 1.069-1.283 1.069-2.28s-.357-1.761-1.07-2.275c-.712-.52-1.736-.78-3.056-.78zM11.81 60.81q1.109-.764 1.11-2.4c0-2.124-1.466-3.189-4.407-3.189H2.58v6.347h5.933q2.19 0 3.302-.763M38.112 44.7v19.077h13.095v-2.369h-10.52v-6.16h9.055v-2.316h-9.055v-5.864h10.164v-2.369zm43.855.005-8.176 19.077h2.66l1.983-4.773h9.597l1.987 4.773h2.705l-8.196-19.077zm1.265 2.778 3.895 9.35h-7.79l3.9-9.35zm34.093 14.336q-2.012-2.181-2.013-6.27V44.706h2.58V55.44c0 4.088 1.697 6.13 5.08 6.13 1.656 0 2.916-.505 3.794-1.512q1.313-1.51 1.315-4.618V44.705h2.505V55.55c0 2.742-.668 4.84-2.013 6.284-1.34 1.444-3.217 2.166-5.616 2.166q-3.615 0-5.627-2.181M153.169 44.7v2.368h6.189v16.709h2.549v-16.71h6.194V44.7zm51.862 0-5.802 10.06-5.773-10.06h-2.765l7.178 12.428v6.649h2.544v-6.592l7.178-12.486z'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='a'%3E%3Cpath fill='%23fff' d='M0 0h208v64H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E"); aspect-ratio: 208 / 64; }
.marquee__logo--weschool { --logo: url("data:image/svg+xml,%3Csvg viewBox='0 0 408 64' xmlns='http://www.w3.org/2000/svg' width='408' height='64' fill='none'%3E%3Cpath fill='%23fff' d='M11.22.43c1.21 0 2.058.61 2.3 1.464L20.3 24.96h10.169l6.658-23.066C37.369 1.04 38.217.43 39.306.43h6.053c1.09 0 1.937.611 2.179 1.465l6.658 23.066h10.17l6.778-23.066C71.387 1.04 72.235.43 73.446.43h8.958c1.695 0 2.542 1.466 2.179 2.564L66.907 58.155c-1.09 3.417-3.873 5.369-7.02 5.37-3.39 0-5.812-1.953-7.023-5.37L43.18 24.96h-1.695L31.8 58.155c-1.21 3.417-3.631 5.369-7.02 5.37-3.148 0-5.933-1.953-7.022-5.37L.083 2.993C-.28 1.895.567.429 2.262.429zm92.732 17.818c11.259 0 20.822 9.03 20.822 20.991v2.196c0 1.708-.847 2.319-1.937 2.319H92.693c.848 5.858 5.448 9.03 10.775 9.03 4.116 0 7.506-1.708 8.353-3.66.242-.61.605-1.22 1.695-1.22h8.353c1.453 0 2.058 1.22 1.694 2.562-1.937 7.689-10.047 13.058-19.611 13.058-12.832 0-22.759-10.129-22.759-23.187 0-12.448 9.927-22.09 22.759-22.09M151.165.429c14.043 0 21.065 7.934 21.791 17.819 0 1.098-.726 2.562-1.937 2.562h-9.201c-1.21 0-1.694-1.098-1.936-1.952-1.211-4.028-4.601-6.59-9.323-6.59-4.72 0-8.11 2.563-8.11 5.98.001 10.25 32.806 2.563 32.807 26.36 0 10.984-9.564 18.916-22.396 18.916-12.348 0-22.274-7.322-23.122-18.916-.121-1.098.484-2.074 2.058-2.074h8.716c1.089 0 1.816.61 1.937 1.708.485 4.271 5.084 6.834 10.411 6.834s9.443-2.563 9.443-6.468c-.001-10.739-32.202-3.662-32.202-26.36 0-10.496 9.2-17.818 21.064-17.819m51.088 17.818c10.048 0 18.158 5.98 20.7 15.011.363 1.099-.484 2.197-1.936 2.197h-9.322c-.847 0-1.332-.366-1.695-1.098-.848-2.562-4.116-4.271-7.747-4.271-5.932 0-10.411 4.27-10.411 10.861 0 5.858 4.479 10.13 10.411 10.13 3.631 0 6.899-1.465 7.505-3.905.484-1.221 1.453-1.465 2.543-1.465h8.716c1.331 0 2.178.976 1.936 2.196-1.936 9.153-10.652 15.621-20.7 15.621-12.954 0-22.76-9.64-22.76-22.577 0-13.058 9.806-22.7 22.76-22.7m95.394 0c12.833 0 22.396 9.642 22.396 22.7 0 12.936-9.564 22.577-22.396 22.577-12.348 0-22.517-9.64-22.517-22.577 0-13.058 10.169-22.7 22.517-22.7m49.393 0c12.348 0 21.791 9.642 21.791 22.7 0 12.936-9.443 22.577-21.791 22.577-12.953 0-22.518-9.64-22.518-22.577 0-13.058 9.565-22.7 22.518-22.7M238.691.43c.969 0 1.937.733 1.937 1.954v22.943h1.211c.968-2.197 4.964-7.078 11.622-7.078 10.532 0 16.706 7.688 16.706 19.526v22.577c0 1.343-.726 2.32-2.058 2.32h-8.111c-1.332 0-1.938-.977-1.938-2.32V39.24c0-5.37-3.389-9.153-8.715-9.153s-8.717 3.784-8.717 9.153v21.112c0 1.343-.968 2.32-1.937 2.32h-8.111c-1.332 0-2.3-.977-2.3-2.32V2.383c0-1.22.968-1.953 2.3-1.954zm145.877 0c1.332 0 2.058.49 2.058 1.954V60.35c0 1.343-.726 2.32-2.058 2.32h-8.111c-1.21 0-2.179-.977-2.179-2.32V2.383c0-1.465.848-1.954 2.179-1.954zm15.961 56.904h-1.986v5.338h-.661v-5.338h-1.986V56.5h4.633zm4.302 4.67 1.986-5.504h.992v6.172h-.827V58l-1.654 4.67h-.993L402.681 58v4.67h-.828V56.5h.993zM297.647 30.086c-5.931 0-10.169 4.27-10.169 10.861.001 5.858 4.238 10.13 10.169 10.13 5.811 0 10.048-4.272 10.048-10.13 0-6.59-4.237-10.861-10.048-10.861m49.393 0c-5.932 0-10.653 4.27-10.653 10.861 0 5.858 4.721 10.13 10.653 10.13a10.06 10.06 0 0 0 10.048-10.13c0-6.59-4.722-10.861-10.048-10.861m-243.572-1.587c-4.843 0-8.716 2.197-10.411 6.956h18.764c0-4.15-4.238-6.956-8.353-6.956'/%3E%3C/svg%3E"); aspect-ratio: 408 / 64; }

/* Logos are pointer-inert, so the lift is driven from the container —
   it pairs with the hover slowdown rather than tracking one logo. */
.marquee:hover .marquee__logo { opacity: .75; }

/* Light artwork on a dark page carries further, so it can sit a touch higher
   without shouting. */
[data-theme="dark"] .marquee__logo { opacity: .55; }
[data-theme="dark"] .marquee:hover .marquee__logo { opacity: .85; }

/* ==========================================================================
   Contact / footer
   ========================================================================== */

/* A full screen of its own: the invitation up top, the hero's globe sinking
   out of the bottom. The height is the frame's opening — the viewport less
   the top rail and the chin — so at the end of the scroll the section is
   exactly what the window shows. No bottom padding: the globe's own fade is
   the end of the page. */
.contact {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: calc(100vh - var(--frame-w) - var(--statusbar-h));
  min-height: calc(100svh - var(--frame-w) - var(--statusbar-h));
  padding-bottom: 0;
}

/* Takes whatever height the globe leaves and centres the link in it */
.contact__head {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: clamp(1.5rem, 4vw, 3rem);
}

/* Same element and renderer as the hero's globe, so this only overrides the
   hero's placement. On a phone it keeps the base rule's overhang (145%, off
   both edges); from 56rem it drops the hero's grid span and sideways mask
   and sits centred, its width capped by the viewport height so the head
   above keeps room on a short laptop. Cropped near the equator like the
   hero, with the same fade taking the cut. */
.contact__globe {
  flex: none;
  aspect-ratio: 1 / .52;
}
@media (min-width: 56rem) {
  .contact__globe {
    grid-area: auto;
    justify-self: auto;
    width: min(100%, 64rem, 105vh);
    margin-inline: auto;
    -webkit-mask-image: linear-gradient(180deg, #000 45%, transparent 100%);
            mask-image: linear-gradient(180deg, #000 45%, transparent 100%);
  }
}

.contact__mail {
  display: inline-block;
  margin-block: 1.5rem 0;
  /* Redaction 10, and split for the same cursor-proximity field as the hero */
  font-family: var(--font-hero);
  font-size: clamp(2.5rem, 1rem + 6.5vw, 6.5rem);
  line-height: 1.1;
  letter-spacing: -.03em;
  text-decoration: none;
  /* Same muted-to-prominent lift as the logo marquee: sits back at rest,
     comes forward on hover. Values match .marquee__logo exactly. */
  color: var(--ink);
  opacity: .45;
  transition: opacity .3s var(--ease);
}
.contact__mail:hover,
.contact__mail:focus-visible { opacity: .75; }

[data-theme="dark"] .contact__mail { opacity: .55; }
[data-theme="dark"] .contact__mail:hover,
[data-theme="dark"] .contact__mail:focus-visible { opacity: .85; }

/* ==========================================================================
   Case study page
   ========================================================================== */

.case-hero { padding-block: clamp(5rem, 11vw, 8rem) 0; }

/* The facts sit between two hairlines with the same space on either side:
   down from the title's hairline is .case-facts' 2rem padding-top, so up
   from the last value to the first chapter's hairline is 2rem too. This
   replaced a full section's padding stacked on the hero's own, 13rem. */
.case-hero + .section,
.case-hero + .section--tight { padding-top: 2rem; }

.case-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 1.5rem + 5vw, 5.5rem);
  line-height: .98;
  max-width: 14ch;
}

/* Two rows in the text column: four facts go two by two, the App case's five
   three and two. auto-fit would have laid four out three and one. */
.case-facts {
  display: grid;
  gap: 1.75rem 2rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: clamp(2.5rem, 5vw, 4rem) 0 0;   /* a <dl>'s default 1em below */
  padding-top: 2rem;
  border-top: 1px solid var(--divider);
}
.case-facts:has(> :nth-child(5)) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 30rem) {
  .case-facts:has(> :nth-child(5)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.fact__label {
  margin: 0 0 .35rem;
  font-family: var(--font-mono);
  font-size: .6875rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.fact__value { margin: 0; font-size: .9375rem; }

.figure { margin: 0; }
.figure img { border-radius: var(--radius); width: 100%; }

/* Il primo e unico embed di terze parti del sito. Va in un wrapper e non
   sull'iframe perché un border-radius applicato all'iframe non ritaglia in
   modo affidabile quello che ci sta dentro: serve overflow:hidden su qualcosa
   che lo contenga. L'aspect-ratio sta qui per lo stesso motivo per cui le
   immagini portano width/height in HTML — riserva lo spazio prima che il
   player arrivi, così il testo sotto non salta. --bg-sunk è cosa si vede in
   quell'intervallo, e se l'iframe non carica affatto.
   Nessun facade con poster e click-to-load: vorrebbe un blocco in main.js, e
   main.js e' una sola IIFE dove ogni blocco nuovo va chiuso nella propria
   funzione (HANDOVER §4). loading="lazy" sull'iframe copre il caso in cui il
   video non sia il primo schermo; qui lo e', quindi non risparmia nulla. */
.video {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-sunk);
}
.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.figure figcaption {
  margin-top: .9rem;
  font-size: .8125rem;
  color: var(--ink-faint);
}

/* Una figura per riga, sempre. Ognuna di queste immagini è già tre schermi
   affiancati (sorgente da 4444px, rapporto 2:1): due per riga significava sei
   telefoni nella larghezza di una colonna, e l'interfaccia dentro le schermate
   diventava illeggibile. La larghezza piena è il minimo perché si veda cosa
   c'è sullo schermo, che è l'unico motivo per cui la figura esiste.
   Il gap segue il ritmo verticale del testo, non quello stretto della griglia:
   sotto ogni immagine c'è una didascalia da staccare dalla figura seguente. */
.figure-stack {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem);
  grid-template-columns: minmax(0, 1fr);
}

/* Le figure si fermano dove si ferma il testo: stesso bordo destro, non solo
   lo stesso bordo sinistro. A tutta colonna erano larghe quasi il doppio del
   paragrafo che le spiega, e il rientro conquistato prima si vedeva solo a
   sinistra.

   Il font-size qui non rende nessun testo — dentro c'e' l'immagine e una
   didascalia che ha gia' la sua misura — ma serve a far risolvere i 62ch nel
   corpo della prosa. Senza, la figura eredita quello del body (1.0625rem
   contro 1.125rem) e resta un 6% piu' corta del testo: di nuovo un bordo
   destro sfalsato, cioe' il problema che si voleva togliere. */
.figure-stack,
.stage__body > .figure {
  max-width: var(--measure);
  font-size: var(--prose-size);
}

/* --- Before/after compare ----------------------------------------------
   Two screens of the same step stacked in one frame: the final underneath,
   the prototype on top, clipped to the left of --pos. Dragging anywhere on
   the frame moves the cut (main.js, "Before/after"); the range input under
   the handle is what the keyboard and screen readers use, invisible but
   focusable, and its focus ring lands on the handle.

   The frame is white in both themes, like the logo tiles: these are light
   screens, and their PNGs are transparent, so without a fill the final
   would show through the prototype's empty margins.

   The handle is the theme toggle's box on purpose: same size, same --rule
   border, same squircle and frosted fill, so the page's two controls read
   as one family in light and in dark. */
.compare { --pos: 50%; }

.compare__frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--radius-tile);
  background: #fff;
  cursor: ew-resize;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.figure .compare__img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0;
  pointer-events: none;
}

.compare__before {
  position: absolute;
  inset: 0;
  background: #fff;
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}

.compare__line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 1px;
  translate: -50% 0;
  background: var(--rule);
  pointer-events: none;
}

.compare__handle {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--rule);
  border-radius: var(--squircle-s);
  corner-shape: superellipse(2);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  color: var(--ink-soft);
  transition: color .25s var(--ease-soft), border-color .25s var(--ease-soft);
}
.compare__handle svg { width: 1rem; height: 1rem; }

.compare__frame:hover .compare__handle,
.compare[data-dragging] .compare__handle { color: var(--ink); border-color: var(--ink-faint); }

.compare__range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.compare__range:focus-visible ~ .compare__line .compare__handle {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* Which side is which, small and out of the way in the top corners. */
.compare__tag {
  position: absolute;
  top: .75rem;
  padding: .25rem .5rem;
  border: 1px solid var(--rule);
  border-radius: var(--squircle-s);
  corner-shape: superellipse(2);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  font-size: .75rem;
  line-height: 1;
  color: var(--ink-soft);
  pointer-events: none;
}
.compare__tag--before { left: .75rem; }
.compare__tag--after { right: .75rem; }

/* --- Carousel -------------------------------------------------------------
   A row of screens that leaves the text column for the whole window: the
   one in focus sits centred, the rest stay in view either side, faded. It
   is a native horizontal scroller with mandatory snap, so touch, trackpads
   and the arrow keys work with no script; main.js adds the mouse drag, the
   buttons and the .is-active slide (see "Carousel" there).

   The centred slide is exactly as wide as the text column (--measure, which
   resolves in the prose size the shell sets), so it lines up with the
   paragraph above it; on a phone it stays a little narrower than the screen
   so its neighbours still show, and on a short window it gives way to the
   height. All six screens are 1440x1024, hence the one ratio. The track's
   side padding is what lets the first and last slide reach the centre.

   The buttons are the theme toggle's box again, like the compare handle,
   set in the column's margin just outside the centred slide, so they sit
   at the article's edge and next to the screen they move; where there is
   no margin wide enough (phones) they overlap the slide's edge. */
.carousel {
  --slide-w: min(var(--measure), 100vw - var(--gutter) * 2, 80vw, 68vh * 1.40625);
  --slide-h: calc(var(--slide-w) / 1.40625);
  --btn: 2.25rem;
  --btn-x: max(.5rem, 50% - var(--slide-w) / 2 - var(--btn) - 1rem);
  position: relative;
  width: 100vw;
  margin-inline: calc(50% - 50vw);
}
.stage__body > .prose + .carousel { margin-top: clamp(2.5rem, 5vw, 4rem); }
/* Text after it, as after a figure (the Grenke problem, 2026-11-13). */
.stage__body > .carousel + .prose { margin-top: clamp(2.5rem, 5vw, 4rem); }

.carousel__track {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: clamp(1rem, 2.5vw, 2rem);
  padding-inline: calc(50% - var(--slide-w) / 2);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  cursor: grab;
}
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__track:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
/* While the mouse drags, and while the throw settles: snap off, or the
   browser would fight every pixel of the drag. */
.carousel__track[data-free] { scroll-snap-type: none; }
.carousel__track[data-dragging] { cursor: grabbing; }

.carousel__slide {
  flex: none;
  margin: 0;
  scroll-snap-align: center;
  opacity: .32;
  transition: opacity .45s var(--ease-soft);
}
.carousel__slide.is-active { opacity: 1; }

.carousel__slide img {
  display: block;
  width: var(--slide-w);
  height: auto;
  border: 1px solid var(--rule);
  border-radius: var(--radius-tile);
  background: #fff;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}
.carousel__slide figcaption {
  margin-top: .9rem;
  font-size: .8125rem;
  color: var(--ink-faint);
}

.carousel__btn {
  position: absolute;
  top: calc(var(--slide-h) / 2);
  translate: 0 -50%;
  display: grid;
  place-items: center;
  width: var(--btn);
  height: var(--btn);
  padding: 0;
  /* --slide-w is in ch, and a <button> brings its own smaller font: without
     this the column measured here would come out narrower than the slide's. */
  font: inherit;
  border: 1px solid var(--rule);
  border-radius: var(--squircle-s);
  corner-shape: superellipse(2);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  color: var(--ink-soft);
  cursor: pointer;
  transition:
    color .25s var(--ease-soft),
    border-color .25s var(--ease-soft),
    opacity .25s var(--ease-soft);
}
.carousel__btn:hover { color: var(--ink); border-color: var(--ink-faint); }
.carousel__btn svg { width: 1rem; height: 1rem; }
.carousel__btn:disabled { opacity: 0; pointer-events: none; }
.carousel__btn--prev { left: var(--btn-x); }
.carousel__btn--next { right: var(--btn-x); }

/* Tall slides: phone screenshots (Passione Beauty, 2026-11-17, its eight
   store frames at 2568x5556, ratio .4622). The same carousel with only the
   size changed: the centred slide is a phone's width, not the column's, so
   three to five frames are in view at once on a desktop, as they are in a
   store listing. Held under 64% of the window height so a whole frame fits
   on a laptop, and under 62vw so a phone still shows its neighbours. The
   buttons sit astride the centred slide's edge: 1rem outside it, as on the
   wide carousel, they landed on the next frame, the gap being narrower than
   a button. */
.carousel--portrait {
  --slide-w: min(18rem, 62vw, 64vh * .4622);
  --slide-h: calc(var(--slide-w) / .4622);
  --btn-x: calc(50% - var(--slide-w) / 2 - var(--btn) / 2);
}

/* 4:5 slides: social posts (WeSchool's LinkedIn carousel, 2026-11-17,
   1035x1293, ratio .8005). Between the two others: wider than a phone, since
   the slides carry body text, narrower than the column so the neighbours
   show. Buttons astride the edge, as on the portrait carousel. The ratio is
   a variable so other post shapes reuse the sizing: --square (the Alphabet
   carousel, 1:1) changes only that. */
.carousel--post {
  --ratio: .8005;
  --slide-w: min(26rem, 72vw, 64vh * var(--ratio));
  --slide-h: calc(var(--slide-w) / var(--ratio));
  --btn-x: calc(50% - var(--slide-w) / 2 - var(--btn) / 2);
}
.carousel--square { --ratio: 1; }

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

.pull-quote {
  margin: clamp(3rem, 7vw, 5rem) auto;
  max-width: 34ch;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.1rem + 1.8vw, 2.5rem);
  line-height: 1.2;
  text-align: center;
  text-wrap: balance;
}
.pull-quote cite {
  display: block;
  margin-top: 1.25rem;
  font-family: var(--font-mono);
  font-size: .75rem;
  font-style: normal;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* Outcome figures — big, side by side, Redaction 10.
   Redaction 10 is the *finest* halftone cut, not the coarsest: at this size
   it reads as type with a faint screen over it rather than as texture. The
   coarse end (_100) would turn a number into a pattern. See HANDOVER §3 for
   why the direction of that scale is easy to get backwards. */
.stats {
  display: grid;
  gap: clamp(1.75rem, 4vw, 3rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  padding-block: clamp(3rem, 6vw, 5rem);
  border-block: 1px solid var(--divider);
}
.stat__value {
  margin: 0;                        /* p carries 1.1em by default */
  font-family: var(--font-hero);
  font-size: clamp(2.75rem, 1.6rem + 4.2vw, 5.5rem);
  line-height: 1;
  letter-spacing: -.03em;
  color: var(--accent);
}
.stat__label {
  margin: .75rem 0 0;
  font-size: .875rem;
  color: var(--ink-soft);
}

/* ==========================================================================
   Image lightbox
   main.js wraps every `.figure > img` in a .figure__zoom button and builds a
   single <dialog class="lightbox"> at the end of <body>. None of it is in the
   pages' markup: without JS the figures stay plain images, which is right.
   ========================================================================== */

.figure__zoom {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: none;
  cursor: zoom-in;
}
.figure__zoom:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

/* --- The window ------------------------------------------------------------
   The dialog itself is the scrim and fills the viewport, so a click that
   lands on it and not on the window is a click outside. ::backdrop is left
   empty on purpose: until recently it inherited no custom properties, so the
   theme's --scrim could not reach it. */

html:has(.lightbox[open]) { overflow: hidden; }

.lightbox {
  /* --lb-pad is the gap between the window and the viewport, --lb-inset the
     frame of window colour kept round the image. --lb-chrome is the room held
     back for the title bar and the quote when sizing the image: enough for a
     two line caption, which is what every current caption comes to. */
  --lb-pad: clamp(.5rem, 2vw, 1.5rem);
  --lb-inset: clamp(.5rem, 1.5vw, 1.25rem);
  --lb-chrome: 7.5rem;
  /* Height of the address field, in whole pixels */
  --lb-field: 26px;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: var(--lb-pad);
  border: 0;
  background: var(--scrim);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--ink);
  overflow: hidden;
}
.lightbox::backdrop { background: transparent; }
.lightbox[open] {
  display: grid;
  place-items: center;
  animation: lightbox-in .3s var(--ease-soft);
}
.lightbox[data-closing] { animation: lightbox-out .22s var(--ease-soft) forwards; }

.lightbox__window {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  /* Wide as it can be, unless the image would then be too tall to fit: in
     that case the window narrows to the width at which it does. --lb-ratio
     is the image's own width/height, set by main.js on open. The inset is
     taken off the height before the ratio is applied and added back to the
     width after, since it frames the image on all four sides. */
  width: min(110rem, 100%, (100vh - 2 * var(--lb-pad) - var(--lb-chrome) - 2 * var(--lb-inset)) * var(--lb-ratio, 1.6) + 2 * var(--lb-inset));
  width: min(110rem, 100%, (100dvh - 2 * var(--lb-pad) - var(--lb-chrome) - 2 * var(--lb-inset)) * var(--lb-ratio, 1.6) + 2 * var(--lb-inset));
  max-height: 100%;
  border-radius: .75rem;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-window);
  animation: lightbox-window-in .45s var(--ease);
}
.lightbox[data-closing] .lightbox__window { animation: lightbox-window-out .22s var(--ease-soft) forwards; }

@keyframes lightbox-in  { from { opacity: 0; } }
@keyframes lightbox-out { to   { opacity: 0; } }
@keyframes lightbox-window-in  { from { opacity: 0; transform: translateY(16px) scale(.97); } }
@keyframes lightbox-window-out { to   { opacity: 0; transform: translateY(8px) scale(.98); } }

@media (prefers-reduced-motion: reduce) {
  .lightbox[open],
  .lightbox__window { animation: none; }
}

/* Title bar: lights on the left, the address field taking all the rest */
.lightbox__bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: .75rem;
  padding: .6rem .9rem;
  background: var(--bg-sunk);
  border-bottom: 1px solid var(--rule);
}

.lightbox__lights { display: flex; gap: 8px; }
/* Pixel sizes on purpose: in rem the light came to 12.8px and the glyph to
   8px, and the fractional 2.4px margin rounded unevenly, so the glyph sat
   off centre. 16 and 10 leave a whole 3px on every side. They were tried at
   the address field's full height and looked wrong: too heavy for the bar. */
.lightbox__light {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 16px;
  height: 16px;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
  line-height: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  /* The glyphs are dark on all three lights, as on the real thing */
  color: rgba(0, 0, 0, .55);
  transition: filter .15s;
}
/* Darkened with a filter rather than three hover colours: it keeps each
   light's own hue without a second set of tokens to keep in step. */
.lightbox__light:hover,
.lightbox__light:focus-visible { filter: brightness(.82); }
.lightbox__light--close { background: var(--mac-close); }
.lightbox__light--min   { background: var(--mac-min); }
.lightbox__light--max   { background: var(--mac-max); }
.lightbox__light svg { display: block; flex: none; width: 10px; height: 10px; opacity: 0; transition: opacity .15s; }
/* macOS shows every glyph as soon as any one light is under the pointer */
.lightbox__lights:hover svg,
.lightbox__lights:focus-within svg { opacity: 1; }
.lightbox__light:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.lightbox__url {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--lb-field);
  min-width: 0;
  margin: 0;
  padding: 0 1rem;
  border-radius: .45rem;
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: .75rem;
  line-height: 1.4;
  white-space: nowrap;
}
/* When the path does not fit, the folder gives way and the file name stays */
.lightbox__dir {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink-faint);
}
.lightbox__file { flex-shrink: 0; color: var(--ink); }

.lightbox__view { min-height: 0; padding: var(--lb-inset); }
.lightbox__view img { display: block; width: 100%; height: auto; border-radius: var(--radius); }

.lightbox__quote {
  margin: 0;
  /* The figcaption's own face and colour, one step up from its .8125rem.
     It follows the image, so it takes the inset's left edge rather than a
     rule of its own. */
  padding: 0 var(--lb-inset) var(--lb-inset);
  font-size: .9375rem;
  line-height: 1.5;
  color: var(--ink-faint);
  text-wrap: pretty;
}
.lightbox__quote::before { content: "\201C"; }
.lightbox__quote::after  { content: "\201D"; }
.lightbox__quote[hidden] { display: none; }

/* Green light: the window takes the whole viewport and the image is fitted
   inside what the bar and the quote leave, rather than the reverse. */
.lightbox[data-full] { padding: 0; }
.lightbox[data-full] .lightbox__window {
  width: 100%;
  height: 100%;
  border-radius: 0;
}
.lightbox[data-full] .lightbox__view img {
  height: 100%;
  object-fit: contain;
}

/* ==========================================================================
   Scroll reveal
   ========================================================================== */

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; }
}

/* ==========================================================================
   Article overlay
   A case study opens as a layer over the home rather than as a page of its
   own, after dmcg.co's About: the home stays put and goes to colour behind a
   blurred veil, and the case scrolls in a layer on top. Built and driven by
   main.js ("Article overlay"); the case pages themselves are unchanged and
   are where its content is fetched from.

   Stacking: above the showcase's edge blurs (50), below the theme toggle (60)
   so the theme can still be switched from inside a case, and below the frame
   (180) and status bar (190), which belong to the window, not to the page.
   The home's own pill and the cursor pill are hidden while it is open; the
   case brings its own pill, inside the layer.

   Nothing on .article itself may carry opacity, a filter or a transform. The
   first would make it a backdrop root and empty the veil's blur (HANDOVER
   §4); the other two would make it the containing block of the case's fixed
   side nav, which would then scroll away with the text.
   ========================================================================== */

.article {
  --article-blur: 110px;
  /* dmcg.co's reveal: filter on the snappy curve, opacity a little quicker
     and plain, transform a little slower. One duration drives all three. */
  --article-in: .52s;
  position: fixed;
  inset: 0;
  z-index: 55;
  visibility: hidden;
  /* Stays visible until the home has come back into focus. */
  transition: visibility 0s linear .9s;
}
html[data-article] .article {
  visibility: visible;
  transition: none;
}
.article:focus { outline: none; }

/* The home goes out of focus rather than under a fade: the blur radius
   itself travels 0 → 110px over .85s, fast at first and settling, and the
   tint comes up alongside it. Timing measured off dmcg.co frame by frame;
   radius and tint pushed past its 81px and 40% for a quieter background.

   The blur is the veil's own backdrop, sized to the viewport — far cheaper
   than a filter on the home's <main>, which is many screens tall. The tint
   is a child, so its opacity never sits on the element doing the blurring
   (that would make it a backdrop root, HANDOVER §4). */
.article__veil {
  position: absolute;
  inset: 0;
  -webkit-backdrop-filter: blur(0px);
  backdrop-filter: blur(0px);
  transition: -webkit-backdrop-filter .85s var(--ease), backdrop-filter .85s var(--ease);
}
html[data-article] .article__veil {
  -webkit-backdrop-filter: blur(var(--article-blur));
  backdrop-filter: blur(var(--article-blur));
}
.article__veil::after {
  content: "";
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--bg) 58%, transparent);
  opacity: 0;
  transition: opacity .85s cubic-bezier(.33, 1, .68, 1);
}
html[data-article] .article__veil::after { opacity: 1; }

.article__scroller {
  position: absolute;
  inset: 0;
  /* The page clips sideways overhang on html/body; this layer is its own
     scroll container, so it has to say so again or a phone can pan it. */
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  .article__scroller { scroll-behavior: auto; }
}

/* The case rises 14px into place out of a 12px blur, a hair small, and
   leaves the same way — on close and when another case replaces it. Kept
   on the content, never on .article: see the note at the head of this
   block. */
.article__content {
  padding-bottom: calc(var(--statusbar-h) + clamp(2rem, 6vw, 4rem));
  opacity: 0;
  filter: blur(12px);
  transform: translateY(14px) scale(.99);
  transform-origin: 50% 0;
  transition:
    opacity calc(var(--article-in) * .81) ease,
    filter var(--article-in) var(--ease),
    transform calc(var(--article-in) * 1.19) var(--ease);
}
/* Ending on the home's footer, the case ends as the home does: the globe's
   fade is the last thing, with only the chin's height under it. */
.article__content:has(> .contact:last-child) { padding-bottom: var(--statusbar-h); }
.article[data-shown] .article__content {
  opacity: 1;
  filter: none;
  transform: none;
}

/* Inside a case every block comes into focus as it scrolls in, not just
   the figures: text out of a 6px blur, figures out of 7px and 1.2% large.
   main.js marks the text blocks when it brings a case in; the case pages on
   their own keep the plain rise of [data-reveal]. */
.article__content [data-reveal] {
  opacity: 0;
  filter: blur(6px);
  transform: none;
  transition:
    opacity calc(var(--article-in) * .81) ease,
    filter var(--article-in) var(--ease);
}
.article__content .figure[data-reveal] {
  filter: blur(7px);
  transform: scale(1.012);
  transition:
    opacity calc(var(--article-in) * .81) ease,
    filter var(--article-in) var(--ease),
    transform calc(var(--article-in) * 1.19) var(--ease);
}
.article__content [data-reveal].is-visible {
  opacity: 1;
  filter: none;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .article__content [data-reveal] { opacity: 1; filter: none; transform: none; }
}

/* A chapter reached from the pill stops clear of the frame's top edge. */
.article__content [id] { scroll-margin-top: calc(var(--frame-w) + 1.5rem); }

/* The work column's top edge, reused: always on here, where there is no
   section to clip it to. Under the close (2) and the case's pill. */
.article__edge { --edge-o: 1; z-index: 1; }

/* The case's own pill fades with its text. */
.article .sidenav { transition: opacity .42s ease; }
.article:not([data-shown]) .sidenav { opacity: 0; }

/* The close: the theme toggle's box (same size, border, squircle and frosted
   fill — see the toggle's rule), mirrored into the window's top-left corner
   and fixed there while the case scrolls. It is first in the scroller, so
   it is still the first stop for Tab. Over the top-edge blur (1), so it
   stays sharp while the text softens under it, and it arrives out of a 6px
   blur with the case. */
.article__close {
  position: fixed;
  z-index: 2;
  top: calc(var(--frame-w) + clamp(.75rem, 2vw, 1.75rem));
  left: calc(var(--frame-w) + clamp(.75rem, 2vw, 1.75rem));
  opacity: 0;
  filter: blur(6px);
  transition:
    opacity calc(var(--article-in) * .81) ease,
    filter var(--article-in) var(--ease),
    color .25s var(--ease-soft),
    border-color .25s var(--ease-soft);
}
.article[data-shown] .article__close { opacity: 1; filter: none; }

/* The home underneath: held still, and its own pills put away. */
html[data-article] { overflow: hidden; }
html[data-article] body > .sidenav,
html[data-article] [data-showcase-pill] {
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s var(--ease-soft), visibility 0s linear .3s;
}

/* ==========================================================================
   Page transition
   A solid curtain that travels top-to-bottom. Leaving a page it drops in from
   above to cover; arriving it continues down and off the bottom, so the wipe
   reads as one continuous movement across the navigation.

   Default state is parked *below* the viewport, so a visitor without JS — who
   will never get the animation that clears it — is never left staring at a
   solid colour. html[data-js] is set synchronously in <head>, before first
   paint, which is what lets the covering state exist without a flash.
   ========================================================================== */

.curtain {
  position: fixed;
  inset: 0;
  /* Above everything, including the side nav and theme toggle at 60 */
  z-index: 200;
  background: var(--curtain);
  pointer-events: none;
  transform: translateY(100%);
  will-change: transform;
}

html[data-js] .curtain { transform: translateY(0); }

/* --- The page fades up as the curtain clears ------------------------------
   Everything except the curtain itself. The hero keeps its own staggered
   reveal on top of this; the two compose rather than compete. */

main,
.sidenav,
.theme-toggle {
  transition: opacity .7s var(--ease-soft) .12s;
}

html[data-js]:not([data-loaded]) main,
html[data-js]:not([data-loaded]) .sidenav,
html[data-js]:not([data-loaded]) .theme-toggle {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .curtain { display: none; }
}