/** AI was used in developing this website, however NO AI was used in the materials. The materials are human-made from trial and error after years of running camps and workshops. **/

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Caveat:wght@500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Schoolbell&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400..800&family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap');

:root {
  --bg: #f6f5f3;
  --bg-card: #fdfbf5;
  --text: #000;
  --text-dim: #4e575f;
  --text-faint: #92a6b3;
  --accent: #2748c4;
  --accent-soft: #eef0fa;
  --border: #ddd3bd;
  --radius: 8px;
  --max-width: 960px;
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  /* --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace; */
  --mono: "Open Sans", sans-serif, serif;
  --hand: 'Caveat', cursive;
}

/* :root {
  --bg: #f6f5f3;
  --bg-card: #fdfbf5;
  --text: #241f1a;
  --text-dim: #8a8272;
  --text-faint: #b3a992;
  --accent: #2748c4;
  --accent-soft: #eef0fa;
  --border: #ddd3bd;
  --radius: 8px;
  --max-width: 960px;
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  --mono: "Open Sans", sans-serif, serif;
  --hand: 'Caveat', cursive;
} */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.65;
}

a { color: inherit; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }

nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px dashed var(--border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 22px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.85rem;
}

.nav-inner .brand {
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--text);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-dim);
}

.nav-links a:hover, .nav-links a.active { color: var(--text); }

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 56px 24px 90px;
}

.hero { text-align: center; margin-bottom: 48px; }

.kicker {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 22px;
}

.hero h1 {
  font-size: 3.2rem;
  font-weight: 600;
  margin: 0 0 6px;
  display: inline-block;
  border-bottom: 4px solid var(--accent);
  padding-bottom: 6px;
}

.hero .tagline {
  font-style: italic;
  color: var(--text-dim);
  font-size: 1.2rem;
  margin: 22px auto 14px;
  max-width: 34ch;
}

.hero .subline {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-dim);
}

.hero .version {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-faint);
  margin-top: 6px;
}

.hero .cta-row {
  margin-top: 26px;
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 9px 18px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.85rem;
  border: 1px solid var(--border);
  text-decoration: none;
}

.btn.primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.btn.secondary { color: var(--text); background: var(--bg-card); }
.btn:hover { border-color: var(--accent); }
.btn.primary:hover { opacity: 0.85; }

hr.divider {
  border: none;
  border-top: 1px dashed var(--border);
  margin: 44px 0;
}

.abstract {
  font-size: 1.02rem;
}

.abstract .label {
  font-weight: 600;
}

.keywords {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-top: 18px;
}

section { margin-bottom: 56px; }

section h2 {
  font-size: 1.5rem;
  margin: 0;
  font-weight: 600;
}

section .section-sub {
  color: var(--text-dim);
  margin-top: 0;
  margin-bottom: 22px;
  font-size: 0.92rem;
  font-family: var(--mono);
}

.hand {
  font-family: var(--hand);
  font-size: 2.4rem;
  font-weight: 700;
  margin: 0 0 20px;
}

.note-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
  align-items: start;
}

@media (max-width: 640px) {
  .note-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2.2rem; }
}

.hero-split {
  display: flex;
  align-items: stretch;
  gap: 40px;
}

.hero-split .hero-text {
  flex: 0 0 auto;
  align-self: center;
}

.hero-split .slideshow-box {
  flex: 1;
  min-width: 0;
  min-height: 300px;
  aspect-ratio: auto;
}

@media (max-width: 860px) {
  .hero-split { flex-direction: column; align-items: center; }
  .hero-split .slideshow-box { width: 100%; flex: none; aspect-ratio: 4 / 3; min-height: 0; }
}

.quote-box {
  background: var(--bg-card);
  border: 1.5px solid var(--text);
  border-radius: 18px 6px 18px 6px / 12px 18px 8px 18px;
  padding: 20px 22px;
  transform: rotate(-1deg);
  font-family: var(--hand);
  font-size: 1.5rem;
  line-height: 1.35;
  color: var(--text);
}



.quote-cite {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  text-align: right;
  margin: 8px 8px 0 0;
}

.slideshow-box {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.slideshow-box img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  transition: opacity 0.6s ease;
}

.camp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 640px) {
  .camp-grid { grid-template-columns: 1fr; }
}

.camp-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  display: block;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.camp-card:hover { border-color: var(--accent); color: var(--text); }

.camp-card .kicker {
  margin-bottom: 12px;
  font-size: 0.72rem;
}

.camp-card h3 {
  font-size: 1.3rem;
  margin: 0 0 8px;
  font-weight: 600;
}

.camp-card p {
  color: var(--text-dim);
  margin: 0 0 12px;
  font-size: 0.95rem;
}

.camp-card .go {
  font-family: var(--mono);
  font-size: 0.85rem;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.card + .card { margin-top: 16px; }

.card h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.card .meta {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 10px;
  font-family: var(--mono);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}

.grid > .card { margin-top: 0; }

.stat-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.stat-number {
  font-family: var(--serif);
  font-size: 2.6rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
  margin-bottom: 10px;
}

.stat-label {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-dim);
}

.placeholder {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 22px;
  color: var(--text-dim);
  font-style: italic;
  font-size: 0.92rem;
  background: var(--bg-card);
}

.tag {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 4px;
  padding: 2px 8px;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  margin-right: 6px;
}

.tag-time {
  background: #e3f3e6;
  color: #2f546b;
  font-family: inherit;
  font-size: 0.82rem;
  width: 7.75em;
  text-align: center;
}

.tag-pptx,
.tag-odp {
  background: #ffe4cc;
  color: #b34700;
}

.tag-slides {
  background: #fff3c4;
  color: #8a6400;
}

.contact-list {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-family: var(--mono);
}

.contact-list a {
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  text-decoration: none;
  background: var(--bg-card);
}

.contact-list a:hover { border-color: var(--accent); color: var(--accent); }

footer {
  border-top: 1px dashed var(--border);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 22px 24px 30px;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.footer-copy {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-dim);
}

.footer-mail {
  color: var(--text-dim);
  line-height: 0;
}

.footer-mail:hover { color: var(--accent); }

.footer-mail svg { width: 26px; height: 26px; display: block; }

.footer-disclaimer {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-style: italic;
  color: var(--text-faint);
  margin: 10px 0 0;
}

.curriculum-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.day-tabs {
  display: flex;
  flex-wrap: wrap;
  background: var(--accent-soft);
  border-bottom: 1px dashed var(--border);
}

.day-tab {
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 12px 20px;
  border: none;
  border-right: 1px dashed var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
}

.day-tab:hover { color: var(--text); }

.day-tab.active {
  background: var(--bg-card);
  color: var(--text);
  box-shadow: inset 0 -3px 0 var(--accent);
}

.day-panel { padding: 26px; }

.curriculum-box.scrolling {
  display: flex;
  flex-direction: column;
  height: min(600px, 80vh);
}

.curriculum-box.scrolling .day-tabs { flex-shrink: 0; }

.day-scroll {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scroll-behavior: auto;
}

.day-section { padding: 16px 26px; margin-bottom: 0; }

.day-section + .day-section { border-top: 1px dashed var(--border); }

.day-section h3 { margin-bottom: 10px; }

.day-section .resource-list li { margin-bottom: 12px; }

.day-section .placeholder { padding: 10px 14px; }

.day-badge {
  display: inline-block;
  min-width: 1.6em;
  margin-right: 10px;
  padding: 0 6px;
  border: 1.5px solid var(--text);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  vertical-align: 2px;
}

.day-panel h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.day-desc {
  color: var(--text-dim);
  margin: 0 0 18px;
  font-size: 0.95rem;
}

.resource-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.resource-list li {
  margin-bottom: 16px;
}

.resource-list li:last-child { margin-bottom: 0; }

.resource-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.resource-desc {
  margin: 4px 0 0;
  color: var(--text-dim);
  font-size: 0.88rem;
  line-height: 1.5;
}

.resource-icon {
  color: var(--text-faint);
  text-decoration: none;
  font-size: 0.85em;
  margin-left: 2px;
}

.resource-eye {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-dim);
  cursor: pointer;
  flex-shrink: 0;
}

.resource-eye svg { width: 15px; height: 15px; display: block; }

.resource-eye:hover { border-color: var(--accent); color: var(--accent); }

.resource-eye.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.resource-count {
  margin-left: auto;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  border: 1px solid #c9d2f2;
  border-radius: 999px;
  padding: 2px 10px;
  background: var(--accent-soft);
}

.resource-count svg { width: 14px; height: 14px; display: block; }

.resource-count.count-pptx {
  color: #b34700;
  border-color: #f5c28f;
  background: #ffe4cc;
}

.resource-count.count-slides {
  color: #8a6400;
  border-color: #ecd98a;
  background: #fff3c4;
}

.resource-preview {
  margin-top: 10px;
}

.resource-preview iframe {
  width: 100%;
  height: 480px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}

.module-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.module-list li {
  position: relative;
  padding-left: 48px;
  margin-bottom: 22px;
}

.module-badge {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1.5px solid var(--text);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.78rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s ease;
}

.module-badge:hover {
  background: #ece6d6;
  color: var(--text);
}

.module-badge:active {
  background: #ddd3bd;
}

.curriculum-box { scroll-margin-top: 110px; }

.module-list li.has-art {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  column-gap: 24px;
  align-items: center;
}

.module-list li.has-art .module-text { grid-column: 1; grid-row: 1; }

.module-art {
  grid-column: 2;
  grid-row: 1;
  width: 150px;
  height: auto;
  display: block;
}

div.module-art {
  aspect-ratio: 220 / 170;
}

.module-art[hidden] { display: none; }

.module-art .ra-svg {
  width: 100%;
  height: 100%;
  display: block;
}

@media (max-width: 640px) {
  .module-list li.has-art { grid-template-columns: minmax(0, 1fr) 96px; column-gap: 16px; }
  .module-art { width: 96px; }
}

.module-list h3 {
  margin: 0 0 4px;
  font-size: 1.08rem;
}

.module-list p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.95rem;
}

.requirements-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.requirements-list li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 10px;
}

.requirements-list li::before {
  content: "\2192";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.resource-list .resource-desc .resource-bullets {
  list-style: disc;
  margin: 4px 0;
  padding-left: 20px;
}

.resource-list .resource-desc .resource-bullets li {
  margin-bottom: 2px;
  padding: 0;
}

.format-toggle {
  display: flex;
  justify-content: flex-end;
  margin-top: -1px;
  padding-right: 16px;
}

.format-opts {
  display: flex;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}

.format-opt {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 7px 14px;
  border: none;
  border-right: 1px dashed var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
}

.format-opt:last-child { border-right: none; }

.format-opt:hover { color: var(--text); }

.format-opt.active {
  background: var(--bg-card);
  color: var(--text);
  box-shadow: inset 0 3px 0 var(--accent);
}

main.with-sidebar {
  max-width: 1270px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  column-gap: 40px;
}

.page-content [id] { scroll-margin-top: 96px; }

.page-sidebar {
  position: sticky;
  top: 96px;
  align-self: start;
}

.sidebar-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 6px;
}

.sidebar-title {
  font-family: var(--hand);
  font-weight: 700;
  font-size: 1.7rem;
  line-height: 1.1;
  padding-bottom: 8px;
  margin-bottom: 14px;
  border-bottom: 3px solid var(--accent);
  display: inline-block;
  color: var(--text);
  text-decoration: none;
}

.sidebar-title:hover { color: var(--accent); }

.sidebar-links {
  display: flex;
  flex-direction: column;
}

.sidebar-links a {
  position: relative;
  padding: 5px 8px 5px 24px;
  font-family: var(--hand);
  font-size: 1.3rem;
  line-height: 1.25;
  color: var(--text-dim);
  text-decoration: none;
}

.sidebar-links a:hover {
  color: var(--text);
}

.sidebar-links a::before {
  content: "\2192";
  position: absolute;
  left: 4px;
  color: var(--accent);
  font-weight: 700;
  opacity: 0;
}

.sidebar-links a.active {
  color: var(--text);
  font-weight: 700;
}

.sidebar-links a.active::before { opacity: 1; }

@media (max-width: 1000px) {
  main.with-sidebar { display: block; max-width: var(--max-width); }
  .page-sidebar { display: none; }
}

/* ---- Robotics module illustrations (see robot-art.js) ---- */

.ra-part {
  transform: translate(var(--tx, 0), var(--ty, 0)) rotate(var(--rot, 0deg));
  transition: transform 1.3s cubic-bezier(0.22, 0.9, 0.28, 1) var(--d, 0s);
}

.ra-assembled .ra-part { transform: translate(0, 0) rotate(0deg); }

@keyframes ra-ground { to { transform: translateX(-40px); } }
@keyframes ra-spin { to { transform: rotate(360deg); } }
@keyframes ra-speed { 0%, 100% { opacity: 0.2; } 50% { opacity: 0.9; } }

.ra-ground { animation: ra-ground 0.8s linear infinite; }
.ra-spin { animation: ra-spin 2.14s linear infinite; }
.ra-speed { animation: ra-speed 0.8s ease-in-out infinite; }

/* Shuttle: the robot drives 55 units forward, then back; the wheel turns
   55 / (2 * pi * 17) * 360 = 185.4deg to match. Keep the two in sync. */
@keyframes ra-shuttle {
  0%, 6% { transform: translateX(0); }
  46%, 54% { transform: translateX(55px); }
  94%, 100% { transform: translateX(0); }
}
@keyframes ra-shuttle-wheel {
  0%, 6% { transform: rotate(0deg); }
  46%, 54% { transform: rotate(185.4deg); }
  94%, 100% { transform: rotate(0deg); }
}
@keyframes ra-ping { 0%, 100% { opacity: 0.2; } 50% { opacity: 1; } }

.ra-shuttle { animation: ra-shuttle 7s ease-in-out infinite; }
.ra-wheel-shuttle { animation: ra-shuttle-wheel 7s ease-in-out infinite; }
.ra-ping { animation: ra-ping 1.1s ease-in-out infinite; }
.ra-ping-2 { animation-delay: 0.18s; }
.ra-ping-3 { animation-delay: 0.36s; }

@keyframes ra-gear-cw { to { transform: rotate(360deg); } }
@keyframes ra-gear-ccw { to { transform: rotate(-360deg); } }
.ra-gear-cw { animation: ra-gear-cw 14s linear infinite; }
.ra-gear-ccw { animation: ra-gear-ccw 14s linear infinite; }

@keyframes ra-twinkle {
  0%, 100% { opacity: 0.15; transform: scale(0.5); }
  50% { opacity: 1; transform: scale(1); }
}
@keyframes ra-bob { to { transform: translateY(-4px); } }
@keyframes ra-fall {
  from { transform: translateY(-20px) rotate(0deg); }
  to { transform: translateY(190px) rotate(300deg); }
}

.ra-twinkle { animation: ra-twinkle 1.8s ease-in-out infinite; transform-origin: 0 0; }
.ra-bob { animation: ra-bob 2.2s ease-in-out infinite alternate; }
.ra-confetti { animation: ra-fall var(--fd, 5s) linear infinite; animation-delay: var(--dl, 0s); }

@media (prefers-reduced-motion: reduce) {
  .ra-part { transition: none; transform: none; }
  .ra-ground, .ra-spin, .ra-speed, .ra-shuttle, .ra-wheel-shuttle, .ra-ping,
  .ra-gear-cw, .ra-gear-ccw, .ra-twinkle, .ra-bob, .ra-confetti { animation: none; }
  .ra-confetti { display: none; }
}

/* ---- Circuits module 2: pressable button (see circuits-art.js) ---- */

.bt-button { cursor: pointer; outline: none; touch-action: manipulation; }
.bt-button:focus-visible .bt-btn-img { filter: drop-shadow(0 0 3px var(--accent)); }

.bt-btn-img { transition: transform 0.08s ease, filter 0.08s ease; }
.is-pressed .bt-btn-img { transform: translateY(2px); filter: brightness(0.9); }

.bt-led { filter: grayscale(0.75) brightness(1.2); opacity: 0.8; transition: filter 0.12s ease, opacity 0.12s ease; }
.bt-halo { opacity: 0; transition: opacity 0.12s ease; }
.is-pressed .bt-led { filter: none; opacity: 1; }
.is-pressed .bt-halo { opacity: 1; }

@keyframes bt-flow { to { stroke-dashoffset: -7; } }
.is-pressed .bt-wire { stroke: #e0483a; animation: bt-flow 0.5s linear infinite; }

@keyframes bt-hint { 0%, 100% { opacity: 0.3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(4px); } }
.bt-hint { animation: bt-hint 1.4s ease-in-out infinite; }
.has-pressed .bt-hint { animation: none; opacity: 0.4; }

@media (prefers-reduced-motion: reduce) {
  .bt-hint, .is-pressed .bt-wire { animation: none; }
}

.bt-link {
  position: absolute;
  left: 0;
  top: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 1;
}


/* ---- Theme switch (top right of the navbar) ---- */

.nav-right {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.lbl-box { display: none; }

.theme-toggle {
  position: relative;
  flex-shrink: 0;
  width: 58px;
  height: 28px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-dim);
  cursor: pointer;
}

.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.tt-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--text);
  transition: transform 0.2s ease;
}

.tt-icon { position: relative; z-index: 1; display: inline-flex; }
.tt-icon svg { width: 15px; height: 15px; display: block; }

html:not([data-theme="box"]) .tt-sun { color: var(--bg); }
html[data-theme="box"] .tt-knob { transform: translateX(30px); }
html[data-theme="box"] .tt-box { color: #3a2a1b; }

/* ---- Box mode: the dim inside of a cardboard box ---- */

html[data-theme="box"] {
  color-scheme: dark;
  --bg: #17110d;
  --bg-card: #7d5f3d;
  --text: #f7f1e6;
  --text-dim: #e0d1ba;
  --text-faint: #b09b82;
  --accent: #e0a964;
  --accent-soft: rgba(224, 169, 100, 0.2);
  --border: #6d5238;
  --board: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.08) 0 2px, rgba(255, 255, 255, 0.035) 2px 5px);
  /* a lamp glowing from above, darkening toward the corners */
  background:
    radial-gradient(ellipse 70% 50% at 50% -8%, rgba(120, 84, 52, 0.55) 0%, rgba(120, 84, 52, 0) 70%),
    radial-gradient(ellipse at 50% 45%, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.6) 100%),
    #1b140f;
  background-attachment: fixed;
}

html[data-theme="box"] body { background: transparent; }

/* cardboard surfaces */
html[data-theme="box"] .card,
html[data-theme="box"] .camp-card,
html[data-theme="box"] .curriculum-box,
html[data-theme="box"] .quote-box,
html[data-theme="box"] .placeholder,
html[data-theme="box"] .btn.secondary,
html[data-theme="box"] .contact-list a {
  background: var(--board), var(--bg-card);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
}

html[data-theme="box"] .btn.primary { box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45); }

/* chalkboard navbar: no fill, a cardboard cutout behind the current page */
html[data-theme="box"] nav {
  background: rgba(23, 17, 13, 0.92);
  backdrop-filter: blur(3px);
  border-bottom: 1px dashed rgba(247, 241, 230, 0.2);
}

html[data-theme="box"] .nav-inner {
  font-family: 'Schoolbell', cursive;
  font-size: 1.1rem;
}

html[data-theme="box"] .nav-inner .brand {
  font-weight: 400;
  font-size: 1.3rem;
  letter-spacing: 0.5px;
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.3);
}

html[data-theme="box"] .nav-links a {
  position: relative;
  isolation: isolate;
  padding: 5px 15px;
  color: rgba(247, 241, 230, 0.72);
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.25);
}

html[data-theme="box"] .nav-links a:hover { color: #fff; }

html[data-theme="box"] .nav-links a.active {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.55));
}

html[data-theme="box"] .nav-links a.active::before {
  content: "";
  position: absolute;
  inset: -1px -2px;
  z-index: -1;
  background: var(--board), #a07848;
  transform: rotate(-1.2deg);
  clip-path: polygon(1% 18%, 9% 4%, 26% 9%, 47% 0%, 71% 8%, 90% 2%, 100% 16%, 97% 44%, 100% 72%, 91% 96%, 68% 90%, 44% 100%, 20% 92%, 6% 99%, 0% 70%, 3% 42%);
}

html[data-theme="box"] .theme-toggle { background: var(--board), #6a4f33; border-color: #8a6a45; }

/* sidebar */
html[data-theme="box"] .lbl-light { display: none; }
html[data-theme="box"] .lbl-box { display: inline; }

/* drawings are dark-on-light, so pin them to a sheet of paper */
html[data-theme="box"] .module-art {
  background: #efe3cc;
  border-radius: 6px;
  padding: 5px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

html[data-theme="box"] .bt-wire { stroke: #eadcc3; }
html[data-theme="box"] .is-pressed .bt-wire { stroke: #ff8a6a; }

/* hard-coded badge colors, retuned for dark */
html[data-theme="box"] .tag-pdf,
html[data-theme="box"] .tag-docx,
html[data-theme="box"] .tag-odt { background: #4b3827; color: #f1d3a8; }
html[data-theme="box"] .tag-slides { background: #5a4716; color: #ffd86b; }
html[data-theme="box"] .tag-pptx,
html[data-theme="box"] .tag-odp { background: #5c3a1a; color: #ffb066; }
html[data-theme="box"] .tag-time { background: #2f4a33; color: #b8e6b9; }

html[data-theme="box"] .resource-count { color: #f1d3a8; border-color: rgba(247, 241, 230, 0.28); background: rgba(0, 0, 0, 0.3); }
html[data-theme="box"] .resource-count.count-slides { color: #ffd86b; border-color: #8a6f2a; background: #5a4716; }
html[data-theme="box"] .resource-count.count-pptx { color: #ffb066; border-color: #94602b; background: #5c3a1a; }

html[data-theme="box"] .module-badge:hover { background: #9a7a52; }
html[data-theme="box"] .module-badge:active { background: #5e4630; }
