/* Size of Space Editorial Styles */
.space-page {
  padding-top: 84px;
  padding-bottom: 80px;
  min-height: 100vh;
  background: #FAF9F6;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
}

.space-container {
  width: 100%;
  max-width: 860px;
  padding: 0 20px;
  text-align: center;
}

.scale-hero-title {
  font-family: var(--font-serif);
  font-size: 38px;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.scale-hero-sub {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
}

/* Comparison Display Box */
.scale-stage-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 4px 16px rgba(36, 36, 36, 0.04);
  margin-bottom: 24px;
}

.scale-viewport {
  width: 100%;
  height: 320px;
  background: #111622;
  border-radius: 8px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

#scaleCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.scale-info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
}

.object-name {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 400;
  color: var(--text-primary);
  margin: 0;
}

.object-diameter {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
}

.object-fact-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
  text-align: left;
}

/* Controls */
.scale-controls-row {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
}

.scale-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  background: linear-gradient(to right, var(--accent) var(--p, 0%), var(--border-light) var(--p, 0%));
}

.scale-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2px solid var(--accent);
  box-shadow: 0 1px 4px rgba(36, 36, 36, 0.22);
  cursor: pointer;
}

.scale-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2px solid var(--accent);
  box-shadow: 0 1px 4px rgba(36, 36, 36, 0.22);
  cursor: pointer;
}

.scale-slider::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: transparent;
}

.scale-slider:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Step-in motion: the one deliberate transition when the scale changes */
.scale-info-row.step-in,
.object-fact-text.step-in {
  animation: spaceStepIn 380ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes spaceStepIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .scale-info-row.step-in,
  .object-fact-text.step-in {
    animation: none;
  }
}

@media (max-width: 640px) {
  .scale-stage-card {
    padding: 18px;
  }
  .scale-viewport {
    height: 240px;
  }
  .scale-hero-title {
    font-size: 28px;
  }
  .scale-controls-row {
    flex-wrap: wrap;
  }
}
