:root {
  --b24-blue: #0f62fe;
  --b24-blue-dark: #0a3d91;
  --b24-orange: #ff7a1a;
  --b24-orange-soft: #ffe3cc;
  --ink: #101828;
  --ink-soft: #475467;
  --paper: #f6f7fb;
  --card: #ffffff;
  --line: #e6e8f0;
  --green: #12b76a;
  --green-soft: #d9f7e8;
  --radius: 20px;
  --shadow: 0 20px 50px -20px rgba(16, 24, 40, 0.25);
  --font-display: "Unbounded", sans-serif;
  --font-body: "Manrope", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(15, 98, 254, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(255, 122, 26, 0.10), transparent 55%),
    var(--paper);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}

/* ===== Topbar ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 40px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--b24-blue), var(--b24-blue-dark));
  color: #fff;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 15px;
  box-shadow: 0 8px 20px -6px rgba(15, 98, 254, 0.5);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 16px; font-weight: 800; }
.brand-text span { font-size: 12px; color: var(--ink-soft); }

.topbar-progress { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.progress-label { font-weight: 800; font-size: 14px; color: var(--b24-blue); min-width: 38px; text-align: right; }
.progress-track { width: 180px; height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--b24-blue), var(--b24-orange));
  transition: width 0.5s ease;
}
.reset-btn {
  border: 1px solid var(--line);
  background: #fff;
  width: 38px; height: 38px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
  color: var(--ink-soft);
  transition: all 0.2s;
}
.reset-btn:hover { border-color: var(--b24-orange); color: var(--b24-orange); transform: rotate(-20deg); }

/* ===== Hero ===== */
.hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 72px 40px 56px;
}

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--b24-orange);
  background: var(--b24-orange-soft);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--b24-blue), var(--b24-orange));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub { margin-top: 20px; font-size: 17px; color: var(--ink-soft); max-width: 520px; }
.hero-sub strong { color: var(--ink); }

.hero-actions { margin-top: 32px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.hero-note { font-size: 14px; color: var(--ink-soft); }

.btn {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  border: none;
  cursor: pointer;
  border-radius: 14px;
  padding: 14px 24px;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--b24-blue), var(--b24-blue-dark));
  color: #fff;
  box-shadow: 0 12px 24px -8px rgba(15, 98, 254, 0.5);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -8px rgba(15, 98, 254, 0.6); }
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--b24-blue); color: var(--b24-blue); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* Hero art */
.hero-art { position: relative; height: 320px; }
.orb { position: absolute; border-radius: 50%; filter: blur(2px); }
.orb-1 { width: 220px; height: 220px; top: 10px; right: 20px; background: radial-gradient(circle at 30% 30%, rgba(15,98,254,0.35), rgba(15,98,254,0.05)); animation: float 7s ease-in-out infinite; }
.orb-2 { width: 160px; height: 160px; bottom: 0; left: 10px; background: radial-gradient(circle at 30% 30%, rgba(255,122,26,0.35), rgba(255,122,26,0.05)); animation: float 9s ease-in-out infinite reverse; }

.card-stack { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 16px; }
.mini-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 20px;
  font-weight: 700;
  box-shadow: var(--shadow);
  width: 240px;
  animation: float 6s ease-in-out infinite;
}
.mini-card:nth-child(2) { margin-left: 60px; animation-delay: 0.6s; }
.mini-card:nth-child(3) { margin-left: 120px; animation-delay: 1.2s; }
.mini-ico { font-size: 22px; }
.mini-chat { border-left: 5px solid var(--b24-blue); }
.mini-task { border-left: 5px solid var(--green); }
.mini-proj { border-left: 5px solid var(--b24-orange); }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* ===== Modules ===== */
.modules {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 40px 80px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.module {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: rise 0.6s ease both;
}
.module:nth-child(2) { animation-delay: 0.12s; }
.module:nth-child(3) { animation-delay: 0.24s; }
.module:hover { transform: translateY(-6px); box-shadow: 0 30px 60px -24px rgba(16, 24, 40, 0.3); }

@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.module-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.module-ico {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  font-size: 26px;
  border-radius: 16px;
}
.module-ico.chat { background: var(--b24-blue); box-shadow: 0 10px 20px -6px rgba(15,98,254,0.5); }
.module-ico.task { background: var(--green); box-shadow: 0 10px 20px -6px rgba(18,183,106,0.5); }
.module-ico.proj { background: var(--b24-orange); box-shadow: 0 10px 20px -6px rgba(255,122,26,0.5); }

.module-badge {
  font-size: 12px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--line);
  color: var(--ink-soft);
}
.module-badge.done { background: var(--green-soft); color: var(--green); }

.module h2 { font-family: var(--font-display); font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.module-desc { color: var(--ink-soft); font-size: 14px; margin-bottom: 20px; }

.lesson-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.lesson-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  background: #fff;
  transition: all 0.2s;
  text-align: left;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
}
.lesson-item:hover { border-color: var(--b24-blue); background: #f4f8ff; }
.lesson-check {
  width: 24px; height: 24px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid var(--line);
  display: grid; place-items: center;
  font-size: 13px;
  color: transparent;
  transition: all 0.2s;
}
.lesson-item.done .lesson-check { background: var(--green); border-color: var(--green); color: #fff; }
.lesson-item.done { opacity: 0.75; }

.module-foot { margin-top: auto; }
.module-progress { font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-bottom: 8px; }
.module-track { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.module-fill { height: 100%; border-radius: 999px; transition: width 0.4s ease; }
.module-fill.chat { background: var(--b24-blue); }
.module-fill.task { background: var(--green); }
.module-fill.proj { background: var(--b24-orange); }

/* ===== Modal ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(16, 24, 40, 0.55);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 24px;
  animation: fade 0.2s ease;
}
.modal-backdrop[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  position: relative;
  width: 100%;
  max-width: 760px;
  max-height: 88vh;
  background: var(--card);
  border-radius: 24px;
  box-shadow: 0 40px 80px -20px rgba(16, 24, 40, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: pop 0.25s ease;
}
@keyframes pop { from { transform: translateY(20px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 15px;
  color: var(--ink-soft);
  z-index: 2;
  transition: all 0.2s;
}
.modal-close:hover { background: var(--ink); color: #fff; }

.modal-head {
  padding: 32px 40px 20px;
  border-bottom: 1px solid var(--line);
}
.modal-module {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--b24-orange);
  margin-bottom: 8px;
  display: block;
}
.modal-head h2 { font-family: var(--font-display); font-size: 24px; font-weight: 700; }

.modal-body {
  padding: 28px 40px;
  overflow-y: auto;
  flex: 1;
}
.modal-body h3 { font-size: 17px; font-weight: 800; margin: 22px 0 10px; }
.modal-body h3:first-child { margin-top: 0; }
.modal-body p { color: var(--ink-soft); margin-bottom: 12px; }
.modal-body ul, .modal-body ol { margin: 0 0 14px 20px; color: var(--ink-soft); }
.modal-body li { margin-bottom: 6px; }
.modal-body strong { color: var(--ink); }

.step {
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
  align-items: flex-start;
}
.step-num {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 10px;
  background: var(--b24-blue);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  display: grid; place-items: center;
}
.step p { margin: 0; padding-top: 4px; }

.tip {
  background: var(--b24-orange-soft);
  border-left: 4px solid var(--b24-orange);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 16px 0;
  font-size: 14px;
  color: #7a3a00;
}
.tip strong { color: #5a2a00; }

.media-slot {
  border: 2px dashed var(--line);
  border-radius: 16px;
  padding: 28px;
  text-align: center;
  color: var(--ink-soft);
  margin: 18px 0;
  background: #fafbfe;
  font-size: 14px;
}
.media-slot .slot-ico { font-size: 30px; display: block; margin-bottom: 8px; }
.media-slot .slot-hint { font-size: 12px; color: #98a2b3; margin-top: 4px; }

.media-figure {
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 24px -12px rgba(16, 24, 40, 0.2);
}
.media-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-bottom: 1px solid var(--line);
}
.media-figure figcaption {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--ink-soft);
  background: #fafbfe;
}

.modal-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 40px;
  border-top: 1px solid var(--line);
  background: #fafbfe;
}

/* ===== Footer ===== */
.footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 40px 48px;
  color: var(--ink-soft);
  font-size: 13px;
  border-top: 1px solid var(--line);
}
.footer-live { font-weight: 700; }
.footer-live.ok { color: var(--green); }
.footer-live.off { color: var(--b24-orange); }

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; padding-top: 48px; }
  .hero-art { display: none; }
  .modules { grid-template-columns: 1fr; }
  .topbar { padding: 14px 20px; }
  .progress-track { width: 100px; }
  .modal-head, .modal-body, .modal-foot { padding-left: 24px; padding-right: 24px; }
}
