:root {
  --bg: #0d0d0d;
  --text: #ffffff;
  --blue: #00aaff;
  --card-bg: #1c1c1c;
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', Arial, sans-serif;
  min-height: 100vh;
}

header.topbar {
  text-align: center;
  background: #000;
  padding-bottom: 1rem;
}

.logo.prominent {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 0 1rem 0;
}

.logo.prominent img {
  height: 80px;
  max-width: 90vw;
  filter: drop-shadow(0 0 10px #00aaff);
  object-fit: contain;
}

/* Nav responsive */
nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 1.05rem;
  padding-bottom: 0.6rem;
}

nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

nav a:hover {
  color: var(--blue);
  background: rgba(255,255,255,0.07);
}

.hero {
  text-align: center;
  padding: 3.5rem 1.5rem 2rem;
  background-color: #111;
}

.hero h1 {
  font-size: clamp(1.3rem, 6vw, 2.5rem);
  margin-bottom: 1rem;
}

.hero p {
  font-size: clamp(1rem, 3.3vw, 1.2rem);
  max-width: 600px;
  margin: 0 auto;
}

.tiles {
  padding: 1.4rem 1rem 1.2rem 1rem;
  text-align: center;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.2rem;
  max-width: 950px;
  margin: 0 auto;
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--card-bg);
  padding: 1.2rem 1rem;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  transition: 0.3s;
  border: 1px solid transparent;
  min-width: 0;
}

.tile i {
  font-size: 2.1rem;
  margin-bottom: 0.5rem;
  color: var(--blue);
}

.tile span {
  font-size: 1rem;
  font-weight: 500;
}

.tile:hover {
  border-color: var(--blue);
  background-color: #181818;
  transform: translateY(-3px) scale(1.03);
}

/* Carousel */
.gallery-carousel.subtle {
  background: none;
  padding: 0.1rem 0 0.3rem 0;
  margin: 0;
  text-align: center;
  border: none;
  min-height: 0;
}
.gallery-carousel.subtle .carousel-wrapper {
  overflow-x: auto;
  white-space: nowrap;
  padding: 0.1rem 0;
}
.gallery-carousel.subtle .carousel {
  display: inline-flex;
  gap: 0.5rem;
  text-decoration: none;
  align-items: center;
}
.gallery-carousel.subtle .carousel img {
  height: 38px;
  border-radius: 6px;
  box-shadow: 0 0 2px #222;
  margin: 0;
  transition: transform 0.15s;
  opacity: 0.96;
}
.gallery-carousel.subtle .carousel img:hover {
  transform: scale(1.10);
  opacity: 1;
}

/* Bottom nav links */
.bottom-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.4rem;
  padding: 0.7rem 0 0.25rem 0;
  background: none;
  font-size: 1.05rem;
}
.bottom-links a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: color 0.17s;
}
.bottom-links a i {
  color: var(--blue);
  font-size: 1em;
}
.bottom-links a:hover {
  color: var(--blue);
}

.upload-container {
  max-width: 98vw;
  margin: 1.5rem auto;
  background: #191919;
  padding: 2vw 2vw 2.2vw;
  border-radius: 14px;
  text-align: center;
  box-shadow: 0 0 16px #000a;
}

#stl-canvas {
  width: 96vw;
  max-width: 350px;
  height: 50vw;
  max-height: 350px;
  margin: 1rem auto 1.3rem auto;
  background: #222;
  border-radius: 10px;
  box-shadow: 0 2px 12px #0007;
  display: block;
}

footer {
  text-align: center;
  padding: 2rem 0.6rem 1.2rem 0.6rem;
  font-size: 0.97rem;
  color: #aaa;
  background: transparent;
}

@media (max-width: 650px) {
  .logo.prominent img { height: 52px; }
  nav { font-size: 0.99rem; gap: 0.45rem;}
  .tile-grid { gap: 0.7rem; }
  .tile { padding: 1rem 0.3rem; }
  .gallery-carousel.subtle .carousel img { height: 30px; }
  .upload-container { padding: 2vw 1vw 1.4vw;}
  #stl-canvas { max-width: 98vw; max-height: 220px; }
}
@media (max-width: 420px) {
  .hero { padding: 2rem 0.3rem 1.2rem; }
  .logo.prominent img { height: 37px; }
  .tile span { font-size: 0.91rem; }
  .bottom-links { font-size: 0.91rem; gap: 0.65rem;}
  footer { font-size: 0.89rem;}
}
nav a.active, .bottom-links a.active {
  color: var(--blue);
  font-weight: 600;
  background: rgba(0,170,255,0.13);
  border-radius: 4px;
}
nav a i, .bottom-links a i {
  margin-right: 4px;
}
