:root {
  color-scheme: light;
  --ground: #f5f8f0;
  --white: #ffffff;
  --ink: #25341e;
  --muted: #4e5f42;
  --olive: #466021;
  --moss: #5c7536;
  --hero: #adc779;
  --soft: #e6edda;
  --note: #dbe7ba;
  --hover: #edf2e3;
  --round: "Arial Rounded MT Bold", ui-rounded, "Trebuchet MS", sans-serif;
  --space: clamp(1.25rem, 2.3vw, 2.25rem);
  font-family: ui-rounded, "Trebuchet MS", "Arial Rounded MT Bold", sans-serif;
  font-size: 17px;
  background: var(--ground);
  color: var(--ink);
}
* { box-sizing: border-box; }
html { scroll-behavior: auto; }
body { margin: 0; line-height: 1.75; }
[hidden] { display: none !important; }
main, article, section, nav, header, footer, div { min-width: 0; }
h1, h2, h3, h4, h5, h6, p, ul, ol, dl, figure { margin: 0; }
h1, h2, h3, h4, h5, h6, dt { font-family: var(--round); font-weight: 700; letter-spacing: 0; }
p, li, dd, a, label, input, button, figcaption { font-size: 1rem; }
p, li, dd { overflow-wrap: break-word; }
p { max-width: 66ch; }
h1 { font-size: clamp(2.25rem, 3.75vw, 3.55rem); line-height: 1.16; max-width: 23ch; text-wrap: balance; }
h2 { font-size: clamp(1.4rem, 2vw, 1.8rem); line-height: 1.35; text-wrap: balance; }
strong { font-weight: 700; }
a { color: var(--olive); text-decoration-thickness: .1em; text-underline-offset: .22em; overflow-wrap: anywhere; }
a:hover { color: var(--ink); text-decoration-thickness: .15em; }
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; box-shadow: 0 0 0 7px var(--white); }
:target { scroll-margin-top: 2rem; }
body > header, body > footer { padding: 1.35rem max(1.25rem, calc((100vw - 1340px) / 2)); }
body > header { background: var(--moss); color: var(--white); }
body > header > div > a { display: inline-flex; align-items: center; min-height: 44px; color: inherit; text-decoration: none; font-family: var(--round); font-size: 1.35rem; line-height: 1.4; }
body > header > div > a:hover { color: var(--white); text-decoration: underline; }
body > header p { color: inherit; font-size: 1rem; }
body > header > a { display: flex; gap: .65rem; align-items: center; min-height: 48px; padding: .45rem 1.1rem; border-radius: 999px; background: var(--white); color: var(--olive); text-decoration: none; font-weight: 700; }
body > header > a:hover { background: var(--note); }
body > footer { margin-top: 4rem; padding-block: 2.25rem; background: var(--soft); display: flex; justify-content: space-between; align-items: start; gap: 2rem; }
body > footer > p { color: var(--muted); max-width: 63ch; }
body > footer nav { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
body > footer a { display: flex; align-items: center; min-height: 44px; padding-inline: .4rem; white-space: nowrap; }
main { padding-top: 2rem; }
main > header, .split { background: var(--hero); border-radius: 28px; padding: clamp(1.5rem, 3vw, 2.65rem); margin-bottom: 2rem; }
main header > p:first-child { color: var(--ink); line-height: 1.5; margin-bottom: 1.15rem; font-weight: 700; }
main header > .lead { font-size: 1.2rem; font-weight: 650; color: var(--ink); margin-top: 1.6rem; line-height: 1.55; }
main header > p:last-of-type { margin-top: 1.1rem; color: var(--ink); }
article { display: grid; grid-template-columns: minmax(0, 1fr) 11.5rem; gap: 0 1.6rem; align-items: start; }
article > section { grid-column: 1; padding: 1.7rem 1.5rem 2rem; margin-bottom: 1.25rem; border-radius: 24px; background: var(--white); }
article > section:nth-of-type(even) { background: var(--soft); }
section > h2 { margin-bottom: 1.2rem; }
section > p + p, section > p + ul, section > ul + p, section > dl + p, section > p + .links { margin-top: 1rem; }
ul { padding-left: 1.25rem; max-width: 67ch; }
li + li { margin-top: .7rem; }
li::marker { color: var(--olive); }
dl { display: grid; gap: 1rem; }
dl > div { padding: 1.25rem 1.4rem; background: var(--soft); border-radius: 20px; }
section:nth-of-type(even) dl > div { background: var(--white); }
dt { font-size: 1.08rem; line-height: 1.5; margin-bottom: .5rem; }
dd { margin: 0; color: var(--muted); max-width: 65ch; }
#chapters { grid-column: 1; grid-row: 1; align-self: start; position: sticky; top: 2rem; margin-top: 2rem; padding: 1.25rem .8rem; background: var(--soft); border-radius: 24px; }
#chapters > h2 { font-size: 1.2rem; margin: 0 .4rem .45rem; }
#chapters > p { color: var(--muted); margin: 0 .4rem 1.2rem; line-height: 1.6; }
#chapters ol { list-style: none; padding: 0; margin: 0; display: grid; gap: .3rem; }
#chapters li { margin: 0; }
#chapters a { display: flex; gap: .65rem; padding: .6rem .65rem; min-height: 48px; align-items: center; color: var(--olive); border-radius: 18px; text-decoration: none; line-height: 1.45; }
#chapters a > span { font-family: var(--round); color: var(--olive); flex-shrink: 0; }
#chapters a:hover { background: var(--white); text-decoration: underline; }
#chapters [aria-current] { background: var(--moss); color: var(--white); font-weight: 700; }
#chapters [aria-current] > span { color: inherit; }
#chapters [aria-current]:hover { background: var(--olive); }
.flex { display: flex; align-items: center; }
.between { justify-content: space-between; }
.gap { gap: 1rem; }
.gap-large { gap: var(--space); }
.shell { max-width: 1440px; margin-inline: auto; padding-inline: clamp(1.25rem, 3.5vw, 3rem); display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: clamp(1.5rem, 2.5vw, 2.5rem); }
.shell > main { grid-column: 2; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(11rem, .42fr); align-items: center; }
.action { margin-top: 1.6rem; padding: .9rem 1.2rem; display: inline-flex; align-items: center; justify-content: space-between; gap: 1.25rem; min-height: 52px; border-radius: 999px; background: var(--white); color: var(--olive); font-weight: 700; text-decoration: underline; }
.action:hover { color: var(--ink); background: var(--ground); }
.links { list-style: none; padding: 0; display: grid; gap: .8rem; max-width: none; }
.links > li { margin: 0; }
.links a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .3rem 1rem; padding: 1.1rem 1.25rem; background: var(--soft); border-radius: 22px; text-decoration: none; min-height: 88px; }
section:nth-of-type(even) .links a { background: var(--white); }
.links a strong { font-size: 1.1rem; color: var(--olive); text-decoration: underline; text-underline-offset: .22em; }
.links a span:first-of-type { color: var(--muted); grid-column: 1; }
.links a span:last-child { font-size: 1.5rem; grid-column: 2; grid-row: 1 / 3; align-self: center; color: var(--olive); }
.links a:hover { background: var(--note); }
.recap { grid-column: 2; grid-row: 1; align-self: start; position: sticky; top: 2rem; margin-block: .5rem 1.4rem; padding: 1.4rem 1.15rem; background: var(--moss); color: var(--white); border-radius: 24px; border-top: .5rem solid var(--hero); }
.recap .recap-label { font-family: var(--round); font-size: 1rem; font-weight: 700; letter-spacing: 0; line-height: 1.5; margin-bottom: .85rem; }
.recap p { font-size: 1.05rem; line-height: 1.7; }
.next-note { color: var(--muted); margin: 1.7rem 0 .8rem; }
.turn { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 1rem; }
.turn a { padding: 1rem 1.4rem; min-height: 86px; display: grid; grid-template-columns: 1fr auto; border-radius: 28px; background: var(--soft); text-decoration: none; }
.turn a > span:first-child { color: var(--muted); grid-column: 1; }
.turn strong { grid-column: 1; text-decoration: underline; text-underline-offset: .22em; }
.turn a > span:last-child:not(:first-child) { grid-column: 2; grid-row: 1 / 3; align-self: center; font-size: 1.5rem; }
.turn a:hover { background: var(--note); }
.reading { padding: 1rem 1.2rem; margin-bottom: 1rem; background: var(--soft); border-radius: 20px; }
section:nth-of-type(even) .reading { background: var(--white); }
.reading > a { min-height: 44px; display: flex; align-items: center; font-weight: 700; padding-block: .4rem; line-height: 1.6; }
.reading > p { color: var(--muted); margin-top: .35rem; }
.paper { margin: 0; align-self: center; display: grid; gap: 1rem; padding: .85rem; background: var(--soft); border-radius: 24px; transform: rotate(2deg); }
.paper > div { position: relative; min-height: 17rem; overflow: hidden; background: var(--note); border-radius: 18px; }
.paper i { position: absolute; width: 64%; height: 55%; top: 18%; left: 15%; display: block; border-radius: 16px 16px 0 0; background: var(--white); clip-path: polygon(0 0, 100% 0, 100% 94%, 92% 96%, 88% 94%, 81% 98%, 75% 95%, 68% 97%, 63% 94%, 57% 99%, 51% 96%, 45% 98%, 39% 94%, 32% 97%, 25% 94%, 17% 98%, 11% 96%, 0 99%); transform: rotate(-12deg); }
.paper i:first-child { background: var(--moss); top: 13%; left: 22%; transform: rotate(11deg); }
.paper i:nth-child(2) { background: var(--hero); top: 24%; left: 20%; transform: rotate(4deg); }
.paper i:nth-child(3) { background: repeating-linear-gradient(0deg, var(--white) 0 24px, #dbe7ba 24px 26px); top: 32%; left: 10%; transform: rotate(-7deg); }
.paper i:last-child { background: var(--olive); width: 35%; height: 23%; left: 40%; top: 53%; transform: rotate(5deg); }
.paper figcaption { padding: 0 .3rem .25rem; color: var(--muted); line-height: 1.6; }
#word-tools { margin-bottom: 1.5rem; padding: 1.25rem; background: var(--note); border-radius: 22px; }
#word-tools label { display: block; font-weight: 700; }
#word-hint { color: var(--muted); margin-block: .35rem .8rem; }
input { background: var(--white); color: var(--ink); border: 2px solid var(--olive); border-radius: 18px; padding: .7rem; font: inherit; width: 100%; min-width: 0; min-height: 48px; }
button { background: var(--moss); color: var(--white); border: 0; border-radius: 999px; padding: .75rem 1.1rem; font: inherit; font-weight: 700; cursor: pointer; min-width: 44px; min-height: 48px; flex-shrink: 0; }
button:hover { background: var(--olive); }
#filter-status { margin-top: .8rem; }
.skip { position: absolute; top: .5rem; left: .5rem; transform: translateY(-200%); z-index: 10; min-height: 48px; border-radius: 999px; background: var(--white); color: var(--olive); padding: .65rem 1.2rem; display: flex; align-items: center; }
.skip:focus { transform: translateY(0); }
@media (max-width: 1200px) {
  .shell { grid-template-columns: 11.5rem minmax(0, 1fr); gap: 1.5rem; }
  article { display: block; }
  .recap { position: static; max-width: 48ch; padding: 1.5rem; margin: 1.5rem 0; }
  .split { grid-template-columns: minmax(0, 1fr) 11rem; }
  .paper > div { min-height: 14rem; }
}
@media (max-width: 980px) {
  .split { grid-template-columns: 1fr; }
  .paper { width: min(100%, 24rem); grid-template-columns: 1fr 1fr; align-items: center; transform: none; }
  .paper > div { min-height: 10rem; }
}
@media (max-width: 760px) {
  :root { font-size: 17px; }
  .shell { display: block; padding-inline: 1.1rem; }
  main { padding-top: 1.25rem; }
  h1 { font-size: clamp(2.05rem, 8vw, 3.2rem); }
  main > header, .split { padding: 1.6rem 1.3rem; margin-bottom: 1.25rem; border-radius: 24px; }
  main header > .lead { margin-top: 1.2rem; }
  article > section { padding: 1.5rem 1.2rem; }
  #chapters { position: static; margin-top: 2.5rem; padding: 1.5rem 1rem; }
  #chapters a { min-height: 50px; }
  body > header { gap: .7rem; align-items: center; padding: 1.15rem 1.1rem; }
  body > header > div > a { font-size: 1.1rem; }
  body > header p { font-size: 1rem; line-height: 1.5; max-width: 18ch; }
  body > header > a { padding-inline: .85rem; gap: .4rem; flex-shrink: 0; }
  body > footer { display: block; margin-top: 2.5rem; padding-inline: 1.25rem; }
  body > footer nav { margin-top: 1rem; }
  .recap { max-width: none; }
  dl > div, .reading, .links a { padding: 1rem 1.1rem; }
  .action { gap: .8rem; padding-inline: 1rem; }
  #word-tools { padding: 1rem; }
  #word-tools .flex { flex-wrap: wrap; }
  #word-tools input { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
@media print {
  :root { color-scheme: light; background: white; color: #25341e; }
  body { background: white; color: #25341e; }
  body > header, #chapters, .skip, .turn, .next-note, .paper, #word-tools, body > footer nav, .action { display: none !important; }
  .shell, article { display: block; padding: 0; }
  main { padding: 0; }
  main > header, article > section { background: white; padding: 1rem 0; }
  section, .recap, dl > div { break-inside: avoid; }
  h1 { font-size: 2rem; }
  p, li, dd, a, .recap p, .links a span:first-of-type, .links a strong { color: #25341e; }
  .recap, dl > div, .links a, .reading { background: white; }
  .recap { position: static; border: 2px solid #466021; }
  #word-list [hidden] { display: block !important; }
  body > footer { background: white; padding: 1rem 0; margin: 1rem 0; }
  body > footer p, .reading p, main header p { color: #25341e !important; }
}
