/* Lance stories: each story is a big nametag; the popup form is a paper sheet. Uses tokens from index.html. */
.stories { padding-block: 0 80px; }
/* The dots sit above the card; the arrows sit on either side of it, level with its colored band, so none of them
   move when the card grows or shrinks to fit a story. */
.story-stage { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; position: relative; }
.story-stage > .story-controls { order: -1; margin: 0 0 26px; height: 14px; }
/* slides are stacked; stories.js sets the frame's height to the current slide's */
.slides { position: relative; transition: height .45s ease; }
.slide {
  position: absolute; top: 0; left: 0; right: 0; margin: 0; min-width: 0;
  background: var(--paper); color: var(--paper-ink); border-radius: 20px; overflow: hidden;
  box-shadow: 0 20px 48px rgba(0,0,0,.6), 0 3px 8px rgba(0,0,0,.4);
  border-bottom: 18px solid var(--red);
  opacity: 0; visibility: hidden; transform: rotate(-1.2deg) translateY(8px);
  transition: opacity .5s ease, transform .5s ease, visibility 0s linear .5s;
}
.slide.on { opacity: 1; visibility: visible; transform: rotate(-1.2deg); transition: opacity .5s ease, transform .5s ease; }
.slide:nth-child(3n+2) { border-bottom-color: #1f4fa8; }
.slide:nth-child(3n+2) .slide-band { background: #1f4fa8; }
.slide:nth-child(3n) { border-bottom-color: #1f8048; }
.slide:nth-child(3n) .slide-band { background: #1f8048; }
.slide-band { background: var(--red); color: #fbf8f1; padding: 14px 24px 10px; display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.slide-hello { font: 900 clamp(30px, 6cqi, 44px)/.9 var(--display); font-stretch: 112%; letter-spacing: .02em; }
.slide-mni { font: 600 16px/1 var(--body); }
.slide-body { padding: 18px clamp(20px, 5cqi, 40px) 28px; display: grid; gap: 14px; }
.slide-who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.slide-name { font: 400 clamp(36px, 7cqi, 54px)/1.05 var(--marker); transform: rotate(-1.5deg); overflow-wrap: anywhere; }
.slide-from { font: 500 14px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--paper-dim); overflow-wrap: anywhere; }
.slide-story {
  margin: 0; font-size: clamp(17px, 2.3cqi, 20px); line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere;
  border-left: 4px solid var(--tape); padding-left: 16px;
}

.story-empty {
  background: var(--paper); color: var(--paper-ink); border-radius: 20px; overflow: hidden;
  box-shadow: 0 20px 48px rgba(0,0,0,.6); transform: rotate(-1.2deg); border-bottom: 18px solid var(--red);
}
.story-empty .slide-body { justify-items: start; }
.blank-line { width: 100%; height: 3px; background: var(--paper-ink); opacity: .7; margin: 26px 0 4px; }
.story-empty p { margin: 0; font-size: 18px; }

.story-controls { display: flex; align-items: center; justify-content: center; margin-top: 24px; }
.story-controls .dots { flex-basis: 100%; max-width: none; }
/* card top = dots (14px) + gap (26px); the band's middle is about 34px further down */
.story-stage .arrow-btn { position: absolute; z-index: 2; top: calc(40px + 34px - 26px); }
.story-stage #storyPrev { left: -82px; }
.story-stage #storyNext { right: -82px; }
/* no room beside the card: smaller, and over the edges of its band (no story text there) */
@container (max-width: 940px) {
  .story-stage .ctrl.arrow-btn { width: 44px; height: 44px; top: calc(40px + 34px - 22px); }
  .story-stage .ctrl.arrow-btn svg { width: 22px; height: 22px; }
  .story-stage #storyPrev { left: -10px; }
  .story-stage #storyNext { right: -10px; }
  .story-stage .slide-band { padding-left: 46px; padding-right: 40px; } /* HELLO starts past the arrow */
}
.ctrl {
  font: 700 14px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase;
  color: var(--chalk); background: rgba(16,12,11,.85); border: 1px solid rgba(244,239,228,.3);
  border-radius: 999px; padding: 11px 16px; cursor: pointer; min-height: 44px;
}
.ctrl:hover { border-color: var(--chalk); }
.ctrl:focus-visible, .dot:focus-visible { outline: 3px solid var(--tape); outline-offset: 3px; }
/* round icon buttons */
.slides { touch-action: pan-y; }
.ctrl.arrow-btn {
  width: 52px; height: 52px; min-height: 0; padding: 0; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--paper); color: var(--paper-ink); border: 0; box-shadow: 0 8px 22px rgba(0,0,0,.55), 0 2px 5px rgba(0,0,0,.4);
  transition: transform .12s ease, background .12s ease;
}
.ctrl.arrow-btn svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.ctrl.arrow-btn:hover { background: #fff; transform: scale(1.07); }
.ctrl.arrow-btn:active { transform: scale(.96); }
@media (prefers-reduced-motion: reduce) { .ctrl.arrow-btn { transition: none; } .ctrl.arrow-btn:hover { transform: none; } }
.dots { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: 60%; }
.dot {
  width: 12px; height: 12px; border-radius: 50%; padding: 0; cursor: pointer;
  border: 2px solid var(--chalk); background: transparent;
}
.dot[aria-current="true"] { background: var(--chalk); }

.story-cta {
  max-width: 760px; margin: 40px auto 0; display: grid; justify-items: center; text-align: center; gap: 16px;
}
.story-cta p {
  margin: 0; max-width: 48ch; font-size: 18px;
  background: rgba(14,11,10,.86); border-radius: 12px; padding: 14px 18px;
}
button.btn { cursor: pointer; }

/* ---------- popup ---------- */
.sheet {
  width: min(580px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0;
  border: 0; border-radius: 18px; background: var(--paper); color: var(--paper-ink);
  box-shadow: 0 30px 80px rgba(0,0,0,.7); overflow: auto;
}
.sheet::backdrop { background: rgba(8,6,5,.78); }
.sheet-band { background: var(--red); color: #fbf8f1; padding: 14px 20px 10px; display: flex; justify-content: space-between; align-items: start; gap: 12px; position: sticky; top: 0; z-index: 1; }
.sheet-band b { display: block; font: 900 34px/.9 var(--display); font-stretch: 112%; letter-spacing: .02em; }
.sheet-band span { font: 600 14px/1.2 var(--body); }
.x {
  width: 44px; height: 44px; flex: none; border-radius: 50%; border: 2px solid rgba(251,248,241,.6);
  background: transparent; color: #fbf8f1; font: 400 26px/1 var(--body); cursor: pointer;
}
.x:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.sheet-body { padding: 20px 22px 24px; display: grid; gap: 16px; }
.sheet h2 { margin: 0; font: 400 32px/1.05 var(--marker); }
.sheet .lead { margin: 0; color: var(--paper-dim); font-size: 15px; }
.fld { display: grid; gap: 6px; font-weight: 800; font-size: 15px; }
.fld small { font-weight: 400; color: var(--paper-dim); font-size: 13px; line-height: 1.4; }
.fld input, .fld textarea {
  width: 100%; font: 400 17px/1.4 var(--body); color: var(--paper-ink);
  background: #fffdf8; border: 2px solid #cfc6b4; border-radius: 10px; padding: 12px 14px;
}
.fld textarea { resize: vertical; min-height: 150px; }
.fld input:focus, .fld textarea:focus { outline: none; border-color: var(--paper-ink); box-shadow: 0 0 0 3px rgba(200,32,43,.25); }
.fld .count { font: 400 12px/1 var(--mono); color: var(--paper-dim); justify-self: end; font-weight: 400; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .two { grid-template-columns: 1fr; } }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.fine { margin: 0; font-size: 13px; color: var(--paper-dim); line-height: 1.5; }
.form-msg { margin: 0; min-height: 1.4em; font-weight: 700; font-size: 15px; }
.form-msg.err { color: var(--red); }
.sheet .btn { justify-self: start; font-size: 18px; padding: 15px 22px 14px; border-width: 0; box-shadow: 0 5px 0 var(--red-deep); }
.sheet .btn:disabled { opacity: .55; cursor: default; }
.done { text-align: left; }
.done p { margin: 0; font-size: 17px; }
.done .scrawl { font: 400 26px/1.2 "Gochi Hand", var(--marker); color: #1d3486; transform: rotate(-1deg); }

@media (prefers-reduced-motion: reduce) {
  .slide, .slide.on, .slides { transition: none; }
}
