/* Sticky Sound · the 1-minute story — layered on tokens.css + styles.css (stickers, tap button, CTA). */

html:has(body.wt), body.wt { height: 100%; overflow: hidden; }
body.wt { background: var(--color-lemon); overscroll-behavior: none; }

/* ---------- stage ---------- */
.wt-stage { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.wt-cvs { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.wt-stage.is-impact { filter: invert(1) hue-rotate(180deg); }

.wt-say {
  --say: var(--color-ink);
  position: absolute; z-index: 2;
  left: var(--gutter); right: var(--gutter);
  top: calc(5.25rem + env(safe-area-inset-top));
  display: grid; justify-items: center; gap: var(--space-sm);
  text-align: center;
  color: var(--say);
  pointer-events: none;
}
.wt-say[data-tone="light"] { --say: var(--color-white); }
.wt-line {
  max-width: 15ch;
  margin: 0;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2rem, 1rem + 5.4vw, 4.4rem);
  line-height: 0.98; letter-spacing: -0.02em;
  text-wrap: balance;
}
.wt-sub { margin: 0; max-width: 26ch; font-family: var(--font-display); font-weight: 600; font-size: var(--text-lg); line-height: 1.2; }
.wt-say .sticker { font-size: var(--text-sm); }
.wt-say[data-tone="light"] .wt-line, .wt-say[data-tone="light"] .wt-sub {
  -webkit-text-stroke: 0.09em var(--color-ink);
  paint-order: stroke fill;
  text-shadow: 0.05em 0.07em 0 var(--color-ink);
}
.wt-say[data-tone="light"] mark { color: var(--color-ink); -webkit-text-stroke: 0; text-shadow: none; }

/* anime sound-effect stickers */
.wt-sfx { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; }
.sfx {
  position: absolute;
  margin: 0;
  font-family: var(--font-display), "Hiragino Maru Gothic ProN", "Hiragino Sans", sans-serif;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
  white-space: nowrap;
  color: var(--sfx, var(--color-lemon));
  -webkit-text-stroke: 0.1em var(--color-ink);
  paint-order: stroke fill;
  text-shadow: 0.07em 0.09em 0 var(--color-ink);
  transform: translate(-50%, -50%) rotate(var(--r, -8deg));
  will-change: transform, opacity;
}

/* ---------- header on top of the stage ---------- */
.wt-top { position: fixed; z-index: 20; }
/* V1 pop: at the end the story fades to the page's yellow, then hands back to the page (walkthrough.js backToPage) */
.wt::after { content: ""; position: fixed; inset: 0; z-index: 60; background: var(--color-lemon); opacity: 0; pointer-events: none; transition: opacity 0.5s var(--ease-out); }
.wt.is-leaving::after { opacity: 1; }
.wt-top .logo {
  padding: 0.3rem 0.85rem 0.3rem 0.35rem;
  border: var(--rule-thick) solid var(--color-ink);
  border-radius: var(--radius-pill);
  background: var(--color-white);
  box-shadow: 0.18rem 0.2rem 0 var(--color-ink);
  font-size: 1.05rem;
}
.wt-top .logo-blob { width: 1.6rem; height: 1.6rem; }

/* ---------- intro ---------- */
.wt-intro {
  position: fixed; inset: 0; z-index: 10;
  display: grid; place-content: center; justify-items: center; gap: var(--space-lg);
  padding: 6rem var(--gutter) var(--space-2xl);
  text-align: center;
}
.wt-kicker { --rot: -5deg; background: var(--color-mint); animation: wiggle 2.8s var(--ease-in-out) infinite; }
.wt-title { font-size: clamp(2.4rem, 1rem + 7vw, 5.5rem); max-width: 11ch; }
.wt-play { --size: min(72vw, 40svh, 400px); margin-top: var(--space-xl); }
.wt-play:disabled { cursor: progress; }
.wt-play:disabled .tap-face { opacity: 0.6; }
.wt-note { font-family: var(--font-display); font-weight: 600; font-size: var(--text-sm); color: var(--color-ink-soft); margin-top: var(--space-md); }
body:not([data-phase="intro"]) .wt-intro { display: none; }

/* ---------- end card ---------- */
.wt-end {
  position: fixed; inset: 0; z-index: 10;
  display: grid; grid-template-columns: minmax(0, 1fr); place-content: center; justify-items: center;
  padding: 6rem var(--gutter) 8rem;
  text-align: center;
  overflow-y: auto;
}
.wt-end[hidden] { display: none; }
.wt-end-h { font-size: clamp(2.6rem, 1rem + 7.4vw, 6.5rem); }
.wt-end .demo-btn { margin-top: var(--space-xl); }
.wt-end-links { margin-top: var(--space-xl); display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-sm) var(--space-xl); }
.wt-end-links a, .wt-end-links button {
  padding: 0.4rem 0.2rem;
  border: 0; background: none; cursor: pointer;
  font-family: var(--font-display); font-weight: 700; font-size: var(--text-md);
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.22em;
  white-space: nowrap;
}

/* ---------- transport ---------- */
.wt-bar {
  position: fixed; z-index: 20;
  left: 50%; bottom: calc(var(--space-md) + env(safe-area-inset-bottom));
  width: min(40rem, calc(100vw - 2 * var(--space-md)));
  transform: translateX(-50%);
  display: flex; align-items: center; gap: var(--space-sm);
  padding: 0.4rem;
  border: var(--rule-thick) solid var(--color-ink);
  border-radius: var(--radius-pill);
  background: var(--color-white);
  box-shadow: 0.25rem 0.3rem 0 var(--color-ink);
  transition: opacity var(--dur-med) var(--ease-out), transform var(--dur-slow) var(--ease-squish);
}
body[data-phase="intro"] .wt-bar { opacity: 0; visibility: hidden; transform: translate(-50%, 150%); }
.wt-pause {
  flex: none; width: 2.75rem; height: 2.75rem; padding: 0;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--color-ink); color: var(--color-white);
  cursor: pointer;
  transition: transform var(--dur-med) var(--ease-squish);
}
.wt-pause svg { width: 1.25rem; height: 1.25rem; fill: currentColor; }
.wt-pause .i-play, body.is-paused .wt-pause .i-pause { display: none; }
body.is-paused .wt-pause .i-play { display: block; }
.wt-pause:active, .wt-next:active { transform: scale(0.9, 0.84); transition-duration: 80ms; }
.wt-chapters { flex: 1; min-width: 0; display: grid; gap: 0.3rem; }
.wt-chap { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: var(--text-xs); line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wt-segs { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.wt-segs li { flex: var(--w, 1) 1 0; min-width: 0; }
.wt-seg {
  position: relative; display: block; width: 100%; height: 0.55rem; padding: 0;
  border: 0; border-radius: var(--radius-pill);
  background: color-mix(in oklch, var(--color-ink) 16%, transparent);
  overflow: hidden; cursor: pointer;
}
.wt-seg::after { content: ""; position: absolute; inset: 0; width: calc(var(--p, 0) * 100%); background: var(--color-ink); border-radius: inherit; }
.wt-seg:focus-visible { outline-offset: 2px; }
.wt-next {
  flex: none;
  padding: 0.6rem 1rem 0.65rem;
  border: 0; border-radius: var(--radius-pill);
  background: var(--color-lemon); color: var(--color-ink);
  font-family: var(--font-display); font-weight: 700; font-size: var(--text-sm); line-height: 1;
  white-space: nowrap; cursor: pointer;
  transition: transform var(--dur-med) var(--ease-squish);
}
body[data-phase="end"] .wt-next { visibility: hidden; }

@media (prefers-reduced-motion: reduce) {
  .wt-kicker { animation: none; }
  .wt-stage.is-impact { filter: none; }
}
