:root {
  --bg: #fafafa;
  --ink: #1b1b19;
  --body: #2c2c2a;
  --muted: #8a8a85;
  --faint: #b8b8b2;
  --rule: #e6e6e1;
  --card: #ffffff;
  --code: #f0f0ec;
  --lit: #b8651b;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --serif: "EB Garamond", Garamond, Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--body);
  font: 15px/1.6 var(--sans); -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }
em.s, .s { font-family: var(--serif); font-style: italic; font-size: 1.08em; }
code { font: 12.5px var(--mono); background: var(--code); padding: 2px 6px; border-radius: 4px; }
b, strong { color: var(--ink); font-weight: 600; }

/* layout: left nav · column · margin */
.page { display: grid; grid-template-columns: 1fr 560px 1fr; gap: 0 48px; padding: 56px 24px 120px; }
.nav { position: sticky; top: 56px; align-self: start; justify-self: end; width: 170px; font-size: 13px; }
.nav .mark { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 500; text-decoration: none; margin-bottom: 4px; }
.nav .mark svg { width: 22px; height: 22px; }
.nav ul { list-style: none; margin: 0 0 28px; padding: 0 0 0 32px; }
.nav li a { display: block; color: var(--muted); text-decoration: none; padding: 2px 0; }
.nav li a:hover, .nav li a.on { color: var(--ink); }
main { grid-column: 2; min-width: 0; position: relative; }
.side { grid-column: 3; }

.top { display: flex; justify-content: space-between; align-items: baseline; }
.top h1 { font-size: 15px; font-weight: 500; color: var(--ink); margin: 0; }
.top h1 span { color: var(--muted); font-weight: 400; }
.tag { font-size: 17px; color: var(--ink); margin: 18px 0 20px; }
.strip { display: flex; gap: 10px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 14px 0; overflow: hidden; }
.strip span { flex: 1; font: 11.5px/1.35 var(--sans); color: var(--muted); padding: 10px; background: var(--card); border: 1px solid var(--rule); border-radius: 8px; }
.strip span i { display: block; font-style: normal; color: var(--ink); font-size: 12.5px; margin-bottom: 2px; }
.meta { font-size: 12.5px; color: var(--muted); margin: 12px 0 28px; }
.meta a, .meta span { margin-right: 6px; }
.meta .dot { color: var(--faint); }

p { margin: 0 0 14px; }
section { margin-top: 72px; position: relative; }
h2 { display: flex; align-items: center; gap: 16px; font-size: 15px; font-weight: 500; color: var(--ink); margin: 0 0 18px; }
h2::after { content: ""; flex: 1; height: 1px; background: var(--rule); order: 1; }
h2 .n { order: 2; font: italic 17px var(--serif); color: var(--muted); }
blockquote { margin: 26px 0; }
blockquote p { font: 28px/1.2 var(--serif); color: var(--ink); margin: 0 0 6px; }
blockquote cite { font-size: 12px; color: var(--muted); font-style: normal; }

/* sidenotes */
sup.fn { font-size: 10px; color: var(--muted); margin-left: 1px; }
.note { position: absolute; left: calc(100% + 48px); width: 170px; font-size: 11.5px; line-height: 1.45; color: var(--muted); }
.note b { color: var(--muted); font-weight: 400; margin-right: 6px; }

/* the figure: a live conversation */
.figure { margin: 48px -40px 40px; position: relative; }
.chat { background: var(--card); border: 1px solid var(--rule); border-radius: 14px; padding: 22px 24px 18px; min-height: 420px; box-shadow: 0 1px 0 rgba(0,0,0,.02), 0 12px 40px -24px rgba(0,0,0,.18); outline: none; cursor: pointer; }
.chat:focus-visible { box-shadow: 0 0 0 2px var(--faint); }
.chat .bar { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); border-bottom: 1px solid var(--rule); padding-bottom: 10px; margin-bottom: 14px; }
.msg { max-width: 82%; padding: 9px 13px; border-radius: 14px; margin: 0 0 8px; font-size: 14px; line-height: 1.45; animation: msgin .35s ease-out both; }
@keyframes msgin { from { opacity: 0; transform: translateY(4px); } }
.msg.ai { background: #f2f2ee; color: var(--ink); border-bottom-left-radius: 4px; }
.msg.you { background: var(--ink); color: #fafafa; margin-left: auto; border-bottom-right-radius: 4px; }
.msg.done { background: #fff7ee; border: 1px solid #f0d9bf; color: var(--ink); }
.msg.lesson { background: none; border-left: 2px solid var(--lit); border-radius: 0; color: var(--ink); font-family: var(--serif); font-style: italic; font-size: 16px; }
.typing { display: inline-flex; gap: 3px; padding: 12px 14px; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--faint); animation: b 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes b { 50% { transform: translateY(-3px); opacity: .5; } }
.figside { position: absolute; left: calc(100% + 48px); top: 30px; width: 190px; font-size: 12px; color: var(--muted); }
.figside kbd { font: 11px var(--mono); background: var(--code); border-radius: 4px; padding: 1px 6px; color: var(--ink); margin-right: 6px; }
.figside div { margin-bottom: 6px; }
.readout { color: var(--ink); margin-top: 14px; font-variant-numeric: tabular-nums; }
.phases { display: flex; gap: 4px; margin-top: 8px; }
.phases i { flex: 1; height: 3px; border-radius: 2px; background: var(--rule); transition: background .3s; }
.phases i.on { background: var(--ink); }
.phases i.lit { background: var(--lit); }

/* tables of words / prompts */
.words { border-top: 1px solid var(--rule); margin: 18px 0; }
.words div { display: grid; grid-template-columns: 130px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--rule); font-size: 14px; }
.words div > :first-child { color: var(--ink); }
.words div > :last-child { color: var(--muted); }
.prompts { background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 6px 16px; margin: 22px 0; }
.prompts div { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--rule); font-size: 14px; color: var(--ink); }
.prompts div:last-child { border: 0; }
.prompts div > :first-child { color: var(--muted); font-size: 12.5px; padding-top: 2px; }

.copybox { background: var(--ink); color: #f2f2ee; border-radius: 12px; padding: 18px 18px 14px; margin: 22px 0; }
.copybox .lbl { font-size: 11.5px; color: #9a9a94; margin-bottom: 8px; }
.copybox .line { font: 14px/1.5 var(--mono); overflow-wrap: anywhere; }
.copybox button { margin-top: 12px; font: 500 12.5px var(--sans); background: #f2f2ee; color: var(--ink); border: 0; border-radius: 7px; padding: 7px 12px; cursor: pointer; }
.copybox button.ghost { background: none; color: #f2f2ee; border: 1px solid #55554f; margin-left: 6px; }

ol.steps { padding-left: 20px; margin: 0 0 14px; }
ol.steps li { margin-bottom: 8px; }
.moves { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 22px 0; }
.moves div { background: var(--card); border: 1px solid var(--rule); border-radius: 10px; padding: 14px; font-size: 13px; color: var(--muted); }
.moves div b { display: block; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 18px; line-height: 1.2; color: var(--ink); margin-bottom: 6px; }
.moves div .k { font-size: 11px; color: var(--faint); display: block; margin-bottom: 4px; }

.faq h3 { font-size: 14px; color: var(--ink); font-weight: 500; margin: 20px 0 4px; }
.cta { margin-top: 80px; border-top: 1px solid var(--rule); padding-top: 28px; }
.cta p.big { font: 26px/1.2 var(--serif); color: var(--ink); }
.btn { display: inline-block; background: var(--ink); color: #fafafa; text-decoration: none; padding: 10px 16px; border-radius: 8px; font-size: 14px; font-weight: 500; }
footer { margin-top: 48px; font-size: 12px; color: var(--muted); }

/* collection page */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 24px 0; }
.cards a, .cards div { display: block; background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 18px; text-decoration: none; }
.cards b { display: block; font: italic 22px var(--serif); font-weight: 400; color: var(--ink); }
.cards span { font-size: 13px; color: var(--muted); }
.cards .soon { opacity: .55; }

@media (max-width: 1100px) {
  .page { grid-template-columns: minmax(0, 620px); justify-content: center; padding-top: 24px; }
  .nav { position: static; justify-self: start; width: auto; margin-bottom: 28px; }
  .nav .mark, .nav ul.toc { display: none; }
  .nav ul { padding: 0; display: flex; gap: 18px; margin: 0; }
  main { grid-column: 1; }
  .note { position: static; margin-top: 0; width: auto; display: block; margin: -4px 0 14px; padding-left: 12px; border-left: 1px solid var(--rule); }
  .figure { margin: 36px 0; }
  .figside { position: static; width: auto; display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 12px; }
  .figside .readout { flex-basis: 100%; margin-top: 4px; }
  .moves { grid-template-columns: 1fr 1fr; }
  .cards { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .strip span:nth-child(n+4) { display: none; }
  .words div, .prompts div { grid-template-columns: 1fr; gap: 2px; }
  .moves { grid-template-columns: 1fr; }
  .msg { max-width: 92%; }
}
@media (prefers-reduced-motion: reduce) { .msg { animation: none; } .typing i { animation: none; } }
.msg.done { white-space: pre-line; }
.msg.work { background: none; color: var(--muted); font-size: 13px; font-style: italic; padding-left: 0; }
.msg.work::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--lit); margin-right: 8px; animation: b 1s infinite; }
.msg { overflow-wrap: anywhere; }
#msgs { max-height: 560px; overflow-y: auto; scroll-behavior: smooth; padding-right: 4px; }
.cta a.sub { margin-left: 14px; font-size: 13px; color: var(--muted); }
