/* ==========================================================
   COURSES — a catalog with a filter rail, not a landing page.
   Each track owns one accent colour so scanning is instant.
   ========================================================== */
body[data-page="courses"] { background: #f6f9ff; }

:root {
  --t-cse: #1f6ff2; --t-cse-bg: #e3edff;
  --t-aiml: #6a4bf0; --t-aiml-bg: #ece8ff;
  --t-ece: #0b9aa0; --t-ece-bg: #dcf5f4;
  --t-eee: #d98a00; --t-eee-bg: #fff0d1;
  --t-tools: #3b4f78; --t-tools-bg: #e6ebf5;
}

/* ---------- hero ---------- */
.chero { position: relative; overflow: hidden; color: #fff; padding-block: clamp(44px, 7vw, 96px) clamp(52px, 7vw, 100px);
  background: radial-gradient(760px 480px at 88% 20%, rgba(24, 180, 255, .24), transparent 62%), radial-gradient(560px 380px at 0% 100%, rgba(31, 111, 242, .22), transparent 62%), var(--night); }
.chero::before { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(rgba(127, 214, 255, .2) 1px, transparent 1.4px); background-size: 28px 28px; -webkit-mask-image: linear-gradient(180deg, #000, transparent 88%); mask-image: linear-gradient(180deg, #000, transparent 88%); opacity: .5; }
.chero__grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.chero__pill { display: inline-flex; align-items: center; gap: 10px; padding: 8px 15px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(127, 214, 255, .28); color: #cfe0ff; font-weight: 700; font-size: 14px; }
.chero h1 { color: #fff; margin-top: 24px; font-size: clamp(2.5rem, 5.8vw, 4.9rem); line-height: 1; letter-spacing: -.04em; font-weight: 800; max-width: 13ch; }
.chero__lead { margin-top: 22px; max-width: 52ch; color: #a9bbdd; font-size: clamp(17px, 1.5vw, 19px); }
.chero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.chero__facts { display: flex; flex-wrap: wrap; gap: 14px 36px; margin-top: 40px; padding-top: 24px; border-top: 1px solid rgba(127, 214, 255, .18); }
.chero__facts li { display: flex; align-items: baseline; gap: 10px; }
.chero__facts b { font-family: var(--f-display); font-size: 1.7rem; letter-spacing: -.03em; color: #fff; line-height: 1; }
.chero__facts span { color: #a9bbdd; font-size: 14px; font-weight: 600; }
.chero__copy > * { animation: crise .7s cubic-bezier(.2, .7, .2, 1) both; }
.chero__copy > :nth-child(2) { animation-delay: .06s; } .chero__copy > :nth-child(3) { animation-delay: .12s; } .chero__copy > :nth-child(4) { animation-delay: .18s; } .chero__copy > :nth-child(5) { animation-delay: .24s; }
@keyframes crise { from { opacity: 0; transform: translateY(16px); } }
.chero__art { position: relative; }
.chero__art::before { content: ""; position: absolute; width: 520px; height: 330px; right: -170px; top: -90px; border-radius: 50%; border: 1.5px dashed rgba(127, 214, 255, .3); transform: rotate(-14deg); pointer-events: none; }
.route { position: relative; display: grid; gap: 14px; padding: 26px; border-radius: 26px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(127, 214, 255, .22); box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .7); backdrop-filter: blur(6px); }
.route::before { content: ""; position: absolute; left: 51px; top: 52px; bottom: 52px; border-left: 2px dashed rgba(127, 214, 255, .4); }
.route__step { position: relative; display: flex; align-items: center; gap: 16px; padding: 14px 16px; border-radius: 16px; background: rgba(255, 255, 255, .07); transition: transform .2s, background-color .2s; }
.route__step:hover { transform: translateX(4px); background: rgba(255, 255, 255, .11); }
.route__ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; background: linear-gradient(135deg, var(--sky), var(--blue)); color: #fff; box-shadow: 0 10px 20px -10px rgba(24, 180, 255, .9); position: relative; z-index: 1; }
.route__step b { display: block; color: #fff; font-family: var(--f-display); font-size: 1.1rem; letter-spacing: -.02em; }
.route__step small { color: #a9bbdd; font-size: 13.5px; font-weight: 600; }
.route__step--end .route__ic { background: linear-gradient(135deg, #3ddc97, #12a672); box-shadow: 0 10px 20px -10px rgba(61, 220, 151, .9); }

/* ---------- search band ---------- */
.catsearch { background: #fff; border-bottom: 1px solid var(--line); padding-block: clamp(32px, 4.5vw, 52px); }
.catsearch__in { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px 56px; align-items: center; }
.catsearch h2 { font-size: clamp(1.9rem, 3.8vw, 3rem); letter-spacing: -.035em; }
.catsearch p { margin-top: 10px; color: var(--muted); max-width: 46ch; }
.search { position: relative; display: flex; align-items: center; gap: 12px; height: 62px; padding: 0 16px; border-radius: 18px; background: #fff; border: 2px solid var(--line); box-shadow: var(--shadow-1); transition: border-color .18s, box-shadow .18s; }
.search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 5px rgba(31, 111, 242, .12), var(--shadow-1); }
.search > .ic, .search > span > .ic { color: var(--muted); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font-size: 17px; font-weight: 600; color: var(--ink); }
.search input::placeholder { color: #8a9bbd; font-weight: 500; }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd { font-family: var(--f-mono); font-size: 13px; font-weight: 500; padding: 3px 9px; border-radius: 7px; background: var(--ice); border: 1px solid var(--line); color: var(--muted); }
.search:focus-within kbd { display: none; }
.search__clear { width: 34px; height: 34px; border-radius: 10px; border: 0; background: var(--ice); color: var(--ink); display: grid; place-items: center; }

/* ---------- layout ---------- */
.cat { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: clamp(24px, 3vw, 44px); padding-block: 36px clamp(56px, 7vw, 88px); align-items: start; }
.side { position: sticky; top: calc(var(--nav-h) + 20px); display: grid; gap: 28px; }
.side__h { font-family: var(--f-body); font-size: 14px; font-weight: 800; color: var(--muted); letter-spacing: 0; margin-bottom: 10px; }
.side__list { display: grid; gap: 4px; }
.fbtn { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 11px 14px; border-radius: 12px; border: 1.5px solid transparent; background: none; font-weight: 700; font-size: 15px; color: var(--text); transition: background-color .15s, border-color .15s, color .15s; }
.fbtn i { width: 10px; height: 10px; border-radius: 3px; background: var(--c, var(--blue)); flex: none; }
.fbtn small { margin-left: auto; font-size: 13px; font-weight: 800; color: var(--muted); }
.fbtn:hover { background: #fff; }
.fbtn[aria-pressed="true"] { background: #fff; border-color: var(--ink); color: var(--ink); box-shadow: var(--shadow-1); }
.fbtn[aria-pressed="true"] small { color: var(--ink); }
.side__help { display: flex; gap: 12px; padding: 16px; border-radius: 16px; background: var(--ink); color: #c9d7f2; font-size: 14px; }
.side__help .ic { color: var(--sky); margin-top: 2px; }
.linkbtn { background: none; border: 0; padding: 0; color: #fff; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.linkbtn:hover { color: var(--sky-2); }

/* ---------- toolbar ---------- */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.bar__count { font-weight: 700; color: var(--ink); font-size: 17px; }
.bar__count span { color: var(--muted); font-weight: 600; }
.bar__tools { display: flex; align-items: center; gap: 10px; }
.sel { position: relative; display: block; }
.sel select { appearance: none; -webkit-appearance: none; height: 44px; padding: 0 40px 0 16px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font-weight: 700; font-size: 14px; color: var(--ink); }
.sel .ic { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--muted); }
.view { display: inline-flex; padding: 4px; border-radius: 12px; background: #fff; border: 1.5px solid var(--line); }
.view button { width: 36px; height: 34px; border: 0; border-radius: 8px; background: none; color: var(--muted); display: grid; place-items: center; }
.view button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.cc {
  --c: var(--t-cse); --bg: var(--t-cse-bg);
  position: relative; display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: 20px; background: #fff; border: 1.5px solid var(--line);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.cc[data-b="aiml"] { --c: var(--t-aiml); --bg: var(--t-aiml-bg); }
.cc[data-b="ece"] { --c: var(--t-ece); --bg: var(--t-ece-bg); }
.cc[data-b="eee"] { --c: var(--t-eee); --bg: var(--t-eee-bg); }
.cc[data-b="tools"] { --c: var(--t-tools); --bg: var(--t-tools-bg); }
.cc:hover { transform: translateY(-4px); border-color: var(--c); box-shadow: 0 22px 40px -26px var(--c); }
.cc__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cc__ic { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; background: var(--bg); color: var(--c); }
.cc__tag { font-size: 12.5px; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: var(--bg); color: var(--c); }
.cc h3 { font-size: 21px; letter-spacing: -.02em; line-height: 1.15; }
.cc__s { color: var(--muted); font-size: 14.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cc__meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: auto; padding-top: 14px; border-top: 1px dashed var(--line); font-size: 13.5px; font-weight: 700; color: var(--ink); }
.cc__meta span { display: inline-flex; align-items: center; gap: 6px; }
.cc__meta .ic { color: var(--c); }
.cc__go { display: flex; align-items: center; justify-content: space-between; height: 44px; padding: 0 16px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 800; font-size: 14.5px; transition: background-color .18s; }
.cc:hover .cc__go { background: var(--c); }
.cc__go .ic { transition: transform .18s; }
.cc:hover .cc__go .ic { transform: translateX(4px); }
.cc > a.cc__link { position: absolute; inset: 0; border-radius: 20px; z-index: 1; }
.cc > a.cc__link:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }

/* list view */
.grid.is-list { grid-template-columns: 1fr; gap: 10px; }
.grid.is-list .cc { display: grid; grid-template-columns: 52px minmax(0, 1.2fr) minmax(0, 1.4fr) auto auto; align-items: center; gap: 18px; padding: 14px 18px; border-radius: 16px; }
.grid.is-list .cc__top { display: contents; }
.grid.is-list .cc__tag { display: none; }
.grid.is-list .cc h3 { font-size: 18px; grid-column: 2; grid-row: 1; }
.grid.is-list .cc__s { grid-column: 3; -webkit-line-clamp: 1; }
.grid.is-list .cc__meta { margin: 0; padding: 0; border: 0; grid-column: 4; flex-wrap: nowrap; white-space: nowrap; }
.grid.is-list .cc__go { grid-column: 5; height: 40px; }
.grid.is-list .cc__ic { grid-column: 1; grid-row: 1; width: 48px; height: 48px; }

/* empty */
.empty { grid-column: 1 / -1; text-align: center; padding: 64px 20px; border: 2px dashed var(--line); border-radius: 22px; background: #fff; }
.empty h3 { font-size: 24px; margin-bottom: 8px; }
.empty p { color: var(--muted); margin-bottom: 22px; }

/* ---------- ask band ---------- */
.ask { background: var(--ink); color: #fff; padding-block: clamp(40px, 6vw, 64px); }
.ask__in { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.ask h2 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -.03em; }
.ask p { color: #a9bbdd; margin-top: 8px; max-width: 52ch; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .grid.is-list .cc { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .grid.is-list .cc__s, .grid.is-list .cc__meta { display: none; }
  .grid.is-list .cc__go { grid-column: 3; }
}
@media (max-width: 900px) {
  .chero__grid, .catsearch__in { grid-template-columns: minmax(0, 1fr); }
  .cat { grid-template-columns: minmax(0, 1fr); padding-top: 22px; }
  .side { position: static; gap: 14px; }
  .side__group { min-width: 0; }
  .side__h { margin-bottom: 8px; }
  .side__list { display: flex; gap: 8px; overflow-x: auto; padding: 2px var(--gut) 8px; margin-inline: calc(var(--gut) * -1); scrollbar-width: none; }
  .side__list::-webkit-scrollbar { display: none; }
  .fbtn { width: auto; flex: none; white-space: nowrap; background: #fff; border-color: var(--line); padding: 10px 14px; }
  .side__help { display: none; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .search { height: 56px; border-radius: 16px; }
  .search kbd { display: none; }
  .bar { flex-direction: column; align-items: stretch; }
  .bar__tools { justify-content: space-between; }
  .ask__in .btn { width: 100%; }
  .grid.is-list .cc { padding: 12px 14px; gap: 12px; }
  .grid.is-list .cc__go { font-size: 0; padding: 0 12px; gap: 0; }
}
