/* Handed to Claude (learn/handed-to-claude/): the whiteboard, the post-it notes and the marker.
   Page parts (hero, headings, pills, chips, cards) use the site's own components; only the board
   and what's drawn on it are hand-made. Rules and what's been rejected:
   .claude/skills/handed-to-claude/references/look-and-feel.md. Everything sits under .htc. */

.htc {
  /* Post-its: the site's green and pink only */
  --htc-green: #9be8bf;
  --htc-green-2: #b9f0d1;
  --htc-pink: #f7b6f8;
  --htc-pink-2: #fbcdfb;
  /* Pens */
  --htc-sharpie: #1c1f24;
  --htc-biro: #2a3c9c;
  --htc-ink: #1c1f24;
  --htc-m-green: #0d7342;
  --htc-m-pink: #a4259f;
  --htc-red: #c8312b;
  --htc-stamp: #cf2318;
  /* The whiteboard stays light in both themes: it's a physical thing */
  --htc-board: #f3f5f4;
  --htc-board-edge: #c9cfcd;
  --htc-shadow: rgba(0, 0, 0, 0.45);
  --htc-hand: "Gochi Hand", "Comic Sans MS", cursive;
  --htc-scrawl: "Nanum Pen Script", "Gochi Hand", cursive;
  --htc-stamp-font: "Anton", Impact, sans-serif;
}

[data-theme="light"] .htc {
  --htc-board: #fdfefd;
  --htc-board-edge: #d5dbd9;
  --htc-shadow: rgba(30, 40, 40, 0.25);
}

/* ---- Overview (expanding) ---- */
.htc-about {
  max-width: 760px;
  margin: 0 auto 2.5rem;
  border: 1px solid var(--image-border-color);
  background: var(--card);
  border-radius: 20px;
}

.htc-about summary {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  font-weight: 700;
  color: var(--title-color);
  cursor: pointer;
  list-style: none;
  border-radius: 20px;
}

.htc-about summary::-webkit-details-marker { display: none; }

/* A drawn plus, dead centre in its circle; turns into a cross when open */
.htc-plus {
  position: relative;
  flex: none;
  width: 28px;
  height: 28px;
  border: 1px solid var(--image-border-color);
  border-radius: 50%;
  transition: transform 0.2s;
}

.htc-plus::before,
.htc-plus::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 2px;
  margin: -1px 0 0 -6px;
  border-radius: 2px;
  background: var(--title-color);
}

.htc-plus::after { transform: rotate(90deg); }
.htc-about[open] .htc-plus { transform: rotate(45deg); }
.htc-about-body { padding: 0 22px 20px; }
.htc-about-body p { margin: 0 0 12px; }

/* ---- Filter chips: the most used show, the rest bubble out of "+N more" ---- */
.htc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.htc-chips .chip { position: relative; }
.htc-more { border-style: dashed; }
.htc-chips .chip.htc-pop { animation: htc-chippop 0.5s cubic-bezier(0.3, 1.7, 0.5, 1) both; animation-delay: calc(var(--i, 0) * 70ms); }

.htc-chips .chip.htc-pop::after {
  content: "";
  position: absolute;
  inset: -3px;
  border: 2px solid var(--secondary-color);
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  animation: htc-burst 0.55s ease-out both;
  animation-delay: calc(var(--i, 0) * 70ms + 120ms);
}

@keyframes htc-chippop {
  0% { transform: scale(0); opacity: 0; }
  55% { transform: scale(1.18); opacity: 1; }
  80% { transform: scale(0.94); }
  100% { transform: scale(1); }
}

@keyframes htc-burst {
  0% { opacity: 0.9; transform: scale(0.9); }
  100% { opacity: 0; transform: scale(1.45); }
}

/* ---- The whiteboard ---- */
.htc-board {
  position: relative;
  overflow: hidden;
  border: 10px solid var(--htc-board-edge);
  border-radius: 14px;
  background:
    linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.7) 45%, transparent 60%),
    radial-gradient(ellipse 40% 8% at 70% 22%, rgba(0, 0, 0, 0.035), transparent),
    radial-gradient(ellipse 30% 6% at 25% 80%, rgba(0, 0, 0, 0.03), transparent),
    var(--htc-board);
  box-shadow: 0 24px 50px -20px var(--htc-shadow), inset 0 0 0 1px rgba(0, 0, 0, 0.06);
  color: var(--htc-ink);
}

.htc-scatter { position: relative; height: 700px; }

.htc-sk {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  height: auto;
  overflow: visible;
  opacity: 0.78;
  pointer-events: none;
}

.htc-sk text { font-family: var(--htc-hand); }
.htc-sk-smudge { mask-image: linear-gradient(120deg, #000 55%, rgba(0, 0, 0, 0.25) 80%, #000 95%); }

.htc-scrawl {
  position: absolute;
  font: 400 24px/1 var(--htc-hand);
  color: var(--htc-m-pink);
  pointer-events: none;
}

/* ---- Post-its ---- */
.htc-note {
  position: relative;
  display: block;
  aspect-ratio: 1;
  color: var(--htc-sharpie);
  text-decoration: none;
  transform: rotate(var(--r, 0deg));
  transition: transform 0.2s ease, opacity 0.25s;
}

/* Stuck along the top, lifting at the bottom */
.htc-note::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 6%;
  right: 4%;
  bottom: 2px;
  height: 40%;
  background: var(--htc-shadow);
  filter: blur(9px);
  opacity: 0.8;
  transform: skewY(2deg) translateY(6px);
  transition: transform 0.2s, filter 0.2s, opacity 0.2s;
}

.htc-note-board {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 212px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
}

.htc-note-board:hover,
.htc-note-board:focus-visible { transform: rotate(calc(var(--r) * 0.4)) translateY(-6px); }
.htc-note-board:hover::before { transform: skewY(2deg) translateY(14px); filter: blur(13px); }
.htc-note-board:focus-visible { outline: 3px solid var(--primary-color); outline-offset: 4px; }

.htc-note-board.is-dragging {
  z-index: 60 !important;
  cursor: grabbing;
  transform: rotate(calc(var(--r) * 0.3)) scale(1.06);
  transition: none;
}

.htc-note-board.is-dragging::before { transform: translateY(20px); filter: blur(16px); opacity: 0.6; }
.htc-note-board.is-dim { opacity: 0.22; }

/* Worn paper: grain, glue-strip shading, lift at the bottom, a faint blotch, rough edges */
.htc-paper {
  position: absolute;
  inset: 0;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.07), rgba(0, 0, 0, 0) 15%),
    linear-gradient(to top, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0) 22%),
    radial-gradient(ellipse at 88% 92%, rgba(255, 255, 255, 0.35), transparent 30%),
    radial-gradient(circle at var(--sx, 20%) var(--sy, 70%), rgba(120, 90, 30, 0.08), transparent 22%),
    var(--c);
  filter: url(#htc-worn);
}

.htc-paper[data-fold] { clip-path: polygon(0 0, 100% 0, 100% calc(100% - 26px), calc(100% - 26px) 100%, 0 100%); }

/* Folded corner */
.htc-ear {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 26px;
  height: 26px;
  background: linear-gradient(315deg, transparent 48%, color-mix(in srgb, var(--c) 70%, #fff) 50%, color-mix(in srgb, var(--c) 85%, #000) 100%);
  box-shadow: -2px -2px 4px rgba(0, 0, 0, 0.12);
  filter: url(#htc-worn);
}

.htc-ink {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 22px 18px 16px;
  text-align: left;
}

/* Coffee ring: only ever on the paper, clipped by .htc-ink */
.htc-ring {
  position: absolute;
  right: -12px;
  top: -16px;
  width: 92px;
  height: 92px;
  border: 5px solid rgba(110, 70, 30, 0.22);
  border-left-color: rgba(110, 70, 30, 0.08);
  border-radius: 50%;
  filter: url(#htc-worn);
  pointer-events: none;
}

.htc-t { position: relative; font: 400 29px/1 var(--htc-hand); letter-spacing: -0.01em; }
.htc-s { position: relative; margin-top: 8px; font: 400 25px/0.95 var(--htc-scrawl); color: var(--htc-biro); }
.htc-ul { display: block; width: 80%; height: 10px; margin-top: 2px; overflow: visible; }

/* The pen running dry, then the loop where it gets going again */
.htc-dry { color: transparent; background-clip: text; -webkit-background-clip: text; }
.htc-t .htc-dry { background-image: linear-gradient(90deg, #1c1f24 0%, rgba(28, 31, 36, 0.6) 40%, rgba(28, 31, 36, 0.18) 85%, rgba(28, 31, 36, 0.08)); }
.htc-s .htc-dry { background-image: linear-gradient(90deg, #2a3c9c 0%, rgba(42, 60, 156, 0.55) 35%, rgba(42, 60, 156, 0.14) 80%, rgba(42, 60, 156, 0.06)); }
.htc-coil { display: inline-block; width: 30px; height: 14px; margin: 0 3px 0 1px; vertical-align: -1px; }
.htc-restart { position: absolute; left: 14px; bottom: 12px; width: 66px; height: 30px; }
.htc-doodle { position: absolute; right: 34px; bottom: 16px; width: 34px; height: 31px; opacity: 0.85; }

.htc-v {
  position: absolute;
  right: 12px;
  top: 10px;
  padding: 3px 6px;
  border: 1.5px solid var(--htc-biro);
  border-radius: 50%;
  font: 400 22px/1 var(--htc-scrawl);
  color: var(--htc-biro);
  opacity: 0.8;
  transform: rotate(8deg);
}

/* Retired: faded paper and a red rubber stamp that didn't press evenly */
.htc-note.is-retired .htc-paper { filter: url(#htc-worn) saturate(0.55) brightness(1.03); }
.htc-note.is-retired .htc-ink { opacity: 0.7; }

.htc-stamp {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 86%;
  height: auto;
  color: var(--htc-stamp);
  opacity: 0.9;
  mix-blend-mode: multiply;
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(-16deg);
  mask-image: linear-gradient(100deg, #000 55%, rgba(0, 0, 0, 0.35) 92%);
}

.htc-stamp text { font-family: var(--htc-stamp-font); }

/* ---- A note's page ---- */
.htc-hero-left { text-align: left; }

.htc-retired-note {
  max-width: 62ch;
  margin: 20px 0 0;
  padding: 12px 16px;
  border: 1px solid rgba(248, 39, 0, 0.45);
  border-radius: 12px;
  background: rgba(248, 39, 0, 0.08);
}

.htc-retired-note strong { color: var(--title-color); }

.htc-wb {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: 32px 48px;
  align-items: start;
  padding: 40px 36px 44px;
}

.htc-note-big { width: 250px; max-width: 100%; animation: htc-stick 0.55s cubic-bezier(0.2, 1.3, 0.4, 1); }
.htc-note-big .htc-t { font-size: 34px; }
.htc-note-big .htc-s { font-size: 28px; }

@keyframes htc-stick {
  from { transform: rotate(-12deg) translate(-30px, -40px) scale(1.15); opacity: 0; }
  to { transform: rotate(var(--r)); }
}

.htc-blk { margin: 0 0 30px; }
.htc-blk:last-child { margin-bottom: 0; }

.htc-mk-h {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin: 0 0 6px;
  font: 400 26px/1 var(--htc-hand);
  letter-spacing: 0;
  color: var(--htc-m-pink);
}

.htc-mk-h::before { content: "//"; color: var(--htc-m-green); }

.htc-diagram { margin-top: 6px; overflow-x: auto; }
.htc-diagram svg { display: block; width: 100%; min-width: 600px; height: auto; }
.htc-dg-word { font: 400 25px var(--htc-hand); }
.htc-dg-note { font: 400 20px var(--htc-scrawl); }

.htc-bubble { position: relative; max-width: 58ch; margin: 0; padding: 16px 30px 24px; font: 400 23px/1.25 var(--htc-hand); color: var(--htc-m-green); }
.htc-bubble svg { position: absolute; inset: -4px; width: calc(100% + 8px); height: calc(100% + 18px); overflow: visible; pointer-events: none; }
.htc-bubble path { stroke-width: 2.8px; }

.htc-was-wrap { max-width: 58ch; margin: 0 0 10px; }
.htc-was { font: 400 21px/1.25 var(--htc-hand); color: var(--htc-ink); opacity: 0.6; text-decoration-color: var(--htc-red); text-decoration-thickness: 3px; }
.htc-when { margin-left: 6px; font: 400 20px var(--htc-scrawl); color: var(--htc-biro); }

.htc-ba { display: flex; flex-wrap: wrap; gap: 20px 40px; align-items: center; }
.htc-ba small { display: block; font: 400 22px/1 var(--htc-scrawl); color: var(--htc-biro); }
.htc-v-old, .htc-v-new { font: 400 44px/1 var(--htc-hand); }
.htc-v-old del { text-decoration-color: var(--htc-red); text-decoration-thickness: 4px; }
.htc-v-new { color: var(--htc-m-green); }
.htc-ba-arrow { font: 400 36px var(--htc-hand); }

.htc-watch, .htc-changes { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font: 400 22px/1.2 var(--htc-hand); }
.htc-watch li { display: flex; gap: 10px; }
.htc-watch li::before { content: "!"; color: var(--htc-red); font-size: 26px; line-height: 0.9; }
.htc-when-tag { display: inline-block; margin-right: 8px; padding: 0 6px; border-radius: 4px; background: var(--htc-m-pink); color: #fff; font: 400 20px var(--htc-scrawl); transform: rotate(-2deg); }

.htc-use { display: flex; flex-direction: column; gap: 8px; padding: 22px 24px; }
.htc-use del { text-decoration-color: var(--red); }
.htc-now { margin: 0; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--secondary-color); }

.htc-minis { display: flex; flex-wrap: wrap; gap: 22px; margin: 0; padding: 0; list-style: none; }
.htc-note-mini { width: 130px; }
.htc-note-mini .htc-ink { padding: 14px 12px; }
.htc-note-mini .htc-t { font-size: 20px; }
.htc-note-mini:hover, .htc-note-mini:focus-visible { transform: rotate(0) translateY(-5px); }
.htc-note-mini:focus-visible { outline: 3px solid var(--primary-color); outline-offset: 4px; }

/* ---- Phones ---- */
@media (max-width: 760px) {
  .htc-scatter { height: 1000px; }
  .htc-note-board { left: var(--mx); top: var(--my); width: 150px; }
  .htc-ink { padding: 16px 12px 12px; }
  .htc-t { font-size: 22px; }
  .htc-s { font-size: 18px; }
  .htc-doodle { right: 12px; bottom: 10px; width: 26px; height: 24px; }
  .htc-restart { left: 10px; bottom: 8px; width: 44px; height: 20px; }
  .htc-v, .htc-hide-m { display: none; }
  .htc-sk { display: none; }
  .htc-sk-m { display: block; left: var(--mx); top: var(--my); width: var(--mw, var(--w)); }
  .htc-board { border-width: 6px; }
  .htc-wb { grid-template-columns: minmax(0, 1fr); padding: 28px 18px 30px; }
  .htc-note-big { margin: 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
  .htc-note, .htc-note::before, .htc-plus { transition: none; }
  .htc-note-big, .htc-chips .chip.htc-pop, .htc-chips .chip.htc-pop::after { animation: none; }
}
