/* Draggable handwritten notes — replaces the drum in the "What operations has
   meant lately" section. Notes scatter over the CTA; drag them off to reveal it.
   Behaviour: js/lately-notes.js */

.notes {
  --note-ink: #6b5f58;              /* site brown — handwriting */
  --note-blue: var(--color-accent-dark);
  --note-1: #fffdf6;
  --note-2: #eef5fd;
  --note-3: #f7f8d2;
  --note-4: #fdf1ec;
  --note-shadow: rgb(24 24 13 / 0.14);
  --note-tape: rgb(199 222 248 / 0.55);
}

/* The drum used to pull the heading down into itself; with the drum hidden,
   drop that offset and give the heading normal spacing above the notes. */
.lately .lately__heading {
  transform: none;
  margin-bottom: clamp(32px, 6vw, 56px);
}

/* Notes can fly past the sides on mobile; clip horizontally so they don't
   add a page scrollbar (vertical stays visible so they can slide off-screen). */
.lately { overflow-x: clip; }

.notes__hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  max-width: none;          /* override the site's p{max-width:65ch} so it truly centres */
  text-align: center;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--color-ink-light);
  margin: 0 0 24px;
}
.notes__hint-icon { width: 18px; height: 18px; flex: none; }

/* ---- the board ---- */
.notes__board {
  position: relative;
  width: 100%;
  max-width: 1100px;
  height: 580px;
  margin: 0 auto;
  touch-action: none;
}
@media (max-width: 560px) {
  .lately { overflow: clip; }                             /* notes can't paint over the section below */
  .notes__hint { display: none; }                         /* dragging hint isn't relevant on mobile */
  .notes__board { height: 440px; touch-action: auto; }    /* allow page scroll; scroll drives the scatter */
  .note {
    width: 150px; min-height: 120px; font-size: 18px; padding: 14px 14px 18px;
    touch-action: auto;
    transition: transform 0.12s ease-out, box-shadow 0.18s ease;  /* smooth the scroll scatter */
  }
  .note__scrawl { font-size: 14px; }
  .note__scrawl--alt { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  @media (max-width: 560px) { .note { transition: none; } }
}

/* The CTA sits behind the pile; drag notes off it to reveal the ask */
.notes__plate {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(92%, 440px);
  z-index: 1;
}
.notes__plate .lately__more { margin: 0; }

/* ---- a note ---- */
.note {
  position: absolute;
  width: 220px;
  min-height: 164px;
  padding: 20px 20px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--note-1);
  color: var(--note-ink);
  font-family: "Walter Turncoat", "Segoe Print", cursive;
  font-weight: 400;
  font-size: 22px;
  line-height: 1.1;
  border-radius: 2px;
  box-shadow: 0 1px 1px rgb(24 24 13 / 0.06),
              0 10px 22px -8px var(--note-shadow);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  transition: box-shadow 0.18s ease;
  will-change: transform;
  z-index: 5;
}
.note--left   { text-align: left;   align-items: flex-start; }
.note--center { text-align: center; align-items: center; }

.note:nth-of-type(4n+1) { background: var(--note-1); }
.note:nth-of-type(4n+2) { background: var(--note-2); }
.note:nth-of-type(4n+3) { background: var(--note-3); }
.note:nth-of-type(4n)   { background: var(--note-4); }

/* washi-tape strip */
.note::before {
  content: "";
  position: absolute;
  top: -9px; left: 50%;
  width: 68px; height: 20px;
  transform: translateX(-50%) rotate(-3deg);
  background: var(--note-tape);
  box-shadow: 0 1px 2px rgb(24 24 13 / 0.08);
}
.note:nth-of-type(even)::before { transform: translateX(-50%) rotate(2.5deg); left: 46%; }

.note.is-dragging {
  cursor: grabbing;
  box-shadow: 0 2px 2px rgb(24 24 13 / 0.08),
              0 26px 40px -12px var(--note-shadow);
}
.note:focus-visible { outline: 3px solid var(--note-blue); outline-offset: 3px; }

/* blue-ink scribbled annotation */
.note__scrawl {
  position: absolute;
  right: 10px; bottom: 6px;
  font-family: "Caveat", "Segoe Print", cursive;
  font-size: 17px;
  color: var(--note-blue);
  transform: rotate(-7deg);
  pointer-events: none;
}
/* a different hand (marker-style), for the "asap" note */
.note__scrawl--alt {
  font-family: "Gochi Hand", "Caveat", cursive;
  font-size: 20px;
  letter-spacing: 0.02em;
  transform: rotate(-11deg);
}

@media (prefers-reduced-motion: reduce) { .note { transition: none; } }
