:root {
  color-scheme: light;
  --ink: #17324d;
  --muted: #65788a;
  --paper: #ffffff;
  --canvas: #edf4f5;
  --line: #d6e1e5;
  --navy: #173f5f;
  --navy-dark: #102e47;
  --teal: #2b8a88;
  --teal-soft: #dff3f0;
  --shadow: 0 18px 48px rgba(18, 52, 75, .12);
  font-family: Inter, Aptos, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(43, 138, 136, .11), transparent 25rem),
    linear-gradient(180deg, #f6faf9 0, #edf4f5 52%, #e7eff1 100%);
  -webkit-font-smoothing: antialiased;
}

.shell {
  width: min(960px, calc(100% - 40px));
  margin: 0 auto;
  padding: 72px 0;
}

.masthead,
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.masthead {
  padding-bottom: 40px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--teal);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.5rem, 7vw, 4.75rem);
  font-weight: 500;
  letter-spacing: -.045em;
  line-height: .98;
}

.intro {
  max-width: 580px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

code {
  padding: .12em .36em;
  border-radius: 4px;
  background: rgba(255, 255, 255, .72);
  font-family: inherit;
  font-size: .9em;
}

.published-at {
  flex: 0 0 auto;
  margin: 0;
  color: var(--muted);
  font-size: .75rem;
  line-height: 1.5;
  text-align: right;
}

.published-at strong { color: var(--navy); }

.section-heading { margin: 44px 0 18px; }

h2 {
  margin-bottom: 0;
  font-size: 1.1rem;
}

.lesson-count {
  margin-bottom: 0;
  color: var(--muted);
  font-size: .9rem;
}

.lesson-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.folder-node { display: block; }

.folder-node + .folder-node,
.folder-node + .lesson-file-row,
.lesson-file-row + .folder-node,
.lesson-file-row + .lesson-file-row { border-top: 1px solid #e3ebed; }

.folder-summary {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.folder-summary::-webkit-details-marker { display: none; }
.folder-summary:hover { background: #f7fbfb; }
.folder-summary:focus-visible { outline: 3px solid rgba(43, 138, 136, .28); outline-offset: -3px; }

.folder-chevron {
  width: 14px;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  transition: transform .15s ease;
}

.folder-node[open] > .folder-summary .folder-chevron { transform: rotate(90deg); }

.folder-icon {
  position: relative;
  width: 20px;
  height: 14px;
  border-radius: 3px;
  background: var(--teal);
}

.folder-icon::before {
  position: absolute;
  top: -4px;
  left: 1px;
  width: 9px;
  height: 5px;
  border-radius: 3px 3px 0 0;
  background: var(--teal);
  content: "";
}

.folder-name { font-size: .91rem; font-weight: 800; }

.folder-count {
  margin-left: auto;
  color: var(--muted);
  font-size: .73rem;
}

.folder-children {
  margin-left: 25px;
  border-left: 1px solid var(--line);
}

.folder-children:empty { display: none; }

.lesson-file-row {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  min-height: 58px;
  padding: 9px 16px 9px 20px;
  color: inherit;
  background: transparent;
  text-decoration: none;
  transition: background .14s ease;
}

.lesson-file-row:hover { background: #f7fbfb; }
.lesson-file-row:focus-visible { outline: 3px solid rgba(43, 138, 136, .28); outline-offset: -3px; }

.lesson-icon {
  display: grid;
  flex: 0 0 38px;
  height: 30px;
  place-items: center;
  border-radius: 6px;
  color: var(--teal);
  background: var(--teal-soft);
  font-size: .58rem;
  font-weight: 900;
  letter-spacing: .04em;
}

.lesson-copy { min-width: 0; }

.lesson-file-name {
  overflow: hidden;
  margin-bottom: 2px;
  font-size: .9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lesson-title {
  overflow-wrap: anywhere;
  margin-bottom: 0;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.35;
}

.lesson-action {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--navy);
  font-size: .75rem;
  font-weight: 800;
}

.status {
  margin: 0;
  padding: 30px 20px;
  color: var(--muted);
  text-align: center;
}

.status.error { color: #9f2d20; }

@media (max-width: 680px) {
  .shell { width: min(100% - 24px, 960px); padding: 42px 0; }
  .masthead { align-items: start; flex-direction: column; }
  .published-at { text-align: left; }
  .section-heading { align-items: start; flex-direction: column; gap: 6px; }
  .folder-children { margin-left: 14px; }
  .lesson-file-row { gap: 10px; padding-left: 12px; }
  .lesson-action { display: none; }
}
