:root {
  --ink: #14162b;
  --muted: #5c6079;
  --soft: #8a8ea7;
  --line: #e5e6f0;
  --bg: #f6f6fb;
  --card: #ffffff;
  --accent: #5a4ee6;
  --accent-2: #8a5cf2;
  --accent-soft: #efedfe;
  --ok: #12a26b;
  --ok-soft: #e3f6ee;
  --warn: #c76a12;
  --warn-soft: #fff1e2;
  --code: #151832;
  --code-ink: #dfe2ff;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(28, 24, 90, 0.08);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html, body { overflow-x: clip; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace; }
button { font: inherit; }

/* -- top bar ------------------------------------------------------------------------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .logo {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 6px 16px rgba(90, 78, 230, 0.35);
}
.brand small { font-weight: 500; color: var(--soft); }
.top nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; }
.top nav a {
  padding: 7px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; white-space: nowrap;
}
.top nav a:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.top nav a.on { background: var(--accent); color: #fff; }

/* -- buttons, chips ------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 12px; border: 1px solid transparent;
  background: var(--accent); color: #fff; font-weight: 600; cursor: pointer;
  transition: transform .08s ease, box-shadow .15s ease, background .15s ease;
  text-decoration: none;
}
.btn:hover { box-shadow: 0 8px 22px rgba(90, 78, 230, 0.35); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: #cfd0e3; box-shadow: none; background: #fafaff; }
.btn.small { padding: 7px 11px; border-radius: 10px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: default; box-shadow: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent);
}
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.gray { background: #eff0f5; color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }
.dot.live { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* -- landing --------------------------------------------------------------------------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.hero { padding: 64px 0 36px; position: relative; }
.hero::before {
  content: ""; position: absolute; inset: -40px -30% auto -30%; height: 520px; z-index: -1;
  background: radial-gradient(60% 60% at 70% 20%, #e6e1ff 0%, rgba(230, 225, 255, 0) 70%),
              radial-gradient(40% 50% at 15% 60%, #ffeede 0%, rgba(255, 238, 222, 0) 70%);
}
.hero h1 { font-size: clamp(30px, 5vw, 52px); line-height: 1.05; letter-spacing: -0.02em; margin: 14px 0 16px; max-width: 900px; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 18px; color: var(--muted); max-width: 760px; margin: 0; }
.hero .row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.section { padding: 34px 0; }
.section h2 { font-size: 28px; letter-spacing: -0.01em; margin: 0 0 6px; }
.section .sub { color: var(--muted); margin: 0 0 22px; max-width: 760px; }
.grid { display: grid; gap: 16px; }
.grid.v4 { grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); }
.grid.v2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); position: relative;
}
.variant { display: flex; flex-direction: column; gap: 10px; transition: transform .15s ease, box-shadow .15s ease; color: var(--ink); }
.variant:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(28, 24, 90, 0.14); text-decoration: none; }
.variant .ico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.variant h3 { margin: 4px 0 0; font-size: 18px; }
.variant p { margin: 0; color: var(--muted); font-size: 14px; flex: 1; }
.variant .go { font-weight: 600; color: var(--accent); }
.feature h3 { margin: 0 0 6px; font-size: 16px; }
.feature p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.flow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; align-items: stretch; }
.flow .step { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; font-size: 14px; }
.flow .step b { display: block; margin-bottom: 4px; }
.flow .step span { color: var(--muted); }
.foot { padding: 30px 0 50px; color: var(--soft); font-size: 13.5px; display: flex; gap: 20px; flex-wrap: wrap; justify-content: space-between; }

/* -- code ------------------------------------------------------------------------------ */
pre.code {
  margin: 0; background: var(--code); color: var(--code-ink); border-radius: 12px;
  padding: 14px 16px; font-size: 12.5px; line-height: 1.6; overflow: auto; max-height: 420px;
  white-space: pre;
}
pre.code .k { color: #ffb38a; } pre.code .s { color: #9fe3b8; } pre.code .c { color: #8389b3; } pre.code .n { color: #8ec5ff; }
.json { white-space: pre-wrap; word-break: break-word; }

/* -- the variant page -------------------------------------------------------------------- */
.page { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 18px; padding: 18px 24px 30px; max-width: 1640px; margin: 0 auto; }
.title { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.title h1 { margin: 0; font-size: 26px; letter-spacing: -0.01em; }
.title p { margin: 4px 0 0; color: var(--muted); max-width: 820px; }
.stage { min-width: 0; }
.browser {
  background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow);
}
.browser .bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #f3f3f9; border-bottom: 1px solid var(--line); }
.browser .bar i { width: 11px; height: 11px; border-radius: 50%; background: #e2e2ee; display: inline-block; }
.browser .bar .url {
  flex: 1; background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 5px 10px;
  font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.site { display: grid; grid-template-columns: 210px minmax(0, 1fr); min-height: 640px; }
.site aside { background: #fbfbfe; border-right: 1px solid var(--line); padding: 16px 12px; font-size: 13.5px; }
.site aside h4 { margin: 0 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--soft); }
.site aside a { display: block; padding: 7px 10px; border-radius: 9px; color: var(--muted); }
.site aside a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.site main { padding: 14px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.site main h2 { margin: 0; font-size: 18px; }
.site main .hint { color: var(--muted); font-size: 13px; margin: 0; }
.slot { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #fafaff; min-height: 560px; position: relative; }
.slot iframe { display: block; width: 100%; height: 72vh; min-height: 560px; border: 0; }
.slot .placeholder { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 24px; }
.landing-site { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 22px; padding: 22px; background: #fbf7f2; min-height: 640px; }
.landing-site h2 { font-size: 26px; line-height: 1.15; margin: 10px 0; }
.landing-site p { color: #6f655a; font-size: 14px; }
.landing-site .tag { display: inline-block; background: #ffe3c7; color: #a2531a; border-radius: 999px; padding: 3px 12px; font-size: 12.5px; font-weight: 600; }

.panel { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.invite .link { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.invite input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; font-size: 12.5px; color: var(--muted); background: #fafaff; }
.invite .qr { display: flex; gap: 14px; align-items: center; margin-top: 12px; }
.invite .qr #qr { width: 112px; height: 112px; flex: none; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.invite .qr #qr img, .invite .qr #qr canvas { width: 100% !important; height: 100% !important; }
.invite .qr p { margin: 0; font-size: 13px; color: var(--muted); }
.timer { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.timer b { color: var(--ink); font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: 4px; padding: 4px; background: #eff0f6; border-radius: 12px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 8px 6px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(20, 20, 60, .08); }
.tabs .count[hidden] { display: none; }
.tabs .count { min-width: 18px; padding: 0 5px; height: 18px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; display: inline-grid; place-items: center; }
.tab { display: none; flex-direction: column; gap: 10px; }
.tab.on { display: flex; }
.tab .explain { font-size: 13px; color: var(--muted); margin: 0; }
.feed { display: flex; flex-direction: column; gap: 8px; max-height: 56vh; overflow: auto; }
.item { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; animation: slide .25s ease; }
@keyframes slide { from { opacity: 0; transform: translateY(-4px); } }
.item .head { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.item .name { font-weight: 700; font-size: 13.5px; font-family: "JetBrains Mono", ui-monospace, monospace; }
.item .when { font-size: 12px; color: var(--soft); }
.item .what { font-size: 13px; color: var(--muted); margin: 4px 0 6px; }
.item pre { margin: 0; font-size: 12px; background: #f7f7fc; border-radius: 8px; padding: 8px 10px; white-space: pre-wrap; word-break: break-word; color: #34385a; }
.empty { border: 1px dashed #d8d9e7; border-radius: 12px; padding: 18px; color: var(--soft); font-size: 13.5px; text-align: center; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.result img { max-width: 100%; border-radius: 10px; border: 1px solid var(--line); display: block; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: #f7f7fc; border-radius: 10px; padding: 8px 10px; }
.stat b { display: block; font-size: 18px; }
.stat span { font-size: 12px; color: var(--muted); }
.toast {
  position: fixed; right: 18px; bottom: 18px; z-index: 50; max-width: 380px;
  background: var(--ink); color: #fff; padding: 12px 14px; border-radius: 12px; font-size: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .25); opacity: 0; transform: translateY(8px); transition: all .2s ease; pointer-events: none;
}
.toast.on { opacity: 1; transform: none; }
.mode { display: inline-flex; padding: 3px; border-radius: 11px; background: #eff0f6; gap: 3px; }
.mode button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.mode button.on { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(20, 20, 60, .08); }

/* -- the pupil's page --------------------------------------------------------------------- */
.pupil { min-height: 100dvh; display: flex; flex-direction: column; }
.pupil .frame { flex: 1; display: flex; }
.pupil .frame iframe { flex: 1; width: 100%; border: 0; min-height: calc(100dvh - 56px); }
.pupil .ask { margin: auto; width: min(420px, calc(100% - 32px)); }
.pupil .ask input { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 16px; margin: 12px 0; }

@media (max-width: 1100px) {
  .page { grid-template-columns: minmax(0, 1fr); }
  .flow { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .top { padding: 10px 14px; }
  .brand small { display: none; }
  .top nav a { padding: 6px 9px; font-size: 13px; }
  .wrap, .page { padding-left: 16px; padding-right: 16px; }
  .site, .landing-site { grid-template-columns: 1fr; }
  .site aside { display: none; }
  .slot iframe { height: 70vh; }
  .flow { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
}

/* -- the LTI variant: an LMS that looks like Moodle 4 (Boost) -------------------------- */
.mdl { font-family: "Roboto", "Segoe UI", system-ui, sans-serif; background: #fff; color: #1d2125; min-height: 680px; display: flex; flex-direction: column; }
.mdl-nav { display: flex; align-items: center; gap: 18px; height: 56px; padding: 0 16px; background: #fff; border-bottom: 1px solid #dee2e6; box-shadow: 0 2px 4px rgba(0,0,0,.08); position: relative; z-index: 1; }
.mdl-logo { display: flex; align-items: center; gap: 8px; font-weight: 700; color: #0f6cbf; font-size: 17px; letter-spacing: -.01em; }
.mdl-logo .hat { width: 26px; height: 26px; border-radius: 6px; background: #0f6cbf; display: grid; place-items: center; }
.mdl-logo small { color: #6a737b; font-weight: 400; font-size: 12px; }
.mdl-primary { display: flex; height: 100%; }
.mdl-primary a { display: flex; align-items: center; padding: 0 12px; color: #1d2125; font-size: 14.5px; border-bottom: 3px solid transparent; }
.mdl-primary a.on { border-bottom-color: #0f6cbf; }
.mdl-primary a:hover { text-decoration: none; background: #f5f5f5; }
.mdl-user { margin-left: auto; display: flex; align-items: center; gap: 12px; color: #6a737b; }
.mdl-user .ava { width: 34px; height: 34px; border-radius: 50%; background: #e7e9ec; display: grid; place-items: center; font-size: 13px; color: #1d2125; font-weight: 600; }
.mdl-body { display: grid; grid-template-columns: 250px minmax(0, 1fr); flex: 1; min-height: 0; }
.mdl-index { border-right: 1px solid #dee2e6; background: #f8f9fa; padding: 14px 0; font-size: 14px; overflow: auto; }
.mdl-index .ttl { padding: 0 16px 10px; font-weight: 700; font-size: 13px; color: #6a737b; text-transform: uppercase; letter-spacing: .04em; }
.mdl-index details { padding: 0; }
.mdl-index summary { list-style: none; cursor: pointer; padding: 7px 16px; font-weight: 600; display: flex; gap: 6px; align-items: center; }
.mdl-index summary::-webkit-details-marker { display: none; }
.mdl-index summary::before { content: "▾"; color: #6a737b; font-size: 11px; }
.mdl-index details:not([open]) summary::before { content: "▸"; }
.mdl-index a { display: flex; align-items: center; gap: 8px; padding: 6px 16px 6px 30px; color: #1d2125; }
.mdl-index a.on { background: #e8f1f9; color: #0f6cbf; font-weight: 600; box-shadow: inset 3px 0 #0f6cbf; }
.mdl-index a:hover { text-decoration: none; background: #eef1f4; }
.mdl-main { padding: 18px 24px 24px; min-width: 0; overflow: auto; }
.mdl-crumbs { font-size: 13px; color: #6a737b; margin-bottom: 8px; }
.mdl-crumbs a { color: #0f6cbf; }
.mdl-course { font-size: 15px; color: #6a737b; margin: 0; }
.mdl-head { display: flex; align-items: center; gap: 12px; margin: 6px 0 4px; }
.mdl-head .act { width: 40px; height: 40px; border-radius: 8px; background: #eb66a2; display: grid; place-items: center; color: #fff; flex: none; }
.mdl-head h2 { margin: 0; font-size: 26px; font-weight: 700; }
.mdl-sec { display: flex; gap: 2px; border-bottom: 1px solid #dee2e6; margin: 12px 0 14px; font-size: 14.5px; overflow-x: auto; }
.mdl-sec a { padding: 9px 14px; color: #1d2125; border-bottom: 3px solid transparent; white-space: nowrap; }
.mdl-sec a.on { border-bottom-color: #0f6cbf; font-weight: 600; }
.mdl-sec a:hover { text-decoration: none; background: #f5f5f5; }
.mdl-done { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.mdl-done .b { border: 1px solid #ced4da; border-radius: 6px; padding: 5px 10px; font-size: 13px; color: #1d2125; background: #fff; }
.mdl-done .info { font-size: 13px; color: #6a737b; }
.mdl .slot { border-radius: 4px; border-color: #dee2e6; }
.mdl-note { margin-top: 10px; font-size: 12.5px; color: #6a737b; }
@media (max-width: 900px) { .mdl-body { grid-template-columns: 1fr; } .mdl-index, .mdl-primary { display: none; } }
