:root {
  /* Default Theme: Minimalist */
  --bg-color: #ffffff;
  --text-color: #1a1a1a;
  --accent-color: #333333;
  --secondary-bg: #f5f5f5;
  --card-bg: #ffffff;
  --font-main: "Inter", "Helvetica Neue", sans-serif;
  --font-heading: "Inter", "Helvetica Neue", sans-serif;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --border-radius: 12px;
  --btn-bg: #000000;
  --btn-text: #ffffff;
  --link-color: #000000;
  --viewer-bg: #f0f0f0;
}

[data-theme="midnight"] {
  --bg-color: #0a0a0a;
  --text-color: #e0e0e0;
  --accent-color: #00ffff;
  --secondary-bg: #111111;
  --card-bg: #161616;
  --font-main: "Roboto Mono", monospace;
  --font-heading: "Orbitron", sans-serif;
  --shadow: 0 4px 20px rgba(0, 255, 255, 0.15);
  --border-radius: 4px;
  --btn-bg: #00ffff;
  --btn-text: #000000;
  --link-color: #00ffff;
  --viewer-bg: #1a1a1a;
}

[data-theme="nature"] {
  --bg-color: #f7f3e8;
  --text-color: #4a4036;
  --accent-color: #5c7c55;
  --secondary-bg: #e8e4d9;
  --card-bg: #ffffff;
  --font-main: "Merriweather", serif;
  --font-heading: "Spectral", serif;
  --shadow: 0 4px 20px rgba(92, 124, 85, 0.1);
  --border-radius: 24px;
  --btn-bg: #5c7c55;
  --btn-text: #ffffff;
  --link-color: #3d5239;
  --viewer-bg: #e0dcd0;
}

* {
  box-sizing: border-box;
  transition: background-color 0.3s ease, color 0.3s ease,
    border-radius 0.3s ease;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header & Theme Switcher */
header {
  padding: 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.theme-switcher {
  display: flex;
  gap: 0.5rem;
  background: var(--secondary-bg);
  padding: 0.5rem;
  border-radius: 50px;
}

.theme-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-family: var(--font-main);
  font-size: 0.9rem;
  color: var(--text-color);
  opacity: 0.6;
  transition: all 0.2s ease;
}

.theme-btn:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.05);
}

.theme-btn.active {
  background: var(--btn-bg);
  color: var(--btn-text);
  opacity: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Download Buttons */
.download-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 1rem;
}

.btn-download {
  display: block;
  background: var(--secondary-bg);
  color: var(--text-color);
  padding: 1rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.btn-download:hover {
  background: var(--accent-color);
  color: #fff;
  transform: translateY(-2px);
}

/* Main Content */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  max-width: 800px;
  width: 100%;
  overflow: hidden;
  position: relative;
}

model-viewer {
  width: 100%;
  height: 500px;
  background-color: var(--viewer-bg);
  --poster-color: transparent;
}

.content {
  padding: 2rem;
  text-align: center;
}

h1 {
  font-family: var(--font-heading);
  font-size: 1.5rem; /* Reduced from 1.8 */
  margin-bottom: 0.25rem; /* Tighter */
  font-weight: 600;
  line-height: 1.3;
}


h1 a {
  color: var(--link-color);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s;
}

h1 a:hover {
  border-bottom-color: var(--link-color);
}

.details {
  font-size: 0.85rem;
  opacity: 0.9;
  margin-bottom: 1rem;
  line-height: 1.4;
  color: var(--accent-color);
}


/* Footer */
footer {
  text-align: center;
  padding: 1rem 2rem; /* Reduced padding */
  font-size: 0.8rem;
  opacity: 0.7;
  max-width: 600px;
  margin: 0 auto;
}


footer a {
  color: var(--link-color);
}

/* Utilities */
.hidden {
  display: none !important;
}

@media (max-width: 600px) {
  /* Full bleed viewer on mobile */
  .card {
    border-radius: 0;
    box-shadow: none;
    max-width: 100%;
    margin: 0;
  }

  model-viewer {
    height: 65vh; /* Immersive height */
  }

  main {
    padding: 0; /* Remove padding around card */
  }

  .content {
    padding: 2rem 1.5rem;
    text-align: center;
  }

  h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }

  /* Bigger touch targets for theme switcher */
  .theme-btn {
    padding: 0.8rem 1.2rem;
    font-size: 1rem;
  }
}
