:root {
  --ink: #14152d;
  --ink-soft: rgba(20, 21, 45, .7);
  --paper: #f3f0fb;
  --accent: #7566f0;
  --accent-text: #5542c5;
  --accent-soft: rgba(117, 102, 240, .16);
  --header-h: 78px;
  --edge: clamp(22px, 4.3vw, 78px);
  --chapter-lift: 0px;
  --chapter-alpha-0: 1;
  --chapter-alpha-1: 0;
  --chapter-alpha-2: 0;
  --chapter-alpha-3: 0;
  --chapter-alpha-4: 0;
  color-scheme: light;
  font-family: "Avenir Next", "Helvetica Neue", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  scroll-behavior: auto;
  background: var(--paper);
}

body {
  width: 100%;
  max-width: 100%;
  margin: 0;
  overflow-x: hidden;
  overflow-x: clip;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 16px;
  color: #fff;
  background: #17182f;
  border-radius: 999px;
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

.site-header {
  position: fixed;
  z-index: 40;
  inset: 0 0 auto;
  height: var(--header-h);
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto minmax(230px, 1fr);
  align-items: center;
  gap: 24px;
  padding: max(10px, env(safe-area-inset-top)) var(--edge) 10px;
  pointer-events: none;
}

.site-header::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: 118%;
  background: linear-gradient(to bottom, rgba(250, 249, 255, .82), rgba(250, 249, 255, 0));
  pointer-events: none;
}

.brand {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--ink);
  text-decoration: none;
  pointer-events: auto;
}
.brand__plate {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 7px 12px;
  border: 1px solid rgba(255,255,255,.68);
  border-radius: 999px;
  background: rgba(255,255,255,.66);
  box-shadow: 0 12px 38px rgba(34, 31, 96, .12);
  backdrop-filter: blur(16px) saturate(1.2);
}
.brand img { width: 112px; height: auto; }
.brand__edition {
  padding-left: 13px;
  border-left: 1px solid rgba(20,21,45,.22);
  font-size: 8px;
  line-height: 1.35;
  font-weight: 800;
  letter-spacing: .15em;
  opacity: .76;
}

.top-nav {
  pointer-events: auto;
  padding: 4px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 999px;
  background: rgba(255,255,255,.64);
  box-shadow: 0 12px 34px rgba(27,31,80,.1);
  backdrop-filter: blur(18px) saturate(1.2);
}
.top-nav ol {
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.top-nav button {
  appearance: none;
  min-height: 40px;
  padding: 0 clamp(10px, 1.05vw, 18px);
  color: rgba(20,21,45,.74);
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  white-space: nowrap;
  transition: color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.top-nav button[aria-current="step"] {
  color: #17182f;
  background: color-mix(in srgb, var(--accent) 22%, #fff);
  box-shadow: 0 7px 18px color-mix(in srgb, var(--accent) 34%, transparent);
}

.official-link {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 18px;
  color: #fff;
  background: #17182f;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  box-shadow: 0 12px 34px rgba(25,24,57,.18);
  text-decoration: none;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  pointer-events: auto;
}

.spatial-film {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 760svh;
  min-height: 5000px;
}

.film-stage {
  position: sticky;
  z-index: 0;
  top: 0;
  width: 100%;
  max-width: 100%;
  height: 100svh;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  background: #ebe7f8;
}

.film-poster,
#spatial-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.film-poster {
  z-index: 0;
  object-fit: cover;
  object-position: 62% 50%;
}
#spatial-canvas {
  z-index: 1;
  display: block;
  max-width: 100%;
  opacity: 0;
  pointer-events: none;
}
body.is-ready #spatial-canvas { opacity: 1; }
body.is-ready .film-poster { visibility: hidden; }
body.has-webgl-fallback #spatial-canvas { display: none; }
body.has-webgl-fallback .film-poster { visibility: visible; }

.world-overlay {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(250,249,246,.93) 0%, rgba(250,249,246,.72) 22%, rgba(250,249,246,.28) 38%, rgba(250,249,246,0) 57%),
    linear-gradient(180deg, rgba(246,244,251,.1) 0%, transparent 72%, rgba(25,22,65,.035) 100%);
}

.film-progress {
  position: absolute;
  z-index: 45;
  inset: 0 0 auto;
  height: 2px;
  overflow: hidden;
  background: rgba(39,39,83,.08);
  pointer-events: none;
}
.film-progress i {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #d866c6, #f2a066);
  transform: scaleX(0);
  transform-origin: 0 50%;
  will-change: transform;
}

.copy-shell {
  position: absolute;
  z-index: 10;
  left: var(--edge);
  top: 50%;
  width: min(590px, 48vw);
  transform: translateY(-45%);
}

.world-kicker {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 18px;
  color: var(--accent-text);
  font-size: 9px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: .17em;
}
.world-kicker i {
  width: 30px;
  height: 1px;
  background: currentColor;
  opacity: .5;
}

.copy-shell > h1 {
  max-width: 510px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(34px, 4.15vw, 70px);
  line-height: .99;
  font-weight: 760;
  letter-spacing: -.055em;
  transform-origin: left center;
  will-change: opacity, transform;
}
.copy-shell > h1 em {
  color: var(--ink);
  font-style: normal;
  background: linear-gradient(100deg, #403aa7 0%, var(--accent) 46%, #a84cac 78%, #e47778 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  word-break: keep-all;
  overflow-wrap: normal;
}

.chapter-stack {
  position: relative;
  height: 276px;
  margin-top: clamp(25px, 4.2vh, 46px);
  transform: translate3d(0, var(--chapter-lift), 0);
  will-change: transform;
}

.chapter {
  position: absolute;
  inset: 0 auto auto 0;
  width: min(540px, 100%);
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  pointer-events: none;
  will-change: opacity, transform;
}
.chapter[data-chapter="0"] { opacity: var(--chapter-alpha-0); }
.chapter[data-chapter="1"] { opacity: var(--chapter-alpha-1); }
.chapter[data-chapter="2"] { opacity: var(--chapter-alpha-2); }
.chapter[data-chapter="3"] { opacity: var(--chapter-alpha-3); }
.chapter[data-chapter="4"] { opacity: var(--chapter-alpha-4); }
.chapter[aria-hidden="false"] { pointer-events: auto; }

.chapter__eyebrow {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 0 0 10px;
  color: rgba(20,21,45,.72);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .13em;
}
.chapter__eyebrow span { color: var(--accent-text); }

.chapter h2 {
  margin: 0;
  color: var(--ink);
  max-width: 530px;
  font-size: clamp(31px, 2.75vw, 48px);
  line-height: 1.04;
  font-weight: 800;
  letter-spacing: -.052em;
  text-wrap: balance;
}
.chapter h2 span {
  color: var(--accent-text);
}

.chapter__lead {
  position: relative;
  max-width: 500px;
  margin: 17px 0 0;
  padding-left: 15px;
  color: var(--ink-soft);
  border-left: 2px solid color-mix(in srgb, var(--accent) 62%, #fff);
  font-size: clamp(13px, 1.02vw, 16px);
  line-height: 1.68;
  font-weight: 600;
  letter-spacing: .01em;
}

.chapter__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}
.chapter__tags li {
  padding: 7px 11px;
  color: var(--accent-text);
  background: color-mix(in srgb, var(--accent) 10%, rgba(255,255,255,.82));
  border: 1px solid color-mix(in srgb, var(--accent) 20%, rgba(255,255,255,.72));
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(44,40,105,.06);
  font-size: 10px;
  line-height: 1;
  font-weight: 750;
  letter-spacing: .03em;
}

.chapter__cta {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  margin-top: 17px;
  padding: 0 18px;
  color: #fff;
  background: #27284f;
  border-radius: 999px;
  box-shadow: 0 14px 30px color-mix(in srgb, var(--accent) 24%, transparent);
  text-decoration: none;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
}

.ai-note {
  max-width: 500px;
  margin: -8px 0 0;
  color: rgba(20,21,45,.72);
  font-size: 11px;
  line-height: 1.55;
  font-weight: 600;
  transform: translate3d(0, var(--chapter-lift), 0);
}

.chapter-rail {
  position: absolute;
  z-index: 12;
  right: max(26px, calc(var(--edge) * .5));
  top: 50%;
  display: flex;
  align-items: center;
  gap: 14px;
  transform: translateY(-44%);
}
.chapter-rail > p {
  margin: 0;
  color: rgba(20,21,45,.68);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .14em;
  writing-mode: vertical-rl;
}
.chapter-rail ol {
  position: relative;
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 16px 0;
  list-style: none;
}
.chapter-rail ol::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: rgba(28,27,67,.17);
}
.chapter-rail button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 50%;
  box-shadow: none;
  cursor: pointer;
}
.chapter-rail button i {
  width: 10px;
  height: 10px;
  box-shadow: 0 5px 16px rgba(30,29,74,.13);
  border-radius: 50%;
  background: rgba(28,27,67,.28);
}
.chapter-rail button span {
  position: absolute;
  right: 40px;
  padding: 6px 9px;
  color: rgba(20,21,45,.68);
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 999px;
  box-shadow: 0 7px 20px rgba(35,31,88,.09);
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(5px);
  transition: opacity .2s ease, transform .2s ease;
}
.chapter-rail button:hover span,
.chapter-rail button:focus-visible span,
.chapter-rail button[aria-current="step"] span {
  opacity: 1;
  transform: none;
}
.chapter-rail button[aria-current="step"] {
  background: transparent;
  box-shadow: none;
}
.chapter-rail button[aria-current="step"] i {
  background: var(--accent);
  box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 15%, transparent), 0 7px 18px color-mix(in srgb, var(--accent) 28%, transparent);
}

.scene-counter {
  position: absolute;
  z-index: 11;
  right: var(--edge);
  bottom: max(27px, calc(env(safe-area-inset-bottom) + 19px));
  display: flex;
  align-items: baseline;
  gap: 5px;
  color: rgba(20,21,45,.72);
}
.scene-counter strong { color: var(--ink); font-size: 28px; line-height: 1; letter-spacing: -.05em; }
.scene-counter span { font-size: 9px; font-weight: 800; letter-spacing: .12em; }

.scroll-cue {
  position: absolute;
  z-index: 11;
  left: 50%;
  bottom: max(25px, calc(env(safe-area-inset-bottom) + 17px));
  display: flex;
  align-items: center;
  gap: 11px;
  color: rgba(20,21,45,.7);
  transform: translateX(-50%);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .13em;
  white-space: nowrap;
}
.scroll-cue__track {
  position: relative;
  width: 18px;
  height: 30px;
  border: 1px solid rgba(20,21,45,.25);
  border-radius: 999px;
}
.scroll-cue__track i {
  position: absolute;
  top: 6px;
  left: 50%;
  width: 3px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
  transform: translateX(-50%);
  animation: cue 1.8s ease-in-out infinite;
}
@keyframes cue {
  0%, 100% { opacity: .35; transform: translate(-50%, 0); }
  48% { opacity: 1; transform: translate(-50%, 8px); }
}

.motion-control {
  position: absolute;
  z-index: 13;
  left: var(--edge);
  bottom: max(25px, calc(env(safe-area-inset-bottom) + 17px));
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 13px;
  color: rgba(20,21,45,.66);
  background: rgba(255,255,255,.7);
  border: 1px solid rgba(255,255,255,.76);
  border-radius: 999px;
  box-shadow: 0 9px 25px rgba(28,27,72,.1);
  backdrop-filter: blur(14px);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}
.motion-control:disabled { cursor: default; opacity: .72; }
.motion-control__icon { display: flex; gap: 3px; }
.motion-control__icon i { width: 2px; height: 11px; background: var(--accent); border-radius: 9px; }
.motion-control__icon i:last-child { height: 7px; align-self: center; }
.motion-control[aria-pressed="true"] .motion-control__icon i { height: 8px; }

.review-badge {
  position: absolute;
  z-index: 12;
  right: var(--edge);
  top: calc(var(--header-h) + 14px);
  margin: 0;
  padding: 7px 10px;
  color: rgba(25,24,61,.62);
  background: rgba(255,255,255,.66);
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(27,26,69,.08);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  pointer-events: none;
}

.loading-status {
  position: absolute;
  z-index: 60;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: rgba(20,21,45,.66);
  background: #f3f0fb;
  transition: opacity .45s ease, visibility .45s ease;
}
.loading-status span {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(80,67,184,.17);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.loading-status p { margin: 0; font-size: 9px; font-weight: 800; letter-spacing: .14em; }
@keyframes spin { to { transform: rotate(1turn); } }
body.is-ready .loading-status,
body.has-webgl-fallback .loading-status { visibility: hidden; opacity: 0; }

body.is-motion-reduced .scroll-cue__track i,
body.is-motion-reduced .loading-status span { animation: none; }

.webgl-fallback {
  position: absolute;
  z-index: 20;
  right: var(--edge);
  bottom: 80px;
  max-width: 320px;
  padding: 10px 13px;
  color: #fff;
  background: rgba(18,19,47,.82);
  border-radius: 12px;
  font-size: 10px;
  line-height: 1.55;
}
.webgl-fallback p { margin: 0; }

.noscript-note {
  position: fixed;
  z-index: 100;
  right: 12px;
  bottom: 12px;
  margin: 0;
  padding: 12px 15px;
  color: #fff;
  background: #17182f;
  border-radius: 12px;
  font-size: 12px;
}
.noscript-note a { color: #fff; }

@media (max-width: 1100px) {
  :root { --edge: clamp(22px, 3.4vw, 42px); }
  .site-header { grid-template-columns: 1fr auto; }
  .top-nav { display: none; }
  .copy-shell { width: min(560px, 57vw); }
  .copy-shell > h1 { font-size: clamp(36px, 5.2vw, 61px); }
  .chapter h2 { font-size: clamp(29px, 3.3vw, 40px); }
}

@media (min-width: 721px) and (min-height: 721px) {
  .ai-note { transform: none; }
}

@media (max-width: 720px) {
  :root { --header-h: 68px; --edge: 18px; }
  .site-header { gap: 10px; padding-left: 16px; padding-right: 16px; }
  .brand__plate { min-height: 38px; padding: 6px 10px; }
  .brand img { width: 96px; }
  .brand__edition { display: none; }
  .official-link { min-height: 40px; padding: 0 13px; font-size: 11px; }
  .official-link svg { width: 15px; }
  .spatial-film { height: 680svh; min-height: 4300px; }
  .film-stage { min-height: 0; }
  .film-poster { object-position: 68% 50%; }
  .world-overlay {
    background:
      linear-gradient(180deg, rgba(248,247,251,.06) 0%, rgba(248,247,251,.02) 52%, rgba(250,249,247,.24) 76%, rgba(250,249,247,.54) 100%),
      linear-gradient(90deg, rgba(250,249,247,.78) 0%, rgba(250,249,247,.48) 44%, rgba(250,249,247,.08) 76%, transparent 100%);
  }
  .copy-shell {
    left: 18px;
    right: 18px;
    top: auto;
    bottom: max(84px, calc(env(safe-area-inset-bottom) + 70px));
    width: auto;
    transform: none;
  }
  .world-kicker { margin-bottom: 10px; font-size: 11px; }
  .world-kicker i { width: 20px; }
  .copy-shell > h1 {
    max-width: 340px;
    font-size: clamp(30px, 9.8vw, 43px);
    line-height: 1.02;
  }
  .chapter-stack { height: 276px; margin-top: 19px; }
  .chapter { width: 100%; }
  .chapter__eyebrow { margin-bottom: 7px; font-size: 12px; }
  .chapter h2 { font-size: clamp(24px, 7.2vw, 32px); }
  .chapter__lead { margin-top: 11px; padding-left: 12px; font-size: 14px; line-height: 1.56; }
  .chapter__lead br { display: none; }
  .chapter__tags { gap: 5px; margin-top: 10px; }
  .chapter__tags li { padding: 7px 10px; font-size: 12px; }
  .chapter__cta { min-height: 44px; margin-top: 11px; padding: 0 15px; font-size: 13px; }
  .ai-note { margin-top: -8px; font-size: 12px; line-height: 1.45; }
  .chapter-rail {
    right: 16px;
    top: 38%;
    gap: 0;
    transform: translateY(-50%);
  }
  .chapter-rail > p { display: none; }
  .chapter-rail ol { gap: 1px; }
  .chapter-rail button span { display: none; }
  .scene-counter { right: 16px; bottom: max(19px, calc(env(safe-area-inset-bottom) + 11px)); }
  .scene-counter strong { font-size: 22px; }
  .scroll-cue { display: none; }
  .motion-control {
    left: 16px;
    bottom: max(17px, calc(env(safe-area-inset-bottom) + 9px));
    min-height: 44px;
    padding: 0 11px;
    font-size: 12px;
  }
  .review-badge {
    right: 15px;
    top: calc(var(--header-h) + 7px);
    max-width: 190px;
    white-space: normal;
    font-size: 11px;
    line-height: 1.35;
    text-align: right;
  }
  .webgl-fallback { right: 16px; bottom: 60px; max-width: calc(100% - 32px); }
}

@media (max-width: 390px) {
  .official-link span { max-width: 72px; overflow: hidden; white-space: nowrap; }
  .copy-shell > h1 { font-size: 31px; }
  .chapter h2 { font-size: 24px; }
  .chapter-stack { height: 276px; }
}

@media (max-height: 720px) and (orientation: landscape) {
  :root { --header-h: 58px; }
  .site-header { padding-top: 7px; padding-bottom: 7px; }
  .brand__plate { min-height: 35px; padding: 5px 9px; }
  .brand img { width: 92px; }
  .official-link { min-height: 35px; }
  .film-stage { height: 100svh; min-height: 0; }
  .copy-shell {
    left: var(--edge);
    right: auto;
    top: calc(var(--header-h) + 16px);
    bottom: 46px;
    width: min(330px, 40vw);
    display: block;
    transform: none;
  }
  .world-kicker { margin-bottom: 10px; font-size: 9px; }
  .copy-shell > h1 { display: none; }
  .chapter-stack {
    height: 190px;
    margin-top: 0;
    transform: none;
  }
  .chapter h2 { font-size: clamp(22px, 2.75vw, 27px); }
  .chapter__eyebrow { margin-bottom: 7px; font-size: 9px; }
  .chapter__lead { margin-top: 8px; padding-left: 10px; font-size: 11px; line-height: 1.38; }
  .chapter__tags { display: none; }
  .chapter__cta { min-height: 40px; margin-top: 8px; font-size: 11px; }
  .ai-note { display: none; }
  .motion-control { bottom: 8px; min-height: 38px; }
  .scene-counter { bottom: 15px; }
  .review-badge { top: calc(var(--header-h) + 2px); font-size: 10px; }
  .scroll-cue { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-cue__track i,
  .loading-status span { animation: none; }
  .top-nav button,
  .chapter-rail button span,
  .loading-status { transition: none; }
}
