/**
 * Grater Records のタイムラインと詳細アーカイブ
 */

:root {
  --bg-space: #04060d;
  --ink: #f5f7fb;
  --ink-dim: #9aa6be;
  --era-color: #7da8d8;
  --era-secondary: #2c487c;
  --hairline: rgba(245, 247, 251, 0.12);
  --glass-radius: 6px;
  --control-radius: 4px;
  --glass-fill: #050812c7;
  --glass-blur: blur(14px);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  background: var(--bg-space);
  color: var(--ink);
  font-family: 'Outfit', 'IBM Plex Sans JP', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

html.is-capsule-open {
  overflow-y: hidden;
  overscroll-behavior: none;
}

body {
  margin: 0;
  background: var(--bg-space);
  color: var(--ink);
  overflow-x: clip;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; }

button:focus-visible,
a:focus-visible {
  outline: 2px solid #f5f7fb;
  outline-offset: 2px;
}

.font-mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* =========================================================
   WebGPU フルスクリーン背景
========================================================= */
#chrono-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(90% 70% at 50% 46%, color-mix(in srgb, var(--era-color) 12%, #060914) 0%, #04060d 72%);
  transition: background 1s ease;
}

#chrono-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

#chrono-canvas[hidden] { display: none; }

.chrono-cursor-ripple {
  position: fixed;
  z-index: 19;
  width: 50vw;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid #ffe0a8b8;
  box-shadow: 0 0 15px color-mix(in srgb, var(--era-color) 65%, #f4cc8d70), inset 0 0 11px #f4cc8d4d;
  background: radial-gradient(closest-side, transparent 67%, #f4cc8d07 85%, #f4cc8d15 100%);
  opacity: 0;
  pointer-events: none;
}

.is-below-voyage .chrono-cursor-ripple {
  border-color: color-mix(in srgb, var(--portal-color, #e7c897) 48%, #ffe0a8b8);
}

@media (pointer: coarse), (prefers-reduced-motion: reduce) {
  .chrono-cursor-ripple { display: none; }
}

.cockpit-vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(4, 6, 13, 0.52) 0%, transparent 16%, transparent 74%, rgba(4, 6, 13, 0.86) 100%);
}

/* =========================================================
   左上の刻印と右上の操作バー
========================================================= */
.hud-top {
  position: fixed;
  top: 24px;
  left: 32px;
  right: 32px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
}

.hud-brand {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 11px;
  padding: 4px 0;
  transition: filter 0.25s ease, opacity 0.25s ease;
}

.hud-brand-mark {
  display: block;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  background: url('./assets/media/grater_logo_cube_mark_white.png') center / contain no-repeat;
  filter: drop-shadow(0 0 8px rgba(156, 196, 244, 0.28)) drop-shadow(0 2px 8px rgba(2, 5, 14, 0.85));
}

@supports ((mask-image: url('')) or (-webkit-mask-image: url(''))) {
  .hud-brand-mark {
    -webkit-mask: url('./assets/media/grater_logo_cube_mark_white.png') center / contain no-repeat;
    mask: url('./assets/media/grater_logo_cube_mark_white.png') center / contain no-repeat;
    background: linear-gradient(135deg, #ffffff 0%, #e4effd 68%, #ecd4a8 100%);
  }
}

.hud-brand-stack {
  display: flex;
  flex-direction: column;
  gap: 3px;
  filter: drop-shadow(0 2px 10px rgba(2, 5, 14, 0.85));
}

.hud-brand-primary {
  font-family: 'Outfit', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.30em;
  line-height: 1;
  color: #f8fbff;
  white-space: nowrap;
}

.hud-brand-secondary {
  font-family: 'Outfit', sans-serif;
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.39em;
  line-height: 1;
  color: #e2c99c;
  white-space: nowrap;
}

.hud-brand:hover {
  opacity: 0.96;
  filter: brightness(1.08) drop-shadow(0 0 12px rgba(236, 210, 162, 0.34));
}

.hud-right-tools {
  pointer-events: auto;
  display: inline-flex;
  flex: none;
  align-items: stretch;
  border: 1px solid #f5f7fb24;
  border-radius: var(--glass-radius);
  background: var(--glass-fill);
  backdrop-filter: var(--glass-blur);
}

.hud-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  min-height: 36px;
  padding: 0 12px;
  font: 500 11px/1.2 'Outfit', 'IBM Plex Sans JP', sans-serif;
  color: #f5f7fbd1;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.hud-control + .hud-control { border-inline-start: 1px solid #f5f7fb24; }
.hud-control:first-child { border-radius: 5px 0 0 5px; }
.hud-control:last-child { border-radius: 0 5px 5px 0; }
.hud-control:focus-visible { outline-width: 1px; outline-offset: -3px; }
.hud-control:hover { background-color: #f5f7fb0d; color: #fff; }
.hud-control[aria-pressed='true'] {
  background-color: #dceafa22;
  color: #edf5ff;
}

.hud-control-link {
  color: #f0d9ae;
  background: linear-gradient(90deg, transparent, #e2c99c91, transparent) bottom / 78% 1px no-repeat;
}

body.is-below-voyage .hud-top::before {
  content: '';
  position: absolute;
  inset: -24px -32px -10px;
  z-index: -1;
  background: linear-gradient(#04060df5 40%, #04060d80 78%, transparent);
}

/* =========================================================
   右端：極細ドット式タイムライン・スクラブバー（圧迫感ゼロ）
========================================================= */
.warp-dots {
  position: fixed;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: auto;
  transition: opacity 0.35s ease;
}

.warp-progress-track {
  position: absolute;
  right: 5px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: rgba(245, 247, 251, 0.14);
  pointer-events: none;
}

.warp-progress-fill {
  width: 100%;
  height: 4%;
  background: rgba(245, 247, 251, 0.85);
}

.warp-dot-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  width: 28px;
  padding: 2px 0;
  cursor: pointer;
}

.warp-dot-tip {
  position: absolute;
  right: calc(100% + 4px);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: rgba(245, 247, 251, 0.72);
  opacity: 0;
  transform: translateX(4px);
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.warp-dot-btn:hover .warp-dot-tip,
.warp-dot-btn:focus-visible .warp-dot-tip {
  opacity: 1;
  transform: translateX(0);
}

/* 通常時はドットのみ表示し、3D空間右サイドの彫刻タイポグラフィと視線を干渉させない */
.warp-dot-btn[aria-current='true']:hover .warp-dot-tip,
.warp-dot-btn[aria-current='true']:focus-visible .warp-dot-tip {
  opacity: 1;
  transform: translateX(0);
  color: #ffffff;
  font-weight: 600;
}

.warp-dot-pip {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  border: 1.5px solid rgba(245, 247, 251, 0.35);
  background: #04060d;
  flex-shrink: 0;
  transition: transform 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}

.warp-dot-btn:hover .warp-dot-pip {
  border-color: #ffffff;
}

.warp-dot-btn[aria-current='true'] .warp-dot-pip {
  border-color: #ffffff;
  background: #ffffff;
  transform: scale(1.22);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.65);
}

/* =========================================================
   スクロールドリブン時空トラック ＆ 映画字幕型ボトムHUD
========================================================= */
main {
  position: relative;
  z-index: 10;
  pointer-events: none;
}

.voyage-track {
  position: relative;
  height: 1020vh;
  width: 100%;
  pointer-events: none;
}

.voyage-stage {
  position: sticky;
  top: 0;
  height: 100dvh;
  min-height: 580px;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
  padding: 28px 32px;
}

/* 描画環境に依存しない年表の背景と主役ビジュアル */
body.is-fallback #chrono-bg {
  background:
    radial-gradient(ellipse at 48% 44%, #04060d 8%, transparent 56%),
    radial-gradient(ellipse at 9% 28%, color-mix(in srgb, var(--era-secondary) 48%, transparent), transparent 63%),
    radial-gradient(ellipse at 85% 63%, color-mix(in srgb, var(--era-color) 25%, transparent), transparent 60%),
    repeating-radial-gradient(ellipse at 12% 120%, #ffffff0d 0 1px, transparent 1px 24px),
    #04060d;
}

.chrono-fallback-stage {
  display: grid;
  flex: 1;
  grid-template-rows: auto minmax(0, 1fr) auto;
  justify-items: center;
  gap: clamp(8px, 2dvh, 24px);
  min-height: 0;
  margin: 52px auto 0;
  width: min(100%, 780px);
  text-align: center;
  text-shadow: 0 3px 24px #04060d;
}

.chrono-fallback-stage[hidden] { display: none; }
body.is-prologue .chrono-fallback-stage { visibility: hidden; }
body.is-fallback .prologue-overlay { transition: opacity 0.35s ease, visibility 0.35s ease; }
body.is-fallback .prologue-overlay.is-hidden { opacity: 0; }

.chrono-fallback-heading {
  display: grid;
  justify-items: center;
  gap: 2px;
}

.chrono-fallback-year {
  font: 500 clamp(42px, min(14vw, 15dvh), 136px)/0.95 'Outfit', sans-serif;
  letter-spacing: 0.075em;
  color: #dceafa;
}

@supports (background-clip: text) {
  .chrono-fallback-year {
    background: linear-gradient(#f5f7fb, #abc7e5);
    background-clip: text;
    color: transparent;
  }
}

.chrono-fallback-date {
  font-size: 12px;
  letter-spacing: 0.16em;
}

.chrono-fallback-media {
  position: relative;
  align-self: stretch;
  width: 100%;
}

.chrono-fallback-media img,
.chrono-fallback-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px #04060dcc);
}

.chrono-fallback-stage.is-playing .chrono-fallback-media img { visibility: hidden; }

.chrono-audio-scope {
  position: absolute;
  inset-inline: 0;
  width: 100%;
  height: 28px;
  background: linear-gradient(90deg, transparent, #0b1018eb 8% 92%, transparent);
  pointer-events: none;
}

.chrono-fallback-stage:not(.no-audio-scope) .has-audio-scope { container-type: size; }
.chrono-fallback-stage:not(.no-audio-scope) .has-audio-scope :is(img, video) { height: max(1px, calc(100% - 28px)); }
.chrono-fallback-media .chrono-audio-scope {
  inset-block-end: 0;
  margin-inline: auto;
  width: min(100%, calc((100cqh - 28px) * 16 / 9));
}
.no-audio-scope .chrono-audio-scope { display: none; }

.chrono-fallback-category {
  display: grid;
  justify-items: center;
  gap: 6px;
  font-size: 12px;
  color: #e8effa;
}

.chrono-fallback-category-label {
  --panel-accent: var(--era-color);
  position: relative;
  padding: 6px 18px;
  background: #04071080;
  font: 600 clamp(12px, 3.5vw, 18px)/1.2 'Outfit', sans-serif;
  letter-spacing: 0.14em;
}

/* =========================================================
   改善案E：ブランド・プロローグ（ファーストビュー導入画面）
   ========================================================= */
.prologue-overlay {
  position: absolute;
  inset: 0;
  z-index: 18;
  display: grid;
  grid-template: minmax(min-content, 1fr) auto / minmax(0, 1fr);
  place-items: center;
  row-gap: clamp(12px, 2.6dvh, 24px);
  padding: max(76px, calc(env(safe-area-inset-top) + 60px)) 28px max(24px, env(safe-area-inset-bottom));
  text-align: center;
  pointer-events: auto;
  will-change: opacity, transform;
  transition: visibility 0.35s ease;
}

.prologue-overlay.is-hidden {
  pointer-events: none;
  visibility: hidden;
}

.prologue-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 960px;
  gap: 0;
}

.prologue-kicker {
  font-size: 10.5px;
  letter-spacing: 0.34em;
  color: rgba(186, 208, 240, 0.64);
  text-shadow: 0 2px 14px rgba(2, 5, 14, 0.92);
  margin-bottom: clamp(14px, 2.2dvh, 22px);
}

.prologue-crest-row {
  --crest-size: clamp(60px, 6.8vw, 78px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--crest-size) minmax(0, 1fr);
  align-items: center;
  gap: clamp(12px, 2vw, 22px);
  width: min(100%, 308px);
  margin-bottom: clamp(10px, 1.5dvh, 14px);
}

.prologue-crest-row::before,
.prologue-crest-row::after {
  content: '';
  height: 1px;
  background: linear-gradient(90deg, transparent, #9cc4f470 66%, #ecd2a2bf);
}

.prologue-crest-row::after { transform: scaleX(-1); }

.prologue-crest {
  aspect-ratio: 1;
  display: grid;
  filter: drop-shadow(0 0 9px #9cc4f46b) drop-shadow(0 4px 22px #ecd2a238);
}

.prologue-crest::before {
  content: '';
  background: url('./assets/media/grater_logo_cube_white.png') center / contain no-repeat;
}

@supports ((mask-image: url('')) or (-webkit-mask-image: url(''))) {
  .prologue-crest::before {
    -webkit-mask: url('./assets/media/grater_logo_cube_white.png') center / contain no-repeat;
    mask: url('./assets/media/grater_logo_cube_white.png') center / contain no-repeat;
    background:
      linear-gradient(108deg, transparent 40%, #f8fbff85 50%, transparent 60%) 100% 0 / 235% 100% no-repeat,
      linear-gradient(142deg, #f8fbff 9%, #d9eaff 36%, #9cc4f4 61%, #ecd2a2 92%);
    animation: prologueCrestShimmer 6.6s ease-in-out infinite;
  }
}

@keyframes prologueCrestShimmer {
  0%, 18% { background-position: 100% 0, 0 0; }
  68%, 100% { background-position: 0 0, 0 0; }
}

.prologue-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  font-size: clamp(34px, 4.5vw, 60px);
  line-height: 1.0;
  letter-spacing: 0.1em;
  background: linear-gradient(180deg, #ffffff 0%, #e4effd 56%, #b4d0f2 86%, #ecd4a8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 28px rgba(4, 8, 22, 0.88));
}

.prologue-manifesto {
  position: relative;
  margin: clamp(20px, 3.2dvh, 32px) 0 0;
  padding-top: clamp(16px, 2.4dvh, 24px);
  font-family: 'Noto Serif JP', serif;
  font-weight: 500;
  font-size: clamp(17px, 1.8vw, 22px);
  line-height: 1.55;
  letter-spacing: 0.22em;
  font-feature-settings: "palt" 1;
  text-wrap: balance;
  color: rgba(246, 249, 255, 0.94);
  text-shadow: 0 4px 24px rgba(2, 5, 14, 0.95);
}

.prologue-manifesto::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(236, 210, 162, 0.72), transparent);
}

.prologue-lead {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin: clamp(10px, 1.5dvh, 14px) 0 0;
  font-family: 'Outfit', 'Noto Sans JP', sans-serif;
  font-weight: 400;
  font-size: clamp(11.5px, 1.02vw, 13px);
  line-height: 1.65;
  letter-spacing: 0.12em;
  color: rgba(202, 216, 238, 0.64);
  text-shadow: 0 2px 16px rgba(2, 5, 14, 0.95);
}

.prologue-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(24px, 3.8dvh, 36px);
}

.prologue-primary-btn {
  height: 44px;
  padding: 0 26px;
  border-radius: 999px;
  background: #f5f7fb;
  color: #050812;
  font-family: 'Outfit', 'Noto Sans JP', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.prologue-primary-btn:hover {
  transform: translateY(-2px);
  opacity: 0.94;
}

.prologue-ghost-btn {
  height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid rgba(245, 247, 251, 0.28);
  background: rgba(6, 10, 22, 0.52);
  backdrop-filter: blur(12px);
  color: rgba(245, 247, 251, 0.9);
  font-family: 'Outfit', 'Noto Sans JP', sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: border-color 0.22s ease, background-color 0.22s ease, transform 0.22s ease;
}

.prologue-ghost-btn:hover {
  border-color: rgba(245, 247, 251, 0.65);
  background: rgba(14, 20, 38, 0.68);
  transform: translateY(-2px);
}

.prologue-scroll-cue {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: rgba(226, 236, 252, 0.54);
}

.prologue-scroll-line {
  display: block;
  width: 1px;
  height: 32px;
  background: linear-gradient(180deg, rgba(245, 247, 251, 0.72) 0%, rgba(245, 247, 251, 0) 100%);
  animation: prologuePulse 2.2s ease-in-out infinite;
}

@keyframes prologuePulse {
  0%, 100% { opacity: 0.35; transform: scaleY(0.75); transform-origin: top; }
  50% { opacity: 0.95; transform: scaleY(1); transform-origin: top; }
}

/* プロローグ表示中はタイムラインHUDとドットバーを静かに隠し、ファーストビューを極限まで純化 */
body.is-prologue .minimal-footer-hud,
body.is-prologue .xfd-bar {
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  pointer-events: none;
}

body.is-prologue .warp-dots {
  opacity: 0 !important;
  visibility: hidden;
  pointer-events: none;
}

/* 固定ステージを抜けたら、下層の操作領域から年表の操作を外す。 */
body.is-below-voyage :is(.warp-dots, .chapter-caption, .minimal-footer-hud, .xfd-bar) {
  visibility: hidden;
  pointer-events: none;
  transition: none;
}

/* 試聴バーと詳細ダイアログで共有するガラス面と操作ボタン */
.audio-bar {
  border: 1px solid color-mix(in srgb, var(--control-accent) 26%, var(--hairline));
  border-top-color: color-mix(in srgb, var(--control-accent) 62%, transparent);
  border-radius: var(--glass-radius);
  background: var(--glass-fill);
  backdrop-filter: var(--glass-blur);
  box-shadow: 0 9px 24px #0005;
}

.frame-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 4px 10px;
  border: 1px solid color-mix(in srgb, var(--control-accent) 54%, var(--hairline));
  border-radius: var(--control-radius);
  background: color-mix(in srgb, var(--control-accent) 8%, #080a11);
  color: #f5f7fb;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.frame-control[hidden] { display: none; }
.frame-control:is(:hover, [aria-pressed='true']) {
  border-color: color-mix(in srgb, var(--control-accent) 82%, var(--hairline));
  background: color-mix(in srgb, var(--control-accent) 18%, #080a11);
}

.xfd-bar {
  --control-accent: var(--era-color);
  pointer-events: auto;
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 16px;
  width: min(760px, 100%);
  margin-inline: auto;
  padding: 8px 14px;
}

.xfd-bar[hidden] {
  display: none;
}

.xfd-play-btn {
  gap: 8px;
  min-width: 195px;
  flex-shrink: 0;
}

.xfd-play-icon {
  font-size: 10px;
  line-height: 1;
}

.xfd-progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.xfd-seek {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 3px;
  border-radius: 999px;
  background: rgba(245, 247, 251, 0.22);
  outline: none;
  cursor: pointer;
}

.xfd-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
  cursor: pointer;
}

.xfd-time {
  font-size: 10.5px;
  color: rgba(245, 247, 251, 0.72);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.xfd-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.xfd-eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
  opacity: 0.3;
}

.xfd-eq i {
  display: block;
  width: 2px;
  height: 4px;
  border-radius: 2px;
  background: var(--era-color);
  transition: height 0.15s ease;
}

.xfd-bar.is-playing .xfd-eq {
  opacity: 1;
}

.xfd-vol-wrap {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding-left: 8px;
  border-left: 1px solid rgba(245, 247, 251, 0.14);
}

.xfd-mute-btn {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  color: rgba(245, 247, 251, 0.86);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.xfd-mute-btn:hover {
  background: rgba(245, 247, 251, 0.12);
  color: #ffffff;
}

.xfd-mute-btn[aria-pressed='true'] {
  color: rgba(245, 247, 251, 0.36);
}

.xfd-mute-btn[aria-pressed='true'] .vol-wave,
.xfd-mute-btn[aria-pressed='true'] .vol-wave-2 {
  opacity: 0.15;
}

.xfd-vol-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 92px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(#f5f7fb3d, #f5f7fb3d) center / 100% 3px no-repeat;
  outline: none;
  cursor: pointer;
}

.xfd-vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f5f7fb;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.xfd-vol-slider::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

.xfd-vol-slider::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 50%;
  background: #f5f7fb;
}

.xfd-vol-slider:focus-visible { outline: 1px solid #f5f7fb; outline-offset: 5px; }

.xfd-vol-pct {
  font-size: 10px;
  min-width: 28px;
  text-align: right;
  color: rgba(245, 247, 251, 0.65);
  font-variant-numeric: tabular-nums;
}

.minimal-footer-hud {
  pointer-events: auto;
  display: flex;
  flex-shrink: 0;
  align-items: flex-end;
  justify-content: flex-end;
  align-self: flex-end;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* 左壁面の章キャプション */
.chapter-caption {
  --series-color: var(--era-color);
  --caption-rule: color-mix(in srgb, var(--series-color) 55%, transparent);
  --caption-event-size: clamp(16px, 3.5vw, 18px);
  --caption-mark-height: clamp(72px, 19dvh, 92px);
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: min(100%, 620px);
  flex: 0 0 auto;
  align-self: center;
  padding: 2px 12px;
  pointer-events: none;
  font-family: 'Outfit', 'Noto Sans JP', sans-serif;
  transition: opacity 0.32s ease;
  text-shadow: 0 1px 4px #02050e, 0 2px 18px #02050ef5;
}

.chapter-caption[inert] { opacity: 0; visibility: hidden; }

.caption-mark-slot {
  position: relative;
  padding-inline-end: 10px;
}

.caption-mark-slot::after {
  content: '';
  position: absolute;
  inset-block: 4%;
  inset-inline-end: 0;
  width: 1px;
  background: linear-gradient(transparent, var(--caption-rule) 30%, var(--caption-rule) 70%, transparent);
}

.caption-mark svg {
  display: block;
  width: auto;
  height: var(--caption-mark-height);
  overflow: visible;
  color: #f5f8ff;
  font-family: 'Outfit', sans-serif;
  filter: drop-shadow(0 1px 2px #02050e) drop-shadow(0 0 12px color-mix(in srgb, var(--series-color) 28%, transparent));
  text-shadow: none;
}

.caption-formal {
  margin: 0 0 5px;
  color: color-mix(in srgb, var(--series-color) 72%, #f5f8ff);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.14em;
}

.caption-formal,
.caption-event-line,
.caption-venue {
  white-space: nowrap;
}

.caption-event-block {
  display: grid;
  gap: 7px;
}

.caption-event-text {
  display: grid;
  justify-items: start;
  align-content: start;
  gap: 3px;
  min-block-size: max(2.64em, calc(1.32em + 21px));
  font-size: var(--caption-event-size);
}

.caption-event {
  margin: 0;
  color: #fff;
  font: 500 1em/1.36 'Shippori Mincho', 'Noto Serif JP', serif;
  letter-spacing: 0.14em;
}

.caption-event-line { display: block; }

.caption-venue {
  padding-inline-start: 7px;
  border-inline-start: 1px solid color-mix(in srgb, var(--era-color) 55%, transparent);
  color: #d4e0f2d6;
  font-family: 'Outfit', 'Noto Sans JP', sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.08em;
}

.caption-meta,
.caption-steps {
  display: flex;
  align-items: center;
}

.caption-meta { gap: 11px; }

.caption-event-index {
  color: #cedaee;
  font-size: 10px;
  line-height: 1.25;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.caption-steps { gap: 4px; }

.caption-steps > span {
  width: 9px;
  height: 2px;
  border-radius: 99px;
  background: #f5f7fb38;
  transition: width 0.26s ease, background-color 0.26s ease, box-shadow 0.26s ease;
}

.caption-steps > .is-past { background: color-mix(in srgb, var(--era-color) 60%, #080b14); }

.caption-steps > .is-current {
  width: 19px;
  background: var(--era-color);
  box-shadow: 0 0 8px var(--era-color);
}

@media (max-width: 900px), (max-height: 579px) {
  .chapter-caption { order: 1; }
  .caption-mark-letters { font-size: 15.5px; }
  .caption-mark-number { font-size: 16px; }
  .minimal-footer-hud { order: 2; }
}

@media (min-width: 901px) and (min-height: 580px) {
  .voyage-stage { --caption-width: clamp(256px, 23vw, 316px); }
  .xfd-bar { width: min(760px, calc(100% - 440px)); }
  .chrono-fallback-stage { width: min(780px, calc(100% - 2 * (var(--caption-width) + 24px))); }

  .chapter-caption {
    --caption-event-size: clamp(18px, 1.55vw, 22px);
    --caption-mark-height: clamp(164px, 13.8vw, 194px);
    position: absolute;
    inset: 50% auto auto 32px;
    gap: clamp(11px, 1.25vw, 18px);
    width: var(--caption-width);
    padding: 0;
    transform: translateY(-50%);
  }

  .caption-mark-slot { padding-inline-end: clamp(9px, 1.05vw, 15px); }
  .caption-formal { font-size: clamp(12.5px, 1vw, 13.5px); }
  .caption-event-index { font-size: 11px; }
}

@media (901px <= width <= 1170px) and (min-height: 580px) {
  .xfd-bar { width: min(660px, 100%); }
}

.minimal-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.minimal-scroll-hint {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: rgba(245, 247, 251, 0.48);
  transition: opacity 0.5s ease;
}

.minimal-scroll-hint.is-used {
  opacity: 0.22;
}

.minimal-nav-group {
  display: inline-flex;
  border: 1px solid rgba(245, 247, 251, 0.18);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(6, 9, 18, 0.55);
  backdrop-filter: blur(8px);
}

.minimal-step-btn {
  min-width: 38px;
  height: 36px;
  display: grid;
  place-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.minimal-step-btn:first-child {
  border-right: 1px solid rgba(245, 247, 251, 0.14);
}

.minimal-step-btn:hover:not(:disabled) {
  background: rgba(245, 247, 251, 0.12);
}

.minimal-step-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.minimal-detail-btn {
  height: 36px;
  padding: 0 18px;
  border-radius: 999px;
  background: #f5f7fb;
  color: #050812;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.minimal-detail-btn:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}

/* =========================================================
   下層：ワコンピ三部作とお問い合わせ
========================================================= */
.below-fold {
  --contact-gold: #e2c99c;
  overflow-anchor: none;
  color: #f7f4ec;
  font-family: 'Outfit', 'Noto Sans JP', sans-serif;
}

.voyage-anchor {
  position: absolute;
  top: calc((100% - 100dvh) * var(--chapter-progress));
}

.lower-section {
  padding-inline: clamp(16px, 4.5vw, 76px);
  scroll-margin-top: max(64px, calc(env(safe-area-inset-top) + 52px));
}

.wrap {
  max-width: 1280px;
  margin-inline: auto;
}

#evolution {
  --work-color: #db505c;
  --work-secondary: #b18756;
  --work-edge: color-mix(in srgb, var(--work-color) 55%, #e8d5af);
  padding-block: clamp(20px, 5dvh, 52px) clamp(24px, 5dvh, 60px);
  overflow-anchor: none;
  text-shadow: 0 2px 18px #07090f, 0 1px 4px #07090f;
}

#evolution:focus { outline: none; }

.trilogy-layout {
  display: grid;
  grid-template-columns: clamp(168px, 13vw, 196px) minmax(0, 1fr);
  grid-template-areas:
    "heading art"
    "index art"
    "gate gate";
  column-gap: clamp(18px, 2.1vw, 34px);
  row-gap: 12px;
  align-items: start;
}

.trilogy-heading {
  grid-area: heading;
  align-self: end;
  margin-block: 0 12px;
}

.trilogy-heading .sec-title span { display: inline-block; }
.trilogy-heading .sec-title { font-size: clamp(24px, 3vw, 34px); }

.trilogy-layout:not(.is-interactive) {
  display: block;
  max-width: 950px;
}

.trilogy-layout:not(.is-interactive) .trilogy-heading { margin-bottom: 24px; }

.sec-kicker {
  display: block;
  margin-bottom: 10px;
  color: #decba7;
  font: 10px/1.5 'JetBrains Mono', monospace;
  letter-spacing: 0.23em;
}

.sec-title {
  margin: 0;
  color: #f7f4ec;
  font-family: 'Shippori Mincho', serif;
  font-size: clamp(26px, 3.3vw, 46px);
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.24;
}

.trilogy-index {
  grid-area: index;
  display: grid;
  border-bottom: 1px solid #f7f4ec22;
  pointer-events: auto;
}

.trilogy-index[hidden], .trilogy-work[hidden] { display: none; }

.trilogy-index button {
  position: relative;
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-block-size: 68px;
  padding: 10px 12px;
  border-top: 1px solid #f7f4ec22;
  border-inline-start: 1px solid transparent;
  text-align: start;
  text-shadow: inherit;
  color: #dedbd2;
  cursor: pointer;
}

.trilogy-index button:hover { background: #f7f4ec0d; }

.trilogy-index button[aria-pressed='true'] {
  border-inline-start-color: var(--work-edge);
  background: linear-gradient(90deg, color-mix(in srgb, var(--work-color) 18%, #07090fa8), #07090f05);
  color: #f7f4ec;
}

.trilogy-number {
  color: #d1cbc0;
  font: 400 27px/1 'Outfit', sans-serif;
  font-variant-numeric: tabular-nums;
}

[aria-pressed='true'] .trilogy-number { color: var(--work-edge); }

.trilogy-index-meta {
  display: block;
  color: #d0c8bb;
  font: 10px/1.4 'JetBrains Mono', monospace;
  letter-spacing: 0.045em;
  overflow-wrap: anywhere;
}

.trilogy-index-name {
  display: block;
  margin-top: 3px;
  font: 500 17px/1.3 'Shippori Mincho', serif;
}

.trilogy-prism { display: none; grid-area: art; }

.trilogy-works {
  grid-area: art;
  display: grid;
  gap: 36px;
  min-width: 0;
}

.trilogy-layout.is-interactive .trilogy-works,
.trilogy-layout.is-interactive .trilogy-work:not([hidden]) { display: contents; }

.trilogy-media {
  grid-area: art;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--work-edge) 60%, #07090f);
  background: #0d1018;
  box-shadow: 0 18px 58px #04060d50;
}

.trilogy-media :is(img, video) {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.trilogy-media video {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.trilogy-media.is-playing video { opacity: 1; }

.trilogy-media.has-audio-scope { margin-bottom: 28px; overflow: visible; }
.trilogy-media .chrono-audio-scope { top: 100%; }

@media (prefers-reduced-motion: no-preference) {
  .trilogy-layout.is-interactive .trilogy-art { animation: trilogy-art-arrival 0.36s ease-out both; }
  .trilogy-media video { transition: opacity 0.34s ease; }
}

@keyframes trilogy-art-arrival {
  from { opacity: 0.45; clip-path: inset(2% 1%); }
  to { opacity: 1; clip-path: inset(0); }
}

/* ブラウザーが描画可能なときだけ、画像と同じグリッド領域を3D投影に割り当てる。 */
@media (width > 900px) and (height > 579px) and (aspect-ratio > 1/1) and (pointer: fine) {
  #evolution.is-prism-ready { padding-block-start: clamp(12px, 2.3dvh, 24px); }

  .is-prism-ready .trilogy-layout {
    max-width: 1440px;
    grid-template-rows: repeat(2, calc((clamp(360px, 100dvh - 178px, 840px) - 12px) / 2)) auto;
  }

  .is-prism-ready .trilogy-prism {
    display: block;
    align-self: stretch;
  }

  /* 動画要素をページ内に置いたまま映像を3D面へ渡す。 */
  .is-prism-ready .trilogy-media {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0.001;
    pointer-events: none;
  }
  .is-prism-ready .trilogy-media .chrono-audio-scope { display: none; }
}

.trilogy-gate {
  --control-accent: var(--work-edge);
  position: relative;
  grid-area: gate;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 18px;
  padding: 5px 12px;
  pointer-events: auto;
}

.trilogy-seek-row {
  flex: 1 0 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 6px;
  border-top: 1px solid rgba(245, 247, 251, 0.09);
}

.trilogy-seek-row[hidden] {
  display: none;
}

.trilogy-seek-row .xfd-seek {
  flex: 1;
  min-width: 0;
}

.trilogy-gate.is-playing::before,
.trilogy-gate.has-seek::before {
  content: '';
  position: absolute;
  inset: -1px 5px auto;
  height: 1px;
  background: linear-gradient(90deg, var(--work-edge), #fff8e7);
  box-shadow: 0 0 6px var(--work-edge);
  transform: scaleX(var(--trilogy-progress, 0));
  transform-origin: left;
  pointer-events: none;
}

.trilogy-gate h3 {
  margin: 0;
  color: #f7f4ec;
  font: 500 clamp(17px, 1.9vw, 23px)/1.4 'Shippori Mincho', serif;
}

.trilogy-gate-copy { min-width: 0; }

.trilogy-gate h3 span {
  display: inline-block;
  margin-inline-start: 0.45em;
  color: var(--work-edge);
  font: 10px/1.5 'JetBrains Mono', monospace;
  letter-spacing: 0.07em;
}

.trilogy-gate p {
  margin: 0;
  color: #d5d0c6;
  font-size: 13px;
  line-height: 1.65;
}

.trilogy-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 14px;
}

@media (min-width: 1250px) {
  .trilogy-gate-copy {
    display: flex;
    align-items: baseline;
    gap: 12px;
  }
  .trilogy-gate h3 { flex: none; }
}

@media (width > 900px) {
  .trilogy-actions { flex-wrap: nowrap; }
  .trilogy-actions :is(button, a) { white-space: nowrap; }
}

.trilogy-volume { gap: 5px; }
.trilogy-volume .xfd-mute-btn { width: 32px; height: 36px; }
.trilogy-volume .xfd-vol-slider { width: clamp(70px, 9vw, 92px); }

.trilogy-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  white-space: nowrap;
  font-size: 12px;
}

.trilogy-jump, .footer-links a { color: #d0c8bb; }
.trilogy-jump:hover, .footer-links a:hover { color: #fff; text-decoration: underline; }

.trilogy-special { text-shadow: none; }

body.is-portal-active #chrono-bg {
  --era-color: var(--portal-color);
  --era-secondary: var(--portal-secondary);
}

body.is-portal-active.is-contact-visible #chrono-bg {
  --era-color: var(--contact-scene-primary);
  --era-secondary: var(--contact-scene-secondary);
}

body.is-portal-active:not(.is-fallback) #chrono-bg {
  background:
    radial-gradient(ellipse at 72% 49%, color-mix(in srgb, var(--era-secondary) 24%, transparent), transparent 68%),
    #04060d;
}

body.is-portal-active .cockpit-vignette {
  background: linear-gradient(180deg, #04060d70, transparent 20%, transparent 85%, #04060d55);
}

@property --contact-accent {
  syntax: '<color>';
  inherits: true;
  initial-value: #d8be8a;
}

#contact {
  --contact-gold: var(--contact-accent);
  padding-bottom: clamp(36px, 8dvh, 84px);
}

@media (prefers-reduced-motion: no-preference) {
  #contact { transition: --contact-accent 0.42s ease; }
}

.contact-heading {
  margin: 0 auto clamp(23px, 4dvh, 38px);
  text-align: center;
  text-shadow: 0 2px 18px #07090f, 0 1px 4px #07090f;
}

.contact-heading .sec-title { font-size: clamp(26px, 3.1vw, 39px); }

.contact-signal {
  display: grid;
  justify-items: center;
  gap: 9px;
  margin-bottom: 10px;
  color: color-mix(in srgb, var(--contact-accent) 62%, #f7f4ec);
  font: 10px/1.5 'JetBrains Mono', monospace;
  letter-spacing: 0.2em;
}

.contact-signal-line {
  position: relative;
  width: 1px;
  height: clamp(44px, 12dvh, 110px);
  background: linear-gradient(transparent, color-mix(in srgb, var(--contact-accent) 54%, transparent) 58%, var(--contact-accent));
  box-shadow: 0 12px 15px color-mix(in srgb, var(--contact-accent) 37%, transparent);
}

.contact-signal-pulse {
  position: absolute;
  inset: 0 -2px auto;
  height: 22%;
  opacity: 0;
  background: radial-gradient(ellipse, color-mix(in srgb, var(--contact-accent) 73%, #fff), transparent 72%);
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .contact-signal-line {
      transform-origin: top;
      animation: signal-arrival linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 38%;
    }
  }
}

@keyframes signal-arrival {
  from { transform: scaleY(0); opacity: 0; }
  to { transform: scaleY(1); opacity: 1; }
}

.contact-grid {
  display: grid;
  max-width: 1040px;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.4fr);
  align-items: start;
  gap: clamp(20px, 4.2vw, 60px);
}

.contact-info {
  display: grid;
  gap: 19px;
  padding-block: 16px;
  text-shadow: 0 1px 4px #04060d, 0 2px 14px #04060de6;
  pointer-events: auto;
}

.contact-lead {
  margin: 0;
  color: #f1ede2;
  font-size: 14px;
  line-height: 1.9;
}

.contact-topics {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact-topics li {
  padding-inline-start: 10px;
  border-inline-start: 1px solid #e2c99c75;
  color: #dad4c9;
  font-size: 12px;
  line-height: 1.6;
}

.contact-org {
  margin: 1px 0 0;
  color: #cbc3b6;
  font: 11px 'JetBrains Mono', 'Noto Sans JP', monospace;
  letter-spacing: 0.08em;
}

.contact-form {
  position: relative;
  min-width: 0;
  display: grid;
  gap: 13px;
  padding: clamp(14px, 2.6vw, 27px);
  border: 1px solid #f5f7fb26;
  border-top-color: color-mix(in srgb, var(--contact-accent) 76%, transparent);
  border-radius: var(--glass-radius);
  background: #070a12a6;
  backdrop-filter: var(--glass-blur);
  pointer-events: auto;
}

@media (max-width: 900px) {
  .trilogy-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "heading" "art" "index" "gate";
    row-gap: 12px;
  }
  .trilogy-heading { margin-block: 0 4px; }
  .trilogy-index { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .trilogy-index button {
    display: flex;
    flex-direction: column;
    align-items: start;
    gap: 3px;
    min-block-size: 74px;
    padding: 7px 5px 8px 7px;
    border-inline-start: 0;
  }
  .trilogy-index button + button { border-inline-start: 1px solid #f7f4ec22; }
  .trilogy-index button[aria-pressed='true'] { border-top-color: var(--work-edge); }
  .trilogy-number { font-size: 19px; }
  .trilogy-index-meta { font-size: 9px; }
  .trilogy-index-name { font-size: 13px; }
  .trilogy-gate { flex-wrap: wrap; padding: 8px 10px; }
}

@media (max-width: 640px) {
  #evolution { padding-block-start: 12px; }
  .trilogy-layout { row-gap: 8px; }
  .trilogy-heading .sec-kicker { margin-bottom: 6px; }
  .trilogy-index button { min-block-size: 64px; padding-block: 5px; }
  .trilogy-index-meta { letter-spacing: 0; }
  .trilogy-media.has-audio-scope { margin-bottom: 22px; }
  .trilogy-media .chrono-audio-scope { height: 22px; }
  .trilogy-gate { gap: 6px; }
  .trilogy-actions { gap: 3px 7px; }
  .trilogy-actions :is(a, button) { min-height: 36px; }
  .trilogy-special { padding-inline: 8px; }
  .contact-grid { grid-template-columns: minmax(0, 1fr); }
}

.contact-topic-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.contact-topic-group legend { margin-bottom: 5px; padding: 0; }
.pill-group { display: flex; flex-wrap: wrap; gap: 6px; }
.topic-option { position: relative; }

.topic-pill {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding-inline: 10px;
  border: 1px solid #f5f7fb29;
  border-radius: 999px;
  background: #050810a6;
  color: #ddd7ce;
  font-size: 11px;
  cursor: pointer;
}

.topic-option input:checked + .topic-pill {
  border-color: color-mix(in srgb, var(--contact-accent) 73%, transparent);
  background: color-mix(in srgb, var(--contact-accent) 15%, #050810);
  color: color-mix(in srgb, var(--contact-accent) 31%, #f7f4ec);
}

.contact-field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.contact-field { display: flex; flex-direction: column; gap: 5px; }
.contact-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 10px;
}
.contact-label { color: #e0dbcf; font-size: 12px; }
.contact-char-count { color: #b9b2a4; font-size: 10.5px; letter-spacing: 0.04em; }
.contact-char-count.is-over { color: #ffb8ba; font-weight: 600; }
.contact-required, .contact-optional { margin-inline-start: 4px; font-size: 10px; }
.contact-required { color: var(--contact-gold); }
.contact-optional { color: #bcb7ac; }

.contact-field :is(input, textarea) {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #f5f7fb24;
  border-radius: var(--control-radius);
  background: #07090f9e;
  color: #f4f7fb;
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
  scroll-margin-block: 60px 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-field :is(input, textarea)::placeholder { color: #a9a497; }
.contact-field textarea { min-height: 86px; resize: vertical; }

#contact .contact-field :is(input, textarea):focus {
  outline: 1px solid color-mix(in srgb, var(--contact-accent) 72%, #fff);
  outline-offset: -1px;
  box-shadow: 0 0 12px color-mix(in srgb, var(--contact-accent) 25%, transparent);
}

.topic-option input:focus-visible + .topic-pill,
.below-fold :is(a, button):focus-visible {
  outline: 1px solid var(--contact-gold);
  outline-offset: 2px;
  box-shadow: 0 0 12px #e2c99c29;
}

.contact-field [aria-invalid='true'] { border-color: #ed9c9e; }
.contact-field-error { color: #ffb8ba; font-size: 12px; }

.contact-form-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding-top: 2px;
}

.contact-form-note { margin: 0; color: #c4bdb1; font-size: 11px; }

.contact-submit {
  min-height: 42px;
  padding: 8px 18px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--contact-accent) 74%, #f7f4ec);
  color: #050812;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  white-space: nowrap;
  cursor: pointer;
}

.contact-submit:hover { background: color-mix(in srgb, var(--contact-accent) 48%, #f7f4ec); }
.contact-submit:disabled { opacity: 0.66; cursor: wait; }

.contact-status {
  margin: 0;
  padding: 9px 11px;
  border: 1px solid #e2c99c73;
  border-radius: 5px;
  background: #e2c99c16;
  color: #f8ecd4;
  font-size: 13px;
}

.contact-status:empty { position: absolute; padding: 0; border: 0; }

.contact-status:is([data-kind='validation'], [data-kind='error']) {
  border-color: #ed9c9e91;
  background: #ed9c9e18;
  color: #ffb8ba;
}

.footer {
  position: relative;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 14px;
  padding: 12px max(clamp(16px, 4.5vw, 76px), calc((100% - 1280px) / 2));
  border-top: 1px solid rgba(245, 247, 251, 0.09);
  background: #07090fcf;
  color: #b6b3aa;
  font: 11px/1.5 'JetBrains Mono', 'Noto Sans JP', monospace;
}

.footer-links { display: flex; flex-wrap: wrap; gap: 4px 14px; }

/* モーダル */
dialog#capsule-dialog {
  --panel-accent: var(--era-color);
  --control-accent: var(--panel-accent);
  --panel-border: color-mix(in srgb, var(--panel-accent) 25%, var(--hairline));
  --panel-divider: linear-gradient(90deg, transparent 3%, color-mix(in srgb, var(--panel-accent) 58%, transparent), transparent 97%);
  background: linear-gradient(155deg, #172033b8, #080d1acf 65%);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 28px #02040b55;
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

dialog#capsule-dialog::before,
.chrono-fallback-category-label::before {
  --corner-ink: color-mix(in srgb, var(--panel-accent) 74%, transparent);
  --corner-line: linear-gradient(var(--corner-ink), var(--corner-ink));
  content: '';
  position: absolute;
  inset: 5px;
  z-index: 1;
  pointer-events: none;
  background:
    var(--corner-line) top left / 9px 1px, var(--corner-line) top left / 1px 9px,
    var(--corner-line) top right / 9px 1px, var(--corner-line) top right / 1px 9px,
    var(--corner-line) bottom left / 9px 1px, var(--corner-line) bottom left / 1px 9px,
    var(--corner-line) bottom right / 9px 1px, var(--corner-line) bottom right / 1px 9px;
  background-repeat: no-repeat;
}

@media (hover: hover) {
  dialog#capsule-dialog:hover {
    transform: translateY(-2px);
  }
}

dialog#capsule-dialog:is(:hover, :focus-within) {
  border-color: color-mix(in srgb, var(--panel-accent) 64%, var(--hairline));
  box-shadow: 0 16px 36px #02040b80, 0 0 20px color-mix(in srgb, var(--panel-accent) 16%, transparent);
}

dialog#capsule-dialog {
  width: min(880px, calc(100vw - 24px));
  max-height: 90dvh;
  overscroll-behavior: contain;
  padding: 0;
  border-radius: 8px;
  color: var(--ink);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.85);
}

dialog#capsule-dialog::backdrop {
  background: rgba(2, 4, 10, 0.84);
  backdrop-filter: blur(10px);
}

.cap-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px;
  background: var(--panel-divider) bottom center / 100% 1px no-repeat;
}

#cap-title {
  margin: 3px 0 0;
  font: 500 20px/1.4 'Shippori Mincho', serif;
  letter-spacing: 0.08em;
}

dialog#capsule-dialog[open] {
  display: flex;
  flex-direction: column;
}

.cap-body {
  padding: 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.concept-callout {
  padding: 12px 16px;
  border-left: 1px solid var(--panel-accent);
  border-radius: 0 4px 4px 0;
  background: linear-gradient(105deg, color-mix(in srgb, var(--panel-accent) 13%, transparent), #ffffff05);
}

.concept-callout-tag {
  color: color-mix(in srgb, var(--panel-accent) 56%, #ffffff);
  font: 500 11px/1.45 'JetBrains Mono', 'Noto Sans JP', monospace;
  letter-spacing: 0.10em;
}

.concept-callout-text {
  margin: 4px 0 0;
  color: #f4f7ff;
  font: 600 15px/1.7 'Noto Serif JP', serif;
}

.cap-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 20px;
}

.cap-media {
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  background: #04060d;
}

.cap-media img,
.cap-media video {
  width: 100%;
  display: block;
  max-height: 340px;
  object-fit: cover;
}

.capsule-volume {
  display: flex;
  justify-content: flex-end;
  padding: 4px 10px;
  border: 0;
}

.capsule-volume .xfd-vol-slider { width: 92px; }

.cap-media.is-logo-media {
  background: radial-gradient(circle at 50% 48%, rgba(30, 44, 76, 0.34) 0%, #050812 76%);
  display: grid;
  place-items: center;
  padding: 26px;
}

.cap-media.is-logo-media img {
  width: auto;
  max-width: 100%;
  max-height: 290px;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(138, 176, 212, 0.28));
}

.cap-embed iframe {
  width: 100%;
  height: 152px;
  border: 0;
  border-radius: 6px;
}

@media (max-width: 900px) {
  .hud-top { left: 16px; right: 16px; top: 16px; }
  body.is-below-voyage .hud-top::before { inset: -16px -16px -10px; }
  .warp-dots { display: none; }
  .voyage-stage { min-height: 0; padding: 18px 16px; }
  .xfd-bar { flex-wrap: wrap; gap: 10px; }
  .minimal-controls { justify-content: space-between; }
  .cap-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .hud-top { inset: max(8px, env(safe-area-inset-top)) 12px auto; gap: 6px; }
  .hud-brand { min-height: 36px; gap: 8px; }
  .hud-brand-mark { width: 21px; height: 21px; }
  .hud-brand-stack { gap: 2.5px; }
  .hud-brand-primary { font-size: 11px; letter-spacing: 0.26em; }
  .hud-brand-secondary { font-size: 7.5px; letter-spacing: 0.35em; }
  .hud-control { padding-inline: 7px; font-size: 10px; }

  .voyage-stage { min-height: 0; padding: 12px 12px max(12px, env(safe-area-inset-bottom)); gap: 8px; }
  .prologue-overlay { padding-inline: 16px; }
  .prologue-crest-row { --crest-size: clamp(58px, 16vw, 72px); width: min(100%, 230px); margin-bottom: 10px; }
  .prologue-brand { font-size: clamp(28px, 7.6vw, 40px); letter-spacing: 0.08em; overflow-wrap: anywhere; }
  .prologue-manifesto { font-size: 16.5px; letter-spacing: 0.12em; margin-top: 18px; padding-top: 14px; }
  .prologue-actions { gap: 8px; margin-top: 20px; }
  .prologue-actions button { min-height: 36px; padding-inline: 12px; }
  .prologue-scroll-line { height: 16px; }
  .chrono-fallback-stage { margin-top: max(66px, calc(env(safe-area-inset-top) + 60px)); }

  .xfd-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 8px;
    padding: 4px 8px;
  }
  .xfd-play-btn { grid-column: 1 / -1; justify-self: start; min-height: 36px; padding-inline: 9px; }
  .xfd-progress-wrap, .xfd-vol-wrap { gap: 5px; }
  .xfd-seek, .xfd-vol-slider {
    min-width: 0;
    height: 36px;
    margin: 0;
    background: linear-gradient(#f5f7fb38, #f5f7fb38) center / 100% 3px no-repeat;
  }
  .xfd-time, .xfd-vol-pct { font-size: 9px; }
  .xfd-right { min-width: 0; }
  .xfd-eq { display: none; }
  .xfd-mute-btn { min-height: 36px; min-width: 36px; }
  .xfd-vol-slider { width: clamp(30px, 9vw, 54px); }

  .minimal-controls { justify-content: flex-end; flex-wrap: wrap; gap: 6px 8px; }
  .minimal-step-btn, .minimal-detail-btn { min-height: 36px; }

  .lower-section { scroll-margin-top: max(52px, calc(env(safe-area-inset-top) + 46px)); }
  .contact-field-row { grid-template-columns: minmax(0, 1fr); }
  .topic-pill { min-height: 36px; }
  .contact-field :is(input, textarea) { font-size: 16px; }
  .cap-head, .cap-body { padding: 12px; }
  .cap-head > div { min-width: 0; overflow-wrap: anywhere; }
  .footer { padding-inline: 16px; }
  .footer-links a { display: inline-flex; align-items: center; min-height: 36px; }
}

@media (max-width: 420px) {
  .hud-brand { gap: 7px; }
  .hud-brand-mark { width: 19px; height: 19px; }
  .hud-brand-primary { font-size: 10px; letter-spacing: 0.22em; }
  .hud-brand-secondary { font-size: 7px; letter-spacing: 0.3em; }
  .hud-control { padding-inline: 6px; }
}

@media (max-width: 360px) {
  .hud-top { inset-inline: 10px; gap: 4px; }
  .hud-control { padding-inline: 4px; }
  .hud-control-icon { display: none; }
}

@media (max-height: 579px) {
  .voyage-stage { min-height: 0; }
}

@media (max-height: 700px) {
  .prologue-overlay { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .prologue-kicker { margin-bottom: 8px; }
  .prologue-crest-row { --crest-size: clamp(48px, 9dvh, 62px); margin-bottom: 8px; }
  .prologue-brand { font-size: clamp(30px, 6.2dvh, 46px); }
  .prologue-manifesto { margin-top: 14px; padding-top: 12px; }
  .prologue-actions { margin-top: 16px; }
  .prologue-scroll-cue { gap: 5px; }
  .prologue-scroll-line { height: 14px; }
}

@media (max-height: 460px) {
  .prologue-scroll-cue { display: none; }
  .prologue-overlay { grid-template-rows: minmax(min-content, 1fr); padding-block: 62px 12px; }
  .prologue-crest-row { --crest-size: 52px; }
  .chrono-fallback-stage { gap: 4px; }
}

@media (min-width: 641px) and (max-height: 460px) {
  .chrono-fallback-stage {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2.6fr) minmax(0, 1.15fr);
    grid-template-rows: minmax(0, 1fr);
    align-items: center;
    gap: clamp(8px, 2vw, 18px);
    margin-block-start: 36px;
  }

  .chrono-fallback-year { font-size: clamp(26px, 5vw, 44px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .prologue-crest::before, .prologue-scroll-line, .xfd-bar.is-playing .xfd-eq i { animation: none; }
  .chapter-caption, .caption-steps > span, .minimal-footer-hud { transition: none; }
  dialog#capsule-dialog, body.is-fallback .prologue-overlay { transition: none; }
  dialog#capsule-dialog:hover { transform: none; }
}
