:root {
  --bg: #f5f7fa;
  --ink: #101b2b;
  --muted: #657181;
  --line: rgba(16, 27, 43, 0.12);
  --panel: #ffffff;
  --soft: #eef4f8;
  --dark: #0e1b2a;
  --green: #047b68;
  --gold: #d39528;
  --blue: #2f6fdb;
  --rose: #bf5d69;
  --radius: 8px;
  --shadow: 0 18px 46px rgba(16, 27, 43, 0.14);
  --hero-image: url("https://images.unsplash.com/photo-1523240795612-9a054b0db644?auto=format&fit=crop&w=1400&q=80");
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(47, 111, 219, 0.08), transparent 320px),
    linear-gradient(90deg, rgba(4, 123, 104, 0.05), transparent 44%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(14, 27, 42, 0.9);
  backdrop-filter: blur(14px);
}

.nav {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #f8fbff;
  font-size: 15px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
  color: #8df2d9;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 800;
}

.nav-links a {
  transition: color 150ms ease;
}

.nav-links a:hover {
  color: #8df2d9;
}

.hero {
  display: grid;
  gap: 14px;
  min-height: 236px;
  margin-top: 18px;
  overflow: hidden;
  align-items: end;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(10, 20, 32, 0.9), rgba(10, 20, 32, 0.68) 48%, rgba(10, 20, 32, 0.18)),
    var(--hero-image);
  background-position: center;
  background-size: cover;
  box-shadow: var(--shadow);
}

.hero-copy {
  display: grid;
  gap: 14px;
  max-width: 720px;
}

h1 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(38px, 5vw, 62px);
  line-height: 1;
  letter-spacing: 0;
}

.lead {
  max-width: 560px;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 15px;
  line-height: 1.55;
}

.route-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.route-card {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.13);
  color: #ffffff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(10px);
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.route-card:hover {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.route-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: var(--radius);
  background: rgba(141, 242, 217, 0.16);
  color: #8df2d9;
}

.route-card[data-filter-link="tutorial"] .route-icon {
  background: rgba(167, 197, 255, 0.18);
  color: #b8ccff;
}

.route-card h2 {
  margin: 0;
  font-size: 13px;
  line-height: 1.25;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  position: relative;
  z-index: 2;
  margin-top: -22px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 38px rgba(16, 27, 43, 0.11);
  backdrop-filter: blur(14px);
}

.search-box {
  position: relative;
}

.search-box i {
  position: absolute;
  left: 13px;
  top: 50%;
  color: var(--muted);
  transform: translateY(-50%);
}

.search-box input {
  width: 100%;
  min-height: 42px;
  padding: 0 14px 0 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fafdff;
  color: var(--ink);
  outline: none;
}

.search-box input:focus {
  border-color: rgba(47, 111, 219, 0.42);
  box-shadow: 0 0 0 3px rgba(47, 111, 219, 0.1);
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.filter {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fafdff;
  color: #31413c;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.filter:hover {
  border-color: rgba(47, 111, 219, 0.32);
  transform: translateY(-1px);
}

.filter.active {
  border-color: transparent;
  background: var(--dark);
  color: #fff;
}

.section {
  padding: 0 0 34px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 16px 0 10px;
}

.section-head h2 {
  margin: 4px 0 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.1;
}

.catalog {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.catalog-column {
  display: grid;
  gap: 10px;
}

.catalog-column[hidden],
.program[hidden] {
  display: none;
}

.column-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  padding: 0 4px;
}

.column-title h3 {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 17px;
}

.column-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.program-list {
  display: grid;
  gap: 9px;
}

.program {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  min-height: 116px;
  overflow: hidden;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  box-shadow: 0 12px 32px rgba(16, 27, 43, 0.07);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.program::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--green);
}

.program[data-type="tutorial"]::before {
  background: var(--blue);
}

.program:hover {
  border-color: rgba(47, 111, 219, 0.24);
  box-shadow: 0 16px 38px rgba(16, 27, 43, 0.1);
  transform: translateY(-2px);
}

.program-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: var(--radius);
  background: rgba(4, 123, 104, 0.1);
  color: var(--green);
}

.program[data-type="tutorial"] .program-icon {
  background: rgba(47, 111, 219, 0.1);
  color: var(--blue);
}

.program-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.program h4 {
  margin: 0;
  font-size: 18px;
  line-height: 1.24;
}

.program p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.48;
}

.meta {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--soft);
  color: #40514c;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.status {
  background: rgba(8, 120, 101, 0.1);
  color: var(--green);
}

.status.draft {
  background: rgba(216, 157, 51, 0.15);
  color: #835b12;
}

.status.coming {
  background: rgba(191, 93, 105, 0.13);
  color: #92414c;
}

.program-action {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--dark), #1e4c85);
  color: #fff;
}

.program-action.disabled {
  background: #dfe7e3;
  color: #687771;
  pointer-events: none;
}

.empty-state {
  display: none;
  margin-top: 12px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.load-error {
  display: block;
  border-style: solid;
  color: #92414c;
}

footer {
  padding: 28px 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 920px) {
  .catalog {
    grid-template-columns: 1fr;
  }

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

  .filters {
    justify-content: flex-start;
  }
}

@media (max-width: 680px) {
  .nav {
    align-items: start;
    flex-direction: column;
    padding: 12px 0;
  }

  .nav-links {
    gap: 10px;
    overflow-x: auto;
    width: 100%;
    padding-bottom: 2px;
    white-space: nowrap;
  }

  .hero {
    min-height: 250px;
    padding: 20px;
  }

  .program {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .program-action {
    grid-column: 2;
    width: 100%;
  }
}
