@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible+Next:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap');

/* ── Variables ──────────────────────────────────────────────────────────── */
:root {
  --bg:             #111111;
  --bg-sidebar:     #18181b;
  --bg-surface:     #27272a;
  --border:         #3f3f46;
  --border-mid:     #52525b;
  --text:           #fafafa;
  --text-muted:     #a1a1aa;
  --text-subtle:    #71717a;
  --accent:         #04dd7c;
  --accent-hover:   #01ff90;
  --accent-dim:     rgba(4, 221, 124, 0.08);
  --accent-active:  #003e1e;
  --amber:          #f59e0b;
  --header-h:       56px;
  --sidebar-w:      280px;
  --content-max:    750px;
  --radius:         6px;
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 17px; scroll-behavior: smooth; }
body {
  font-family: 'Atkinson Hyperlegible Next', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; }

/* ── Preview ribbon ─────────────────────────────────────────────────────── */
.preview-ribbon {
  position: fixed;
  top: 18px;
  right: -30px;
  z-index: 9999;
  background: var(--amber);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 40px;
  transform: rotate(45deg);
  transform-origin: center;
  pointer-events: none;
  user-select: none;
}

/* ── Tessl site header (shared chrome — mirrors tessl-patterns) ──────────── */
.tessl-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 200;
}
.tessl-header-inner {
  padding: 0 5rem 0 1.5rem; /* extra right padding clears the preview ribbon */
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.tessl-brand { display: flex; align-items: center; gap: 0.8rem; min-width: 0; }
.tessl-logo-link { display: flex; align-items: center; flex-shrink: 0; }
.tessl-logo-img { height: 22px; width: auto; }

/* This property (Learn) woven into the global Tessl header, next to the logo */
.tessl-property {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  min-width: 0;
}
.tessl-property:hover { text-decoration: none; }
.tessl-property-sep { color: var(--text-subtle); font-size: 1.2rem; font-weight: 300; }
.tessl-property-text { display: flex; flex-direction: row; align-items: baseline; min-width: 0; }
.tessl-property-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.tessl-property-byline {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tessl-property-byline::before {
  content: "·";
  margin: 0 0.45rem;
  color: var(--text-subtle);
}
.tessl-header-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-left: auto;
}
.tessl-header-nav a {
  font-size: 0.875rem;
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s, opacity 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.tessl-header-nav a:hover { color: var(--text); opacity: 0.75; text-decoration: none; }
.tessl-nav-external svg { opacity: 0.6; }

/* Registry — outlined pill (rightmost CTA) */
.tessl-nav-registry {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.8rem;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 8px;
  color: var(--text) !important;
  font-size: 0.875rem;
  font-weight: 500;
  transition: border-color 0.15s, background 0.15s;
}
.tessl-nav-registry:hover {
  border-color: rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.06);
  opacity: 1 !important;
  text-decoration: none;
}

/* Community dropdown */
.tessl-nav-dropdown { position: relative; display: inline-flex; align-items: center; }
.tessl-nav-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text);
  padding: 0;
  transition: opacity 0.15s;
}
.tessl-nav-dropdown-btn:hover { opacity: 0.75; }
.tessl-nav-dropdown-btn svg { opacity: 0.7; transition: transform 0.2s; }
.tessl-nav-dropdown.open .tessl-nav-dropdown-btn svg { transform: rotate(180deg); }
.tessl-nav-dropdown-menu {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 180px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0;
  padding-top: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  z-index: 200;
  transition: opacity 0.15s, visibility 0.15s;
}
.tessl-nav-dropdown.open .tessl-nav-dropdown-menu {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}
.tessl-nav-dropdown-menu a {
  display: block;
  padding: 0.45rem 1rem;
  font-size: 0.875rem;
  color: var(--text);
  opacity: 0.75;
  text-decoration: none;
  transition: background 0.1s, opacity 0.1s;
}
.tessl-nav-dropdown-menu a:hover { background: rgba(255,255,255,0.06); opacity: 1; }

/* Header hamburger (mobile) — toggles the marketing nav */
.tessl-header-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
  flex-shrink: 0;
}
.tessl-header-burger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.tessl-header-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.tessl-header-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.tessl-header-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Fixed lesson-sidebar toggle (mobile only) — opens the lessons drawer */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: calc(var(--header-h) + 0.6rem);
  left: 0.9rem;
  z-index: 210;
  width: 2.25rem;
  height: 2.25rem;
  align-items: center;
  justify-content: center;
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0,0,0,.4);
  color: var(--text);
  cursor: pointer;
}
.sidebar-toggle:hover { color: var(--accent); border-color: var(--accent); }

/* ── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: var(--header-h); left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.25s ease;
}
.sidebar-inner {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding-bottom: 2rem;
}
.sidebar-brand {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-title { display: block; font-weight: 600; font-size: 0.9rem; }
.sidebar-sub { display: block; font-size: 0.75rem; color: var(--text-muted); margin-top: 0.2rem; }
.sidebar-modules { padding: 1rem 0; flex: 1; }
.sidebar-label {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-subtle);
  padding: 0 1.25rem 0.6rem;
}
.nav-module {
  display: grid;
  grid-template-columns: 1.6rem 1fr auto;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.865rem;
  border-left: 2px solid transparent;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  cursor: pointer;
}
.nav-module:hover { background: var(--accent-dim); color: var(--text); }
.nav-module.active {
  background: var(--accent-active);
  border-left-color: var(--accent);
  color: var(--text);
}
.mod-num {
  font-size: 0.72rem; color: var(--text-subtle);
  font-variant-numeric: tabular-nums; font-weight: 600;
}
.nav-module.active .mod-num { color: var(--accent); }
.mod-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mod-status { font-size: 0.7rem; flex-shrink: 0; transition: color 0.2s; }
.sidebar-footer {
  padding: 1rem 1.25rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  flex-shrink: 0;
}
.sidebar-footer a { color: var(--text-subtle); }
.sidebar-footer a:hover { color: var(--accent); }

/* ── Layout ─────────────────────────────────────────────────────────────── */
.content {
  margin-left: var(--sidebar-w);
  padding-top: var(--header-h);
  min-height: 100vh;
}

/* ── Module page ────────────────────────────────────────────────────────── */
.module-body {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
}
.module-eyebrow {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 0.4rem;
}
.module-body h1 {
  font-size: 2rem; font-weight: 600; letter-spacing: -0.02em;
  line-height: 1.2; margin-bottom: 1.5rem;
}
/* Title + inline duration share a baseline-aligned row so the time reads as a
   small note beside the heading rather than a separate boxed meta line. */
.lesson-head { display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.lesson-head h1 { margin-bottom: 0; }
.lesson-duration {
  font-size: 0.85rem; font-weight: 500; color: var(--text-muted);
  white-space: nowrap;
}
.module-meta { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.meta-tag {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.8rem; color: var(--text-muted);
  background: var(--bg-surface); border: 1px solid var(--border);
  padding: 0.2rem 0.65rem; border-radius: var(--radius);
}
.meta-tag svg { flex-shrink: 0; }
.ships-box, .install-box {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.75rem;
  padding: 0.7rem 1rem; border-radius: var(--radius); margin-bottom: 0.6rem;
  font-size: 0.875rem;
}
.ships-box {
  background: var(--accent-dim);
  border: 1px solid rgba(4, 221, 124, 0.2);
}
.ships-label, .install-label {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent); flex-shrink: 0;
}
.ships-value { color: var(--text); }
.ships-value code {
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 0.85em; color: var(--accent);
  background: rgba(4, 221, 124, 0.1); padding: 0.05em 0.3em;
  border-radius: 3px;
}
.install-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
}
.install-cmd {
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 0.875rem; color: var(--accent);
  word-break: break-all;
}

/* Two-ways-through framing for the install/run boxes (Simon 25 Jun feedback) */
.lesson-modes { margin-bottom: 1rem; }
.modes-intro {
  font-size: 0.9rem; color: var(--text-muted);
  margin: 0 0 0.6rem; line-height: 1.5;
}
.modes-intro strong { color: var(--text); font-weight: 600; }
.install-help {
  flex-basis: 100%;
  font-size: 0.8rem; color: var(--text-muted); line-height: 1.5;
}
.install-help code {
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 0.85em; color: var(--text);
  background: var(--bg); padding: 0.05em 0.3em; border-radius: 3px;
}
.install-help em { color: var(--text); font-style: normal; }

/* ── Prose typography ───────────────────────────────────────────────────── */
.module-prose { margin-top: 2.5rem; }

.module-prose h2 {
  font-size: 1.3rem; font-weight: 600;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
  margin: 2.75rem 0 1rem;
}
.module-prose h2:first-child { margin-top: 0; }
.module-prose h3 { font-size: 1.05rem; font-weight: 600; margin: 2rem 0 0.75rem; }
.module-prose h4 { font-size: 0.95rem; font-weight: 600; margin: 1.5rem 0 0.5rem; color: var(--text-muted); }

.module-prose p { margin-bottom: 1rem; }
.module-prose p:last-child { margin-bottom: 0; }

.module-prose ul, .module-prose ol { margin: 0 0 1rem 1.5rem; }
.module-prose li { margin-bottom: 0.3rem; }
.module-prose li > ul, .module-prose li > ol { margin-top: 0.3rem; margin-bottom: 0.3rem; }

.module-prose strong { font-weight: 600; color: var(--text); }
.module-prose em { font-style: italic; }

/* tables */
.module-prose table {
  width: 100%; border-collapse: collapse;
  font-size: 0.875rem; margin: 1.5rem 0;
  display: block; overflow-x: auto;
}
.module-prose th {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: left; font-weight: 600; white-space: nowrap;
}
.module-prose td { border: 1px solid var(--border); padding: 0.5rem 0.75rem; }
.module-prose tbody tr:nth-child(even) td { background: rgba(255,255,255,0.02); }

/* inline code */
.module-prose code {
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 0.85em; color: var(--accent);
  background: var(--bg-surface); border: 1px solid var(--border);
  padding: 0.1em 0.35em; border-radius: 3px;
}

/* code blocks */
.module-prose pre {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  overflow-x: auto; margin: 1.25rem 0;
}
.module-prose pre code {
  background: none; border: none; padding: 0;
  color: var(--text); font-size: 0.875rem; line-height: 1.6;
}

/* blockquotes */
.module-prose blockquote {
  border-left: 3px solid var(--accent);
  background: var(--accent-dim);
  padding: 0.8rem 1.1rem;
  margin: 1.5rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.module-prose blockquote p { margin-bottom: 0.5rem; }
.module-prose blockquote p:last-child { margin-bottom: 0; }

.module-prose hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

/* ── Collapsible long content (B10, reference pages) ───────────────────── */
.collapse-toggle {
  display: inline-flex; align-items: center;
  background: var(--bg-surface); border: 1px solid var(--border-mid);
  color: var(--text-muted); font: inherit; font-size: 0.8rem;
  padding: 0.3rem 0.75rem; border-radius: 4px; cursor: pointer;
}
.collapse-toggle:hover { color: var(--text); border-color: var(--accent); }

/* Tall code / pasted-output blocks clamp until "Show more" is pressed. */
.collapsible-pre.is-clamped pre { max-height: 340px; overflow: hidden; }
.collapsible-pre .collapse-toggle { margin-top: 0.5rem; }

/* Glossary-style section folding. */
.ref-collapse-all { display: flex; justify-content: flex-end; margin-bottom: 1rem; }
details.ref-section {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-surface); margin: 0 0 0.6rem;
}
details.ref-section > summary {
  cursor: pointer; list-style: none;
  padding: 0.75rem 1rem; font-size: 1.05rem; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 0.5rem;
}
details.ref-section > summary::-webkit-details-marker { display: none; }
details.ref-section > summary::before {
  content: '\25B8'; color: var(--accent); font-size: 0.85em; transition: transform 0.15s ease;
}
details.ref-section[open] > summary::before { transform: rotate(90deg); }
details.ref-section[open] > summary { border-bottom: 1px solid var(--border); }
details.ref-section > *:not(summary) { margin-left: 1rem; margin-right: 1rem; }
details.ref-section > *:nth-child(2) { margin-top: 1rem; }
details.ref-section > *:last-child { margin-bottom: 1rem; }

/* ── Syntax highlighting (hljs theme) ──────────────────────────────────── */
.hljs { background: transparent !important; }
.hljs-comment, .hljs-quote { color: var(--text-subtle); font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-addition { color: #c792ea; }
.hljs-number, .hljs-string, .hljs-meta .hljs-meta-string,
.hljs-literal, .hljs-doctag, .hljs-regexp { color: #c3e88d; }
.hljs-title, .hljs-section, .hljs-name, .hljs-selector-id,
.hljs-selector-class { color: #82aaff; }
.hljs-attribute, .hljs-attr { color: #ffcb6b; }
.hljs-variable, .hljs-template-variable { color: #f07178; }
.hljs-type, .hljs-built_in, .hljs-builtin-name, .hljs-symbol,
.hljs-selector-attr, .hljs-selector-pseudo { color: #decb6b; }
.hljs-bullet, .hljs-link { color: var(--accent); }
.hljs-deletion { color: #f07178; }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: bold; }

/* ── Completion ─────────────────────────────────────────────────────────── */
.completion-area {
  margin: 3.5rem 0 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative; /* anchor for the completion star burst */
}
/* Completion delight: a short outward star burst, positioned over the clicked
   control via inline --dx/--dy/left/top. pointer-events:none so it never
   blocks the UI; removed from the DOM after ~1.2s. */
.star-burst { position: absolute; width: 0; height: 0; pointer-events: none; z-index: 5; }
.star-burst span {
  position: absolute; left: 0; top: 0;
  color: var(--accent); line-height: 1;
  animation: star-burst 0.95s ease-out forwards;
}
@keyframes star-burst {
  0%   { opacity: 0; transform: translate(0, 0) scale(0.3); }
  15%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx, 0), var(--dy, -20px)) scale(1.1); }
}
.complete-btn {
  background: var(--accent); color: #000;
  border: none; border-radius: var(--radius);
  padding: 0.65rem 1.5rem;
  font-size: 0.9rem; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: background 0.15s, transform 0.1s;
  flex-shrink: 0;
}
.complete-btn:hover { background: var(--accent-hover); transform: translateY(-1px); }
.complete-check {
  color: var(--accent); font-weight: 600; font-size: 0.9rem;
  display: none;
}

/* ── Page navigation ────────────────────────────────────────────────────── */
.page-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 2rem; gap: 1rem; flex-wrap: wrap;
}
.nav-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.6rem 1.25rem; border-radius: var(--radius);
  border: 1px solid var(--border); color: var(--text-muted);
  font-size: 0.875rem;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.nav-btn:hover {
  border-color: var(--accent); color: var(--accent);
  background: var(--accent-dim);
}
.track-done { color: var(--accent); font-size: 0.875rem; font-weight: 500; }

/* ── Index page ─────────────────────────────────────────────────────────── */
.index-body {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 2rem 5rem;
}
.hero {
  background: linear-gradient(135deg, var(--bg) 0%, #003e1e 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem 2.5rem;
  margin-bottom: 2rem;
}
.hero h1 {
  font-size: 2rem; font-weight: 600; letter-spacing: -0.02em;
  margin-bottom: 0.75rem; line-height: 1.2;
}
.hero-sub {
  color: var(--text-muted); font-size: 1.05rem;
  max-width: 520px; line-height: 1.6;
}
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
/* The academy landing has only a couple of course cards. auto-fill would leave
   empty column tracks to the right (the "weird empty space" Bap flagged);
   auto-fit collapses the empty tracks so the cards stretch to fill the row.
   The 280px min still drops to one column on narrow screens. */
.module-grid--courses { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.module-card {
  display: block; position: relative;
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.35rem 1.4rem 1.5rem;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.module-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(4, 221, 124, 0.12);
  color: var(--text);
}
.card-eyebrow {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 0.45rem;
}
.card-title { font-size: 1rem; font-weight: 600; line-height: 1.35; margin-bottom: 0.5rem; }
.card-desc { font-size: 0.845rem; color: var(--text-muted); line-height: 1.55; margin-bottom: 1rem; }
.card-meta { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.card-meta span { font-size: 0.75rem; color: var(--text-subtle); }
.card-status { position: absolute; top: 1rem; right: 1rem; font-size: 0.8rem; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Header: hide the desktop nav, show the header burger + lesson drawer toggle */
  .tessl-header { position: relative; } /* anchor the absolute mobile-nav panel */
  .tessl-header-inner { padding: 0 1rem; }
  .tessl-header-nav { display: none; }
  .tessl-header-burger { display: flex; margin-right: 2.5rem; } /* clear preview ribbon */
  .tessl-property-byline { display: none; }
  .sidebar-toggle { display: flex; }

  /* Mobile drop-down panel for the marketing nav */
  .tessl-header-nav.mobile-open {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0 0.75rem;
    z-index: 199;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  }
  .tessl-header-nav.mobile-open > a,
  .tessl-header-nav.mobile-open > .tessl-nav-dropdown {
    display: block;
    padding: 0.65rem 1.5rem;
    font-size: 0.9rem;
    color: var(--text);
    opacity: 0.85;
    border-radius: 0;
  }
  .tessl-header-nav.mobile-open > a:hover { background: rgba(255,255,255,0.05); opacity: 1; }
  .tessl-header-nav.mobile-open .tessl-nav-registry {
    border: none; border-radius: 0; font-weight: 400; width: 100%; text-align: left;
  }
  .tessl-header-nav.mobile-open .tessl-nav-dropdown-btn {
    width: 100%; justify-content: space-between; padding: 0; font-size: 0.9rem; opacity: 0.85;
  }
  .tessl-header-nav.mobile-open .tessl-nav-dropdown-menu {
    display: none; position: static; transform: none; box-shadow: none;
    border: none; border-top: 1px solid rgba(255,255,255,0.06); border-radius: 0;
    padding: 0.25rem 0; min-width: 0; background: rgba(255,255,255,0.03);
    margin-top: 0.4rem; transition: none; visibility: visible; opacity: 1; pointer-events: auto;
  }
  .tessl-header-nav.mobile-open .tessl-nav-dropdown.open .tessl-nav-dropdown-menu { display: block; }
  .tessl-header-nav.mobile-open .tessl-nav-dropdown-menu a { padding: 0.55rem 2rem; font-size: 0.85rem; }

  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 20px rgba(0,0,0,0.6); }
  .content { margin-left: 0; padding-top: calc(var(--header-h) + 0.5rem); }
  .module-body { padding: 2rem 1.25rem 3rem; }
  .module-body h1 { font-size: 1.6rem; }
  .index-body { padding: 1.25rem 1rem 3rem; }
  .hero { padding: 2rem 1.5rem; }
  .hero h1 { font-size: 1.5rem; }
  .module-grid { grid-template-columns: 1fr; }

  /* Footer collapses to a single column on small screens */
  .tessl-footer-inner { grid-template-columns: 1fr; gap: 2rem; }
  .tessl-footer-links { grid-template-columns: repeat(2, 1fr); }
  .tessl-footer-bottom { flex-direction: column; align-items: flex-start; }
}
@media (min-width: 769px) and (max-width: 1024px) {
  :root { --sidebar-w: 240px; }
}

/* ── Breadcrumb + course nav (routing fix, 2026-06-17) ───────────────────── */
.breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem;
  font-size: 0.78rem; color: var(--text-subtle);
  padding: 1.5rem 0 0; margin: 0 auto; max-width: 760px;
}
.content--index .breadcrumb { max-width: 1100px; }
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span[aria-current="page"] { color: var(--text); }
.crumb-sep { color: var(--border-mid); }

/* Course headings double as links to the course page. */
a.sidebar-course {
  display: block; text-decoration: none;
  margin-top: 1rem; transition: color 0.12s ease;
}
a.sidebar-course:first-of-type { margin-top: 0; }
a.sidebar-course:hover, a.sidebar-course.active { color: var(--accent); }
a.sidebar-title { text-decoration: none; color: var(--text); }
a.sidebar-title:hover { color: var(--accent); }

/* Quickstart sits above the course list as a standalone entry point. */
a.sidebar-quickstart {
  display: block; text-decoration: none;
  margin-bottom: 1rem; transition: color 0.12s ease;
}
a.sidebar-quickstart:hover, a.sidebar-quickstart.active { color: var(--accent); }

/* ── Per-screen lesson stepper (progressive disclosure, 2026-06-21) ──────── */
/* Activated by stepper.js; the static page is a normal scroll without it. */
.stepper-bar {
  display: flex; flex-direction: column; gap: 0.5rem;
  margin: 2rem 0 1.5rem; padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.stepper-track { display: flex; gap: 0.4rem; }
.stepper-dot {
  flex: 1 1 0; height: 4px; min-width: 12px; padding: 0;
  border: none; border-radius: 2px; background: var(--border);
  cursor: pointer; transition: background 0.15s;
}
.stepper-dot:hover { background: var(--border-mid); }
.stepper-dot.done { background: var(--accent-active); }
.stepper-dot.current { background: var(--accent); }
.stepper-dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.stepper-count {
  font-size: 0.78rem; color: var(--text-muted); font-weight: 500;
  letter-spacing: 0.01em;
}

/* One step on screen at a time. */
.lesson-step { animation: stepfade 0.18s ease; }
.lesson-step[hidden] { display: none; }
@keyframes stepfade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .lesson-step { animation: none; }
  .star-burst { display: none; }
}

.stepper-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 2.5rem; gap: 1rem;
}
.stepper-nav .nav-btn { cursor: pointer; background: none; font-family: inherit; }
.stepper-prev:disabled { opacity: 0.35; cursor: default; }
.stepper-prev:disabled:hover { border-color: var(--border); color: var(--text-muted); background: none; }
.stepper-next { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.stepper-progress-text { font-size: 0.8rem; color: var(--text-subtle); }
[hidden] { display: none !important; }

/* ── Tessl footer (shared chrome — mirrors tessl-patterns) ──────────────── */
.tessl-footer {
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border);
  padding: 3rem 1.5rem 2rem;
  margin-top: 4rem;
}
.tessl-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}
.tessl-footer-brand { display: flex; flex-direction: column; gap: 0.75rem; align-items: flex-start; }
.tessl-footer-tagline { font-size: 0.875rem; color: var(--text-muted); margin: 0; }
.tessl-footer-address { font-size: 0.8125rem; color: var(--text-subtle); margin: 0; }
.tessl-footer-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.tessl-footer-col { display: flex; flex-direction: column; gap: 0.625rem; }
.tessl-footer-col-title {
  font-size: 0.75rem; font-weight: 600; color: var(--text);
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.25rem;
}
.tessl-footer-col a {
  font-size: 0.875rem; color: var(--text-muted);
  text-decoration: none; transition: color 0.15s;
}
.tessl-footer-col a:hover { color: var(--accent); }
.tessl-footer-discord { display: inline-flex; align-items: center; gap: 0.4rem; }
.tessl-footer-discord svg { flex-shrink: 0; }
.tessl-footer-bottom {
  max-width: 1200px;
  margin: 1.5rem auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-subtle);
}

/* ── Callout boxes (opt-in, mirrors tessl-patterns) ─────────────────────── */
.callout {
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}
.callout-title {
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 0.5rem;
}
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout.callout-green { background: var(--accent-dim); border-left-color: var(--accent); }
.callout.callout-green .callout-title { color: var(--accent); }
.callout.callout-amber { background: rgba(245, 158, 11, 0.08); border-left-color: var(--amber); }
.callout.callout-amber .callout-title { color: var(--amber); }
