:root {
  --ink: #241f1a;
  --muted: #776b5e;
  --paper: #f4eee2;
  --panel: #fffaf1;
  --line: #d9cbbb;
  --accent: #8e2435;
  --dark: #171310;
  --gold: #c7a45d;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--dark);
}

.space-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(420px, 1fr) auto;
  gap: 16px;
  padding: clamp(16px, 3vw, 34px);
}

.space-header,
.space-panel {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  border: 1px solid #6f6254;
  background: var(--paper);
}

.space-header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: start;
  padding: clamp(18px, 3vw, 30px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 6vw, 72px);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 0.98;
}

.space-header p:last-child,
.space-panel p {
  margin: 10px 0 0;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.45;
}

model-viewer {
  width: min(1180px, 100%);
  height: min(70vh, 720px);
  min-height: 420px;
  margin: 0 auto;
  display: block;
  border: 1px solid #6f6254;
  background: #eee6d8;
}

model-viewer.viewer-fallback {
  display: grid;
  place-items: center;
  padding: 24px;
  background: #201a15;
}

.viewer-fallback-panel {
  width: min(560px, 100%);
  border: 1px solid rgba(255, 250, 241, 0.24);
  padding: 22px;
  color: #fffaf1;
  background: rgba(255, 250, 241, 0.08);
}

.viewer-fallback-panel strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 5vw, 46px);
  font-weight: 500;
  line-height: 1;
}

.viewer-fallback-panel span {
  display: block;
  margin-top: 10px;
  color: #e6d8c4;
  line-height: 1.45;
}

.space-panel {
  padding: clamp(18px, 3vw, 28px);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.model-variant-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  flex: 1 0 100%;
  width: 100%;
  gap: 10px;
}

.model-variant.active {
  background: var(--gold);
  border-color: #6f4e12;
  color: #171310;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 15px;
  border: 1px solid var(--ink);
  color: inherit;
  text-decoration: none;
  font-size: 14px;
  background: transparent;
  cursor: pointer;
  border-radius: 0;
}

.button.primary {
  background: var(--ink);
  color: #fffaf1;
}

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

.audio-overview-player {
  display: block;
  width: min(760px, 100%);
  margin-top: 16px;
}

.audio-overview-player[hidden] {
  display: none;
}

.quick-look-link img {
  width: 1px;
  height: 1px;
  opacity: 0;
  position: absolute;
  pointer-events: none;
}

.button:hover,
.button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.button.primary:hover,
.button.primary:focus-visible,
.ar-button:hover,
.ar-button:focus-visible {
  background: var(--gold);
  border-color: #6f4e12;
  color: #171310;
}

.ar-button {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  min-width: 190px;
  border: 2px solid #6f4e12;
  background: var(--gold);
  color: #171310;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  font-weight: 800;
}

.ar-button:active,
.button.primary:active {
  transform: translateY(1px);
}

.ar-button:active {
  transform: translateX(-50%) translateY(1px);
}

.note {
  max-width: 760px;
}

@media (max-width: 720px) {
  .space-shell {
    grid-template-rows: auto minmax(340px, 1fr) auto;
    padding: 12px;
  }

  .space-header {
    grid-template-columns: 1fr;
  }

  model-viewer {
    min-height: 340px;
    height: 58vh;
  }
}
