/* ============================================================
   profile — clean plates. No glitch, no misregistered ink; the
   grain and the halftone sit behind the content, and the links
   head is the plain label. Badges are the older chip row: hover
   is a colour transition, nothing else.
   ============================================================ */

@font-face {
  font-family: "Unbounded";
  src: url("assets/fonts/unbounded-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("assets/fonts/geist-mono-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bone: #f2efe6;
  --muted: #a9a59b;
  --line: rgba(242, 239, 230, 0.14);
  --line-soft: rgba(242, 239, 230, 0.08);
  --surface: rgba(242, 239, 230, 0.035);
  --ink: #08070d;
  --accent-rgb: 167, 139, 250;
  --accent: rgb(var(--accent-rgb));
  --accent-soft: #d8ccff;
  --accent-wash: rgba(var(--accent-rgb), 0.1);
  /* The two canonical rave jolts: acid green and hot pink. */
  --acid: #ccff00;
  --acid-rgb: 204, 255, 0;
  --hot: #ff00cc;
  --hot-rgb: 255, 0, 204;
  --font-display: "Unbounded", "Bahnschrift", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --dur-micro: 80ms;
  --dur-quick: 150ms;
  --dur-fast: 250ms;
  --dur-medium: 350ms;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

/* sloth — the default purple */
html[data-theme="sloth"] {
  --ink: #08070d;
  --accent-rgb: 167, 139, 250;
  --accent-soft: #d8ccff;
}

html[data-theme="vnkyy"] {
  --ink: #0b0608;
  --accent-rgb: 255, 90, 90;
  --accent-soft: #ffb0a8;
  --acid: #00ffcc;
  --acid-rgb: 0, 255, 204;
}

html[data-theme="hello"] {
  --ink: #050b07;
  --accent-rgb: 94, 234, 139;
  --accent-soft: #b6f5c9;
}

html[data-theme="click"] {
  --ink: #0a0413;
  --accent-rgb: 167, 139, 250;
  --accent-soft: #d8ccff;
}

/* merzost — grey, and only grey */
html[data-theme="merzost"] {
  --ink: #0a0a0b;
  --bone: #ededed;
  --muted: #9a9a9e;
  --accent-rgb: 176, 176, 182;
  --accent: rgb(var(--accent-rgb));
  --accent-soft: #d6d6da;
  --acid: #d6d6da;
  --acid-rgb: 214, 214, 218;
  --hot: #7e7e86;
  --hot-rgb: 126, 126, 134;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

html { background: var(--ink); }

body {
  min-height: 100svh;
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.5;
  color: var(--bone);
  /* The stage sits at z-index -1 and the body paints after negative-z
     descendants, so an opaque body background would cover it. The ink
     comes from html (the canvas) and from .stage itself. */
  background: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection {
  background: var(--acid);
  color: var(--ink);
}

/* One grain pass over the whole composite. It sits under .frame, so
   the print texture never lands on the pictures or the links. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: var(--grain);
  background-size: 180px 180px;
  opacity: 0.07;
  mix-blend-mode: screen;
  pointer-events: none;
}

.skip {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 100;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--bone);
  color: var(--ink);
  font-size: 0.75rem;
  text-decoration: none;
}

.skip:focus { top: 16px; }

/* ------------------------------------------------------------
   Stage — flat ink, CRT scanlines and xerox grain. A slow aurora,
   a lumen that follows the pointer. Life, not noise.
   ------------------------------------------------------------ */
.stage {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--ink);
}

/* A single soft key light from the upper right: depth, not glow. */
.stage::before {
  content: "";
  position: absolute;
  inset: -12%;
  background:
    radial-gradient(46% 40% at 74% 6%, rgba(242, 239, 230, 0.06), transparent 70%),
    radial-gradient(40% 44% at 8% 96%, rgba(242, 239, 230, 0.022), transparent 72%);
  pointer-events: none;
}

/* Two vast, barely-there lights. They are fixed: any drift changes how
   much of the glow is on screen, which reads as the page slowly
   brightening and then darkening. */
.stage__aurora {
  position: absolute;
  width: 74vmax;
  height: 74vmax;
  border-radius: 50%;
  pointer-events: none;
}

.stage__aurora--a {
  top: -30vmax;
  left: -20vmax;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.16), transparent 64%);
}

.stage__aurora--b {
  right: -26vmax;
  bottom: -36vmax;
  background: radial-gradient(circle, rgba(var(--acid-rgb), 0.07), transparent 66%);
}

/* The room's answer to a visitor: an acid light that trails the
   pointer. It moves by transform only, so tracking the cursor
   never repaints the stage. Desktop only. */
.stage__lumen {
  position: absolute;
  top: 0;
  left: 0;
  width: 86vmax;
  height: 86vmax;
  margin: -43vmax 0 0 -43vmax;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--acid-rgb), 0.1), transparent 60%);
  transform: translate3d(var(--lx, 72vw), var(--ly, 12vh), 0);
  opacity: 0;
  transition: opacity 0.9s var(--ease-out);
  will-change: transform;
  pointer-events: none;
}

html.has-pointer .stage__lumen { opacity: 1; }

/* CRT scanlines — one faint light line every three pixels. */
.stage__scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 2px,
    rgba(242, 239, 230, 0.045) 2px 3px
  );
  opacity: 0.6;
  pointer-events: none;
}

.stage__grain {
  position: absolute;
  inset: 0;
  opacity: 0.09;
  mix-blend-mode: screen;
  background-image: var(--grain);
  background-size: 180px 180px;
  pointer-events: none;
}

.stage__vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(118% 96% at 44% 32%, transparent 46%, rgba(0, 0, 0, 0.6) 100%),
    linear-gradient(to bottom, transparent 62%, rgba(0, 0, 0, 0.35));
  pointer-events: none;
}

/* ------------------------------------------------------------
   Frame — hero, then links. Nothing above or below.
   ------------------------------------------------------------ */
.frame {
  position: relative;
  z-index: 1;
  width: min(100%, 1400px);
  min-height: 100svh;
  margin: 0 auto;
  padding: clamp(24px, 3.4vw, 52px) clamp(24px, 4.6vw, 68px);
  display: grid;
  grid-template-rows: 1fr auto;
  gap: clamp(26px, 4.6vh, 52px);
}

/* ------------------------------------------------------------
   Hero — the name carries the page
   ------------------------------------------------------------ */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(28px, 5.5vw, 84px);
  min-height: 0;
  padding-block: clamp(4px, 1.4vh, 18px);
}

.identity { min-width: 0; }

/* Misregistered ink: the acid plate sits a hair right of the
   pink one, the way a two-pass print drifts. */
.name {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(4.75rem, 13.4vw, 10.75rem);
  font-weight: 600;
  line-height: 0.82;
  letter-spacing: -0.062em;
  color: var(--bone);
  white-space: nowrap;
}

.name--long { font-size: clamp(2.25rem, 8vw, 6.4rem); }

/* Letters are wrapped by JS; each one rises on its own beat. */
.name__l {
  display: inline-block;
  will-change: transform;
}

html.is-ready .name__l {
  animation: letter-in 0.8s var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 26ms + 0.12s);
}

@keyframes letter-in {
  from {
    opacity: 0;
    transform: translateY(0.55em) rotate(1.5deg);
    filter: blur(7px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: blur(0);
  }
}

/* Under a fine pointer each letter leans toward the cursor and
   picks up the acid plate. */
@media (hover: hover) and (pointer: fine) {
  .name__l { transition: transform var(--dur-quick) var(--ease-out), color var(--dur-quick) var(--ease-out); }

  .name__l:hover {
    transform: translateY(-0.045em);
    color: var(--acid);
  }
}

.handle {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  margin: clamp(16px, 2.4vh, 26px) 0 0;
  font-size: 0.75rem;
  line-height: 1;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.handle__rule {
  width: 28px;
  height: 1px;
  flex: none;
  background: var(--acid);
}

/* The handle is a copy control: the name and the Discord mark are one target. */
.handle__copy {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: -6px -8px;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: inherit;
  font: inherit;
  line-height: 1;
  letter-spacing: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.handle__copy:hover .handle__text { color: var(--bone); }

.handle__copy:hover .handle__icon { opacity: 1; }

.handle__copy:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 2px;
}

.handle__text { transition: color var(--dur-quick) var(--ease-out); }

.handle__icon {
  width: 15px;
  height: 15px;
  flex: none;
  color: var(--muted);
  opacity: 0.8;
  transition: opacity var(--dur-quick) var(--ease-out);
}

.handle__done {
  display: none;
  width: 15px;
  height: 15px;
  flex: none;
  color: var(--accent-soft);
}

/* Icon-only companions on the handle line: Matrix, then the wallets. */
.handle__copy--matrix,
.handle__copy--wallet {
  margin: 0 0 0 calc(-0.3rem - 5px);
  padding: 5px;
}

.handle__copy--wallet + .handle__copy--wallet {
  margin-left: calc(-0.3rem - 10px);
}

.handle__copy--matrix .handle__icon,
.handle__copy--wallet .handle__icon {
  width: 14px;
  height: 14px;
}

.handle__icon--xmr { color: #ff6600; }

.handle__icon--ltc { color: #c9c9c9; }

.handle__copy.is-copied .handle__icon { display: none; }

.handle__copy.is-copied .handle__done { display: block; }

.handle__copy.is-copied .handle__text { color: var(--accent-soft); }

/* A soft ring pulses out of the control the moment it copies. */
.handle__copy.is-copied { animation: copied-pulse 0.5s var(--ease-out); }

@keyframes copied-pulse {
  0% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.4); }
  100% { box-shadow: 0 0 0 10px rgba(var(--accent-rgb), 0); }
}

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

/* Offscreen field for the legacy clipboard fallback. */
.copy-fallback {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  margin: 0;
  opacity: 0;
  font-size: 16px;
  pointer-events: none;
}

/* Visible receipt for a copy — the sr-only status still announces it. */
.toast {
  position: fixed;
  bottom: max(22px, calc(14px + env(safe-area-inset-bottom)));
  left: 50%;
  z-index: 120;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 9, 15, 0.86);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--bone);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
  pointer-events: none;
}

.toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ------------------------------------------------------------
   Portrait — crop marks, rim light, scanline develop, halftone
   ------------------------------------------------------------ */
.portrait {
  --size: clamp(220px, 25vw, 340px);
  --sheen-x: 50%;
  --sheen-y: 50%;
  position: relative;
  width: var(--size);
  margin: 0;
  flex: none;
  border-radius: 18px;
  /* Depth lives outside the clipped frame, or clip-path would erase it. */
  box-shadow: 0 40px 90px -42px rgba(0, 0, 0, 1);
  transition: transform var(--dur-medium) var(--ease-out);
}

/* While the pointer drives it, no transition: the card follows in real time. */
.portrait.is-tilting {
  transition: none;
  will-change: transform;
}

/* The print never quite rests. */
.portrait__float {
  animation: float 7.5s ease-in-out 1.2s infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

.portrait::before,
.portrait::after {
  content: "";
  position: absolute;
  z-index: 2;
  width: 16px;
  height: 16px;
  border-color: var(--acid);
  opacity: 0.75;
  pointer-events: none;
}

.portrait::before {
  top: -10px;
  left: -10px;
  border-top: 1px solid;
  border-left: 1px solid;
}

.portrait::after {
  right: -10px;
  bottom: -10px;
  border-right: 1px solid;
  border-bottom: 1px solid;
}

.portrait__frame {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow:
    inset 0 0 0 1px rgba(242, 239, 230, 0.06),
    inset 0 1px 0 rgba(242, 239, 230, 0.12);
  clip-path: inset(0);
}

html.is-ready .portrait__frame {
  animation: develop 1.1s var(--ease-in-out) 0.25s both;
}

@keyframes develop {
  from { clip-path: inset(0 0 100% 0); }
  to   { clip-path: inset(0 0 0 0); }
}

.portrait__img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The print goes through the riso drum: a halftone dot screen. It is
   the paper the picture is laid on, so it draws under the image. */
.portrait__dots {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: radial-gradient(circle, rgba(0, 0, 0, 0.5) 0.9px, transparent 1.35px);
  background-size: 4px 4px;
  mix-blend-mode: multiply;
  opacity: 0.5;
  pointer-events: none;
}

.portrait__scrim {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 78px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.5) 42%, rgba(0, 0, 0, 0.8));
  pointer-events: none;
}

.portrait__hud {
  position: absolute;
  bottom: 11px;
  left: 13px;
  z-index: 2;
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  color: var(--bone);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
}

/* The recorder light: the machine is still watching. */
.portrait__hud::before {
  content: "";
  align-self: center;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 6px rgba(var(--acid-rgb), 0.9);
}

html.is-ready .portrait__hud::before { animation: blink 1.8s steps(1, end) infinite; }

@keyframes blink {
  0%, 58%, 100% { opacity: 1; }
  59%, 99% { opacity: 0.25; }
}

.portrait__hud span { opacity: 0.72; }

/* The scanline: one pass as the print develops, then a faint
   sweep every eighteen seconds — the machine is still watching. */
.portrait__scan {
  position: absolute;
  top: 0;
  right: -8px;
  left: -8px;
  z-index: 3;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--acid), transparent);
  box-shadow: 0 0 14px var(--acid);
  opacity: 0;
  pointer-events: none;
}

html.is-ready .portrait__scan {
  animation: scan 18s var(--ease-in-out) 0.25s infinite;
}

@keyframes scan {
  0%    { transform: translateY(0); opacity: 0; }
  1.4%  { opacity: 0.9; }
  7%    { transform: translateY(var(--size)); opacity: 0; }
  100%  { transform: translateY(var(--size)); opacity: 0; }
}

/* directional rim — the single accent light on the portrait,
   breathing slowly */
.portrait__frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--accent-soft), transparent 56%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0.75;
  pointer-events: none;
}

html.is-ready .portrait__frame::before {
  animation: rim 7s ease-in-out 1.4s infinite;
}

@keyframes rim {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 0.9; }
}

/* A bone-white specular sheen that follows the pointer across the print. */
.portrait__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(
    62% 62% at var(--sheen-x) var(--sheen-y),
    rgba(255, 252, 240, 0.2),
    rgba(255, 252, 240, 0.05) 46%,
    transparent 72%
  );
  mix-blend-mode: soft-light;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out);
  pointer-events: none;
}

.portrait.is-tilting .portrait__frame::after { opacity: 1; }

/* ------------------------------------------------------------
   Badges — the older chip row: one line, no tilt, no tooltips.
   Hover is a colour and border transition and nothing else.
   ------------------------------------------------------------ */
.bottom {
  display: grid;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: inset 0 1px 0 rgba(242, 239, 230, 0.05);
  color: var(--bone);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transform: translate3d(var(--bx, 0px), var(--by, 0px), 0);
  transition:
    border-color var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out),
    transform var(--dur-quick) var(--ease-out);
}

.badge__icon {
  display: block;
  width: 20px;
  height: 20px;
  flex: none;
  object-fit: contain;
  opacity: 1;
}

.links {
  display: grid;
  justify-items: center;
  gap: 14px;
}

.links__head {
  display: grid;
  justify-items: center;
  gap: 9px;
}

/* Just a label. */
.links__title {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.8;
}

.links__rule {
  width: 36px;
  height: 1px;
  background: var(--accent);
  opacity: 0.45;
}

.badge:active {
  background: var(--accent-wash);
  transform: translate3d(var(--bx, 0px), var(--by, 0px), 0) scale(0.97);
  transition-duration: var(--dur-micro);
}

.badge:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 3px;
  border-color: var(--accent);
}

/* ------------------------------------------------------------
   Hello — a window, written by hand on launch
   ------------------------------------------------------------ */
html.intro-open,
html.intro-open body { overflow: hidden; }

.intro {
  --len: 1;
  position: fixed;
  inset: 0;
  z-index: 200;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

.intro.is-opening { pointer-events: none; }

/* The veil is a photocopy: grain and scanlines over everything. */
.intro::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    var(--grain),
    repeating-linear-gradient(to bottom, transparent 0 2px, rgba(242, 239, 230, 0.05) 2px 3px);
  background-size: 180px 180px, auto;
  opacity: 0.16;
  pointer-events: none;
}

/* Full-screen veil, with the handwritten "hello" cut out of it. */
.intro__veil {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: 50% 50%;
  transition: transform 2.2s var(--ease-in-out);
}

/* The cutout is a clean window: the live page shows through untouched. */
.intro__curtain { fill: #000; }

/* Black stroke inside a luminance mask = the window. */
.intro__hole {
  fill: none;
  stroke: #000;
  stroke-width: 18;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: var(--len, 1);
  stroke-dashoffset: var(--len, 1);
}

.intro__hole--main { transition: stroke-width 2.2s var(--ease-in-out); }

/* Handwriting: measured at the start, quicker through the downstrokes. */
.intro.is-drawing .intro__hole {
  animation: intro-draw 1.2s cubic-bezier(0.45, 0.05, 0.55, 0.95) forwards;
}

@keyframes intro-draw {
  from { stroke-dashoffset: var(--len, 1); }
  to { stroke-dashoffset: 0; }
}

/* The camera flies through the word: the cutout and the veil rush past,
   then the last of the curtain fades away. */
.intro.is-opening .intro__veil { transform: scale(3); }
.intro.is-opening .intro__hole--main { stroke-width: 1600; }

/* The overlay fades as well, so it can never vanish in one frame. */
.intro.is-opening {
  opacity: 0;
  transition: opacity 2s var(--ease-out) 0.3s;
}

/* Entrance — the card settles after the veil lifts. */
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

@keyframes fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

html.is-ready .identity,
html.is-ready .bottom {
  animation: rise 0.55s var(--ease-out) both;
}

html.is-ready .portrait { animation: fade 0.65s var(--ease-out) both; }

html.is-ready .identity { animation-delay: 0.1s; }
html.is-ready .portrait { animation-delay: 0.18s; }
html.is-ready .bottom { animation-delay: 0.26s; }

/* Badges arrive one after another. */
html.is-ready .badge {
  animation: rise 0.5s var(--ease-out) backwards;
}

html.is-ready .badge:nth-child(1) { animation-delay: 0.34s; }
html.is-ready .badge:nth-child(2) { animation-delay: 0.4s; }
html.is-ready .badge:nth-child(3) { animation-delay: 0.46s; }
html.is-ready .badge:nth-child(4) { animation-delay: 0.52s; }
html.is-ready .badge:nth-child(5) { animation-delay: 0.58s; }
html.is-ready .badge:nth-child(6) { animation-delay: 0.64s; }

/* ------------------------------------------------------------
   Pointer effects — only where a real hover exists
   ------------------------------------------------------------ */
@media (hover: hover) and (pointer: fine) {
  .badge:hover {
    border-color: var(--accent);
    background: var(--accent-wash);
  }
}

/* ------------------------------------------------------------
   Small screens — portrait becomes the masthead
   ------------------------------------------------------------ */
@media (max-width: 760px) {
  .frame {
    gap: 22px;
    padding-left: 20px;
    padding-right: 20px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 22px;
  }

  .portrait {
    order: -1;
    --size: clamp(132px, 34vw, 176px);
  }

  .name { font-size: clamp(3.5rem, 19vw, 6.2rem); }

  .name--long { font-size: clamp(2.1rem, 9.6vw, 4rem); }

  .badges { gap: 7px; }

  .badge {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .badge__icon {
    width: 18px;
    height: 18px;
  }
}

/* Short viewports: keep the whole card above the fold */
@media (max-height: 720px) and (min-width: 761px) {
  .frame {
    gap: 20px;
    padding-top: 24px;
    padding-bottom: 20px;
  }

  .name { font-size: clamp(3.6rem, 11.4vw, 8rem); }

  .name--long { font-size: clamp(2rem, 7vw, 5.2rem); }

  .portrait { --size: clamp(180px, 20vw, 240px); }
}

/* ------------------------------------------------------------
   Reduced motion — softer movement, never a snap
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html.is-ready .identity,
  html.is-ready .portrait,
  html.is-ready .bottom,
  html.is-ready .badge { animation: none; }

  html.is-ready .portrait__frame { animation: none; }

  .portrait__scan { display: none; }

  .portrait__float { animation: none; }

  html.is-ready .portrait__frame::before { animation: none; }

  .stage__lumen { display: none; }

  .name__l { animation: none !important; }

  .handle__copy.is-copied { animation: none; }

  /* The print's own life stays: the recorder light is brief and slow —
     and this box reports
     `reduce` whenever Windows animation effects are off, which would
     otherwise leave the page dead. Only the room's movement (aurora,
     lumen, float, scan, rim, rise, magnets, tilt) is dropped above. */

  /* A gentler camera move, but never a snap: the window still opens out
     and the curtain still fades. */
  .intro__veil { transition: transform 1.8s var(--ease-out); }

  .intro__hole--main { transition: stroke-width 1.8s var(--ease-out); }

  .intro.is-opening .intro__hole--main { stroke-width: 900; }
  .intro.is-opening .intro__veil { transform: scale(2.2); }
  .intro.is-opening { transition: opacity 1.5s var(--ease-out) 0.3s; }

  .badge {
    transition:
      border-color var(--dur-quick) var(--ease-out),
      background-color var(--dur-quick) var(--ease-out);
  }

  .badge:active { transform: translate3d(var(--bx, 0px), var(--by, 0px), 0); }
}
