:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef0f7;
  --text: #15151f;
  --muted: #5c5c70;
  --line: #e3e4ee;
  --accent: #6247e8;
  --accent-soft: #ece8ff;
  --green: #007a52;
  --green-soft: #e4f7ee;
  --warn: #925400;
  --warn-bg: #fff4e0;
  --radius: 16px;
  --shadow: 0 8px 28px rgba(20, 20, 50, 0.07);
  --max: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e14;
    --surface: #16161f;
    --surface-2: #1e1e2a;
    --text: #f1f1f6;
    --muted: #a0a0b4;
    --line: #282838;
    --accent: #a18cff;
    --accent-soft: #221d3f;
    --green: #34d399;
    --green-soft: #10291f;
    --warn: #fbbf24;
    --warn-bg: #241a08;
    --shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.tiny { font-size: 0.82rem; }
.accent { color: var(--accent); }

/* header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(246, 247, 251, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
@media (prefers-color-scheme: dark) {
  .site-header { background: rgba(14, 14, 20, 0.88); }
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}
.brand {
  font-weight: 800;
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.brand:hover { text-decoration: none; }
.brand-mark { font-size: 1.25rem; }
.nav { display: flex; align-items: center; gap: 18px; font-size: 0.92rem; font-weight: 600; }
.nav a { color: var(--muted); }
.nav a:hover { color: var(--text); text-decoration: none; }
.nav .btn { color: #fff; }

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 20px;
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { box-shadow: 0 10px 24px rgba(98, 71, 232, 0.3); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--text); }
.btn-small { padding: 8px 14px; font-size: 0.85rem; }
.btn-block { width: 100%; margin-top: 12px; }
.btn-enroll { width: 100%; margin-top: 12px; background: var(--green); color: #fff; }

/* hero */
.hero {
  padding: 72px 0 56px;
  background:
    radial-gradient(900px 400px at 15% -10%, rgba(98, 71, 232, 0.16), transparent 60%),
    radial-gradient(700px 350px at 90% 0%, rgba(0, 122, 82, 0.12), transparent 55%);
  border-bottom: 1px solid var(--line);
}
.eyebrow {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.lede { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--muted); max-width: 62ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 14px; }

/* sections */
.section { padding: 44px 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.section-head h2 { margin: 0; }

/* course grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}
.grid-related { display: flex; flex-wrap: wrap; }
.grid-related .card { flex: 0 1 300px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}
.card-link { display: block; height: 100%; }
.card-link:hover { text-decoration: none; }
.thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--surface-2);
}
.thumb-empty { background: linear-gradient(135deg, var(--accent-soft), var(--surface-2)); }
.card-body { padding: 14px 16px 18px; }
.card-body h3 {
  font-size: 1rem;
  margin: 8px 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.meta { font-size: 0.8rem; color: var(--muted); margin: 0; }

/* badges + chips */
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
}
.badge-free { background: var(--accent-soft); color: var(--accent); }
.badge-fresh { background: var(--green-soft); color: var(--green); }
.badge-stale { background: var(--warn-bg); color: var(--warn); }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.88rem;
  font-weight: 600;
}
.chip:hover { border-color: var(--accent); text-decoration: none; }
.chip-count {
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 1px 7px;
}

/* course page */
.breadcrumb { margin-bottom: 18px; }
.course-head {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 28px;
  align-items: center;
  margin-bottom: 30px;
}
.course-head h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); }
.course-image {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.course-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(240px, 1fr);
  gap: 28px;
  align-items: start;
}

.coupon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 16px 18px;
  border: 2px dashed var(--accent);
  border-radius: var(--radius);
  background: var(--accent-soft);
  margin-bottom: 4px;
}
.coupon-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.coupon code { font-size: 1.2rem; font-weight: 800; letter-spacing: 0.04em; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}
.details {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 14px;
  margin: 0 0 6px;
  font-size: 0.9rem;
}
.details dt { color: var(--muted); }
.details dd { margin: 0; font-weight: 600; }

/* prose */
.prose { max-width: 76ch; }
.prose h2 { margin-top: 1.4em; }
.learn { padding-left: 1.2em; }
.learn li { margin-bottom: 0.4em; }
.steps { padding-left: 1.2em; }
.steps li { margin-bottom: 0.6em; }

.faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 10px;
}
.faq summary { cursor: pointer; font-weight: 700; }
.faq p { margin: 10px 0 0; color: var(--muted); }

.notice {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.notice-warn {
  background: var(--warn-bg);
  border-color: var(--warn);
  color: var(--text);
}

/* sponsor + cta */
.sponsor {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.sponsor p { margin: 0; flex: 1 1 320px; }

.cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 26px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.cta h2 { margin: 0 0 4px; }
.cta p { margin: 0; color: var(--muted); }

/* footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 0 40px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 0.9rem;
}
.footer-links a { color: var(--text); font-weight: 600; }

@media (max-width: 760px) {
  .course-head, .course-grid { grid-template-columns: 1fr; }
  .course-image { order: -1; }
  .nav a:not(.btn) { display: none; }
  .hero { padding: 48px 0 40px; }
  .section { padding: 32px 0; }
}
