:root {
  --max: 1120px;
  --radius: 18px;
  --radius-sm: 14px;

  /* Light (default): calm greys + soft Fab Lab Rwanda accent */
  --bg0: #f3f5f6;
  --bg1: #ffffff;
  --panel: rgba(255, 255, 255, 0.78);
  --panel2: rgba(255, 255, 255, 0.92);
  --text: rgba(10, 14, 20, 0.92);
  --muted: rgba(10, 14, 20, 0.62);
  --border: rgba(17, 24, 39, 0.12);
  --shadow: 0 26px 70px rgba(17, 24, 39, 0.12);
  --shadow-soft: 0 18px 50px rgba(17, 24, 39, 0.08);

  --accent: #2f6f64;

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji";
}

html[data-theme="dark"] {
  --bg0: #0e1112;
  --bg1: #121718;
  --panel: rgba(255, 255, 255, 0.06);
  --panel2: rgba(255, 255, 255, 0.085);
  --text: rgba(255, 255, 255, 0.9);
  --muted: rgba(255, 255, 255, 0.68);
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.35);
  --shadow-soft: 0 18px 50px rgba(0, 0, 0, 0.22);
  --accent: #4aa89a;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: linear-gradient(180deg, var(--bg0), var(--bg1));
}

a {
  color: inherit;
  text-decoration: none;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
    monospace;
  font-size: 0.95em;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: 16px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  transform: translateY(-150%);
  transition: transform 160ms ease;
  z-index: 100;
}
.skip-link:focus {
  transform: translateY(0);
}

.muted {
  color: var(--muted);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
}
html[data-theme="dark"] .site-header {
  background: rgba(13, 16, 17, 0.55);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}
.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  object-fit: cover;
  box-shadow: var(--shadow-soft);
  background: var(--panel);
}
.brand-title {
  font-weight: 800;
  letter-spacing: -0.01em;
}
.brand-subtitle {
  font-size: 12.5px;
  color: var(--muted);
}

.nav {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-link {
  font-size: 14px;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
}
.nav-link:hover {
  color: var(--text);
  background: var(--panel);
  border-color: var(--border);
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}
.icon-btn:hover {
  background: var(--panel2);
}

.nav-toggle {
  display: none;
}

.section {
  padding: 28px 0;
  scroll-margin-top: 92px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  padding: 16px;
}
.card-head {
  margin-bottom: 12px;
}
.card-title {
  font-weight: 800;
  letter-spacing: -0.01em;
}
.card-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}
.card-foot {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 14px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.btn:hover {
  transform: translateY(-1px);
  background: var(--panel2);
}
.btn:active {
  transform: translateY(0);
}
.btn-ghost {
  background: transparent;
}
.btn-primary {
  background: var(--accent);
  border-color: color-mix(in oklab, var(--accent) 70%, black);
  color: rgba(255, 255, 255, 0.96);
}
.btn-sm {
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13px;
}

.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  font-size: 12.5px;
}
.chip-sm {
  padding: 6px 9px;
  font-size: 12px;
}

.feature-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.feature-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--muted);
  line-height: 1.45;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-top: 5px;
  background: var(--accent);
  flex: 0 0 auto;
}

.video-frame {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.08);
  box-shadow: var(--shadow-soft);
}
.video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: rgba(0, 0, 0, 0.08);
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.student-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  padding: 14px;
  transition: transform 140ms ease, background 140ms ease;
}
.student-card:hover {
  transform: translateY(-2px);
  background: var(--panel2);
}

.student-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
}
.student-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 20%, transparent);
  border-radius: 14px;
}

.student-name {
  font-weight: 800;
  letter-spacing: -0.02em;
}

.avatar-wrap {
  position: relative;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
}
.avatar-wrap-lg {
  width: 66px;
  height: 66px;
}
.avatar-wrap-sm {
  width: 28px;
  height: 28px;
}
.avatar-wrap .avatar,
.avatar-wrap .avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.avatar,
.avatar-img {
  border-radius: 16px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--accent) 14%, white);
  box-shadow: var(--shadow-soft);
}
.avatar-wrap-lg .avatar,
.avatar-wrap-lg .avatar-img {
  border-radius: 18px;
}
.avatar-wrap-sm .avatar,
.avatar-wrap-sm .avatar-img {
  border-radius: 10px;
}
.avatar {
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.avatar-img {
  object-fit: cover;
  display: block;
}

/* Two-column pages (content + right navigation) */
.page-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 14px;
  align-items: start;
}
.sidebar {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  padding: 14px;
  position: sticky;
  top: 92px;
}
.sidebar-title {
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}
.sidebar-frame {
  width: 100%;
  border: 0;
  display: block;
  border-radius: 14px;
  overflow: hidden;
  height: 320px;
  background: transparent;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.week-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  padding: 16px;
  transition: transform 140ms ease, background 140ms ease;
}
.week-link {
  display: block;
  color: inherit;
}
.week-link:hover {
  transform: translateY(-2px);
  background: var(--panel2);
}
.week-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 20%, transparent);
  border-radius: 14px;
}
.week-title {
  font-weight: 800;
  letter-spacing: -0.01em;
}
.week-sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 24px 0 32px;
  margin-top: 10px;
  background: rgba(0, 0, 0, 0.02);
}
html[data-theme="dark"] .footer {
  background: rgba(0, 0, 0, 0.08);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.footer-title {
  font-weight: 800;
}
.footer-link {
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
}
.footer-link:hover {
  color: var(--text);
  background: var(--panel);
  border-color: var(--border);
}

@media (max-width: 980px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 840px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .page-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: relative;
    top: auto;
  }
  .week-grid {
    grid-template-columns: 1fr;
  }

  .nav-toggle {
    display: inline-grid;
  }
  .nav-links {
    position: absolute;
    right: 20px;
    top: 64px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    min-width: 240px;
    padding: 10px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-soft);
  }
  html[data-theme="dark"] .nav-links {
    background: rgba(13, 16, 17, 0.9);
  }
  .nav-links.open {
    display: flex;
  }
}

@media (max-width: 560px) {
  .brand-subtitle {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

