/* The lessons at /learn/. The figure on the left, the steps on the right; on a phone they stack and the step you are
   on carries its own readout. Every size, gap and radius comes from the tokens in styles.css. */
.lesson { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; gap: var(--s-6); }
.lesson-figure { margin: 0; position: sticky; top: calc(var(--s-12) + var(--s-3)); gap: var(--s-6); }
.lesson-figure svg { display: block; width: 100%; height: auto; }

.f-label { fill: var(--muted); font: 500 var(--t-xs) var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }
.f-name { fill: var(--ink-2); font: 500 var(--t-sm) var(--sans); }
.f-num { fill: var(--ink); font: 500 var(--t-sm) var(--mono); }
.f-track { fill: var(--well); }
.f-bar-before { fill: var(--ink-2); }
.f-bar { fill: var(--ink); }
.f-sq { fill: var(--accent-wash); }
.f-more { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.f-won { fill: var(--ink); }

/* The sentence the model is finishing, and the ten words it came back with. */
.prompt { margin: 0; font-size: var(--t-lg); line-height: var(--l-lg); color: var(--ink-2); }
.prompt b { color: var(--ink); font-weight: 600; white-space: nowrap; }
.asks-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3) var(--s-6); }
.f-label-html { margin: 0; color: var(--muted); font: 500 var(--t-xs)/var(--l-xs) var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }
.asks { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s-2); margin: 0; padding: 0; list-style: none; }
.asks li { padding: var(--s-2) var(--s-1); border: 1px solid var(--ink); border-radius: var(--r-md); background: var(--ink); color: var(--bg); font-size: var(--t-sm); line-height: var(--l-sm); font-weight: 500; text-align: center; white-space: nowrap; overflow: hidden; transition: background-color 300ms var(--ease), color 300ms var(--ease), border-color 300ms var(--ease); }
.asks li.other { border-color: var(--line-2); background: transparent; color: var(--ink); }

/* Systems as chips, filled when joined; the questions with what each still needs, in words. */
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: 0; padding: 0; list-style: none; }
.chips li { padding: var(--s-1) var(--s-3); border: 1px solid var(--ink); border-radius: var(--r-md); background: var(--ink); color: var(--bg); font-size: var(--t-sm); line-height: var(--l-sm); font-weight: 500; white-space: nowrap; transition: background-color 300ms var(--ease), color 300ms var(--ease), border-color 300ms var(--ease); }
.chips li.off { border-color: var(--line-2); background: transparent; color: var(--ink); }
.qs { display: grid; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.qs li { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: var(--s-1) var(--s-3); align-items: baseline; padding: var(--s-2) 0; border-bottom: 1px solid var(--line); font-size: var(--t-sm); line-height: var(--l-sm); }
.qs li::before { content: ""; width: 10px; height: 10px; border: 1px solid var(--ink); border-radius: 2px; background: var(--ink); }
.qs li.off::before { border-color: var(--line-2); background: transparent; }
.qs li.off span { color: var(--muted); }
.qs em { grid-column: 2; color: var(--muted); font: 500 var(--t-xs)/var(--l-xs) var(--mono); font-style: normal; letter-spacing: 0.04em; }
.qs li:not(.off) em { color: var(--ink); }
.toggles { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.toggle { position: relative; display: inline-flex; padding: var(--s-2) var(--s-4); border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--surface); font-size: var(--t-sm); line-height: var(--l-sm); font-weight: 500; white-space: nowrap; cursor: pointer; transition: background-color 300ms var(--ease), color 300ms var(--ease), border-color 300ms var(--ease); }
.toggle:hover { border-color: var(--ink-2); }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle:has(input:checked) { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.toggle:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.lesson-step .toggle-label { margin: 0; color: var(--muted); font: 500 var(--t-xs)/var(--l-xs) var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }

.f-key { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-6); margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: var(--t-xs); line-height: var(--l-xs); }
.f-key li { display: inline-flex; align-items: center; gap: var(--s-3); white-space: nowrap; }
.f-key i { width: 12px; height: 12px; border-radius: 2px; }
.f-key .k-sq { background: var(--accent-wash); }
.f-key .k-more { border: 1px solid var(--ink); }
.f-key .k-won { background: var(--ink); }

.readouts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-5) var(--s-6); margin: 0; padding-top: var(--s-5); border-top: 1px solid var(--line); }
.readouts div { display: grid; gap: var(--s-1); align-content: start; }
.readouts dt { color: var(--muted); font: 500 var(--t-xs)/var(--l-xs) var(--mono); letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.readouts dd { margin: 0; font-size: var(--t-2xl); line-height: var(--l-2xl); font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.readouts dd small { display: block; color: var(--muted); font-size: var(--t-sm); line-height: var(--l-sm); font-weight: 400; letter-spacing: 0; }

.lesson-steps { display: grid; gap: var(--s-4); margin: 0; padding: 0; list-style: none; }
.lesson-step { display: grid; gap: var(--s-4); padding: var(--s-6); border: 1px solid var(--line); border-radius: var(--r-2xl); background: var(--surface); transition: opacity 300ms var(--ease); }
.lesson-step.locked { opacity: 0.45; }
/* The step's number and name on one line, its question on the line under it. */
.lesson-step-head { display: grid; gap: var(--s-2); }
.lesson-step-head span { color: var(--muted); font: 500 var(--t-xs)/var(--l-xs) var(--mono); letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.lesson-step-head b { font-size: var(--t-xl); line-height: var(--l-xl); font-weight: 600; letter-spacing: -0.01em; }
.lesson-step p { color: var(--ink-2); font-size: var(--t-base); line-height: var(--l-base); }
.lesson-step .note { color: var(--muted); font-size: var(--t-sm); line-height: var(--l-sm); }

.slider { display: grid; gap: var(--s-2); }
.slider span { display: flex; justify-content: space-between; gap: var(--s-4); font-size: var(--t-sm); line-height: var(--l-sm); }
.slider span b { font-weight: 500; white-space: nowrap; }
.slider span output { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.slider input { width: 100%; margin: 0; accent-color: var(--ink); }
.slider-set { display: grid; gap: var(--s-5); }
.lesson-step details { border-top: 1px solid var(--line); padding-top: var(--s-4); }
.lesson-step summary { cursor: pointer; font-size: var(--t-sm); line-height: var(--l-sm); font-weight: 500; }
.lesson-step details[open] summary { margin-bottom: var(--s-5); }

.inline-read { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); margin: 0; font-size: var(--t-sm); line-height: var(--l-sm); }
.inline-read div { display: flex; gap: var(--s-2); white-space: nowrap; }
.inline-read dt { color: var(--muted); }
.inline-read dd { margin: 0; font-family: var(--mono); font-variant-numeric: tabular-nums; }

.lesson-step textarea { width: 100%; min-height: 112px; padding: var(--s-4); border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--bg); color: var(--ink); font: var(--t-base)/var(--l-base) var(--sans); resize: vertical; }
.lesson-step textarea:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.ours { display: grid; gap: var(--s-3); padding: var(--s-5); border-radius: var(--r-lg); background: var(--well); }
.ours p { color: var(--ink); }
.step-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }

.model { display: grid; gap: var(--s-4); margin: 0; padding: 0; list-style: none; }
.model li { padding-bottom: var(--s-4); border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: var(--t-lg); line-height: var(--l-lg); }
.model li b { color: var(--ink); font-weight: 600; }

.course { display: grid; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.course li { display: grid; grid-template-columns: var(--s-9) minmax(0, 1fr) auto; align-items: baseline; gap: var(--s-4); padding: var(--s-5) 0; border-bottom: 1px solid var(--line); }
.course .n, .course em { color: var(--muted); font: 500 var(--t-xs)/var(--l-xs) var(--mono); font-style: normal; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.course b { font-size: var(--t-xl); line-height: var(--l-xl); font-weight: 600; letter-spacing: -0.01em; }
.course a { color: inherit; text-decoration: none; }
.course a:hover b, .course a:focus-visible b { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.course .here b { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.course .here em { color: var(--ink); }

.lesson-step-head b, .course b, .slider b, .prompt { text-wrap: balance; }
.lesson-step p, .model li, .ours p, .qs span { text-wrap: pretty; }

@media (max-width: 960px) {
  .lesson { grid-template-columns: minmax(0, 1fr); }
  .lesson-figure { position: static; }
}
@media (max-width: 600px) {
  .lesson-step { padding: var(--s-5); }
  .readouts dd { font-size: var(--t-xl); line-height: var(--l-xl); }
  .course li { grid-template-columns: var(--s-7) minmax(0, 1fr); }
  .course em { grid-column: 2; }
  .asks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
