* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0a0a14;
  color: #e0e0e8;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.site-header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  padding: 32px 0 24px;
  text-align: center;
  border-bottom: 1px solid #222;
}
.site-header h1 { font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 700; letter-spacing: -0.02em; }
.subtitle { color: #888; font-size: clamp(0.8rem, 2vw, 0.9rem); margin-top: 6px; }
.meta-bar { margin-top: 16px; font-size: 0.85rem; color: #666; }
nav.toc {
  background: #111;
  border-bottom: 1px solid #222;
  padding: 10px 0;
  position: sticky;
  top: 0;
  z-index: 10;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
nav.toc a {
  display: inline-block;
  margin: 0 12px;
  color: #aaa;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.2s;
  white-space: nowrap;
  padding: 4px 0;
}
nav.toc a:hover { color: #4a9eff; border-bottom: 2px solid #4a9eff; }
main { padding: 24px 0; }
section { margin-bottom: 40px; }
h2 {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-weight: 600;
  margin-bottom: 8px;
  color: #fff;
}
.section-desc { color: #888; font-size: clamp(0.8rem, 2vw, 0.9rem); margin-bottom: 20px; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.card {
  background: #111;
  border: 1px solid #222;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  border-color: #333;
}
.card.featured { border-color: #4a9eff; }
.card.featured .card-body h3 { color: #4a9eff; }
.aspect-ratio {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  background: #000;
}
.video-frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.card-body { padding: 14px; }
.card-body h3 {
  font-size: clamp(0.9rem, 2vw, 1rem);
  font-weight: 600;
  margin-bottom: 4px;
}
.file-meta { font-size: 0.8rem; color: #666; margin-bottom: 12px; }
.dl-btn {
  display: inline-block;
  background: #1a1a2e;
  color: #4a9eff;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid #2a2a4a;
  transition: background 0.2s;
  word-break: break-all;
}
.dl-btn:hover {
  background: #222;
  border-color: #4a9eff;
}
.dl-btn-lg { display: flex; align-items: center; gap: 6px; }
.dl-btn-lg::after { content: "→"; font-size: 1rem; }
.site-footer {
  background: #0a0a14;
  border-top: 1px solid #222;
  padding: 20px 0;
  text-align: center;
  font-size: 0.85rem;
  color: #666;
}
.site-footer .small { font-size: 0.8rem; margin-top: 4px; color: #444; }

/* Mobile-first — viewport under 600px is the default stack */
.grid { grid-template-columns: 1fr; }
@media (min-width: 600px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  nav.toc a { display: inline-block; margin: 0 12px; }
  nav.toc a:hover { border-bottom: 2px solid #4a9eff; }
  .site-header h1 { font-size: 2rem; }
}
@media (max-width: 599px) {
  .container { padding: 0 12px; }
  nav.toc a { display: block; margin: 4px 0; padding: 8px 0; }
  .dl-btn { font-size: 0.8rem; padding: 6px 12px; }
  .card-body h3 { font-size: 0.9rem; }
  .section-desc { font-size: 0.8rem; }
  h2 { font-size: 1.1rem; }
  main { padding: 20px 0; }
  .site-header { padding: 24px 0 16px; }
}
