/* Static lesson and path pages (/learn/<slug>/), written by tools/pages.mjs. Same paper, ink and type as the app. No JavaScript. */
:root {
  color-scheme: light dark;
  --paper: #f5f1e6;
  --card: #f8f5ec;
  --ink: #2a2a2e;
  --ink-2: #5d5a55;
  --ink-3: #726c63;
  --line: rgba(42, 42, 46, .12);
  --green: #1f9d55;
  --green-dark: #146b3a;
  --green-tint: rgba(31, 157, 85, .09);
  --shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 6px 18px -12px rgba(60, 45, 20, .35);
  --serif: "Iowan Old Style", "Charter", "Palatino Linotype", ui-serif, Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1d1c1a;
    --card: #262522;
    --ink: #ece6d8;
    --ink-2: #c3bcad;
    --ink-3: #9a9384;
    --line: rgba(236, 230, 216, .14);
    --green: #3cc078;
    --green-dark: #7fd6a3;
    --green-tint: rgba(60, 192, 120, .12);
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body.pg { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); line-height: 1.5; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-wrap: break-word; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 8px; }
svg { flex: none; }

.top, .wrap, .foot { max-width: 640px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }

/* breadcrumb */
.top { padding-top: calc(10px + var(--safe-top)); }
.crumbs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; font-size: 15px; color: var(--ink-2); }
.crumbs li + li::before { content: "›"; margin: 0 9px; color: var(--ink-3); }
.crumbs a { display: inline-block; padding: 11px 0; text-decoration: none; }
.crumbs li:first-child a { font-weight: 600; color: var(--ink); }
.crumbs a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* title block */
.kicker { font-size: 14px; color: var(--ink-3); margin: 22px 0 0; }
h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 9.4vw, 46px); line-height: 1.08; letter-spacing: -.015em; margin: 8px 0 12px; text-wrap: balance; }
.dek { font-family: var(--serif); font-size: 20px; line-height: 1.4; color: var(--ink-2); margin: 0; text-wrap: pretty; }
.cover { margin: 22px 0 0; background: #f8f5ec; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); }
.cover img { display: block; width: 100%; height: auto; }
@media (prefers-color-scheme: dark) { .cover { border-color: transparent; } .cover img { filter: brightness(.93); } }

/* the one button: open the drawn version in the app */
.open {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; margin: 18px 0 0; padding: 0 24px;
  border-radius: 28px; background: var(--ink); color: var(--paper); font-size: 17px; font-weight: 600; text-decoration: none;
  transition: transform .15s ease, opacity .2s ease;
}
.open:hover { opacity: .9; }
.open:active { transform: scale(.98); }

/* the cards, as text */
.cards { list-style: none; counter-reset: card; margin: 32px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.cards li { counter-increment: card; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px 20px 18px; box-shadow: var(--shadow); }
.cards li::before { content: counter(card); display: block; font-size: 13px; color: var(--ink-3); margin-bottom: 4px; }
.cards p { margin: 0; font-family: var(--serif); font-size: 20px; line-height: 1.45; text-wrap: pretty; }

.label { font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--ink-3); margin: 0 0 8px; }

/* quiz: the answer stays folded until asked for */
.quiz { margin: 32px 0 0; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 18px 20px 12px; box-shadow: var(--shadow); }
.quiz .q { font-family: var(--serif); font-size: 22px; line-height: 1.3; margin: 0; text-wrap: pretty; }
.opts { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.opts li { padding: 12px 16px; border: 1.5px solid var(--line); border-radius: 14px; font-size: 17px; line-height: 1.3; transition: border-color .25s ease, background .25s ease, opacity .25s ease; }
.quiz:has(details[open]) .opts li.right { border-color: var(--green); background: var(--green-tint); color: var(--green-dark); }
.quiz:has(details[open]) .opts li:not(.right) { opacity: .5; }
.quiz details { margin-top: 6px; }
.quiz summary { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; color: var(--green-dark); font-weight: 600; font-size: 16px; list-style: none; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); }
.quiz summary::-webkit-details-marker { display: none; }
.quiz details[open] summary { color: var(--ink-3); text-decoration: none; }
.quiz .ans { font-family: var(--serif); font-size: 20px; line-height: 1.35; margin: 0; color: var(--green-dark); }
.quiz .why { font-family: var(--serif); font-size: 18px; line-height: 1.45; color: var(--ink-2); margin: 6px 0 8px; text-wrap: pretty; }

/* the line to keep */
.keep { margin: 34px 0 0; }
.take { font-family: var(--serif); font-size: clamp(26px, 7.2vw, 32px); line-height: 1.3; margin: 0; text-decoration: underline; text-decoration-color: var(--green); text-decoration-thickness: 3px; text-underline-offset: 8px; text-wrap: balance; }

.src { margin: 30px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }
.src p { margin: 0; font-family: var(--serif); font-size: 16px; line-height: 1.55; color: var(--ink-2); overflow-wrap: anywhere; }

.try { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 20px 0 0; padding: 13px 16px; min-height: 48px; border: 1px solid var(--line); border-radius: 14px; color: var(--green-dark); text-decoration: none; font-size: 16px; }
.try:hover { background: var(--green-tint); }

/* previous, next, the whole path */
.pn { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 36px 0 0; }
.step { display: flex; flex-direction: column; gap: 4px; padding: 14px 18px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; text-decoration: none; box-shadow: var(--shadow); }
.step span { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink-3); }
.step b { font-family: var(--serif); font-weight: 400; font-size: 19px; line-height: 1.25; }
.step.next span { justify-content: flex-end; }
.step.next { text-align: right; }
.step:hover b { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.pn .all { grid-column: 1 / -1; display: block; text-align: center; padding: 12px; font-size: 15px; color: var(--ink-2); text-underline-offset: 3px; text-decoration-color: var(--line); }
@media (min-width: 620px) {
  .pn { grid-template-columns: 1fr 1fr; }
  .step.next:first-child { grid-column: 2; }
}

/* path page: its lessons, like the app's path view */
.list { list-style: none; margin: 26px 0 0; padding: 0; border-top: 1px solid var(--line); }
.list a { display: flex; align-items: center; gap: 14px; padding: 16px 4px; border-bottom: 1px solid var(--line); text-decoration: none; }
.list a:hover .t { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.list .num { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--ink-3); color: var(--ink-2); display: grid; place-items: center; font-family: var(--serif); font-size: 16px; }
.list .txt, .tile .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.list .t { font-family: var(--serif); font-size: 19px; line-height: 1.25; }
.list .meta, .tile .meta { font-size: 14px; line-height: 1.4; color: var(--ink-3); }
.list .min { flex: none; font-size: 13px; color: var(--ink-3); }
.others { margin: 40px 0 0; display: flex; flex-direction: column; gap: 10px; }
.tile { display: flex; align-items: center; gap: 14px; padding: 16px 16px 16px 18px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; text-decoration: none; color: inherit; box-shadow: var(--shadow); }
.tile .t { font-family: var(--serif); font-size: 21px; line-height: 1.2; }
.tile svg { color: var(--ink-3); }
.tile:hover .t { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }

/* footer */
.foot { margin-top: 56px; padding-top: 22px; padding-bottom: calc(36px + var(--safe-bot)); border-top: 1px solid var(--line); font-size: 15px; color: var(--ink-2); }
.foot p { margin: 0; }
.foot .brand a { display: inline-block; padding: 6px 0; text-decoration: none; color: var(--ink); }
.foot .brand b { font-weight: 600; }
.foot .lede { color: var(--ink-3); margin-bottom: 10px; }
.foot .paths { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 18px; }
.foot .paths a, .foot .paths span, .foot .more a { display: inline-block; padding: 8px 0; }
.foot a { text-decoration: none; }
.foot a:hover { text-decoration: underline; text-underline-offset: 3px; }
.foot [aria-current] { color: var(--ink); }
.foot .more { display: flex; flex-wrap: wrap; gap: 0 18px; margin-top: 4px; }

@media (prefers-reduced-motion: reduce) { * { transition-duration: .01ms !important; } }
