/* =========================================================
   THEME
   ========================================================= */
:root {
  /* COLOURS — change them here, they update everywhere */
  --primary: #7D00FF;    /* violet: main texts, big words, my chat bubbles */
  --secondary: #FF5500;  /* orange: small texts, counter, restart, hints */
  --bg: #FFFFFF;

  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --edge: 8px; /* minimum gap between items and the screen edge */

  /* THE THREE TEXT SIZES */
  --fs-s: clamp(18px, 4.8vw, 25px);   /* small: info at the screen edges, notes */
  --fs-m: clamp(19px, 5.3vw, 29px);   /* medium: every other text (like "Click and drag…") */
  --fs-l: clamp(34px, 9.5vw, 96px);   /* large: titles, years */

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
}

/* =========================================================
   NO SCROLL, EVER
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  background: var(--page, var(--bg)) !important;
  transition: background-color .35s ease;
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--primary);
  font-family: var(--font);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  position: fixed;   /* stops iOS rubber-band scrolling */
  inset: 0;
}

#stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  touch-action: none;       /* we handle all gestures ourselves */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: crosshair;
  outline: none;
}
#stage:focus-visible { box-shadow: inset 0 0 0 3px var(--primary); }

/* =========================================================
   ITEMS
   .item   = position (moved by JS with translate)
   .inner  = tilt + appear animation
   ========================================================= */
.item {
  position: absolute;
  left: 0;
  top: 0;
  touch-action: none;
  cursor: grab;
  will-change: transform;
}
.item.dragging { cursor: grabbing; }

.inner {
  transform: rotate(var(--tilt, 0deg));
  transform-origin: center;
  animation: pop-in 420ms cubic-bezier(.2, 1.6, .4, 1) both;
  transition: transform 160ms ease;
}
.item.dragging .inner {
  transform: rotate(var(--tilt, 0deg)) scale(1.04);
}
.item.leaving .inner {
  animation: pop-out 320ms ease-in forwards;
}

/* text beats */
.item.text .inner {
  font-size: var(--fs-m);
  line-height: 1.05;
  font-weight: 700;
  white-space: pre-line;
  max-width: min(80vw, 520px);
  padding: 2px 4px;
}
.item.text.big .inner {
  font-size: var(--fs-l);
  line-height: 0.92;
  letter-spacing: -0.02em;
  max-width: 90vw;
}
.item.text.small .inner {
  font-size: var(--fs-s);
  font-weight: 400;
  color: var(--secondary);
}

/* image / video placeholders */
.item.media .inner {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--fill, #ddd);
  overflow: hidden;
}
.media .tag {
  position: absolute;
  left: 8px;
  top: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.media .tag small { font-weight: 400; opacity: .7; }

/* video placeholder extras: play triangle + looping progress bar */
.video .play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform: translate(-35%, -50%);
  border-style: solid;
  border-width: 16px 0 16px 26px;
  border-color: transparent transparent transparent var(--primary);
}
.video .bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  width: 100%;
  background: var(--secondary);
  transform-origin: left;
  animation: loop-bar 4s linear infinite;
}

/* typed text: blinking caret while typing */
.inner.caret::after {
  content: "";
  display: inline-block;
  width: 0.08em;
  height: 0.9em;
  margin-left: 0.05em;
  vertical-align: -0.08em;
  background: var(--primary);
  animation: blink 0.8s steps(2, start) infinite;
}

/* burst photos: snappier entrance, quicker exit */
.item.quick .inner { animation-duration: 260ms; }
.item.leaving-fast .inner { animation: pop-out 200ms ease-in forwards; }

/* chat */
.item.chat .inner {
  width: min(86vw, 460px);
  padding: 10px;
  background: var(--bg);
  border: 1.5px solid var(--primary);
  border-radius: 14px;
  font-size: var(--fs-m);
  line-height: 1.25;
}
.chat-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  padding: 0 0 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--secondary);
  color: var(--secondary);
}
.chat-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bubble {
  max-width: 80%;
  padding: 7px 11px;
  border-radius: 16px;
  word-wrap: break-word;
  animation: bubble-in 240ms cubic-bezier(.2, 1.5, .4, 1) both;
}
.bubble.them {
  align-self: flex-start;
  color: var(--secondary);
  border: 1.5px solid var(--secondary);
  border-bottom-left-radius: 4px;
}
.bubble.me {
  align-self: flex-end;
  background: var(--primary);
  color: var(--bg);
  border-bottom-right-radius: 4px;
}
.bubble.dots { display: flex; gap: 4px; padding: 10px 12px; }
.bubble.dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: dot 1s ease-in-out infinite;
}
.bubble.dots i:nth-child(2) { animation-delay: .15s; }
.bubble.dots i:nth-child(3) { animation-delay: .3s; }

/* intro title: big but a bit smaller than "big" so the whole title fits */
.item.text.title .inner {
  font-size: var(--fs-l);
  line-height: 0.95;
  letter-spacing: -0.02em;
  max-width: min(90vw, 1000px);
}

/* subtitle under the title: orange, readable */
.item.text.sub .inner {
  font-size: var(--fs-m);
  font-weight: 500;
  color: var(--secondary);
}
.item.align-center .inner { text-align: center; }

/* body copy: regular weight, comfortable reading width */
.item.text.body .inner {
  font-size: var(--fs-m);
  font-weight: 400;
  line-height: 1.25;
  max-width: min(82vw, 460px);
}
/* small orange note, e.g. a year */
.item.text.note .inner {
  font-size: var(--fs-s);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--secondary);
}

/* lines that appear one at a time */
.line { display: block; visibility: hidden; }
.line.on { visibility: visible; }

/* words that appear one at a time */
.word { visibility: hidden; }
.word.on { visibility: visible; }

/* real photos */
.item.photo .inner { position: relative; width: 100%; height: 100%; overflow: hidden; background: none; }
.item.photo img {
  display: block;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}
.item.photo .pic { width: 100%; height: 100%; object-fit: cover; }
.item.polaroid .inner {
  background: #FFFFFF;
  box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 4px 14px rgba(0,0,0,.14);
}
.item.pixelated img { image-rendering: pixelated; image-rendering: crisp-edges; image-rendering: pixelated; }

/* REVEAL — the colour wash that slides off the photo and back, like the GANNI gif.
   The mask is a soft-edged gradient twice the photo's height that slides up/down. */
.wash {
  position: absolute;
  inset: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 45.45%, #000 54.55%);
          mask-image: linear-gradient(to bottom, transparent 45.45%, #000 54.55%);
  -webkit-mask-size: 100% 220%;   /* soft edge = 20% of the photo, fully off-photo at both ends */
          mask-size: 100% 220%;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: 0 100%;
          mask-position: 0 100%;
  animation: wash-loop 4.5s infinite;
}
.wash.once { animation-name: wash-once; animation-duration: 1.6s; animation-iteration-count: 1; animation-fill-mode: forwards; }
.wash.solid { background: var(--wash); }
.wash .mask {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}
.wash .sil {
  position: absolute;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: drop-shadow(var(--w) 0 0 var(--wash));
}

@keyframes wash-loop {
  0%, 18%   { -webkit-mask-position: 0 100%; mask-position: 0 100%; animation-timing-function: cubic-bezier(.45,0,.55,1); }
  46%, 64%  { -webkit-mask-position: 0 0;    mask-position: 0 0;    animation-timing-function: cubic-bezier(.45,0,.55,1); }
  94%, 100% { -webkit-mask-position: 0 100%; mask-position: 0 100%; }
}
/* photo hidden until its coloured silhouette is ready */
.inner.waiting .pic, .inner.waiting .wash { visibility: hidden; }
@keyframes wash-once {
  0%, 15% { -webkit-mask-position: 0 100%; mask-position: 0 100%; animation-timing-function: cubic-bezier(.45,0,.55,1); }
  100%    { -webkit-mask-position: 0 0;    mask-position: 0 0; }
}

/* strike-through: a line drawn across a phrase */
.strike { position: relative; }
.strike::after {
  content: "";
  position: absolute;
  left: -2%;
  right: -2%;
  top: 52%;
  height: 0.1em;
  min-height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
}
.strike.on::after { animation: strike 420ms cubic-bezier(.6,0,.3,1) forwards; }
@keyframes strike { to { transform: scaleX(1); } }

/* STACK — photos slide up from below in stop-motion steps, then leave upwards */
.item.stacked .inner { animation: stack-in 760ms both; }
.item.leaving-stack .inner { animation: stack-out 640ms both; }
@keyframes stack-in {
  0%   { transform: translateY(110vh) rotate(var(--tilt)); animation-timing-function: steps(1, end); }
  14%  { transform: translateY(62vh)  rotate(var(--tilt)); animation-timing-function: steps(1, end); }
  28%  { transform: translateY(32vh)  rotate(var(--tilt)); animation-timing-function: steps(1, end); }
  42%  { transform: translateY(14vh)  rotate(var(--tilt)); animation-timing-function: steps(1, end); }
  56%  { transform: translateY(5vh)   rotate(var(--tilt)); animation-timing-function: steps(1, end); }
  70%  { transform: translateY(1.5vh) rotate(var(--tilt)); animation-timing-function: steps(1, end); }
  84%, 100% { transform: translateY(0) rotate(var(--tilt)); }
}
@keyframes stack-out {
  0%   { transform: translateY(0)      rotate(var(--tilt)); animation-timing-function: steps(1, end); }
  16%  { transform: translateY(-1.5vh) rotate(var(--tilt)); animation-timing-function: steps(1, end); }
  32%  { transform: translateY(-6vh)   rotate(var(--tilt)); animation-timing-function: steps(1, end); }
  48%  { transform: translateY(-18vh)  rotate(var(--tilt)); animation-timing-function: steps(1, end); }
  64%  { transform: translateY(-40vh)  rotate(var(--tilt)); animation-timing-function: steps(1, end); }
  80%  { transform: translateY(-75vh)  rotate(var(--tilt)); animation-timing-function: steps(1, end); }
  100% { transform: translateY(-130vh) rotate(var(--tilt)); }
}

/* stack variants: arrive from the top / leave downwards (away from the texts) */
.item.stacked.from-top .inner { animation-name: stack-in-top; }
.item.leaving-stack.down .inner { animation-name: stack-out-down; }
@keyframes stack-in-top {
  0%   { transform: translateY(-110vh) rotate(var(--tilt)); animation-timing-function: steps(1, end); }
  14%  { transform: translateY(-62vh)  rotate(var(--tilt)); animation-timing-function: steps(1, end); }
  28%  { transform: translateY(-32vh)  rotate(var(--tilt)); animation-timing-function: steps(1, end); }
  42%  { transform: translateY(-14vh)  rotate(var(--tilt)); animation-timing-function: steps(1, end); }
  56%  { transform: translateY(-5vh)   rotate(var(--tilt)); animation-timing-function: steps(1, end); }
  70%  { transform: translateY(-1.5vh) rotate(var(--tilt)); animation-timing-function: steps(1, end); }
  84%, 100% { transform: translateY(0) rotate(var(--tilt)); }
}
@keyframes stack-out-down {
  0%   { transform: translateY(0)     rotate(var(--tilt)); animation-timing-function: steps(1, end); }
  16%  { transform: translateY(1.5vh) rotate(var(--tilt)); animation-timing-function: steps(1, end); }
  32%  { transform: translateY(6vh)   rotate(var(--tilt)); animation-timing-function: steps(1, end); }
  48%  { transform: translateY(18vh)  rotate(var(--tilt)); animation-timing-function: steps(1, end); }
  64%  { transform: translateY(40vh)  rotate(var(--tilt)); animation-timing-function: steps(1, end); }
  80%  { transform: translateY(75vh)  rotate(var(--tilt)); animation-timing-function: steps(1, end); }
  100% { transform: translateY(130vh) rotate(var(--tilt)); }
}

/* video: sound button + subtitles */
.sound {
  position: absolute;
  right: 6px;
  top: 6px;
  padding: 6px 8px;
  border: 0;
  background: var(--secondary);
  color: #FFFFFF;
  font: 700 11px/1 var(--font);
  letter-spacing: 0.06em;
  cursor: pointer;
  touch-action: manipulation;
}
.subs {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 8%;
  text-align: center;
  font: 700 clamp(12px, 3.4vw, 18px)/1.2 var(--font);
  color: #FFFFFF;
  text-shadow: 0 0 4px rgba(0,0,0,.9), 0 1px 2px rgba(0,0,0,.9);
  visibility: hidden;
  pointer-events: none;
}

/* links inside texts */
.item.text a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.15em;
  cursor: pointer;
  touch-action: manipulation;
}

/* cursor that shows a link is clickable: pixel arrow glides in, clicks twice, fades */
.cursor-hint {
  position: absolute;
  width: 22px;              /* 11 × 17 pixel grid → 2 px per square */
  height: 34px;
  margin: 0;                /* the arrow tip (top-left square) sits on the point */
  pointer-events: none;
  z-index: 2;
  image-rendering: pixelated;
  animation: cursor-move 3s ease-out forwards;
}
.cursor-hint svg { display: block; animation: cursor-press 3s ease-in-out forwards; transform-origin: 0 0; }
@keyframes cursor-move {
  0%   { opacity: 0; transform: translate(34px, 30px); }
  12%  { opacity: 1; }
  30%  { transform: translate(0, 0); }
  85%  { opacity: 1; transform: translate(0, 0); }
  100% { opacity: 0; transform: translate(0, 0); }
}
@keyframes cursor-press {
  0%, 36%, 46%, 56%, 66%, 100% { transform: scale(1); }
  41%, 61% { transform: scale(.82); }
}

/* DECK — cards fly out of a point and land fanned out */
.item.card .inner { box-shadow: 0 1px 2px rgba(0,0,0,.14), 0 6px 18px rgba(0,0,0,.16); }
.item.dealt .inner { animation: deal 520ms cubic-bezier(.2,.9,.25,1.05) both; }
@keyframes deal {
  0%   { opacity: 0; transform: translate(var(--fx, 0), var(--fy, 0)) rotate(0deg) scale(.15); }
  25%  { opacity: 1; }
  100% { opacity: 1; transform: rotate(var(--tilt)) scale(1); }
}

/* POSTCARD — after 00_REFERENCES/cartoline: coloured-frame cards and cream
   stamp-edged cards, the city name in a retro display font with a solid shadow */
.item.postcard .inner {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 2.75%;
  background: var(--frame);
  box-shadow: 0 2px 4px rgba(0,0,0,.16), 0 10px 26px rgba(0,0,0,.20);
}
.item.pc-rect .pc-pic { border-radius: 3% / 4.5%; }
/* wavy-edged cream card: the outline is an SVG mask set in JS; shadow on the outer item */
.item.pc-wavy .inner {
  background: #F6EEE3;
  padding: 4.5%;
  box-shadow: none;
  -webkit-mask-size: 100% 100%;
          mask-size: 100% 100%;
}
.item.pc-wavy { filter: drop-shadow(0 6px 14px rgba(0,0,0,.22)); }
.item.pc-wavy .pc-pic { border-radius: 2px; }
.pc-pic {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.pc-pic .pic { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6%;
  padding: 0 5% 0.12em;
  overflow: hidden;
  text-align: center;
  line-height: 1;
  white-space: nowrap;
  text-shadow:
    1px 1px 0 var(--shade), 2px 2px 0 var(--shade), 3px 3px 0 var(--shade),
    4px 4px 0 var(--shade), 5px 5px 0 rgba(0,0,0,.35);
}

/* a text sitting on top of photos gets a white label behind it */
.item.text.boxed .inner {
  background: var(--bg);
  padding: 6px 9px;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
}

/* screen recording shown like a phone */
.item.phone .inner {
  border-radius: 9% / 4.2%;
  border: 5px solid #111111;
  box-shadow: 0 8px 22px rgba(0,0,0,.22);
  background: #111111;
}

/* MARQUEE — giant, vertically stretched, endlessly scrolling word */
.marquee {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
  pointer-events: none;           /* taps go through to the canvas */
  color: var(--primary);
}
.marquee.color-secondary { color: var(--secondary); }
.marquee span {
  display: inline-block;
  white-space: nowrap;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  will-change: transform;
}
.marquee .mq-scale { transform-origin: left center; white-space: nowrap; will-change: transform; }
@keyframes marquee {
  from { transform: translateX(var(--from)) scaleY(var(--sy)); }
  to   { transform: translateX(var(--to))   scaleY(var(--sy)); }
}
.marquee.leaving { animation: none; }
.marquee.leaving span { opacity: 0; transition: opacity .3s; }

strong { font-weight: 800; }

/* CODE column — the CV streaming like code */
.codecol {
  position: absolute;
  overflow: hidden;
  pointer-events: none;
  color: #FFFFFF;
  font: 400 clamp(11px, 2.9vw, 13px)/1.45 ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}
.codecol.full { inset: calc(var(--band-t) + 8px) 14px calc(var(--band-b) + 8px) 14px; opacity: .9; }
.codecol.half { top: calc(var(--band-t) + 8px); bottom: calc(var(--band-b) + 8px); width: 46vw; }
.codecol.half.left { left: 2vw; }
.codecol.half.right { right: 2vw; }
.codefeed { transition: transform .25s ease-out; padding-bottom: 18px; }
.codefeed > div { animation: code-in .18s ease-out both; }
.codecol .c-head { margin-top: .9em; font-weight: 700; opacity: .75; }
.codecol .c-year { opacity: .6; }
@keyframes code-in { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
body:not(.dark-page) .codecol { color: var(--primary); }

/* BOOK — 3D: front + back covers, spine, page edges */
.item.book .inner { width: 100%; height: 100%; perspective: 1400px; overflow: visible; background: none; }
.book3d {
  position: relative;
  width: var(--w);
  height: var(--h);
  transform-style: preserve-3d;
  animation: book-in 1.2s cubic-bezier(.2,.8,.2,1) both, book-turn 9s ease-in-out 1.2s infinite;
}
.bf { position: absolute; backface-visibility: hidden; }
.bf.front, .bf.back { width: var(--w); height: var(--h); }
.bf.front { transform: translateZ(calc(var(--d) / 2)); box-shadow: inset 3px 0 4px rgba(0,0,0,.22), inset -2px 0 3px rgba(255,255,255,.25); }
.bf.back  { transform: rotateY(180deg) translateZ(calc(var(--d) / 2)); }
.bf .cover { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.bf.spine {
  width: var(--d); height: var(--h); left: calc(50% - var(--d) / 2);
  background: var(--spine);
  transform: rotateY(-90deg) translateZ(calc(var(--w) / 2));
  box-shadow: inset 0 0 6px rgba(0,0,0,.35);
}
.bf.pages-r {
  width: var(--d); height: calc(var(--h) - 4px); top: 2px; left: calc(50% - var(--d) / 2);
  background: linear-gradient(90deg, #b9b2a3, #ebe5d8 35%, #d6cfbf), repeating-linear-gradient(0deg, #f6f2e8 0 1px, #d8d1c2 1px 2px);
  background-blend-mode: multiply;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
  transform: rotateY(90deg) translateZ(calc(var(--w) / 2 - 2px));
}
.bf.pages-t, .bf.pages-b {
  width: calc(var(--w) - 4px); height: var(--d); left: 2px; top: calc(50% - var(--d) / 2);
  background: repeating-linear-gradient(0deg, #fbfaf6 0 1px, #e3e0d8 1px 2px);
}
.bf.pages-t { transform: rotateX(90deg) translateZ(calc(var(--h) / 2 - 2px)); }
.bf.pages-b { transform: rotateX(-90deg) translateZ(calc(var(--h) / 2 - 2px)); }
.item.book { filter: drop-shadow(0 18px 22px rgba(0,0,0,.28)); }
.book-year {
  position: absolute;
  left: 50%;
  bottom: 100%;
  margin-bottom: .9em;
  translate: -50% 0;                             /* composes with the pop-in animation */
  font: 700 var(--fs-m)/1 var(--font);           /* site font, medium size */
  color: var(--primary);
  background: #FFFFFF;                           /* white pill */
  padding: .1em .5em .12em;
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;
  animation: pop-in 420ms cubic-bezier(.2, 1.6, .4, 1) .9s both;
}
@keyframes book-in {   /* no opacity here: animating opacity flattens the 3D book (no page edges) */
  0%   { transform: rotateX(0deg) rotateY(calc(var(--rest) - 70deg)) scale(.85); }
  100% { transform: rotateX(0deg) rotateY(var(--rest)) scale(1); }
}
@keyframes book-sway {
  0%, 100% { transform: rotateX(10deg) rotateY(var(--rest)); }
  50%      { transform: rotateX(7deg) rotateY(calc(var(--rest) * 0.55)); }
}

/* text colour override */
.item.text.color-secondary .inner { color: var(--secondary); }
.item.text.color-primary .inner { color: var(--primary); }
.item.text.color-white .inner { color: #FFFFFF; }
body.dark-page .ui { color: #FFFFFF; }   /* on a coloured page the UI turns white */
/* …and so do texts, the caret and the marquee */
body.dark-page .item.text:not(.color-secondary) .inner { color: #FFFFFF; }
body.dark-page .inner.caret::after { background: #FFFFFF; }
body.dark-page .marquee:not(.color-secondary) { color: #FFFFFF; }
body.dark-page .item.text.boxed .inner { background: var(--primary); box-shadow: 0 0 0 2px #FFFFFF; }
body.dark-page .item.text.box-light.boxed .inner, body.dark-page .item.text.box-light .inner { background: #FFFFFF; color: var(--primary); box-shadow: 0 4px 14px rgba(0,0,0,.18); padding: 6px 9px; }
body.dark-page .item.text.box-light .inner.caret::after { background: var(--primary); }
.item.text.color-white .inner.caret::after { background: #FFFFFF; }

/* =========================================================
   FIXED CONTROLS
   ========================================================= */
.ui {
  position: fixed;
  z-index: 100000;
  font: 400 var(--fs-s)/1 var(--font);   /* small size, regular weight */
  letter-spacing: 0.03em;
  color: var(--secondary);
}
.ui-progress {
  top: calc(var(--safe-t) + 12px);
  left: calc(var(--safe-l) + 12px);
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}
.ui-progress.bump { animation: bump 300ms ease; }
/* desktop / tablet landscape: UI 10% smaller than the body texts */
@media (orientation: landscape) and (min-width: 601px) {
  :root { --fs-s: clamp(16px, 4.3vw, 22.5px); }   /* small info a bit smaller on desktop */
}

/* the two UI bands: counter + RESTART on top, contact links at the bottom.
   They are painted in the page colour above every item, so nothing ever covers the UI;
   placement and dragging keep things between them. */
:root {
  --band-t: calc(var(--safe-t) + var(--fs-s) + 24px);
  --band-b: calc(var(--safe-b) + var(--fs-s) + 24px);
}
.ui-band {
  position: fixed;
  left: 0; right: 0;
  z-index: 99999;                       /* above all items, below the UI texts */
  background: var(--page, var(--bg));
  pointer-events: none;
  transition: background .3s;
}
.ui-band-top { top: 0; height: var(--band-t); }
.ui-band-bottom { bottom: 0; height: var(--band-b); }

/* contact links: always at the bottom, EMAIL ME left, ACTUAL PORTFOLIO right */
.ui-contact {
  left: calc(var(--safe-l) + 4px);
  right: calc(var(--safe-r) + 4px);
  bottom: calc(var(--safe-b) + 4px);
  display: flex;
  justify-content: space-between;
}
.ui-contact .ui-email { order: -1; }
.ui-cv { margin-left: auto; margin-right: 1.6em; }   /* CV sits right before ACTUAL PORTFOLIO */
.ui-link { white-space: nowrap; }
@media (max-width: 600px) { .ui-cv { margin-right: .6em; } .ui-link { padding-left: 4px; padding-right: 4px; } }
.ui-portfolio { order: 1; }
.ui-link {
  color: inherit;
  text-decoration: none;
  padding: 8px;
  touch-action: manipulation;
}
.ui-link:hover, .ui-link:focus-visible { text-decoration: underline; outline: none; }
.ui-link[hidden] { display: none; }
.ui-restart {
  top: calc(var(--safe-t) + 4px);
  right: calc(var(--safe-r) + 4px);
  padding: 8px;               /* bigger tap target than it looks */
  background: none;
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
}
.ui-restart:hover, .ui-restart:focus-visible { text-decoration: underline; outline: none; }

/* =========================================================
   ANIMATIONS
   ========================================================= */
@keyframes pop-in {
  0%   { opacity: 0; transform: rotate(calc(var(--tilt, 0deg) * -2)) scale(.3); }
  100% { opacity: 1; transform: rotate(var(--tilt, 0deg)) scale(1); }
}
@keyframes pop-out {
  0%   { opacity: 1; transform: rotate(var(--tilt, 0deg)) scale(1); }
  30%  { opacity: 1; transform: rotate(var(--tilt, 0deg)) scale(1.08); }
  100% { opacity: 0; transform: rotate(calc(var(--tilt, 0deg) + 12deg)) scale(.2); }
}
@keyframes bubble-in {
  from { opacity: 0; transform: translateY(6px) scale(.85); }
  to   { opacity: 1; transform: none; }
}
@keyframes dot {
  0%, 60%, 100% { transform: translateY(0); opacity: .4; }
  30% { transform: translateY(-4px); opacity: 1; }
}
@keyframes loop-bar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes blink { to { visibility: hidden; } }
@keyframes bump {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

@media (prefers-reduced-motion: reduce) {
  .book3d { animation: none; transform: rotateX(8deg) rotateY(var(--rest)); }
  .wash { display: none; }
  .inner, .item.leaving .inner, .item.leaving-fast .inner, .item.leaving-stack .inner, .item.dealt .inner, .bubble,
  .bubble.dots i, .inner.caret::after, .video .bar, .ui-progress.bump {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }
  .inner { transition: none; }
}

/* iMessage photo bubble: grey bubble with a tail at the bottom-left */
.item.imsg .inner {
  overflow: visible;
  background: #E9E9EB;
  padding: 5px;
  border-radius: 22px;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.item.imsg .inner img { border-radius: 17px; display: block; width: 100%; height: 100%; object-fit: cover; }
.item.imsg .inner::before,
.item.imsg .inner::after {
  content: "";
  position: absolute;
  bottom: 0;
  height: 22px;
}
.item.imsg .inner::before { left: -7px; width: 22px; background: #E9E9EB; border-bottom-right-radius: 16px 14px; }
.item.imsg .inner::after  { left: -10px; width: 10px; background: var(--page, var(--bg)); border-bottom-right-radius: 10px; }

/* ZINE — stapled paper zine whose pages turn in 3D */
.item.zine .inner { width: 100%; height: 100%; overflow: visible; background: none; perspective: 2400px; }
.zine-book {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform .8s cubic-bezier(.45,.05,.3,1);
}
.zine-book.closed { transform: translateX(calc(var(--pw) * -0.5)); }   /* closed: only the cover, centred */
.zbase, .zleaf { position: absolute; left: 50%; top: 0; width: 50%; height: 100%; }
.zleaf {
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform .95s cubic-bezier(.45,.05,.3,1);
}
.zleaf.turned { transform: rotateY(-179.5deg); }
.zface, .zbase {
  background-color: #F4F1E9;
  box-shadow: 0 10px 22px rgba(0,0,0,.22), 0 1px 2px rgba(0,0,0,.18);
}
.zface {
  position: absolute; inset: 0;
  overflow: hidden;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.zface.back { transform: rotateY(180deg); }
/* the photo, printed on the paper (multiply = ink on paper), a bit crooked */
.zimg {
  position: absolute; left: 10%; top: 10%; width: 80%; height: 80%;
  object-fit: contain;
  transform: translate(var(--zx, 0), var(--zy, 0)) rotate(var(--zt, 0deg));
  mix-blend-mode: multiply;
  filter: saturate(.92) contrast(1.03);
  pointer-events: none;
}
.zimg.bleed { left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; transform: none; }
/* paper grain + the fold shading near the spine, over the print */
.zface::after, .zbase::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .45  0 0 0 0 .42  0 0 0 0 .38  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
  opacity: .5;
}
.zface.front::before, .zbase::before, .zface.back::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
}
.zface.front::before, .zbase::before { background: linear-gradient(to right, rgba(0,0,0,.22), rgba(0,0,0,.05) 7%, transparent 16%); }
.zface.back::before  { background: linear-gradient(to left,  rgba(0,0,0,.22), rgba(0,0,0,.05) 7%, transparent 16%); }
/* while a leaf turns, its paper darkens and lightens like it's catching the light */
.zleaf.turning .zface::before { animation: z-light .95s ease-in-out; }
@keyframes z-light { 0%, 100% { opacity: 1; } 50% { opacity: 1; box-shadow: inset 0 0 0 999px rgba(0,0,0,.12); } }
.zstaples { position: absolute; left: calc(50% - 1.5px); top: 0; width: 3px; height: 100%; transform: translateZ(2px); pointer-events: none; transition: opacity .3s; }
.zstaples::before, .zstaples::after {
  content: ""; position: absolute; left: 0; width: 3px; height: 11%;
  background: linear-gradient(to right, #8d8d8d, #e2e2e2, #8d8d8d); border-radius: 2px;
}
.zstaples::before { top: 22%; }
.zstaples::after { bottom: 22%; }
.zine-book.closed .zstaples { opacity: 0; }

/* CARDS — wall of project covers seen through a window; the camera moves, the window stays */
.item.cards .inner { width: 100%; height: 100%; overflow: hidden; background: none; border-radius: 4px; }
.cards-wall {
  position: absolute; left: 0; top: 0;
  transform-origin: 0 0;
  transition: transform .75s cubic-bezier(.65,0,.25,1);
  will-change: transform;
}
.pcard {
  position: absolute;
  border-radius: 14px;
  overflow: hidden;
  background: #E9E9EB;
  box-shadow: 0 6px 16px rgba(0,0,0,.14);
}
.pcard-img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.pcard-pill {
  position: absolute; left: 8%; right: 8%; top: 44%;
  display: flex; align-items: center; justify-content: space-between; gap: .5em;
  background: #FFFFFF; color: #111111; text-decoration: none;
  border-radius: 999px;
  padding: .45em .45em .45em .9em;
  font: 500 clamp(11px, 1.1vw, 14px)/1.1 var(--font);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  touch-action: manipulation;
}
.pcard-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-go {
  flex: none; width: 1.7em; height: 1.7em; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--primary); color: #FFFFFF; font-weight: 700;
}
@media (prefers-reduced-motion: reduce) { .cards-wall { transition-duration: .01s; } }

/* SLIDES — big straight photos sliding in from the right, nothing else */
.item.slide .inner { width: 100%; height: 100%; animation: slide-in .55s cubic-bezier(.2,.8,.2,1) both; }
.item.slide .pic { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
@keyframes slide-in { from { transform: translateX(110vw); } to { transform: none; } }

/* COLLAGE — full-screen changing panels + one white project card in front */
.collage { position: absolute; left: 0; right: 0; overflow: hidden; }
.collage-bg { position: absolute; inset: 0; }
.collage-tile { position: absolute; object-fit: cover; display: block; pointer-events: none; }
.collage-card {
  position: absolute; top: var(--cy); transform: translateY(-50%);
  display: flex; flex-direction: column; gap: .5em;
  background: #FFFFFF; color: var(--primary); text-decoration: none;
  padding: 14px 14px 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  touch-action: manipulation;
}
.collage-title { font: 700 var(--fs-m)/1 var(--font); text-transform: uppercase; letter-spacing: -.01em; }
.collage-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; pointer-events: none; }

/* LAPTOP — 3D, seen from above-front; .open lifts the lid */
.item.laptop .inner { width: 100%; height: 100%; overflow: visible; background: none; perspective: 2400px; perspective-origin: 50% 20%; }
.lt-rig {
  position: absolute; left: 50%; top: 58%;
  width: var(--W); height: var(--D);
  margin: calc(var(--D) / -2) 0 0 calc(var(--W) / -2);
  transform-style: preserve-3d;
  transform: rotateX(58deg) rotateZ(-32deg);
}
.lt-base {
  position: absolute; inset: 0;
  border-radius: calc(var(--W) * .03);
  background: linear-gradient(160deg, #f1f2f4, #d4d6da 60%, #c4c7cc);
  box-shadow: 0 0 0 1px rgba(0,0,0,.08), 30px 40px 60px rgba(0,0,0,.25);
  transform-style: preserve-3d;
}
.lt-front {   /* the thin front edge of the base */
  position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--W) * .018);
  background: linear-gradient(#cfd2d6, #9fa3a8);
  transform-origin: 50% 100%; transform: rotateX(-90deg);
  border-radius: 0 0 6px 6px;
}
.lt-keys {
  position: absolute; left: 8%; right: 8%; top: 9%; height: 46%;
  border-radius: 6px;
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(var(--W) * .052), #c9ccd1 calc(var(--W) * .052) calc(var(--W) * .058)),
    repeating-linear-gradient(0deg, transparent 0 calc(var(--W) * .05), #c9ccd1 calc(var(--W) * .05) calc(var(--W) * .057)),
    #1d1e21;
  box-shadow: inset 0 0 0 2px #b9bcc1;
}
.lt-pad { position: absolute; left: 32%; right: 32%; top: 62%; bottom: 7%; border-radius: 8px;
  background: linear-gradient(160deg, #e6e7ea, #cfd1d5); box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.lt-lid {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  transform-origin: 50% 0;
  transform: translateZ(2px) rotateX(0deg);
  transform-style: preserve-3d;
  transition: transform .8s cubic-bezier(.3,.1,.2,1);
}
.item.laptop.open .lt-lid { transform: translateZ(2px) rotateX(108deg); }
.item.laptop.closing .lt-lid { transition-duration: .55s; transition-timing-function: cubic-bezier(.6,0,.9,.6); }
.lt-shell, .lt-display { position: absolute; inset: 0; border-radius: calc(var(--W) * .03); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.lt-shell { background: linear-gradient(160deg, #e9eaed, #c9ccd1); box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.lt-display { transform: rotateX(180deg); background: #0d0d0e; padding: calc(var(--W) * .022) calc(var(--W) * .022) calc(var(--W) * .04); }
.lt-screen { position: relative; width: 100%; height: 100%; overflow: hidden; background: #FFFFFF; border-radius: 2px; }
.lt-site { display: block; width: 100%; height: auto; pointer-events: none; }
.lt-ribbons { position: absolute; right: 9%; top: 0; display: flex; gap: calc(var(--W) * .015); }
.lt-ribbon {
  display: grid; place-items: center;
  width: calc(var(--W) * .06); height: calc(var(--W) * .085); padding-bottom: calc(var(--W) * .018);
  font: 700 calc(var(--W) * .024)/1 var(--font);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%);
}
/* FLIPBOOK — open magazine from above, pages turning fast */
.item.flipbook .inner { width: 100%; height: 100%; overflow: visible; background: none; perspective: 2200px; }
.fb-half, .fb-leaf { position: absolute; top: 0; width: 50%; height: 100%; }
.fb-half { background: #F7F5F0 no-repeat; background-size: 200% 100%; box-shadow: 0 12px 30px rgba(0,0,0,.25); }
.fb-l { left: 0; }
.fb-r { left: 50%; }
.fb-l.blank { visibility: hidden; }
.fb-gutter { position: absolute; left: 47%; width: 6%; top: 0; height: 100%; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(0,0,0,.18) 45%, rgba(0,0,0,.22) 50%, rgba(0,0,0,.18) 55%, transparent); }
.fb-leaf { left: 50%; transform-origin: 0 50%; transform-style: preserve-3d; animation: fb-turn cubic-bezier(.42,0,.38,1) both; z-index: 2; }
.fb-face { position: absolute; inset: 0; background: #F7F5F0 no-repeat; background-size: 200% 100%; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.fb-face.plain { background: #EDEAE2; }
.fb-back { transform: rotateY(180deg); }
@keyframes fb-turn {
  0%   { transform: rotateY(0deg) translateZ(0); }
  15%  { transform: rotateY(-14deg) translateZ(2px); }
  50%  { transform: rotateY(-90deg) translateZ(14px); }
  85%  { transform: rotateY(-166deg) translateZ(2px); }
  100% { transform: rotateY(-180deg) translateZ(0); }
}
/* light and shadow travelling across the turning page */
.fb-face::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.fb-front::after { background: linear-gradient(90deg, rgba(0,0,0,.28), rgba(0,0,0,0) 40%); }
.fb-back::after  { background: linear-gradient(270deg, rgba(0,0,0,.28), rgba(255,255,255,.12) 50%, rgba(0,0,0,0)); }
.fb-leaf .fb-front::after { animation: fb-shade-f var(--fbd, 450ms) ease-in both; }
.fb-leaf .fb-back::after  { animation: fb-shade-b var(--fbd, 450ms) ease-out both; }
@keyframes fb-shade-f { from { opacity: 0; } to { opacity: 1; } }
@keyframes fb-shade-b { from { opacity: 1; } to { opacity: 0; } }
/* the page underneath gets a soft moving shadow */
.fb-r.under::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.25), transparent 60%); animation: fb-under var(--fbd, 450ms) ease-out both; pointer-events: none; }
.fb-r { position: absolute; }
@keyframes fb-under { from { opacity: 1; } to { opacity: 0; } }

/* FLICK pile */
.item.flick .inner { width: 100%; height: 100%; box-shadow: 0 6px 16px rgba(0,0,0,.18); }
.item.flick .pic { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }

/* chat: a centred line, like a system message ("And Vaste Programme was born.") */
.bubble.note { align-self: center; background: none; color: var(--primary); font-size: .7em; padding: .4em 0 0; border: 0; box-shadow: none; }

/* RECEIPT — thermal paper, monospace, torn zigzag bottom; .crumpled = paper ball */
.item.receipt .inner { background: none; overflow: visible; }
.rc-paper {
  position: relative; margin: 0;
  background-color: #FBFAF7;
  color: #222222;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  line-height: 1.25;
  white-space: pre;
  padding: 1.6em 1.4em 2.6em;
  box-shadow: 0 10px 24px rgba(0,0,0,.22);
  background-image:
    linear-gradient(172deg, transparent 0 30%, rgba(0,0,0,.05) 31%, transparent 34%),
    linear-gradient(8deg, transparent 0 58%, rgba(0,0,0,.045) 59%, transparent 62%),
    linear-gradient(95deg, transparent 0 46%, rgba(255,255,255,.6) 47%, transparent 50%);
  -webkit-mask: linear-gradient(#000 0 0) top / 100% calc(100% - 10px) no-repeat,
                conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 14px 10px repeat-x;
          mask: linear-gradient(#000 0 0) top / 100% calc(100% - 10px) no-repeat,
                conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 14px 10px repeat-x;
  transform-origin: 50% 0;
  animation: rc-print 1.1s steps(14, end) both;     /* prints out line by line */
  transition: transform .5s cubic-bezier(.5,0,.3,1.4), border-radius .5s;
}
@keyframes rc-print { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }


/* BACK arrow — left edge, middle */
.ui-back {
  left: calc(var(--safe-l) + 6px); top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; padding: 10px 6px;
  background: none; border: 0; cursor: pointer; touch-action: manipulation;
}
.ui-back svg { width: 100%; height: 100%; display: block; }
.ui-back[hidden] { display: none; }
.ui-back:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
/* while replaying (going back), skip the entrance animations */
body.fast .inner, body.fast .rc-paper, body.fast .book3d, body.fast .lt-lid { animation-duration: 1ms !important; transition-duration: 1ms !important; }

/* a list running behind texts: lighter, so the texts stay readable */
.codecol.faint { opacity: .4; }

/* after landing, the books turn slowly back and forth (no opacity: it would flatten the 3D) */
@keyframes book-turn {
  0%, 100% { transform: rotateX(0deg) rotateY(var(--rest)); }
  50%      { transform: rotateX(0deg) rotateY(calc(var(--rest) + 28deg)); }
}

/* WIPE — white panel sweeping left → right */
.wipe-panel { position: absolute; left: 0; right: 0; background: #FFFFFF; animation: wipe-lr ease-in-out both; pointer-events: none; }
@keyframes wipe-lr { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* LANYARD — strap from the top, metal clip, card; swings like a pendulum */
.lanyard { position: absolute; width: 0; height: 0; pointer-events: none; }
.ly-swing { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: auto; cursor: grab; touch-action: none; }
.ly-strap {
  position: absolute; left: calc(var(--cw) * -.06); top: -40px;
  width: calc(var(--cw) * .12); height: calc(var(--strap) + 40px);
  background: linear-gradient(90deg, #5e0f12, #7c1a1d 30%, #8e2326 50%, #7c1a1d 70%, #5e0f12);
  box-shadow: 2px 0 6px rgba(0,0,0,.18);
}
.ly-clip {
  position: absolute; left: calc(var(--cw) * -.05); top: calc(var(--strap) - 6px);
  width: calc(var(--cw) * .1); height: calc(var(--cw) * .16);
  border-radius: 40% 40% 30% 30%;
  background: linear-gradient(90deg, #8d9096, #f2f3f5 45%, #a6a9ae 60%, #6f7277);
  box-shadow: 0 2px 4px rgba(0,0,0,.3);
}
.ly-clip i { position: absolute; left: 30%; right: 30%; top: 18%; height: 40%; border-radius: 40%; background: rgba(0,0,0,.25); }
.ly-card {
  position: absolute; left: calc(var(--cw) * -.5); top: calc(var(--strap) + var(--cw) * .13);
  width: var(--cw);
  border-radius: calc(var(--cw) * .04);
  overflow: hidden; background: #FFFFFF;
  box-shadow: 0 14px 28px rgba(0,0,0,.25), 0 0 0 1px rgba(0,0,0,.06);
}
.ly-card img { display: block; width: 100%; height: auto; pointer-events: none; }
.ly-swing.swing { animation: ly-swing 2.2s cubic-bezier(.3,.05,.3,1) both; }
.ly-swing.nudge { animation: ly-nudge 1.8s ease-out both; }
@keyframes ly-swing {
  0%   { transform: rotate(88deg); }
  38%  { transform: rotate(-22deg); }
  58%  { transform: rotate(10deg); }
  75%  { transform: rotate(-4deg); }
  88%  { transform: rotate(1.5deg); }
  100% { transform: rotate(0deg); }
}
@keyframes ly-nudge {
  0% { transform: rotate(0); } 20% { transform: rotate(-12deg); } 45% { transform: rotate(7deg); }
  65% { transform: rotate(-3deg); } 82% { transform: rotate(1deg); } 100% { transform: rotate(0); }
}
@media (prefers-reduced-motion: reduce) { .ly-swing.swing, .ly-swing.nudge { animation: none; } }

.ly-swing.out { animation: ly-out .75s cubic-bezier(.5,0,.8,.4) both; }
@keyframes ly-out { from { transform: rotate(0deg); } to { transform: rotate(95deg); } }

/* MAILICON — a pixel letter with flapping wings, bobbing; tap → it flies off (mailto) */
.item.mailicon .inner { background: none; overflow: visible; animation: mi-in .6s cubic-bezier(.2,1.4,.4,1) both; }
.mi-link { display: block; position: relative; width: clamp(130px, 14vw, 180px); touch-action: manipulation; text-decoration: none; animation: mi-bob 1.6s ease-in-out .6s infinite; }
.mi-link svg { display: block; width: 100%; height: auto; overflow: visible; image-rendering: pixelated; }
.mi-wing { transform-box: fill-box; animation: mi-flap .32s steps(2, jump-none) infinite alternate; }
.mi-wl { transform-origin: 100% 100%; }
.mi-wr { transform-origin: 0% 100%; animation-name: mi-flap-r; }
@keyframes mi-flap { from { transform: rotate(0); } to { transform: rotate(-22deg) translateY(-2px); } }
@keyframes mi-flap-r { from { transform: rotate(0); } to { transform: rotate(22deg) translateY(-2px); } }
@keyframes mi-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@keyframes mi-in { from { transform: translate(-60vw, 30vh) rotate(-20deg); } to { transform: none; } }
.mi-note { position: absolute; left: 50%; top: 100%; transform: translateX(-50%) rotate(-4deg); margin-top: 6px; white-space: nowrap;
  font: 700 var(--fs-s)/1 var(--font); color: var(--secondary); }
.item.mailicon.flyaway .inner { animation: mi-away .9s cubic-bezier(.5,0,.8,.4) forwards; }
@keyframes mi-away { to { transform: translate(60vw, -70vh) rotate(18deg) scale(.6); } }

/* receipt total: bigger on its own line */
.rc-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.55em; line-height: 1.15; margin: .15em 0; }
@media (max-width: 600px) { .rc-total { font-size: 1.9em; } }

/* CRUMPLE — the paper folds in a few jerky steps, then becomes a faceted paper ball */
.item.receipt.crumpled .rc-paper {
  -webkit-mask: none; mask: none;
  transform-origin: 50% 55%;
  animation: none;
  transition: none;
}
@keyframes rc-fold {
  0%   { transform: none; filter: none; }
  25%  { transform: perspective(600px) rotateX(38deg) scale(.86, .7) rotate(-4deg); filter: brightness(.96); }
  50%  { transform: perspective(600px) rotateY(-52deg) rotateX(20deg) scale(.55, .4) rotate(9deg); filter: brightness(.9); }
  75%  { transform: perspective(600px) rotateX(-40deg) rotateY(30deg) scale(.32, .18) rotate(-12deg); filter: brightness(.88); }
  100% { transform: scale(.16, .09) rotate(20deg); filter: brightness(.85); opacity: .6; }
}
.item.receipt.balled .inner { width: 100%; height: 100%; animation: rc-pop .35s cubic-bezier(.2,1.6,.4,1) both; }
.rc-ball { display: block; filter: drop-shadow(0 6px 8px rgba(0,0,0,.25)); }
@keyframes rc-pop { from { transform: scale(.55) rotate(-25deg); } 70% { transform: scale(1.06) rotate(4deg); } to { transform: none; } }

/* BIN for the paper ball */
.rc-bin { position: absolute; width: 78px; pointer-events: none; animation: pop-in 420ms cubic-bezier(.2,1.6,.4,1) .7s both; }
.rc-bin svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 4px 6px rgba(0,0,0,.2)); }
.rc-bin.got { animation: bin-shake .45s ease-out .45s; }
@keyframes bin-shake { 0%,100% { rotate: 0deg; } 25% { rotate: -8deg; } 55% { rotate: 6deg; } 80% { rotate: -2deg; } }

/* AUDIOCARD — photo + a mini player like the iTunes one */
.item.audiocard .inner { background: #FFFFFF; padding: 8px 8px 10px; box-shadow: 0 10px 24px rgba(0,0,0,.2); }
.ac-photo { display: block; width: 100%; height: auto; pointer-events: none; }
.ac-player { margin-top: 8px; background: linear-gradient(#f4f4f4, #e6e6e6); border-radius: 14px; padding: 8px 12px 6px; color: #333; font: 500 11px/1 var(--font); box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.ac-row { display: flex; align-items: center; gap: 8px; }
.ac-bar { position: relative; flex: 1; height: 4px; border-radius: 2px; background: #c9c9c9; }
.ac-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: #555; border-radius: 2px; }
.ac-bar b { position: absolute; left: 0; top: 50%; width: 3px; height: 12px; margin: -6px 0 0 -1.5px; background: #333; border-radius: 1px; }
.ac-now, .ac-left { font-variant-numeric: tabular-nums; min-width: 2.4em; }
.ac-left { text-align: right; }
.ac-ctrl { margin-top: 6px; gap: 6px; }
.ac-btn { background: none; border: 0; padding: 4px; width: 30px; height: 30px; color: #444; cursor: pointer; touch-action: manipulation; }
.ac-btn svg { width: 100%; height: 100%; fill: currentColor; display: block; }
.ac-play { width: 36px; height: 36px; }
.ac-play .i-play { display: block; } .ac-play .i-pause { display: none; }
.item.audiocard.playing .ac-play .i-play { display: none; } .item.audiocard.playing .ac-play .i-pause { display: block; }
.item.audiocard.needs-tap .ac-play { animation: ac-blink 1s ease-in-out infinite; color: var(--primary); }
@keyframes ac-blink { 50% { transform: scale(1.18); } }
.ac-vol.off { opacity: .35; }
.ac-dots { color: #777; letter-spacing: 1px; }
.ac-sp { flex: 1; }

/* NEXT arrow — right edge, middle (mirror of the back arrow) */
.ui-next {
  right: calc(var(--safe-r) + 6px); top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; padding: 10px 6px;
  background: none; border: 0; cursor: pointer; touch-action: manipulation;
}
.ui-next svg { width: 100%; height: 100%; display: block; }
.ui-next[hidden] { display: none; }
.ui-next:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* CLICK ANYWHERE starburst — yellow, black heavy type, pulsing until the first tap */
.hint-burst {
  position: fixed; left: 50%; top: 78%; z-index: 100001;
  width: min(46vw, 230px); aspect-ratio: 200 / 140;
  transform: translate(-50%, -50%) rotate(-9deg);
  pointer-events: none;
  animation: hint-in .5s cubic-bezier(.2,1.6,.4,1) .6s both, hint-pulse 1.1s ease-in-out 1.2s infinite;
  transition: opacity .25s, transform .25s;
}
.hint-burst svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.hint-burst polygon { fill: var(--primary); }
.hint-burst span {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  font: 700 clamp(13px, 3.4vw, 19px)/1 var(--font); letter-spacing: .01em; color: #FFFFFF;
}
.hint-burst.gone { opacity: 0; transform: translate(-50%, -50%) rotate(-9deg) scale(.6); animation: none; }
@keyframes hint-in { from { transform: translate(-50%, -50%) rotate(-30deg) scale(0); } to { transform: translate(-50%, -50%) rotate(-9deg) scale(1); } }
@keyframes hint-pulse { 0%, 100% { transform: translate(-50%, -50%) rotate(-9deg) scale(1); } 50% { transform: translate(-50%, -50%) rotate(-6deg) scale(1.08); } }
@media (orientation: landscape) and (min-width: 601px) { .hint-burst { width: 190px; } }

/* iPhone-style alert */
.ios-alert-wrap { position: fixed; inset: 0; z-index: 200000; display: grid; place-items: center; background: rgba(0,0,0,.28); animation: fade-in .2s both; }
.ios-alert-wrap[hidden] { display: none; }
.ios-alert {
  width: min(280px, 82vw); border-radius: 14px; overflow: hidden; text-align: center;
  background: rgba(242,242,242,.97); color: #000;
  font-family: -apple-system, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
  animation: ios-in .28s cubic-bezier(.2,1.3,.4,1) both;
}
.ios-t { margin: 0; padding: 19px 16px 2px; font-weight: 600; font-size: 17px; line-height: 1.25; }
.ios-m { margin: 0; padding: 2px 16px 19px; font-size: 13px; line-height: 1.35; }
.ios-btns { display: flex; border-top: .5px solid rgba(60,60,67,.36); }
.ios-btns > * {
  flex: 1; padding: 11px 6px; font-size: 17px; color: #0A7AFF; background: none; border: 0;
  text-decoration: none; cursor: pointer; font-family: inherit; touch-action: manipulation;
}
.ios-btns > * + * { border-left: .5px solid rgba(60,60,67,.36); font-weight: 600; }
@keyframes ios-in { from { transform: scale(1.15); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } }

/* CV / portfolio viewer */
.viewer { position: fixed; inset: 0; z-index: 200001; background: #FFFFFF; display: flex; flex-direction: column; }
.viewer[hidden] { display: none; }
.viewer-bar {
  flex: none; display: flex; justify-content: space-between; align-items: center; gap: 1em;
  padding: calc(var(--safe-t) + 10px) calc(var(--safe-r) + 12px) 10px calc(var(--safe-l) + 12px);
  background: var(--primary); color: #FFFFFF;
  font: 400 var(--fs-s)/1 var(--font); letter-spacing: .03em;
}
.viewer-bar button, .viewer-bar a { color: inherit; background: none; border: 0; padding: 4px 0; font: inherit; letter-spacing: inherit; text-decoration: none; cursor: pointer; white-space: nowrap; }
.viewer-bar button { font-weight: 700; }
.viewer-body { flex: 1; min-height: 0; }
.viewer-body.cv { overflow: auto; -webkit-overflow-scrolling: touch; background: #EEEEEE; padding: 16px; }
.viewer-body.cv img { display: block; width: 100%; max-width: 820px; margin: 0 auto 16px; box-shadow: 0 6px 20px rgba(0,0,0,.15); background: #FFFFFF; }
.viewer-body.site iframe { width: 100%; height: 100%; border: 0; display: block; }
.vo-short { display: none; }
@media (max-width: 600px) { .vo-long { display: none; } .vo-short { display: inline; } .viewer-bar { font-size: 18px; } }
.ios-btns > *:focus { outline: none; } .ios-btns > *:focus-visible { background: rgba(0,0,0,.06); }

.rc-center { display: block; text-align: center; height: 1.25em; }

.rc-pieces { position: absolute; left: 0; top: 0; perspective: 700px; transform-style: preserve-3d; pointer-events: none; }
.rc-piece { position: absolute; left: 0; top: 0; margin: 0; animation: none !important; -webkit-mask: none !important; mask: none !important; box-shadow: none; backface-visibility: visible; }

/* LAPTOP screen: simplified profile */
.lp { position: absolute; inset: 0; background: #FFFFFF; color: #111; font-family: var(--font); padding: 5% 6%; display: flex; flex-direction: column; gap: 4%; }
.lp-head { display: flex; align-items: center; gap: 4%; }
.lp-av { flex: none; width: calc(var(--W) * .075); aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: #DDD; color: #FFF; display: grid; place-items: center; font: 700 calc(var(--W) * .026)/1 var(--font); }
.lp-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lp-name { font: 700 calc(var(--W) * .036)/1.05 var(--font); }
.lp-role { font: 400 calc(var(--W) * .02)/1.2 var(--font); color: #666; margin-top: .3em; }
.lp-stats { display: flex; gap: 6%; }
.lp-stats div { display: flex; flex-direction: column; }
.lp-stats b { font: 700 calc(var(--W) * .026)/1 var(--font); color: #111; }
.lp-stats span { font: 400 calc(var(--W) * .018)/1.3 var(--font); color: #666; }
.lp-win { flex: 1; min-height: 0; overflow: hidden; position: relative; }
.lp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: calc(var(--W) * .014); animation: lp-scroll linear 1.6s infinite alternate; }
.lp-grid i { display: block; aspect-ratio: 1.28; background: #EEE center / cover no-repeat; border-radius: 3px; }
@keyframes lp-scroll { 0%, 6% { transform: translateY(0); } 94%, 100% { transform: translateY(calc(-100% + var(--W) * .3)); } }
@media (prefers-reduced-motion: reduce) { .lp-grid { animation: none; } }

/* BURGERBOX — CSS 3D box from the dieline faces */
.item.burgerbox .inner { width: 100%; height: 100%; overflow: visible; background: none; }
.bb-scene { position: absolute; inset: 0; perspective: 1400px; perspective-origin: 50% 0%; }
.bb-box {
  position: absolute; left: 50%; top: 62%;
  width: var(--L); height: var(--H);
  margin: calc(var(--H) / -2) 0 0 calc(var(--L) / -2);
  transform-style: preserve-3d;
  transform: rotateX(-32deg) rotateY(-24deg);
  animation: bb-drop .9s cubic-bezier(.3,1.4,.5,1) both;
}
@keyframes bb-drop { from { transform: translateY(-60vh) rotateX(-32deg) rotateY(-80deg); } to { transform: rotateX(-32deg) rotateY(-24deg); } }
.bb-f { position: absolute; background: #F9D11F center / 100% 100% no-repeat; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.bb-front, .bb-back { width: var(--L); height: var(--H); left: 0; top: 0; }
.bb-front { transform: translateZ(calc(var(--D) / 2)); }
.bb-back  { transform: rotateY(180deg) translateZ(calc(var(--D) / 2)); }
.bb-left, .bb-right { width: var(--D); height: var(--H); left: calc((var(--L) - var(--D)) / 2); top: 0; }
.bb-right { transform: rotateY(90deg) translateZ(calc(var(--L) / 2)); filter: brightness(.88); }
.bb-left  { transform: rotateY(-90deg) translateZ(calc(var(--L) / 2)); filter: brightness(.88); }
.bb-bottom { width: var(--L); height: var(--D); left: 0; top: calc((var(--H) - var(--D)) / 2); transform: rotateX(-90deg) translateZ(calc(var(--H) / 2)); }
/* the inside: a white floor you see once the lid is open */
.bb-inner { width: var(--L); height: var(--D); left: 0; top: calc((var(--H) - var(--D)) / 2); transform: rotateX(90deg) translateZ(calc(var(--H) / -2 + 2px)); background: #F4F1EA; backface-visibility: visible; }
/* lid: hinged on the back top edge */
.bb-lid {
  position: absolute; left: 0; top: calc((var(--H) - var(--D)) / 2);
  width: var(--L); height: var(--D);
  transform-style: preserve-3d;
  transform: rotateX(90deg) translateZ(calc(var(--H) / 2));
}
.bb-hinge { position: absolute; inset: 0; transform-style: preserve-3d; transform-origin: 50% 0; transition: transform .8s cubic-bezier(.3,1.3,.5,1); }
.bb-top, .bb-lidin { position: absolute; inset: 0; width: 100%; height: 100%; }
.bb-lidin { transform: rotateY(180deg) translateZ(1px); background: #F4F1EA; }
.bb-top { transform: translateZ(1px); }
.item.burgerbox.open .bb-hinge { transform: rotateX(105deg); }
/* the burger, standing up, rising out of the box */
.bb-pop {
  position: absolute; left: calc(var(--L) * .2); width: calc(var(--L) * .6); bottom: calc(var(--H) * .25);
  transform-origin: 50% 100%;
  transform: translateY(40%) scale(.4);
  opacity: 0;
  transition: transform .7s cubic-bezier(.3,1.6,.5,1) .55s, opacity .2s .55s;
}
.bb-burger { display: block; width: 100%; height: auto; filter: drop-shadow(0 8px 6px rgba(0,0,0,.25)); }
.item.burgerbox.open .bb-pop { transform: translateY(-62%) scale(1); opacity: 1; animation: bb-bob 1.8s ease-in-out 1.4s infinite; }
.item.burgerbox.open .bb-pop.jump { animation: bb-jump .7s cubic-bezier(.3,1.6,.5,1), bb-bob 1.8s ease-in-out .7s infinite; }
@keyframes bb-bob { 0%, 100% { transform: translateY(-62%) scale(1) rotate(0); } 50% { transform: translateY(-70%) scale(1.02) rotate(-3deg); } }
@keyframes bb-jump { 0% { transform: translateY(-62%); } 40% { transform: translateY(-130%) rotate(12deg); } 100% { transform: translateY(-62%); } }
@media (prefers-reduced-motion: reduce) { .bb-box { animation: none; } }

.pc-name.flat { text-shadow: none; }
.item.pc-wait { visibility: hidden; }
.item.pc-wait .inner { animation-play-state: paused; }

/* FLIPBOOK paper look (like the reference: open book from above, fast flicking) */
.fb-edges { position: absolute; left: -6px; right: -6px; top: 3px; bottom: -4px; pointer-events: none;
  background:
    repeating-linear-gradient(90deg, #d9d6cf 0 1px, #f6f4ef 1px 2px) left / 7px 100% no-repeat,
    repeating-linear-gradient(90deg, #f6f4ef 0 1px, #d9d6cf 1px 2px) right / 7px 100% no-repeat;
  border-radius: 2px; box-shadow: 0 14px 30px rgba(0,0,0,.28); }
.fb-paper { position: absolute; inset: 0; pointer-events: none; z-index: 3;
  background:
    linear-gradient(90deg, rgba(0,0,0,.10), transparent 6%, transparent 42%, rgba(0,0,0,.20) 49%, rgba(255,255,255,.18) 50.5%, rgba(0,0,0,.12) 52%, transparent 58%, transparent 94%, rgba(0,0,0,.08)),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .5  0 0 0 0 .48  0 0 0 0 .44  0 0 0 .35 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply; }
.fb-gutter { z-index: 2; }

/* FOLDER — blue desktop folder; press cards slide out of it */
.item.pfolder .inner { position: relative; width: 100%; height: 100%; }
.item.pfolder .pf-back { filter: drop-shadow(0 5px 9px rgba(0,0,0,.18)); }   /* shadow on the folder only, not on the cards sliding through it (smoother on iPhone) */
.pf-back, .pf-front { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.pf-out { position: absolute; inset: 0; }
.pf-out > .item.pf-card { pointer-events: none; transition: transform 720ms cubic-bezier(.2,.85,.25,1.04); transform-origin: 50% 100%; will-change: transform; backface-visibility: hidden; }
.item.pfolder.pf-pop .inner { animation: pfpop 420ms cubic-bezier(.2,1.5,.4,1) both; }
@keyframes pfpop { 0% { opacity: 0; transform: scale(.3) translateY(20%); } 100% { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pf-out > .item.pf-card { transition: none; } .item.pfolder.pf-pop .inner { animation: none; } }

.rc-creases { position: absolute; inset: 0; background-size: 100% 100%; pointer-events: none; opacity: 0; mix-blend-mode: normal; }
.pf-out > .item.pf-card.pf-back-in { transition: transform 420ms cubic-bezier(.5,0,.75,.4); }

/* the last sentence, as big as the screen */
.item.text.fill .inner { line-height: 1.04; letter-spacing: -0.015em; }
.item.text.fill .inner { white-space: pre-wrap; }

/* WAVES — work cards falling in */
.item.wv { will-change: transform; }
.item.wv-spin .inner, .item.card.wv-spin .inner { width: 100%; height: 100%; perspective: 700px; background: none; overflow: visible; box-shadow: none; }
.wv-spin3d { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; animation: wv-spin linear infinite; }
.wv-face { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  filter: drop-shadow(0 6px 8px rgba(0,0,0,.18)); pointer-events: none; }
.wv-face.back { transform: rotateY(180deg); }
@keyframes wv-spin { from { transform: rotateY(0deg); } to { transform: rotateY(360deg); } }
@media (prefers-reduced-motion: reduce) { .wv-spin3d { animation: none; } }
/* phone frame: a little "island" at the top, like an iPhone */
.item.phone .inner { position: relative; }
.item.phone .inner::before { content: ""; position: absolute; z-index: 2; top: 2.4%; left: 50%; width: 30%; height: 3.2%; transform: translateX(-50%);
  background: #111; border-radius: 99px; pointer-events: none; }

/* press cards: they only slide out of the folder (no pop-in, neither inside nor once out); wave cards only fall */
.item.pf-card .inner, .item.pf-done .inner, .item.wv .inner { animation: none; }
.item.cutout .inner { background: none; box-shadow: none; overflow: visible; }
.item.cutout .pic { object-fit: contain; }

/* IG POST on a phone (wave card) */
.item.igphone .inner { position: relative; width: 100%; height: 100%; background: #fff; border: .55em solid #1b1b1d; border-radius: 2.6em;
  box-shadow: 0 10px 26px rgba(0,0,0,.25); overflow: hidden; display: flex; flex-direction: column; font-family: -apple-system, "Helvetica Neue", Arial, sans-serif; color: #111; }
.ig-island { position: absolute; top: .45em; left: 50%; width: 32%; height: 1.15em; transform: translateX(-50%); background: #1b1b1d; border-radius: 99px; z-index: 2; }
.ig-head { display: flex; align-items: center; gap: .55em; padding: 2.3em .8em .6em; font-size: 1em; }
.ig-head b { font-size: .95em; font-weight: 700; }
.ig-av { width: 2.1em; height: 2.1em; border-radius: 50%; background: #000; color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .8em;
  box-shadow: 0 0 0 .14em #fff, 0 0 0 .3em #e1306c; flex: none; letter-spacing: -.05em; }
.ig-dots { margin-left: auto; font-size: .7em; letter-spacing: .1em; color: #444; }
.ig-pic { width: 100%; background: #eee; flex: none; }
.ig-pic .pic { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.ig-act { display: flex; align-items: center; gap: .9em; padding: .7em .8em .3em; }
.ig-act svg, .ig-nav svg { width: 1.55em; height: 1.55em; flex: none; }
.ig-sp { flex: 1; }
.ig-cap { padding: .2em .8em; font-size: .82em; line-height: 1.3; }
.ig-cap b { font-weight: 700; }
.ig-nav { margin-top: auto; display: flex; justify-content: space-around; align-items: center; padding: .7em .5em 1.2em; border-top: 1px solid #eee; }
.ig-me { width: 1.5em; height: 1.5em; border-radius: 50%; background: #000; }

/* 3D plate (wave card) */
.item.wv-plate .inner, .item.card.wv-plate .inner { width: 100%; height: 100%; background: none; box-shadow: none; overflow: visible; perspective: 900px; perspective-origin: 50% 30%; }
.plate3d { position: absolute; inset: 0; transform-style: preserve-3d; animation: plate-spin linear infinite; }
.plate-layer { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; pointer-events: none; backface-visibility: visible; }
.plate-layer.rim { filter: brightness(.78) contrast(1.1); }
.plate-shadow { position: absolute; left: 12%; right: 12%; top: 58%; height: 30%; border-radius: 50%; background: radial-gradient(closest-side, rgba(0,0,0,.28), rgba(0,0,0,0)); filter: blur(4px); }
@keyframes plate-spin { 0% { transform: rotateX(58deg) rotateZ(0deg); } 50% { transform: rotateX(50deg) rotateZ(180deg); } 100% { transform: rotateX(58deg) rotateZ(360deg); } }
@media (prefers-reduced-motion: reduce) { .plate3d { animation: none; transform: rotateX(55deg); } }

.mi-note.copied { white-space: nowrap; font-size: .8em; }
.item.mailicon.mi-tapped .mi-link svg { animation: mi-tap .45s cubic-bezier(.2,1.6,.4,1); }
@keyframes mi-tap { 0% { transform: scale(1); } 40% { transform: scale(.86); } 100% { transform: scale(1); } }
