/* =========================================================
   Yumemi: Y2K retro folklore
   Watercolour East Asia around the year 2000, wrapped in a Japan/Korea 2000s pop homepage:
   candy-gloss buttons, sticker-booth stickers, pixel labels, polka dots and holographic cards.
   Morning (default): pastel candy paper. Night: violet sky, neon glow, stars and fireflies.
   Every section fills the screen (100svh).
   ========================================================= */
@font-face {
  font-family: "Hachi Maru Pop";
  src: url("../fonts/hachi-maru-pop.woff") format("woff");
  font-display: swap;
}

@font-face {
  font-family: "DotGothic16";
  src: url("../fonts/dotgothic16.woff") format("woff");
  font-display: swap;
}

@font-face {
  font-family: "Zen Maru Gothic";
  src: url("../fonts/zen-maru-gothic-500.woff") format("woff");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Zen Maru Gothic";
  src: url("../fonts/zen-maru-gothic-700.woff") format("woff");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Zen Maru Gothic";
  src: url("../fonts/zen-maru-gothic-900.woff") format("woff");
  font-weight: 900;
  font-display: swap;
}

@font-face {
  font-family: "Yuji Syuku";
  src: url("../fonts/yuji-syuku.woff") format("woff");
  font-display: swap;
}

:root {
  /* candy palette */
  --pink: #ff8fc6;
  --pink-deep: #f0559a;
  --blue: #8fd3ff;
  --lilac: #b9a4ff;
  --mint: #8fe8c9;
  --lemon: #ffe98a;
  --seal: #e0443a;
  /* lantern red, for the folklore seals */
  --plum: #3d2c4f;

  /* morning (default) */
  --ground: #fff4f9;
  --dots: rgba(255, 143, 198, .2);
  --paper: #ffffff;
  --pool: #ffffff;
  --ink: var(--plum);
  --ink-soft: #7a6890;
  --accent: var(--pink-deep);
  --rule: rgba(61, 44, 79, .12);
  --outline: #ffffff;
  /* the white sticker outline around display text */
  --art-filter: none;

  --font-pop: "Hachi Maru Pop", "Zen Maru Gothic", sans-serif;
  --font-pixel: "DotGothic16", "Zen Maru Gothic", monospace;
  --font-text: "Zen Maru Gothic", system-ui, sans-serif;
  --font-brush: "Yuji Syuku", serif;
  --road: .885;
  /* where the pavement runs in every journey painting */

  /* candy colours, swapped for muted slate at night */
  --c-top: #ffa9d4;
  --c-bot: #f0559a;
  --c-glow: rgba(240, 85, 154, .35);
  --c-text: rgba(180, 30, 100, .45);
  --tag-top: #c9b8ff;
  --tag-bot: #8f73ff;
  --tag-glow: rgba(143, 115, 255, .3);
  --tint: rgba(240, 85, 154, .28);
  --menu-bot: #ffe9f4;

  --gloss: linear-gradient(180deg, rgba(255, 255, 255, .85) 0%, rgba(255, 255, 255, .25) 48%, rgba(255, 255, 255, 0) 52%, rgba(255, 255, 255, .25) 100%);
  color-scheme: light;
}

:root[data-theme="night"] {
  /* night is the same white paper, dimmed: darker dots, dark-blue patches, no pink, quieter colours */
  --ground: #eceef3;
  --dots: rgba(34, 48, 94, .3);
  --paper: #f7f8fb;
  --pool: #ffffff;
  --ink: #262c42;
  --ink-soft: #586079;
  --accent: #46557f;
  --rule: rgba(38, 44, 66, .14);
  --outline: #ffffff;
  --art-filter: brightness(.86) saturate(.6);
  --pink: #a3abc4;
  --pink-deep: #4d5a85;
  --lilac: #a3a8c8;
  --blue: #93a6c9;
  --mint: #a9b8b6;
  --lemon: #c8c4ad;
  --c-top: #aab4d0;
  --c-bot: #4d5a85;
  --c-glow: rgba(50, 65, 110, .28);
  --c-text: rgba(20, 30, 60, .4);
  --tag-top: #b7bdd8;
  --tag-bot: #5d6893;
  --tag-glow: rgba(50, 65, 110, .22);
  --tint: rgba(50, 65, 110, .22);
  --menu-bot: #eef0f6;
  color-scheme: light;
}

/* =========================================================
   Base: polka-dot candy paper with soft pastel glows
   ========================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-text);
  font-weight: 500;
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--ink);
  background-color: var(--ground);
  background-image:
    radial-gradient(var(--dots) 2px, transparent 2.4px),
    radial-gradient(60vmax 50vmax at 0% 0%, rgba(255, 170, 214, .28), transparent 60%),
    radial-gradient(60vmax 50vmax at 100% 100%, rgba(143, 211, 255, .26), transparent 60%);
  background-size: 26px 26px, auto, auto;
  background-attachment: fixed;
  transition: background-color 1.2s, color 1.2s;
  overflow-x: hidden;
}

:root[data-theme="night"] body {
  background-image:
    radial-gradient(var(--dots) 2px, transparent 2.4px),
    radial-gradient(38vmax 30vmax at 8% 12%, rgba(32, 46, 100, .16), transparent 70%),
    radial-gradient(30vmax 26vmax at 92% 40%, rgba(32, 46, 100, .13), transparent 70%),
    radial-gradient(42vmax 30vmax at 30% 88%, rgba(32, 46, 100, .14), transparent 70%);
}

p {
  margin: 0 0 1em;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 900;
}

button {
  font: inherit;
}

::selection {
  background: var(--pink);
  color: #fff;
}

:focus-visible {
  outline: 3px dotted var(--accent);
  outline-offset: 4px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--paper);
  color: var(--ink);
}

.skip:focus {
  left: 8px;
}

#ambient {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

#audioVisualizer {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 44px;
  z-index: 40;
  pointer-events: none;
}

main,
.footer {
  position: relative;
  z-index: 1;
}

main {
  overflow-x: clip;
}

.screen {
  min-height: 100svh;
  position: relative;
}

/* the white "sticker" outline around display text (a dark outline at night, with a neon glow) */
.sticker-text,
.title-ja span,
.head-ja,
.journey-intro .head-ja,
.finale-title {
  text-shadow:
    3px 0 0 var(--outline), -3px 0 0 var(--outline), 0 3px 0 var(--outline), 0 -3px 0 var(--outline),
    2px 2px 0 var(--outline), -2px -2px 0 var(--outline), 2px -2px 0 var(--outline), -2px 2px 0 var(--outline),
    5px 6px 0 var(--tint);
}

/* Paintings sit in a soft pool of white paper (moonlight at night) */
.pool {
  position: absolute;
  inset: -8%;
  z-index: -1;
  background: radial-gradient(closest-side, var(--pool) 52%, transparent);
  transition: background 1.2s, opacity 1.2s;
  opacity: .9;
}

.art {
  filter: var(--art-filter);
  transition: filter 1.2s;
}

.hero-path,
.bleed .art {
  -webkit-mask-image: radial-gradient(circle at 45% 65%, #000 calc(var(--r, 160%) - 32%), transparent var(--r, 160%));
  mask-image: radial-gradient(circle at 45% 65%, #000 calc(var(--r, 160%) - 32%), transparent var(--r, 160%));
}

/* the noodle cover is cropped from a wider painting: fade its cut top and right edges too */
.atlas-cover .art {
  -webkit-mask-image:
    radial-gradient(circle at 45% 65%, #000 calc(var(--r, 160%) - 32%), transparent var(--r, 160%)),
    linear-gradient(to right, #000 80%, transparent),
    linear-gradient(to bottom, transparent, #000 16%);
  -webkit-mask-composite: source-in, source-in;
  mask-image:
    radial-gradient(circle at 45% 65%, #000 calc(var(--r, 160%) - 32%), transparent var(--r, 160%)),
    linear-gradient(to right, #000 80%, transparent),
    linear-gradient(to bottom, transparent, #000 16%);
  mask-composite: intersect;
}

/* word-by-word reveals (words are wrapped by js/reveal.js) */
.split .w {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: .1em;
  margin-bottom: -.1em;
}

.split .wi {
  display: inline-block;
  will-change: transform;
}

/* candy-gloss button: the Y2K jelly look */
.candy,
.open-toy,
.ink-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 26px;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-text);
  font-weight: 900;
  font-size: 1.02rem;
  text-decoration: none;
  letter-spacing: .02em;
  color: #fff;
  text-shadow: 0 1px 0 var(--c-text);
  background: var(--gloss), linear-gradient(180deg, var(--c-top), var(--c-bot));
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--c-bot), 0 8px 18px var(--c-glow), inset 0 -4px 8px rgba(0, 0, 0, .15);
  transition: transform .15s, box-shadow .15s, filter .15s;
}

.candy:hover,
.open-toy:hover,
.ink-link:hover {
  transform: translateY(-2px) scale(1.02);
  filter: saturate(1.1);
}

.candy:active,
.open-toy:active,
.ink-link:active {
  transform: translateY(1px) scale(.98);
}

/* little stickers: "new!", "♡ fave" */
.sticker {
  position: absolute;
  z-index: 4;
  top: 4%;
  right: 6%;
  padding: 4px 12px 5px;
  border-radius: 999px;
  font-family: var(--font-pixel);
  font-size: .95rem;
  line-height: 1.2;
  color: #fff;
  background: var(--gloss), linear-gradient(180deg, var(--c-top), var(--c-bot));
  border: 3px solid #fff;
  box-shadow: 0 4px 12px var(--c-glow);
  transform: rotate(10deg);
  animation: blink 1.2s steps(2, jump-none) infinite;
}

@keyframes blink {
  50% {
    filter: brightness(1.25);
    transform: rotate(10deg) scale(1.08);
  }
}

/* =========================================================
   Top bar: folklore seals + a glossy pixel menu; hides while scrolling down
   ========================================================= */
.topbar {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px 22px;
  transition: transform .45s ease;
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to bottom, var(--ground) 60%, transparent);
  opacity: 0;
  transition: opacity .45s, background .45s;
}

.topbar.scrolled::before {
  opacity: 1;
}

.topbar.hidden {
  transform: translateY(-110%);
}

.controls {
  display: flex;
  gap: 12px;
}

.name-seal {
  display: grid;
  place-items: center;
  flex: none;
  width: 46px;
  height: 64px;
  font-family: var(--font-brush);
  font-size: 1.15rem;
  line-height: 1.05;
  writing-mode: vertical-rl;
  color: #fff4ea;
  text-decoration: none;
  background: var(--seal);
  border-radius: 6px 9px 7px 10px;
  box-shadow: inset 0 0 0 3px rgba(255, 240, 225, .35), 0 6px 14px rgba(224, 68, 58, .3);
}

.seal {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--ink);
  min-width: 52px;
}

.seal-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  font-family: var(--font-brush);
  font-size: 1.55rem;
  line-height: 1;
  color: #fff4ea;
  background: var(--seal);
  border: 3px solid var(--seal);
  border-radius: 7px 10px 8px 11px;
  transform: rotate(-4deg);
  box-shadow: 0 6px 14px rgba(224, 68, 58, .3);
  transition: transform .2s, background-color .2s, color .2s;
}

.seal:hover .seal-mark {
  transform: rotate(0deg) scale(1.06);
}

.seal:active .seal-mark {
  transform: scale(.92);
}

#soundToggle[aria-pressed="false"] .seal-mark,
#volSeal[data-muted="true"] .seal-mark {
  color: var(--seal);
  background: #fff6ee;
  border-color: rgba(224, 68, 58, 0.45);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

:root[data-theme="night"] #soundToggle[aria-pressed="false"] .seal-mark,
:root[data-theme="night"] #volSeal[data-muted="true"] .seal-mark {
  color: var(--ink-soft);
  background: #251e44;
  border-color: #4b4185;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.seal-cap {
  font-family: var(--font-pixel);
  font-size: .74rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.menu {
  display: flex;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .95), var(--menu-bot));
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--pink), 0 8px 20px var(--c-glow);
}

.menu a {
  padding: 6px 15px;
  border-radius: 999px;
  font-family: var(--font-pixel);
  font-size: .92rem;
  text-decoration: none;
  color: var(--ink);
  transition: background .25s, color .25s;
}

.menu a:hover {
  color: var(--accent);
}

.menu a[aria-current="true"] {
  color: #fff;
  background: var(--gloss), linear-gradient(180deg, var(--c-top), var(--c-bot));
  text-shadow: 0 1px 0 var(--c-text);
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .95fr);
  align-items: center;
  gap: clamp(16px, 3vw, 48px);
  padding: 92px clamp(16px, 6vw, 96px) 56px;
  max-width: 1400px;
  margin: 0 auto;
}

.hero-copy {
  display: flex;
  align-items: flex-start;
  gap: clamp(18px, 3vw, 44px);
}

.hero-title {
  writing-mode: vertical-rl;
  display: flex;
  gap: 10px;
  flex: none;
}

.title-ja {
  display: flex;
  font-family: var(--font-pop);
  font-size: clamp(4.6rem, 10vw, 9rem);
  line-height: 1.05;
}

.title-ja {
  color: var(--ink);
}

.title-ja span {
  display: block;
}

.title-en {
  font-family: var(--font-pixel);
  font-size: clamp(1rem, 1.6vw, 1.3rem);
  letter-spacing: .35em;
  color: var(--accent);
  padding-top: .6em;
}

.hero-text {
  padding-top: clamp(16px, 7svh, 90px);
  max-width: 31rem;
}

.tagline {
  font-family: var(--font-pixel);
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  color: var(--accent);
  margin-bottom: .6em;
  letter-spacing: .04em;
}

.lede {
  font-weight: 900;
  font-size: clamp(1.9rem, 3.5vw, 3rem);
  line-height: 1.22;
  margin-bottom: 1em;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 26px;
  margin: 0;
}

.soft-link {
  font-family: var(--font-pixel);
  color: var(--ink);
  text-decoration: underline dotted var(--pink);
  text-underline-offset: 6px;
  text-decoration-thickness: 3px;
}

.soft-link:hover {
  color: var(--accent);
}

.hero-art {
  position: relative;
  margin: 0;
  justify-self: center;
  isolation: isolate;
  height: min(84svh, 820px);
  aspect-ratio: 3 / 4;
  max-width: 100%;
}

.hero-path {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero-art .sticker {
  top: 8%;
  right: 10%;
}

/* the date stamp a sticker-photo booth prints in the corner */
.purikura-date {
  position: absolute;
  z-index: 3;
  right: 6%;
  bottom: 3%;
  font-family: var(--font-pixel);
  font-size: clamp(.9rem, 1.3vw, 1.1rem);
  color: var(--pink-deep);
  text-shadow: 2px 0 0 #fff, -2px 0 0 #fff, 0 2px 0 #fff, 0 -2px 0 #fff;
  transform: rotate(-4deg);
}

.yumemi {
  all: unset;
  cursor: pointer;
  position: absolute;
  z-index: 2;
  left: 6%;
  bottom: 3%;
  height: 54%;
  display: flex;
  align-items: flex-end;
  transform-origin: 50% 95%;
}

.yumemi:focus-visible {
  outline: 3px dotted var(--accent);
  outline-offset: 4px;
  border-radius: 12px;
}

.pose-wrap {
  position: relative;
  display: block;
  height: 100%;
  transform-origin: 50% 100%;
  animation: breathe 4s ease-in-out infinite;
}

.yumemi .pose {
  position: relative;
  display: block;
  height: 100%;
  width: auto;
  max-width: none;
  filter: drop-shadow(0 14px 14px rgba(90, 40, 80, .18));
}

.yumemi[data-pose="sleep"] .pose-wrap {
  height: 60%;
}

@keyframes breathe {
  50% {
    transform: scale(1.014, .986);
  }
}

.yumemi.bounce .pose-wrap {
  animation: hop .45s ease-out;
}

@keyframes hop {
  40% {
    transform: translateY(-16px) scale(1.03, .97);
  }
}

/* her eyes: drawn over the painted ones in the lantern pose; the pupils follow the cursor */
.eyes {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.eye-look {
  transition: transform .12s ease-out;
}

.yumemi:not([data-pose="lantern"]) .eyes {
  display: none;
}

/* the glow of the lantern she holds: it softly pulses by day (a hint that it does something),
   and shines at night */
.lantern-glow {
  position: absolute;
  z-index: 1;
  left: -1.2%;
  top: 47.7%;
  width: 35%;
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 200, 120, .9), rgba(255, 140, 70, .3) 55%, transparent);
  mix-blend-mode: screen;
  animation: lantern-pulse 2.6s ease-in-out infinite;
}

.yumemi[data-pose="sleep"] .lantern-glow {
  left: 27.2%;
  top: 57%;
  width: 30%;
}

.yumemi:not([data-pose="lantern"]):not([data-pose="sleep"]) .lantern-glow {
  display: none;
}

@keyframes lantern-pulse {

  0%,
  100% {
    opacity: .25;
    transform: scale(.92);
  }

  50% {
    opacity: .7;
    transform: scale(1.08);
  }
}

:root[data-theme="night"] .lantern-glow {
  animation-name: lantern-night;
}

@keyframes lantern-night {

  0%,
  100% {
    opacity: .85;
    transform: scale(1);
  }

  45% {
    opacity: 1;
    transform: scale(1.1);
  }

  60% {
    opacity: .9;
    transform: scale(.96);
  }
}

/* the Easter egg: a wish lantern floating up into the sky */
.wish-lantern {
  position: fixed;
  z-index: 70;
  pointer-events: none;
  height: auto;
  filter: drop-shadow(0 0 10px rgba(255, 190, 110, .95)) drop-shadow(0 0 26px rgba(255, 140, 80, .6));
}

/* her messages look like a little flip-phone text */
.bubble,
.companion-bubble {
  pointer-events: none;
  margin: 0;
  padding: 7px 14px 9px;
  font-size: .95rem;
  line-height: 1.5;
  font-weight: 700;
  color: var(--plum);
  background: #fff;
  border: 2px solid var(--pink);
  border-radius: 16px 16px 16px 4px;
  box-shadow: 0 0 0 3px #fff, 0 10px 22px var(--c-glow);
}

.bubble::before,
.companion-bubble::before {
  content: "✉ yumemi";
  display: block;
  margin-bottom: 1px;
  font-family: var(--font-pixel);
  font-size: .72rem;
  font-weight: 400;
  color: var(--pink-deep);
  letter-spacing: .06em;
}

.bubble {
  position: absolute;
  z-index: 3;
  left: 46%;
  top: 34%;
  max-width: 230px;
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 6px;
  font-family: var(--font-pixel);
  font-size: .85rem;
  letter-spacing: .2em;
  color: var(--accent);
  text-decoration: none;
}

.scroll-cue i {
  width: 3px;
  height: 38px;
  border-radius: 2px;
  background: linear-gradient(var(--pink-deep), transparent);
  animation: drip 1.8s ease-in-out infinite;
  transform-origin: top;
}

@keyframes drip {
  0% {
    transform: scaleY(0);
    opacity: 1;
  }

  70% {
    transform: scaleY(1);
    opacity: 1;
  }

  100% {
    transform: scaleY(1);
    opacity: 0;
  }
}

/* =========================================================
   Companion: Yumemi follows you after the hero
   ========================================================= */
.companion {
  position: fixed;
  z-index: 45;
  right: clamp(10px, 2vw, 28px);
  bottom: clamp(10px, 2vw, 24px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  pointer-events: none;
}

.companion[hidden] {
  display: none;
}

.companion-cat {
  all: unset;
  cursor: pointer;
  pointer-events: auto;
  display: block;
}

.companion-cat:focus-visible {
  outline: 3px dotted var(--accent);
  outline-offset: 4px;
  border-radius: 12px;
}

.companion-cat img {
  height: clamp(104px, 17svh, 160px);
  width: auto;
  max-width: none;
  filter: drop-shadow(0 8px 10px rgba(60, 20, 60, .22));
  transform-origin: 50% 100%;
}

.companion-bubble {
  margin-right: 22px;
  max-width: 200px;
  font-size: .86rem;
  border-radius: 16px 16px 4px 16px;
}

.companion-bubble:empty {
  display: none;
}

/* =========================================================
   Section headings: a big pop-handwriting word with a pixel name tag
   ========================================================= */
.section-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-bottom: clamp(20px, 4svh, 44px);
}

.head-ja {
  font-family: var(--font-pop);
  font-weight: 400;
  font-size: clamp(2.8rem, 6.5vw, 4.8rem);
  line-height: 1.1;
  color: var(--ink);
}

.head-en {
  font-family: var(--font-pixel);
  font-weight: 400;
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  color: #fff;
  padding: 4px 14px 5px;
  border-radius: 999px;
  transform: rotate(-3deg);
  background: var(--gloss), linear-gradient(180deg, var(--tag-top), var(--tag-bot));
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--tag-bot), 0 6px 14px var(--tag-glow);
}

/* =========================================================
   Selected work: placeholder cards (projects to come)
   ========================================================= */
.work {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 1240px;
  margin: 0 auto;
  padding: 104px clamp(16px, 5vw, 64px) 72px;
}

.placeholders {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 3vw, 36px);
}

.ph-card {
  padding: 14px 14px 20px;
  border-radius: 22px;
  background: var(--paper);
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--pink), 0 18px 36px var(--c-glow);
}

.ph-card:nth-child(2) {
  transform: rotate(1.2deg);
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--lilac), 0 18px 36px var(--tag-glow);
}

.ph-card:nth-child(3) {
  transform: rotate(-1deg);
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--blue), 0 18px 36px var(--c-glow);
}

.ph-art {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  margin-bottom: 16px;
  border-radius: 14px;
  background:
    radial-gradient(var(--dots) 2px, transparent 2.4px) 0 0 / 18px 18px,
    linear-gradient(135deg, color-mix(in srgb, var(--pink) 30%, #fff), color-mix(in srgb, var(--lilac) 30%, #fff), color-mix(in srgb, var(--blue) 30%, #fff));
  border: 2px dashed var(--pink);
  overflow: hidden;
}

.ph-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 12px;
  transition: transform .35s ease;
}

.ph-card:hover .ph-art img {
  transform: scale(1.05);
}

.ph-num {
  position: absolute;
  bottom: 8px;
  left: 10px;
  z-index: 2;
  font-family: var(--font-pop);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  line-height: 1;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(4px);
  padding: 4px 10px 2px;
  border-radius: 999px;
  border: 2px solid #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.ph-art .sticker {
  top: 10px;
  right: 10px;
  z-index: 3;
}

.ph-card h3 {
  font-size: clamp(1.3rem, 2vw, 1.6rem);
  padding: 0 6px;
}

.ph-note {
  margin: 4px 0 0;
  padding: 0 6px;
  font-family: var(--font-pixel);
  font-size: .92rem;
  color: var(--ink-soft);
}

/* =========================================================
   Story: pinned, cinematic, one chapter per place
   ========================================================= */
.journey {
  position: relative;
}

.journey-pin {
  position: relative;
  height: 100svh;
  overflow: hidden;
  background-color: var(--journey-bg, transparent);
}

.journey-intro {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, 90vw);
  text-align: center;
  pointer-events: none;
}

.journey-intro .head-ja {
  display: block;
  font-size: clamp(5rem, 14vw, 10rem);
  color: var(--pink-deep);
}

.journey-intro h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.journey-intro p {
  font-family: var(--font-pixel);
  color: var(--ink-soft);
  margin-top: .4em;
}

.stage {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  padding-bottom: 2svh;
}

.strip {
  --scene-h: min(70svh, 62vw);
  position: relative;
  height: var(--scene-h);
  width: 100%;
  min-width: 0;
  transform-origin: 50% 82%;
  will-change: transform;
}

.track {
  display: flex;
  height: 100%;
  width: max-content;
  will-change: transform;
  /* soften the top of the paintings so the sky never ends in a straight line */
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 16%);
  mask-image: linear-gradient(to bottom, transparent, #000 16%);
}

.scene {
  height: 100%;
  width: auto;
  max-width: none;
  flex: none;
}

.scene+.scene {
  margin-left: calc(var(--scene-h) * -.16);
}

.walker {
  --walker-x: 50%;
  position: absolute;
  z-index: 2;
  left: var(--walker-x);
  bottom: calc(var(--scene-h) * (1 - var(--road)));
  height: calc(var(--scene-h) * .3);
  width: auto;
  max-width: none;
  transform: translateX(-50%);
  pointer-events: none;
  filter: drop-shadow(0 6px 6px rgba(60, 30, 60, .2));
}

.walker.facing-left {
  transform: translateX(-50%) scaleX(-1);
}

.chapters {
  list-style: none;
  margin: 0;
  padding: 0;
}

.chapter {
  position: absolute;
  z-index: 3;
  left: clamp(16px, 6vw, 96px);
  top: clamp(84px, 12svh, 120px);
  width: min(470px, 86vw);
  padding: 10px 22px 16px 0;
  visibility: hidden;
  opacity: 0;
}

.chapter::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -50px -80px -60px -90px;
  background: radial-gradient(closest-side, var(--journey-bg, var(--ground)) 45%, transparent);
  opacity: .94;
}

.stop-tag {
  display: inline-block;
  padding: 3px 12px 4px;
  border-radius: 999px;
  font-family: var(--font-pixel);
  font-size: .9rem;
  letter-spacing: .06em;
  color: #fff;
  background: var(--gloss), linear-gradient(180deg, var(--c-top), var(--c-bot));
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--c-bot), 0 6px 14px var(--c-glow);
  transform: rotate(-3deg);
}

.chapter h3 {
  font-size: clamp(1.9rem, 3.4vw, 2.7rem);
  line-height: 1.15;
  margin: 8px 0 12px;
}

.chapter p {
  margin: 0;
  font-size: clamp(1.1rem, 1.8vw, 1.28rem);
  line-height: 1.75;
}

/* =========================================================
   Growth chart (skills)
   ========================================================= */
.growth {
  display: grid;
  place-items: center;
  padding: 104px clamp(16px, 5vw, 64px) 72px;
}

.growth-inner {
  width: 100%;
  max-width: 1100px;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: end;
}

.growth-lede {
  font-size: clamp(1.4rem, 2.8vw, 2rem);
  font-weight: 900;
  line-height: 1.3;
  max-width: 18ch;
}

.post {
  --post-h: min(66svh, 560px);
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
  height: var(--post-h);
  border-left: 26px solid #e8b98a;
  background: linear-gradient(90deg, rgba(255, 143, 198, .12), transparent 55%);
  transform-origin: 50% 100%;
}

.post::after {
  content: "";
  position: absolute;
  left: -26px;
  top: 0;
  bottom: 0;
  width: 26px;
  background: repeating-linear-gradient(180deg, transparent 0 22px, rgba(120, 70, 30, .18) 22px 24px);
}

.post li {
  position: absolute;
  left: -26px;
  bottom: calc(var(--h) / 100 * (var(--post-h) - 40px));
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding-left: 46px;
}

.post li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 40px;
  height: 5px;
  margin-top: -2px;
  background: var(--pink-deep);
  border-radius: 3px;
  transform-origin: left;
}

.mark-label {
  font-weight: 900;
  font-size: 1.02rem;
  padding: 2px 12px 3px;
  border-radius: 999px;
  background: var(--paper);
  border: 2px solid var(--pink);
  color: var(--ink);
}

.post li:nth-child(2) .mark-label {
  border-color: var(--lilac);
}

.post li:nth-child(3) .mark-label {
  border-color: var(--blue);
}

.post li:nth-child(4) .mark-label {
  border-color: var(--mint);
}

.post li:nth-child(5) .mark-label {
  border-color: var(--lemon);
}

.mark-note {
  color: var(--ink-soft);
  font-size: .95rem;
}

/* =========================================================
   About: travel permit as a holographic ID card
   ========================================================= */
.about {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 1080px;
  margin: 0 auto;
  padding: 104px clamp(16px, 5vw, 64px) 72px;
}

.permit {
  position: relative;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  align-items: center;
  padding: clamp(20px, 3vw, 40px);
  border-radius: 26px;
  overflow: hidden;
  color: var(--plum);
  background: linear-gradient(115deg, #ffe6f3 0%, #e6f3ff 22%, #f1e6ff 44%, #e6fff6 66%, #fff4e0 88%, #ffe6f3 100%);
  background-size: 300% 300%;
  animation: holo 10s ease-in-out infinite;
  border: 3px solid #fff;
  box-shadow: 0 0 0 3px var(--pink), 0 24px 50px rgba(240, 85, 154, .2);
}

.permit::after {
  /* a moving holographic sheen */
  content: "";
  position: absolute;
  inset: -40%;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 40%, rgba(255, 255, 255, .55) 50%, transparent 60%);
  animation: sheen 6s ease-in-out infinite;
}

:root[data-theme="night"] .permit {
  filter: saturate(.35) brightness(.97);
  box-shadow: 0 0 0 3px var(--pink), 0 24px 50px var(--c-glow);
}

@keyframes holo {
  50% {
    background-position: 100% 100%;
  }
}

@keyframes sheen {
  0% {
    transform: translateX(-40%);
  }

  60%,
  100% {
    transform: translateX(40%);
  }
}

.permit-photo {
  position: relative;
  margin: 0;
  padding: 10px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 0 0 2px #ffd0e6;
  transform: rotate(-2deg);
}

.stamp {
  position: absolute;
  right: -16px;
  bottom: 4px;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  font-family: var(--font-brush);
  font-size: 2rem;
  line-height: 1;
  color: var(--seal);
  border: 3px solid var(--seal);
  border-radius: 50%;
  background: rgba(255, 255, 255, .6);
  transform: rotate(-12deg);
  opacity: .92;
}

.fields {
  position: relative;
  z-index: 1;
  margin: 0;
}

.field {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 2px dotted rgba(240, 85, 154, .35);
}

.field:last-child {
  border-bottom: 0;
}

.field dt {
  font-family: var(--font-pixel);
  font-size: .92rem;
  color: var(--pink-deep);
}

.field dd {
  margin: 0;
  max-width: 60ch;
}

.unwritten {
  color: #8a789e;
  font-style: italic;
}

.motto {
  font-weight: 900;
  font-size: 1.2rem;
  color: var(--pink-deep);
}

/* =========================================================
   Guest book
   ========================================================= */
.guestbook {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 820px;
  margin: 0 auto;
  padding: 104px clamp(16px, 5vw, 64px) 72px;
}

.gb-form {
  display: grid;
  gap: 18px;
  padding: clamp(20px, 3vw, 36px);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--lilac), 0 24px 50px var(--tag-glow);
}

.gb-field {
  display: grid;
  gap: 6px;
}

.gb-field span {
  font-family: var(--font-pixel);
  color: var(--accent);
}

.gb-field input,
.gb-field textarea {
  font: inherit;
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 14px;
  border: 2px dashed var(--pink);
  background: transparent;
  resize: vertical;
}

.gb-field input:focus,
.gb-field textarea:focus {
  outline: none;
  border-style: solid;
  border-color: var(--pink-deep);
}

.gb-form .open-toy {
  justify-self: start;
}

.gb-status {
  margin: 0;
  font-family: var(--font-pixel);
  color: var(--ink-soft);
  font-size: .92rem;
}

/* =========================================================
   Footer: full-screen night finale at the old city wall
   ========================================================= */
.footer {
  background: #160f30;
  color: #fff2fb;
}

/* a pink LED sign scrolling the welcome message */
.mount {
  position: relative;
  z-index: 2;
  height: 38px;
  overflow: hidden;
  background: radial-gradient(rgba(255, 255, 255, .06) 1px, transparent 1.4px) 0 0 / 4px 4px, #12091f;
  border-top: 3px solid var(--pink-deep);
  border-bottom: 3px solid var(--pink-deep);
}

.ticker {
  margin: 0;
  height: 100%;
  display: flex;
  align-items: center;
  width: max-content;
  font-family: var(--font-pixel);
  font-size: .95rem;
  letter-spacing: .08em;
  color: #ff8fd0;
  text-shadow: 0 0 6px rgba(255, 110, 200, .9);
  animation: ticker 40s linear infinite;
}

.ticker span {
  padding-right: 1em;
  white-space: nowrap;
}

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

.finale {
  position: relative;
  height: 100svh;
  overflow: hidden;
}

.finale-scene {
  /* always covers the screen; centred with plain offsets so the scroll animation only scales and lifts it */
  position: absolute;
  width: max(100vw, 100svh * 1.5);
  height: max(100svh, 100vw / 1.5);
  left: calc(50% - max(100vw, 100svh * 1.5) / 2);
  top: calc(50% - max(100svh, 100vw / 1.5) / 2);
  transform: scale(1.18);
  background: #e9e1f3;
}

.finale-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.finale-cat {
  position: absolute;
  left: 12%;
  bottom: 13%;
  height: 17%;
  width: auto;
  max-width: none;
}

.finale::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(20, 12, 46, .5), transparent 30%),
    radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(20, 12, 46, .6)),
    linear-gradient(to bottom, transparent 74%, rgba(20, 12, 46, .94));
}

.finale-header {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: calc(50% - 60px);
  transform: translate(-50%, -50%);
  width: min(960px, 94vw);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(14px, 2.4svh, 24px);
}

.finale-title {
  position: static;
  transform: none;
  width: 100%;
  text-align: center;
  margin: 0;
  font-size: clamp(2.1rem, 4.2vw, 3.5rem);
  line-height: 1.18;
  color: #fff;
  text-shadow: 0 0 2px #fff, 0 0 18px rgba(255, 120, 200, .9), 0 2px 24px rgba(20, 10, 50, .8);
}

.finale-title>span[lang] {
  font-family: var(--font-pop);
  font-weight: 400;
  color: #ff9ad4;
  margin-right: .25em;
}

.finale-character {
  display: flex;
  justify-content: center;
  align-items: center;
}

.finale-yumemi-img {
  width: clamp(130px, 20svh, 200px);
  height: auto;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, .5)) drop-shadow(0 0 26px rgba(255, 140, 210, .55));
  transition: transform .35s ease, filter .35s ease;
}

.finale-yumemi-img:hover {
  transform: translateY(-6px) scale(1.08);
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, .6)) drop-shadow(0 0 32px rgba(255, 160, 225, .75));
}

.creators-credit {
  margin: 0;
  font-family: var(--font-pixel);
  font-size: clamp(1.05rem, 2.1vw, 1.32rem);
  color: #fff2fb;
  letter-spacing: .06em;
  padding: 8px 22px;
  border-radius: 999px;
  background: rgba(22, 14, 46, 0.55);
  border: 1px solid rgba(255, 160, 220, 0.35);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  text-shadow: 0 0 10px rgba(255, 120, 200, .9), 0 2px 8px rgba(0, 0, 0, .7);
}

.creators-credit a {
  color: #ff9ad4;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: color .2s ease, text-shadow .2s ease;
}

.creators-credit a:hover {
  color: #7dffcf;
  text-shadow: 0 0 12px rgba(125, 255, 207, 1);
}

.finale-copy {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: clamp(24px, 4.5svh, 48px);
  transform: translateX(-50%);
  width: min(1080px, calc(100% - 40px));
  padding: 16px 32px 18px;
  text-align: center;
  color: #fff;
  border-radius: 20px;
  background: rgba(18, 12, 42, .76);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .18), 0 16px 40px rgba(0, 0, 0, .4);
}

.tally-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: .6em;
}

.tally-label {
  font-family: var(--font-pixel);
  color: #ff9ad4;
}

/* the classic hit counter */
.odometer {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  border-radius: 6px;
  background: #000;
  box-shadow: 0 0 0 2px #ff9ad4, 0 0 16px rgba(255, 110, 200, .5);
}

.odometer span {
  display: inline-block;
  min-width: 1.15em;
  padding: 0 3px;
  font-family: var(--font-pixel);
  font-size: 1.2rem;
  text-align: center;
  color: #7dffcf;
  background: #111a14;
  text-shadow: 0 0 6px rgba(125, 255, 207, .8);
  border-radius: 2px;
}

.tally-count {
  font-family: var(--font-pixel);
  font-size: .88rem;
  color: #e9e2ff;
}

.credits {
  margin: 0;
  font-size: .88rem;
  line-height: 1.55;
  color: #e9e2ff;
  max-width: 980px;
  margin-inline: auto;
}

/* =========================================================
   Cursor trail: bright sakura petals by day, bright stars at night
   ========================================================= */
.sparkle {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  width: var(--s, 12px);
  height: var(--s, 12px);
  transform: translate(-50%, -50%) rotate(var(--rot, 0deg));
  animation: drift 1.1s ease-out forwards;
}

.sparkle.petal {
  height: calc(var(--s, 12px) * .78);
  border-radius: 150% 0 150% 0;
  background: radial-gradient(circle at 30% 30%, #ffd1e6, #ff4f9e 55%, #ff1f84);
  box-shadow: 0 0 8px 2px rgba(255, 60, 150, .75), 0 0 18px 4px rgba(255, 120, 190, .45);
}

.sparkle.star {
  clip-path: polygon(50% 0, 60% 38%, 100% 50%, 60% 62%, 50% 100%, 40% 62%, 0 50%, 40% 38%);
  background: radial-gradient(circle, #ffffff 0 22%, #fff3a0 34%, #ffbf00 72%);
}

/* the glow sits on a wrapper-free halo so the clip-path above doesn't cut it off */
.sparkle.halo {
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .95) 0 12%, rgba(255, 214, 60, .75) 30%, rgba(255, 190, 0, 0) 70%);
  mix-blend-mode: normal;
}

@keyframes drift {
  0% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, 30px))) rotate(calc(var(--rot, 0deg) + 160deg)) scale(.35);
  }
}

/* =========================================================
   Before the intro plays: hide what will animate in
   ========================================================= */
.anim .hero .title-ja span,
.anim .hero .title-en,
.anim .hero .tagline,
.anim .hero-links,
.anim .hero-path,
.anim .yumemi,
.anim .bubble,
.anim .scroll-cue,
.anim .hero .sticker,
.anim .purikura-date {
  visibility: hidden;
}

/* =========================================================
   Phones and narrow screens
   ========================================================= */
@media (max-width: 899px) {
  .menu {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    justify-content: space-between;
    z-index: 50;
  }

  .menu a {
    flex: 1;
    text-align: center;
    padding: 9px 2px;
    font-size: .78rem;
  }

  .topbar {
    padding-bottom: 10px;
  }

  .topbar.hidden {
    transform: none;
  }

  .topbar.hidden .name-seal,
  .topbar.hidden .controls {
    transform: translateY(-160%);
  }

  .topbar.hidden::before {
    opacity: 0;
  }

  .name-seal,
  .controls {
    transition: transform .45s ease;
  }

  .companion {
    bottom: 70px;
  }

  .companion-cat img {
    height: 78px;
  }

  .companion-bubble {
    margin: 0 12px 0 0;
    max-width: 190px;
    font-size: .8rem;
  }

  .hero {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    padding: 84px 16px 74px;
    gap: 0;
    height: 100svh;
    min-height: 600px;
  }

  .hero-copy {
    gap: 14px;
  }

  .title-ja {
    font-size: clamp(3rem, 13vw, 4.2rem);
  }

  .hero-text {
    padding-top: 6px;
  }

  .tagline {
    font-size: .9rem;
    margin-bottom: .3em;
  }

  .lede {
    font-size: clamp(1.3rem, 5.6vw, 1.8rem);
    margin-bottom: .6em;
  }

  .candy,
  .open-toy,
  .ink-link {
    padding: 9px 20px;
    font-size: .95rem;
  }

  .hero-art {
    height: 100%;
    max-height: 46svh;
    min-height: 0;
    width: auto;
    align-self: end;
  }

  .yumemi {
    left: 4%;
    height: 58%;
  }

  .bubble {
    left: 44%;
    top: 16%;
    max-width: 170px;
    font-size: .8rem;
  }

  .purikura-date {
    font-size: .8rem;
  }

  .scroll-cue {
    display: none;
  }

  .work {
    padding: 92px 16px 170px;
  }

  .placeholders {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .ph-card {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 0 14px;
    align-items: center;
    padding: 10px;
  }

  .ph-art {
    grid-row: span 2;
    aspect-ratio: 1;
    margin: 0;
  }

  .ph-num {
    font-size: 1.7rem;
  }

  .ph-art .sticker {
    font-size: .75rem;
    top: -8px;
    right: -8px;
  }

  .strip {
    --scene-h: min(46svh, 92vw);
  }

  .stage {
    padding-bottom: 80px;
  }

  .chapter {
    left: 16px;
    right: 16px;
    top: 80px;
    width: auto;
  }

  .chapter h3 {
    font-size: 1.7rem;
    margin: 2px 0 6px;
  }

  .chapter p {
    font-size: 1.02rem;
  }

  .walker {
    --walker-x: 42%;
  }

  .growth {
    padding: 92px 16px 170px;
  }

  .growth-inner {
    grid-template-columns: 1fr;
  }

  .post {
    --post-h: 52svh;
  }

  .post li {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .mark-label {
    font-size: .95rem;
  }

  .mark-note {
    font-size: .86rem;
  }

  .about,
  .guestbook {
    padding: 92px 16px 170px;
  }

  .permit {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .permit-photo {
    width: 160px;
    margin: 0 auto;
  }

  .field {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .finale-header {
    top: calc(50% - 64px);
    transform: translate(-50%, -50%);
    gap: 10px;
  }

  .finale-yumemi-img {
    width: clamp(100px, 15svh, 130px);
  }

  .creators-credit {
    font-size: 0.95rem;
    padding: 6px 16px;
  }

  .finale-copy {
    bottom: 82px;
    padding: 12px 16px 14px;
    width: calc(100% - 24px);
  }

  .credits {
    display: none;
  }
}

@media (max-width: 599px) {
  body {
    font-size: 1.02rem;
  }

  .seal-mark {
    width: 40px;
    height: 40px;
    font-size: 1.35rem;
  }

  .name-seal {
    width: 40px;
    height: 56px;
    font-size: 1rem;
  }
}

/* Reduced motion, or the animation library failed: everything simply shows */
.static-journey .journey-pin {
  height: auto;
  overflow: visible;
  padding: 96px 0 40px;
}

.static-journey .journey-intro,
.static-journey .stage,
.static-journey .chapter {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  inset: auto;
}

.static-journey .journey-intro {
  margin: 0 auto 24px;
}

.static-journey .track {
  flex-direction: column;
  width: 100%;
  align-items: center;
  gap: 8px;
}

.static-journey .strip {
  height: auto;
}

.static-journey .scene {
  height: auto;
  width: min(900px, 100%);
}

.static-journey .scene+.scene {
  margin-left: 0;
}

.static-journey .walker {
  display: none;
}

.static-journey .chapter {
  visibility: visible;
  opacity: 1;
  margin: 24px auto;
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  html {
    scroll-behavior: auto;
  }

  .ticker {
    width: auto;
  }

  .ticker span+span {
    display: none;
  }
}


/* Phones: bigger hero painting, fuller story screen, readable chapters,
   and the companion tucks away so she never covers the words */
@media (max-width: 899px) {
  .hero-art {
    max-height: none;
    height: 100%;
    width: 100%;
  }

  .strip {
    --scene-h: min(56svh, 118vw);
  }

  .chapter {
    top: 76px;
    padding: 12px 16px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .62);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    box-shadow: 0 8px 24px var(--c-glow);
  }

  .chapter::before {
    display: none;
  }

  .chapter h3 {
    font-size: 1.55rem;
  }

  .chapter p {
    font-size: 1rem;
    line-height: 1.6;
  }

  .stop-tag {
    font-size: .95rem;
  }

  .companion-cat {
    transition: transform .45s cubic-bezier(.3, 1.4, .5, 1);
  }

  .companion.peek .companion-cat {
    transform: translateY(70%);
  }

  .companion.peek .companion-bubble {
    display: none;
  }
}


/* no blue/grey flash box when you tap something on a phone (keyboard focus rings still show) */
* {
  -webkit-tap-highlight-color: transparent;
}


/* Day: pink gingham picnic-cloth paper */
body {
  background-image:
    radial-gradient(60vmax 50vmax at 0% 0%, rgba(255, 170, 214, .28), transparent 60%),
    radial-gradient(60vmax 50vmax at 100% 100%, rgba(143, 211, 255, .24), transparent 60%),
    linear-gradient(90deg, rgba(255, 143, 198, .11) 50%, transparent 50%),
    linear-gradient(rgba(255, 143, 198, .11) 50%, transparent 50%);
  background-size: auto, auto, 72px 72px, 72px 72px;
}

/* Night: lantern festival */
:root[data-theme="night"] {
  --ground: #17132f;
  --paper: #241e48;
  --pool: rgba(255, 186, 110, .26);
  --ink: #fbefdc;
  --ink-soft: #cbbfdc;
  --accent: #ffb867;
  --rule: rgba(255, 230, 200, .16);
  --outline: #2b2254;
  --art-filter: none;
  --pink: #f0a050;
  --pink-deep: #ffc27d;
  --lilac: #a08cf0;
  --blue: #7c95e6;
  --mint: #7fd1b6;
  --lemon: #ffd98a;
  --c-top: #ffb35c;
  --c-bot: #d9661f;
  --c-glow: rgba(255, 150, 70, .4);
  --c-text: rgba(110, 40, 0, .55);
  --tag-top: #b69cff;
  --tag-bot: #6b4fd8;
  --tag-glow: rgba(140, 110, 255, .35);
  --tint: rgba(255, 160, 80, .5);
  --menu-bot: #241e48;
  color-scheme: dark;
}

:root[data-theme="night"] body {
  background-image:
    radial-gradient(55vmax 42vmax at 88% 6%, rgba(255, 176, 92, .18), transparent 60%),
    radial-gradient(50vmax 40vmax at 4% 96%, rgba(255, 130, 70, .13), transparent 60%),
    linear-gradient(180deg, #15113a 0%, #211947 55%, #31204e 100%);
  background-size: auto;
}

:root[data-theme="night"] body::before,
:root[data-theme="night"] body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1.6px 1.6px at 22px 34px, #fff6e2, transparent),
    radial-gradient(1.1px 1.1px at 96px 78px, #ffffff, transparent),
    radial-gradient(1.8px 1.8px at 150px 132px, #ffe2a8, transparent),
    radial-gradient(1.1px 1.1px at 58px 162px, #ffffff, transparent);
  background-size: 190px 190px;
  animation: twinkle 3.2s ease-in-out infinite alternate;
}

:root[data-theme="night"] body::after {
  background-size: 270px 270px;
  background-position: 90px 60px;
  animation-delay: -1.6s;
  opacity: .7;
}

@keyframes twinkle {
  from {
    opacity: .35;
  }

  to {
    opacity: 1;
  }
}

:root[data-theme="night"] .menu {
  background: linear-gradient(180deg, #3a3168, #241e48);
  border-color: #4b4185;
}

:root[data-theme="night"] .bubble,
:root[data-theme="night"] .companion-bubble {
  color: var(--ink);
  background: #241e48;
  box-shadow: 0 0 0 3px #3a3168, 0 10px 22px var(--c-glow);
}

:root[data-theme="night"] .ph-card {
  box-shadow: 0 0 0 3px #3a3168, 0 0 0 6px var(--pink), 0 18px 36px var(--c-glow);
}

:root[data-theme="night"] .ph-card:nth-child(2) {
  box-shadow: 0 0 0 3px #3a3168, 0 0 0 6px var(--lilac), 0 18px 36px var(--tag-glow);
}

:root[data-theme="night"] .ph-card:nth-child(3) {
  box-shadow: 0 0 0 3px #3a3168, 0 0 0 6px var(--blue), 0 18px 36px var(--c-glow);
}

:root[data-theme="night"] .ph-art {
  background:
    radial-gradient(rgba(255, 230, 190, .14) 2px, transparent 2.4px) 0 0 / 18px 18px,
    linear-gradient(135deg, #3b2a5a, #2c2a62, #23345e);
}

:root[data-theme="night"] .ph-num {
  background: rgba(36, 30, 72, 0.9);
  border-color: #4b4185;
  color: var(--ink);
  text-shadow: none;
}

:root[data-theme="night"] .gb-form {
  box-shadow: 0 0 0 3px #3a3168, 0 0 0 6px var(--lilac), 0 24px 50px var(--tag-glow);
}

:root[data-theme="night"] .gb-field ::placeholder {
  color: var(--ink-soft);
  opacity: .7;
}

:root[data-theme="night"] .permit {
  filter: none;
  color: var(--ink);
  background: linear-gradient(115deg, #2b2257 0%, #1f2f58 22%, #35255e 44%, #1d3c4c 66%, #3f2b45 88%, #2b2257 100%);
  background-size: 300% 300%;
  border-color: #4b4185;
  box-shadow: 0 0 0 3px var(--pink), 0 24px 50px var(--c-glow);
}

:root[data-theme="night"] .permit::after {
  opacity: .35;
}

:root[data-theme="night"] .field {
  border-bottom-color: rgba(255, 190, 120, .3);
}

:root[data-theme="night"] .unwritten {
  color: var(--ink-soft);
}

:root[data-theme="night"] .post {
  background: linear-gradient(90deg, rgba(255, 170, 90, .14), transparent 55%);
}

@media (max-width: 899px) {
  :root[data-theme="night"] .chapter {
    background: rgba(28, 22, 62, .74);
  }
}

/* the paintings are partly see-through watercolour: at night they sit on warm lantern-lit paper */
:root[data-theme="night"] .hero-path {
  background-color: #fff1df;
  -webkit-mask-image: radial-gradient(ellipse at 50% 52%, #000 calc(var(--r, 160%) * .3), transparent calc(var(--r, 160%) * .44));
  mask-image: radial-gradient(ellipse at 50% 52%, #000 calc(var(--r, 160%) * .3), transparent calc(var(--r, 160%) * .44));
}

:root[data-theme="night"] .track {
  background-color: #fff1df;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 16%, #000 93%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 16%, #000 93%, transparent);
}


/* Mini game: Yumemi's Snack Run, played inside the hero */
.play-link {
  --c-top: var(--tag-top);
  --c-bot: var(--tag-bot);
  --c-glow: var(--tag-glow);
}

button.soft-link {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.hero.is-playing .hero-copy,
.hero.is-playing .hero-art,
.hero.is-playing .scroll-cue {
  visibility: hidden !important;
}

.game {
  position: absolute;
  inset: 0;
  z-index: 6;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
}

.game[hidden] {
  display: none;
}

.game::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../assets/scene-noodles.webp") center bottom / cover no-repeat;
  opacity: .55;
  -webkit-mask-image: linear-gradient(to bottom, transparent 15%, #000 65%);
  mask-image: linear-gradient(to bottom, transparent 15%, #000 65%);
}

:root[data-theme="night"] .game::before {
  background-color: #fff1df;
  opacity: .9;
}

.game.wish::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 90px 10px rgba(255, 200, 80, .55);
  animation: lantern-pulse 1.2s ease-in-out infinite;
}

.game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: none;
}

.game-hud {
  position: absolute;
  z-index: 2;
  top: 88px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 24px);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-family: var(--font-pixel);
  pointer-events: none;
}

.hud-box {
  padding: 4px 10px 5px;
  border-radius: 10px;
  font-size: .85rem;
  letter-spacing: .08em;
  color: #ff9ad4;
  background: #12091f;
  box-shadow: 0 0 0 2px var(--pink), 0 0 14px var(--c-glow);
}

.hud-box b {
  font-weight: 400;
  color: #7dffcf;
  text-shadow: 0 0 6px rgba(125, 255, 207, .7);
}

.hud-quit {
  pointer-events: auto;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  background: var(--seal);
  border: 2px solid #fff;
  box-shadow: 0 4px 10px rgba(224, 68, 58, .35);
}

.hud-combo {
  flex-basis: 100%;
  text-align: center;
  color: var(--accent);
  font-size: 1rem;
  letter-spacing: .1em;
}

.hud-combo:empty {
  display: none;
}

.game-card {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  width: min(460px, calc(100% - 32px));
  padding: 22px 24px 20px;
  text-align: center;
  background: var(--paper);
  border-radius: 24px;
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--lilac), 0 24px 50px var(--tag-glow);
}

.game-card[hidden] {
  display: none;
}

:root[data-theme="night"] .game-card {
  box-shadow: 0 0 0 3px #3a3168, 0 0 0 6px var(--lilac), 0 24px 50px var(--tag-glow);
}

.game-kicker {
  margin: 0;
  font-family: var(--font-pixel);
  color: var(--accent);
  font-size: .9rem;
}

.game-title {
  font-family: var(--font-pop);
  font-weight: 400;
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  line-height: 1.2;
  margin: 2px 0 8px;
}

.game-how {
  font-size: .98rem;
  line-height: 1.6;
  margin: 0 0 10px;
}

.game-legend {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
  font-family: var(--font-pixel);
  font-size: .88rem;
  color: var(--ink-soft);
}

.game-legend li {
  display: flex;
  align-items: center;
  gap: 2px;
}

.game-legend img {
  width: 34px;
  height: 34px;
}

.game-result {
  min-height: 1.6em;
  margin: 0 0 12px;
  font-weight: 900;
  color: var(--pink-deep);
}

.game-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin: 0;
}

@media (max-width: 899px) {
  .game-hud {
    top: 80px;
    gap: 6px;
  }

  .hud-box {
    font-size: .78rem;
    padding: 3px 8px 4px;
  }
}


/* Lantern nightlight (night only) */
@media (max-width: 899px) {
  .hero-art {
    width: auto;
    max-width: 100%;
    aspect-ratio: 3 / 4;
  }
}

.nightlight {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

:root[data-theme="night"] .nightlight {
  display: block;
}

.hero-art {
  --x: 30%;
  --y: 80%;
  --lx: 30%;
  --ly: 80%;
  --nr: 160px;
}

/* at night the painting only exists where light falls on it: around her lantern, and around yours */
:root[data-theme="night"] .hero-path {
  -webkit-mask-image:
    radial-gradient(ellipse at 50% 52%, #000 48%, transparent 70%),
    radial-gradient(circle at var(--x) var(--y), #000 calc(var(--nr) * .45), transparent var(--nr)),
    radial-gradient(circle at var(--lx) var(--ly), #000 calc(var(--nr) * .2), transparent calc(var(--nr) * .75));
  -webkit-mask-composite: source-in, source-over;
  mask-image:
    radial-gradient(ellipse at 50% 52%, #000 48%, transparent 70%),
    radial-gradient(circle at var(--x) var(--y), #000 calc(var(--nr) * .45), transparent var(--nr)),
    radial-gradient(circle at var(--lx) var(--ly), #000 calc(var(--nr) * .2), transparent calc(var(--nr) * .75));
  mask-composite: intersect, add;
}

:root[data-theme="night"] .hero-art .pool,
:root[data-theme="night"] .hero-art .sticker,
:root[data-theme="night"] .purikura-date {
  display: none;
}

.nl-glow {
  position: absolute;
  inset: -10%;
  background: radial-gradient(circle at calc(var(--x) + 100% / 12) calc(var(--y) + 100% / 12), rgba(255, 196, 120, .22), transparent calc(var(--nr) * 1.1));
}

.nl-dreams {
  position: absolute;
  inset: 0;
  -webkit-mask-image: radial-gradient(circle at var(--x) var(--y), #000 calc(var(--nr) * .4), transparent calc(var(--nr) * .85));
  mask-image: radial-gradient(circle at var(--x) var(--y), #000 calc(var(--nr) * .4), transparent calc(var(--nr) * .85));
}

.dream {
  position: absolute;
  margin: 0;
  height: auto;
  filter: drop-shadow(0 0 6px rgba(255, 220, 150, .85));
}

.dream-wishes {
  display: flex;
  align-items: flex-start;
  gap: 8%;
}

.dream-wishes img {
  width: 50%;
  height: auto;
}

.dream-wishes img+img {
  width: 38%;
  margin-top: 30%;
}

.dream-text {
  white-space: nowrap;
  padding: 4px 12px 5px;
  border-radius: 6px 12px 8px 14px;
  font-family: var(--font-pop);
  font-size: clamp(.85rem, 1.4vw, 1.2rem);
  line-height: 1.3;
  color: #c2336d;
  background: #fff6e6;
  box-shadow: 0 0 0 2px #ffd0e2, 0 4px 12px rgba(80, 40, 20, .3);
  transform: rotate(-6deg);
}

.dream-wish {
  font-family: var(--font-pixel);
  color: #7a4ad8;
  box-shadow: 0 0 0 2px #d8c8ff, 0 4px 12px rgba(80, 40, 20, .3);
  transform: rotate(5deg);
}

.dream.found {
  animation: dream-found .7s ease-out;
}

@keyframes dream-found {
  40% {
    scale: 1.3;
  }
}

.nl-hint {
  display: none;
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 1%;
  transform: translateX(-50%);
  margin: 0;
  white-space: nowrap;
  font-family: var(--font-pixel);
  font-size: .82rem;
  letter-spacing: .04em;
  color: #ffe7b8;
  text-shadow: 0 0 8px rgba(255, 180, 90, .8);
}

:root[data-theme="night"] .nl-hint {
  display: block;
}

.nl-hint b {
  font-weight: 400;
  color: #7dffcf;
}

.nl-hint.all-found {
  color: #7dffcf;
  text-shadow: 0 0 8px rgba(125, 255, 207, .8);
}

.anim .nightlight,
.anim .nl-hint {
  visibility: hidden;
}

/* =========================================================
   Volume seal – visually identical to the 朝 / 音 seals.
   Hover / focus-within reveals a vertical slider that drops
   down below the ♪ mark. The hide-delay lets the cursor
   travel from 音 → ♪ without the panel disappearing.
   ========================================================= */

.vol-seal {
  position: relative;
  cursor: default;
}

/* ♪ mark inherits .seal-mark – just nudge the font size */
.vol-seal .seal-mark {
  font-size: 1.45rem;
  cursor: pointer;
  user-select: none;
}

/* ── Drop-down panel (tall & narrow for a vertical slider) ── */
.vol-panel {
  position: absolute;
  top: 100%;
  /* snug touching the bottom of the seal container */
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 9px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 233, 244, 0.65));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 2px rgba(255, 143, 198, 0.4), 0 10px 24px var(--c-glow);

  /* ── hidden state with generous fade-out delay ── */
  opacity: 0;
  transform: translateX(-50%) scaleY(0.6);
  transform-origin: top center;
  pointer-events: none;

  transition:
    opacity .25s ease .75s,
    transform .25s ease .75s;
}

/* Reveal: immediate when mouse enters seal or panel */
.vol-seal:hover .vol-panel,
.vol-seal:focus-within .vol-panel {
  opacity: 1;
  transform: translateX(-50%) scaleY(1);
  pointer-events: auto;
  transition:
    opacity .2s ease 0s,
    transform .2s ease 0s;
}

/* ── Vertical slider track ─────────────────────────────────── */
.vol-slider {
  -webkit-appearance: slider-vertical;
  /* Safari ≤ 15 */
  writing-mode: vertical-lr;
  /* Chrome 117+, Firefox */
  direction: rtl;
  /* bottom = 0, top = 100 */
  appearance: none;
  width: 4px;
  height: 80px;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  /* Fill: drawn with a linear-gradient driven by --val CSS custom property */
  background: linear-gradient(to top,
      var(--seal) 0%,
      var(--seal) calc(var(--val, 18) * 1%),
      var(--rule) calc(var(--val, 18) * 1%),
      var(--rule) 100%);
  transition: background .1s;
}

/* ── Slider thumb ──────────────────────────────────────────── */
.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--seal);
  box-shadow: 0 0 0 2.5px #fff, 0 0 0 4px rgba(224, 68, 58, .35);
  transition: transform .15s;
  cursor: grab;
}

.vol-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 50%;
  background: var(--seal);
  box-shadow: 0 0 0 2.5px #fff, 0 0 0 4px rgba(224, 68, 58, .35);
  transition: transform .15s;
  cursor: grab;
}

.vol-slider:hover::-webkit-slider-thumb,
.vol-slider:focus::-webkit-slider-thumb {
  transform: scale(1.3);
}

.vol-slider:hover::-moz-range-thumb,
.vol-slider:focus::-moz-range-thumb {
  transform: scale(1.3);
}

/* ── Night-theme overrides ─────────────────────────────────── */
:root[data-theme="night"] .vol-panel {
  background: linear-gradient(180deg, rgba(40, 32, 75, 0.78), rgba(28, 22, 58, 0.72));
  border-color: rgba(90, 80, 140, 0.65);
  box-shadow: 0 0 0 2px rgba(163, 168, 200, 0.35), 0 10px 24px var(--c-glow);
}

:root[data-theme="night"] .vol-slider {
  background: linear-gradient(to top,
      var(--accent) 0%,
      var(--accent) calc(var(--val, 18) * 1%),
      var(--rule) calc(var(--val, 18) * 1%),
      var(--rule) 100%);
}

:root[data-theme="night"] .vol-slider::-webkit-slider-thumb {
  background: var(--accent);
  box-shadow: 0 0 0 2.5px #fff, 0 0 0 4px var(--tag-glow);
}

:root[data-theme="night"] .vol-slider::-moz-range-thumb {
  background: var(--accent);
  box-shadow: 0 0 0 2.5px #fff, 0 0 0 4px var(--tag-glow);
}

/* Respect reduce-motion */
@media (prefers-reduced-motion: reduce) {
  .vol-seal {
    display: none;
  }
}