:root {
  --paper: #f1ece2;
  --ink: #1d2540;
  --mute: #55597a;
  --orange: #ff8a1f;
  --teal: #1fa59a;
  --c1: #4fbfae;
  --c2: #ffa24a;
  --c3: #f2c14e;
  --c4: #6aa3dc;
  --c5: #e8685c;
  --display: "Bagel Fat One", "Trebuchet MS", system-ui, sans-serif;
  --body: "Nunito", -apple-system, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  position: relative;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font: 18px/1.7 var(--body);
  -webkit-font-smoothing: antialiased;
}
/* subtle paper grain */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 50; pointer-events: none;
  opacity: .45; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .2  0 0 0 0 .22  0 0 0 0 .3  0 0 0 .22 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  max-width: 760px; margin: 0 auto; padding: 20px 24px;
  display: flex; justify-content: space-between; align-items: center;
  font: 800 15px var(--body);
}
.logo { background: #fff6dc; border: 2px solid var(--ink); border-radius: 999px; padding: 3px 14px; color: var(--ink); text-decoration: none; letter-spacing: .01em; }
.logo span { color: #c4600a; }
nav { display: flex; gap: 8px; }
nav a { color: var(--ink); text-decoration: none; padding: 3px 12px; border-radius: 999px; background: #fff6dc; border: 2px solid var(--ink); }
nav a:hover { background: var(--orange); }

main, footer { max-width: 760px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 2; }

.hero { padding: 0 0 32px; }
.title { margin: -64px 0 18px; position: relative; z-index: 1; font: 400 clamp(88px, 22vw, 156px)/1 var(--display); letter-spacing: .005em; }
.title span { color: #fff6dc; -webkit-text-stroke: 10px var(--ink); paint-order: stroke fill; text-shadow: 6px 7px 0 var(--ink); display: inline-block; transform: rotate(-3deg); }
.lede { font-size: 20px; max-width: 32em; margin: 0; }

section { padding: 30px 0; }
h2 { font: 400 26px var(--display); letter-spacing: .01em; color: var(--ink); margin: 0 0 18px; display: flex; align-items: center; gap: 12px; }
h2::before { content: ""; width: 12px; height: 12px; background: var(--orange); flex: none; transform: rotate(45deg); }
h2::after { content: ""; flex: 1; height: 2px; background: var(--ink); opacity: .18; }
.dot { display: none; }

.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.chips li { font: 800 15px var(--body); padding: 4px 14px; border-radius: 6px; color: var(--ink); transition: transform .15s; cursor: default; }
.chips li:hover { transform: translateY(-3px); }

.updated { font-size: 14px; color: var(--mute); margin: -8px 0 16px; }
.now { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.now li { padding: 14px 18px 16px; border-radius: 6px; border-left: 7px solid var(--ink); line-height: 1.4; }
.now li:nth-child(1) { background: var(--c3); }
.now li:nth-child(2) { background: var(--c1); }
.now li:nth-child(3) { background: var(--c4); }
.now li:nth-child(4) { background: var(--c2); }
.now .lbl { display: block; font: 800 14px var(--body); margin-bottom: 2px; opacity: .75; }
.now li > span:last-child { font: 400 21px/1.25 var(--display); letter-spacing: .01em; }

.thought { background: #fffdf8; border-left: 7px solid var(--orange); border-radius: 4px 14px 14px 4px; padding: 20px 26px 8px 24px; margin-bottom: 24px; box-shadow: 0 1px 0 rgba(29,37,64,.12); }
.thought time { font: 800 13px var(--body); color: var(--mute); }
.thought h3 { font: 400 28px/1.2 var(--display); letter-spacing: .01em; margin: 2px 0 10px; }
.thought p { margin: 0 0 14px; }

.links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.links a { display: inline-block; font: 800 15px var(--body); color: #fff6dc; background: var(--ink); text-decoration: none; padding: 7px 18px; border-radius: 6px; transition: background .15s, transform .15s, color .15s; }
.links a span { opacity: .6; }
.links a:hover { background: var(--orange); color: var(--ink); transform: translateY(-3px); }
.links a:focus-visible, nav a:focus-visible, .logo:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 24px; padding-bottom: 48px; margin-top: 20px; font-size: 14px; color: var(--mute); }


@media (max-width: 560px) {
  body { font-size: 17px; }
  .now { grid-template-columns: 1fr; }
  nav { gap: 0; }
  nav a { padding: 2px 8px; font-size: 14px; }
  nav a[href="#orbit"] { display: none; }
  .logo { font-size: 14px; }
  .top { padding: 12px; }
  .title { margin-top: -50px; font-size: 80px; }
  .title span { text-shadow: 4px 5px 0 var(--ink); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}


/* ---- hero collage ---- */
.collage { --px: 0; position: relative; height: clamp(400px, 46vw, 640px); container-type: size; overflow: hidden; background: #ffd23f; border-bottom: 4px solid var(--ink); isolation: isolate; }
.collage::before { content: ""; position: absolute; inset: 0; z-index: 0; background: radial-gradient(rgba(29,37,64,.22) 1.6px, transparent 2px) 0 0 / 14px 14px; mask-image: linear-gradient(100deg, #000, transparent 65%); -webkit-mask-image: linear-gradient(100deg, #000, transparent 65%); }
.blobs i { position: absolute; display: block; z-index: 1; }
.b1 { left: -6%; bottom: -30%; width: 46%; aspect-ratio: 1; border-radius: 50%; background: #3f78b5; }
.b2 { left: 44%; top: -35%; width: 34%; aspect-ratio: 1; border-radius: 50%; background: #e5483c; }
.b3 { right: -8%; bottom: -25%; width: 36%; aspect-ratio: 1; background: #1fa59a; transform: rotate(18deg); border-radius: 22%; }
.b4 { left: 30%; bottom: -12%; width: 40%; height: 55%; background: #1d2540; transform: skewX(-14deg); }
#hero-pieces { position: absolute; inset: 0; z-index: 2; }

.piece, .wp, .camper { margin: 0; cursor: pointer; outline: none; user-select: none; -webkit-user-select: none; }
.piece img, .wp img, .camper img { display: block; height: 100%; width: auto; max-width: none; -webkit-user-drag: none; filter: drop-shadow(3px 0 0 var(--ink)) drop-shadow(-3px 0 0 var(--ink)) drop-shadow(0 3px 0 var(--ink)) drop-shadow(0 -3px 0 var(--ink)) drop-shadow(0 8px 10px rgba(0,0,0,.28)); transition: transform .25s cubic-bezier(.3,1.5,.5,1); transform-origin: 50% 100%; }
.piece { position: absolute; transform: translateX(calc(var(--px) * var(--d, 0) * -1px)) rotate(var(--rot, 0deg)) scaleX(var(--flip, 1)); transition: transform .35s ease-out; }
.piece:hover img, .piece:focus-visible img, .wp:hover img, .wp:focus-visible img, .camper:hover img { transform: translateY(-3%) scale(1.04); }
.piece:focus-visible img, .wp:focus-visible img, .camper:focus-visible img { filter: drop-shadow(0 0 5px var(--orange)) drop-shadow(3px 0 0 var(--ink)) drop-shadow(-3px 0 0 var(--ink)); }
.piece::after, .wp::after, .camper::after { content: attr(data-name); position: absolute; left: 50%; top: 4%; transform: translate(-50%, 6px) scaleX(var(--flip, 1)); background: var(--ink); color: #fff6dc; font: 800 13px var(--body); padding: 2px 10px; border-radius: 6px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 5; }
.piece:hover::after, .piece.show::after, .wp:hover::after, .wp.show::after, .camper:hover::after, .camper.show::after { opacity: 1; transform: translate(-50%, 0) scaleX(var(--flip, 1)); }
.hop img { animation: hop .75s cubic-bezier(.3,1.6,.5,1); }
@keyframes hop { 0% { transform: translateY(0) scale(1.06, .94); } 35% { transform: translateY(-9%) scale(.97, 1.04) rotate(-2deg); } 100% { transform: translateY(0) scale(1); } }

/* ---- big background characters ---- */
.wp { position: absolute; z-index: 1; --k: 0; transform: translateY(calc(var(--sy, 0) * var(--k, 0) * 1px)) rotate(var(--rot, 0deg)); transform-origin: 50% 100%; }
.wp.perch { z-index: 3; }
.flier { position: fixed; left: 0; top: 0; z-index: 0; pointer-events: none; opacity: 0; will-change: transform; }
.flier img { display: block; height: auto; filter: drop-shadow(3px 0 0 var(--ink)) drop-shadow(-3px 0 0 var(--ink)) drop-shadow(0 3px 0 var(--ink)) drop-shadow(0 -3px 0 var(--ink)) drop-shadow(0 10px 12px rgba(0,0,0,.25)); animation: bob 3.2s ease-in-out infinite alternate; }
@keyframes bob { from { transform: translateY(0); } to { transform: translateY(-14px); } }
@media (max-width: 1100px) { .wp:not(.perch) { opacity: .28; pointer-events: none; } }

/* ---- campfire ending ---- */
.camp { margin-top: 40px; padding: 90px 24px 22px; background: #1d2540; color: #fff6dc; text-align: center; position: relative; z-index: 2; overflow: hidden; }
.camp-row { display: flex; align-items: flex-end; justify-content: center; gap: clamp(10px, 3vw, 40px); }
.camper { position: relative; height: clamp(90px, 14vw, 150px); opacity: 0; transform: translateY(18px); transition: opacity .5s calc(var(--i) * 110ms), transform .5s calc(var(--i) * 110ms); --flip: 1; }
.camper img { filter: drop-shadow(2px 0 0 #000) drop-shadow(-2px 0 0 #000) drop-shadow(0 2px 0 #000) drop-shadow(0 -2px 0 #000); }
.camp.arrive .camper { opacity: 1; transform: none; }
.camp.arrive .camper img { animation: hop .75s cubic-bezier(.3,1.6,.5,1) calc(var(--i) * 110ms + 300ms); }
.fire svg { display: block; }
.fl { transform-box: fill-box; transform-origin: 50% 100%; animation: flick 1s ease-in-out infinite alternate; }
.f2 { animation-duration: .7s; }
@keyframes flick { from { transform: scale(1, .92) rotate(-2deg); } to { transform: scale(.94, 1.06) rotate(2deg); } }
.camp-logo { display: block; margin: 30px auto 0; width: min(180px, 50vw); height: auto; opacity: .95; }
.camp-note { margin: 14px 0 0; font: 400 20px var(--display); letter-spacing: .02em; opacity: .85; }
@media (max-width: 560px) { .camp-row { gap: 2px; flex-wrap: wrap; } .camper { height: 70px; } .camp { padding-top: 60px; } }
@media (prefers-reduced-motion: reduce) { .piece, .wp { transition: none; } }

@media (max-width: 600px) {
  .collage { height: 460px; }
  .piece[data-id="logo"]     { left: 3% !important;   top: 14% !important;    height: 13% !important; }
  .piece[data-id="finn"]     { left: -4% !important;  bottom: 1% !important;  height: 30% !important; }
  .piece[data-id="jake"]     { left: 30% !important;  bottom: 0% !important;  height: 20% !important; }
  .piece[data-id="alice"]    { left: 26% !important;  bottom: -4% !important; height: 64% !important; }
  .piece[data-id="cheshire"] { left: 34% !important;  top: 25% !important;    height: 17% !important; }
  .piece[data-id="bmo"]      { left: 56% !important;  bottom: 0% !important;  height: 40% !important; }
  .piece[data-id="nausicaa"] { left: 60% !important;  top: 9% !important;     height: 12% !important; }
  .piece[data-id="arrietty"] { left: 36% !important;  bottom: -2% !important; height: 36% !important; }
  .piece[data-id="hobie"]    { left: 74% !important;  bottom: -8% !important; height: 62% !important; }
}

/* ---- dragging ---- */
.piece { cursor: grab; touch-action: pan-y; }
.piece.dragging { cursor: grabbing; transition: none; }
.piece.dragging img { transform: scale(1.05) rotate(-2deg); filter: drop-shadow(3px 0 0 var(--ink)) drop-shadow(-3px 0 0 var(--ink)) drop-shadow(0 3px 0 var(--ink)) drop-shadow(0 -3px 0 var(--ink)) drop-shadow(0 16px 14px rgba(0,0,0,.35)); }
.drag-hint, .reset-hero { position: absolute; right: 16px; bottom: 56px; z-index: 40; font: 800 13px var(--body); background: #fff6dc; color: var(--ink); border: 2px solid var(--ink); border-radius: 999px; padding: 3px 14px; margin: 0; }
.drag-hint { transition: opacity .4s; pointer-events: none; }
.drag-hint.gone { opacity: 0; }
.reset-hero { cursor: pointer; right: 16px; bottom: 16px; bottom: 56px; }
.reset-hero:hover { background: var(--orange); }
.reset-hero[hidden] { display: none; }

.title, .title span { pointer-events: none; user-select: none; -webkit-user-select: none; }
.collage { user-select: none; -webkit-user-select: none; }

/* resize handle (one shared dot that floats above everything) */
.rz { position: absolute; z-index: 9999; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%; background: var(--orange); border: 3px solid var(--ink); cursor: ew-resize; opacity: 0; pointer-events: none; transform: scale(.7); transition: opacity .15s, transform .15s; touch-action: none; }
.rz.on { opacity: 1; pointer-events: auto; transform: none; }
.rz::after { content: "\2194"; position: absolute; inset: 0; display: grid; place-items: center; font: 800 12px/1 var(--body); color: var(--ink); }
.rz:focus-visible { outline: 3px solid #fff6dc; }
.piece.resizing { transition: none; }

@media (max-width: 600px) {
  .drag-hint, .reset-hero { right: 8px; bottom: 66px; font-size: 11px; max-width: 150px; white-space: normal; text-align: center; line-height: 1.3; border-radius: 14px; padding: 3px 10px; }
}
