:root {
  --navy: #002f54;
  --navy-deep: #001d35;
  --ecru: #f9f7ee;
  --sand: #e8d1ab;
  --sand-light: #f1e6d1;
  --ink: #0e2638;
  --muted: #596a76;
  --line: rgba(0, 47, 84, 0.18);
  --white: #ffffff;
  --focus: #9a5d00;
  --shadow: 0 22px 70px rgba(0, 29, 53, 0.14);
  --radius: 1.25rem;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "YuGothic", "Noto Sans JP", sans-serif;
  color: var(--ink);
  background: var(--ecru);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--ecru);
  scroll-behavior: smooth;
}

body {
  min-width: 20rem;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 82% 8%, rgba(232, 209, 171, 0.45), transparent 30rem),
    var(--ecru);
}

button,
a {
  font: inherit;
}

button {
  min-height: 2.75rem;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.75rem 1rem;
  color: var(--white);
  background: var(--navy);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: none;
}

.app-shell {
  min-height: 100svh;
  padding-bottom: 5.25rem;
}

.brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3.5rem;
  padding: 0.75rem 1rem;
  color: var(--white);
  background: var(--navy);
}

.brand-bar > div {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.brand-name {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.pilot-badge {
  padding: 0.22rem 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.09em;
}

.brand-bar p {
  margin: 0;
  font-size: 0.88rem;
  letter-spacing: 0.05em;
}

.experience {
  display: grid;
  min-width: 0;
}

.viewer-column,
.detail-column {
  min-width: 0;
}

.viewer-column {
  padding: 1.25rem 1rem 1.5rem;
}

.intro-line {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

.eyebrow {
  margin: 0 0 0.3rem;
  color: var(--navy);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.15em;
}

h1,
h2,
h3 {
  font-family: "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", serif;
  font-weight: 500;
}

h1 {
  margin: 0;
  color: var(--navy-deep);
  font-size: clamp(1.65rem, 7vw, 2.7rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.pilot-notice {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.viewer-stage {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 22rem;
  height: clamp(22rem, 48svh, 26rem);
  overflow: hidden;
  border: 1px solid rgba(0, 47, 84, 0.12);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(232, 209, 171, 0.26)),
    var(--sand-light);
  box-shadow: var(--shadow);
}

.viewer-stage::after {
  position: absolute;
  z-index: -1;
  right: -4rem;
  bottom: -5rem;
  width: 14rem;
  height: 14rem;
  border: 1px solid rgba(0, 47, 84, 0.13);
  border-radius: 50%;
  box-shadow: 0 0 0 2.4rem rgba(0, 47, 84, 0.035), 0 0 0 4.8rem rgba(0, 47, 84, 0.025);
  content: "";
}

model-viewer {
  display: block;
  width: 100%;
  height: 100%;
  background: transparent;
  --poster-color: transparent;
  --progress-bar-color: var(--navy);
}

.stage-status {
  position: absolute;
  z-index: 5;
  top: 0.75rem;
  left: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid rgba(0, 47, 84, 0.12);
  border-radius: 999px;
  color: var(--navy);
  background: rgba(249, 247, 238, 0.88);
  backdrop-filter: blur(10px);
  font-size: 0.76rem;
}

.status-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--sand);
  box-shadow: 0 0 0 0.2rem rgba(232, 209, 171, 0.35);
}

.stage-status.is-ready .status-dot {
  background: var(--navy);
  box-shadow: 0 0 0 0.2rem rgba(0, 47, 84, 0.12);
}

.stage-status.is-error .status-dot {
  background: #99431f;
  box-shadow: none;
}

.loading-panel,
.static-fallback {
  position: absolute;
  z-index: 4;
  inset: 0;
}

.loading-panel {
  display: grid;
  place-content: end stretch;
  gap: 0.6rem;
  padding: 1.2rem;
  pointer-events: none;
  background: linear-gradient(to top, rgba(249, 247, 238, 0.72), transparent 48%);
  transition: opacity 240ms ease, visibility 240ms ease;
}

.loading-panel[hidden] {
  display: none;
}

.loading-panel p {
  margin: 0;
  color: var(--navy);
  font-size: 0.85rem;
}

.progress-track {
  width: 100%;
  height: 0.22rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 47, 84, 0.12);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--navy);
  transition: width 140ms linear;
}

.static-fallback {
  display: grid;
  align-content: end;
  overflow: hidden;
  background: var(--sand-light);
}

.static-fallback[hidden] {
  display: none;
}

.static-fallback img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.static-fallback > div {
  position: relative;
  z-index: 1;
  padding: 1rem;
  color: var(--white);
  background: linear-gradient(transparent, rgba(0, 29, 53, 0.92) 35%);
}

.static-fallback p {
  margin: 0.3rem 0 0.75rem;
  font-size: 0.9rem;
}

.static-fallback button {
  padding: 0.55rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  color: var(--white);
  background: transparent;
  cursor: pointer;
}

.hotspot {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: var(--white);
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}

.hotspot[hidden] {
  display: none !important;
}

.hotspot::before {
  flex: 0 0 auto;
  width: 0.72rem;
  height: 0.72rem;
  border: 2px solid var(--sand);
  border-radius: 50%;
  background: var(--navy);
  box-shadow: 0 3px 12px rgba(0, 29, 53, 0.38);
  content: "";
}

.hotspot-label {
  position: absolute;
  left: 2.1rem;
  top: 50%;
  width: max-content;
  max-width: var(--label-max-width, min(15rem, calc(100vw - 2rem)));
  padding: 0.42rem 0.58rem;
  border-radius: 0.45rem;
  overflow-wrap: anywhere;
  color: var(--white);
  text-align: left;
  white-space: normal;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  background: var(--navy);
  box-shadow: 0 4px 14px rgba(0, 29, 53, 0.24);
  line-height: 1.4;
  transform: translateY(calc(-50% + var(--label-nudge-y, 0px)));
  transition: opacity 160ms ease;
}

.hotspot:hover .hotspot-label,
.hotspot:focus-visible .hotspot-label {
  visibility: visible;
  opacity: 1;
}

.hotspot-label.label-left {
  right: 2.1rem;
  left: auto;
}

.hotspot-label.label-below,
.hotspot-label.label-above {
  left: 50%;
  top: 2.1rem;
  transform: translateX(calc(-50% + var(--label-nudge-x, 0px)));
}

.hotspot-label.label-above {
  top: auto;
  bottom: 2.1rem;
}

.control-deck {
  display: grid;
  gap: 0.8rem;
  margin-top: 0.85rem;
}

.primary-guides {
  position: fixed;
  z-index: 12;
  right: 1rem;
  bottom: calc(0.6rem + env(safe-area-inset-bottom));
  left: 1rem;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 0.4rem;
  padding: 0.38rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: rgba(249, 247, 238, 0.94);
  box-shadow: 0 12px 35px rgba(0, 29, 53, 0.18);
  backdrop-filter: blur(12px);
}

.primary-guides button,
.primary-guides a {
  min-width: 0;
  min-height: 2.75rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--navy);
  border-radius: 0.65rem;
  color: var(--navy);
  background: transparent;
  cursor: pointer;
}

.primary-guides a { display: flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; }

.primary-guides .guide-size {
  color: var(--white);
  background: var(--navy);
}

.primary-guides button.is-active {
  outline: 2px solid var(--sand);
  outline-offset: -4px;
}

.control-deck fieldset {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.control-deck fieldset.camera-switcher {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.control-deck legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.control-deck button {
  min-width: 0;
  padding: 0.55rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
}

.control-deck button span {
  display: block;
  font-size: 0.68rem;
}

.control-deck button.is-active,
.control-deck button[aria-pressed="true"] {
  color: var(--white);
  border-color: var(--navy);
  background: var(--navy);
}

.control-deck button:disabled {
  color: #6d7478;
  border-style: dashed;
  background: rgba(255, 255, 255, 0.25);
  cursor: not-allowed;
}

.gesture-hint {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.diagnostics {
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.diagnostics summary {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  cursor: pointer;
}

.diagnostics dl {
  display: grid;
  gap: 0.25rem;
  max-width: 35rem;
  margin: 0;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.45);
}

.diagnostics dl div {
  display: grid;
  grid-template-columns: minmax(7.5rem, 0.8fr) 1.5fr;
  gap: 0.5rem;
}

.diagnostics dt {
  font-weight: 600;
}

.diagnostics dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.detail-column {
  padding: 1.5rem 1rem 2.5rem;
  color: var(--white);
  background: var(--navy);
}

.detail-column .eyebrow {
  color: var(--sand);
}

.detail-heading h2 {
  max-width: 14em;
  margin: 0;
  font-size: clamp(1.45rem, 6vw, 2.15rem);
  line-height: 1.32;
}

.part-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  margin-top: 1.2rem;
}

.part-button {
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  align-items: center;
  min-width: 0;
  padding: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.7rem;
  color: var(--white);
  text-align: left;
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
}

.part-button .part-number {
  color: var(--sand);
  font-family: Georgia, serif;
  font-size: 0.82rem;
}

.part-button .part-name {
  min-width: 0;
  font-size: 0.78rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: normal;
}

.part-button[aria-pressed="true"] {
  color: var(--navy-deep);
  border-color: var(--sand);
  background: var(--sand);
}

.part-button[aria-pressed="true"] .part-number {
  color: var(--navy);
}

.part-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.part-detail {
  min-height: 12rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.detail-empty {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  color: rgba(255, 255, 255, 0.72);
}

.detail-empty span {
  color: var(--sand);
  font-size: 1.5rem;
  line-height: 1;
}

.detail-empty p {
  max-width: 24rem;
  margin: 0;
  line-height: 1.7;
}

.detail-index {
  margin: 0;
  color: var(--sand);
  font-family: Georgia, serif;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

.part-detail h3 {
  margin: 0.35rem 0 0.55rem;
  font-size: 1.28rem;
  line-height: 1.35;
}

.part-detail h3 + p {
  margin: 0;
  color: rgba(255, 255, 255, 0.83);
  line-height: 1.75;
}

.part-detail figure {
  margin: 1rem 0 0;
}

.part-detail img {
  display: block;
  width: 100%;
  max-height: 16rem;
  object-fit: cover;
  border-radius: 0.75rem;
  background: var(--navy-deep);
}

.part-detail figcaption {
  margin-top: 0.45rem;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.76rem;
  line-height: 1.55;
}

.photo-viewport { position: relative; }
.photo-viewport.is-framed {
  overflow: hidden;
  border-radius: 0.75rem;
  background: var(--navy-deep);
}
.part-detail .photo-viewport.is-framed img {
  position: absolute;
  height: auto;
  max-width: none;
  max-height: none;
  border-radius: 0;
}
.photo-highlight {
  position: absolute;
  pointer-events: none;
  border: 3px solid #b17a23;
  border-radius: 0.6rem;
  box-shadow: 0 0 0 2px #002f54, 0 0 0 4px rgba(249,247,238,.8);
  background: rgba(232,209,171,.14);
}
.photo-selection {
  margin: 0 0 0.65rem;
  color: var(--sand);
  font-weight: 700;
  line-height: 1.5;
}

.photo-close {
  min-height: 2.75rem;
  margin-top: 0.35rem;
  padding: 0.35rem 0;
  border: 0;
  color: var(--sand);
  text-decoration: underline;
  text-underline-offset: 0.25em;
  background: transparent;
  cursor: pointer;
}

.detail-link,
.journey-links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--white);
  text-underline-offset: 0.28em;
}

.detail-link {
  margin-top: 0.7rem;
}

.journey-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.journey-links:empty {
  display: none;
}

.journey-links a {
  color: var(--sand);
  font-size: 0.82rem;
}

.cover-guide {
  margin-top: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.045);
}

.cover-guide summary {
  min-height: 2.75rem;
  padding: 0.8rem 1rem;
  color: var(--sand);
  cursor: pointer;
}

.cover-guide summary:focus-visible {
  outline: 3px solid var(--sand);
  outline-offset: 3px;
}

#cover-guide-content {
  padding: 0 1rem 1rem;
}

.cover-path {
  padding: 0.75rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.cover-path h3,
.cover-path p {
  margin: 0;
}

.cover-path h3 {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
}

.cover-path p {
  margin-top: 0.35rem;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.8rem;
  line-height: 1.6;
}

.cover-path-links,
.cover-need-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.9rem;
  margin-top: 0.35rem;
}

.cover-path a,
.cover-need-links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--sand);
  font-size: 0.8rem;
  text-underline-offset: 0.25em;
}

.cover-path-status {
  display: inline-block;
  margin-top: 0.45rem;
  padding: 0.3rem 0.55rem;
  border: 1px dashed rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.72rem;
}

.part-facts {
  margin: 1rem 0;
  font-size: 0.82rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.part-facts > div {
  padding: 0.65rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}
.part-facts dt { color: var(--sand); font-weight: 600; }
.part-facts dd { margin: 0.3rem 0 0; color: rgba(255, 255, 255, 0.8); }
.cover-guide-entry {
  min-height: 2.75rem;
  max-width: 100%;
  padding: 0.65rem 0.9rem;
  margin-top: 0.5rem;
  border: 1px solid var(--sand);
  border-radius: 0.5rem;
  color: var(--sand);
  background: transparent;
  font: inherit;
  font-size: 0.85rem;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.cover-guide-entry:focus-visible { outline: 3px solid var(--sand); outline-offset: 3px; }

.noscript-message {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  align-content: center;
  padding: 1rem;
  color: var(--white);
  text-align: center;
  background: var(--navy);
}

.noscript-message img {
  width: min(100%, 42rem);
  margin: 0 auto;
}

@media (min-width: 48rem) {
  .app-shell {
    padding-bottom: 0;
  }

  .brand-bar {
    padding-inline: 2rem;
  }

  .viewer-column,
  .detail-column {
    padding-inline: 2rem;
  }

  .intro-line {
    grid-template-columns: 1fr minmax(15rem, 23rem);
    align-items: end;
  }

  .viewer-stage {
    height: min(58svh, 35rem);
  }

  .primary-guides {
    position: static;
    margin-top: 0.8rem;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .control-deck {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.18fr);
  }
}

@media (min-width: 68rem) {
  .experience {
    grid-template-columns: minmax(0, 1.75fr) minmax(22rem, 0.75fr);
    min-height: calc(100svh - 3.5rem);
  }

  .viewer-column {
    display: grid;
    grid-template-rows: auto minmax(28rem, 1fr) auto auto;
    padding: 1.5rem clamp(2rem, 4vw, 4.5rem) 1.25rem;
  }

  .viewer-stage {
    height: auto;
    min-height: 28rem;
    max-height: calc(100svh - 15.5rem);
  }

  .detail-column {
    height: calc(100svh - 3.5rem);
    max-height: calc(100svh - 3.5rem);
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
    padding: 2.25rem 2rem;
  }

  .part-list {
    grid-template-columns: 1fr;
  }

  .part-button {
    grid-template-columns: 2rem 1fr;
  }

  .part-button .part-name {
    font-size: 0.84rem;
  }
}

@media (forced-colors: active) {
  .viewer-stage,
  .control-deck button,
  .part-button,
  .stage-status {
    border: 1px solid CanvasText;
  }

  .status-dot,
  .hotspot::before {
    forced-color-adjust: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

