/* TaleRic site — direction 1 (literary magazine), see design/site-2026-11-10/directions. */
:root {
  --paper: #F4EFE5;
  --paper-2: #EBE4D6;
  --ink: #1A1814;
  --ink-2: #5E584F;
  --rule: rgba(26, 24, 20, 0.16);
  --blue: #0A5BD8;          /* text blue on paper, 5.3:1 */
  --blue-ui: #0A6CFF;       /* the app's blue, for fills and marks */
  --tap: #D6E4FF;           /* tapped-phrase highlight */
  --terra: #8E3B22;
  --cream: #F6EEE3;
  --night: #16171B;
  --night-ink: #E9E4DA;
  --night-2: #9A958C;
  --gold: #E2B865;
  --card: #FFFFFF;

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Source Sans 3", -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --hand: "Caveat", "Bradley Hand", cursive;

  --gutter: clamp(16px, 4vw, 56px);
  --max: 1320px;
  --r: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 18px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
.mono { font-family: var(--mono); font-size: 13px; letter-spacing: 0.02em; }
.hand { font-family: var(--hand); font-weight: 500; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--blue-ui); outline-offset: 3px; border-radius: 4px; }

/* ---------- masthead ---------- */
.masthead {
  max-width: var(--max); margin: 0 auto; padding: 18px var(--gutter);
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 28px;
  border-bottom: 1px solid var(--rule);
}
.wordmark { display: inline-flex; align-items: center; gap: 2px; font: 500 26px/1 var(--serif); text-decoration: none; letter-spacing: -0.02em; }
.wordmark .star { width: 20px; height: 20px; fill: var(--blue-ui); transform: translateY(-5px); }
.wordmark.small { font-size: 20px; }
.wordmark.small .star { width: 15px; height: 15px; }
.issue { justify-self: center; color: var(--ink-2); }
.nav { display: flex; gap: 22px; font-size: 15px; }
.nav a { text-decoration: none; color: var(--ink-2); }
.nav a:hover { color: var(--ink); }

.badge {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  background: #000; color: #fff; border-radius: 10px; padding: 7px 14px 7px 10px;
  font: 600 17px/1 -apple-system, "Helvetica Neue", var(--sans); letter-spacing: -0.01em;
  transition: transform .15s ease;
}
.badge svg { width: 22px; height: 22px; fill: #fff; }
.badge span { display: flex; flex-direction: column; gap: 2px; }
.badge small { font-size: 10px; font-weight: 400; letter-spacing: 0.01em; }
.badge:active { transform: scale(0.97); }
.badge-lg { padding: 10px 20px 10px 14px; font-size: 22px; }
.badge-lg svg { width: 28px; height: 28px; }
.badge-lg small { font-size: 12px; }

/* ---------- hero ---------- */
.hero { max-width: var(--max); margin: 0 auto; padding: clamp(28px, 5vw, 64px) var(--gutter) clamp(40px, 6vw, 80px); }
.hero-line-wrap { position: relative; }
.hero-line {
  font: 300 clamp(52px, 8.6vw, 140px)/1 var(--serif);
  letter-spacing: -0.035em; margin: 0; max-width: 13.5ch;
}
.phrase {
  all: unset; cursor: pointer; border-radius: 0.12em; padding: 0 0.04em;
  transition: background-color .25s ease, color .25s ease;
  -webkit-tap-highlight-color: transparent;
}
.phrase:hover { background: rgba(10, 108, 255, 0.07); }
.phrase:not([aria-pressed="true"]) { text-decoration: underline dotted rgba(26, 24, 20, .28); text-decoration-thickness: 0.04em; text-underline-offset: 0.12em; }
.phrase[aria-pressed="true"] { background: var(--tap); color: var(--blue); }
.phrase:focus-visible { outline: 3px solid var(--blue-ui); outline-offset: 2px; }
.gloss {
  position: absolute; right: 0; top: 0.6em; max-width: 30%;
  font-size: clamp(26px, 3.2vw, 44px); line-height: 1.05; color: var(--blue); text-align: left;
  transition: top .35s ease, left .35s ease;
}
.gloss::before {
  content: ""; position: absolute; right: 100%; top: 0.55em; width: var(--lead, 0px); height: 1.5px;
  margin-right: 10px; background: var(--blue-ui); opacity: .7; transition: width .35s ease;
}
.gloss-text { display: inline-block; transition: opacity .25s ease, transform .3s ease; }
.gloss.is-hint .gloss-text { color: var(--ink-2); }
.gloss.is-swap .gloss-text { opacity: 0; transform: translateY(6px); }

.hero-deck {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px);
  margin-top: clamp(28px, 4vw, 48px); padding-top: 22px; border-top: 1px solid var(--rule);
}
.deck-lead { font: 400 clamp(22px, 2.2vw, 30px)/1.25 var(--serif); max-width: 28ch; }
.deck-side { display: flex; flex-direction: column; justify-content: space-between; gap: 24px; }
.caption { color: var(--ink-2); line-height: 1.6; }
.cta-row { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 20px; }
.trial { color: var(--ink-2); font-size: 16px; }

/* ---------- shared section heads ---------- */
section { scroll-margin-top: 20px; }
.section-head { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.kicker { color: var(--ink-2); margin-bottom: 14px; }
.section-head h2, .wall-head h2, .sky-copy h2 { font-size: clamp(38px, 5.4vw, 76px); line-height: 1.02; font-weight: 300; letter-spacing: -0.03em; max-width: 18ch; }
.section-lead { margin-top: 18px; max-width: 56ch; color: var(--ink-2); font-size: 19px; }

/* ---------- how ---------- */
.how { padding: clamp(56px, 8vw, 120px) 0; border-top: 1px solid var(--rule); }
.steps {
  list-style: none; margin: 48px auto 0; padding: 0 var(--gutter); max-width: var(--max);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 44px);
}
.step { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--ink); padding-top: 18px; }
.step h3 { font-size: 34px; font-weight: 400; }
.step > p:not(.step-no) { color: var(--ink-2); max-width: 36ch; }
.step-no { color: var(--blue); }
.ui {
  margin: 18px 0 0; background: var(--card); border-radius: var(--r); padding: 20px 22px;
  box-shadow: 0 1px 0 rgba(26,24,20,.06), 0 14px 34px -18px rgba(26,24,20,.35);
  font-family: var(--sans); color: var(--ink); min-height: 172px;
}
.ui-page { background: #FBF8F2; font: 400 19px/1.6 var(--serif); }
.ui-run { color: var(--ink-2); font-size: 11px; margin-bottom: 10px; }
.ui mark { background: var(--tap); color: var(--blue); border-radius: 3px; padding: 0 2px; }
.ui-phrase { font-weight: 600; font-size: 21px; line-height: 1.25; color: var(--blue); display: flex; justify-content: space-between; gap: 12px; }
.ui-speaker { font-size: 13px; font-weight: 400; letter-spacing: -2px; flex: none; }
.ui-label { margin-top: 14px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.ui-meaning { font-size: 19px; margin-top: 2px; }
.ui-foot { margin-top: 14px; padding-top: 10px; border-top: 1px solid #eee; font-size: 13px; color: var(--ink-2); }
.ui-review p { font: 400 19px/1.6 var(--serif); }
.ui-gap { background: var(--tap); color: var(--blue); border-radius: 3px; padding: 0 3px; }
.ui-grades { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; font-size: 14px; font-weight: 600; text-align: center; }
.ui-grades span { border: 1px solid #e4e0d8; border-radius: 10px; padding: 8px 0; color: var(--ink-2); }
.ui-grades .on { background: var(--blue-ui); border-color: var(--blue-ui); color: #fff; }

/* ---------- wall of first lines ---------- */
.wall { background: var(--terra); color: var(--cream); padding: clamp(56px, 8vw, 120px) 0; }
.wall-head, .lines, .wall-note, .langs { max-width: var(--max); margin-left: auto; margin-right: auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.wall .kicker { color: rgba(246, 238, 227, .9); }
.wall-head p:last-child { margin-top: 16px; max-width: 52ch; color: var(--cream); }
.lines { list-style: none; margin-top: 44px; line-height: 1.32; }
.lines li { display: inline; margin-right: 0.55em; }
.line {
  all: unset; display: inline; cursor: pointer; font: 400 clamp(20px, 2.4vw, 34px)/1.32 var(--serif);
  color: rgba(246, 238, 227, .78); transition: color .2s ease; border-radius: 6px; text-decoration: underline dotted rgba(246, 238, 227, .35); text-underline-offset: .22em; text-decoration-thickness: 1px;
}
.lines li:nth-child(3n+1) .line { font-size: clamp(26px, 3.6vw, 52px); }
.lines li:nth-child(4n+2) .line { font-style: italic; }
.line:hover { color: var(--cream); }
.line:focus-visible { outline: 2px solid var(--cream); outline-offset: 4px; }
.line[aria-pressed="true"] { color: var(--cream); }
.line mark { background: var(--cream); color: var(--terra); border-radius: 4px; padding: 0 4px; }
.wall-note { margin-top: 36px; min-height: 88px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; }
.wall-note .hand { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.1; }
.wall-note .src { opacity: .8; }
.langs { margin-top: 40px; padding-top: 18px; background: linear-gradient(rgba(246, 238, 227, .3), rgba(246, 238, 227, .3)) var(--gutter) 0 / calc(100% - 2 * var(--gutter)) 1px no-repeat; color: rgba(246, 238, 227, .92); line-height: 2; }

/* ---------- sky ---------- */
.sky {
  background: var(--night); color: var(--night-ink);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center;
  gap: clamp(24px, 5vw, 80px); padding: clamp(64px, 9vw, 140px) max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
  background-image: radial-gradient(1px 1px at 12% 18%, #fff8 50%, transparent 51%), radial-gradient(1px 1px at 78% 12%, #fff6 50%, transparent 51%),
    radial-gradient(1px 1px at 64% 72%, #fff5 50%, transparent 51%), radial-gradient(1px 1px at 30% 84%, #fff7 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 90% 58%, #fff9 50%, transparent 51%), radial-gradient(1px 1px at 46% 36%, #fff4 50%, transparent 51%),
    radial-gradient(1px 1px at 5% 52%, #fff6 50%, transparent 51%), radial-gradient(1.2px 1.2px at 22% 64%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 56% 8%, #fff5 50%, transparent 51%), radial-gradient(1px 1px at 84% 88%, #fff6 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 38% 12%, #fff7 50%, transparent 51%), radial-gradient(1px 1px at 70% 44%, #fff4 50%, transparent 51%),
    radial-gradient(600px 400px at 100% 100%, rgba(226, 184, 101, .10), transparent 70%);
}
.sky .kicker { color: var(--night-2); }
.sky-copy p:not(.kicker):not(.sky-count) { margin-top: 18px; color: #C9C3B8; max-width: 44ch; font-size: 19px; }
.sky-count { margin-top: 28px; color: var(--night-2); }
.sky-figure { max-width: 520px; width: 100%; justify-self: center; }
.figure-lines path { stroke: rgba(233, 228, 218, .28); stroke-width: .5; stroke-linecap: round; stroke-linejoin: round; transition: stroke .8s ease; }
.figure-stars circle { fill: rgba(233, 228, 218, .25); transition: fill .4s ease, r .4s ease; }
.figure-stars circle.lit { fill: #fff; }
.sky.is-done .figure-lines path { stroke: rgba(226, 184, 101, .75); }
.sky.is-done .figure-stars circle.lit { fill: var(--gold); }

/* ---------- reviews ---------- */
.reviews { padding: clamp(56px, 8vw, 120px) 0; }
.review-demo { max-width: var(--max); margin: 44px auto 0; padding: 0 var(--gutter); display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(20px, 4vw, 56px); align-items: start; }
.stages { display: flex; flex-direction: column; border-top: 1px solid var(--ink); }
.stages button {
  all: unset; cursor: pointer; padding: 16px 0; border-bottom: 1px solid var(--rule);
  font: 400 clamp(22px, 2.2vw, 30px)/1.1 var(--serif); color: var(--ink-2); display: flex; justify-content: space-between;
}
.stages button::after { content: "→"; font-family: var(--sans); opacity: 0; transition: opacity .2s; }
.stages button[aria-selected="true"] { color: var(--ink); }
.stages button[aria-selected="true"]::after { opacity: 1; color: var(--blue); }
.stages button:focus-visible { outline: 2px solid var(--blue-ui); outline-offset: 2px; }
.review-card {
  background: var(--card); border-radius: 20px; padding: clamp(22px, 3vw, 36px); min-height: 330px;
  box-shadow: 0 1px 0 rgba(26,24,20,.06), 0 24px 60px -30px rgba(26,24,20,.4);
}
.rc-kind { font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.rc-passage { margin-top: 16px; font: 400 clamp(20px, 2vw, 26px)/1.55 var(--serif); }
.rc-passage .gap { display: inline-block; min-width: 5.5em; border-bottom: 2px solid var(--blue-ui); }
.rc-passage .tap { background: var(--tap); color: var(--blue); border-radius: 3px; padding: 0 3px; }
.rc-ask { margin-top: 18px; color: var(--ink-2); font-size: 16px; }
.rc-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.rc-options span, .rc-chips span { border: 1px solid #e4e0d8; border-radius: 12px; padding: 12px 14px; font-size: 16px; }
.rc-options .right { border-color: var(--blue-ui); color: var(--blue); background: #F2F7FF; }
.rc-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.rc-chips span { padding: 8px 12px; font-family: var(--serif); font-size: 18px; }
.rc-grades { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; text-align: center; font-weight: 600; font-size: 15px; }
.rc-grades span { border: 1px solid #e4e0d8; border-radius: 12px; padding: 12px 0; color: var(--ink-2); }
.rc-grades .on { background: var(--blue-ui); border-color: var(--blue-ui); color: #fff; }

/* ---------- books ---------- */
.books { padding: clamp(56px, 8vw, 120px) 0; background: var(--paper-2); }
.books-grid { max-width: var(--max); margin: 44px auto 0; padding: 0 var(--gutter); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 72px); align-items: end; }
.imports { list-style: none; margin: 0; padding: 0; }
.imports li { padding: 16px 0; border-top: 1px solid var(--rule); color: var(--ink-2); }
.imports li:last-child { border-bottom: 1px solid var(--rule); }
.imports strong { color: var(--ink); font-weight: 600; }

/* ---------- teacher ---------- */
.teacher { max-width: 980px; margin: 0 auto; padding: clamp(64px, 9vw, 140px) var(--gutter); }
.teacher blockquote { margin: 0; }
.teacher blockquote p { font: 300 clamp(26px, 3vw, 40px)/1.3 var(--serif); letter-spacing: -0.01em; }
.teacher blockquote p::before { content: "“"; color: var(--blue); }
.teacher blockquote p::after { content: "”"; color: var(--blue); }
.teacher footer { margin-top: 28px; display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; color: var(--ink-2); }
.signature { font-size: 52px; color: var(--blue); line-height: 1; }

/* ---------- plans ---------- */
.plans { padding: clamp(56px, 8vw, 120px) 0; border-top: 1px solid var(--rule); }
.billing { max-width: var(--max); margin: 36px auto 0; padding: 0 var(--gutter); display: flex; gap: 8px; }
.billing button { all: unset; cursor: pointer; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--rule); font-size: 15px; }
.billing button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.billing button:focus-visible { outline: 2px solid var(--blue-ui); outline-offset: 2px; }
.save { font-size: 12px; color: var(--blue); margin-left: 4px; }
.billing button[aria-pressed="true"] .save { color: #9CC0FF; }
.plan-grid { max-width: var(--max); margin: 22px auto 0; padding: 0 var(--gutter); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2vw, 28px); }
.plan { border-top: 1px solid var(--ink); padding: 22px 0 8px; }
.plan h3 { font-size: 40px; font-weight: 400; }
.plan-for { color: var(--ink-2); margin-top: 4px; }
.price { margin-top: 22px; font: 300 clamp(44px, 5vw, 64px)/1 var(--serif); letter-spacing: -0.02em; }
.price small { font: 400 16px/1 var(--sans); color: var(--ink-2); letter-spacing: 0; }
.quota { margin-top: 22px; font: 300 clamp(30px, 3.4vw, 44px)/1.1 var(--serif); }
.quota strong { color: var(--blue); }
.fine { max-width: var(--max); margin: 26px auto 0; padding: 0 var(--gutter); font-size: 14px; color: var(--ink-2); }

/* ---------- faq ---------- */
.faq { padding: clamp(56px, 8vw, 120px) 0; border-top: 1px solid var(--rule); }
.faq-list { max-width: var(--max); margin: 36px auto 0; padding: 0 var(--gutter); columns: 2 420px; column-gap: clamp(24px, 4vw, 64px); }
.faq details { break-inside: avoid; border-top: 1px solid var(--rule); padding: 16px 0; }
.faq summary { cursor: pointer; font: 400 22px/1.3 var(--serif); list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--sans); color: var(--blue); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin-top: 10px; color: var(--ink-2); max-width: 54ch; }

/* ---------- close ---------- */
.close { text-align: center; padding: clamp(72px, 10vw, 160px) var(--gutter); background: var(--paper-2); }
.close-line { font: 300 clamp(44px, 7.4vw, 120px)/1 var(--serif); letter-spacing: -0.035em; }
.tapped { background: var(--tap); color: var(--blue); border-radius: 0.12em; padding: 0 0.05em; }
.close-gloss { font-size: clamp(28px, 3vw, 40px); color: var(--blue); margin-top: 6px; }
.close-cta { margin-top: 44px; display: flex; justify-content: center; align-items: center; gap: 36px; flex-wrap: wrap; }
.qr { margin: 0; display: flex; align-items: center; gap: 14px; text-align: left; }
.qr img { border-radius: 8px; background: #fff; padding: 6px; }
.qr figcaption { color: var(--ink-2); max-width: 12ch; }

/* ---------- colophon ---------- */
.colophon {
  max-width: var(--max); margin: 0 auto; padding: 28px var(--gutter) 40px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 28px; font-size: 15px; color: var(--ink-2);
}
.colophon nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.colophon .wordmark { color: var(--ink); }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .masthead { grid-template-columns: auto 1fr auto; }
  .issue { display: none; }
  .nav { grid-column: 1 / -1; grid-row: 2; overflow-x: auto; gap: 18px; padding-top: 2px; white-space: nowrap; scrollbar-width: none; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .sky { grid-template-columns: minmax(0, 1fr); }
  .sky-figure { max-width: 380px; }
  .review-demo, .books-grid { grid-template-columns: minmax(0, 1fr); }
  .stages { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .stages button { padding: 8px 14px; border: 1px solid var(--rule); border-radius: 999px; font: 400 15px/1.2 var(--sans); }
  .stages button::after { display: none; }
  .stages button[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
}
@media (max-width: 720px) {
  body { font-size: 17px; }
  .masthead { grid-template-columns: 1fr auto; }
  .masthead .badge { padding: 6px 10px 6px 8px; font-size: 15px; }
  .masthead .badge small { font-size: 11px; }
  .hero-line { max-width: none; font-size: clamp(44px, 13vw, 76px); }
  .lines li { display: block; margin: 0 0 10px; }
  .gloss { position: static; max-width: none; text-align: left; margin-top: 14px; min-height: 1.1em; }
  .hero-deck { grid-template-columns: minmax(0, 1fr); }
  .plan-grid { grid-template-columns: minmax(0, 1fr); }
  .rc-options { grid-template-columns: minmax(0, 1fr); }
    .qr { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- legal pages ---------- */
.doc-page .masthead { grid-template-columns: auto 1fr; }
.doc { max-width: 760px; margin: 0 auto; padding: clamp(32px, 6vw, 72px) var(--gutter) 64px; }
.doc h1 { font-size: clamp(36px, 5vw, 60px); font-weight: 300; line-height: 1.05; letter-spacing: -0.02em; margin-bottom: 18px; }
.doc h2 { font-size: 28px; margin: 40px 0 10px; }
.doc h3 { font-size: 21px; margin: 28px 0 8px; }
.doc p, .doc li { color: #34302A; }
.doc p + p, .doc ul, .doc ol { margin-top: 12px; }
.doc a { color: var(--blue); }
.doc table { border-collapse: collapse; margin-top: 12px; font-size: 16px; }
.doc th, .doc td { border: 1px solid var(--rule); padding: 8px 10px; text-align: left; vertical-align: top; }

/* ===================== round 2 (2026-11-10): one palette, playable demos ===================== */

/* One world: paper, deeper paper, and the night only for the sky. */
.wall { background: var(--paper-2); color: var(--ink); }
.wall .kicker { color: var(--ink-2); }
.wall-head p:last-child { color: var(--ink-2); }
.line { color: var(--ink-2); text-decoration-color: rgba(26, 24, 20, .22); }
.line:hover, .line[aria-pressed="true"] { color: var(--ink); }
.line:focus-visible { outline-color: var(--blue-ui); }
.line mark { background: var(--tap); color: var(--blue); }
.langs { color: var(--ink-2); background: linear-gradient(var(--rule), var(--rule)) var(--gutter) 0 / calc(100% - 2 * var(--gutter)) 1px no-repeat; }
.books { background: var(--paper); border-top: 1px solid var(--rule); }

/* Speaker */
.speak {
  all: unset; cursor: pointer; flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: inline-grid; place-items: center; color: var(--blue-ui); transition: background-color .2s;
}
.speak:hover { background: #EEF4FF; }
.speak:focus-visible { outline: 2px solid var(--blue-ui); outline-offset: 2px; }
.speak svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.speak svg path:first-child { fill: currentColor; stroke: none; }
.speak.is-speaking .w1 { animation: wave 0.9s ease-in-out infinite; }
.speak.is-speaking .w2 { animation: wave 0.9s ease-in-out .15s infinite; }
@keyframes wave { 50% { opacity: .2; } }
.ui-phrase { align-items: flex-start; }

/* Step iii multiple choice */
.ui-ask { margin-top: 12px; font-size: 15px; color: var(--ink-2); }
.choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.choices button, .rc-options button, .rc-chips button, .rc-grades button, .rc-reveal, .rc-next {
  font: 500 15px/1.2 var(--sans); cursor: pointer; border: 1px solid #DDD6CA; background: #fff; color: var(--ink);
  border-radius: 12px; padding: 10px 14px; transition: background-color .15s, border-color .15s, transform .1s;
}
.choices button:hover:not(:disabled), .rc-options button:hover:not(:disabled), .rc-chips button:hover:not(:disabled), .rc-grades button:hover { border-color: var(--blue-ui); }
.choices button:active, .rc-options button:active, .rc-chips button:active { transform: scale(.97); }
.choices button:disabled, .rc-options button:disabled, .rc-chips button:disabled { cursor: default; }
.choices .is-right, .rc-options .right { border-color: var(--blue-ui); background: #EEF4FF; color: var(--blue); }
.choices .is-wrong, .rc-options .wrong { border-color: #E2B4A8; background: #FBEFEB; color: #8E3B22; text-decoration: line-through; }
.quiz-out, .rc-out { margin-top: 10px; font-size: 15px; color: var(--ink-2); min-height: 1.4em; }

/* Reviews: playable card */
.stages button .mono { color: var(--blue); margin-right: 10px; font-size: 13px; }
.rc-options button { width: 100%; text-align: left; padding: 12px 14px; font-size: 16px; }
.rc-passage .gap { display: inline-block; min-width: 5.5em; border-bottom: 2px solid var(--blue-ui); color: var(--blue); }
.rc-passage .gap.filled { background: var(--tap); border-radius: 3px; border-bottom-color: transparent; padding: 0 3px; }
.rc-passage .slots { min-width: 11em; }
.rc-chips button { font: 400 19px/1.2 var(--serif); }
.rc-reveal { margin-top: 16px; background: var(--ink); color: var(--paper); border-color: var(--ink); }
.rc-answer { margin-top: 16px; font: 500 clamp(20px, 2vw, 26px)/1.3 var(--serif); color: var(--blue); }
.rc-grades { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.rc-grades button.on { background: var(--blue-ui); border-color: var(--blue-ui); color: #fff; }
.rc-grades[hidden] { display: none; }
.rc-next { margin-top: 12px; background: transparent; border-color: var(--ink); }

/* Wall: the card opens right under the tapped line */
.line-card {
  display: block; margin: 14px 0 18px; max-width: 560px; background: #fff; border-radius: 16px; padding: 16px 18px 14px;
  box-shadow: 0 1px 0 rgba(26,24,20,.06), 0 18px 40px -22px rgba(26,24,20,.45); font-family: var(--sans);
}
.lc-phrase { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; font: 600 20px/1.3 var(--sans); color: var(--blue); }
.lc-label { margin-top: 10px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.lc-meaning { font-size: 19px; color: var(--ink); }
.lc-src { margin-top: 10px; padding-top: 10px; border-top: 1px solid #eee; color: var(--ink-2); font-size: 12px; }

/* Sky: three depth layers that turn with the pointer and drift with the scroll */
.sky-copy p:not(.kicker):not(.sky-count) + p { margin-top: 12px; }
.sky-stage { --px: 0; --py: 0; --sy: 0; perspective: 900px; width: 100%; max-width: 560px; justify-self: center; aspect-ratio: 1; }
.sky-3d {
  position: relative; width: 100%; height: 100%; transform-style: preserve-3d;
  transform: rotateY(calc(var(--px) * 12deg)) rotateX(calc(var(--py) * -10deg + var(--sy) * 6deg));
  transition: transform .6s cubic-bezier(.2,.7,.2,1);
}
.sky-3d .layer { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sky-3d .far { transform: translateZ(-220px) scale(1.4); }
.sky-3d .mid { transform: translateZ(-90px) scale(1.16); }
.sky-3d .near { transform: translateZ(40px); }
.dust circle { fill: #fff; }
.ghost path { fill: none; stroke: rgba(233, 228, 218, .16); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.figure-base path { stroke: rgba(233, 228, 218, .12); stroke-width: .5; stroke-linecap: round; stroke-linejoin: round; }
.figure-lines path {
  stroke: rgba(233, 228, 218, .85); stroke-width: .55; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .35s linear, stroke .8s ease;
}
.figure-stars circle { fill: rgba(233, 228, 218, .3); transition: fill .4s ease; }
.figure-stars circle.lit { fill: #fff; }
.sky.is-done .figure-lines path { stroke: var(--gold); }
.sky.is-done .figure-stars circle.lit { fill: var(--gold); }
.sky-count span:last-child { color: var(--gold); }

/* Books: a real shelf, in perspective */
.bookcase { position: relative; perspective: 1100px; padding: 0 6px; }
.shelf3d { display: flex; align-items: flex-end; gap: 4px; height: 290px; padding: 0 10px; transform: rotateX(4deg); transform-origin: bottom; }
.book {
  --c: #2F3B52; --h: 88%; --w: 44px;
  position: relative; flex: none; width: var(--w); height: var(--h); border-radius: 3px 3px 2px 2px;
  background:
    linear-gradient(90deg, rgba(0,0,0,.28), rgba(255,255,255,.12) 18%, rgba(255,255,255,0) 40%, rgba(0,0,0,.18) 88%, rgba(0,0,0,.35)),
    linear-gradient(transparent 8%, rgba(226,184,101,.55) 8.6%, transparent 9.6%, transparent 86%, rgba(226,184,101,.55) 86.6%, transparent 87.6%),
    var(--c);
  box-shadow: 0 10px 16px -10px rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  transition: transform .25s cubic-bezier(.2,.7,.2,1);
}
.book::before { /* the top of the pages */
  content: ""; position: absolute; left: 3px; right: 3px; top: -5px; height: 6px; border-radius: 2px 2px 0 0;
  background: repeating-linear-gradient(90deg, #F3ECDD 0 2px, #E2D8C4 2px 3px); transform: skewX(-30deg); transform-origin: bottom;
}
.book i {
  font: 400 15px/1 var(--serif); font-style: normal; color: #F6EEE3; white-space: nowrap;
  writing-mode: vertical-rl; transform: rotate(180deg); max-height: 82%; overflow: hidden; text-overflow: ellipsis;
}
.bookcase:hover .book:hover { transform: translateY(-14px); }
.b1 { --c: #2F3B52; --h: 92%; --w: 48px; }
.b2 { --c: #8C3B26; --h: 80%; --w: 42px; }
.b3 { --c: #3F5A43; --h: 72%; --w: 36px; }
.b4 { --c: #5B2E3E; --h: 98%; --w: 54px; }
.b5 { --c: #B5893F; --h: 78%; --w: 40px; }
.b5 i { color: #2A2217; }
.b6 { --c: #24303A; --h: 85%; --w: 38px; }
.book.own { --c: #F4EEE2; }
.book.own i { color: var(--ink); font: 400 12px/1 var(--mono); }
.b7 { --h: 70%; --w: 44px; }
.b8 { --c: #E6DDCB; --h: 62%; --w: 40px; }
.book.lean { transform: rotate(9deg); transform-origin: bottom left; margin-left: 12px; }
.bookcase:hover .book.lean:hover { transform: rotate(9deg) translateY(-10px); }
.board {
  display: block; height: 16px; margin: 0 -6px; border-radius: 2px;
  background: linear-gradient(#8A7258, #6E5C46 40%, #5A4A37); box-shadow: 0 14px 22px -14px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.18);
}
@media (max-width: 720px) {
  .shelf3d { height: 220px; gap: 3px; padding: 0 4px; }
  .book { --w: 34px; }
  .b4 { --w: 40px; }
  .book i { font-size: 13px; }
  .line-card { margin: 8px 0 16px; }
  .sky-stage { max-width: 340px; }
}
@media (prefers-reduced-motion: reduce) {
  .sky-3d { transform: none; }
  .speak.is-speaking .w1, .speak.is-speaking .w2 { animation: none; }
}
.stages button { justify-content: flex-start; align-items: baseline; text-align: left; gap: 0; }
.stages button::after { margin-left: auto; }
.stages button[aria-selected="true"] .mono { color: #9CC0FF; }
/* Rule above the language list as a pseudo-element, not a background, so the text keeps a solid ground. */
.langs { background: none; position: relative; }
.langs::before { content: ""; position: absolute; top: 0; left: var(--gutter); right: var(--gutter); height: 1px; background: var(--rule); }
/* Spine colour as a solid colour under the shading. */
.book { background-color: var(--c); background-image:
    linear-gradient(90deg, rgba(0,0,0,.28), rgba(255,255,255,.12) 18%, rgba(255,255,255,0) 40%, rgba(0,0,0,.18) 88%, rgba(0,0,0,.35)),
    linear-gradient(transparent 8%, rgba(226,184,101,.55) 8.6%, transparent 9.6%, transparent 86%, rgba(226,184,101,.55) 86.6%, transparent 87.6%); }
