:root {
  --blue: #1d2fb8;
  --blue-deep: #12206b;
  --yellow: #ffd400;
  --pink: #ff8fc4;
  --ink: #14162e;
  --paper: #fffdf6;
  --card: #ffffff;
  --radius: 20px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
}

h1, h2, h3, .section-title, .badge, .pill {
  font-family: "Unbounded", -apple-system, sans-serif;
}

a { color: inherit; }

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

/* Header */
.site-header {
  background: var(--blue);
  color: #fff;
  padding: 48px 20px 56px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.site-header::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -60px;
  width: 200px;
  height: 200px;
  background: var(--yellow);
  border-radius: 40%;
  transform: rotate(20deg);
  opacity: 0.9;
}
.site-header h1 {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  margin: 0 0 10px;
  position: relative;
}
.site-header p {
  font-size: 16px;
  opacity: 0.85;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}
.back-link {
  display: inline-block;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  opacity: 0.85;
}
.back-link:hover { opacity: 1; }

/* Theme grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: -32px;
  position: relative;
}
.theme-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 8px 24px rgba(18, 32, 107, 0.12);
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.15s ease;
}
.theme-card:not(.locked):hover { transform: translateY(-4px); }
.theme-card.locked {
  opacity: 0.55;
  pointer-events: none;
}
.badge {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.4px;
}
.badge.open { background: var(--yellow); color: var(--blue-deep); }
.badge.soon { background: #eee; color: #888; }
.theme-card h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}
.theme-card .desc {
  font-size: 13px;
  color: #666;
  margin: 0;
}

/* Content sections */
.section {
  margin-top: 40px;
}
.section-title {
  font-size: 22px;
  font-weight: 900;
  text-transform: uppercase;
  background: var(--yellow);
  display: inline-block;
  padding: 6px 16px;
  border-radius: 10px;
  transform: rotate(-1deg);
  margin: 0 0 20px;
}
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 14px;
  box-shadow: 0 6px 18px rgba(18, 32, 107, 0.08);
}
.card h4 {
  margin: 0 0 10px;
  font-weight: 800;
  font-size: 16px;
}
.card ul { margin: 0; padding-left: 20px; }
.card li { margin-bottom: 6px; }
.card.blue {
  background: var(--blue);
  color: #fff;
}
.card.pink { background: #fff0f7; }
.pill-row { display: flex; gap: 10px; flex-wrap: wrap; }
.pill {
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 999px;
}

.video-frame {
  position: relative;
  padding-top: 56.25%;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
  background: #000;
}
.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.homework {
  background: var(--blue-deep);
  color: #fff;
  border-radius: var(--radius);
  padding: 24px;
}
.homework h4 { margin-top: 0; }
.homework p, .homework li { color: #e6e9ff; }

.doc-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  color: var(--blue);
  text-decoration: none;
  margin-top: 8px;
}
.doc-link:hover { text-decoration: underline; }

/* Floating chat widget */
#chat-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  border: none;
  box-shadow: 0 10px 24px rgba(18, 32, 107, 0.35);
  font-size: 24px;
  cursor: pointer;
  z-index: 999;
}
#chat-panel {
  position: fixed;
  right: 22px;
  bottom: 92px;
  width: min(340px, calc(100vw - 44px));
  height: min(460px, calc(100vh - 160px));
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 999;
}
#chat-panel.open { display: flex; }
#chat-panel .chat-head {
  background: var(--blue);
  color: #fff;
  padding: 14px 16px;
  font-weight: 800;
  font-size: 14px;
}
#chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  font-size: 13px;
}
#chat-log .msg { margin-bottom: 10px; }
#chat-log .msg.user { font-weight: 700; }
#chat-log .msg.bot { color: #333; line-height: 1.5; }
#chat-log .msg.bot p { margin: 0 0 8px; }
#chat-log .msg.bot p:last-child { margin-bottom: 0; }
#chat-log .msg.bot p.quote {
  opacity: 0.75;
  font-style: italic;
}
#chat-log .msg.bot h4 {
  font-size: 13px;
  font-weight: 800;
  margin: 10px 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}
#chat-log .msg.bot h4:first-child { margin-top: 0; }
#chat-log .msg.bot ul, #chat-log .msg.bot ol {
  margin: 0 0 8px;
  padding-left: 18px;
}
#chat-log .msg.bot li { margin-bottom: 4px; }
#chat-log .msg.bot strong { font-weight: 800; }
.chat-input-row {
  display: flex;
  border-top: 1px solid #eee;
}
.chat-input-row input {
  flex: 1;
  border: none;
  padding: 12px;
  font-size: 13px;
  outline: none;
}
.chat-input-row button {
  background: var(--yellow);
  border: none;
  font-weight: 800;
  padding: 0 16px;
  cursor: pointer;
}
