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

:root {
  --bg: #ffffff;
  --name: #0a0a0a;
  --dim: #6e6e73;
  --faint: #8a8a90;
  --ul: rgba(0, 0, 0, 0.22);
  --line: rgba(0, 0, 0, 0.08);
  --surface: #ffffff;
  --chip: rgba(0, 0, 0, 0.028);
  --ring: rgba(0, 0, 0, 0.08);
  --ring-h: rgba(0, 0, 0, 0.16);
  --peek-ring: rgba(0, 0, 0, 0.10);
  --peek-shadow: 0 12px 32px -6px rgba(0, 0, 0, 0.22), 0 2px 6px rgba(0, 0, 0, 0.06);
  --ok: #1e9e63;
  --mark: #ef3e33;
  --enter: cubic-bezier(0.23, 1, 0.32, 1);
  --exit: cubic-bezier(0.5, 0, 0.1, 1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0b;
    --name: #fafafa;
    --dim: #8e8e95;
    --faint: #74747a;
    --ul: rgba(255, 255, 255, 0.26);
    --line: rgba(255, 255, 255, 0.10);
    --surface: #1c1c1f;
    --chip: rgba(255, 255, 255, 0.035);
    --ring: rgba(255, 255, 255, 0.09);
    --ring-h: rgba(255, 255, 255, 0.2);
    --peek-ring: rgba(255, 255, 255, 0.14);
    --peek-shadow: 0 16px 40px -6px rgba(0, 0, 0, 0.85), 0 2px 8px rgba(0, 0, 0, 0.5);
    --ok: #2fbf71;
  }
}

@view-transition { navigation: auto; }

html { scroll-behavior: smooth; overflow-x: clip; }

body {
  font-family: 'Geist', system-ui, sans-serif;
  background: var(--bg);
  color: var(--dim);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 1.5px solid var(--name); outline-offset: 3px; border-radius: 3px; }
::selection { background: var(--name); color: var(--bg); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ── Layout ── */
main {
  max-width: 560px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: clamp(56px, 14vh, 128px) clamp(20px, 6vw, 60px) clamp(28px, 5vh, 44px);
  display: flex;
  flex-direction: column;
}

.prose {
  max-width: 420px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: -0.015em;
}

.prose p { margin-top: 24px; text-wrap: pretty; }
h1 { font: inherit; color: var(--name); text-wrap: balance; }

/* ── Entrance ── */
[data-fade] {
  animation: fade-in 0.7s var(--enter) backwards;
  animation-delay: calc(var(--d, 0) * 1s);
}

/* Set once by site.js when the entrance ends (or is cut short); never removed */
[data-fade].faded { animation: none; }

@keyframes fade-in {
  from { opacity: 0; transform: translateY(12px); filter: blur(6px); }
}

/* ── Name + mark ── */
.me {
  position: relative;
  cursor: default;
  border-radius: 4px;
  -webkit-tap-highlight-color: transparent;
}

.me:focus:not(:focus-visible) { outline: none; }

.me-nm {
  color: var(--name);
  text-decoration: underline 1px var(--ul);
  text-underline-offset: 4px;
  transition: text-decoration-color 0.15s ease-out;
}

.me-mark {
  position: absolute;
  left: calc(100% + 7px);
  top: calc(50% - 10px);
  width: 20px;
  height: 20px;
  border-radius: 1px;
  background: #fff;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.82);
  filter: blur(1px);
  transition: opacity 0.14s ease-out, transform 0.14s ease-out, filter 0.14s ease-out;
}

.me-mark .logo, .sticker-logo .logo { display: block; width: 100%; height: 100%; fill: var(--mark); }

.me:hover .me-mark,
.me:focus .me-mark {
  opacity: 1;
  transform: none;
  filter: none;
  transition: opacity 0.2s ease-out, transform 0.4s var(--enter), filter 0.2s ease-out;
  animation: roll 0.4s var(--enter);
}

.me:hover .me-nm,
.me:focus .me-nm { text-decoration-color: var(--name); }

@keyframes roll {
  from { transform: translateX(-8px) rotate(-45deg) scale(0.9); }
}

/* ── Inline route links with peek ── */
.pk { position: relative; }

.w {
  color: var(--name);
  text-decoration: underline 1px transparent;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.18s ease;
}

.w:hover, .w:focus-visible { text-decoration-color: var(--ul); }

.peek {
  position: absolute;
  z-index: 10;
  top: calc(100% + 8px);
  left: calc(-12px + var(--nudge, 0px));
  width: max-content;
  max-width: 260px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--peek-ring), var(--peek-shadow);
  isolation: isolate;
  font-size: 12px;
  font-weight: 450;
  line-height: 1.45;
  letter-spacing: 0;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px) scale(0.97);
  transform-origin: 24px 0;
  filter: blur(3px);
  visibility: hidden;
  transition: opacity 0.14s ease-out, transform 0.14s ease-out, filter 0.14s ease-out, visibility 0s 0.14s;
}

/* Lift the paragraph holding an open peek above its siblings (they may still be
   mid fade-in, which gives them their own stacking context) */
.prose p:has(.pk:hover),
.prose p:has(.pk :focus-visible) { position: relative; z-index: 20; }


/* Recede everything else while a peek is open */
@media (hover: hover) and (pointer: fine) {
  .prose > *,
  .pk > :first-child { transition: opacity 0.25s var(--exit); }
  .prose:has(.pk:hover) > :not(:has(.pk:hover)),
  .prose:has(.pk:hover) .pk:not(:hover) > :first-child { opacity: 0.35; }
}

.peek-list { display: block; }

.peek-h { display: block; color: var(--name); font-weight: 500; }
.peek-s { display: block; color: var(--faint); margin-bottom: 6px; }
.peek-p { display: block; color: var(--dim); max-width: 230px; white-space: normal; }

/* Touch screens get the page instead of the card */
@media not ((hover: hover) and (pointer: fine)) { .peek { display: none; } }

/* Glossary terms: hover or focus to read a definition */
.term {
  color: var(--name);
  cursor: help;
  border-radius: 3px;
  text-decoration: underline 1px dotted var(--ul);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.18s ease;
}

.term:hover, .term:focus-visible { text-decoration-color: var(--name); }

.peek-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 1px 0;
}

.peek-row span:first-child { color: var(--name); }
.peek-row span + span { color: var(--faint); font-variant-numeric: tabular-nums; }

.peek-row {
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 0.1s ease-out, transform 0.1s ease-out;
}

.peek-go {
  display: block;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  color: var(--faint);
}

@media (hover: hover) and (pointer: fine) {
  .pk:hover .peek,
  .pk:has(:focus-visible) .peek {
    opacity: 1;
    transform: none;
    filter: none;
    visibility: visible;
    transition: opacity 0.1s ease-out 0.06s, transform 0.35s var(--enter) 0.06s, filter 0.16s ease-out 0.06s, visibility 0s 0.06s;
  }

  .pk:hover .peek-row,
  .pk:has(:focus-visible) .peek-row {
    opacity: 1;
    transform: none;
    transition: opacity 0.25s ease-out, transform 0.35s var(--enter);
    transition-delay: calc(0.12s + var(--i, 0) * 0.035s);
  }
}

/* ── External / copy links ── */
.lk { white-space: nowrap; }

.ext {
  position: relative;
  color: var(--name);
  font-weight: inherit;
  letter-spacing: inherit;
  -webkit-tap-highlight-color: transparent;
}

.ext::after { content: ""; position: absolute; inset: -3px -2px; }

.ext-t {
  text-decoration: underline 1px transparent;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s ease-out;
}

/* The arrow (or copy icon) always has its space reserved, so hovering never
   reflows the text around it: it rests at half opacity and nudges on hover. */
.slot {
  display: inline-grid;
  place-items: center start;
  width: 9.5px;
  height: 0.72em;
  margin-left: 2px;
  vertical-align: 0.06em;
  color: var(--dim);
}

.slot > svg {
  grid-area: 1 / 1;
  display: block;
  width: 9px;
  height: 9px;
  opacity: 0.5;
  transition: opacity 0.2s ease, transform 0.3s var(--enter), scale 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.slot > svg[data-icon="copy"],
.slot > svg[data-icon="check"] { width: 9.5px; height: 9.5px; }
.slot > svg[data-icon="check"] { color: var(--ok); opacity: 0; scale: 0.4; }

.ext:hover .ext-t,
.ext:focus-visible .ext-t { text-decoration-color: var(--ul); }

.ext:hover .slot > svg,
.ext:focus-visible .slot > svg { opacity: 1; }
.ext:hover .slot > svg[data-icon="arrow"],
.ext:focus-visible .slot > svg[data-icon="arrow"] { transform: translate(1.5px, -1.5px); }

/* Copied: swap the copy icon for a check */
.ext[data-done] .slot > svg[data-icon="copy"] { opacity: 0; scale: 0.4; }
.ext[data-done] .slot > svg[data-icon="check"] { opacity: 1; scale: 1; }
.ext:hover .slot > svg[data-icon="check"] { opacity: 0; }
.ext[data-done]:hover .slot > svg[data-icon="check"] { opacity: 1; }

/* Touch devices: always show the underline affordance */
@media (hover: none) {
  .ext-t { text-decoration-color: var(--ul); }
  .w { text-decoration-color: var(--ul); }
}

/* ── Inner pages ── */
.back {
  display: inline-block;
  color: var(--faint);
  transition: color 0.3s var(--exit);
}

.back:hover { color: var(--name); }

.back svg {
  display: inline-block;
  width: 0.79em;
  height: 0.66em;
  margin-right: 7px;
  vertical-align: -0.06em;
  transition: transform 0.35s var(--exit);
}

.back:hover svg { transform: translateX(-2px); }

.page-head { margin-top: 24px; }
.page-head p { margin-top: 0; }

/* Skills: hovering a list dims its siblings */
.tag { transition: color 0.2s ease; }
.tag:not(:last-child)::after { content: ","; color: var(--faint); }
.tags:hover .tag { color: var(--faint); }
.tags .tag:hover { color: var(--name); }
.tags .lead { color: var(--name); }

/* Detail pages */
.meta { color: var(--faint); }

.pager {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.015em;
}

.pager a { display: flex; flex-direction: column; gap: 1px; max-width: 48%; }
.pager .next { margin-left: auto; text-align: right; }
.pager small { font-size: 12px; font-weight: 400; letter-spacing: 0; color: var(--faint); transition: color 0.2s ease; }
.pager span { color: var(--name); transition: transform 0.35s var(--exit); }
.pager .prev:hover span { transform: translateX(-3px); }
.pager .next:hover span { transform: translateX(3px); }
.pager a:hover small { color: var(--dim); }

/* Figures: click to enlarge */
.fig { margin-top: 24px; }
.fig + .fig { margin-top: 16px; }

.zoom {
  display: block;
  width: 100%;
  padding: 0;
  border-radius: 10px;
  cursor: zoom-in;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--line);
}

.fig img, .fig video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  background: var(--line);
  transition: transform 0.6s var(--enter);
}

.fig video { box-shadow: 0 0 0 1px var(--line); }
.zoom:hover img { transform: scale(1.015); }

.fig figcaption {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0;
  color: var(--faint);
}

.lb {
  margin: auto;
  max-width: min(1200px, 94vw);
  max-height: 92vh;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
  cursor: zoom-out;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.2s ease-out, transform 0.35s var(--enter), overlay 0.2s allow-discrete, display 0.2s allow-discrete;
}

.lb[open] { opacity: 1; transform: none; }

@starting-style {
  .lb[open] { opacity: 0; transform: scale(0.96); }
}

.lb::backdrop {
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0);
  transition: background 0.2s ease-out, backdrop-filter 0.2s ease-out, overlay 0.2s allow-discrete, display 0.2s allow-discrete;
}

.lb[open]::backdrop { background: rgba(0, 0, 0, 0.78); backdrop-filter: blur(6px); }

@starting-style {
  .lb[open]::backdrop { background: rgba(0, 0, 0, 0); backdrop-filter: blur(0); }
}

.lb img {
  display: block;
  max-width: min(1200px, 94vw);
  max-height: 86vh;
  width: auto;
  height: auto;
  border-radius: 10px;
}

.lb p {
  margin-top: 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
}

/* Project facts */
.facts {
  margin-top: 24px;
  padding: 14px 0 2px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 6px 16px;
  font-size: 13px;
  font-weight: 450;
  line-height: 1.45;
  letter-spacing: 0;
}

.facts dt { color: var(--faint); }
.facts dd { color: var(--dim); text-wrap: pretty; }

/* Sections of cards */
.sec { margin-top: 40px; }
.sec h2 { font: inherit; color: var(--faint); margin-bottom: 10px; }
.sec h2 + p { margin-top: -4px; margin-bottom: 12px; }

/* Cards: notable work, as a list or a bento grid */
.cards { display: grid; gap: 8px; }

.card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px var(--ring);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.35s var(--enter);
}

.card:hover, .card:focus-visible {
  background: var(--chip);
  box-shadow: inset 0 0 0 1px var(--ring-h);
}

.card:active { transform: scale(0.99); }
.card:focus-visible { outline-offset: 2px; border-radius: 12px; }

.card-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.card-k {
  font-size: 12px;
  font-weight: 450;
  letter-spacing: 0;
  color: var(--faint);
  margin-bottom: 2px;
}

.card-t {
  color: var(--name);
  text-wrap: balance;
  text-decoration: underline 1px transparent;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.18s ease;
}

.card:hover .card-t, .card:focus-visible .card-t { text-decoration-color: var(--ul); }

.card-t .slot { color: var(--faint); margin-left: 5px; }
.card:hover .slot > svg, .card:focus-visible .slot > svg { opacity: 1; }
.card:hover .slot > svg[data-icon="arrow"], .card:focus-visible .slot > svg[data-icon="arrow"] { transform: translateX(2px); }
.card--ext:hover .slot > svg[data-icon="arrow"], .card--ext:focus-visible .slot > svg[data-icon="arrow"] { transform: translate(1.5px, -1.5px); }

.card-d {
  font-size: 13.5px;
  font-weight: 450;
  line-height: 1.45;
  letter-spacing: -0.005em;
  color: var(--dim);
  text-wrap: pretty;
}

.card-img {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--ring);
  background: var(--chip);
}

.card-img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--enter);
}

.card:hover .card-img img { transform: scale(1.06); }

/* Bento */
.bento {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 8px;
}

.bento .card {
  grid-template-columns: 1fr;
  align-items: end;
  align-content: space-between;
  min-height: 128px;
}

.bento .card--wide { grid-column: span 2; }
.bento .card--wide:not(:has(.card-img)) { min-height: 104px; }

.bento .card-img {
  order: -1;
  width: auto;
  height: auto;
  aspect-ratio: 16 / 8;
  margin: -14px -16px 2px;
  border-radius: 0;
  box-shadow: inset 0 -1px 0 var(--ring);
}

.bento .card--shot .card-img { aspect-ratio: 4 / 3; }
.bento .card--shot.card--wide .card-img { aspect-ratio: 16 / 9; }

.card-logo {
  order: -1;
  display: grid;
  place-items: center;
  height: 104px;
  margin: -14px -16px 2px;
  background: var(--chip);
  box-shadow: inset 0 -1px 0 var(--ring);
}

.card-logo img {
  display: block;
  width: auto;
  height: 40px;
  max-width: 64%;
  transition: transform 0.5s var(--enter);
}

.card:hover .card-logo img { transform: scale(1.08); }

/* Logos are black single-colour marks: flip them in dark mode */
@media (prefers-color-scheme: dark) {
  .card-logo img { filter: invert(1); }
}

.bento .card:has(.card-img, .card-logo) { align-content: start; }

@media (max-width: 420px) {
  .bento .card:not(.card--wide) { min-height: 116px; padding: 12px 14px; }
  .card-img { width: 52px; height: 52px; }
}

/* ── Footer ── */
footer {
  margin-top: auto;
  padding-top: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--faint);
}

.clock { display: flex; align-items: center; gap: 7px; font-variant-numeric: tabular-nums; }

.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mark);
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 62, 51, 0.4); }
  70%, 100% { box-shadow: 0 0 0 7px rgba(239, 62, 51, 0); }
}

kbd {
  font: inherit;
  padding: 0 4px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px var(--line);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
}

/* ── Holographic sticker (home) ── */
@property --peel { syntax: '<length>'; inherits: true; initial-value: 0px; }
@property --lift { syntax: '<number>'; inherits: true; initial-value: 0; }
@property --ax { syntax: '<percentage>'; inherits: true; initial-value: 50%; }
@property --ay { syntax: '<percentage>'; inherits: true; initial-value: 50%; }

main { position: relative; }

.sticker {
  --size: 112px;
  --x: 0px;
  --y: 0px;
  --rot: -8deg;
  --swing: 0deg;
  --rx: 0deg;
  --ry: 0deg;
  --px: 0%;
  --py: 0%;
  --peel: 8px;
  --lift: 0;
  position: absolute;
  z-index: 40;
  top: 104px;
  right: -112px;
  width: var(--size);
  height: var(--size);
  translate: var(--x) var(--y);
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  border-radius: 13px;
  transition: --peel 0.45s var(--enter), --lift 0.35s var(--enter);
  animation: sticker-slap 0.7s var(--enter) 0.5s backwards;
}

.sticker:hover { --peel: 24px; --lift: 0.35; }
.sticker.is-dragging { --peel: 40px; --lift: 1; cursor: grabbing; transition: --peel 0.25s var(--enter), --lift 0.25s var(--enter); }
.sticker.is-homing { transition: translate 0.7s var(--enter), --peel 0.45s var(--enter), --lift 0.35s var(--enter); }
.sticker:focus { outline: none; }
.sticker:focus-visible { outline: 1.5px solid var(--name); outline-offset: 6px; }

@keyframes sticker-slap {
  from { opacity: 0; scale: 1.5; rotate: -24deg; }
  60% { opacity: 1; scale: 0.96; }
}

.sticker-body {
  position: relative;
  width: 100%;
  height: 100%;
  transform: perspective(600px) rotate(calc(var(--rot) + var(--swing))) rotateX(var(--rx)) rotateY(var(--ry)) scale(calc(1 + var(--lift) * 0.07));
  filter: drop-shadow(0 calc(1px + var(--lift) * 12px) calc(1.5px + var(--lift) * 14px) rgba(0, 0, 0, calc(0.22 + var(--lift) * 0.14)));
  transition: transform 0.6s var(--enter);
  will-change: transform;
}

.sticker:hover .sticker-body { transition: transform 0.15s ease-out; }
.sticker.is-dragging .sticker-body { transition: transform 0.06s linear; }
.sticker-body.is-wiggle { animation: sticker-wiggle 0.55s var(--enter); }
.sticker-body.is-stuck { animation: sticker-stick 0.45s var(--enter); }

@keyframes sticker-wiggle {
  20% { rotate: -10deg; }
  40% { rotate: 8deg; }
  60% { rotate: -4deg; }
  80% { rotate: 2deg; }
}

@keyframes sticker-stick {
  40% { scale: 0.95 1.03; }
  70% { scale: 1.02 0.98; }
}

.sticker-face {
  position: absolute;
  inset: 0;
  padding: 8px;
  border-radius: 13px;
  background: #fff;
  overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--peel)), calc(100% - var(--peel)) 100%, 0 100%);
  animation: sticker-shimmer 9s ease-in-out infinite alternate;
}

@keyframes sticker-shimmer {
  from { --ax: 15%; --ay: 30%; }
  to { --ax: 85%; --ay: 70%; }
}

.sticker-logo { width: 100%; height: 100%; }

/* Iridescence: a pastel tint over everything, a bright foil over the red, then sparkle and glare */
.sticker-holo,
.sticker-foil,
.sticker-glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.sticker-holo,
.sticker-foil {
  background-image: repeating-linear-gradient(115deg,
    #ff8ac2 0%, #ffd27a 6%, #93ffc0 12%, #79d8ff 18%, #b896ff 24%, #ff8ac2 30%);
  background-size: 400% 400%;
  background-position: calc(var(--ax) + var(--px)) calc(var(--ay) + var(--py));
}

.sticker-holo { mix-blend-mode: multiply; opacity: 0.32; }

.sticker-foil {
  inset: 8px;
  border-radius: 5px;
  mix-blend-mode: soft-light;
  opacity: calc(0.75 + var(--lift) * 0.25);
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.9) 0 0.6px, transparent 1.2px),
    radial-gradient(circle, rgba(255, 255, 255, 0.7) 0 0.5px, transparent 1px),
    repeating-linear-gradient(115deg, #ff8ac2 0%, #ffd27a 6%, #93ffc0 12%, #79d8ff 18%, #b896ff 24%, #ff8ac2 30%);
  background-size: 13px 11px, 7px 9px, 400% 400%;
  background-position:
    calc(var(--px) * 0.3) calc(var(--py) * 0.3),
    calc(var(--px) * -0.2) calc(var(--py) * -0.2),
    calc(var(--ax) + var(--px)) calc(var(--ay) + var(--py));
}

.sticker-glare {
  background: radial-gradient(farthest-corner circle at calc(50% + var(--px)) calc(50% + var(--py)),
    rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.18) 28%, transparent 60%);
  mix-blend-mode: overlay;
  opacity: calc(0.3 + var(--lift) * 0.5);
}

/* The peeled corner shows the paper backing */
.sticker-flap {
  position: absolute;
  left: calc(100% - var(--peel));
  top: calc(100% - var(--peel));
  width: var(--peel);
  height: var(--peel);
  filter: drop-shadow(-1.5px -1.5px 2px rgba(0, 0, 0, 0.22));
  pointer-events: none;
}

.sticker-flap::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top-left-radius: calc(var(--peel) * 0.3);
  clip-path: polygon(100% 0, 0 100%, 0 0);
  background: linear-gradient(to top left, #e9e9ec 0%, #ffffff 30%, #f2f2f4 60%, #cfcfd6 100%);
}

.sticker-hint {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  translate: -50% 0;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 450;
  color: var(--faint);
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.sticker.was-moved .sticker-hint { opacity: 0; }

@media (max-width: 820px) {
  .sticker { --size: 88px; top: auto; right: 20px; bottom: 76px; }
  .sticker, .sticker-face { border-radius: 10px; }
  .sticker-face { padding: 6px; }
  .sticker-foil { inset: 6px; border-radius: 4px; }
  .sticker-hint { top: auto; bottom: calc(100% + 10px); }
}

@media (prefers-reduced-motion: reduce) {
  .sticker-face { animation: none; }
}

/* ── Tools (skills): a dock per group ── */
.tools { display: grid; gap: 18px; }
.tool-group h3 { font: inherit; font-size: 13px; font-weight: 450; letter-spacing: 0; color: var(--faint); margin-bottom: 8px; }

.tool-grid {
  --t: 48px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  min-height: calc(var(--t) * 1.2);
}

.tool {
  --m: 1;
  display: grid;
  place-items: center;
  flex: none;
  width: calc(var(--t) * var(--m));
  height: calc(var(--t) * var(--m));
  border-radius: calc(13px * var(--m));
  background: var(--chip);
  box-shadow: inset 0 0 0 1px var(--ring);
  outline-offset: 3px;
  transition: width 0.35s var(--enter), height 0.35s var(--enter), border-radius 0.35s var(--enter), box-shadow 0.2s ease, background-color 0.2s ease;
}

.tool:hover, .tool:focus-visible { box-shadow: inset 0 0 0 1px var(--ring-h); }
.tool-grid.is-docking .tool { transition: width 0.14s ease-out, height 0.14s ease-out, border-radius 0.14s ease-out, box-shadow 0.2s ease; }
.tool-grid.is-docking img { transition-duration: 0.4s, 0.4s, 0.14s, 0.14s; }

.tool img {
  display: block;
  width: calc(24px * var(--m));
  height: calc(24px * var(--m));
  object-fit: contain;
  filter: grayscale(1);
  opacity: 0.6;
  transition: filter 0.4s ease, opacity 0.4s ease, width 0.35s var(--enter), height 0.35s var(--enter);
  transition-delay: calc(var(--i, 0) * 30ms), calc(var(--i, 0) * 30ms), 0s, 0s;
}

/* Hovering a group lights it up, left to right */
.tool-grid:hover img, .tool-grid:focus-within img { filter: none; opacity: 1; }

.tool-n {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* Single-colour dark marks flip in dark mode */
@media (prefers-color-scheme: dark) {
  /* Deep brand colours (Mendeley, Jira) go muddy as grey on dark tiles, so lift them */
  .tool img { filter: grayscale(1) brightness(1.8); }
  .tool--deep img { filter: grayscale(1) brightness(3.2); }
  .tool-grid:hover .tool--deep img, .tool-grid:focus-within .tool--deep img { filter: brightness(1.7); }
  .tool--mono img { filter: grayscale(1) invert(1); }
  .tool-grid:hover .tool--mono img, .tool-grid:focus-within .tool--mono img { filter: invert(1); }
}

/* Touch: full colour, names visible, no dock */
@media (hover: none) {
  .tool-grid { gap: 14px 6px; min-height: 0; }
  .tool { width: 64px; height: auto; padding: 12px 2px 8px; gap: 6px; }
  .tool img { filter: none; opacity: 1; }
  .tool-n {
    position: static; width: auto; height: auto; overflow: visible; clip: auto;
    white-space: normal; text-align: center;
    font-size: 11px; line-height: 1.2; color: var(--dim);
  }
}

@media (hover: none) and (prefers-color-scheme: dark) {
  .tool--mono img { filter: invert(1); }
}

@media (prefers-reduced-motion: reduce) {
  .tool { --m: 1 !important; }
}
