/* No. 020 · A language nobody speaks
   A printed grammar: one serif made for linguists, black ink on paper, and the cover of the book in
   cloth of a color that belongs to the language. Red is kept for one thing, what just changed. */
:root {
  /* the paper takes a little of the cover's cloth, so each language has pages of its own */
  --paper: color-mix(in srgb, var(--ground) 7%, #fbfaf7); --sheet: color-mix(in srgb, var(--ground) 3%, #fefdfb); --ink: #1a1713; --soft: #6a6253; --line: rgba(26, 23, 19, .2); --wash: rgba(26, 23, 19, .06);
  --red: #c5341c;
  --ground: #1f2c5c; --on: #f3ead6; --on-soft: #aab3d6;
  --face: 'Gentium Book Plus', 'Gentium Plus', 'Charis SIL', 'Iowan Old Style', Palatino, Georgia, serif;
  --margin: clamp(18px, 4vw, 56px);
  --out: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--soft) var(--paper); background: var(--paper); }
body { background: var(--paper); color: var(--ink); font: 400 17px/1.5 var(--face); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
::selection { background: var(--red); color: #fff; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
button, input { font: inherit; color: inherit; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
canvas { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
i { font-style: italic; }
abbr { text-decoration: none; }
.cap, .lab, .key abbr, .g abbr, h3, .work span, .facts, dt, caption, table th, .name-box label { font-variant-caps: all-small-caps; letter-spacing: .05em; }

/* ---------- the top and the cover: the cloth of the book ---------- */
.top, .cover { background: var(--ground); color: var(--on); }
/* the cloth changes color when the page turns to another language, not when it first opens */
.turning .top, .turning .cover { transition: background-color .7s var(--out), color .7s var(--out); }
.top { display: flex; align-items: center; gap: 12px; padding: max(14px, env(safe-area-inset-top)) var(--margin) 0; }
.back { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px; border: 1px solid color-mix(in srgb, var(--on) 40%, transparent); border-radius: 17px; color: inherit; text-decoration: none; font-size: 15px; white-space: nowrap; }
.back:hover { background: color-mix(in srgb, var(--on) 12%, transparent); }
.work { font-size: 15px; color: var(--on-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.work span { color: var(--on); margin-right: 6px; font-size: 16px; }
.top :focus-visible, .cover :focus-visible { outline-color: var(--on); }

.cover { display: grid; justify-items: center; text-align: center; margin-top: -1px; padding: clamp(20px, 4vw, 44px) var(--margin) clamp(40px, 6vw, 76px); }
.cover h1 { font-weight: 400; font-size: 17px; font-variant-caps: all-small-caps; letter-spacing: .16em; color: var(--on-soft); }
.ink { display: grid; place-items: center; width: 100%; min-height: clamp(170px, 34vh, 380px); margin: clamp(6px, 2vw, 22px) 0 0; }
.name { font-size: clamp(46px, 8.6vw, 104px); line-height: 1; letter-spacing: -.01em; margin-top: clamp(4px, 1vw, 12px); overflow-wrap: anywhere; }
.name .ipa { display: block; margin-top: 12px; font-size: clamp(16px, 1.5vw, 20px); letter-spacing: .02em; color: var(--on-soft); }
.means { margin-top: 10px; font-style: italic; font-size: clamp(17px, 1.6vw, 21px); }
.facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 0; margin-top: 18px; font-size: 16.5px; color: var(--on-soft); }
.facts span:not(:last-child)::after { content: '·'; margin: 0 .7em; }
.frieze { display: flex; justify-content: center; width: 100%; margin-top: clamp(26px, 4vw, 44px); overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
.track { display: flex; flex: none; margin: 0 auto; }
.track canvas { flex: none; max-width: none; }
/* the band of writing slides in along the foot of the cover once, and settles */
@keyframes settle { from { opacity: 0; transform: translateX(var(--from, 90px)); } }
.arrive .track { animation: settle 3.4s var(--out) backwards; animation-delay: calc(var(--pen, 1200ms) * .5 + 500ms); }
.track.back { --from: -90px; }
.lede { max-width: 58ch; margin-top: clamp(22px, 3vw, 34px); font-size: clamp(16.5px, 1.35vw, 19px); line-height: 1.55; text-wrap: pretty; }
.go { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 20px; margin-top: 26px; }
.next { height: 46px; padding: 0 24px; border: 0; border-radius: 23px; background: var(--on); color: var(--ground); font-size: 18px; cursor: pointer; transition: transform .2s var(--out); }
.next:hover { transform: translateY(-1px); }
.next:active { transform: translateY(1px) scale(.98); }
.num { color: var(--on); font-size: 16px; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--on) 45%, transparent); text-underline-offset: 3px; font-variant-numeric: tabular-nums; }

/* ---------- opening, and turning to another language ----------
   Until the script has made its language, only the cloth and the title show: never the sample
   language that is in the page for readers without scripts. */
.js:not([data-ready]) .cover > :not(h1), .js:not([data-ready]) .sec, .js:not([data-ready]) .foot { visibility: hidden; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes show { from { opacity: 0; } }
.arrive .name, .arrive .means, .arrive .facts, .arrive .lede, .arrive .go { animation: rise .9s var(--out) backwards; animation-delay: calc(var(--pen, 1200ms) * .5 + var(--i, 0) * 110ms); }
.arrive .means { --i: 1; } .arrive .facts { --i: 2; } .arrive .lede { --i: 3; } .arrive .go { --i: 4; }
.arrive .ink { animation: show .35s ease backwards; }
.arrive .sec.seen .body { animation: show .7s ease backwards; }
/* a section comes up as it is scrolled to */
.motion .sec > * { transition: opacity .9s var(--out), transform .9s var(--out); }
.motion .sec > .body { transition-delay: .12s; }
.motion .sec:not(.seen) > * { opacity: 0; transform: translateY(26px); }
.saying { border-radius: 5px; background: color-mix(in srgb, var(--ground) 16%, transparent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--ground) 16%, transparent); }
.w { transition: background-color .12s, box-shadow .12s; }
.hear[aria-pressed="true"] { animation: speaking 1.1s ease-in-out infinite; }
@keyframes speaking { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--red) 22%, transparent); } }
.chip { transition: background-color .15s; }
.seg button, .tog, .hear, .all summary { transition: background-color .15s, color .15s; }

/* ---------- a section: its name and notes in the margin, the matter beside ---------- */
.sec { display: grid; grid-template-columns: minmax(0, 18.5rem) minmax(0, 1fr); gap: 20px clamp(28px, 5vw, 80px); max-width: 1280px; margin: 0 auto; padding: clamp(40px, 6vw, 80px) var(--margin); }
.sec + .sec { border-top: 1px solid var(--line); }
.sec > header h2 { font-weight: 400; font-size: clamp(30px, 3.4vw, 44px); line-height: 1.05; letter-spacing: -.01em; }
.sec > header p { margin-top: 12px; font-size: 15.5px; line-height: 1.5; color: var(--soft); text-wrap: pretty; }
.sec > header i, .why i, dd i, .fine i, .said i { color: var(--ink); }
.body { min-width: 0; }
h3 { font-weight: 400; font-size: 16px; color: var(--soft); margin: 30px 0 10px; }
h3:first-child { margin-top: 4px; }
.fine { font-size: 14.5px; line-height: 1.5; color: var(--soft); max-width: 64ch; text-wrap: pretty; }
.grid-wrap { overflow-x: auto; }

/* ---------- one sentence ---------- */
.ink-box { display: flex; justify-content: center; min-height: 96px; align-items: center; }
.inter { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; margin-top: 6px; }
.w { display: inline-grid; justify-items: start; }
.r { font-style: italic; font-size: 20px; line-height: 1.25; }
.g { font-size: 13px; line-height: 1.3; color: var(--soft); }
.g abbr { font-size: 14px; }
.hot { color: var(--red); }
.en { margin-top: 26px; text-align: center; font-size: clamp(23px, 2.7vw, 31px); line-height: 1.35; text-wrap: balance; }
.chip { padding: 1px 7px; margin: 0 -5px; border: 0; border-radius: 4px; background: none; cursor: pointer; text-decoration: underline dotted; text-decoration-thickness: 2px; text-underline-offset: 6px; text-decoration-color: var(--soft); }
.chip:hover, .chip[aria-expanded="true"] { background: var(--wash); text-decoration-color: var(--red); text-decoration-style: solid; }
.switches { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 10px; margin-top: 22px; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.seg button, .tog { min-height: 38px; padding: 0 15px; border: 0; background: none; font-size: 16px; cursor: pointer; white-space: nowrap; }
.tog { border: 1px solid var(--line); border-radius: 20px; }
.seg button + button { box-shadow: -1px 0 0 var(--line); }
.seg button:hover, .tog:hover { background: var(--wash); }
.seg button[aria-pressed="true"], .tog[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.hear { display: inline-flex; align-items: center; gap: 9px; min-height: 38px; padding: 0 16px 0 14px; border: 1px solid var(--ink); border-radius: 20px; background: none; font-size: 16px; cursor: pointer; white-space: nowrap; }
.hear span { width: 9px; height: 12px; background: var(--ink); clip-path: polygon(0 0, 100% 50%, 0 100%); }
.hear:hover { background: var(--wash); }
.hear[aria-pressed="true"] { background: var(--red); border-color: var(--red); color: #fff; }
.hear[aria-pressed="true"] span { height: 10px; background: #fff; clip-path: none; }
.hear-row { margin-top: 16px; }
.panel { display: grid; gap: 10px; margin: 18px auto 0; padding: 16px 18px; max-width: 760px; border: 1px solid var(--line); border-radius: 12px; background: var(--sheet); }
.panel .row { display: grid; grid-template-columns: 6.2rem minmax(0, 1fr); align-items: start; gap: 10px; }
.panel .lab { padding-top: 7px; font-size: 15.5px; color: var(--soft); }
.panel .seg { border-radius: 12px; justify-self: start; }
.panel .seg button { min-height: 36px; padding: 0 12px; box-shadow: none; border-radius: 12px; }
.why { max-width: 60ch; margin: 24px auto 0; text-align: center; font-size: 17.5px; line-height: 1.5; text-wrap: pretty; min-height: 3em; }
.why b { font-weight: 400; color: var(--red); }
.key { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 16px; margin-top: 14px; font-size: 14px; color: var(--soft); }
.key abbr { color: var(--ink); font-size: 15px; }
.trail { margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); text-align: center; }
.trail .next { background: var(--ink); color: var(--paper); }
.trail .lab { margin-top: 24px; font-size: 15.5px; color: var(--soft); }
.trail ul { display: grid; gap: 6px; margin-top: 10px; }
.trail li { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 14px; }
.trail a { color: var(--soft); text-underline-offset: 3px; }
.trail .r { font-size: 18.5px; }

/* ---------- the writing ---------- */
.letters { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 2px; }
.letters li { display: grid; justify-items: center; align-content: end; gap: 0; padding: 6px 8px 10px; border-radius: 6px; }
.letters li span { font-style: italic; font-size: 16px; color: var(--soft); }
.letters li.mark { background: var(--wash); }
.syl { border-collapse: collapse; }
.syl th { padding: 2px 10px; font-weight: 400; font-size: 16px; color: var(--soft); font-style: italic; font-variant-caps: normal; letter-spacing: 0; }
.syl td { padding: 0 2px; }
.syl td canvas { margin: 0 auto; }
.name-box { margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); }
.name-box label { display: block; font-size: 16px; color: var(--soft); }
.name-box input { width: min(100%, 22rem); margin-top: 4px; padding: 4px 0 6px; border: 0; border-bottom: 2px solid var(--ink); border-radius: 0; background: none; font-size: 28px; }
.name-box input:focus-visible { outline: none; border-bottom-color: var(--red); }
.yours { margin-top: 12px; min-height: 120px; }
.yours canvas { margin-left: -10px; }
.said { margin-top: 2px; font-size: 16px; color: var(--soft); max-width: 56ch; }

/* ---------- the sounds ---------- */
.cons { border-collapse: collapse; min-width: min(100%, 420px); }
.cons caption, .vowels .cap { caption-side: top; text-align: left; font-size: 16px; color: var(--soft); padding-bottom: 6px; }
.cons th { padding: 7px 14px 7px 0; text-align: left; font-weight: 400; font-size: 14.5px; color: var(--soft); white-space: nowrap; }
.cons thead th { padding-bottom: 4px; }
.cons td { padding: 7px 14px 7px 0; border-top: 1px solid var(--line); white-space: nowrap; }
.cons tbody th { border-top: 1px solid var(--line); }
.ph { display: inline-flex; align-items: baseline; gap: 4px; margin-right: 12px; }
.ph b { font-weight: 400; font-size: 21px; }
.ph small { font-size: 13px; color: var(--soft); }
.vowels { margin: 26px 0 18px; }
.vowels .cap { display: block; }

/* ---------- the words ---------- */
.made { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 0 28px; }
.made li { display: grid; align-content: start; gap: 0; padding: 4px 0 14px; border-top: 1px solid var(--line); }
.made li canvas { margin-left: -9px; }
.made p { font-size: 17.5px; line-height: 1.35; }
.made b { font-weight: 700; }
.made .lit, .made .real { display: block; font-size: 14.5px; line-height: 1.4; color: var(--soft); }
.made .real { margin-top: 3px; }
.made.down li { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; padding: 8px 0; }
.made + .fine { margin-top: 12px; }
.roots { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 0 20px; }
.roots li { display: flex; align-items: center; gap: 4px; min-height: 44px; font-size: 16px; color: var(--soft); border-top: 1px solid var(--line); }
.roots li canvas { flex: none; margin-left: -6px; }
.roots i { color: var(--ink); font-size: 17px; }
.all { margin-top: 18px; }
.all summary { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border: 1px solid var(--line); border-radius: 20px; font-size: 16px; cursor: pointer; list-style: none; }
.all summary::-webkit-details-marker { display: none; }
.all summary::after { content: '+'; margin-left: 10px; font-size: 19px; line-height: 1; }
.all[open] summary::after { content: '–'; }
.all summary:hover { background: var(--wash); }

/* ---------- counting ---------- */
.nums { display: flex; flex-wrap: wrap; gap: 0 28px; }
.nums li, .twenty { display: grid; justify-items: start; align-content: start; gap: 0; min-width: 104px; padding: 8px 0 14px; border-top: 1px solid var(--line); }
.nums li { flex: 1 0 auto; }
.nums canvas, .twenty canvas { margin-left: -9px; }
.n { font-size: 30px; line-height: 1; font-variant-numeric: lining-nums; }
.nums i, .twenty i { font-size: 17.5px; }
.nums small, .twenty small { font-size: 13.5px; line-height: 1.25; color: var(--soft); }
.twenty { width: fit-content; margin-top: 4px; }

/* ---------- a short text ---------- */
.page { padding: clamp(14px, 3vw, 34px); background: var(--sheet); border: 1px solid var(--line); border-radius: 3px; box-shadow: 0 14px 30px -24px rgba(26, 23, 19, .5); }
.lines { display: grid; gap: 18px; margin-top: 28px; counter-reset: line; }
.lines li { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); gap: 0 6px; counter-increment: line; }
.lines li::before { content: counter(line); grid-row: 1 / span 2; font-size: 15px; color: var(--soft); padding-top: 3px; }
.lines .inter { justify-content: flex-start; margin: 0; }
.tr { grid-column: 2; margin-top: 4px; font-size: 16.5px; }
.lines + .key { justify-content: flex-start; margin-left: 2rem; }

/* ---------- the grammar ---------- */
.rules { display: grid; }
.rules div { display: grid; grid-template-columns: 11.5rem minmax(0, 1fr); gap: 4px 20px; padding: 13px 0; border-top: 1px solid var(--line); }
.rules div:first-child { border-top: 0; padding-top: 2px; }
dt { font-size: 16px; color: var(--soft); }
dd { max-width: 62ch; text-wrap: pretty; }
.about .body { display: grid; gap: 14px; }
.about .body p { max-width: 64ch; text-wrap: pretty; }

.foot { padding: 26px var(--margin) max(30px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); font-size: 15px; color: var(--soft); }
.foot a { color: inherit; }

/* ---------- without scripts: one language, in Latin letters ---------- */
.no-js .ink, .no-js .go, .no-js .frieze { display: none; }
.no-js .name { margin-top: 26px; }
.plain-lines { display: grid; gap: 14px; }
.plain-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 4px 24px; }
ol.plain-list { list-style: decimal; padding-left: 1.4em; }
.no-js .why { text-align: left; margin-left: 0; }
.no-js #writing { display: none; }
.plain-lines i { font-size: 19px; }
.plain-lines small { display: block; font-size: 14px; color: var(--soft); }

/* ---------- the cover alone ---------- */
.bare body { background: var(--ground); }
.bare .top, .bare .sec, .bare .foot, .bare .lede, .bare .go { display: none; }
.bare .cover h1 { position: absolute; left: 0; right: 0; top: 34px; font-size: 19px; }
.bare .cover { min-height: 100vh; align-content: center; padding-top: 30px; padding-bottom: 30px; }
.bare .ink { min-height: 0; }
.bare .frieze { position: absolute; left: 0; bottom: 30px; margin: 0; -webkit-mask-image: none; mask-image: none; }
.bare .cover { position: relative; padding-bottom: 86px; }
.bare .name { font-size: 84px; }
.bare .facts { margin-top: 14px; }

@media (max-width: 860px) {
  .sec { grid-template-columns: minmax(0, 1fr); }
  .sec > header p { max-width: 62ch; }
  .rules div { grid-template-columns: minmax(0, 1fr); }
  .panel .row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .panel .lab { padding-top: 0; }
}
@media (max-width: 480px) {
  body { font-size: 16.5px; }
  .work { font-size: 14px; }
  .seg button, .tog { padding: 0 12px; }
  .r { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  .turning .top, .turning .cover, .next { transition: none; }
  .hear[aria-pressed="true"] { animation: none; }
  .arrive .name, .arrive .means, .arrive .facts, .arrive .lede, .arrive .go, .arrive .track, .arrive .ink, .arrive .sec.seen .body { animation: none; }
}
