* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-color: #f8f4ed;
  --bg-secondary: #f0ebe2;
  --text-primary: #2a2a2a;
  --text-secondary: #666;
  --accent: #c9a66b;
  --accent-dark: #a88544;
  --shadow: rgba(42, 42, 42, 0.1);
  --shadow-strong: rgba(42, 42, 42, 0.2);
}

body {
  font-family: 'Source Sans 3', sans-serif;
  background: var(--bg-color);
  background-image: 
    radial-gradient(circle at 20% 80%, rgba(201, 166, 107, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(201, 166, 107, 0.05) 0%, transparent 50%);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  max-width: 100vw;
}

.app-header {
  text-align: center;
  padding: 1rem 0 2rem;
  animation: fadeIn 0.8s ease-out;
}

.app-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.app-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.scale-indicator {
  position: fixed;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  z-index: 100;
}

.scale-line {
  width: 2px;
  height: 100px;
  background: linear-gradient(to bottom, transparent, var(--accent), transparent);
}

.scale-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
}

.scale-label {
  font-size: 0.6rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

@media (max-width: 768px) {
  .scale-indicator {
    position: static;
    transform: none;
    flex-direction: row;
    justify-content: center;
    margin-bottom: 1rem;
  }
  
  .scale-line {
    width: 80px;
    height: 2px;
  }
  
  .scale-text,
  .scale-label {
    writing-mode: horizontal-tb;
    transform: none;
  }
}

.objects-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 350px;
  cursor: grab;
  user-select: none;
  overflow: hidden;
}

.objects-container:active {
  cursor: grabbing;
}

.objects-track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
}

.object-wrapper {
  position: absolute;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.object-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px var(--shadow), 0 8px 40px var(--shadow);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.object-card:hover {
  box-shadow: 0 8px 30px var(--shadow-strong), 0 16px 60px var(--shadow);
}

.object-card.center {
  background: linear-gradient(135deg, white 0%, #fefcf9 100%);
  box-shadow: 0 8px 40px var(--shadow-strong), 0 20px 60px var(--shadow);
}

.object-image-container {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 8px;
  background: var(--bg-secondary);
  position: relative;
}

.object-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.object-image.visible {
  opacity: 1;
}

.loading-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid var(--bg-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.error-placeholder {
  font-size: 3rem;
  opacity: 0.5;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.object-info {
  text-align: center;
  margin-top: 1rem;
}

.object-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.object-size {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.detail-panel {
  text-align: center;
  padding: 2rem 1rem;
  max-width: 600px;
  margin: 0 auto;
  animation: slideUp 0.5s ease-out;
}

.category-tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--accent);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 20px;
  margin-bottom: 0.75rem;
}

.detail-name {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.detail-description {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.detail-size {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.size-value {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-dark);
}

.size-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.navigation-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
}

.nav-button {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid var(--text-primary);
  background: transparent;
  color: var(--text-primary);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-button:hover:not(:disabled) {
  background: var(--text-primary);
  color: white;
}

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

.compare-button {
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--accent);
  background: transparent;
  color: var(--accent-dark);
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.compare-button:hover {
  background: var(--accent);
  color: white;
}

.progress-bar {
  position: relative;
  height: 4px;
  background: var(--bg-secondary);
  border-radius: 2px;
  margin: 1rem 2rem 2rem;
}

.progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  border-radius: 2px;
  transition: width 0.5s ease;
}

.progress-markers {
  position: absolute;
  inset: 0;
}

.progress-marker {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--bg-secondary);
  border: 2px solid var(--bg-color);
  border-radius: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: all 0.3s ease;
}

.progress-marker:hover {
  background: var(--accent);
  transform: translate(-50%, -50%) scale(1.3);
}

.progress-marker.active {
  background: var(--accent-dark);
  transform: translate(-50%, -50%) scale(1.5);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background: white;
  border-radius: 20px;
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.3s ease;
}

.modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-align: center;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg-secondary);
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: var(--text-primary);
  color: white;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.compare-item {
  padding: 0.75rem;
  border: 2px solid var(--bg-secondary);
  background: white;
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s ease;
}

.compare-item:hover {
  border-color: var(--accent);
  background: var(--bg-secondary);
}

.compare-item.selected {
  border-color: var(--accent-dark);
  background: var(--accent);
  color: white;
}

.compare-name {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.compare-size {
  font-size: 0.75rem;
  opacity: 0.7;
}

.comparison-view {
  padding: 2rem;
  text-align: center;
  animation: fadeIn 0.5s ease;
}

.comparison-close {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  padding: 0.5rem 1rem;
  border: none;
  background: var(--bg-secondary);
  border-radius: 20px;
  cursor: pointer;
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 600;
  transition: all 0.3s ease;
}

.comparison-close:hover {
  background: var(--text-primary);
  color: white;
}

.comparison-title {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  margin-bottom: 2rem;
}

.comparison-objects {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.comparison-object {
  flex: 1;
  min-width: 200px;
  max-width: 300px;
}

.comparison-image {
  width: 150px;
  height: 150px;
  object-fit: contain;
  border-radius: 16px;
  background: white;
  box-shadow: 0 4px 20px var(--shadow);
  margin-bottom: 1rem;
}

.comparison-object h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  margin-bottom: 0.25rem;
}

.comparison-object p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.comparison-vs {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.vs-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.ratio-badge {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ratio-value {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 900;
}

.ratio-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.9;
}

.comparison-fact {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.6;
}

.app-footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.app-footer a {
  color: var(--accent-dark);
  text-decoration: none;
  transition: color 0.3s ease;
}

.app-footer a:hover {
  color: var(--text-primary);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@media (max-width: 640px) {
  .app-container {
    padding: 1rem;
  }
  
  .object-card {
    padding: 1rem;
  }
  
  .detail-panel {
    padding: 1rem;
  }
  
  .progress-bar {
    margin: 1rem 1rem 1.5rem;
  }
  
  .comparison-objects {
    flex-direction: column;
  }
  
  .comparison-image {
    width: 120px;
    height: 120px;
  }
}