:root {
  --ink: #0f2744;
  --muted: #5b7592;
  --line: #cfe0f3;
  --line-2: #e4eefa;
  --bg: #f2f7fd;
  --card: #ffffff;
  --accent: #4374c6;
  --accent-deep: #2f5aa0;
  --accent-soft: #dce9f9;
  --ok: #1f8a5b;
  --warn: #a33a2b;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(25, 60, 105, .08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(900px 500px at 15% -10%, #e2efff 0%, transparent 60%),
    radial-gradient(700px 420px at 100% 0%, #e9f3ff 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-deep); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px clamp(14px, 4vw, 34px);
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-2);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
}

.mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #5d93dd, #2f5aa0);
  color: #fff;
  flex: none;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong { font-size: 13px; letter-spacing: .14em; }
.brand-text span { font-size: 11px; color: var(--muted); }

.top-actions { display: flex; align-items: center; gap: 10px; }
.top-actions .link { text-decoration: none; font-size: 13px; font-weight: 600; color: var(--muted); }

.wrap { width: min(980px, 100%); margin: 0 auto; padding: 0 clamp(14px, 4vw, 30px); }

.hero { padding: clamp(28px, 7vw, 64px) 0 26px; }

.eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-deep);
  background: var(--accent-soft);
  padding: 5px 10px;
  border-radius: 999px;
}

.hero h1 {
  margin: 12px 0 10px;
  font-size: clamp(30px, 6.2vw, 52px);
  line-height: 1.04;
  letter-spacing: -.03em;
  font-weight: 800;
}

.hero h1 em { font-style: normal; color: var(--accent); }

.hero p {
  margin: 0;
  max-width: 56ch;
  color: var(--muted);
  font-size: clamp(15px, 2.4vw, 17px);
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 13px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.btn.primary { background: linear-gradient(135deg, #5d93dd, #2f5aa0); color: #fff; box-shadow: 0 8px 22px rgba(47, 90, 160, .22); }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn.small { min-height: 38px; padding: 0 13px; font-size: 13px; border-radius: 11px; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
  max-width: 520px;
}

.hero-stats div {
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 15px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

.hero-stats strong { display: block; font-size: 22px; letter-spacing: -.02em; }
.hero-stats span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

.join-card {
  margin: 10px 0 30px;
  padding: clamp(18px, 4vw, 26px);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #f7fbff);
  box-shadow: var(--shadow);
}

.join-card h2 { margin: 0 0 6px; font-size: clamp(20px, 3.6vw, 26px); letter-spacing: -.02em; }
.note { color: var(--muted); margin: 0; font-size: 14px; }

.join-card form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 14px; }

.field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 240px; }
.field label { font-size: 12px; font-weight: 700; color: var(--muted); }

.field input {
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font: inherit;
  color: var(--ink);
  outline: none;
}

.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(67, 116, 198, .14); }

.progress { height: 10px; border-radius: 999px; background: var(--accent-soft); overflow: hidden; margin: 14px 0 12px; }
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #5d93dd, #2f5aa0); border-radius: inherit; transition: width .25s ease; }

.modules { display: grid; gap: 16px; padding-bottom: 10px; }

.module {
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: clamp(14px, 3vw, 22px);
  box-shadow: var(--shadow);
}

.module-head { display: flex; align-items: flex-start; gap: 12px; }

.module-n {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .04em;
}

.module-head h2 { margin: 2px 0 4px; font-size: clamp(19px, 3.2vw, 23px); letter-spacing: -.02em; }
.module-head p { margin: 0; color: var(--muted); font-size: 14px; max-width: 60ch; }

.module-count {
  margin-left: auto;
  flex: none;
  font-size: 12px;
  font-weight: 800;
  color: var(--accent-deep);
  background: #f2f8ff;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 4px 10px;
}

.lesson { border-top: 1px solid var(--line-2); margin-top: 14px; }
.lesson summary {
  list-style: none;
  cursor: pointer;
  padding: 13px 2px 13px 30px;
  position: relative;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
}
.lesson summary::-webkit-details-marker { display: none; }
.lesson summary::before {
  content: "+";
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 14px;
  font-weight: 800;
}
.lesson[open] summary::before { content: "−"; }
.lesson.is-done summary::after {
  content: "✓ vista";
  margin-left: 8px;
  font-size: 10px;
  font-weight: 800;
  color: var(--ok);
  letter-spacing: .04em;
}

.lesson-body { padding: 0 4px 16px 30px; color: #26415f; font-size: 15px; }
.lesson-body p { margin: 0 0 10px; }
.lesson-body ul, .lesson-body ol { margin: 0 0 10px; padding-left: 20px; }
.lesson-body li { margin-bottom: 6px; }
.lesson-body code { background: #eef5ff; border-radius: 6px; padding: 1px 5px; font-size: .92em; }
.lesson-body .warn {
  background: #fff4f1;
  border-left: 3px solid var(--warn);
  padding: 10px 12px;
  border-radius: 10px;
  color: #7a2a1e;
  font-size: 14px;
}

.closing {
  margin: 22px 0 34px;
  padding: clamp(18px, 4vw, 28px);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #1d3f6d, #2f5aa0);
  color: #eaf3ff;
}
.closing h2 { margin: 0 0 6px; color: #fff; letter-spacing: -.02em; }
.closing p { margin: 0; color: #cfe1f7; max-width: 60ch; }
.closing a { color: #fff; }
.closing .hero-actions { margin-top: 16px; }
.closing .btn.ghost { background: transparent; border-color: rgba(255,255,255,.35); color: #fff; }

.foot {
  border-top: 1px solid var(--line-2);
  padding: 22px clamp(14px, 4vw, 30px) 30px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.foot p { margin: 0 0 8px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.foot-links a { color: var(--muted); text-decoration: none; font-weight: 600; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translate(-50%, 12px);
  background: #12345a;
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 40;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 620px) {
  .top-actions .link { display: none; }
  .module-head { flex-wrap: wrap; }
  .module-count { margin-left: 54px; }
  .hero-stats { grid-template-columns: repeat(3, 1fr); }
  .hero-stats strong { font-size: 19px; }
}
