/* RackDocs Website — Dark theme, muted colors, no gradients */

:root {
  --bg: #121214;
  --bg-raised: #1c1c1f;
  --bg-hover: #242428;
  --text: #e0e0e4;
  --text-muted: #8e8e93;
  --text-dim: #636366;
  --accent: #6e9ecf;
  --accent-hover: #85b3de;
  --border: #2c2c2e;
  --border-light: #3a3a3c;
  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 1080px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; height: auto; display: block; }

/* --- Nav --- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(18, 18, 20, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
}
.nav-logo:hover { color: var(--text); }
.nav-logo img { border-radius: 6px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 500;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--text); }

.nav-appstore {
  background: var(--accent);
  color: #fff !important;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 14px !important;
  font-weight: 600 !important;
  transition: background 0.15s;
}
.nav-appstore:hover { background: var(--accent-hover); }

/* --- Breadcrumb --- */

.breadcrumb {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 24px 0;
  font-size: 14px;
  color: var(--text-dim);
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { margin: 0 8px; }
.breadcrumb .current { color: var(--text-muted); }

/* --- Main content --- */

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 64px;
}

/* --- Hero --- */

.hero {
  display: flex;
  align-items: center;
  gap: 48px;
  padding: 64px 0;
}

.hero-content { flex: 1; }

.hero h1 {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.hero-sub {
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 28px;
  max-width: 480px;
}

.hero-image {
  flex-shrink: 0;
}
.hero-image img {
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.btn-appstore img { display: inline-block; }

/* --- Intro paragraph --- */

.intro {
  max-width: 800px;
  padding: 0 0 16px;
}
.intro p {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* --- Pain Points --- */

.pain-points {
  padding: 48px 0;
  border-top: 1px solid var(--border);
}

.pain-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.pain-card {
  padding: 24px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.pain-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--accent);
}

.pain-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

.pain-solution {
  font-size: 16px;
  color: var(--text);
  line-height: 1.7;
  max-width: 800px;
}

/* --- How It Works --- */

.how-it-works {
  padding: 48px 0;
  border-top: 1px solid var(--border);
}
.how-it-works h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 32px;
  text-align: center;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.step {
  text-align: center;
  padding: 24px;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 16px;
}

.step h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.step p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* --- Features --- */

.features {
  padding: 48px 0;
}
.features h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 32px;
  text-align: center;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  transition: border-color 0.15s;
}
.feature-card:hover { border-color: var(--border-light); }

.feature-icon {
  margin-bottom: 12px;
  color: var(--accent);
}
.feature-icon svg {
  width: 28px;
  height: 28px;
}

.feature-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* --- Screenshots --- */

.screenshots {
  padding: 48px 0;
  border-top: 1px solid var(--border);
}
.screenshots h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 32px;
  text-align: center;
}

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  align-items: start;
}

.screenshot-item {
  text-align: center;
}
.screenshot-item img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  margin-bottom: 12px;
}
.screenshot-item p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.4;
}
.pdf-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

/* --- Stats Bar --- */

.stats-bar {
  display: flex;
  justify-content: center;
  gap: 48px;
  padding: 40px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 16px 0;
}

.stat { text-align: center; }

.stat-number {
  display: block;
  font-size: 36px;
  font-weight: 800;
  color: var(--accent);
}

.stat-label {
  display: block;
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* --- Popular Modules Grid --- */

.popular-modules {
  padding: 48px 0;
}
.popular-modules h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
}

.module-grid-small {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 16px;
}

.module-thumb-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 8px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s, transform 0.15s;
}
.module-thumb-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.module-thumb-card img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 4px;
  margin-bottom: 8px;
  background: var(--bg);
}

.module-thumb-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: block;
  line-height: 1.3;
}
.module-thumb-mfr {
  font-size: 11px;
  color: var(--text-dim);
  display: block;
  margin-top: 2px;
}

.section-cta {
  text-align: center;
  margin-top: 24px;
  font-size: 15px;
}

/* --- Page Header --- */

.page-header {
  padding: 48px 0 32px;
}
.page-header h1 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 12px;
}
.page-header p {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 700px;
  line-height: 1.6;
}

/* --- Manufacturer Grid (Index) --- */

.manufacturer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  padding-bottom: 48px;
}

.manufacturer-card {
  display: block;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color 0.15s, transform 0.15s;
}
.manufacturer-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.manufacturer-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}
.manufacturer-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.module-count {
  font-size: 13px;
  color: var(--text-dim);
  background: var(--bg);
  padding: 2px 10px;
  border-radius: 12px;
  white-space: nowrap;
}

.manufacturer-thumbs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.manufacturer-thumb-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 96px;
}
.manufacturer-thumbs img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  border-radius: 4px;
  background: var(--bg);
}
.manufacturer-thumb-name {
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  margin-top: 4px;
  line-height: 1.2;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 96px;
}

/* --- Module List (Manufacturer Page) --- */

.module-list {
  padding-bottom: 48px;
}

.module-card-expanded {
  display: flex;
  gap: 24px;
  padding: 24px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  transition: border-color 0.15s;
}
.module-card-expanded:hover { border-color: var(--border-light); }

.module-image {
  flex-shrink: 0;
}
.module-image img {
  width: 180px;
  height: 180px;
  object-fit: contain;
  border-radius: var(--radius);
  background: var(--bg);
}

.module-info { flex: 1; min-width: 0; }

.module-info h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}

.module-specs {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.module-annotations {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.module-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.tag {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg);
  padding: 2px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.module-app-hint {
  font-size: 13px;
  color: var(--text-dim);
  font-style: italic;
  margin-bottom: 8px;
}

.module-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.rating {
  color: var(--accent);
}

.btn-small {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 4px 14px;
  border-radius: 16px;
  transition: background 0.15s, color 0.15s;
}
.btn-small:hover {
  background: var(--accent);
  color: #fff;
}

/* --- News --- */

.news-rich {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 48px;
}

.news-card {
  display: flex;
  gap: 20px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.15s;
}
.news-card:hover { border-color: var(--border-light); }

.news-image {
  flex-shrink: 0;
  width: 240px;
  max-height: 160px;
  overflow: hidden;
}
.news-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-content {
  padding: 20px 20px 20px 0;
  flex: 1;
  min-width: 0;
}

.news-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-dim);
}

.news-content h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.3;
}
.news-content h2 a { color: var(--text); }
.news-content h2 a:hover { color: var(--accent); }

.news-excerpt {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Badges */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.badge-video { background: #3a2020; color: #e08080; }
.badge-article { background: #1e2a38; color: #80b0e0; }
.badge-module { background: #1e3020; color: #80c090; }
.badge-podcast { background: #2a1e38; color: #b080e0; }
.badge-tutorial { background: #38301e; color: #e0c080; }
.badge-other { background: var(--bg); color: var(--text-muted); }

.news-source {
  color: var(--text-muted);
}

/* Compact news list */
.news-compact {
  padding-bottom: 48px;
}
.news-compact h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
}

.news-list {
  list-style: none;
}
.news-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}
.news-list li > a {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  flex: 1;
  min-width: 200px;
}
.news-list li > a:hover { color: var(--accent); }

.news-list-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
  flex-shrink: 0;
}

/* --- Advanced Features --- */

.advanced-features {
  padding: 48px 0;
  border-top: 1px solid var(--border);
}
.advanced-features h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 32px;
  text-align: center;
}

/* --- Perfect For --- */

.perfect-for {
  padding: 48px 0;
  border-top: 1px solid var(--border);
}
.perfect-for h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
  text-align: center;
}

.use-case-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.use-case {
  text-align: center;
  padding: 24px 16px;
}

.use-case h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
}

.use-case p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* --- Section Intro --- */

.section-intro {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 24px;
  max-width: 700px;
}

/* --- FAQ --- */

.faq {
  padding: 48px 0;
  border-top: 1px solid var(--border);
}
.faq h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
}

.faq-list {
  max-width: 760px;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item summary {
  padding: 16px 0;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item summary::after {
  content: '+';
  font-size: 20px;
  color: var(--text-dim);
  flex-shrink: 0;
  margin-left: 16px;
}
.faq-item[open] summary::after {
  content: '-';
}

.faq-item p {
  padding: 0 0 16px;
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* --- CTA Bottom --- */

.cta-bottom {
  text-align: center;
  padding: 48px 0;
  border-top: 1px solid var(--border);
  margin-top: 16px;
}
.cta-bottom h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
}
.cta-bottom p {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* --- Footer --- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 32px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  color: var(--text-muted);
}
.footer-brand img { border-radius: 4px; }

.footer-links {
  display: flex;
  gap: 20px;
  font-size: 14px;
}
.footer-links a { color: var(--text-dim); }
.footer-links a:hover { color: var(--text-muted); }

.footer-copy {
  font-size: 13px;
  color: var(--text-dim);
  margin-left: auto;
}

/* --- Responsive --- */

@media (max-width: 768px) {
  .hero {
    flex-direction: column;
    text-align: center;
    gap: 32px;
    padding: 40px 0;
  }
  .hero-sub { max-width: none; }
  .hero h1 { font-size: 30px; }
  .hero-image img { max-width: 240px; margin: 0 auto; }
  .hero-cta { justify-content: center; display: flex; }

  .pain-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .screenshot-grid { grid-template-columns: 1fr; max-width: 300px; margin: 0 auto; }
  .use-case-grid { grid-template-columns: repeat(2, 1fr); }

  .stats-bar {
    flex-direction: column;
    gap: 24px;
  }

  .module-grid-small {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .manufacturer-grid {
    grid-template-columns: 1fr;
  }

  .module-card-expanded {
    flex-direction: column;
    gap: 16px;
  }
  .module-image img {
    width: 100px;
    height: 100px;
  }

  .news-card {
    flex-direction: column;
  }
  .news-image {
    width: 100%;
    height: 180px;
  }
  .news-content {
    padding: 16px;
  }

  .nav-links { gap: 16px; }
  .footer-container { flex-direction: column; text-align: center; }
  .footer-copy { margin-left: 0; }
}

@media (max-width: 480px) {
  .nav-links a:not(.nav-appstore) { display: none; }
  .hero h1 { font-size: 26px; }
  .stats-bar { gap: 16px; }
  .stat-number { font-size: 28px; }
}
