:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1c2433;
  --muted: #5c6a85;
  --line: #e2e6f0;
  --link: #1e4bb8;
  --accent: #2b5fd9;
  --shadow: 0 8px 20px rgba(0,0,0,.07);
  --radius: 12px;
  --max: 1180px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #eef2fb 0%, #f9faff 100%);
  line-height: 1.5;
}

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

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px 16px 48px;
}

header {
  text-align: center;
  margin-bottom: 20px;
}

.logo img {
  max-width: 280px;
  width: 100%;
  height: auto;
  margin-bottom: 12px;
}

.title {
  margin: 0;
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 700;
}

.subtitle {
  margin: 8px auto 0;
  color: var(--muted);
  max-width: 65ch;
  font-size: 1.05rem;
}

.help {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  margin: 20px 0;
  text-align: center;
  font-size: 0.95rem;
}

nav.topics {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  margin-bottom: 24px;
}

nav.topics ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  justify-content: center;
}

nav.topics a {
  font-size: 0.9rem;
  white-space: nowrap;
  padding: 4px 0;
}

.category-grid, .video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.category-card, .video-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.category-card:hover, .video-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0,0,0,.1);
}

.category-card a, .video-card {
  display: block;
  color: inherit;
  text-decoration: none;
}

.thumb {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #111;
  overflow: hidden;
}

.thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  padding: 12px 14px 16px;
}

.card-title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
}

.card-summary {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.video-embed {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.back-link {
  display: inline-block;
  margin-bottom: 16px;
  font-size: 0.95rem;
}

footer {
  margin-top: 36px;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

@media (max-width: 700px) {
  .category-grid, .video-grid {
    grid-template-columns: 1fr;
  }
  nav.topics ul {
    justify-content: flex-start;
  }
}
