:root {
  --ink: #050505;
  --muted: #111111;
  --muted-dark: #2b2b2b;
  --night: #f7f4f8;
  --night-soft: #fffafd;
  --line: rgba(27, 39, 64, 0.18);
  --pink: #f08ab4;
  --cyan: #8ac8c3;
  --red: #ff7657;
  --paper: #fff8fb;
  --display-stroke: clamp(8px, 1.08vw, 14px);
  --body-stroke: 3px;
  --frame-ink: #111827;
  --frame-paper: #fff7fa;
  --frame-pink: #f08ab4;
  --frame-side: clamp(1.35rem, 2.5vw, 2.45rem);
  --frame-band: clamp(2.5rem, 5.8vh, 3.75rem);
  --frame-bottom-band: clamp(2.55rem, 6vh, 3.9rem);
  --frame-module-width: clamp(7.2rem, 12vw, 11.5rem);
  --frame-module-height: clamp(3.25rem, 7.5vh, 4.65rem);
  --frame-bottom-module-height: clamp(3.2rem, 7.2vh, 4.5rem);
  --content-gutter-left: max(1.1rem, calc(var(--frame-side) + 0.9rem), calc(env(safe-area-inset-left, 0px) + 1.1rem));
  --content-gutter-right: max(1.1rem, calc(var(--frame-side) + 0.9rem), calc(env(safe-area-inset-right, 0px) + 1.1rem));
  --ease-out: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-in-out: cubic-bezier(0.645, 0.045, 0.355, 1);
  color: var(--ink);
  background: var(--night);
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html {
  background: var(--paper);
  scroll-behavior: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-weight: 800;
  text-transform: uppercase;
  -webkit-text-stroke: 0.75px rgba(255, 255, 255, 0.94);
  paint-order: stroke fill;
}

body.is-loading { overflow: hidden; }

button, a { font: inherit; }

button { cursor: pointer; }

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 100;
  padding: 0.7rem 1rem;
  color: #fff;
  background: var(--ink);
  transform: translateY(-180%);
  transition: transform 180ms var(--ease-out);
}

.skip-link:focus { transform: translateY(0); }

#webgl {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  outline: none;
  opacity: 0;
  transition: opacity 900ms var(--ease-out);
  pointer-events: none;
}

body.is-ready #webgl { opacity: 1; }

body[data-mode="explore"] #webgl {
  pointer-events: auto;
  cursor: grab;
}

body[data-mode="explore"] #webgl:active { cursor: grabbing; }

.japan-art-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--paper);
}

.japan-art-bg::after {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 42%, transparent 0 28%, rgba(255, 250, 252, 0.08) 68%, rgba(255, 247, 250, 0.62) 100%),
    linear-gradient(90deg, rgba(255, 248, 251, 0.22), transparent 22% 76%, rgba(255, 248, 251, 0.24));
  content: "";
}

.visual-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.visual-layer-pattern {
  z-index: 0;
  opacity: 0.31;
  transform: translate3d(var(--pattern-scroll-x, 0px), var(--pattern-scroll, 0px), 0);
  will-change: transform;
}

.pattern-surface {
  position: absolute;
  inset: -30%;
  background-image: url("./assets/tokyo-seigaiha-pattern-v3.svg");
  background-position: center;
  background-repeat: repeat;
  background-size: clamp(24rem, 38vw, 38rem);
  animation: patternDrift 26s ease-in-out infinite;
  will-change: transform;
}

.visual-layer-frame {
  z-index: 3;
  contain: strict;
  display: block;
}

.frame-asset {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
}

.frame-shell {
  position: absolute;
  inset: 0;
  isolation: isolate;
  pointer-events: none;
}

.frame-piece,
.frame-module,
.frame-gem,
.frame-dot {
  position: absolute;
  display: block;
  pointer-events: none;
}

.frame-piece {
  z-index: 1;
  border: 3px solid var(--frame-ink);
  background-color: var(--frame-paper);
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.72);
}

.frame-top,
.frame-bottom {
  right: 0;
  left: 0;
  height: var(--frame-band);
  background-image:
    radial-gradient(ellipse 0.62rem 0.48rem at 50% 100%, transparent 57%, rgba(240, 138, 180, 0.24) 61% 75%, transparent 79%),
    linear-gradient(var(--frame-paper), var(--frame-paper));
  background-position: 0 0, 0 0;
  background-size: 1.52rem 1.28rem, auto;
  background-repeat: repeat-x, no-repeat;
}

.frame-top {
  top: 0;
  border-top: 3px solid var(--frame-ink);
  border-bottom: 3px solid var(--frame-ink);
  clip-path: polygon(0 0, 100% 0, 100% 76%, 96% 76%, 94.8% 100%, 86% 100%, 85% 76%, 59% 76%, 57.8% 100%, 42.2% 100%, 41% 76%, 15% 76%, 14% 100%, 5.2% 100%, 4% 76%, 0 76%);
}

.frame-bottom {
  bottom: 0;
  height: var(--frame-bottom-band);
  background-position: 0 100%, 0 0;
  clip-path: polygon(0 24%, 4% 24%, 5.2% 0, 14% 0, 15% 24%, 41% 24%, 42.2% 0, 57.8% 0, 59% 24%, 85% 24%, 86% 0, 94.8% 0, 96% 24%, 100% 24%, 100% 100%, 0 100%);
}

.frame-side {
  top: 0;
  bottom: 0;
  width: var(--frame-side);
  background:
    radial-gradient(circle at 50% 28%, rgba(240, 138, 180, 0.12), transparent 0.4rem),
    linear-gradient(var(--frame-paper), var(--frame-paper));
}

.frame-side-left {
  left: 0;
  border-right: 3px solid var(--frame-ink);
  clip-path: polygon(0 0, 100% 0, 100% 21%, 73% 23%, 73% 36%, 100% 38%, 100% 62%, 73% 64%, 73% 77%, 100% 79%, 100% 100%, 0 100%);
}

.frame-side-right {
  right: 0;
  border-left: 3px solid var(--frame-ink);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 79%, 27% 77%, 27% 64%, 0 62%, 0 38%, 27% 36%, 27% 23%, 0 21%);
}

.frame-module {
  left: 50%;
  z-index: 2;
  width: var(--frame-module-width);
  border: 3px solid var(--frame-ink);
  transform: translateX(-50%);
}

.frame-module-top {
  top: -1px;
  height: var(--frame-module-height);
  background: var(--frame-pink);
  clip-path: polygon(0 0, 100% 0, 100% 73%, 82% 100%, 18% 100%, 0 73%);
}

.frame-module-top::after,
.frame-module-bottom::after {
  position: absolute;
  content: "";
  border: 3px solid var(--frame-ink);
  background: var(--frame-paper);
}

.frame-module-top::after {
  top: 29%;
  right: 19%;
  left: 19%;
  height: 43%;
}

.frame-module-top::before {
  position: absolute;
  top: 29%;
  bottom: 28%;
  left: 50%;
  width: 3px;
  z-index: 1;
  background: var(--frame-ink);
  box-shadow: -1.6rem 0 0 var(--frame-ink), 1.6rem 0 0 var(--frame-ink);
  content: "";
}

.frame-module-bottom {
  bottom: -1px;
  height: var(--frame-bottom-module-height);
  background: #f7b7d0;
  clip-path: polygon(16% 0, 84% 0, 100% 35%, 100% 100%, 0 100%, 0 35%);
  animation: frameModuleFloat 5.4s ease-in-out infinite;
}

.frame-module-bottom::after {
  top: 27%;
  right: 24%;
  bottom: 0;
  left: 24%;
}

.frame-module-bottom::before {
  position: absolute;
  top: 44%;
  bottom: 0;
  left: 50%;
  z-index: 1;
  width: 1.4rem;
  background: var(--frame-pink);
  transform: translateX(-50%);
  content: "";
}

.frame-gem {
  top: max(0.72rem, env(safe-area-inset-top));
  z-index: 3;
  width: 1rem;
  height: 1rem;
  border: 3px solid var(--frame-ink);
  background: var(--frame-pink);
  transform: rotate(45deg);
  animation: frameGemGlow 3.6s ease-in-out infinite;
}

.frame-gem-top-left { left: calc(var(--frame-side) + 0.2rem); }
.frame-gem-top-right { right: calc(var(--frame-side) + 0.2rem); animation-delay: -1.8s; }

.frame-dot {
  z-index: 3;
  width: 0.78rem;
  height: 0.78rem;
  border: 3px solid var(--frame-ink);
  border-radius: 50%;
  background: var(--frame-pink);
  animation: frameDotPulse 3.2s ease-in-out infinite;
}

.frame-dot-left-one,
.frame-dot-left-two { left: calc(var(--frame-side) / 2); transform: translateX(-50%); }
.frame-dot-right-one,
.frame-dot-right-two { right: calc(var(--frame-side) / 2); transform: translateX(50%); }
.frame-dot-left-one,
.frame-dot-right-one { top: 28%; }
.frame-dot-left-two,
.frame-dot-right-two { top: 72%; animation-delay: -1.6s; }

.frame-brand {
  position: fixed;
  top: max(0.25rem, env(safe-area-inset-top));
  left: 50%;
  z-index: 5;
  width: min(calc(var(--frame-module-width) - 1.2rem), 9rem);
  height: calc(var(--frame-module-height) - 0.45rem);
  transform: translateX(-50%);
  pointer-events: none;
}

.frame-brand img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.leaf-field {
  position: fixed;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}

.leaf-field canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0.84;
}

@keyframes patternDrift {
  0%, 100% { transform: translate3d(-2.5%, -1.8%, 0) rotate(-0.7deg) scale(1.02); }
  50% { transform: translate3d(2.5%, 1.8%, 0) rotate(0.7deg) scale(1.045); }
}

@keyframes frameModuleFloat {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-3px); }
}

@keyframes frameGemGlow {
  0%, 100% { opacity: 0.72; transform: rotate(45deg) scale(0.92); }
  50% { opacity: 1; transform: rotate(50deg) scale(1.08); }
}

@keyframes frameDotPulse {
  0%, 100% { opacity: 0.58; transform: translateX(-50%) scale(0.8); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.08); }
}

.frame-dot-right-one,
.frame-dot-right-two { animation-name: frameDotPulseRight; }

@keyframes frameDotPulseRight {
  0%, 100% { opacity: 0.58; transform: translateX(50%) scale(0.8); }
  50% { opacity: 1; transform: translateX(50%) scale(1.08); }
}

.scene-wash {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(circle at 52% 42%, rgba(240, 138, 180, 0.08), transparent 34%),
    linear-gradient(90deg, rgba(255, 250, 252, 0.72) 0%, rgba(255, 250, 252, 0.14) 34%, rgba(255, 250, 252, 0.04) 70%, rgba(255, 250, 252, 0.24) 100%),
    linear-gradient(180deg, rgba(255, 250, 252, 0.12), transparent 45%, rgba(255, 248, 251, 0.42));
}

.site-header {
  position: fixed;
  top: auto;
  bottom: calc(var(--frame-bottom-band) + clamp(0.65rem, 2vh, 1.1rem));
  left: 50%;
  z-index: 10;
  display: flex;
  align-items: center;
  width: min(252px, calc(100vw - 1rem));
  height: 46px;
  gap: 0;
  padding: 3px 4px;
  overflow: visible;
  border: 1.5px solid #fff;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 241, 247, 0.62));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.84),
    0 5px 12px rgba(20, 34, 60, 0.12);
  backdrop-filter: blur(12px) saturate(1.12);
  -webkit-backdrop-filter: blur(12px) saturate(1.12);
  backface-visibility: hidden;
  contain: layout style paint;
  transform: translateX(-50%) translateZ(0);
  transition: background 260ms ease, box-shadow 260ms ease;
  isolation: isolate;
  will-change: transform;
}

.site-header::before,
.site-header::after {
  position: absolute;
  border-radius: inherit;
  pointer-events: none;
  content: "";
}

.site-header::before {
  display: none;
}

.site-header::after {
  inset: 1px;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.52), transparent 44%, rgba(255, 255, 255, 0.08)),
    radial-gradient(ellipse 42% 80% at 18% -15%, rgba(255, 255, 255, 0.62), transparent 72%);
  opacity: 0.9;
}

.site-header.is-scrolled {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 241, 247, 0.72));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.92),
    0 5px 12px rgba(20, 34, 60, 0.16);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header { background: rgba(255, 250, 252, 0.94); }
}

.primary-nav { position: relative; z-index: 2; pointer-events: auto; }

.primary-nav {
  display: flex;
  align-items: center;
  align-self: stretch;
  justify-content: space-between;
  width: 100%;
  gap: 2px;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  min-height: 38px;
  padding: 0;
  flex: 0 0 38px;
  border-radius: 999px;
  color: rgba(20, 34, 60, 0.82);
  line-height: 1;
  text-decoration: none;
  transition: color 180ms ease, background-color 180ms ease;
}

.nav-audio {
  border: 0;
  font: inherit;
  cursor: pointer;
}

.nav-audio.is-on {
  color: var(--paper);
  background: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24), 0 2px 0 var(--pink);
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--ink);
  background: rgba(240, 138, 180, 0.13);
}

.nav-link.is-active {
  color: var(--paper);
  background: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24), 0 2px 0 var(--pink);
}

.nav-link.is-active::after {
  display: none;
}

.nav-link svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.nav-link-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.nav-progress {
  position: absolute;
  right: 13px;
  bottom: -7px;
  left: 13px;
  z-index: 3;
  width: auto;
  height: 3px;
  margin: 0;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(27, 39, 64, 0.2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.74);
}

.nav-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--pink);
  transform: scaleX(var(--route-progress, 0));
  transform-origin: left center;
  transition: transform 260ms var(--ease-out);
}

.scroll-progress-bottom {
  position: fixed;
  right: 0;
  bottom: env(safe-area-inset-bottom, 0px);
  left: 0;
  z-index: 18;
  height: 5px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 -2px 12px rgba(240, 138, 180, 0.18);
  opacity: 0;
  transition: opacity 360ms ease;
  pointer-events: none;
}

body.is-ready .scroll-progress-bottom { opacity: 1; }

.scroll-progress-bottom span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--pink);
  box-shadow: 0 0 12px rgba(240, 138, 180, 0.72);
  transform: scaleX(var(--route-progress, 0));
  transform-origin: left center;
  will-change: transform;
}

.outline-button, .focus-button, .panel-route {
  border: 0;
  color: var(--ink);
  background: transparent;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

main { position: relative; z-index: auto; }

.story-section {
  position: relative;
  display: grid;
  z-index: 2;
  min-height: 130vh;
  min-height: 130dvh;
  padding: calc(var(--frame-band) + clamp(2rem, 7vh, 5rem)) var(--content-gutter-right) calc(var(--frame-bottom-band) + clamp(2rem, 7vh, 5rem)) var(--content-gutter-left);
  pointer-events: none;
}

.story-copy, .hero-actions, .focus-button, .outline-button { pointer-events: auto; }

.story-copy { align-self: center; width: min(100%, 39rem); max-width: 33rem; }

.story-copy .word {
  display: inline-block;
  white-space: pre;
  transform: translateZ(0);
}

@keyframes wordReveal {
  from {
    opacity: 0;
    transform: translate3d(0, 0.72em, 0) scale(0.96);
  }
  64% {
    opacity: 1;
    transform: translate3d(0, -0.08em, 0) scale(1.025);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

.no-gsap .story-section.is-text-revealed .story-copy .word {
  animation: wordReveal 680ms var(--ease-out) calc(var(--word-index, 0) * 38ms + var(--word-group-delay, 0ms)) both;
  will-change: transform, opacity;
}

.story-copy > .hero-kicker,
.story-copy > .object-label { --word-group-delay: 0ms; }

.story-copy > h1,
.story-copy > h2,
.story-copy > h3 { --word-group-delay: 40ms; }

.story-copy > .intro-copy,
.story-copy > .story-body { --word-group-delay: 110ms; }

.story-copy > .hero-actions,
.story-copy > .focus-button,
.story-copy > .outline-button,
.story-copy > .credits { --word-group-delay: 190ms; }

.hero-copy {
  max-width: 39rem;
  transform: translateY(clamp(-5rem, -8vh, -2rem));
}

.copy-right { justify-self: end; }

.hero-kicker,
.object-label,
.panel-label,
.status-label {
  margin: 0 0 1.15rem;
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 900;
  font-synthesis: weight;
  letter-spacing: 0.015em;
  line-height: 1.4;
}

.hero-kicker { color: var(--muted-dark); }
.object-label {
  font-size: clamp(0.85rem, 1.2vw, 1rem);
  text-shadow: 0 2px 8px rgba(27, 39, 64, 0.24);
}

.accent-pink { color: var(--pink); }
.accent-cyan { color: var(--cyan); }
.accent-red { color: var(--red); }

h1, h2, h3, p { margin-top: 0; }

h1, h2, h3 {
  margin-bottom: 1.3rem;
  font-family: "Unbounded", sans-serif;
  font-weight: 800;
  font-synthesis: none;
  font-variation-settings: "wght" 800;
  letter-spacing: -0.035em;
  line-height: 0.94;
  text-wrap: balance;
  -webkit-text-stroke: var(--display-stroke) rgba(255, 255, 255, 0.98);
  paint-order: stroke fill;
  text-shadow: 0 2px 0 rgba(27, 39, 64, 0.06), 0 8px 18px rgba(240, 138, 180, 0.22);
}

h1 { max-width: 11ch; font-size: clamp(3.5rem, 7vw, 6rem); }
h2 { max-width: 13ch; font-size: clamp(3rem, 5vw, 5.25rem); }
h3 { font-size: clamp(2rem, 3vw, 3.25rem); }

h1 em, h2 em {
  color: var(--pink);
  font-style: normal;
  font-weight: 800;
}

.intro-copy, .story-body {
  max-width: 29rem;
  color: var(--muted);
  font-size: clamp(0.96rem, 1.25vw, 1.12rem);
  font-weight: 900;
  font-synthesis: weight;
  line-height: 1.7;
  text-wrap: pretty;
  -webkit-text-stroke: var(--body-stroke) rgba(255, 255, 255, 0.96);
  paint-order: stroke fill;
  text-shadow: 0 1px 0 rgba(27, 39, 64, 0.08), 0 6px 14px rgba(240, 138, 180, 0.16);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 2.2rem;
}

.text-link {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.text-link span, .focus-button span, .outline-button span, .panel-route span { margin-left: 0.7rem; color: var(--pink); }
.text-link:hover { color: var(--pink); }

.hero-note, .credits {
  color: var(--muted-dark);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.025em;
}

.credits { letter-spacing: 0.04em; }

.focus-section { min-height: 155vh; }
.focus-copy { align-self: center; }

.focus-button, .outline-button, .panel-route {
  display: inline-flex;
  align-items: center;
  margin-top: 1.2rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.76rem;
  font-weight: 900;
  font-synthesis: weight;
  text-shadow: 0 2px 8px rgba(240, 138, 180, 0.18);
  transition: color 180ms ease, border-color 180ms ease;
}

.focus-button:hover, .focus-button:focus-visible, .outline-button:hover, .outline-button:focus-visible, .panel-route:hover, .panel-route:focus-visible {
  border-color: var(--ink);
  color: var(--pink);
}

.outro-section { min-height: 125vh; }
.outro-copy { align-self: center; }
.outro-copy h2 { max-width: 9ch; }
.outro-copy h2 em { color: var(--pink); }
.outline-button { padding: 0.75rem 0.95rem; border: 1px solid var(--line); }
.credits { margin-top: 5rem; }

.project-signature {
  position: fixed;
  right: 0;
  top: max(calc(var(--frame-module-height) + 0.55rem), calc(env(safe-area-inset-top, 0px) + var(--frame-module-height) + 0.25rem));
  bottom: auto;
  left: 0;
  z-index: 6;
  width: auto;
  margin: 0;
  color: #e15d86;
  font-family: "Unbounded", sans-serif;
  font-size: clamp(1.05rem, 2vw, 1.55rem);
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1;
  text-align: center;
  text-shadow: 0 3px 0 rgba(255, 255, 255, 0.92), 0 6px 16px rgba(211, 57, 107, 0.3), 0 12px 26px rgba(240, 138, 180, 0.2);
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.84);
  paint-order: stroke fill;
  pointer-events: none;
  animation: signatureFloat 4.8s ease-in-out infinite;
}

@keyframes signatureFloat {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, 3px, 0); }
}

.hotspots {
  position: fixed;
  inset: 0;
  z-index: 7;
  pointer-events: none;
}

.hotspot {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.85);
  transition: opacity 260ms var(--ease-out), transform 420ms var(--ease-out);
  pointer-events: none;
}

.hotspot.is-visible { opacity: 1; transform: translate(-50%, -50%) scale(1); pointer-events: auto; }
.hotspot-pulse { width: 0.82rem; height: 0.82rem; border: 1px solid var(--pink); border-radius: 50%; box-shadow: 0 0 0 0.3rem rgba(240, 138, 180, 0.15), 0 0 1.2rem rgba(240, 138, 180, 0.8); }
.hotspot-window .hotspot-pulse { border-color: var(--cyan); box-shadow: 0 0 0 0.3rem rgba(138, 200, 195, 0.15), 0 0 1.2rem rgba(138, 200, 195, 0.8); }
.hotspot-banner .hotspot-pulse { border-color: var(--red); box-shadow: 0 0 0 0.3rem rgba(255, 118, 87, 0.15), 0 0 1.2rem rgba(255, 118, 87, 0.58); }
.hotspot-line { width: 2.4rem; height: 1px; background: var(--line); }
.hotspot-label { font-size: 0.64rem; font-weight: 700; letter-spacing: 0.035em; }
.hotspot:hover .hotspot-label, .hotspot:focus-visible .hotspot-label { color: var(--pink); }

.detail-panel {
  position: fixed;
  right: clamp(1rem, 5vw, 5rem);
  bottom: max(calc(var(--frame-bottom-band) + 0.75rem), calc(env(safe-area-inset-bottom, 0px) + 0.75rem));
  z-index: 12;
  width: min(23rem, calc(100vw - 2rem));
  padding: 1.6rem;
  border: 1px solid rgba(27, 39, 64, 0.14);
  color: var(--ink);
  background: rgba(255, 250, 252, 0.84);
  box-shadow: 0 8px 24px rgba(65, 38, 57, 0.08);
  backdrop-filter: blur(18px) saturate(1.05);
  opacity: 0;
  transform: translateY(1.2rem);
  transition: opacity 240ms var(--ease-out), transform 240ms var(--ease-out);
  pointer-events: none;
}

.detail-panel.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.detail-panel h3 { margin-bottom: 0.8rem; }
.detail-panel .panel-body { color: var(--muted); font-size: 0.86rem; line-height: 1.65; text-wrap: pretty; }
.panel-close { position: absolute; top: 0.8rem; right: 1rem; border: 0; color: var(--muted); background: transparent; font-size: 1.6rem; line-height: 1; }
.panel-close:hover, .panel-close:focus-visible { color: var(--ink); }
.panel-route { margin-top: 0.4rem; }

.explore-hint {
  position: fixed;
  bottom: max(calc(var(--frame-bottom-band) + 0.65rem), calc(env(safe-area-inset-bottom, 0px) + 0.65rem));
  left: 50%;
  z-index: 11;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  transform: translate(-50%, 0.5rem);
  transition: opacity 260ms var(--ease-out), transform 260ms var(--ease-out);
  pointer-events: none;
}

body[data-mode="explore"] .explore-hint { opacity: 1; transform: translate(-50%, 0); }
.drag-icon { color: var(--pink); font-size: 1rem; }

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 1.5rem clamp(1.1rem, 8vw, 9rem);
  background:
    radial-gradient(circle at 50% 42%, rgba(240, 138, 180, 0.13), transparent 34%),
    var(--night);
  text-align: center;
  transition: opacity 700ms var(--ease-out), visibility 700ms;
}

.loading-screen.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.loading-brand {
  position: relative;
  width: min(32rem, 82vw);
  margin-bottom: 1.8rem;
  isolation: isolate;
}

.loading-logo {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  animation: none;
  transform-origin: center;
}

.loading-orbit {
  display: none;
  position: absolute;
  inset: 50% auto auto 12.5%;
  z-index: 0;
  width: clamp(6.5rem, 13vw, 9.5rem);
  aspect-ratio: 1;
  border: 2px dashed rgba(240, 138, 180, 0.38);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: loaderOrbitSpin 8s linear infinite;
}

.loading-kicker,
.loading-status,
.loading-percent {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.09em;
}

.loading-kicker { margin-bottom: 0.9rem; color: var(--pink); }

.loading-bar {
  width: min(25rem, 76vw);
  height: 4px;
  margin: 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.12);
}

.loading-bar span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--pink);
  box-shadow: 0 0 14px rgba(240, 138, 180, 0.58);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 180ms ease;
}

.loading-meta {
  display: flex;
  justify-content: space-between;
  width: min(25rem, 76vw);
  margin-top: 0.75rem;
}

.loading-status,
.loading-percent { margin: 0; color: var(--muted-dark); }

@keyframes loaderLogoFloat {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(0, -7px, 0) scale(1.012); }
}

@keyframes loaderOrbitSpin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.fallback-message {
  position: fixed;
  inset: 50% auto auto 50%;
  z-index: 20;
  width: min(30rem, calc(100vw - 2rem));
  padding: 2rem;
  border: 1px solid var(--line);
  background: var(--night-soft);
  transform: translate(-50%, -50%);
}
.fallback-message[hidden] { display: none; }
.fallback-message h2 { font-size: 2.6rem; }
.fallback-message .fallback-copy { color: var(--muted); line-height: 1.6; }

@media (min-width: 701px) and (max-width: 1100px) {
  :root {
    --frame-side: clamp(1.45rem, 3vw, 2rem);
    --frame-band: clamp(2.55rem, 6vh, 3.4rem);
    --frame-bottom-band: clamp(2.7rem, 6.2vh, 3.6rem);
  }

  .story-section {
    min-height: 135dvh;
    padding-inline: max(2rem, calc(var(--frame-side) + 2rem));
  }

  h1 { font-size: clamp(3.8rem, 8vw, 5.4rem); }
  h2 { font-size: clamp(3.2rem, 6vw, 4.8rem); }
}

@media (max-width: 700px) {
  :root {
    --frame-side: clamp(1.15rem, 5vw, 1.7rem);
    --frame-band: clamp(2.6rem, 8vh, 3.8rem);
    --frame-bottom-band: clamp(2.7rem, 8vh, 4rem);
    --frame-module-width: min(8.8rem, 34vw);
    --frame-module-height: clamp(3rem, 8.5vh, 4rem);
    --frame-bottom-module-height: clamp(3.15rem, 8.5vh, 4.2rem);
  }

  .site-header {
    top: auto;
    bottom: calc(var(--frame-bottom-band) + 0.65rem);
    width: min(252px, calc(100vw - 2rem));
    height: 44px;
  }

  .japan-art-bg { inset: 0; }
  .frame-brand { width: min(calc(var(--frame-module-width) - 0.95rem), 6.8rem); }
  .project-signature {
    top: calc(var(--frame-module-height) + 0.42rem);
    font-size: clamp(0.86rem, 3.8vw, 1.05rem);
  }
  .nav-link { width: 36px; min-height: 36px; flex-basis: 36px; }
  .nav-progress { right: 10px; bottom: -6px; left: 10px; }
  .story-section {
    min-height: 118vh;
    min-height: 118dvh;
    padding-top: calc(var(--frame-band) + 2.5rem);
    padding-right: max(1.1rem, calc(var(--frame-side) + 0.65rem), calc(env(safe-area-inset-right, 0px) + 1rem));
    padding-bottom: calc(var(--frame-bottom-band) + 2.5rem);
    padding-left: max(1.1rem, calc(var(--frame-side) + 0.65rem), calc(env(safe-area-inset-left, 0px) + 1rem));
  }

  .story-copy {
    max-width: calc(100% - 0.4rem);
    margin-inline: 0;
  }

  .hero-section { min-height: 112vh; min-height: 112dvh; }
  .hero-copy { padding-top: 0; transform: translateY(clamp(-2.75rem, -4vh, -1rem)); }
  h1 { font-size: clamp(2.35rem, 14vw, 5.15rem); }
  h2 { font-size: clamp(2.15rem, 11.5vw, 4.5rem); }
  .copy-right { justify-self: start; }
  .focus-copy { padding-bottom: 0; }
  .hero-actions { align-items: flex-start; flex-direction: column; gap: 0.8rem; }
  .hotspot-line { width: 1.4rem; }
  .hotspot-label { font-size: 0.5rem; }
  .detail-panel {
    right: max(1rem, env(safe-area-inset-right, 0px));
    bottom: max(calc(var(--frame-bottom-band) + 0.65rem), calc(env(safe-area-inset-bottom, 0px) + 0.65rem));
  }
  .roofline { bottom: 15%; width: 72%; }
  .roofline-front { bottom: 10%; width: 66%; }
}

@media (max-height: 560px) and (orientation: landscape) {
  :root {
    --frame-band: 2.25rem;
    --frame-bottom-band: 2.45rem;
    --frame-module-height: 2.9rem;
    --frame-bottom-module-height: 3rem;
  }

  .site-header {
    top: auto;
    bottom: calc(var(--frame-bottom-band) + 0.45rem);
    height: 40px;
  }
  .nav-link { width: 32px; min-height: 32px; flex-basis: 32px; }
  .nav-link svg { width: 15px; height: 15px; }
  .story-section {
    min-height: 145vh;
    min-height: 145dvh;
    padding-top: calc(var(--frame-band) + 2rem);
    padding-bottom: calc(var(--frame-bottom-band) + 2rem);
  }
  .hero-copy { transform: none; }
  h1 { font-size: clamp(2.4rem, 7vw, 4.2rem); }
  h2 { font-size: clamp(2.2rem, 5.5vw, 4rem); }
  .intro-copy, .story-body { font-size: 0.82rem; line-height: 1.45; }
  .project-signature {
    top: calc(var(--frame-module-height) + 0.3rem);
    font-size: 0.78rem;
  }
}

@media (min-width: 1600px) and (min-aspect-ratio: 2/1) {
  .story-section { padding-inline: max(8vw, calc(var(--frame-side) + 4rem)); }
  .story-copy { max-width: 38rem; }
}
