/* ============================================================
   Creative mode: "Susan's desk"
   Paper, tape, polaroids, quest cards, sticky notes, a postcard,
   and a page you can doodle on.
   ============================================================ */

:root {
  --paper: #f7f0e4;
  --paper-2: #efe4d2;
  --white: #fffdf9;
  --kraft: #c9a97c;
  --kraft-2: #b08a5c;
  --wood: #5a3d29;
  --ink: #1c1712;
  --soft: #5c534a;
  --mute: #8a7e72;
  --line: rgba(28, 23, 18, 0.14);
  --rust: #c45c26;
  --note-y: #ffe27a;
  --note-p: #ffbfcb;
  --note-b: #bfdcff;
  --note-g: #cdebb6;
  --hand: 'Caveat', 'Segoe Script', cursive;
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Outfit', sans-serif;
  --w: 1080px;
  --pad: clamp(1.2rem, 4.5vw, 2.2rem);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 10px 24px rgba(28, 23, 18, 0.14), 0 2px 6px rgba(28, 23, 18, 0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.6rem;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(rgba(28, 23, 18, 0.14) 1px, transparent 1.3px);
  background-size: 22px 22px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  transition: opacity 0.22s ease;
}

body.mode-leave { opacity: 0; }

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  opacity: 0.16;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; background: none; border: 0; cursor: pointer; color: inherit; }
address { font-style: normal; }

.wrap {
  width: min(100% - var(--pad) * 2, var(--w));
  margin-inline: auto;
}

.hand {
  font-family: var(--hand);
  font-weight: 500;
}

.skip-link {
  position: absolute;
  left: 0.9rem;
  top: -4.5rem;
  z-index: 100;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font-size: 0.88rem;
  font-weight: 650;
}

.skip-link:focus { top: 0.75rem; }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 3px;
}

/* Reveal. Entrances animate the individual translate/rotate/scale
   properties with backwards fill, so each element's own transform
   (tilt, hover lift) keeps working once it has landed. */
.js .reveal:not(.in) { opacity: 0; }

.js .reveal.in {
  animation: up 0.8s var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 90ms);
}

@keyframes up {
  from { opacity: 0; translate: 0 22px; }
}

/* ------------------------------------------------------------
   Doodle canvas
   ------------------------------------------------------------ */
.doodle {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 30;
  pointer-events: none;
  touch-action: none;
}

body.is-drawing .doodle {
  pointer-events: auto;
  cursor: crosshair;
}

body.is-drawing main,
body.is-drawing footer { user-select: none; }

/* ------------------------------------------------------------
   Header
   ------------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(247, 240, 228, 0.78);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  background: rgba(255, 253, 249, 0.9);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  height: 4.4rem;
  width: min(100% - var(--pad) * 2, var(--w));
  margin-inline: auto;
}

.logo {
  font-family: var(--hand);
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
}

.logo em { font-style: normal; color: var(--rust); }

/* Play button */
.nav-links > .nav-play {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: 0.4rem;
  padding: 0.45rem 0.95rem 0.45rem 0.8rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--rust);
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.nav-links > .nav-play::after { display: none; }

.nav-links > .nav-play svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.nav-links > .nav-play:hover {
  color: var(--white);
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--rust);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.3rem;
  margin-left: auto;
  order: 1;
}

.nav-links > a {
  font-family: var(--hand);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--soft);
  position: relative;
}

.nav-links > a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 6px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 6'%3E%3Cpath d='M0 3 Q 5 0, 10 3 T 20 3 T 30 3 T 40 3' fill='none' stroke='%23c45c26' stroke-width='1.6'/%3E%3C/svg%3E") repeat-x;
  background-size: 20px 6px;
  opacity: 0;
  transition: opacity 0.2s;
}

.nav-links > a:hover { color: var(--ink); }
.nav-links > a:hover::after { opacity: 1; }

.nav-toggle {
  order: 3;
  margin-left: 0.5rem;
  display: none;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--white);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 14px;
  height: 1.5px;
  background: var(--ink);
  transition: 0.25s var(--ease);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ------------------------------------------------------------
   Type and buttons
   ------------------------------------------------------------ */
.tag {
  font-size: 1.2rem;
  color: var(--rust);
  line-height: 1.2;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid var(--ink);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.2s, color 0.2s;
}

.btn-ink {
  background: var(--ink);
  color: var(--white);
  box-shadow: 4px 4px 0 var(--rust);
}

.btn-ink:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--rust);
}

.btn-paper {
  background: var(--white);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

.btn-paper:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}

/* ------------------------------------------------------------
   Hero: the desk
   ------------------------------------------------------------ */
.desk { padding: clamp(2rem, 6vw, 4.5rem) 0 clamp(1.5rem, 4vw, 2.5rem); }

.desk-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hand-kicker {
  font-size: 1.45rem;
  color: var(--rust);
  transform: rotate(-1.5deg);
  display: inline-block;
}

.desk-name {
  font-family: var(--hand);
  font-weight: 700;
  font-size: clamp(3.2rem, 8vw, 5.4rem);
  line-height: 0.95;
  margin: 0.4rem 0 0.9rem;
  letter-spacing: -0.01em;
}

.desk-name .hl {
  position: relative;
  display: inline-block;
}

.desk-name .hl::after {
  content: '';
  position: absolute;
  left: -2%;
  right: -2%;
  bottom: 0.08em;
  height: 0.32em;
  background: var(--note-y);
  z-index: -1;
  transform: rotate(-1.2deg);
  border-radius: 3px;
}

.desk-display {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3.6vw, 2.5rem);
  line-height: 1.15;
  margin-bottom: 1.1rem;
}

.desk-display em {
  font-style: italic;
  color: var(--rust);
}

.desk-lead {
  color: var(--soft);
  max-width: 30rem;
  margin-bottom: 1.5rem;
}

.desk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1.4rem;
}

.hand-hint {
  font-size: 1.3rem;
  color: var(--soft);
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  max-width: 24rem;
  line-height: 1.15;
}

.arrow {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.arrow-hint {
  width: 52px;
  height: 26px;
  flex-shrink: 0;
  transform: scaleY(-1) rotate(10deg);
  margin-top: 0.1rem;
}

/* The pile of stuff on the right */
.desk-pile {
  position: relative;
  min-height: 420px;
  padding: 1.2rem 0 3rem;
}

.polaroid {
  display: block;
  background: var(--white);
  padding: 0.7rem 0.7rem 0.9rem;
  box-shadow: var(--shadow);
  position: relative;
  transform: rotate(var(--r, 0deg));
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.polaroid::before {
  content: '';
  position: absolute;
  top: -11px;
  left: 50%;
  width: 88px;
  height: 24px;
  background: var(--tape, rgba(255, 226, 122, 0.85));
  opacity: 0.85;
  transform: translateX(-50%) rotate(-3deg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  z-index: 2;
}

.polaroid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--paper-2);
}

.polaroid figcaption,
.polaroid .cap {
  font-family: var(--hand);
  font-size: 1.35rem;
  line-height: 1.15;
  margin-top: 0.65rem;
  display: block;
}

.cap-short { display: none; }
.swipe-hint { display: none; }

.polaroid .cap-sub {
  display: block;
  font-size: 0.85rem;
  color: var(--soft);
  line-height: 1.35;
  margin-top: 0.15rem;
}

a.polaroid:hover {
  transform: rotate(0deg) translateY(-6px) scale(1.02);
  box-shadow: 0 18px 34px rgba(28, 23, 18, 0.2), 0 4px 8px rgba(28, 23, 18, 0.08);
}

.polaroid-hero {
  width: min(100%, 400px);
  margin-left: auto;
  margin-right: 2.5rem;
  transform: rotate(var(--r, 0deg)) rotateX(var(--ty, 0deg)) rotateY(var(--tx, 0deg));
  transition: transform 0.18s linear;
  will-change: transform;
}

.desk-pile { perspective: 900px; }

.polaroid-hero img { aspect-ratio: 4 / 3; }

/* Sticky notes (generic) */
.stick {
  position: absolute;
  width: 150px;
  padding: 0.7rem 0.8rem 0.8rem;
  background: var(--note-y);
  box-shadow: 2px 6px 14px rgba(28, 23, 18, 0.18);
  transform: translate(var(--dx, 0px), var(--dy, 0px)) rotate(var(--r, 0deg));
  cursor: grab;
  touch-action: none;
  user-select: none;
  z-index: 3;
  transition: box-shadow 0.2s;
}

.stick::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, transparent 50%, rgba(0, 0, 0, 0.08) 50%);
}

.stick-y { background: var(--note-y); }
.stick-p { background: var(--note-p); }

.stick-title {
  font-size: 1.15rem;
  color: var(--soft);
  line-height: 1;
}

.clock {
  font-family: var(--serif);
  font-size: 2.2rem;
  line-height: 1.05;
  margin: 0.15rem 0;
  font-variant-numeric: tabular-nums;
}

.stick-sub {
  font-size: 1.1rem;
  line-height: 1.1;
}

.stick-clock { left: -2%; top: 4%; }
.stick-todo { right: -4%; bottom: -2%; width: 140px; }

.todo {
  font-size: 1.25rem;
  line-height: 1.25;
  margin-top: 0.1rem;
}

.todo li { padding-left: 1.4rem; position: relative; }

.todo li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.35rem;
  width: 0.85rem;
  height: 0.85rem;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
}

.todo-btn {
  font: inherit;
  text-align: left;
  padding: 0;
  color: inherit;
  line-height: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

.todo-btn:hover { color: var(--rust); }
.todo li.done .todo-btn { text-decoration: line-through; color: var(--soft); }

.todo li.done::after {
  content: '';
  position: absolute;
  left: 0.22rem;
  top: 0.12rem;
  width: 0.4rem;
  height: 0.75rem;
  border-right: 2px solid var(--rust);
  border-bottom: 2px solid var(--rust);
  transform: rotate(40deg);
}

.stick.is-dragging,
.fox.is-dragging {
  cursor: grabbing;
  z-index: 10;
  box-shadow: 6px 14px 26px rgba(28, 23, 18, 0.26);
}

/* Fox sticker */
.fox {
  position: absolute;
  left: 2%;
  bottom: -6%;
  width: 150px;
  transform: translate(var(--dx, 0px), var(--dy, 0px)) rotate(var(--r, 0deg));
  cursor: grab;
  touch-action: none;
  user-select: none;
  z-index: 4;
  filter: drop-shadow(0 8px 12px rgba(28, 23, 18, 0.22));
}

.fox img {
  border-radius: 22px;
  border: 4px solid var(--white);
  box-shadow: 0 0 0 1px var(--line);
}

.fox-tag {
  position: absolute;
  right: -1.6rem;
  top: -0.6rem;
  background: var(--white);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 0.05rem 0.55rem;
  font-size: 1rem;
  transform: rotate(8deg);
}

.stats {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: clamp(1.5rem, 4vw, 2.8rem);
  padding-top: 1rem;
  border-top: 2px dashed var(--line);
  font-size: 1.35rem;
  color: var(--soft);
}

.stats b {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.8rem;
  color: var(--ink);
  margin-right: 0.3rem;
}

/* ------------------------------------------------------------
   Sections
   ------------------------------------------------------------ */
.section { padding: clamp(3.5rem, 8vw, 5.5rem) 0; }
.section-last { padding-bottom: clamp(4rem, 9vw, 6rem); }

.sec-head { max-width: 34rem; margin-bottom: 2.4rem; }

.sec-head h2 {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  line-height: 1.05;
  margin: 0.2rem 0 0.7rem;
  position: relative;
  display: inline-block;
}

.squiggle {
  position: absolute;
  left: 0;
  width: 0;
  bottom: -0.35rem;
  height: 10px;
  transition: width 0.9s var(--ease) 0.25s;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 10'%3E%3Cpath d='M0 5 Q 5 0, 10 5 T 20 5 T 30 5 T 40 5' fill='none' stroke='%23c45c26' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x;
  background-size: 24px 10px;
  opacity: 0.9;
}

.sec-head.in .squiggle,
html:not(.js) .squiggle { width: calc(100% + 0.4rem); }

.sec-head p:not(.tag) { color: var(--soft); }

/* ------------------------------------------------------------
   Shelf
   ------------------------------------------------------------ */
.polaroids {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.6rem 1.4rem;
  padding-top: 0.6rem;
}

.wander {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  align-items: center;
  margin-top: 3rem;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 6px 6px 0 var(--ink);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.wander:hover {
  transform: translate(-3px, -3px);
  box-shadow: 9px 9px 0 var(--rust);
}

.wander img {
  width: 100%;
  height: 100%;
  min-height: 240px;
  object-fit: cover;
}

.wander-copy { padding: clamp(1.4rem, 3vw, 2.2rem); }

.wander-copy h3 {
  font-family: var(--serif);
  font-size: 1.9rem;
  line-height: 1.1;
  margin: 0.2rem 0 0.5rem;
}

.wander-copy p:not(.tag) {
  color: var(--soft);
  margin-bottom: 1.1rem;
}

/* ------------------------------------------------------------
   Quest board
   ------------------------------------------------------------ */
.board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
  padding: clamp(1.4rem, 3vw, 2.2rem);
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.12), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(0, 0, 0, 0.08), transparent 40%),
    var(--kraft);
  border: 12px solid var(--wood);
  border-image: linear-gradient(135deg, #6b4a32, #4a2f1e 40%, #6b4a32 70%, #3d2617) 1;
  box-shadow: inset 0 0 40px rgba(60, 35, 15, 0.35), 0 16px 34px rgba(28, 23, 18, 0.22);
}

.quest {
  position: relative;
  background: linear-gradient(160deg, #3a2d22, #241b14);
  color: #ead9bc;
  border-radius: 10px;
  padding: 1.25rem 1.1rem 1rem;
  border: 1px solid rgba(234, 217, 188, 0.22);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.45), 0 8px 18px rgba(28, 23, 18, 0.3);
  transform: rotate(var(--r, 0deg));
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.quest:hover {
  transform: rotate(0deg) translateY(-4px);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.45), 0 16px 28px rgba(28, 23, 18, 0.36);
}

.quest::before {
  content: '';
  position: absolute;
  top: -9px;
  left: 12px;
  width: 78px;
  height: 18px;
  background: var(--rust);
  transform: rotate(-8deg);
  clip-path: polygon(0 0, 100% 0, 94% 50%, 100% 100%, 0 100%, 6% 50%);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.3);
}

.quest::after {
  content: '';
  position: absolute;
  top: -4px;
  left: 46px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f5d98a, #b5852c 70%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.quest .xp {
  position: absolute;
  top: 0.55rem;
  right: 0.9rem;
  font-size: 1.15rem;
  color: #f0c36a;
  line-height: 1;
}

.quest h3 {
  font-family: var(--serif);
  font-size: 1.5rem;
  line-height: 1.1;
  margin: 0.4rem 0 0.4rem;
  color: #f6ead2;
}

.quest > p:not(.xp) {
  font-size: 0.92rem;
  color: #cbb99c;
  line-height: 1.45;
  min-height: 2.6em;
}

.quest-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 0.9rem;
  padding-top: 0.7rem;
  border-top: 1px dashed rgba(234, 217, 188, 0.28);
}

.diff { display: flex; gap: 4px; }

.diff i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid #cbb99c;
}

.diff i.on { background: #f0c36a; border-color: #f0c36a; }

.quest-links { display: flex; gap: 0.4rem; }

.quest-foot a {
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.35rem 0.75rem;
  border: 1.5px solid #ead9bc;
  border-radius: 999px;
  color: #f6ead2;
  transition: background 0.2s, color 0.2s;
}

.quest-foot a:hover { background: #ead9bc; color: #241b14; }

/* ------------------------------------------------------------
   Map / trail
   ------------------------------------------------------------ */
.map-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.polaroid-map { position: sticky; top: 5.5rem; }

.trail {
  position: relative;
  padding-left: 2.2rem;
  display: grid;
  gap: 1.6rem;
}

.trail::before {
  content: '';
  position: absolute;
  left: 0.55rem;
  top: 0.6rem;
  bottom: 0.6rem;
  border-left: 3px dashed var(--rust);
  opacity: 0.7;
}

.stop { position: relative; }

.stop::before {
  content: '';
  position: absolute;
  left: -2.2rem;
  top: 0.55rem;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--ink);
  box-shadow: 0 0 0 3px var(--paper);
}

.stop:first-child::before { background: var(--rust); }

.when {
  font-size: 1.25rem;
  color: var(--rust);
  line-height: 1;
}

.stop h3 {
  font-family: var(--serif);
  font-size: 1.6rem;
  line-height: 1.1;
  margin: 0.25rem 0 0.35rem;
}

.stop h3 em {
  font-style: italic;
  color: var(--mute);
  font-size: 0.85em;
}

.stop p { color: var(--soft); font-size: 0.98rem; }

/* ------------------------------------------------------------
   Sticker sheet
   ------------------------------------------------------------ */
.sheet {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem 1.2rem;
  padding-top: 0.5rem;
}

.skill {
  padding: 1.3rem 1.2rem 1.4rem;
  border-radius: 22px;
  background: var(--note-y);
  box-shadow: 0 0 0 5px var(--white), 0 0 0 6px var(--line), var(--shadow);
  transform: rotate(var(--r, 0deg));
  transition: transform 0.35s var(--ease);
}

.skill:hover { transform: rotate(0deg) scale(1.03); }

.skill-y { background: var(--note-y); }
.skill-p { background: var(--note-p); }
.skill-b { background: var(--note-b); }
.skill-g { background: var(--note-g); }

.skill h3 {
  font-family: var(--hand);
  font-weight: 700;
  font-size: 1.9rem;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.skill p { font-size: 0.92rem; color: var(--soft); line-height: 1.45; }

.tools {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.1rem;
  margin-top: 2.6rem;
  justify-content: center;
}

.tool {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.9rem 0.45rem 0.55rem;
  background: var(--white);
  border-radius: 999px;
  box-shadow: 0 0 0 3px var(--white), 0 0 0 4px var(--line), 0 4px 10px rgba(28, 23, 18, 0.1);
  transform: rotate(var(--r, 0deg));
  font-size: 0.84rem;
  font-weight: 600;
  transition: transform 0.3s var(--ease);
}

.tool:hover { transform: rotate(0deg) translateY(-3px); }

.tool img { width: 22px; height: 22px; }

/* ------------------------------------------------------------
   Sticky notes
   ------------------------------------------------------------ */
.notes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem;
  padding-top: 0.5rem;
}

.note {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 250px;
  padding: 1.3rem 1.3rem 1.2rem;
  background: var(--note-y);
  box-shadow: 2px 8px 18px rgba(28, 23, 18, 0.18);
  transform: rotate(var(--r, 0deg));
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.note::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 26px;
  height: 26px;
  background: linear-gradient(135deg, transparent 50%, rgba(0, 0, 0, 0.1) 50%);
}

.note:hover {
  transform: rotate(0deg) translateY(-5px);
  box-shadow: 4px 14px 26px rgba(28, 23, 18, 0.22);
}

.note-y { background: var(--note-y); }
.note-b { background: var(--note-b); }
.note-p { background: var(--note-p); }

.note .num {
  font-size: 1.2rem;
  color: var(--soft);
  line-height: 1;
}

.note h3 {
  font-family: var(--hand);
  font-weight: 700;
  font-size: 1.75rem;
  line-height: 1.05;
  margin: 0.3rem 0 0.5rem;
}

.note p { font-size: 0.92rem; color: var(--soft); line-height: 1.45; }

.note .read {
  margin-top: auto;
  padding-top: 1rem;
  font-size: 1.25rem;
  color: var(--ink);
}

/* ------------------------------------------------------------
   Postcard
   ------------------------------------------------------------ */
.postcard {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform: rotate(var(--r, 0deg));
  position: relative;
  overflow: hidden;
}

.postcard::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(-45deg, var(--rust) 0 12px, transparent 12px 24px, #2f6fb5 24px 36px, transparent 36px 48px);
  opacity: 0.85;
  mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
  mask-composite: exclude;
  -webkit-mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
  -webkit-mask-composite: xor;
  padding: 7px;
  pointer-events: none;
}

.post-left {
  padding: clamp(1.6rem, 4vw, 2.8rem);
  border-right: 2px dashed var(--line);
}

.post-left h2 {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  line-height: 1.1;
  margin: 0.3rem 0 0.7rem;
}

.post-left p:not(.tag) { color: var(--soft); margin-bottom: 1.3rem; }

.post-right {
  position: relative;
  padding: clamp(1.6rem, 4vw, 2.8rem);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.stamp {
  position: absolute;
  top: 1.4rem;
  right: 1.4rem;
  width: 82px;
  padding: 5px;
  background: var(--white);
  border: 1.5px dashed var(--ink);
  transform: rotate(4deg);
}

.stamp img { width: 100%; }

.postmark {
  position: absolute;
  top: 2.6rem;
  right: 6.8rem;
  width: 74px;
  height: 74px;
  border: 2px solid rgba(28, 23, 18, 0.5);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1rem;
  color: rgba(28, 23, 18, 0.6);
  transform: rotate(-12deg);
}

.addr {
  display: grid;
  gap: 0.8rem;
  font-size: 1.45rem;
  line-height: 1;
  margin-top: 6.5rem;
}

.addr span {
  padding-bottom: 0.3rem;
  border-bottom: 1.5px solid var(--ink);
}

.addr a:hover { color: var(--rust); }

/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */
.site-footer {
  border-top: 2px dashed var(--line);
  padding: 1.8rem 0 5.5rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--soft);
}

.footer-meta .hand { font-size: 1.2rem; }
.footer-meta .hand a { text-decoration: underline; text-decoration-color: var(--rust); }
.footer-meta .hand a:hover { color: var(--rust); }

.socials { display: flex; gap: 1.1rem; }
.socials a:hover { color: var(--rust); }

/* ------------------------------------------------------------
   Pen toolbar
   ------------------------------------------------------------ */
.pen-bar {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.45rem;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 4px 4px 0 var(--ink);
  max-width: calc(100% - 2rem);
}

.pen-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-weight: 650;
  font-size: 0.9rem;
  transition: background 0.2s, color 0.2s;
}

.pen-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pen-toggle:hover { background: var(--paper-2); }

.pen-toggle[aria-pressed="true"] {
  background: var(--ink);
  color: var(--white);
}

.pen-colors {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-right: 0.3rem;
}

.pen-colors[hidden] { display: none; }

.swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--c);
  border: 2px solid var(--white);
  box-shadow: 0 0 0 1.5px var(--line);
  transition: transform 0.2s;
}

.swatch:hover { transform: scale(1.15); }
.swatch.is-on { box-shadow: 0 0 0 2px var(--ink); transform: scale(1.15); }

.pen-clear {
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--soft);
  padding: 0.3rem 0.5rem;
  border-radius: 999px;
}

.pen-clear:hover { color: var(--rust); }

.pen-hint {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.6rem);
  transform: translateX(-50%) rotate(-1.5deg);
  white-space: nowrap;
  font-size: 1.15rem;
  color: var(--soft);
  background: var(--note-y);
  padding: 0.15rem 0.7rem;
  box-shadow: 1px 3px 8px rgba(28, 23, 18, 0.16);
}

.pen-hint[hidden] { display: none; }

/* ------------------------------------------------------------
   Fun layer: xp pill, toasts, torch, tape, fox talk, confetti
   ------------------------------------------------------------ */
.xp-pill {
  order: 2;
  margin-left: 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.65rem 0.28rem 0.6rem;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--note-y);
  font-family: var(--hand);
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transform: rotate(-2deg);
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.xp-pill:hover { transform: rotate(0deg) translateY(-1px); box-shadow: 3px 3px 0 var(--ink); }

.xp-pill.bump { animation: bump 0.5s var(--ease); }

@keyframes bump {
  35% { transform: rotate(-3deg) scale(1.14); }
}

.xp-bar {
  width: 54px;
  height: 6px;
  border-radius: 999px;
  background: rgba(28, 23, 18, 0.16);
  overflow: hidden;
}

.xp-bar i {
  display: block;
  height: 100%;
  width: var(--p, 0%);
  background: var(--rust);
  transition: width 0.6s var(--ease);
}

.toasts {
  position: fixed;
  top: 5rem;
  right: 1rem;
  z-index: 60;
  display: grid;
  gap: 0.5rem;
  justify-items: end;
  pointer-events: none;
}

.toast {
  font-family: var(--hand);
  font-size: 1.2rem;
  line-height: 1.1;
  background: var(--white);
  border: 1.5px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  padding: 0.4rem 0.8rem;
  transform: rotate(1.5deg);
  animation: toastin 0.4s var(--ease), toastout 0.4s ease 2.7s forwards;
  max-width: min(80vw, 22rem);
}

.toast.big {
  background: var(--note-y);
  font-size: 1.4rem;
  transform: rotate(-2deg);
}

@keyframes toastin { from { opacity: 0; transform: translateY(-10px) rotate(1.5deg); } }
@keyframes toastout { to { opacity: 0; transform: translateY(-8px) rotate(1.5deg); } }

/* Lights off: a flashlight follows the pointer */
.torch {
  position: fixed;
  inset: 0;
  z-index: 35;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
  background: radial-gradient(circle 260px at var(--mx, 50%) var(--my, 40%), rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 38%, rgba(16, 12, 24, 0.55) 62%, rgba(16, 12, 24, 0.94) 100%);
}

body.night .torch { opacity: 1; }
body.night { background-color: #2b2531; }
body.night .grain { opacity: 0.08; }

body.night .site-header {
  background: rgba(24, 19, 28, 0.86);
  border-bottom-color: rgba(243, 235, 225, 0.15);
}

body.night .logo,
body.night .nav-links > a { color: var(--paper); }
body.night .nav-links > a:hover { color: var(--note-y); }
body.night .nav-toggle { background: #3a3242; border-color: rgba(243, 235, 225, 0.25); }
body.night .nav-toggle span { background: var(--paper); }
body.night .pen-toggle[aria-pressed="true"]#lights-toggle { background: var(--note-y); color: var(--ink); }

/* Tape strips */
.tape {
  overflow: hidden;
  background: var(--rust);
  color: var(--paper);
  transform: rotate(-1.2deg);
  margin: 1.2rem -2rem 0.4rem;
  padding: 0.3rem 0;
  box-shadow: 0 4px 10px rgba(28, 23, 18, 0.15);
}

.tape-2 {
  background: var(--ink);
  color: var(--note-y);
  transform: rotate(0.9deg);
}

.tape-track {
  display: flex;
  width: max-content;
  animation: tape 38s linear infinite;
}

.tape span {
  font-family: var(--hand);
  font-size: 1.35rem;
  white-space: nowrap;
  padding-right: 1rem;
  letter-spacing: 0.02em;
}

@keyframes tape { to { transform: translateX(-50%); } }

/* Fox talks */
.fox-say {
  position: absolute;
  left: 50%;
  top: -2.3rem;
  transform: translateX(-50%) rotate(-3deg);
  background: var(--white);
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  padding: 0.15rem 0.6rem;
  font-size: 1.1rem;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 2px 2px 0 var(--ink);
  z-index: 2;
}

.fox-say::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 10px;
  height: 10px;
  background: var(--white);
  border-right: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  transform: translateX(-50%) rotate(45deg);
}

.fox-say[hidden] { display: none; }

.fox.bounce img { animation: foxbounce 0.6s var(--ease); }

@keyframes foxbounce {
  30% { transform: translateY(-16px) rotate(-7deg); }
  60% { transform: translateY(0) rotate(5deg); }
}

/* Confetti bits */
.confetti {
  position: fixed;
  width: 8px;
  height: 12px;
  border-radius: 2px;
  z-index: 70;
  pointer-events: none;
}

/* Pencil cursor while drawing */
body.is-drawing .doodle {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 24 24'%3E%3Cpath d='M4 20l4-1 10-10-3-3L5 16z' fill='%23ffe27a' stroke='%231c1712' stroke-width='1.5' stroke-linejoin='round'/%3E%3Cpath d='M13 7l3 3' stroke='%231c1712' stroke-width='1.5'/%3E%3C/svg%3E") 4 22, crosshair;
}

body.is-drawing.is-stamping .doodle { cursor: copy; }

.swatch-stamp {
  height: 24px;
  padding: 0 0.55rem;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--white);
  font-family: var(--hand);
  font-size: 1rem;
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.2s, background 0.2s;
}

.swatch-stamp:hover { transform: scale(1.06); }
.swatch-stamp[aria-pressed="true"] { background: var(--note-y); border-color: var(--ink); box-shadow: 0 0 0 1.5px var(--ink); }

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 980px) {
  .polaroids { grid-template-columns: repeat(2, 1fr); }
  .polaroid:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc(50% - 0.7rem); }
  .board { grid-template-columns: repeat(2, 1fr); }
  .sheet { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .desk-grid { grid-template-columns: 1fr; gap: 2rem; }
  .desk-copy { order: 2; }

  /* The pile becomes a compact stage: polaroid centred, stickers tucked under its corners */
  .desk-pile {
    order: 1;
    min-height: 0;
    padding: 1.4rem 0 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .polaroid-hero {
    grid-column: 1 / -1;
    justify-self: center;
    width: min(100%, 300px);
    margin: 0;
  }

  .stick-clock { left: 0; top: 0.6rem; }

  .stick-todo {
    position: relative;
    right: auto;
    bottom: auto;
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
    margin: -0.5rem 0 0 0.2rem;
  }

  .fox {
    position: relative;
    left: auto;
    bottom: auto;
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
    width: 112px;
    margin: -1.8rem 0.4rem 0 0;
  }

  .cap-long { display: none; }
  .cap-short { display: inline; }

  .map-grid { grid-template-columns: 1fr; }
  .polaroid-map { position: static; max-width: 360px; }
  .notes { grid-template-columns: 1fr; max-width: 420px; }
  .postcard { grid-template-columns: 1fr; }
  .post-left { border-right: 0; border-bottom: 2px dashed var(--line); }
}

@media (max-width: 720px) {
  html { scroll-padding-top: 4rem; }

  .nav { height: 3.75rem; gap: 0.6rem; }
  .nav-toggle { display: flex; }
  .xp-pill { margin-left: auto; font-size: 0.92rem; padding: 0.22rem 0.5rem; gap: 0.35rem; }
  .xp-bar { width: 34px; height: 5px; }
  .xp-lvl { max-width: 5.6rem; overflow: hidden; text-overflow: ellipsis; }
  .toasts { top: 4.3rem; right: 0.75rem; left: 0.75rem; justify-items: end; }
  .toast { font-size: 1.05rem; }
  .torch { background: radial-gradient(circle 170px at var(--mx, 50%) var(--my, 40%), rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 38%, rgba(16, 12, 24, 0.55) 62%, rgba(16, 12, 24, 0.94) 100%); }
  .tape { margin: 1rem -1.5rem 0.2rem; }
  .tape span { font-size: 1.1rem; }
  .fox-say { font-size: 0.95rem; top: -2rem; }
  .pen-bar { gap: 0.3rem; padding: 0.35rem 0.4rem; }
  .pen-toggle { padding: 0.4rem 0.7rem; font-size: 0.82rem; }
  .pen-toggle span { display: none; }
  .pen-toggle svg { width: 20px; height: 20px; }
  .pen-colors { gap: 0.3rem; }
  .pen-colors .swatch { width: 20px; height: 20px; }
  .swatch-stamp { font-size: 0.9rem; padding: 0 0.4rem; }

  .nav-links {
    position: fixed;
    inset: 3.75rem 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 0.35rem var(--pad) 1.1rem;
    background: rgba(255, 253, 249, 0.98);
    border-bottom: 1px solid var(--line);
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: 0.28s var(--ease);
    max-height: calc(100dvh - 3.75rem);
    overflow-y: auto;
  }

  .nav-links.is-open {
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links > a {
    padding: 0.7rem 0;
    border-bottom: 1px dashed var(--line);
    font-size: 1.35rem;
  }

  .nav-links > a::after { display: none; }

  .nav-links > .nav-play {
    order: -1;
    display: flex;
    justify-content: center;
    margin: 0.7rem 0 0.5rem;
    padding: 0.8rem 1rem;
    border-bottom: 0;
    font-size: 0.9rem;
  }

  /* Hero */
  .desk { padding: 0.6rem 0 1rem; }
  .desk-pile { padding-top: 1.2rem; }
  .polaroid-hero { width: min(100%, 250px); padding: 0.5rem 0.5rem 0.6rem; }
  .polaroid-hero figcaption { font-size: 1.2rem; margin-top: 0.45rem; }
  .stick { width: 112px; padding: 0.5rem 0.6rem 0.6rem; }
  .stick-title { font-size: 1rem; }
  .clock { font-size: 1.6rem; }
  .stick-sub { font-size: 1rem; }
  .stick-todo { width: 112px; margin-top: -0.4rem; }
  .todo { font-size: 1.05rem; line-height: 1.2; }
  .todo li { padding-left: 1.25rem; }
  .fox { width: 100px; margin-top: -2rem; }
  .fox-tag { font-size: 0.85rem; right: auto; left: -1.2rem; top: 0.6rem; transform: rotate(-8deg); }

  .hand-kicker { font-size: 1.25rem; }
  .desk-name { font-size: clamp(2.7rem, 13vw, 3.4rem); margin: 0.25rem 0 0.6rem; }
  .desk-display { font-size: clamp(1.45rem, 6.4vw, 1.85rem); margin-bottom: 0.8rem; }
  .desk-lead { font-size: 0.98rem; margin-bottom: 1.1rem; }
  .desk-actions { gap: 0.6rem; margin-bottom: 1rem; }
  .desk-actions .btn { flex: 1 1 auto; padding: 0.75rem 1rem; font-size: 0.9rem; }
  .hand-hint { font-size: 1.15rem; }

  .stats {
    flex-direction: column;
    gap: 0.15rem;
    margin-top: 1.4rem;
    padding-top: 0.8rem;
    font-size: 1.15rem;
  }

  .stats b { font-size: 1.35rem; }

  /* Sections */
  .section { padding: 2.4rem 0; }
  .sec-head { margin-bottom: 1.3rem; }
  .sec-head h2 { font-size: clamp(1.9rem, 8.5vw, 2.4rem); }
  .sec-head p:not(.tag) { font-size: 0.98rem; }
  .tag { font-size: 1.1rem; }

  /* Shelf: keep two-up, smaller frames */
  .polaroids { gap: 1.3rem 0.85rem; padding-top: 0.4rem; }
  .polaroid:last-child:nth-child(odd) { width: calc(50% - 0.425rem); }
  .polaroid { padding: 0.45rem 0.45rem 0.6rem; }
  .polaroid::before { width: 62px; height: 18px; top: -8px; }
  .polaroid .cap { font-size: 1.1rem; margin-top: 0.45rem; }
  .polaroid .cap-sub { font-size: 0.74rem; line-height: 1.3; }

  .wander { grid-template-columns: 1fr; margin-top: 2rem; box-shadow: 4px 4px 0 var(--ink); }
  .wander img { min-height: 0; aspect-ratio: 16 / 9; }
  .wander-copy { padding: 1.2rem 1.1rem 1.3rem; }
  .wander-copy h3 { font-size: 1.55rem; }
  .wander-copy p:not(.tag) { font-size: 0.95rem; }

  /* Quest board: pan across it instead of stacking ten cards */
  .swipe-hint { display: block; margin-top: 0.3rem; color: var(--rust); font-size: 1.15rem; }

  .board {
    display: flex;
    gap: 0.9rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 1rem;
    padding: 1.3rem 1rem 1.1rem;
    border-width: 9px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .board::-webkit-scrollbar { display: none; }

  .quest {
    flex: 0 0 min(74vw, 290px);
    scroll-snap-align: center;
    transform: none;
    padding: 1.1rem 1rem 0.9rem;
  }

  .quest:hover { transform: none; }
  .quest h3 { font-size: 1.35rem; }
  .quest > p:not(.xp) { font-size: 0.88rem; min-height: 0; }

  /* Map */
  .polaroid-map { max-width: 300px; margin-inline: auto; }
  .polaroid-map figcaption { font-size: 1.15rem; }
  .map-grid { gap: 1.8rem; }
  .trail { gap: 1.2rem; padding-left: 2rem; }
  .stop::before { left: -2rem; }
  .stop h3 { font-size: 1.4rem; }
  .stop p { font-size: 0.93rem; }
  .when { font-size: 1.15rem; }

  /* Sticker sheet: two-up, tighter */
  .sheet { grid-template-columns: repeat(2, 1fr); gap: 1.1rem 0.9rem; max-width: none; }
  .skill { padding: 0.95rem 0.9rem 1rem; border-radius: 16px; box-shadow: 0 0 0 3px var(--white), 0 0 0 4px var(--line), var(--shadow); }
  .skill h3 { font-size: 1.5rem; margin-bottom: 0.35rem; }
  .skill p { font-size: 0.84rem; line-height: 1.4; }

  .tools { gap: 0.6rem; margin-top: 1.8rem; }
  .tool { font-size: 0.76rem; padding: 0.35rem 0.75rem 0.35rem 0.45rem; gap: 0.35rem; }
  .tool img { width: 18px; height: 18px; }

  /* Notes */
  .notes { max-width: none; gap: 1.2rem; }
  .note { min-height: 0; padding: 1.1rem 1.1rem 1rem; }
  .note h3 { font-size: 1.5rem; }
  .note .read { padding-top: 0.7rem; font-size: 1.15rem; }

  /* Postcard */
  .post-left { padding: 1.4rem 1.2rem 1.5rem; }
  .post-left h2 { font-size: clamp(1.5rem, 7vw, 1.9rem); }
  .post-left p:not(.tag) { font-size: 0.95rem; }
  .post-right { padding: 1.4rem 1.2rem 1.5rem; }
  .stamp { width: 62px; top: 1rem; right: 1rem; }
  .postmark { width: 58px; height: 58px; right: 5.4rem; top: 1.7rem; font-size: 0.8rem; }
  .addr { margin-top: 4.6rem; gap: 0.7rem; font-size: 1.2rem; }

  .footer-inner { font-size: 0.85rem; }
  .pen-hint { font-size: 1rem; white-space: normal; text-align: center; width: max-content; max-width: 80vw; }
  .pen-bar { bottom: 0.75rem; }
  .site-footer { padding-bottom: 6rem; }
}

@media (max-width: 360px) {
  .polaroid-hero { width: min(100%, 220px); }
  .stick, .stick-todo { width: 100px; }
  .fox { width: 88px; }
  .desk-actions .btn { width: 100%; }
}

/* ============================================================
   Motion layer. creative-motion.js puts .motion on <html>
   (never under prefers-reduced-motion).
   ============================================================ */

/* Structure hooks that must work without motion too */
.board-track { display: contents; }
.board-meter { display: none; }
.trail::before { clip-path: inset(0 0 calc((1 - var(--draw, 1)) * 100%) 0); }
.stats b { font-variant-numeric: tabular-nums; }
.sec-head .tag { width: fit-content; }
.section, .desk { position: relative; }
.section > .wrap,
.desk > .wrap,
.quest-pin > .wrap { position: relative; z-index: 1; }

/* Scroll progress: a pencil drawing a squiggle under the header */
.scroll-ink {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 8px;
  pointer-events: none;
}

.scroll-ink i {
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 8'%3E%3Cpath d='M0 4 Q 5 0, 10 4 T 20 4 T 30 4 T 40 4' fill='none' stroke='%23c45c26' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x;
  background-size: 22px 8px;
  clip-path: inset(0 calc((1 - var(--sp, 0)) * 100%) 0 0);
}

.scroll-ink svg {
  position: absolute;
  left: -20px;
  bottom: 1px;
  width: 22px;
  height: 22px;
  transform: scaleX(-1);
}

/* Ink cursor (fine pointers only) */
.cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 90;
  width: 12px;
  height: 12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid transparent;
  background: var(--ink);
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: multiply;
  transition: width 0.35s var(--ease), height 0.35s var(--ease), background 0.25s, border-color 0.25s, opacity 0.3s, scale 0.2s var(--ease);
}

.cursor.on { opacity: 0.85; }
.cursor.is-down { scale: 0.75; }

.cursor.is-link {
  width: 46px;
  height: 46px;
  background: transparent;
  border-color: var(--ink);
}

.cursor.is-label {
  width: 66px;
  height: 66px;
  background: var(--note-y);
  border-color: var(--ink);
  mix-blend-mode: normal;
  opacity: 1;
  box-shadow: 2px 2px 0 var(--ink);
}

.cursor-label {
  font-family: var(--hand);
  font-size: 1.2rem;
  line-height: 1;
  color: var(--ink);
  opacity: 0;
  scale: 0.4;
  transition: opacity 0.2s, scale 0.3s var(--ease);
}

.cursor.is-label .cursor-label { opacity: 1; scale: 1; }
body.is-drawing .cursor { opacity: 0; }
body.night .cursor { background: var(--note-y); mix-blend-mode: normal; }
body.night .cursor.is-link { background: transparent; border-color: var(--note-y); }

/* Click splat */
.splat {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 85;
  pointer-events: none;
}

.splat i {
  position: absolute;
  left: -1.5px;
  top: 0;
  width: 3px;
  height: 11px;
  border-radius: 3px;
  transform-origin: 50% 0;
  animation: splat 0.55s var(--ease) forwards;
}

@keyframes splat {
  from { transform: rotate(var(--a)) translateY(6px) scaleY(0.2); opacity: 1; }
  to { transform: rotate(var(--a)) translateY(24px) scaleY(1); opacity: 0; }
}

/* ---------- Hero intro ---------- */
.desk-name .wd { display: inline-block; white-space: nowrap; }
.desk-name .ch { display: inline-block; }

.motion .desk-name .ch {
  animation: drop 0.9s cubic-bezier(0.3, 1.5, 0.5, 1) backwards;
  animation-delay: calc(0.2s + var(--i) * 45ms);
}

.motion .desk-name .ch.ch-done { animation: none; }
.motion .desk-name .ch.hop { animation: hop 0.55s var(--ease); }

@keyframes drop {
  from { opacity: 0; translate: 0 -0.8em; rotate: var(--cr); }
  50% { opacity: 1; }
}

@keyframes hop {
  35% { translate: 0 -0.25em; rotate: calc(var(--cr) * 0.4); }
  70% { translate: 0 0.04em; }
}

.motion .desk-name .hl::after {
  transform-origin: left center;
  animation: mark 0.7s var(--ease) 1.05s backwards;
}

@keyframes mark { from { scale: 0 1; } }

.motion .hand-kicker { animation: write 1s var(--ease) 0.05s backwards; }

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

.motion .desk-display { animation: blurUp 1s var(--ease) 0.7s backwards; }
.motion .desk-lead { animation: up 0.8s var(--ease) 1s backwards; }
.motion .desk-actions { animation: up 0.8s var(--ease) 1.12s backwards; }
.motion .hand-hint { animation: up 0.8s var(--ease) 1.25s backwards; }

@keyframes blurUp {
  from { opacity: 0; translate: 0 0.5em; filter: blur(8px); }
}

.desk-display em { position: relative; white-space: nowrap; }

.scribble {
  position: absolute;
  left: -2%;
  bottom: -0.2em;
  width: 104%;
  height: 0.34em;
  overflow: visible;
  fill: none;
  stroke: var(--rust);
  stroke-width: 2.6;
  stroke-linecap: round;
  pointer-events: none;
}

.scribble path,
.arrow-hint path { stroke-dasharray: 1; }

.motion .scribble path { stroke-dashoffset: 1; animation: ink 0.9s var(--ease) 1.5s forwards; }
.motion .arrow-hint path { stroke-dashoffset: 1; animation: ink 0.6s var(--ease) 1.7s forwards; }
.motion .arrow-hint path + path { animation-delay: 2.2s; animation-duration: 0.3s; }

@keyframes ink { to { stroke-dashoffset: 0; } }

.motion .polaroid-hero { animation: slap 0.9s cubic-bezier(0.25, 1.3, 0.5, 1) 0.35s backwards; }
.motion .stick-clock { animation: flyL 1s cubic-bezier(0.25, 1.25, 0.5, 1) 0.8s backwards; }
.motion .stick-todo { animation: flyR 1s cubic-bezier(0.25, 1.25, 0.5, 1) 0.95s backwards; }
.motion .fox { animation: spinIn 1.1s cubic-bezier(0.25, 1.3, 0.5, 1) 1.1s backwards; }

@keyframes slap {
  from { opacity: 0; scale: 1.4; rotate: -16deg; translate: 0 -30px; }
  55% { opacity: 1; }
}

@keyframes flyL { from { opacity: 0; translate: -160px -70px; rotate: -45deg; } }
@keyframes flyR { from { opacity: 0; translate: 160px 70px; rotate: 45deg; } }
@keyframes spinIn { from { opacity: 0; scale: 0.2; rotate: -220deg; } }

.motion .tape-track { animation: none; will-change: transform; }

/* ---------- Section heads: tag writes on, title words rise ---------- */
.sec-head h2 .w {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding: 0 0.05em 0.14em;
  margin: 0 -0.05em -0.14em;
}

.sec-head h2 .w > span { display: inline-block; }

.motion .sec-head.in h2 .w > span {
  animation: wordUp 0.9s var(--ease) backwards;
  animation-delay: calc(0.12s + var(--i) * 90ms);
}

@keyframes wordUp { from { translate: 0 115%; rotate: 9deg; } }

.motion .sec-head .tag { clip-path: inset(0 100% 0 0); }

.motion .sec-head.in .tag {
  clip-path: inset(-20% -10% -20% 0);
  transition: clip-path 1.1s var(--ease) 0.05s;
}

/* ---------- Margin doodles that draw themselves ---------- */
.doodad {
  position: absolute;
  z-index: 0;
  width: var(--s);
  height: var(--s);
  overflow: visible;
  fill: none;
  stroke: var(--c);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.7;
  pointer-events: none;
}

.doodad path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.8s var(--ease) 0.15s;
}

.doodad.in path { stroke-dashoffset: 0; }

@media (max-width: 1179px) {
  .doodad { display: none; }
}

/* ---------- Shelf: polaroids get tossed onto the table ---------- */
.motion .polaroids .polaroid.in {
  animation: toss 1.15s cubic-bezier(0.2, 1.25, 0.4, 1) backwards;
  animation-delay: calc(var(--i, 0) * 110ms);
}

@keyframes toss {
  from { opacity: 0; translate: var(--fx) var(--fy); rotate: var(--fr); scale: 1.25; }
  40% { opacity: 1; }
}

.motion .wander.in { animation: pop 1s cubic-bezier(0.2, 1.3, 0.4, 1) backwards; }

@keyframes pop { from { opacity: 0; scale: 0.85; rotate: -3deg; translate: 0 40px; } }

.motion .wander img { scale: 1.18; }

/* ---------- Quest board: cards swing on their pins ---------- */
.motion .board.in { animation: boardIn 1s var(--ease) backwards; }

@keyframes boardIn { from { opacity: 0; scale: 0.94; translate: 0 40px; } }

.motion .board.in .quest {
  transform-origin: 51px 0;
  animation: swing 1.3s var(--ease) backwards;
  animation-delay: calc(0.2s + var(--i, 0) * 80ms);
}

@keyframes swing {
  0% { opacity: 0; translate: 0 -50px; rotate: -18deg; }
  35% { opacity: 1; translate: 0 0; rotate: 10deg; }
  55% { rotate: -6deg; }
  72% { rotate: 3deg; }
  86% { rotate: -1deg; }
  100% { rotate: 0deg; }
}

/* Desktop: the board pins and scrolls sideways */
#quests.h-scroll { padding: 0; }

#quests.h-scroll .quest-pin {
  position: sticky;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

#quests.h-scroll .sec-head { margin-bottom: 1.6rem; }
#quests.h-scroll .board { display: block; overflow: hidden; padding-bottom: 2.8rem; }

#quests.h-scroll .board-track {
  display: flex;
  gap: 1.4rem;
  width: max-content;
  position: relative;
  will-change: transform;
}

#quests.h-scroll .quest {
  flex: 0 0 300px;
  transform: translateY(var(--arc-y, 0px)) rotate(calc(var(--r, 0deg) + var(--arc-r, 0deg)));
  transition: box-shadow 0.35s var(--ease), translate 0.35s var(--ease);
}

#quests.h-scroll .quest:hover { translate: 0 -8px; }

#quests.h-scroll .board-meter {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.1rem;
}

.board-meter b {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(28, 23, 18, 0.12);
  overflow: hidden;
  position: relative;
}

.board-meter i {
  position: absolute;
  inset: 0;
  background: var(--rust);
  transform-origin: left center;
  transform: scaleX(var(--bp, 0));
}

.board-meter span {
  font-size: 1.25rem;
  color: var(--soft);
  white-space: nowrap;
}

/* ---------- Map: the trail draws as you scroll ---------- */
.motion .trail { --draw: 0; }

.trail-tip { display: none; }

.motion .trail-tip {
  display: block;
  position: absolute;
  left: calc(0.55rem + 1.5px);
  top: calc(0.6rem + var(--draw) * (100% - 1.2rem));
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: var(--rust);
  z-index: 1;
}

.trail-tip::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--rust);
  animation: ping 1.6s ease-out infinite;
}

@keyframes ping {
  from { scale: 0.5; opacity: 0.9; }
  to { scale: 1.8; opacity: 0; }
}

.motion .stop::before {
  background: var(--white);
  scale: 0.7;
  transition: background 0.3s, scale 0.5s cubic-bezier(0.3, 1.8, 0.5, 1);
}

.motion .stop.lit::before { background: var(--rust); scale: 1; }
.motion .stop.in { animation: slideIn 0.8s var(--ease) backwards; }

@keyframes slideIn { from { opacity: 0; translate: 48px 0; } }

/* ---------- Stickers: slapped on, then a shine ---------- */
.skill { position: relative; overflow: hidden; }

.skill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.7) 50%, transparent 65%);
  translate: -120% 0;
  pointer-events: none;
}

.motion .sheet .skill.in {
  animation: slapSticker 0.9s cubic-bezier(0.25, 1.4, 0.5, 1) backwards;
  animation-delay: calc(var(--i, 0) * 110ms);
}

.motion .skill.in::after {
  animation: shine 1.2s var(--ease) forwards;
  animation-delay: calc(0.55s + var(--i, 0) * 110ms);
}

.motion .skill.in:hover::after { animation: shineAgain 0.9s var(--ease); }

@keyframes slapSticker {
  from { opacity: 0; scale: 1.7; rotate: var(--fr); }
  50% { opacity: 1; }
}

@keyframes shine { to { translate: 120% 0; } }

@keyframes shineAgain {
  from { translate: -120% 0; }
  to { translate: 120% 0; }
}

.motion .tools.in .tool {
  animation: scatter 0.95s cubic-bezier(0.25, 1.4, 0.5, 1) backwards;
  animation-delay: calc(0.1s + var(--i, 0) * 45ms);
}

@keyframes scatter { from { opacity: 0; translate: var(--fx) var(--fy); scale: 0.3; rotate: var(--fr); } }

/* ---------- Notes flutter down like paper ---------- */
.motion .notes .note.in {
  animation: flutter 1.4s cubic-bezier(0.3, 0.7, 0.4, 1) backwards;
  animation-delay: calc(var(--i, 0) * 140ms);
}

@keyframes flutter {
  0% { opacity: 0; translate: 0 -160px; rotate: -24deg; }
  25% { opacity: 1; translate: 40px -100px; rotate: 14deg; }
  50% { translate: -24px -40px; rotate: -8deg; }
  75% { translate: 8px -8px; rotate: 3deg; }
  100% { translate: 0 0; rotate: 0deg; }
}

/* ---------- Postcard arrives like mail ---------- */
.motion .postcard.in {
  animation: mail 1.1s cubic-bezier(0.2, 1.1, 0.4, 1) backwards, thunk 0.35s ease 1.25s;
}

@keyframes mail {
  from { opacity: 0; translate: 60vw -40px; rotate: 18deg; }
  60% { opacity: 1; }
}

@keyframes thunk { 40% { scale: 0.985; } }

.motion .postcard.in .stamp { animation: stampIn 0.45s cubic-bezier(0.3, 1.6, 0.5, 1) 1.05s backwards; }
.motion .postcard.in .postmark { animation: postmark 0.5s ease-out 1.3s backwards; }
.motion .postcard.in .addr span { animation: write 0.8s var(--ease) backwards; }
.motion .postcard.in .addr span:nth-child(1) { animation-delay: 1.45s; }
.motion .postcard.in .addr span:nth-child(2) { animation-delay: 1.6s; }
.motion .postcard.in .addr span:nth-child(3) { animation-delay: 1.75s; }

@keyframes stampIn { from { opacity: 0; scale: 2.8; rotate: -25deg; } }
@keyframes postmark { from { opacity: 0; scale: 1.6; filter: blur(3px); } }

.motion .btn {
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.2s, color 0.2s, translate 0.4s var(--ease);
}
