/* ── 08 · Inktober: puppets rising behind giant pink letters ───────────── */
#inktober {
  /* --s: px per source pixel of the ink scans, --fs: letter size */
  --s: min(.058vh, .04vw);
  --fs: min(15.4vw, 25vh);
  padding: 0;
}
#inktober .ink-pin {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 640px;
  overflow: hidden;
  /* the scans are multiplied into the paper; give the (pinned) frame its own
     paper so the blend has something to melt into while position:fixed */
  background: var(--bg);
}

/* intro copy */
#inktober .ink-top {
  position: absolute; left: 0; right: 0; top: clamp(78px, 11.5vh, 124px);
  display: flex; justify-content: center;
  padding: 0 var(--gutter);
  z-index: 3;
}
#inktober .ink-intro {
  position: relative;
  max-width: 60ch; margin: 0;
  text-align: center;
  font-size: clamp(19px, 1.45vw, 24px);
  line-height: 1.45;
  color: var(--ink);
}
#inktober .ink-intro .w { display: inline-block; }
#inktober .ink-pot {
  position: absolute; width: clamp(54px, 4.6vw, 74px);
  left: calc(50% + min(32ch, 31vw)); top: -6px;
  overflow: visible; rotate: 8deg;
  fill: none; stroke: var(--ink); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round;
}
#inktober .ink-pot__glass { fill: #fffaf3; }
#inktober .ink-pot__ink { fill: var(--ink); stroke: none; }
#inktober .ink-pot__label { fill: var(--pink-soft); stroke-width: 2.4; }
#inktober .ink-pot__neck { fill: var(--pink); }
#inktober .ink-pot__pen { stroke-width: 4.4; stroke: var(--pink-deep); }
#inktober .ink-pot__nib { fill: var(--ink); stroke-width: 2; }
#inktober .ink-pot__drip { stroke: var(--ink); stroke-width: 3; }
#inktober .ink-dd { position: absolute; }
#inktober .ink-dd--1 { width: 26px; height: 26px; left: calc(50% - min(33ch, 33vw)); top: -14px; }
#inktober .ink-dd--2 { width: 22px; height: 22px; left: calc(50% - min(35ch, 35vw)); top: 46px; }

/* the stage: characters stand behind the letters and are clipped at the
   "stage floor" so they can rise up from behind INKTOBER */
#inktober .ink-scene {
  position: absolute; left: 0; right: 0;
  bottom: clamp(30px, 5.5vh, 64px);
  height: calc(var(--s) * 700 + var(--fs) * .5);
}
#inktober .ink-stage {
  position: absolute; left: 0; right: 0;
  top: -60vh;
  bottom: calc(var(--fs) * .3);
  overflow: hidden;
  pointer-events: none;
}
#inktober .ink-cast {
  position: absolute; left: 0; right: 0;
  bottom: calc(var(--fs) * .16);
  display: flex; justify-content: center; align-items: flex-end;
  padding-left: 1vw;
}
#inktober .ink-char {
  position: relative; flex: none;
  width: calc(var(--w) * var(--s));
  height: calc(var(--h) * var(--s));
  margin: 0 calc(var(--s) * -6);
  margin-bottom: calc((var(--lift) * 6 - var(--fb)) * var(--s));
  pointer-events: none;
}
#inktober .ink-char--mustache { margin-right: calc(var(--s) * 40); }
#inktober .ink-char__fig {
  position: absolute; inset: 0;
  mix-blend-mode: multiply;
  pointer-events: auto;
  cursor: zoom-in;
}
#inktober .ink-char__puppet, #inktober .ink-char__body {
  position: absolute; inset: 0;
  transform-origin: 50% 100%;
}
#inktober .ink-char__body img { width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }
#inktober .ink-char__fig:focus-visible { outline-offset: -6px; }

/* handwritten prompt labels with little ink arrows */
#inktober .ink-label {
  position: absolute; margin: 0; z-index: 2;
  font-family: var(--font-hand);
  font-size: clamp(20px, 1.75vw, 28px);
  line-height: 1; white-space: nowrap;
  color: var(--ink);
}
#inktober .ink-label span { display: inline-block; }
#inktober .ink-arrow {
  position: absolute; z-index: 2;
  overflow: visible; fill: none;
  stroke: var(--ink); stroke-width: 2.6px; stroke-linecap: round; stroke-linejoin: round;
}
#inktober .ink-arrow path { vector-effect: non-scaling-stroke; }
#inktober .ink-label--star { left: -14%; top: -2%; rotate: -16deg; }
#inktober .ink-arrow--star { left: 10%; top: 1%; width: 22%; rotate: 6deg; }
#inktober .ink-label--rowdy { left: 84%; top: 54%; rotate: 6deg; }
#inktober .ink-arrow--rowdy { left: 64%; top: 46%; width: 24%; rotate: 4deg; }
#inktober .ink-label--mustache { left: 46%; top: -9%; rotate: 4deg; }
#inktober .ink-arrow--mustache { left: 34%; top: -6%; width: 16%; rotate: -14deg; }
#inktober .ink-label--rivals { left: 62%; top: -3%; rotate: -10deg; }
#inktober .ink-arrow--rivals { left: 46%; top: 1%; width: 18%; rotate: 8deg; }
#inktober .ink-label--buttons { left: 86%; top: 34%; rotate: 9deg; }
#inktober .ink-arrow--buttons { left: 70%; top: 37%; width: 18%; rotate: 0deg; }

/* ink splats that pop out on hover (built in JS) */
#inktober .ink-splat {
  position: absolute; z-index: 3; pointer-events: none;
  width: 34px; height: 34px; margin: -17px 0 0 -17px;
  overflow: visible;
}
#inktober .ink-splat path, #inktober .ink-splat circle { fill: currentColor; }

/* the giant pink letters, in front of everyone's legs */
#inktober .ink-title {
  position: absolute; left: 0; right: 0; bottom: 0;
  margin: 0; z-index: 4;
  text-align: center;
  font-family: var(--font-display); font-weight: 800;
  font-size: var(--fs); line-height: .8;
  letter-spacing: .035em;
  color: var(--pink);
  text-transform: uppercase;
  pointer-events: none;
}
#inktober .ink-title__word { display: inline-block; white-space: nowrap; padding-left: .035em; }
#inktober .ink-l {
  display: inline-block;
  rotate: var(--r, 0deg);
  transform-origin: 50% 100%;
  pointer-events: auto;
  cursor: pointer;
  will-change: transform;
}

#inktober .ink-hint {
  position: absolute; right: max(var(--gutter), 3vw); bottom: calc(var(--fs) * .86);
  margin: 0; z-index: 5;
  font-family: var(--font-hand); font-size: clamp(17px, 1.3vw, 21px);
  color: var(--ink-soft); rotate: -5deg; white-space: nowrap;
}
#inktober .ink-hint span { color: var(--pink); }
#inktober .ink-swipe { display: none; }

html:not(.js) #inktober .ink-hint { display: none; }

/* ── Phones & small tablets: title on top, swipe strip of characters ──── */
@media (max-width: 899px) {
  #inktober { --s: .5px; --fs: min(15vw, 96px); }
  #inktober .ink-pin {
    height: auto; min-height: 0;
    display: flex; flex-direction: column;
    padding: clamp(92px, 14vh, 130px) 0 clamp(64px, 10vh, 96px);
    overflow: visible;
  }
  #inktober .ink-scene { display: contents; }
  #inktober .ink-title { position: relative; order: 0; bottom: auto; margin: 0 0 22px; line-height: .9; }
  #inktober .ink-top { position: relative; order: 1; top: auto; padding: 0 22px; }
  #inktober .ink-intro { font-size: 19px; line-height: 1.45; }
  #inktober .ink-pot { width: 44px; left: auto; right: 10px; top: -78px; }
  #inktober .ink-dd--1 { left: 14px; top: -70px; }
  #inktober .ink-dd--2 { display: none; }
  #inktober .ink-swipe {
    display: block; order: 2; margin: 18px 22px 0 auto;
    font-family: var(--font-hand); font-size: 18px; color: var(--ink-soft); rotate: -3deg;
  }
  #inktober .ink-swipe span { color: var(--pink); display: inline-block; }
  #inktober .ink-hint { display: none; }

  #inktober .ink-stage {
    position: relative; order: 3; inset: auto;
    margin-top: 4px;
    overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    pointer-events: auto;
    padding: 64px 0 0;
  }
  #inktober .ink-stage::-webkit-scrollbar { display: none; }
  #inktober .ink-cast {
    position: relative; inset: auto;
    width: max-content;
    padding: 0 18vw 22px 12vw;
    gap: 34px;
  }
  /* a wobbly pink floor line for the little stage */
  #inktober .ink-cast::after {
    content: ''; position: absolute; left: 4vw; right: 4vw; bottom: 10px; height: 14px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 14'%3E%3Cpath d='M0 7 C 15 1, 30 13, 45 7 S 75 1, 90 7 S 110 12, 120 7' fill='none' stroke='%23e27ea1' stroke-width='3.4' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x 0 0 / 120px 14px;
    pointer-events: none;
  }
  #inktober .ink-char {
    margin: 0; margin-bottom: calc(var(--fb) * var(--s) * -1);
    scroll-snap-align: center;
  }
  #inktober .ink-char--mustache { margin-right: 0; }
  #inktober .ink-label { font-size: 22px; }
  #inktober .ink-label--star { left: -6%; top: -9%; }
  #inktober .ink-arrow--star { left: 14%; top: -3%; }
  #inktober .ink-label--rowdy { left: 52%; top: -10%; rotate: -6deg; }
  #inktober .ink-arrow--rowdy { left: 36%; top: -7%; width: 22%; rotate: 150deg; }
  #inktober .ink-label--mustache { left: 40%; top: -10%; }
  #inktober .ink-arrow--mustache { left: 28%; top: -8%; }
  #inktober .ink-label--rivals { left: 56%; top: -8%; }
  #inktober .ink-label--buttons { left: 56%; top: -9%; rotate: -6deg; }
  #inktober .ink-arrow--buttons { left: 40%; top: -6%; width: 20%; rotate: 70deg; }
}
