:root {
  --bg-top: #f4efe4;
  --bg-bottom: #d8e4ea;
  --ink: #11212d;
  --muted: #4d5b63;
  --panel: rgba(255, 252, 247, 0.76);
  --panel-border: rgba(17, 33, 45, 0.14);
  --accent: #d95d39;
  --accent-dark: #7f2f1d;
  --accent-soft: rgba(217, 93, 57, 0.14);
  --shadow: 0 24px 80px rgba(17, 33, 45, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 30%),
    linear-gradient(145deg, var(--bg-top), var(--bg-bottom));
}

button,
input,
textarea {
  font: inherit;
}

.page-shell {
  width: min(1320px, calc(100vw - 32px));
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100svh;
  padding: 12px 0;
  display: flex;
  align-items: stretch;
}

.panel-label {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

h2 {
  font-family: "Space Grotesk", sans-serif;
}
.list-item {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.viewer-card {
  display: grid;
  grid-template-columns: minmax(0, 1.34fr) minmax(430px, 0.94fr);
  gap: 16px;
  align-items: stretch;
  width: 100%;
  min-height: calc(100vh - 24px);
  min-height: calc(100svh - 24px);
}

.viewer-column {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
  min-height: 640px;
}

model-viewer,
.info-panel {
  border: 1px solid var(--panel-border);
  border-radius: 32px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

model-viewer {
  position: relative;
  width: 100%;
  min-height: 560px;
  height: 100%;
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.96), transparent 24%),
    linear-gradient(180deg, rgba(255, 250, 245, 0.84), rgba(224, 236, 240, 0.92));
  overflow: hidden;
}

.viewer-loader {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.95), rgba(244, 239, 228, 0.88) 56%, rgba(216, 228, 234, 0.82));
  transition: opacity 260ms ease, visibility 260ms ease;
}

.viewer-loader-orbit {
  position: relative;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 1px solid rgba(127, 47, 29, 0.16);
  box-shadow:
    inset 0 0 0 10px rgba(255, 255, 255, 0.42),
    0 14px 28px rgba(17, 33, 45, 0.1);
  animation: viewer-loader-spin 1.35s linear infinite;
}

.viewer-loader-orbit::before,
.viewer-loader-orbit::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 1px dashed rgba(217, 93, 57, 0.28);
}

.viewer-loader-orbit::after {
  inset: 20px;
  border-style: solid;
  border-color: rgba(17, 33, 45, 0.08);
}

.viewer-loader-dot {
  position: absolute;
  top: -6px;
  left: 50%;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d95d39, #7f2f1d);
  box-shadow:
    0 0 0 8px rgba(217, 93, 57, 0.16),
    0 10px 22px rgba(127, 47, 29, 0.24);
}

.viewer-loader-text {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

model-viewer:not(.is-loading) .viewer-loader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@keyframes viewer-loader-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.cta-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border: 1px solid rgba(217, 93, 57, 0.16);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 244, 238, 0.92), rgba(255, 252, 247, 0.88));
  box-shadow: 0 16px 36px rgba(17, 33, 45, 0.08);
}

.cta-copy {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.35;
  color: var(--ink);
  text-align: center;
}

.cta-copy span {
  font-weight: 700;
  color: var(--accent-dark);
}

.info-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 640px;
  padding: 18px;
  background: var(--panel);
  overflow: hidden;
}

.panel-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-heading-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.panel-heading-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

.panel-heading-row h2 {
  margin: 0;
  font-size: clamp(1.55rem, 1.9vw, 2rem);
  letter-spacing: -0.04em;
  line-height: 1;
}

.page-audio-shell {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 8px 10px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 244, 238, 0.92), rgba(255, 252, 247, 0.9));
  box-shadow:
    inset 0 0 0 1px rgba(217, 93, 57, 0.14),
    0 10px 24px rgba(17, 33, 45, 0.06);
}

.page-audio-toggle {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #d95d39, #8f3721);
  box-shadow: 0 12px 24px rgba(143, 55, 33, 0.22);
}

.page-audio-toggle:hover {
  transform: translateY(-1px);
}

#page-audio-toggle-icon {
  font-size: 1rem;
  line-height: 1;
}

.page-audio-meta {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.page-audio-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

.page-audio-progress {
  width: 100%;
  margin: 0;
  accent-color: #d95d39;
}

.page-audio-time {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

#page-audio-player {
  display: none;
}

.page-chip {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  min-width: 58px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent-dark);
  background: rgba(217, 93, 57, 0.1);
  box-shadow: inset 0 0 0 1px rgba(217, 93, 57, 0.12);
}

.panel-description {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.86rem;
  max-width: none;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.page-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  align-items: start;
  padding: 0;
}

.page-preview-wrap {
  width: 100%;
  min-height: 0;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 14px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 245, 240, 0.9), rgba(255, 255, 255, 0.78)),
    radial-gradient(circle at top, rgba(255, 255, 255, 0.85), transparent 60%);
  box-shadow:
    inset 0 0 0 1px rgba(217, 93, 57, 0.12),
    0 18px 40px rgba(17, 33, 45, 0.06);
}

.page-preview {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: min(320px, 36vh);
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(17, 33, 45, 0.14);
}

.panel-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 2px;
}

.hotspot-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.list-item {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 58px;
  padding: 8px;
  text-align: center;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(17, 33, 45, 0.08);
}

.list-item:hover {
  transform: translateY(-1px);
}

.list-item.is-active {
  background: linear-gradient(180deg, rgba(255, 237, 231, 0.95), rgba(255, 245, 241, 0.9));
  box-shadow:
    inset 0 0 0 1px rgba(217, 93, 57, 0.22),
    0 12px 24px rgba(217, 93, 57, 0.08);
}

.list-item-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 25px rgba(17, 33, 45, 0.12);
}

.list-item.is-active .list-item-number {
  color: #fff;
  background: linear-gradient(135deg, #d95d39, #7f2f1d);
}

.hotspot {
  width: 52px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

.hotspot-marker {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, #d95d39, #7f2f1d);
  box-shadow:
    0 0 0 10px rgba(217, 93, 57, 0.16),
    0 10px 22px rgba(127, 47, 29, 0.32);
}

.hotspot-audio-marker {
  background: linear-gradient(135deg, #d95d39, #8f3721);
}

.hotspot-audio-icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
  color: #fff;
}

.hotspot.is-active .hotspot-marker,
.hotspot:hover .hotspot-marker {
  transform: scale(1.06);
}

.hotspot:not(.visible) {
  display: none;
}

@media (max-width: 1080px) {
  .page-shell {
    min-height: auto;
    padding: 14px 0 18px;
  }

  .viewer-card {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .viewer-column {
    min-height: auto;
  }

  model-viewer,
  .info-panel {
    min-height: auto;
  }

  model-viewer {
    height: clamp(420px, 62vh, 640px);
  }

  .info-panel {
    gap: 20px;
    overflow: visible;
  }

  .cta-tab {
    padding: 16px 18px;
  }

  .page-stage {
    padding: 0;
  }

  .page-preview {
    max-height: min(52vh, 520px);
  }

  .hotspot-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
  }

  .list-item {
    padding: 14px;
    min-height: 78px;
  }
}

@media (max-width: 680px) {
  .page-shell {
    width: min(100vw - 16px, 1380px);
    padding: 8px 0 14px;
  }

  .info-panel {
    padding: 18px;
    border-radius: 24px;
  }

  .viewer-column {
    gap: 12px;
  }

  model-viewer {
    height: clamp(320px, 50vh, 460px);
    border-radius: 24px;
  }

  .cta-tab {
    padding: 16px;
    border-radius: 22px;
  }

  .cta-copy {
    font-size: 0.94rem;
  }

  .panel-label {
    font-size: 0.72rem;
    letter-spacing: 0.16em;
  }

  .panel-topline {
    align-items: flex-start;
  }

  .panel-heading-row h2 {
    font-size: 1.45rem;
  }

  .panel-description {
    font-size: 0.92rem;
    max-width: none;
    display: block;
  }

  .page-audio-shell {
    width: 100%;
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .page-audio-time {
    grid-column: 1 / -1;
    justify-self: end;
  }

  .page-preview-wrap {
    padding: 12px;
    border-radius: 18px;
  }

  .page-preview {
    max-height: 34vh;
    border-radius: 14px;
  }

  .hotspot-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .list-item {
    padding: 10px;
    min-height: 70px;
    border-radius: 18px;
  }

  .list-item-number {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .hotspot {
    width: 46px;
    height: 46px;
  }

  .hotspot-marker {
    box-shadow:
      0 0 0 8px rgba(217, 93, 57, 0.14),
      0 8px 18px rgba(127, 47, 29, 0.26);
  }
}

@media (max-width: 420px) {
  model-viewer {
    height: clamp(280px, 44vh, 360px);
  }

  .info-panel {
    padding: 16px;
  }

  .page-chip {
    min-width: 48px;
    height: 34px;
    font-size: 0.88rem;
  }
}
