@font-face {
  font-family: 'PP Neue Montreal';
  font-weight: 400;
  font-display: block;
  src: url('./assets/pp-neue-montreal-book.woff2') format('woff2');
}
@font-face {
  font-family: 'PP Neue Montreal';
  font-weight: 500;
  font-display: block;
  src: url('./assets/pp-neue-montreal-medium.woff2') format('woff2');
}
@font-face {
  font-family: 'PP Neue Montreal';
  font-weight: 700;
  font-display: block;
  src: url('./assets/pp-neue-montreal-bold.woff2') format('woff2');
}
@font-face {
  font-family: 'Cygnito Mono';
  font-weight: 400;
  font-display: block;
  src: url('./assets/cygnito-mono.woff2') format('woff2');
}

:root {
  --bg: #ededed;     /* Figma: Index */
  --rest: #acacac;   /* the coin tags at rest */
  --sans: 'PP Neue Montreal', ui-sans-serif, system-ui, sans-serif;
  --mono: 'Cygnito Mono', ui-monospace, monospace;
  /* Motion (Emil Kowalski's curves): strong ease-out for things responding,
     and a softer one for things that appear (the cards). */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-soft: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
}

.page {
  position: fixed;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.page.is-over { cursor: grab; }
.page.is-peeling, .page.is-peeling * { cursor: grabbing; }
/* Narrow screens: the stickers flow into columns and the page scrolls. */
.page.is-flow {
  overflow-x: hidden;
  overflow-y: auto;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

/* The Figma frame, in Figma px, scaled to the window by main.js. */
.board {
  position: absolute;
  left: 0;
  top: 0;
  width: 1728px;
  height: 1117px;
  transform-origin: 0 0;
}

/* Over the stickers: the peel layer (a sticker being peeled is drawn here,
   uncropped), then the cards' own layer. */
.peel-layer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}
.board.cards {
  z-index: 2;
  pointer-events: none;
}

/* ---- Stickers (the sticker prototype's die-cut look, drawn in main.js) ---- */

.sticker {
  position: absolute;
  /* left/top/width/height from main.js, in Figma px */
  transform: translateY(var(--rise, 0px)) rotate(var(--rot, 0deg)) scale(var(--lift, 1));
  transition:
    transform 200ms var(--ease-out),
    opacity 400ms var(--ease-out),
    filter 200ms var(--ease-out);
  pointer-events: none; /* main.js hit-tests the art itself */
}
/* Its card is open: it sits up a touch. */
.sticker.is-active { --lift: 1.02; transition-duration: 500ms, 500ms, 500ms; }
/* First load: the stickers rise in one after another (delays set in main.js). */
.sticker.is-entering { opacity: 0; --rise: 14px; --lift: 0.97; }
.board.is-ready .sticker { transition-duration: 200ms, 500ms, 200ms; }
.sticker canvas {
  position: absolute;
  pointer-events: none;
}

/* ---- Cards (Figma: Tooltip / …, 221×275) ---- */

.card {
  position: absolute;
  width: 221px;
  height: 275px;
  padding: 12px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 24px;
  color: var(--ink);
  pointer-events: none;
  /* On a small board the cards scale back up (main.js sets --cs), growing
     from their coin tag in the bottom-right corner. */
  transform: scale(var(--cs, 1));
  transform-origin: 100% 100%;
  z-index: 10000; /* above every sticker, however many times they're picked up */
}
.card__bg {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: var(--c);
}

/* The card opens out of its coin tag, softly: it fades in while growing a
   little (from 97%, anchored at the tag), and its content drifts in after it,
   out of a slight blur. Closing is a gentle fade, not a snap. */
.card__bg,
.card__top,
.card__meta,
.card__more,
.coin--open {
  opacity: 0;
  transition:
    opacity 260ms ease-out,
    transform 300ms ease-out,
    filter 260ms ease-out;
}
.card__bg {
  transform: scale(0.97);
  transform-origin: calc(100% - 26px) calc(100% - 22px); /* the coin tag */
}
.card__top,
.card__meta,
.card__more {
  transform: translateY(6px);
  filter: blur(4px);
}

.card.is-open { pointer-events: auto; z-index: 10001; }
.card.is-open .card__bg,
.card.is-open .card__top,
.card.is-open .card__meta,
.card.is-open .card__more,
.card.is-open .coin--open {
  opacity: 1;
  transform: none;
  filter: none;
  transition:
    opacity 480ms var(--ease-soft),
    transform 640ms var(--ease-soft),
    filter 520ms var(--ease-soft);
}
.card.is-open .coin--open { transition-delay: 60ms; }
.card.is-open .card__more { transition-delay: 120ms; }
.card.is-open .card__meta { transition-delay: 170ms; }
.card.is-open .card__top { transition-delay: 220ms; }
.card.is-open .coin--rest { opacity: 0; }

/* Moving straight from one card to the next: a quick, soft crossfade (no
   stagger) rather than the full entrance. */
.card.is-instant,
.card.is-instant * { transition-duration: 220ms !important; transition-delay: 0ms !important; }

.card__body {
  position: relative;
  z-index: 1;
  flex: 1 0 0;
  min-height: 1px;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.card__top { display: flex; flex-direction: column; gap: 4px; }
.card__title {
  margin: 0;
  font: 500 24px/normal var(--sans);
  letter-spacing: -0.48px;
}
.card__text {
  margin: 0;
  font: 400 10px/1.5 var(--sans);
}
.card__meta { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.card__row {
  display: flex;
  gap: 16px;
  align-items: center;
  font: 400 10px/1.5 var(--mono);
  text-transform: uppercase;
}
.card__row dt { width: 50px; flex: none; }
.card__row dd { margin: 0; flex: 1 0 0; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px; }
/* (the category row: its tags wrap onto the next line, label at the top) */
.card__row:has(.chip) { align-items: flex-start; }
.chip {
  padding: 0 2px;
  background: var(--ink);
  color: var(--c);
  font-size: 8px;
  line-height: 1.5;
  max-width: 100%;
  overflow-wrap: anywhere; /* (one longer than the whole row breaks inside) */
}

.card__foot {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}
.card__more {
  padding: 0 2px;
  background: var(--ink);
  color: var(--c);
  font: 400 10px/1.5 var(--mono);
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

/* The SN.S coin tag: two tilted coins, one letter each. Grey at rest (always
   showing), the card's ink when open. */
.coin {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 37px;
  height: 24px;
  pointer-events: auto;
}
/* Figma (SN.S Coin Tag / rest): the two rings sit 7.5px in and 7.3px down,
   at their own size — not stretched over the tag. */
.coin img {
  position: absolute;
  left: 7.5px;
  top: 7.3px;
  width: 29.88px;
  height: 16.7px;
}
/* Each letter centred in its ring's face (Figma: 12.38×13.8 at 9.15/24.15, 9). */
.coin--rest { transition: opacity 300ms ease-out; }
.coin span {
  position: absolute;
  top: 9px;
  width: 12.38px;
  height: 13.8px;
  display: grid;
  place-items: center;
  font: 700 10.05px/1 var(--sans);
}
.coin span:nth-of-type(1) { left: 9.15px; }
.coin span:nth-of-type(2) { left: 24.15px; }
/* Open: the coins with their tubes fill the tag (24px tall, as the
   component's 96px scaled to K 0.25); their rings land where the rest rings
   are. The tubes slide out from behind the rings, up and to the left. */
.coin--open img {
  left: 0;
  top: 0;
  width: 37.38px;
  height: 24px;
  clip-path: inset(30.4% 0 0 20%);
  transition: clip-path 240ms ease-out;
}
.card.is-open .coin--open img {
  clip-path: inset(0 0 0 0);
  transition: clip-path 560ms var(--ease-soft) 120ms;
}
.coin--rest span { color: var(--rest); }
.coin--open span { color: var(--ink); }

/* Reduced motion: fades only, nothing moves, scales or wipes. */
@media (prefers-reduced-motion: reduce) {
  .sticker { --lift: 1 !important; --rise: 0px !important; }
  .card__top, .card__meta, .card__more { transform: none !important; filter: none !important; }
  .card__bg { transform: none !important; }
}
