/* =========================================================
   Billie: portfolio home
   Plain CSS. Colours are registered with @property so the
   theme switch can interpolate them rather than snap.
   ========================================================= */

@property --bg      { syntax: '<color>'; inherits: true; initial-value: #E8E6E1; }
@property --fg      { syntax: '<color>'; inherits: true; initial-value: #121212; }
@property --pill    { syntax: '<color>'; inherits: true; initial-value: #121212; }
@property --pill-fg { syntax: '<color>'; inherits: true; initial-value: #E8E6E1; }
@property --glass   { syntax: '<color>'; inherits: true; initial-value: rgba(18,18,18,.22); }
@property --glass-hi{ syntax: '<color>'; inherits: true; initial-value: rgba(18,18,18,.32); }
@property --line    { syntax: '<color>'; inherits: true; initial-value: rgba(18,18,18,.077); }
@property --rule    { syntax: '<color>'; inherits: true; initial-value: rgba(18,18,18,.16); }
@property --dot     { syntax: '<color>'; inherits: true; initial-value: #F06E32; }
@property --menu-bg { syntax: '<color>'; inherits: true; initial-value: rgba(190,188,184,.42); }
@property --page-bg { syntax: '<color>'; inherits: true; initial-value: #121212; }
@property --menu-muted { syntax: '<color>'; inherits: true; initial-value: rgba(18,18,18,.4); }

:root {
  /* Brand */
  --black:     #121212;
  --plum-dark: #3F1126;
  --off-white: #E8E6E1;
  --plum:      #6F1B42;
  --pink:      #F45CA3;

  /* Type */
  /* Tenez via the Adobe Fonts kit (Light 300, Regular 400 + Italic 400).
     Until it is added to the kit, the fallback shows. */
  --display: "tenez", "Iowan Old Style", Georgia, serif;
  /* Inter: not in the Typekit kit yet. Add it there and these names will pick it up. */
  --text: "inter-variable", "inter", "Inter", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

  /* Easing: nothing linear */
  --ease-out:    cubic-bezier(.16, 1, .3, 1);      /* expo.out */
  --ease-out-3:  cubic-bezier(.215, .61, .355, 1); /* power3.out */
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);     /* sine-ish in-out, slightly firmer */
  --ease-expo-io:cubic-bezier(.87, 0, .13, 1);     /* expo.inOut */

  /* Chrome geometry, measured from the 2000px frames at 1440 */
  --edge-x: clamp(18px, 3.125vw, 64px);
  --edge-top: clamp(16px, 1.8vw, 40px);
  --edge-bottom: clamp(18px, 3vw, 56px);
  --chrome-type: clamp(15px, 1.25vw, 22px);
  --ui-type: clamp(11px, .9vw, 15px);

  --theme-dur: 1.1s;

  transition:
    --bg var(--theme-dur) var(--ease-in-out),
    --fg var(--theme-dur) var(--ease-in-out),
    --pill .7s var(--ease-in-out),
    --pill-fg .7s var(--ease-in-out),
    --glass var(--theme-dur) var(--ease-in-out),
    --glass-hi var(--theme-dur) var(--ease-in-out),
    --line var(--theme-dur) var(--ease-in-out),
    --rule var(--theme-dur) var(--ease-in-out),
    --dot .7s var(--ease-in-out),
    --menu-bg var(--theme-dur) var(--ease-in-out),
    --menu-muted var(--theme-dur) var(--ease-in-out),
    --page-bg var(--theme-dur) var(--ease-in-out);
}

html[data-theme="mono"] {
  --bg: #E8E6E1;
  --fg: #121212;
  --pill: #121212;
  --pill-fg: #E8E6E1;
  --glass: rgba(18,18,18,.22);
  --glass-hi: rgba(18,18,18,.32);
  --line: rgba(18,18,18,.07);           /* grid: 30% lighter than .10 */
  --rule: rgba(18,18,18,.16);
  --dot: #F06E32;
  --menu-bg: rgba(190,188,184,.42);
  --menu-muted: rgba(18,18,18,.4);
}
html[data-theme="funky"] {
  --bg: #6F1B42;
  --fg: #E8E6E1;
  --pill: #F45CA3;
  --pill-fg: #FFFFFF;
  --glass: rgba(244,92,163,.34);
  --glass-hi: rgba(244,92,163,.5);
  --line: rgba(244,92,163,.14);         /* grid: 30% lighter than .2 */
  --rule: rgba(232,230,225,.2);
  --dot: #F45CA3;
  --menu-bg: rgba(150,40,96,.42);
  --menu-muted: rgba(232,230,225,.45);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
html.is-loading:not(.is-booted) body { background: var(--black); }
html.is-loading .card.is-hero { opacity: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: inherit; }
img { display: block; max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Custom cursor on fine pointers only */
@media (pointer: fine) {
  html.has-cursor, html.has-cursor * { cursor: none !important; }
  html.has-cursor a[href], html.has-cursor a[href] *,
  html.has-cursor button:not([disabled]), html.has-cursor button:not([disabled]) * { cursor: pointer !important; }
  html.has-cursor.cursor-grab .viewport,
  html.has-cursor.cursor-grab .viewport * { cursor: grab !important; }
  html.has-cursor.is-dragging, html.has-cursor.is-dragging * { cursor: grabbing !important; }
}
html.cursor-grab .cursor, html.is-dragging .cursor, html.is-dragging .cursor-label { opacity: 0; }
.viewport { touch-action: none; }
html.scroll-mode .viewport { touch-action: auto; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--pill); outline-offset: 3px; }

/* =========================================================
   CANVAS
   ========================================================= */
.viewport {
  position: fixed;
  inset: 0;
  overflow: hidden;
}
.pan {
  position: absolute;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  will-change: transform;
  transform: translate3d(0,0,0);
}
.inner {
  position: absolute;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  transform-origin: 50% 50%;
  transform: scale(2.7);
}

/* Grid: a viewport-sized layer, oversized by the largest cell, that
   wraps by one cell as the canvas pans. Same lines, same scale as the
   canvas, but rasterised once and moved with transform only.
   Its scale trails the card zoom (2.2s vs 1.2s), as on Lusano. */
.grid {
  position: absolute;
  left: calc(var(--C-max, 81px) * -1);
  top: calc(var(--C-max, 81px) * -1);
  width: calc(100vw + var(--C-max, 81px) * 2);
  height: calc(100vh + var(--C-max, 81px) * 2);
  will-change: transform;
  --C: 24.3px;
  --lw: 1.2px;
  background-image:
    linear-gradient(to right, var(--line) var(--lw), transparent var(--lw)),
    linear-gradient(to bottom, var(--line) var(--lw), transparent var(--lw));
  background-size: var(--C) var(--C);
  pointer-events: none;
}
html.scroll-mode .grid { position: fixed; }

/* ---------- Cards ---------- */
.card {
  position: absolute;
  display: block;
  z-index: 1;
  -webkit-user-drag: none;
  user-select: none;
  /* left/top/width set inline from projects.js */
}
.card__media {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  clip-path: var(--clip-flat);
  transition: clip-path 1s var(--ease-out), transform .9s var(--ease-out);
  background: rgba(18,18,18,.06);
}
.card.is-hover .card__media,
.card:focus-visible .card__media { transform: scale(1.04); }
.card__media img {
  -webkit-user-drag: none;
  pointer-events: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0);
  transform: scale(1.001);
  opacity: 0;
  transition:
    filter .7s var(--ease-out-3),
    transform 1.1s var(--ease-out),
    opacity .8s var(--ease-out-3);
}
.card__media img.is-loaded { opacity: 1; }

/* Monochrome: full colour, black and white on hover */
html[data-theme="mono"] .card.is-hover .card__media img,
html[data-theme="mono"] .card:focus-visible .card__media img { filter: grayscale(1); }

/* Funky: colour, bowed mask that straightens on hover */
html[data-theme="funky"] .card__media { clip-path: var(--clip-bow); background: transparent; }
html[data-theme="funky"] .card.is-hover .card__media,
html[data-theme="funky"] .card:focus-visible .card__media { clip-path: var(--clip-flat); }

.card:focus-visible { outline: none; }
/* Keyboard focus on an image link (canvas cards, projects-page images): a
   dark ring with a light one inside it, so one of them stands out against any
   photo in either theme (WCAG 2.4.11, 3:1+). Drawn on a layer above the image:
   a ring on the image itself is clipped by its clip-path or covered by it. */
.card:focus-visible, .pp-fig:focus-visible { outline: none; }
.card::after, .pp-fig::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  box-shadow: inset 0 0 0 var(--ring, 1px) #121212, inset 0 0 0 calc(var(--ring, 1px) * 2) #E8E6E1;
  opacity: 0;
}
.card:focus-visible::after, .pp-fig:focus-visible::after { opacity: 1; }
.pp-fig { --ring: 2px; }   /* cards are drawn at 1.5-4.5x (the canvas zoom), so 1px there already reads as 2-5px */

/* ---------- Faces ---------- */
.face {
  position: absolute;
  z-index: 2;
  pointer-events: none;
}
.face img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
  transition: opacity .45s var(--ease-in-out);
}
.face__funky { opacity: 0; }
html[data-theme="funky"] .face__plain { opacity: 0; }
html[data-theme="funky"] .face__funky { opacity: 1; }

/* ---------- Theme switch ripple ----------
   During a switch, every canvas element gets --d (seconds), its
   distance from the toggle, so the change spreads outward. */
html.is-switching .card__media img { transition-duration: 1s, 1.1s, .8s; transition-delay: var(--d, 0s), 0s, 0s; }
html.is-switching .card__media     { transition-duration: 1.25s; transition-delay: calc(var(--d, 0s) + .08s); }
html.is-switching .face img        { transition-delay: calc(var(--d, 0s) + .12s); }
html.is-switching .face.is-pop     { animation: face-pop .8s var(--d, 0s) both; }
@keyframes face-pop {
  0%   { transform: scale(1); animation-timing-function: cubic-bezier(.3,0,.7,.4); }
  35%  { transform: scale(.82) rotate(-4deg); animation-timing-function: cubic-bezier(.2,1.4,.4,1); }
  100% { transform: scale(1) rotate(0); }
}

/* =========================================================
   CHROME
   ========================================================= */
.chrome { position: fixed; left: 0; right: 0; z-index: 20; pointer-events: none; }
.chrome > * { pointer-events: auto; }
/* Only the visible part of the menu reacts: the closed panel is clipped to
   its bar (clip-path clips hit-testing too), so hovering the empty space
   where the list would be doesn't open it. */
.chrome > .menu { pointer-events: none; }
.menu__panel { pointer-events: auto; }
.chrome--top { top: var(--edge-top); height: 0; }
.chrome--bottom { bottom: var(--edge-bottom); height: 0; }

/* Pills */
.pill {
  position: absolute;
  display: inline-flex;
  align-items: center;
  height: 1.5em;
  padding: 0 .55em;
  border-radius: 99px;
  background: var(--pill);
  color: var(--pill-fg);
  font-family: var(--text);
  font-style: normal;
  font-weight: 400;
  font-size: var(--chrome-type);
  line-height: 1;
  text-transform: uppercase;
  transition: transform .6s var(--ease-out);
}
.chrome__left {
  position: absolute;
  left: var(--edge-x);
  top: calc(var(--edge-top) * .55);
  display: flex;
  align-items: center;
  gap: .5em;
  height: 1.5em;
  font-size: var(--chrome-type);
  pointer-events: none;
}
.chrome__left > * { pointer-events: auto; }
.chrome__left .pill--name { position: relative; }
/* Slot for the project-page close control (being designed). Empty until then. */
.close-slot { display: none; align-items: center; height: 100%; }
html.is-project .close-slot { display: flex; }
.pill--name:active { transform: scale(.96); transition-duration: .15s; }

/* Per-character stagger (pill buttons).
   Each character carries a copy of itself one line below (text-shadow);
   on hover every character slides up one line, delayed by its index. */
.chars {
  --ch: 1.25em;
  display: inline-flex;
  height: var(--ch);
  line-height: var(--ch);
  overflow: hidden;
  vertical-align: middle;
}
.chars > span {
  display: inline-block;
  text-shadow: 0 var(--ch) currentColor;
  transition: transform .62s cubic-bezier(.625, .05, 0, 1);
  will-change: transform;
}
.pill:hover .chars > span,
.pill:focus-visible .chars > span,
.menu__item:hover .chars > span,
.menu__item:focus-visible .chars > span,
.duo__item:hover .chars > span,
.duo__item:focus-visible .chars > span,
.duo:focus-visible .duo__item .chars > span {
  transform: translateY(calc(var(--ch) * -1));
}

/* ---------- Shared material: menu panel + zoom controls ----------
   Translucent, blurred just enough that the grid still reads through. */
.menu__panel,
.zoom {
  background: var(--menu-bg);
  -webkit-backdrop-filter: blur(var(--material-blur)) saturate(1.1);
  backdrop-filter: blur(var(--material-blur)) saturate(1.1);
}
:root { --material-blur: 7px; --ui-radius: 6px; }   /* slight rounding: menu + zoom controls */

/* ---------- Menu ---------- */
.menu {
  position: absolute;
  left: 50%;
  --menu-type: clamp(13px, 1.06vw, 19px);
  /* Bar centred on the same line as the pill and the clock */
  top: calc(var(--edge-top) * .55 + .75 * var(--chrome-type) - 1.15 * var(--menu-type));
  width: clamp(176px, 13.6vw, 270px);
  margin-left: calc(clamp(176px, 13.6vw, 270px) / -2);
  font-family: var(--display);
  font-size: var(--menu-type);
  color: var(--fg);
}
.menu__panel {
  --bar-h: 2.3em;
  position: relative;
  /* Closed: clip to the bar. Open: reveal the whole panel. */
  clip-path: inset(0 0 calc(100% - var(--bar-h)) 0 round var(--ui-radius));
  border-radius: var(--ui-radius);
  transition: clip-path .7s var(--ease-expo-io);
}
.menu.is-open .menu__panel { clip-path: inset(0 0 0 0 round var(--ui-radius)); transition-duration: .9s; }

.menu__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: var(--bar-h);
  padding: 0 .85em;
  transition: background-color .4s var(--ease-out-3);
}

.burger { position: relative; width: 16px; height: 11px; display: block; }
.burger i {
  position: absolute; left: 0; right: 0; height: 1px;
  background: currentColor;
  transition: transform .7s var(--ease-expo-io), opacity .35s var(--ease-out-3);
}
.burger i:nth-child(1) { top: 0; }
.burger i:nth-child(2) { top: 5px; }
.burger i:nth-child(3) { top: 10px; }
.menu__bar:hover .burger i:nth-child(2) { transform: scaleX(.6); transform-origin: left; }
.menu.is-open .burger i:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.menu.is-open .burger i:nth-child(2) { transform: scaleX(0); opacity: 0; }
.menu.is-open .burger i:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* Tenez in the menu: regular italic, lowercase. Numbers stay upright. */
.menu__current,
.menu__label { font-style: italic; font-weight: 400; text-transform: lowercase; }

/* Bar label: current page when closed, "menu" when open. */
.menu__current { display: grid; height: 1.25em; line-height: 1.25em; overflow: hidden; text-align: right; }
.menu__current > span { grid-area: 1 / 1; transition: transform .6s var(--ease-expo-io); }
.menu__current-menu { transform: translateY(100%); }
.menu.is-open .menu__current-page { transform: translateY(-100%); }
.menu.is-open .menu__current-menu { transform: none; }

.menu__list { list-style: none; margin: 0; padding: 0; }
.menu__list li { border-top: 1px solid var(--rule); }
.menu__list li:last-child { border-bottom: 1px solid var(--rule); }
.menu__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 2em;
  padding: 0 .65em;
  position: relative;
  overflow: hidden;
  color: var(--fg);
}
.menu__item::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--glass);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform .5s var(--ease-out);
}
.menu__item > span { position: relative; }
.menu__num { font-style: normal; font-variant-numeric: tabular-nums; }
/* Current page: lighter grey; the rest full strength. */
.menu__item.is-current { color: var(--menu-muted); }

.menu__social {
  display: flex;
  justify-content: center;
  padding: 3.4em .6em .6em;
  font-size: clamp(9px, .72vw, 12px);
}


/* Menu content stagger (opacity/transform only) */
.menu__list li, .menu__social {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .35s var(--ease-out-3), transform .5s var(--ease-out);
}
.menu.is-open .menu__list li, .menu.is-open .menu__social {
  opacity: 1;
  transform: none;
  transition: opacity .6s var(--ease-out-3), transform .8s var(--ease-out);
}
.menu.is-open .menu__list li:nth-child(1) { transition-delay: .12s; }
.menu.is-open .menu__list li:nth-child(2) { transition-delay: .17s; }
.menu.is-open .menu__list li:nth-child(3) { transition-delay: .22s; }
.menu.is-open .menu__list li:nth-child(4) { transition-delay: .27s; }
.menu.is-open .menu__list li:nth-child(5) { transition-delay: .32s; }
.menu.is-open .menu__social { transition-delay: .41s; }

/* ---------- Clock ---------- */
.clock {
  position: absolute;
  right: var(--edge-x);
  top: calc(var(--edge-top) * .55);
  height: 1.5em;
  display: flex;
  align-items: center;
  gap: .3em;
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: var(--chrome-type);
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- Zoom % ---------- */
.zoom-pct {
  position: absolute;
  left: var(--edge-x);
  bottom: 0;
  font-family: var(--display);
  font-size: var(--chrome-type);
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

/* ---------- Bottom controls ---------- */
.controls {
  --zoom-w: 6.1em;
  --gap: 1.3em;
  position: absolute;
  left: 50%;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: var(--gap);
  font-size: var(--ui-type);
  /* Centre the visible group (zoom + current pill width), not the max box */
  flex-direction: column;
  gap: 1.05em;
  transform: translateX(-50%);
}
.zoom {
  display: flex;
  width: var(--zoom-w);
  height: 2.75em;
  border-radius: var(--ui-radius);
  overflow: hidden;
}
.zoom__btn {
  flex: 1;
  display: grid;
  place-items: center;
  color: var(--fg);
  position: relative;
  transition: background-color .35s var(--ease-out-3), opacity .35s var(--ease-out-3);
}
.zoom__btn svg {
  width: 1.15em; height: 1.15em;
  stroke: currentColor; stroke-width: 1.05; fill: none;
  transition: transform .5s var(--ease-out);
}
.zoom__btn:hover { background: var(--glass); }
.zoom__btn:hover svg { transform: scale(1.18); }
#zoomIn:hover svg { transform: scale(1.18) rotate(90deg); }
.zoom__btn:active svg { transform: scale(.85); transition-duration: .12s; }
.zoom__btn[disabled] { opacity: .3; pointer-events: none; }



/* =========================================================
   CURSOR + LABEL
   ========================================================= */
.cursor, .cursor-label {
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  pointer-events: none;
  will-change: transform;
}
.cursor { display: none; }
.cursor-label { display: none; }
html.has-cursor .cursor, html.has-cursor .cursor-label { display: block; }

.cursor__arrow {
  display: block;
  transform-origin: 2px 2px;
  transition: transform .45s var(--ease-out), opacity .3s var(--ease-out-3);
  overflow: visible;
}
.cursor__arrow path { fill: #fff; stroke: var(--black); stroke-width: .9; stroke-linejoin: round; }
.cursor.is-ui .cursor__arrow { opacity: 0; transform: scale(.6); }
.cursor.is-down .cursor__arrow { transform: scale(.7); transition-duration: .12s; }
.cursor.is-hidden .cursor__arrow { opacity: 0; transform: scale(.4); }

.cursor-label__duo {
  font-size: clamp(8.5px, .64vw, 11px);
  opacity: 0;
  transform: translateY(-6px) scale(.9);
  transform-origin: 0 0;
  transition: opacity .35s var(--ease-out-3), transform .6s var(--ease-out);
}
.cursor-label.is-visible .cursor-label__duo { opacity: 1; transform: none; }

/* =========================================================
   PRELOADER
   Structure follows Lusano's: fixed shell, a bg panel (z1) and the
   loading text (z2). Only the bg panel moves: transform + clip-path.
   ========================================================= */
.preloader {
  position: fixed;
  inset: 0;
  height: 100svh;
  z-index: 109;
  pointer-events: none;
}
html:not(.is-loading) .preloader { display: none; }
html.is-repeat .preloader { display: none; }   /* intro already seen in this tab */
.preloader__bg {
  position: absolute;
  left: 0; top: 0;
  width: 100vw; height: 100svh;
  z-index: 1;
  background: var(--black);
  transform-origin: 0 0;
  will-change: transform, clip-path;
}
.preloader__inner {
  position: absolute;
  inset: 0;
  z-index: 2;
  color: var(--off-white);
}
.preloader__top {
  position: absolute;
  left: var(--edge-x);
  right: var(--edge-x);
  top: 11.5vh;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  font-family: var(--text);
  font-size: var(--ui-type);
  text-transform: uppercase;
  letter-spacing: .01em;
}
.preloader__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 300;
  font-size: min(3.15vw, 5vh);
  line-height: 1;
  letter-spacing: -.005em;
}
.preloader__right { justify-self: end; font-variant-numeric: tabular-nums; }
.preloader__figure {
  position: absolute;
  left: 50%;
  top: 29.3vh;
  height: 42.5vh;
  translate: -50% 0;
}
.preloader__figure img { display: block; height: 100%; width: auto; opacity: 0; transition: opacity .6s var(--ease-out-3); }
.preloader__figure img.is-in { opacity: 1; }
/* Progress: the fill scales across the track (transform only). */
.preloader__bar {
  position: absolute;
  left: 50%;
  bottom: calc(var(--edge-bottom) + 4px);
  width: min(21.5vw, 360px);
  height: 3px;
  translate: -50% 0;
  background: rgba(232,230,225,.28);
  overflow: hidden;
}
.preloader__bar i {
  position: absolute;
  inset: 0;
  background: var(--off-white);
  transform: scaleX(0);
  transform-origin: left;
}
@media (max-width: 700px) {
  .preloader__top { grid-template-columns: 1fr 1fr; row-gap: 5vh; }
  .preloader__title { grid-column: 1 / -1; grid-row: 2; justify-self: center; font-size: 7.4vw; }
  .preloader__figure { top: auto; bottom: calc(var(--edge-bottom) + 9vh); height: 52vh; }
  .preloader__bar { width: 46vw; }
}

/* Hero photo arriving inside the landed block */
.card.is-revealing .card__media { background: var(--black); }
.card.is-revealing .card__media img { animation: blur-in 1.1s var(--ease-out) both; }
@keyframes blur-in {
  0%   { opacity: 0; filter: blur(2.5rem); }
  35%  { opacity: 1; }
  100% { opacity: 1; filter: blur(0); }
}

/* Before JS boots: keep everything that intro animates hidden. */
html.is-loading [data-intro] { opacity: 0; }
html.is-loading .card, html.is-loading .face { opacity: 0; }
html.is-loading .grid { opacity: 0; }

/* =========================================================
   SCROLL MODE (reduced motion or touch): native scrolling
   instead of pointer drift. Still the same canvas.
   ========================================================= */
html.scroll-mode .viewport { overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
html.scroll-mode .pan { will-change: auto; transform: none; overflow: hidden; }
html.scroll-mode .inner { transform-origin: 0 0; }

@media (prefers-reduced-motion: reduce) {
  :root { --theme-dur: .25s; }
  .card__media, .card__media img, .face img, .menu__panel,
  .menu__list li, .menu__social, .controls,
  .chars > span, .burger i, .cursor-label__duo, .duo__item {
    transition-duration: .2s !important;
    transition-delay: 0s !important;
  }
  .face.is-pop { animation: none !important; }
  .card.is-hover .card__media img, .card.is-hover .card__media { transform: none; }
}

@media (max-width: 640px) {
  .menu { width: 38vw; margin-left: -19vw; }   /* clears the pill on a 375px phone */
  .clock__city { display: none; }
}

/* =========================================================
   PROJECT PAGE
   Dark in both themes (an inversion of home). The section is
   the panel that swipes up; it sits above the chrome while it
   moves and drops below it once the page is in.
   ========================================================= */
html[data-theme="mono"]  { --page-bg: #121212; }
:root { --project-top: calc(var(--edge-top) * .55 + 2.3 * var(--chrome-type) + clamp(18px, 4.5vh, 56px)); }
html[data-theme="funky"] { --page-bg: var(--plum-dark); }

/* Chrome on a project page: off-white text, inverted pills. The clock
   dot keeps its theme colour (orange / pink). */
html.is-project[data-theme] {
  --fg: #E8E6E1;
  --pill: #E8E6E1;
  --pill-fg: #121212;
  --glass: rgba(232,230,225,.14);
  --glass-hi: rgba(232,230,225,.22);
  --rule: rgba(232,230,225,.24);
  /* Dark glass, tinted with the page colour (black / plum), so the
     off-white text holds up over light imagery scrolling beneath. */
  --menu-bg: color-mix(in srgb, var(--page-bg) 62%, transparent);
  --menu-muted: rgba(232,230,225,.45);
}

/* Flip chrome colours in one frame while it's hidden under the panel. */
html.is-instant, html.is-instant *, html.is-instant *::before, html.is-instant *::after { transition: none !important; }

/* No bottom controls on project pages (zoom and theme toggle live on home;
   the theme still carries across). visibility also takes them out of the tab order. */
html.is-project .controls,
html.is-project .zoom-pct { visibility: hidden; pointer-events: none; }

.project {
  position: fixed;
  inset: 0;
  z-index: 15;
  background: var(--page-bg);
  color: #E8E6E1;
  visibility: hidden;
  will-change: transform;
  --line-c: rgba(232,230,225,.0525);
}
.project.is-open,
html.is-project-cold .project { visibility: visible; }
.project.is-covering { z-index: 30; }
html.is-project-cold .preloader { display: none; }

/* Grid lines: individual 1px bars that extend from their origin. */
.project__grid { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.project__grid i { position: absolute; display: block; background: var(--line-c); will-change: transform; }
.project__grid .v { top: 0; bottom: 0; width: 1px; transform-origin: 50% 0; }
.project__grid .h { left: 0; right: 0; height: 1px; transform-origin: 0 50%; }

.project__scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.project__scroll::-webkit-scrollbar { display: none; }

/* Text column on the left; images run to the right site margin. */
.project__layout {
  display: grid;
  grid-template-columns: 36vw 1fr;
  column-gap: 4.5vw;
  padding: 0 var(--edge-x);
}

/* ---------- Left column (sticky) ---------- */
.project__side {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: flex;
  flex-direction: column;
  padding: var(--project-top) 0 min(1.45vw, 2.4vh);
}
.project__title {
  margin: 0 0 min(1.25vw, 2.2vh);
  font-family: var(--display);
  font-style: normal;
  font-weight: 300;
  text-transform: uppercase;
  font-size: min(4.6vw, 8.6vh);
  line-height: 1;
  letter-spacing: 0;
  outline: none;
}
.project__intro {
  margin: 0 0 min(2.4vw, 3.6vh);
  font-family: var(--text);
  font-size: clamp(12px, .9vw, 15px);
  line-height: 1.5;
  color: rgba(232,230,225,.84);
}
.project__details { margin: 0; font-family: var(--text); font-size: 14px; }
.project__details > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1em;
  height: min(2.53vw, 4.4vh);
  min-height: 28px;
  border-top: 1px solid #E8E6E1;
}
.project__details dt { text-transform: uppercase; letter-spacing: .01em; }
.project__details dd { margin: 0; text-align: right; }

.project__site {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: .5em;
  margin-top: min(2.2vw, 3.4vh);
  font-size: clamp(9px, .76vw, 13px);
}
.project__site[hidden] { display: none; }
.project__arrow {
  width: .85em; height: .85em; flex: none;
  stroke: currentColor; stroke-width: 1.3; fill: none; stroke-linecap: square;
  transition: transform .6s var(--ease-out);
}
.project__next-link:hover .project__arrow { transform: translate(.12em, -.12em); }
.project__head { display: flex; flex-direction: column; padding-bottom: min(2vw, 2.4vh); }

.project__thumb {
  display: block;
  align-self: flex-start;
  margin-top: auto;
  flex: 0 1 8.9vw;
  min-height: 0;
  overflow: hidden;
  background: rgba(232,230,225,.05);
}
.project__thumb img { display: block; height: 100%; width: auto; aspect-ratio: 220 / 128; object-fit: cover; transition: transform 1.1s var(--ease-out); }
.project__thumb:hover img { transform: scale(1.04); }

.project__next {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex: none;
  margin-top: min(2.2vw, 3vh);
  padding-top: min(.9vw, 1.4vh);
  border-top: 1px solid #E8E6E1;
}
.project__next-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .35em;
  padding-bottom: 2px;
  font-family: var(--text);
  font-size: clamp(9px, .76vw, 13px);
  text-transform: uppercase;
  letter-spacing: .01em;
}
.project__next-link::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: currentColor;
  transform-origin: left;
  transition: transform .6s var(--ease-expo-io);
}
.project__next-link:hover::after { transform: scaleX(.0001); transform-origin: right; }
.project__next-name { font-family: var(--display); font-weight: 300; text-transform: uppercase; font-size: clamp(13px, 1.08vw, 19px); }

/* Character stagger on the project links too */
.project__site:hover .chars > span,
.project__site:focus-visible .chars > span,
.project__next-link:hover .chars > span,
.project__next-link:focus-visible .chars > span { transform: translateY(calc(var(--ch) * -1)); }

/* ---------- Right column (scrolls) ---------- */
.project__media {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6vw;
  padding: var(--project-top) 0 10vw;
}
.project__row {
  display: flex;
  gap: 1.6vw;
  width: 100%;
}
.project__row > .project__figure { flex: var(--ar) 1 0%; min-width: 0; }
.project__row.is-half > .project__figure { flex: 0 0 calc(50% - .8vw); }
.project__figure {
  margin: 0;
  width: 100%;
  overflow: hidden;
  background: rgba(232,230,225,.04);
}
.project__figure img,
.project__figure video {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .9s var(--ease-out-3);
}
.project__figure img.is-loaded,
.project__figure video.is-loaded { opacity: 1; }
/* Videos: the poster fades in like an image; the film then plays over it. */
.project__figure--video { position: relative; }
.project__figure.is-postered video { opacity: 1; }
/* Pause / play: always visible (not hover-only), so it works by touch and keyboard. */
.project__vidctl {
  position: absolute;
  left: 12px; bottom: 12px;
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  padding: 0;
  border: 0;
  border-radius: 99px;
  background: var(--pill);
  color: var(--pill-fg);
  cursor: pointer;
  transition: transform .6s var(--ease-out);
}
.project__vidctl svg { width: 14px; height: 14px; fill: currentColor; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.project__vidctl:active { transform: scale(.94); transition-duration: .15s; }
.project__vidctl:focus-visible { outline: 2px solid var(--pill); outline-offset: 3px; }

@media (max-width: 860px) {
  .project__layout { grid-template-columns: 1fr; padding: 0 var(--edge-x); }
  /* Single column: head, images, then next project at the end of the page. */
  .project__side { display: contents; }
  .project__head { order: 1; padding-top: var(--project-top); }
  .project__media { order: 2; }
  .project__title { font-size: 12vw; margin-bottom: 4vw; }
  .project__row { display: contents; }
  .project__row > .project__figure, .project__row.is-half > .project__figure { flex: none; }
  .project__figure { width: 100%; }
  .project__intro { margin-bottom: 6vw; }
  .project__details > div { height: auto; padding: 10px 0; }
  .project__site { margin-top: 6vw; }
  .project__thumb { display: none; }
  .project__next { order: 3; margin: 0 0 22vw; padding-top: 3vw; }
  .project__media { gap: 6vw; padding: 10vw 0 12vw; }
}

@media (prefers-reduced-motion: reduce) {
  .project__figure img, .project__thumb img, .project__arrow { transition-duration: .2s !important; }
}

/* =========================================================
   PILL PAIR ("duo")
   A squared pill and a round one, side by side: theme choice,
   socials, the project hover label, View site.
   ========================================================= */
.duo {
  display: inline-flex;
  align-items: stretch;
  gap: 0;                            /* the pills touch */
  font-family: var(--text);
  text-transform: uppercase;
  letter-spacing: .01em;
  line-height: 1;
}
.duo__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.5em;
  padding: 0 1em;
  border-radius: .32em;
  background: var(--pill);
  color: var(--pill-fg);
  white-space: nowrap;
  text-transform: uppercase;          /* set on the item: buttons don't inherit it */
  transition: border-radius .7s var(--ease-expo-io), background-color .7s var(--ease-in-out), color .7s var(--ease-in-out);
}
.duo > .duo__item:last-child { border-radius: 99px; }
.duo__icon { width: 2.5em; padding: 0; }
.duo__icon svg {
  width: .95em; height: .95em;
  stroke: currentColor; stroke-width: 1.15; fill: none; stroke-linecap: square;
  transition: transform .6s var(--ease-out);
}
.duo:hover .duo__icon svg, .duo:focus-visible .duo__icon svg { transform: translate(.12em, -.12em); }
.duo:active .duo__item { transform: scale(.97); transition: transform .15s var(--ease-out); }

/* Theme row: label hangs left so the pills centre under the controls. */
.theme-row { position: relative; font-size: clamp(10px, .8vw, 14px); }
.theme-row__label {
  position: absolute;
  right: 100%;
  top: 50%;
  margin-right: .95em;
  transform: translateY(-50%);
  font-family: var(--text);
  text-transform: uppercase;
  letter-spacing: .01em;
  white-space: nowrap;
  color: var(--fg);
}
/* The current theme is the squared pill; the other one is round. */
.theme-links .theme-link[aria-pressed="true"] { border-radius: .32em; cursor: default; }
.theme-links .theme-link[aria-pressed="false"] { border-radius: 99px; }
@media (max-width: 640px) { .theme-row__label { display: none; } }

/* Socials row in the menu: full width, pills centred (overrides the duo's inline-flex). */
.menu__social.duo { display: flex; justify-content: center; }

/* Name / home button: a pill pair like the others, home icon in the circle. */
.pill--name { font-size: clamp(10px, .8vw, 14px); }
/* Mobile: just the house and the initials. */
.pill--name .pill__short { display: none; }
@media (max-width: 700px) {
  .pill--name .pill__long { display: none; }
  .pill--name .pill__short { display: inline-flex; }
}
.pill--name .duo__icon svg { width: 1.3em; height: 1.3em; stroke-width: .7; stroke-linecap: round; stroke-linejoin: round; }
.pill--name:hover .duo__icon svg, .pill--name:focus-visible .duo__icon svg { transform: translateY(-.1em); }

/* =========================================================
   PROJECTS PAGE  (/projects?view=gallery|linear|list)
   Same canvas look as home (light in mono, plum in funky). Swipes up
   over the canvas; project pages swipe up over it.
   Sizes are taken off the frames (1440 wide) and scale with the window.
   ========================================================= */
.pp {
  position: fixed;
  inset: 0;
  z-index: 14;                 /* under a project page opened from it */
  background: var(--bg);
  color: var(--fg);
  visibility: hidden;
  will-change: transform;
  --pp-x: 7.95vw;              /* gallery column inset */
  --pp-rule-x: 3.7vw;          /* list + ruler inset */
  --pp-head: 0px;              /* header height, set from JS */
}
.pp.is-open, html.is-projects-cold .pp { visibility: visible; }
.pp.is-covering { z-index: 30; }
html.is-projects-cold .preloader { display: none; }

/* Home controls that mean nothing here; the theme row stays. */
/* The theme switch lives on home only. visibility also takes it out of the tab order. */
html.is-projects .controls,
html.is-projects .zoom-pct { visibility: hidden; pointer-events: none; }

.pp__grid { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.pp__grid i { position: absolute; display: block; background: var(--line); will-change: transform; }
.pp__grid .v { top: 0; bottom: 0; width: 1px; transform-origin: 50% 0; }
.pp__grid .h { left: 0; right: 0; height: 1px; transform-origin: 0 50%; }

.pp__scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.pp__scroll::-webkit-scrollbar { display: none; }
.pp[data-view="linear"] .pp__scroll { overflow: hidden; }
.pp__content { position: relative; min-height: 100%; }

/* ---------- Header ---------- */
.pp__head {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: calc(var(--edge-top) * .55 + 2.3 * var(--chrome-type) + clamp(10px, 2.2vh, 40px));
}
.pp__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 300;
  font-size: min(7.4vw, 12.5vh);
  line-height: .9;
  text-transform: uppercase;
  letter-spacing: 0;
  outline: none;
}
.pp__views {
  display: flex;
  align-items: center;
  gap: .9em;
  margin-top: min(2.3vw, 3.6vh);
  font-family: var(--text);
  font-size: clamp(10px, .8vw, 14px);
  text-transform: uppercase;
  letter-spacing: .01em;
  line-height: 1;
}
.pp__pills { position: relative; display: flex; }
.pp__pill {
  position: relative;
  height: 2.3em;
  padding: 0 .85em;
  background: var(--pill);
  color: var(--pill-fg);
  text-transform: uppercase;
  transition: opacity .6s var(--ease-out);
}
/* Shapes, left to right: slightly rounded, round, and a mix
   (round top-right and bottom-left, slight top-left and bottom-right). */
.pp__pill:nth-child(1) { border-radius: .32em; }
.pp__pill:nth-child(2) { border-radius: 99px; }
.pp__pill:nth-child(3) { border-radius: .32em 1.15em .32em 1.15em; }
.pp__pill[aria-pressed="true"] { opacity: .45; cursor: default; }
.pp__pill:not([aria-pressed="true"]):hover .chars > span,
.pp__pill:not([aria-pressed="true"]):focus-visible .chars > span { transform: translateY(calc(var(--ch) * -1)); }

/* ---------- Views ---------- */
.pp__stage { position: relative; }
.ppv { display: none; position: relative; }
.ppv.is-active { display: block; z-index: 2; }
/* The way out: holds its place over the stage while the new view arrives. */
.ppv.is-leaving { display: block; position: absolute; left: 0; right: 0; top: 0; z-index: 1; pointer-events: none; }

/* An image: one per (project, image). Keeps its aspect ratio in every view
   except the gallery, which crops 3:4. */
.pp-fig {
  position: relative;
  display: block;
  overflow: hidden;
  background: rgba(18,18,18,.06);
  transition: clip-path 1s var(--ease-out);
  -webkit-user-drag: none;
}
/* Only funky masks the images (the bow); monochrome stays unclipped, which
   keeps travelling images cheap to composite. */
.pp-fig > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1s cubic-bezier(.165,.84,.44,1), transform 1s cubic-bezier(.165,.84,.44,1), filter .7s var(--ease-out-3);
}
.pp-fig > img.is-loaded { opacity: 1; }
.pp-fig.is-hover > img, .pp-fig:focus-visible > img { transform: scale(1.03); }
html[data-theme="mono"] .pp-fig.is-hover > img, html[data-theme="mono"] .pp-fig:focus-visible > img { filter: grayscale(1); }
html[data-theme="funky"] .pp-fig { clip-path: var(--clip-bow); background: transparent; }
html[data-theme="funky"] .pp-fig.is-hover, html[data-theme="funky"] .pp-fig:focus-visible { clip-path: var(--clip-flat); }

.pp-name {
  margin: 0;
  font-family: var(--display);
  font-weight: 300;              /* Tenez Light (in the Adobe Fonts kit) */
  text-transform: uppercase;
  letter-spacing: 0;
  line-height: 1.08;
}

/* ---------- Gallery: editorial grid (after studioplato.co) ----------
   12 columns. Per two rows: large left (6 cols) + small right (3 cols),
   then small left + large right. 3:4 portraits throughout. */
.ppg {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 1.4vw;
  row-gap: 8.4vw;
  align-items: start;
  padding: 5.2vw var(--edge-x) 7vw;
}
.ppg__cell:nth-child(4n+1) { grid-column: 1 / 7; }
.ppg__cell:nth-child(4n+2) { grid-column: 10 / 13; margin-top: 9vw; }
.ppg__cell:nth-child(4n+3) { grid-column: 1 / 4;  margin-top: 9vw; }
.ppg__cell:nth-child(4n+4) { grid-column: 7 / 13; }
.ppg__item { will-change: transform; transition: opacity .7s cubic-bezier(.165,.84,.44,1); }
.ppg .pp-fig { aspect-ratio: 3 / 4; }
/* Hover: the others step back. */
.ppg:has(.pp-fig.is-hover) .ppg__item:not(:has(.pp-fig.is-hover)) { opacity: .14; }
.ppg .pp-name { margin-top: 1.25vw; }
.ppg__cell.is-large .pp-name { font-size: 3vw; }
.ppg__cell.is-small .pp-name { font-size: 1.75vw; }
.ppg__text {
  max-width: 31em;
  margin: .9vw 0 0;
  font-family: var(--text);
  font-size: clamp(12px, .95vw, 17px);
  line-height: 1.45;
  opacity: .8;
}

/* ---------- End of the gallery / list: back to top ---------- */
.pp__end { display: flex; justify-content: center; padding: 0 0 8vw; font-size: clamp(10px, .8vw, 14px); }
.pp[data-view="linear"] .pp__end { display: none; }
.pp__top .duo__icon svg { transition: transform .6s var(--ease-out); }
.pp__top:hover .duo__icon svg, .pp__top:focus-visible .duo__icon svg { transform: translateY(-.14em); }

/* ---------- Bottom edge: progressive blur ----------
   Six stacked backdrop blurs (1px to 32px), each masked to a band, so
   content surfaces from a soft edge. Gallery and list only. */
.pp__blur { position: absolute; left: 0; right: 0; bottom: 0; height: 70px; z-index: 4; pointer-events: none; }
.pp__blur i { position: absolute; inset: 0; }
.pp__blur i:nth-child(1) { backdrop-filter: blur(1px);  -webkit-backdrop-filter: blur(1px);  mask: linear-gradient(to bottom, transparent 0%, #000 12.5%, #000 25%, transparent 37.5%); -webkit-mask: linear-gradient(to bottom, transparent 0%, #000 12.5%, #000 25%, transparent 37.5%); }
.pp__blur i:nth-child(2) { backdrop-filter: blur(2px);  -webkit-backdrop-filter: blur(2px);  mask: linear-gradient(to bottom, transparent 12.5%, #000 25%, #000 37.5%, transparent 50%); -webkit-mask: linear-gradient(to bottom, transparent 12.5%, #000 25%, #000 37.5%, transparent 50%); }
.pp__blur i:nth-child(3) { backdrop-filter: blur(4px);  -webkit-backdrop-filter: blur(4px);  mask: linear-gradient(to bottom, transparent 25%, #000 37.5%, #000 50%, transparent 62.5%); -webkit-mask: linear-gradient(to bottom, transparent 25%, #000 37.5%, #000 50%, transparent 62.5%); }
.pp__blur i:nth-child(4) { backdrop-filter: blur(8px);  -webkit-backdrop-filter: blur(8px);  mask: linear-gradient(to bottom, transparent 37.5%, #000 50%, #000 62.5%, transparent 75%); -webkit-mask: linear-gradient(to bottom, transparent 37.5%, #000 50%, #000 62.5%, transparent 75%); }
.pp__blur i:nth-child(5) { backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); mask: linear-gradient(to bottom, transparent 50%, #000 62.5%, #000 75%, transparent 87.5%); -webkit-mask: linear-gradient(to bottom, transparent 50%, #000 62.5%, #000 75%, transparent 87.5%); }
.pp__blur i:nth-child(6) { backdrop-filter: blur(32px); -webkit-backdrop-filter: blur(32px); mask: linear-gradient(to bottom, transparent 62.5%, #000 75%, #000 100%); -webkit-mask: linear-gradient(to bottom, transparent 62.5%, #000 75%, #000 100%); }
.pp[data-view="linear"] .pp__blur { display: none; }

/* ---------- List: a row per project ---------- */
.ppr-list { padding: min(6.6vw, 9vh) var(--pp-rule-x) 6vw; }
.ppr { position: relative; padding-top: .95vw; margin-bottom: 5.5vw; }
.ppr__rule { position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--fg); opacity: .55; transform-origin: 0 50%; }
.ppr__top { display: flex; align-items: center; justify-content: space-between; gap: 2vw; }
.ppr .pp-name { font-size: 2.4vw; }
.ppr__cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .45em;
  padding-bottom: .3em;
  font-family: var(--text);
  font-size: clamp(11px, .92vw, 17px);
  text-transform: uppercase;
  letter-spacing: .01em;
  line-height: 1;
  white-space: nowrap;
}
.ppr__cta::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1.5px; background: currentColor; transform-origin: 100% 50%; transition: transform .7s var(--ease-out); }
.ppr__cta:hover::after { transform: scaleX(.0001); transform-origin: 100% 50%; animation: pp-underline .9s var(--ease-out) .1s forwards; }
@keyframes pp-underline { from { transform: scaleX(0); transform-origin: 0 50%; } to { transform: scaleX(1); transform-origin: 0 50%; } }
.ppr__cta svg { width: .85em; height: .85em; stroke: currentColor; stroke-width: 1.3; fill: none; stroke-linecap: square; transition: transform .6s var(--ease-out); }
.ppr__cta:hover svg { transform: translate(.12em, -.12em); }
/* Strip: flex-grow = aspect ratio gives every image the same height;
   the first is a size up, bottoms aligned. */
.ppr__strip { display: flex; align-items: flex-end; gap: .8vw; margin-top: 1.5vw; }
.ppr__strip .pp-fig { flex: var(--g) 1 0; min-width: 0; aspect-ratio: var(--ar); }

/* ---------- Linear: an endless timeline ---------- */
.ppv--linear { height: calc(100svh - var(--pp-head)); overflow: visible; touch-action: none; user-select: none; }
.ppl__track { position: absolute; left: 0; top: 0; height: 100%; will-change: transform; }
.ppl__track .pp-fig { position: absolute; left: 0; top: 0; }
/* Ruler: ticks stand on one baseline, heights set from JS (scaleY). */
.ppl__ruler {
  position: absolute;
  left: 0; right: 0;
  bottom: var(--ruler-b, 12vh);
  height: var(--ruler-h, 50px);
  overflow: hidden;
  pointer-events: none;
}
.ppl__ticks { position: absolute; inset: 0; }
.ppl__tick {
  position: absolute;
  left: 0; bottom: 0;
  width: 1px;
  height: var(--tick-h, 12px);
  background: var(--fg);
  opacity: .32;
  transform-origin: 50% 100%;
  will-change: transform;
}
.ppl__tick.is-main { opacity: .6; }
.ppl__head {
  position: absolute;
  left: calc(50% - .5px); bottom: 0;
  width: 1px; height: 100%;
  background: var(--fg);
  transform-origin: 50% 100%;
  will-change: transform;
}
.ppl__label {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(var(--ruler-b, 12vh) - 2em);
  margin: 0;
  text-align: center;
  font-family: var(--text);
  font-size: clamp(12px, 1.1vw, 20px);
  text-transform: uppercase;
  letter-spacing: .02em;
  line-height: 1.2;
  height: 1.2em;
  overflow: hidden;
  pointer-events: none;
}
.ppl__label span { display: block; }

@media (max-width: 700px) {
  /* One column, in project order; the small ones narrower, alternating sides. */
  .ppg { display: flex; flex-direction: column; gap: 14vw; padding: 8vw var(--edge-x) 14vw; }
  .ppg__cell { margin: 0 !important; }
  .ppg__cell.is-small { width: 72%; }
  .ppg__cell:nth-child(4n+2) { align-self: flex-end; }
  .ppg__cell.is-large .pp-name { font-size: 8vw; }
  .ppg__cell.is-small .pp-name { font-size: 6vw; }
  .ppg .pp-name { margin-top: 3.4vw; }
  .ppg__text { max-width: none; font-size: 14px; margin-top: 2.4vw; }
  .ppr .pp-name { font-size: 6.4vw; }
  .ppr__strip { gap: 1.6vw; margin-top: 3vw; }
  .ppr__strip .pp-fig:nth-child(n+4) { display: none; }
  .ppr { margin-bottom: 10vw; padding-top: 2.4vw; }
  .pp__end { padding-bottom: 18vw; }
}
@media (prefers-reduced-motion: reduce) {
  .pp-fig, .pp-fig img, .pp__pill, .ppg__item { transition: none; }
}

/* =========================================================
   CONTACT PAGE  (/contact)
   Built to the "Get in touch" design: a dark card on the grid with
   the email pill, socials and a two-column form, and the full-body
   figures of Billie and Lu standing beside it. Sizes come from the
   2000px design in --u (1u = 20 design px at that width).
   Motion is transform / opacity only.
   ========================================================= */
.ct {
  --u: clamp(12.5px, 1vw, 22px);
  position: fixed;
  inset: 0;
  z-index: 14;
  background: var(--bg);
  color: var(--fg);
  visibility: hidden;
  will-change: transform;
}
.ct.is-open, html.is-contact-cold .ct { visibility: visible; }
.ct.is-covering { z-index: 30; }
html.is-contact-cold .preloader { display: none; }
/* The theme switch lives on home only. */
html.is-contact .controls,
html.is-contact .zoom-pct { visibility: hidden; pointer-events: none; }

.ct__scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.ct__scroll::-webkit-scrollbar { display: none; }
.ct__content {
  position: relative;
  z-index: 1;
  min-height: 100%;
  padding: calc(9.6 * var(--u)) var(--edge-x) calc(4 * var(--u));
}
.ct__stage { position: relative; width: calc(38.55 * var(--u)); margin: 0 auto; }

/* ---------- The card ---------- */
.ct__card {
  /* Colours inside the card: inverted pills on black (mono) / pink on plum (funky). */
  --card-bg: #121212;
  --card-fg: #E8E6E1;
  --field-bg: rgba(232,230,225,.08);
  --pill: #E8E6E1;
  --pill-fg: #121212;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: calc(45.05 * var(--u));   /* the design's height, thanks message included: no jump when it appears */
  padding: calc(1.55 * var(--u)) calc(1.75 * var(--u)) calc(3.9 * var(--u));
  border-radius: 3px;
  background: var(--card-bg);
  color: var(--card-fg);
  transition: background-color var(--theme-dur) var(--ease-in-out);
}
html[data-theme="funky"] .ct__card {
  --card-bg: #3F1126;
  --field-bg: rgba(232,230,225,.07);
  --pill: #F45CA3;
  --pill-fg: #FFFFFF;
}

.ct__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 300;
  font-size: calc(4.65 * var(--u));
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: -.01em;
  white-space: nowrap;
  outline: none;
}

/* ---------- Email pill ---------- */
.ct__email { position: relative; margin-top: calc(1.45 * var(--u)); }
.ct__copy { font-size: max(10px, calc(.68 * var(--u))); }
.ct__address {
  border-radius: .2em;
  -webkit-user-select: text;
  user-select: text;
  cursor: pointer;
}
.ct__address ::selection { background: var(--card-bg); color: var(--card-fg); }
.ct__copy-btn {
  position: relative;
  border: 0;
  margin: 0;
  font: inherit;
  cursor: pointer;
}
.ct__copy-btn svg { position: absolute; stroke-linejoin: round; transition: transform .6s var(--ease-out), opacity .35s var(--ease-out-3); }
.ct__icon-done { opacity: 0; transform: scale(.6); stroke-linecap: round; }
.ct__copy.is-copied .ct__icon-copy { opacity: 0; transform: scale(.6); }
.ct__copy.is-copied .ct__icon-done { opacity: 1; transform: none; }
.ct__copy-btn:hover .ct__icon-copy, .ct__copy-btn:focus-visible .ct__icon-copy { transform: translate(.08em, -.08em); }
.ct__copy-btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--card-bg), 0 0 0 3px var(--pill); }
.ct__copy:hover .duo__icon svg.ct__icon-done { transform: none; }
/* Copying blocked: the address is selected and this says how to copy it. */
.ct__copy-hint {
  position: absolute;
  left: calc(100% + .7em);
  top: 50%;
  margin: 0;
  font-family: var(--text);
  font-size: max(10px, calc(.62 * var(--u)));
  text-transform: uppercase;
  letter-spacing: .01em;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-.4em, -50%);
  transition: opacity .35s var(--ease-out-3), transform .6s var(--ease-out);
}
.ct__copy-hint.is-on { opacity: .75; transform: translate(0, -50%); }

/* Label swap (address ↔ "copied"): both words share one grid cell;
   each letter slides a line up, one after the other (the pill stagger). */
.swap {
  --ch: 1.25em;
  display: inline-grid;
  justify-items: center;
  height: var(--ch);
  line-height: var(--ch);
  overflow: hidden;
  vertical-align: middle;
}
.swap__word { grid-area: 1 / 1; display: inline-flex; white-space: pre; }
.swap__word > span {
  display: inline-block;
  transition: transform .62s cubic-bezier(.625, .05, 0, 1);
  will-change: transform;
}
.swap__word.is-next > span { transform: translateY(var(--ch)); }
.swap.is-swapped .swap__word.is-now > span { transform: translateY(calc(var(--ch) * -1)); }
.swap.is-swapped .swap__word.is-next > span { transform: none; }

/* ---------- Socials: underlined, with the arrow ---------- */
.ct__social {
  display: flex;
  gap: calc(.85 * var(--u));
  margin-top: calc(1.2 * var(--u));
  font-family: var(--text);
  font-size: max(10px, calc(.68 * var(--u)));
  text-transform: uppercase;
  letter-spacing: .01em;
  line-height: 1;
}
.ct__link {
  display: inline-flex;
  align-items: center;
  gap: .35em;
  padding-bottom: .12em;
  border-bottom: 1px solid currentColor;
}
.ct__link svg {
  width: .85em; height: .85em;
  stroke: currentColor; stroke-width: 1.15; fill: none; stroke-linecap: square;
  transition: transform .6s var(--ease-out);
}
.ct__link:hover .chars > span, .ct__link:focus-visible .chars > span { transform: translateY(calc(var(--ch) * -1)); }
.ct__link:hover svg, .ct__link:focus-visible svg { transform: translate(.12em, -.12em); }
.ct__link:focus-visible { outline: none; box-shadow: 0 2px 0 var(--card-fg); }

/* ---------- Form ---------- */
.ct__form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: calc(1.25 * var(--u));
  row-gap: calc(1.2 * var(--u));
  width: 100%;
  margin-top: calc(5.2 * var(--u));
}
.ct__trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ct__field { display: flex; flex-direction: column; gap: calc(.5 * var(--u)); min-width: 0; }
.ct__field--wide { grid-column: 1 / -1; margin-top: calc(.55 * var(--u)); }
.ct__field label {
  display: flex;
  justify-content: space-between;
  gap: 1em;
  font-family: var(--text);
  font-size: max(10px, calc(.68 * var(--u)));
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: .01em;
}
.ct__hint { opacity: .65; }
.ct__field input,
.ct__field textarea {
  width: 100%;
  margin: 0;
  padding: 0 .85em;
  height: calc(1.6 * var(--u));
  border: 0;
  border-radius: 2px;
  background: var(--field-bg);
  color: inherit;
  font-family: var(--text);
  font-size: max(11px, calc(.66 * var(--u)));
  line-height: 1.4;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.ct__field textarea {
  display: block;
  height: calc(8.25 * var(--u));
  padding-top: .7em;
  padding-bottom: .7em;
  resize: none;
}
.ct__field input::placeholder,
.ct__field textarea::placeholder { color: var(--card-fg); opacity: .38; text-transform: uppercase; }
.ct__field input:focus-visible,
.ct__field textarea:focus-visible { box-shadow: inset 0 0 0 1px rgba(232,230,225,.45); }
.ct__field.is-invalid input,
.ct__field.is-invalid textarea { box-shadow: inset 0 0 0 1px var(--pill); }
.ct__field input:-webkit-autofill {
  -webkit-text-fill-color: var(--card-fg);
  -webkit-box-shadow: 0 0 0 100px var(--card-bg) inset;
}

.ct__captcha { grid-column: 1 / -1; min-height: 78px; }   /* the widget's height: no jump when it appears */
.ct__captcha:empty { min-height: 0; }
.ct__captcha.is-waiting { min-height: 78px; }
.ct__send {
  grid-column: 1 / -1;
  justify-self: start;
  margin-top: calc(-.45 * var(--u));
  font-size: max(10px, calc(.68 * var(--u)));
}
.ct__send[aria-busy="true"] { opacity: .5; pointer-events: none; }
.ct__send:focus-visible { outline: none; }
.ct__send:focus-visible .duo__item { box-shadow: 0 0 0 2px var(--card-bg), 0 0 0 3px var(--pill); }

/* ---------- Result: thanks / error ---------- */
.ct__toast {
  position: relative;
  align-self: flex-start;
  width: calc(19.75 * var(--u));
  max-width: 100%;
  margin-top: calc(2.5 * var(--u));
  padding: calc(.55 * var(--u)) calc(.6 * var(--u));
  border-radius: 2px;
  background: var(--pill);
  color: var(--pill-fg);
  outline: none;
}
.ct__toast[hidden] { display: none; }
.ct__toast-text {
  margin: 0;
  padding-right: calc(1.6 * var(--u));
  font-family: var(--text);
  font-size: max(10px, calc(.68 * var(--u)));
  line-height: 1.5;
  text-transform: uppercase;
  letter-spacing: .01em;
}
.ct__toast-text a { text-decoration: underline; text-underline-offset: .15em; }
.ct__toast-lu {
  position: absolute;
  right: calc(-.65 * var(--u));
  top: calc(-1.5 * var(--u));
  width: calc(2.6 * var(--u));
  height: auto;
  transform-origin: 50% 90%;
}
.ct__toast.is-error .ct__toast-lu { display: none; }

/* ---------- Billie and Lu (full-body figures, beside the card) ---------- */
/* One image (bill-lu.webp): Lu's left edge sits 10.85u inside the card's right edge. */
.ct__figure { position: absolute; z-index: 2; left: calc(100% - 10.85 * var(--u)); top: calc(.25 * var(--u)); width: calc(35.5 * var(--u)); pointer-events: none; }
.ct__figure img { display: block; width: 100%; height: auto; }

@media (max-width: 860px) {
  .ct { --u: 3.2vw; }
  .ct__content { padding-top: calc(var(--edge-top) * .55 + 2.3 * var(--chrome-type) + 24px); padding-left: 12px; padding-right: 12px; }
  .ct__stage { width: 100%; }
  .ct__card { min-height: 0; padding: 8vw 5vw 10vw; }
  .ct__title { font-size: 11.4vw; }
  .ct__email { margin-top: 6vw; }
  .ct__copy, .ct__social, .ct__field label, .ct__send, .ct__toast-text { font-size: 11px; }
  .ct__social { margin-top: 5vw; gap: 18px; }
  .ct__copy-hint { left: 50%; top: calc(100% + 10px); transform: translate(-50%, -.4em); }
  .ct__copy-hint.is-on { transform: translate(-50%, 0); }
  .ct__form { grid-template-columns: 1fr; row-gap: 18px; margin-top: 12vw; }
  .ct__field { gap: 8px; }
  .ct__field--wide { margin-top: 0; }
  .ct__field input, .ct__field textarea { font-size: 16px; height: 44px; }   /* 16px+: no zoom on focus in iOS Safari */
  .ct__field textarea { height: 168px; }
  .ct__send { margin-top: 4px; justify-self: stretch; }
  .ct__send .duo__item:first-child { flex: 1; }
  .ct__toast { width: 100%; margin-top: 30px; padding: 12px 14px; }
  .ct__toast-lu { width: 46px; right: -10px; top: -28px; }
  .ct__figure { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .swap__word > span, .ct__copy-btn svg, .ct__link svg, .ct__copy-hint { transition: none; }
}

/* =========================================================
   SKIP LINK: hidden until it has keyboard focus (first Tab).
   ========================================================= */
.skip-link {
  position: fixed;
  left: var(--edge-x);
  top: 10px;
  z-index: 300;
  display: inline-flex;
  align-items: center;
  height: 2.5em;
  padding: 0 1em;
  border-radius: .32em;
  background: var(--pill);
  color: var(--pill-fg);
  font-family: var(--text);
  font-size: clamp(11px, .8vw, 14px);
  text-transform: uppercase;
  letter-spacing: .01em;
  transform: translateY(-160%);
  transition: transform .4s var(--ease-out);
}
.skip-link:focus { transform: none; outline: 2px solid var(--pill); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .skip-link { transition: none; } }

/* Menu items: a full ring inside the row (an outline would be clipped by the panel). */
.menu__item:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--fg); border-radius: 2px; }
