:root {
  --color-bg: #0f1115;
  --color-surface: #171a21;
  --color-surface-hover: #1e222b;
  --color-border: #262a33;
  --color-text: #e6e8eb;
  --color-muted: #9aa1ac;
  --color-accent: #2aabee;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.55;
}

h1, h2, h3 {
  line-height: 1.25;
}

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

a:hover {
  text-decoration: underline;
}

/* Header */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--color-border);
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-text);
}

.site-header nav a {
  color: var(--color-muted);
  font-weight: 500;
  margin-left: 1.5rem;
}

.site-header nav a:hover {
  color: var(--color-text);
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem;
}

section + section {
  margin-top: 3rem;
}

/* Hero */

.hero {
  text-align: center;
  padding: 2.5rem 0 3rem;
}

.hero h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.hero-subtitle {
  color: var(--color-muted);
  max-width: 560px;
  margin: 0 auto 1.75rem;
  font-size: 1.05rem;
}

.page-intro {
  color: var(--color-muted);
  margin-bottom: 1.5rem;
}

/* CTA buttons */

.cta-button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--color-accent);
  color: #fff;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}

.cta-button:hover {
  text-decoration: none;
  opacity: 0.9;
}

.cta-button--card {
  padding: 0.5rem 1.1rem;
  font-size: 0.9rem;
  margin-top: auto;
  align-self: flex-start;
}

/* Section headers */

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.section-header h2 {
  margin: 0;
}

.section-link {
  font-size: 0.9rem;
  color: var(--color-muted);
  white-space: nowrap;
}

.section-link:hover {
  color: var(--color-accent);
}

/* Category chips (главная) */

.category-chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0;
  margin: 0;
}

.chip {
  display: inline-block;
  padding: 0.45rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text);
  font-size: 0.9rem;
}

.chip:hover {
  background: var(--color-surface-hover);
  text-decoration: none;
  border-color: var(--color-accent);
}

/* Category filter (каталог) */

.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.category-filter a {
  color: var(--color-muted);
  font-size: 0.9rem;
}

.category-filter a.active {
  color: var(--color-text);
  font-weight: 700;
}

.category-filter a:hover {
  color: var(--color-text);
  text-decoration: none;
}

/* Course cards */

.course-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.course-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.course-card h2, .course-card h3 {
  margin: 0;
  font-size: 1.1rem;
}

.course-card p {
  margin: 0;
  color: var(--color-text);
}

.course-categories {
  color: var(--color-muted) !important;
  font-size: 0.85rem;
}

.course-instructor {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

/* Course detail page */

.breadcrumbs {
  font-size: 0.9rem;
  color: var(--color-muted);
  margin-bottom: 1.5rem;
}

.breadcrumbs a {
  color: var(--color-muted);
}

.breadcrumbs a:hover {
  color: var(--color-accent);
}

.course-detail h1 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.course-detail .course-categories {
  margin: 0 0 1.25rem;
}

.course-detail-description {
  white-space: pre-line;
  margin-bottom: 1.75rem;
}

.similar-courses {
  margin-top: 3rem;
}

/* Footer */

.site-footer {
  text-align: center;
  padding: 3rem 2rem;
  border-top: 1px solid var(--color-border);
  margin-top: 3rem;
}

.footer-note {
  color: var(--color-muted);
  max-width: 480px;
  margin: 0 auto 1.25rem;
}

@media (max-width: 600px) {
  main {
    padding: 1.5rem 1rem;
  }

  .hero h1 {
    font-size: 1.5rem;
  }
}
