:root {
  --bg: #f8f9fa;
  --card-bg: #ffffff;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --text: #1f2937;
  --subtext: #6b7280;
  --border: #e5e7eb;
  --green: #16a34a;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 24px rgba(37,99,235,0.15);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.site-header .logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.site-header .tagline {
  color: var(--subtext);
  font-size: 0.85rem;
}

/* ── Hero (index) ── */
.hero {
  text-align: center;
  padding: 56px 24px 32px;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.hero p {
  color: var(--subtext);
  font-size: 1.05rem;
  max-width: 500px;
  margin: 0 auto;
}

/* ── Cards grid ── */
.models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  padding: 8px 24px 60px;
  max-width: 1080px;
  margin: 0 auto;
  width: 100%;
}

.model-card {
  background: var(--card-bg);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.model-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.model-card img {
  width: 100%;
  height: 210px;
  object-fit: cover;
}

.model-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.model-card h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.model-card .card-desc {
  color: var(--subtext);
  font-size: 0.88rem;
  flex: 1;
  margin-bottom: 16px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: background 0.15s;
  cursor: pointer;
  border: none;
}

.btn:hover { background: var(--accent-hover); }

.btn-download {
  padding: 13px 24px;
  font-size: 1rem;
  border-radius: 10px;
  width: 100%;
}

/* ── Download options ── */
.download-section { margin-top: 4px; }

.download-section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--subtext);
  margin-bottom: 10px;
}

.download-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.download-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 10px;
  border-radius: 10px;
  text-decoration: none;
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  transition: border-color 0.15s, box-shadow 0.15s;
  gap: 3px;
}

.download-option:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
}

.download-option-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  margin-bottom: 4px;
}

.download-option-label {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
}

.download-option-desc {
  font-size: 0.75rem;
  color: var(--subtext);
  line-height: 1.3;
}

.download-option--print {
  background: var(--card-bg);
}

/* ── Footer ── */
footer {
  text-align: center;
  padding: 22px 24px;
  color: var(--subtext);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ── Model page ── */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  flex: 1;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.88rem;
  padding: 24px 0 0;
}

.back-link:hover { text-decoration: underline; }

.model-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 28px 0 60px;
  align-items: start;
}

.model-hero img {
  width: 100%;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.model-info h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 22px;
}

/* ── Specs & Features cards ── */
.info-card {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.info-card h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--subtext);
  margin-bottom: 12px;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

.spec-row:last-child { border-bottom: none; }
.spec-row .label { color: var(--subtext); }

.feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 0.92rem;
}

.feature-item::before {
  content: '✓';
  color: var(--green);
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Schematic ── */
.schematic-img {
  width: 100%;
  border-radius: 8px;
  margin-top: 6px;
  display: block;
}

/* ── STL download ── */
.stl-download {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  font-size: 0.9rem;
  margin-top: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.stl-download:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
}

.stl-download img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.stl-download-text span {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--subtext);
}

/* ── Components table ── */
.components-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 6px;
}

.components-table th {
  text-align: left;
  padding: 6px 8px;
  color: var(--subtext);
  font-weight: 500;
  border-bottom: 2px solid var(--border);
}

.components-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.4;
}

.components-table tr:last-child td {
  border-bottom: none;
}

.components-table td:nth-child(2) {
  white-space: nowrap;
  color: var(--subtext);
  text-align: center;
}

/* ── Shop links ── */
.shop-link {
  display: inline-block;
  padding: 2px 7px;
  background: #f0f4ff;
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--accent);
  text-decoration: none;
  margin: 2px 2px 0 0;
  white-space: nowrap;
}

.shop-link:hover {
  background: var(--accent);
  color: #fff;
}

.components-table .note {
  font-size: 0.75rem;
  color: var(--subtext);
  margin-top: 2px;
}

.components-section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--subtext);
  padding: 10px 8px 4px;
  background: var(--bg);
}

/* ── Responsive ── */
@media (max-width: 700px) {
  .hero h1 { font-size: 1.5rem; }
  .models-grid { grid-template-columns: 1fr; padding: 0 16px 40px; }

  .model-hero {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px 0 40px;
  }

  .model-info h1 { font-size: 1.5rem; }
}
