/* The board of sticky notes that swing from their top edge and fly away: a board in Tackwell, a made up whiteboard
   for teams, on a warm grey page. A soft white board with a 1px edge, layered shadows and a faint grid; sticky notes
   in five soft paper colours, each with the darker band of its glue, a little grain and a shadow that grows when it is
   lifted. The one accent of the app is ink blue, for the hint and for the selection of your own notes. */
:root {
  --page: #efede8;             /* the page around the board */
  --board: #fbfaf7;            /* the board */
  --grid: rgba(30, 32, 44, 0.045); /* the faint grid on the board */
  --ink: #1b1c22;              /* the words */
  --muted: #8a8890;            /* the small words */
  --edge: rgba(28, 28, 40, 0.08); /* the 1px edges */
  --accent: #3d5bd9;           /* the app's one accent: ink blue */
  --butter: #f7ecb0;           /* the sticky note colours, soft paper */
  --blush: #f5d8d1;
  --mint: #d3eadb;
  --sky: #d5e2f3;
  --lilac: #e2daf2;
  --peach: #f7dcc4;
  --mira: #7a62d8;             /* Mira's cursor */
  --jon: #2f8f7a;              /* Jon's cursor */
  --note: clamp(76px, min(23vw, 21vh), 140px); /* how big a note is */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

.stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 12px;
  overflow: hidden;
  background:
    radial-gradient(90% 70% at 50% 40%, rgba(255, 255, 255, 0.55), transparent 70%),
    var(--page);
}

/* ---------------------------------------------------------------- the board */
.board {
  position: relative;
  width: min(820px, 93vw);
  height: min(540px, 88vh);
  border-radius: 22px;
  background: var(--board);
  box-shadow:
    inset 0 0 0 1px var(--edge),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 1px 1px rgba(20, 20, 30, 0.04),
    0 6px 14px -6px rgba(20, 20, 30, 0.08),
    0 28px 56px -24px rgba(30, 30, 50, 0.2),
    0 70px 100px -60px rgba(30, 30, 50, 0.22);
  opacity: 0;
}

.board__head {
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  height: clamp(44px, 12vh, 58px);
  padding: 0 clamp(12px, 3.4vw, 20px);
  border-bottom: 1px solid var(--edge);
  border-radius: 22px 22px 0 0;
  background: linear-gradient(180deg, #fff, var(--board));
  pointer-events: none;
}

.board__mark {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #5d78ef, var(--accent) 60%, #2e47b8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15),
    0 5px 12px -6px rgba(50, 70, 200, 0.6);
}

.board__mark svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.board__mark rect {
  fill: rgba(255, 255, 255, 0.92);
  stroke: none;
}

.board__titles {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.board__name {
  font-size: clamp(13px, 3.6vw, 15px);
  font-weight: 620;
  font-variation-settings: 'wdth' 96;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.board__meta {
  font-size: 11px;
  color: var(--muted);
  font-weight: 480;
  white-space: nowrap;
}

.board__people {
  margin-left: auto;
  display: flex;
  flex: none;
}

.face {
  display: grid;
  place-items: center;
  min-width: 27px;
  height: 27px;
  padding: 0 6px;
  border-radius: 14px;
  margin-left: -4px;
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: #fff;
  box-shadow: 0 0 0 2px var(--board);
}

.face--mira {
  background: linear-gradient(160deg, #957ff0, var(--mira));
}

.face--jon {
  background: linear-gradient(160deg, #45ab93, var(--jon));
}

.face--you {
  background: #e9e7e1;
  color: #55545c;
  font-weight: 600;
}

.board__field {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: -1px -1px;
}

.board__hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: clamp(8px, 2.4vh, 14px);
  margin: 0;
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  pointer-events: none;
  opacity: 0;
}

/* ---------------------------------------------------------------- a note */
.note {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--note);
  height: var(--note);
  z-index: 3;
  cursor: grab;
  outline: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  --lift: 0;
}

.note.is-held {
  cursor: grabbing;
}

.note__body {
  position: absolute;
  inset: 0;
  transform-origin: 50% 0;
}

.note__shadow {
  position: absolute;
  inset: 2px 3px 0;
  border-radius: 3px 3px 10px 8px;
  box-shadow:
    0 calc(1px + var(--lift) * 16px) calc(2px + var(--lift) * 26px) calc(var(--lift) * -2px) rgba(40, 34, 20, calc(0.16 + var(--lift) * 0.02)),
    0 calc(var(--lift) * 34px) calc(var(--lift) * 46px) calc(var(--lift) * -16px) rgba(40, 34, 20, calc(var(--lift) * 0.22));
}

.note__paper {
  position: absolute;
  inset: 0;
  border-radius: 2px 2px 4px 3px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.045) 0, rgba(0, 0, 0, 0.045) 18%, rgba(255, 255, 255, 0.18) 18.6%, transparent 30%),
    linear-gradient(165deg, rgba(255, 255, 255, 0.34), transparent 45%),
    var(--c);
  box-shadow:
    inset 0 0 0 0.5px rgba(60, 50, 20, 0.08),
    inset 0 -1px 0 rgba(60, 50, 20, 0.05);
  padding: calc(var(--note) * 0.25) calc(var(--note) * 0.11) 0;
}

/* the bottom curls away a little when lifted: a soft shade that grows with the lift */
.note__paper::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(0deg, rgba(60, 46, 10, 0.1), transparent 34%),
    radial-gradient(60% 40% at 100% 100%, rgba(60, 46, 10, 0.1), transparent 70%);
  opacity: calc(0.25 + var(--lift) * 0.75);
}

/* a whisper of grain on the paper */
.note__paper::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .4 0 0 0 0 .3 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='90' height='90' filter='url(%23n)'/%3E%3C/svg%3E");
}

.note__text {
  position: relative;
  margin: 0;
  font-size: calc(var(--note) * 0.128);
  line-height: 1.22;
  font-weight: 560;
  font-variation-settings: 'wdth' 92;
  letter-spacing: -0.012em;
  color: rgba(30, 28, 24, 0.88);
}

.note__by {
  position: absolute;
  right: calc(var(--note) * 0.1);
  bottom: calc(var(--note) * 0.08);
  font-size: calc(var(--note) * 0.082);
  font-weight: 620;
  letter-spacing: 0.04em;
  color: rgba(30, 28, 24, 0.42);
}

/* the selection ring when someone holds the note, in that person's colour */
.note__ring {
  position: absolute;
  inset: -3px;
  border-radius: 5px;
  box-shadow: 0 0 0 1.5px var(--ring, var(--accent));
  opacity: 0;
  pointer-events: none;
}

.note:focus-visible .note__ring {
  opacity: 1;
}

/* ---------------------------------------------------------------- the cursors of other people */
.cursor {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 100000;
  pointer-events: none;
  opacity: 0;
}

.cursor__arrow {
  display: block;
  width: 18px;
  height: 20px;
  transform-origin: 3px 2px;
  filter: drop-shadow(0 1.5px 2px rgba(20, 20, 30, 0.22));
}

.cursor__arrow path {
  fill: var(--who);
  stroke: #fff;
  stroke-width: 1.4;
  stroke-linejoin: round;
}

.cursor__tag {
  position: absolute;
  left: 15px;
  top: 17px;
  padding: 3px 7px 3px;
  border-radius: 8px 8px 8px 3px;
  background: var(--who);
  color: #fff;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.03em;
  white-space: nowrap;
  box-shadow: 0 4px 10px -4px rgba(20, 20, 30, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.cursor--mira {
  --who: var(--mira);
}

.cursor--jon {
  --who: var(--jon);
}
