:root {
  color-scheme: dark;
  --bg: #0a1118;
  --bg-elevated: #101923;
  --surface: #121d27;
  --surface-soft: #17232e;
  --surface-strong: #1b2935;
  --ink: #edf3f6;
  --muted: #a2b0bb;
  --soft: #71818d;
  --line: #263642;
  --line-strong: #354956;
  --accent: #36d6aa;
  --accent-soft: rgba(54, 214, 170, 0.12);
  --blue: #75bdf7;
  --blue-soft: rgba(117, 189, 247, 0.12);
  --amber: #f1bd68;
  --amber-soft: rgba(241, 189, 104, 0.12);
  --danger: #ff9098;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
  --sidebar-width: 328px;
  --header-height: 70px;
  --shell: 1520px;
  --font-sans: "Aptos", "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: "Aptos Display", "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-family: var(--font-sans);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #eef2f0;
  --bg-elevated: #fbfdfc;
  --surface: #ffffff;
  --surface-soft: #e7eeeb;
  --surface-strong: #dae5e1;
  --ink: #0b1916;
  --muted: #304842;
  --soft: #4e645d;
  --line: #bdcdc7;
  --line-strong: #95aaa2;
  --accent: #00644f;
  --accent-soft: rgba(0, 100, 79, 0.12);
  --blue: #135b8f;
  --blue-soft: rgba(19, 91, 143, 0.11);
  --amber: #76480d;
  --amber-soft: rgba(118, 72, 13, 0.11);
  --danger: #9d2837;
  --shadow: 0 22px 60px rgba(22, 46, 39, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

body:not(.is-locked) {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

button {
  color: inherit;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 74%, transparent);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

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

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: 9px;
  background: var(--accent);
  color: #03130e;
  font-size: 0.78rem;
  font-weight: 800;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header,
.public-footer {
  width: min(calc(100% - 40px), var(--shell));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-height: 48px;
}

.brand__mark,
.domain-button__mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.69rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.brand__mark {
  width: 37px;
  height: 37px;
  border-radius: 11px;
}

.brand__copy strong,
.brand__copy small {
  display: block;
}

.brand__copy strong {
  font-size: 0.82rem;
  letter-spacing: -0.015em;
}

.brand__copy small {
  margin-top: 3px;
  color: var(--soft);
  font-size: 0.62rem;
}

.security-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 720;
}

.security-status__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 12px color-mix(in srgb, var(--danger) 58%, transparent);
}

body:not(.is-locked) .security-status__dot {
  background: var(--accent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 58%, transparent);
}

.unlock-view {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
  gap: clamp(48px, 8vw, 130px);
  align-items: center;
  width: min(calc(100% - 40px), 1240px);
  min-height: calc(100vh - 138px);
  margin: 0 auto;
  padding: 76px 0 88px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow span {
  width: 28px;
  height: 1px;
  background: currentColor;
}

.unlock-intro h1 {
  max-width: 810px;
  margin: 22px 0 0;
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 7.6vw, 7rem);
  font-weight: 720;
  letter-spacing: -0.055em;
  line-height: 0.96;
}

.unlock-intro__lede {
  max-width: 650px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(0.92rem, 1.5vw, 1.05rem);
  line-height: 1.75;
}

.unlock-pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  max-width: 760px;
  margin-top: 48px;
  border: 1px solid var(--line);
  border-radius: 17px;
  overflow: hidden;
  background: var(--line);
}

.unlock-pillars article {
  min-height: 152px;
  padding: 20px;
  background: color-mix(in srgb, var(--surface) 78%, var(--bg));
}

.unlock-pillars article > span {
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.65rem;
}

.unlock-pillars h2 {
  margin: 22px 0 0;
  font-size: 0.78rem;
}

.unlock-pillars p {
  margin: 7px 0 0;
  color: var(--soft);
  font-size: 0.68rem;
  line-height: 1.55;
}

.unlock-card {
  width: min(100%, 430px);
  justify-self: end;
  padding: clamp(28px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.unlock-card__icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 34px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
  border-radius: 15px;
  background: var(--accent-soft);
}

.unlock-card__icon::before,
.unlock-card__icon span {
  content: "";
  position: absolute;
}

.unlock-card__icon::before {
  width: 16px;
  height: 12px;
  margin-top: -11px;
  border: 2px solid var(--accent);
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
}

.unlock-card__icon span {
  width: 23px;
  height: 18px;
  margin-top: 9px;
  border-radius: 5px;
  background: var(--accent);
}

.unlock-card__kicker {
  margin: 0;
  color: var(--accent);
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.unlock-card h2 {
  margin: 9px 0 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.04em;
}

.unlock-card__copy {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.65;
}

.unlock-form {
  margin-top: 28px;
}

.unlock-form > label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 780;
}

.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--bg);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.password-field:focus-within {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--line));
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.password-field input {
  width: 100%;
  min-width: 0;
  height: 52px;
  padding: 0 6px 0 15px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  letter-spacing: 0.04em;
}

.password-field button {
  min-width: 56px;
  min-height: 42px;
  margin-right: 5px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--soft);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 800;
}

.password-field button:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 50px;
  margin-top: 12px;
  border: 1px solid var(--accent);
  border-radius: 13px;
  background: var(--accent);
  color: #041510;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 850;
  transition: transform 160ms ease, filter 160ms ease;
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.66;
}

.unlock-status {
  min-height: 20px;
  margin: 9px 0 0;
  color: var(--danger);
  font-size: 0.68rem;
  line-height: 1.5;
}

.local-note {
  display: flex;
  gap: 8px;
  margin: 17px 0 0;
  color: var(--soft);
  font-size: 0.64rem;
  line-height: 1.5;
}

.local-note span {
  color: var(--accent);
}

.public-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
  border-top: 1px solid var(--line);
  color: var(--soft);
  font-size: 0.64rem;
}

body:not(.is-locked) > .site-header,
body:not(.is-locked) > .public-footer {
  display: none;
}

.public-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  font-weight: 750;
}

.hub,
.hub-shell {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
}

.hub-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  overflow: hidden;
  transition: grid-template-columns 180ms ease;
}

.curriculum {
  position: relative;
  z-index: 40;
  display: grid;
  grid-template-areas:
    "mobile-head"
    "library-home"
    "curriculum-scroll";
  grid-template-rows: auto auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: var(--bg-elevated);
}

.curriculum__mobile-head {
  grid-area: mobile-head;
  display: none;
}

.sidebar-home-row {
  grid-area: library-home;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
  align-items: center;
  padding: 14px;
}

.domain-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  width: 100%;
  min-height: 68px;
  margin: 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.domain-button:hover {
  border-color: var(--line-strong);
}

.domain-button__mark {
  width: 39px;
  height: 39px;
  border-radius: 11px;
}

.domain-button strong,
.domain-button small {
  display: block;
}

.domain-button strong {
  font-size: 0.88rem;
}

.domain-button small {
  margin-top: 3px;
  color: var(--soft);
  font-size: 0.7rem;
}

.domain-button > span:last-child {
  color: var(--soft);
  font-size: 0.9rem;
}

.sidebar-collapse-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 1.2rem;
}

.sidebar-collapse-button:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: var(--accent-soft);
  color: var(--accent);
}

.sidebar-resize-handle {
  position: absolute;
  z-index: 55;
  top: 0;
  right: 0;
  width: 10px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}

.sidebar-resize-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 2px;
  width: 3px;
  height: 56px;
  border-radius: 999px;
  background: var(--line-strong);
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity 150ms ease, background-color 150ms ease;
}

.sidebar-resize-handle:hover::after,
.sidebar-resize-handle:focus-visible::after,
body.is-resizing-sidebar .sidebar-resize-handle::after {
  background: var(--accent);
  opacity: 1;
}

body.sidebar-collapsed .hub-shell {
  grid-template-columns: 0 minmax(0, 1fr);
}

body.sidebar-collapsed .curriculum {
  visibility: hidden;
  border-right: 0;
  opacity: 0;
  pointer-events: none;
}

body.sidebar-collapsed .menu-button {
  display: grid;
}

body.is-resizing-sidebar,
body.is-resizing-sidebar * {
  cursor: col-resize !important;
  user-select: none !important;
}

body.is-resizing-sidebar .hub-shell {
  transition: none;
}

.curriculum__scroll {
  grid-area: curriculum-scroll;
  width: 100%;
  min-height: 0;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: scroll;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.module-list {
  padding: 1px 14px 24px;
}

.collection-nav + .collection-nav {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.collection-nav__head {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  margin-bottom: 0;
  padding: 9px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.collection-nav__head:hover,
.collection-nav__head.is-current {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  background: var(--accent-soft);
}

.collection-nav__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  border-radius: 9px;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.68rem;
  font-weight: 850;
}

.collection-nav__head strong,
.collection-nav__head small {
  display: block;
}

.collection-nav__head strong {
  font-size: 0.79rem;
  line-height: 1.35;
}

.collection-nav__head small {
  margin-top: 4px;
  color: var(--soft);
  font-size: 0.65rem;
  line-height: 1.35;
}

.collection-nav__head > span:last-child {
  color: var(--accent);
  font-size: 0.8rem;
}

.collection-nav__head[aria-expanded="true"] {
  margin-bottom: 7px;
}

.collection-nav__chevron {
  transition: transform 160ms ease;
}

.collection-nav__head[aria-expanded="true"] .collection-nav__chevron {
  transform: rotate(90deg);
}

.collection-nav__body {
  min-width: 0;
}

.module-group + .module-group {
  margin-top: 4px;
}

.module-toggle {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  width: 100%;
  min-height: 50px;
  padding: 10px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.module-toggle:hover,
.module-toggle[aria-expanded="true"] {
  background: var(--surface-soft);
}

.module-number {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--soft);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.6rem;
  font-weight: 780;
}

.module-toggle[aria-expanded="true"] .module-number {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  background: var(--accent-soft);
  color: var(--accent);
}

.module-toggle__copy strong,
.module-toggle__copy small {
  display: block;
}

.module-toggle__copy strong {
  font-size: 0.77rem;
  line-height: 1.38;
}

.module-toggle__copy small {
  margin-top: 4px;
  color: var(--soft);
  font-size: 0.65rem;
}

.module-chevron {
  margin-top: 6px;
  color: var(--soft);
  font-size: 0.66rem;
  transition: transform 160ms ease;
}

.module-toggle[aria-expanded="true"] .module-chevron {
  transform: rotate(90deg);
}

.lesson-list {
  display: grid;
  gap: 2px;
  margin: 2px 0 8px 36px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.lesson-link {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 39px;
  padding: 7px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.72rem;
  line-height: 1.4;
  text-align: left;
}

.lesson-link:hover,
.lesson-link[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--ink);
}

.lesson-link[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -13px;
  width: 2px;
  height: 22px;
  border-radius: 2px;
  background: var(--accent);
}

.lesson-link__state {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--soft);
  font-size: 0.52rem;
}

.lesson-link.is-complete .lesson-link__state {
  border-color: var(--accent);
  background: var(--accent);
  color: #041510;
}

.lesson-link.is-planned .lesson-link__state {
  border-radius: 5px;
  font-size: 0;
}

.lesson-link.is-planned .lesson-link__state::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--soft);
}

.workspace {
  position: relative;
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--bg);
}

.workspace-bar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 70px;
  padding: 10px clamp(18px, 3vw, 40px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 91%, transparent);
  backdrop-filter: blur(18px);
}

html[data-theme="light"] .workspace-bar {
  background: rgba(251, 253, 252, 0.98);
  backdrop-filter: none;
}

.workspace-bar__left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  width: min(100%, 670px);
}

.icon-button,
.text-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.icon-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 11px;
}

.menu-button {
  display: none;
}

.search-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 46px;
  padding: 0 9px 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-box:focus-within {
  border-color: color-mix(in srgb, var(--accent) 68%, var(--line));
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.search-box > span:first-child {
  color: var(--soft);
  font-size: 1rem;
}

.search-box input {
  min-width: 0;
  height: 42px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.75rem;
}

.search-box input::placeholder {
  color: var(--soft);
}

.search-box kbd {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--soft);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.55rem;
}

.workspace-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 0.66rem;
  font-weight: 780;
}

.text-button:hover,
.icon-button:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.text-button--danger:hover {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--line));
  color: var(--danger);
}

.search-results {
  position: absolute;
  z-index: 50;
  top: 61px;
  left: clamp(18px, 3vw, 40px);
  width: min(calc(100% - 36px), 670px);
  max-height: min(62vh, 530px);
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
}

.search-results__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 8px 10px;
  color: var(--soft);
  font-size: 0.6rem;
}

.search-result {
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.search-result:hover {
  background: var(--surface-soft);
}

.search-result__number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--soft);
  font-size: 0.58rem;
}

.search-result strong,
.search-result small {
  display: block;
}

.search-result strong {
  font-size: 0.7rem;
  line-height: 1.35;
}

.search-result small {
  margin-top: 3px;
  color: var(--soft);
  font-size: 0.58rem;
}

.search-result__status {
  color: var(--accent);
  font-size: 0.56rem;
}

.search-empty {
  padding: 28px 18px;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
}

.reading-progress {
  position: sticky;
  z-index: 29;
  top: 69px;
  height: 2px;
  background: transparent;
}

.reading-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 80ms linear;
}

.reader-wrap {
  width: min(calc(100% - 48px), 1050px);
  margin: 0 auto;
  padding: clamp(48px, 7vw, 88px) 0 96px;
}

.lesson-reader {
  min-height: calc(100vh - 200px);
}

.reader-hero {
  padding-bottom: 34px;
  border-bottom: 1px solid var(--line);
}

.reader-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin: 0;
  color: var(--soft);
  font-size: 0.65rem;
}

.reader-breadcrumb span:last-child {
  color: var(--accent);
}

.reader-hero h1 {
  max-width: 900px;
  margin: 18px 0 0;
  font-family: var(--font-display);
  font-size: clamp(2.9rem, 6.4vw, 5.6rem);
  font-weight: 720;
  letter-spacing: -0.055em;
  line-height: 1;
}

.reader-deck {
  max-width: 800px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(1.08rem, 1.4vw, 1.18rem);
  line-height: 1.78;
}

.reader-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.reader-meta span {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--soft);
  font-size: 0.69rem;
}

.reader-meta .status-live {
  border-color: color-mix(in srgb, var(--accent) 36%, var(--line));
  background: var(--accent-soft);
  color: var(--accent);
}

.reader-meta .status-planned {
  border-color: color-mix(in srgb, var(--amber) 35%, var(--line));
  background: var(--amber-soft);
  color: var(--amber);
}

.reader-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-top: 24px;
}

.complete-button,
.source-policy-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 43px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 780;
}

.complete-button:hover,
.complete-button[aria-pressed="true"],
.source-policy-link:hover {
  border-color: color-mix(in srgb, var(--accent) 44%, var(--line));
  background: var(--accent-soft);
  color: var(--accent);
}

.complete-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.complete-button__check {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.52rem;
}

.lesson-body {
  max-width: 820px;
  margin: 0 auto;
  padding-top: 16px;
}

.lesson-section {
  padding-top: 56px;
  scroll-margin-top: 92px;
}

.section-heading {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 13px;
  align-items: start;
  margin-bottom: 22px;
}

.section-heading span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.62rem;
}

.section-heading h2 {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.content-block + .content-block {
  margin-top: 18px;
}

.content-paragraph,
.content-list,
.content-table,
.flow-diagram,
.content-callout {
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: clamp(1.1rem, 1.05rem + 0.18vw, 1.2rem);
  line-height: 1.86;
}

.content-paragraph {
  margin: 0;
}

.content-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 22px;
}

.content-list li::marker {
  color: var(--accent);
}

.inline-citation {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  margin: 0 2px;
  padding: 0 5px;
  border: 1px solid color-mix(in srgb, var(--blue) 35%, var(--line));
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--blue);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.68rem;
  font-weight: 850;
  line-height: 1;
  vertical-align: 0.08em;
}

.content-callout {
  padding: 18px 20px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line));
  border-radius: 13px;
  background: var(--accent-soft);
}

.content-callout[data-tone="caution"] {
  border-color: color-mix(in srgb, var(--amber) 30%, var(--line));
  background: var(--amber-soft);
}

.content-callout strong {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.content-callout p {
  margin: 0;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.content-table {
  width: 100%;
  min-width: 590px;
  border-collapse: collapse;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.9rem;
  line-height: 1.62;
}

.content-table th,
.content-table td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.content-table th {
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.content-table tr:last-child td {
  border-bottom: 0;
}

.flow-diagram {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 18px;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.flow-step {
  position: relative;
  min-height: 90px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}

.flow-step:not(:last-child)::after {
  content: "→";
  position: absolute;
  top: 50%;
  right: -16px;
  color: var(--accent);
  transform: translateY(-50%);
}

.flow-step span {
  display: block;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.flow-step strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.38;
}

.flow-step small {
  display: block;
  margin-top: 5px;
  color: var(--soft);
  font-size: 0.78rem;
  line-height: 1.55;
}

.reference-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.reference-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.reference-item__number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.6rem;
  font-weight: 820;
}

.reference-item strong,
.reference-item span,
.reference-item small {
  display: block;
}

.reference-item strong {
  font-size: 0.9rem;
  line-height: 1.45;
}

.reference-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.reference-item small {
  margin-top: 5px;
  color: var(--soft);
  font-size: 0.72rem;
}

.reference-item a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 800;
}

.reference-item a:hover {
  border-color: color-mix(in srgb, var(--blue) 45%, var(--line));
  background: var(--blue-soft);
}

.lesson-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 820px;
  margin: 64px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.lesson-nav button {
  min-height: 82px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.lesson-nav button:last-child {
  text-align: right;
}

.lesson-nav button:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  background: var(--accent-soft);
}

.lesson-nav button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.lesson-nav small,
.lesson-nav strong {
  display: block;
}

.lesson-nav small {
  color: var(--soft);
  font-size: 0.7rem;
}

.lesson-nav strong {
  margin-top: 7px;
  font-size: 0.84rem;
  line-height: 1.4;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 34px;
  align-items: end;
  padding-bottom: 42px;
  border-bottom: 1px solid var(--line);
}

.home-hero h1 {
  max-width: 760px;
  margin: 18px 0 0;
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 7vw, 6.4rem);
  font-weight: 720;
  letter-spacing: -0.06em;
  line-height: 0.95;
}

.home-hero__lede {
  max-width: 710px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.78;
}

.home-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--line);
  gap: 1px;
}

.home-stats div {
  min-height: 94px;
  padding: 17px;
  background: var(--surface);
}

.home-stats strong,
.home-stats span {
  display: block;
}

.home-stats strong {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
}

.home-stats span {
  margin-top: 7px;
  color: var(--soft);
  font-size: 0.72rem;
}

.home-section {
  padding-top: 60px;
}

.home-section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 22px;
}

.home-section__head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
}

.home-section__head p {
  max-width: 480px;
  margin: 0;
  color: var(--soft);
  font-size: 0.82rem;
  line-height: 1.62;
  text-align: right;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.collection-card {
  display: flex;
  flex-direction: column;
  min-height: 330px;
  padding: clamp(24px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
}

.collection-card:first-child {
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--blue) 9%, transparent), transparent 58%),
    var(--surface);
}

.collection-card:last-child {
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 58%),
    var(--surface);
}

.collection-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.collection-card__top span:first-child {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line));
  border-radius: 11px;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.76rem;
  font-weight: 850;
}

.collection-card__top span:last-child {
  color: var(--soft);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.collection-card h2 {
  margin: 32px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.collection-card > p {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.collection-card__metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.collection-card__metrics span {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--soft);
  font-size: 0.72rem;
}

.collection-card button {
  align-self: flex-start;
  margin-top: auto;
  padding: 18px 0 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 820;
}

.mental-model {
  display: grid;
  grid-template-columns: repeat(7, minmax(90px, 1fr));
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.mental-model article {
  min-height: 108px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}

.mental-model span {
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.56rem;
}

.mental-model strong {
  display: block;
  margin-top: 19px;
  font-size: 0.65rem;
  line-height: 1.42;
}

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

.module-card {
  display: flex;
  flex-direction: column;
  min-height: 180px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}

.module-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.module-card__top span:first-child {
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.61rem;
}

.module-card__top span:last-child {
  color: var(--soft);
  font-size: 0.56rem;
}

.module-card h3 {
  margin: 17px 0 0;
  font-size: 0.95rem;
  line-height: 1.42;
}

.module-card p {
  margin: 8px 0 0;
  color: var(--soft);
  font-size: 0.78rem;
  line-height: 1.62;
}

.module-card__evidence {
  display: grid;
  gap: 4px;
  margin: 12px 0 16px;
  padding: 10px 11px;
  border-left: 2px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: var(--accent-soft);
  font-size: 0.7rem;
  line-height: 1.55;
}

.module-card__evidence strong {
  color: var(--accent);
  font-size: 0.61rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.module-card__evidence span {
  color: var(--muted);
}

.module-card button {
  align-self: flex-start;
  min-height: 34px;
  margin-top: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 820;
}

.policy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.policy-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.policy-card strong {
  display: block;
  color: var(--ink);
  font-size: 0.82rem;
}

.policy-card p {
  margin: 7px 0 0;
  color: var(--soft);
  font-size: 0.78rem;
  line-height: 1.64;
}

.source-library {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.source-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.source-card__org {
  margin: 0;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.source-card h3 {
  margin: 9px 0 0;
  font-size: 0.88rem;
  line-height: 1.45;
}

.source-card p {
  margin: 7px 0 0;
  color: var(--soft);
  font-size: 0.76rem;
  line-height: 1.62;
}

.source-card a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-top: 8px;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 800;
}

.planned-template {
  max-width: 820px;
  margin: 48px auto 0;
  padding: 24px;
  border: 1px solid color-mix(in srgb, var(--amber) 28%, var(--line));
  border-radius: 14px;
  background: var(--amber-soft);
}

.planned-template h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
}

.planned-template p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.72;
}

.planned-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 18px;
}

.planned-sections span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--soft);
  font-size: 0.62rem;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 20px;
  bottom: 20px;
  max-width: min(calc(100% - 40px), 360px);
  padding: 12px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--bg-elevated);
  color: var(--ink);
  box-shadow: var(--shadow);
  font-size: 0.7rem;
}

.noscript-message {
  position: fixed;
  z-index: 200;
  inset: 20px;
  display: grid;
  place-items: center;
  border: 1px solid var(--danger);
  border-radius: 20px;
  background: var(--bg);
  color: var(--ink);
  text-align: center;
}

@media (max-width: 1180px) {
  :root {
    --sidebar-width: 292px;
  }

  .mental-model {
    grid-template-columns: repeat(4, minmax(100px, 1fr));
  }
}

@media (max-width: 960px) {
  body:not(.is-locked) {
    overflow: hidden;
  }

  .unlock-view {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .unlock-card {
    justify-self: start;
  }

  .hub-shell {
    display: block;
    transition: none;
  }

  .curriculum {
    position: fixed;
    z-index: 70;
    inset: 0 auto 0 0;
    width: min(88vw, 340px);
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    box-shadow: var(--shadow);
    transform: translateX(-105%);
    transition: transform 200ms ease;
  }

  body.sidebar-open .curriculum {
    transform: translateX(0);
  }

  body.sidebar-collapsed .curriculum {
    visibility: visible;
    border-right: 1px solid var(--line);
    opacity: 1;
    pointer-events: auto;
  }

  .curriculum__mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--line);
    font-size: 0.72rem;
  }

  .sidebar-home-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar-collapse-button,
  .sidebar-resize-handle {
    display: none;
  }

  .sidebar-scrim {
    position: fixed;
    z-index: 60;
    inset: 0;
    display: block !important;
    background: rgba(0, 0, 0, 0.48);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
  }

  body.sidebar-open .sidebar-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .menu-button {
    display: grid;
  }

  .workspace {
    width: 100%;
  }

  .home-hero {
    grid-template-columns: 1fr;
  }

  .home-stats {
    max-width: 520px;
  }

  .module-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .site-header,
  .public-footer,
  .unlock-view {
    width: min(calc(100% - 28px), var(--shell));
  }

  .unlock-view {
    gap: 56px;
    padding: 54px 0 66px;
  }

  .unlock-intro h1 {
    font-size: clamp(3.25rem, 15vw, 5.4rem);
  }

  .unlock-pillars {
    grid-template-columns: 1fr;
  }

  .unlock-pillars article {
    min-height: 120px;
  }

  .unlock-pillars h2 {
    margin-top: 14px;
  }

  .public-footer {
    flex-direction: column;
    justify-content: center;
    padding: 16px 0;
    text-align: center;
  }

  .workspace-bar {
    gap: 9px;
    padding-inline: 12px;
  }

  .search-box kbd,
  .text-button span:last-child {
    display: none;
  }

  .text-button {
    width: 42px;
    padding: 0;
  }

  .search-results {
    left: 12px;
    width: calc(100% - 24px);
  }

  .reader-wrap {
    width: min(calc(100% - 28px), 1050px);
    padding-top: 44px;
  }

  .reader-hero h1,
  .home-hero h1 {
    font-size: clamp(2.8rem, 13vw, 4.5rem);
  }

  .section-heading {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .section-heading span {
    width: 28px;
    height: 28px;
  }

  .flow-diagram {
    grid-template-columns: 1fr;
  }

  .flow-step:not(:last-child)::after {
    top: auto;
    right: 50%;
    bottom: -19px;
    transform: translateX(50%) rotate(90deg);
  }

  .reference-item {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .reference-item a {
    grid-column: 2;
    justify-self: start;
  }

  .home-section__head {
    display: block;
  }

  .home-section__head p {
    margin-top: 9px;
    text-align: left;
  }

  .mental-model,
  .collection-grid,
  .module-overview,
  .policy-grid,
  .source-library {
    grid-template-columns: 1fr;
  }

  .lesson-nav {
    grid-template-columns: 1fr;
  }

  .lesson-nav button:last-child {
    text-align: left;
  }

  .planned-sections {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .brand__copy small {
    display: none;
  }

  .security-status {
    font-size: 0.6rem;
  }

  .unlock-card {
    padding: 24px;
  }

  .reader-wrap {
    width: min(calc(100% - 22px), 1050px);
  }

  .workspace-bar {
    padding-inline: 8px;
  }

  .search-results {
    left: 8px;
    width: calc(100% - 16px);
  }

  .home-stats {
    grid-template-columns: 1fr;
  }

  .home-stats div {
    min-height: 80px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
