/* The font page (font.html): a stack of vellum leaves on the dark of the room. The room,
   the leaf, the bar and the foot are page.css (shared with the About pages); this is the
   rest. The hands are registered by font.js from data and reach the page through the
   --hand-* variables; until they arrive the masthead stays hidden rather than flash in a
   serif. */

:root {
  --hand-display: var(--serif);
  --hand-text: var(--serif);
  --hand-water: var(--serif);
  --hand-small: var(--serif);
  --tick: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path d='M1.9 6.3c1 .8 1.7 1.8 2.3 3.1C5.5 6.1 7.7 3.4 10.8 1.4' fill='none' stroke='%239a2414' stroke-width='1.7' stroke-linecap='round'/></svg>");
}

main { max-width: 1160px; margin: 0 auto; padding: 0 20px 24px; }

.loading { text-align: center; font-style: italic; color: rgba(239, 228, 200, 0.75); margin: 2em 0; }
.loading[hidden] { display: none; }
.loading a { color: #e7c98a; border-bottom-color: rgba(231, 201, 138, 0.5); }

.leaf h2 {
  margin: 0 0 1.1em;
  font-family: var(--hand-display);
  font-weight: normal;
  font-size: clamp(28px, 3.6vw, 42px);
  line-height: 1.15;
  letter-spacing: 0.05em;
  text-align: center;
}
.leaf h2::after {
  content: "";
  display: block;
  width: 6.5em;
  max-width: 60%;
  height: 1px;
  margin: 0.4em auto 0;
  background: linear-gradient(to right, transparent, var(--rubric) 35%, var(--rubric) 65%, transparent);
  opacity: 0.75;
}
.leaf h3 {
  margin: 2.2em 0 0.7em;
  font-family: var(--hand-display);
  font-weight: normal;
  font-size: 1.28em;
  letter-spacing: 0.07em;
  line-height: 1.2;
  border-bottom: 0.5px solid var(--rule);
  padding-bottom: 0.25em;
}
.leaf p { margin: 0 0 0.9em; }
.note { color: var(--ink-soft); font-size: 0.94em; }
.prose { max-width: 44em; }

.textbutton {
  min-height: 44px;
  padding: 0 0.2em;
  background: none;
  border: 0;
  border-bottom: 0.5px solid rgba(42, 29, 20, 0.45);
  border-radius: 0;
  font-style: italic;
  color: var(--ink);
  cursor: pointer;
}
.textbutton:hover { color: var(--rubric); border-bottom-color: var(--rubric); }

/* ── masthead ── */
.masthead { text-align: center; padding-bottom: clamp(26px, 3.4vw, 44px); }
.masthead h1 {
  margin: 0.1em 0 0.12em;
  font-family: var(--hand-display);
  font-weight: normal;
  font-size: clamp(40px, 7vw, 92px);
  line-height: 1.05;
  letter-spacing: 0.02em;
}
.masthead .lede {
  margin: 0 auto 1.2em;
  max-width: 30em;
  font-family: var(--hand-text);
  font-size: clamp(20px, 2.3vw, 27px);
  line-height: 1.35;
  color: var(--ink-soft);
}
/* hidden until the hands are in (font.js adds .ready; noscript shows them) */
html:not(.ready) .masthead h1,
html:not(.ready) .masthead .lede,
html:not(.ready) .masthead .hero { visibility: hidden; }

.hero {
  --u: clamp(17px, 3.1vw, 34px);
  margin: 0.6em auto 0.4em;
  max-width: 900px;
  padding: 1.1em 0 0.9em;
  border-top: 0.5px solid var(--rule);
  border-bottom: 0.5px solid var(--rule);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.18em;
}
.hero .name { line-height: 1.15; overflow-wrap: break-word; max-width: 100%; }
.hero .name:nth-child(2) { align-self: flex-start; margin-left: 8%; }
.hero .name:nth-child(3) { align-self: flex-end; margin-right: 10%; }
.hero .name:nth-child(5) { align-self: flex-start; margin-left: 22%; }

.contents {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 1.3em;
  margin-top: 1.2em;
}
.contents a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border: 0;
  color: var(--ink);
  font-size: 1.05em;
}
.contents a:hover { color: var(--rubric); }
.contents a.face-link { font-size: 1.2em; }

/* ── introduction ── */
.intro-text {
  max-width: 34em;
  margin: 0 auto;
  font-family: var(--hand-text);
  font-size: clamp(19px, 1.9vw, 23px);
  line-height: 1.5;
}
.intro-text p:first-child::first-letter { color: var(--rubric); }

table.glance {
  margin: 2.2em auto 0;
  border-collapse: collapse;
  font-variant-numeric: lining-nums tabular-nums;
  font-size: 0.95em;
}
.glance caption { caption-side: bottom; padding-top: 0.8em; font-size: 0.86em; font-style: italic; color: var(--sepia); }
.glance th, .glance td { padding: 0.42em 0.9em; border-bottom: 0.5px solid var(--rule); text-align: right; }
.glance thead th { font-weight: normal; font-size: 1.25em; text-align: right; border-bottom: 1px solid rgba(42, 29, 20, 0.5); }
.glance tbody th { text-align: left; font-weight: normal; font-style: italic; color: var(--ink-soft); }
.glance tbody tr:last-child th, .glance tbody tr:last-child td { border-bottom: 0; }

/* ── the preview ── */
.try-faces { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.2em 1.4em; margin-bottom: 0.6em; }
.face-opt { position: relative; display: inline-flex; align-items: center; min-height: 48px; cursor: pointer; }
.face-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.face-opt span {
  font-size: 1.45em;
  color: var(--sepia);
  border-bottom: 1px solid transparent;
  padding: 0 0.1em 0.04em;
  line-height: 1.25;
}
.face-opt:hover span { color: var(--rubric); }
.face-opt input:checked + span { color: var(--ink); border-bottom-color: var(--rubric); }
.face-opt input:focus-visible + span { outline: 1px dotted var(--rubric); outline-offset: 3px; }

.try-text {
  display: block;
  width: 100%;
  min-height: 2.2em;
  margin: 0 0 0.6em;
  padding: 0.2em 0.35em;
  background: rgba(255, 250, 235, 0.32);
  border: 0.5px solid rgba(42, 29, 20, 0.4);
  border-radius: 1px;
  color: var(--ink);
  font-size: 56px;
  line-height: 1.25;
  resize: vertical;
  overflow: hidden;
  font-kerning: normal;
}
.try-text:focus { outline: none; border-color: var(--rubric); background: rgba(255, 250, 235, 0.45); }

.try-samples { display: flex; flex-wrap: wrap; gap: 0 1.1em; margin: 0 0 1em; }
.try-samples::before { content: "Samples:"; align-self: center; font-size: 0.9em; color: var(--sepia); font-style: italic; }

.try-sliders { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4em 1.6em; margin: 0 0 1.2em; }
.slider { display: flex; flex-direction: column; font-size: 0.92em; color: var(--ink-soft); }
.slider span { display: flex; justify-content: space-between; gap: 1em; }
.slider output { font-variant-numeric: lining-nums tabular-nums; color: var(--ink); }
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 44px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track { height: 1px; background: var(--ink-soft); }
input[type="range"]::-moz-range-track { height: 1px; background: var(--ink-soft); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px;
  margin-top: -10px;
  border-radius: 50%;
  background: rgb(var(--vellum));
  border: 1.5px solid var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: rgb(var(--vellum));
  border: 1.5px solid var(--ink);
}
input[type="range"]:focus-visible { outline: 1px dotted var(--rubric); }
input[type="range"]:hover::-webkit-slider-thumb { border-color: var(--rubric); }

.try-features { margin: 0 0 1em; padding: 0; border: 0; min-width: 0; }
.try-features legend { padding: 0; margin-bottom: 0.4em; font-style: italic; color: var(--ink-soft); font-size: 0.94em; }
.feature-toggles { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 0 1.4em; }
.ft {
  display: flex;
  align-items: center;
  gap: 0.6em;
  min-height: 46px;
  border-bottom: 0.5px solid var(--rule);
  cursor: pointer;
}
.ft input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ft .box {
  flex: none;
  width: 18px; height: 18px;
  border: 1px solid var(--ink-soft);
  transform: rotate(-1.5deg);
  background: center / 118% no-repeat;
}
.ft input:checked + .box { background-image: var(--tick); border-color: var(--ink); }
.ft input:focus-visible + .box { outline: 1px dotted var(--rubric); outline-offset: 2px; }
.ft .tag { font-family: var(--mono); font-size: 0.86em; min-width: 3.4em; }
.ft .nm { font-size: 0.9em; color: var(--ink-soft); line-height: 1.25; }
.ft:hover .nm, .ft:hover .tag { color: var(--rubric); }
.ft .def { margin-left: auto; font-size: 0.75em; font-style: italic; color: var(--sepia); white-space: nowrap; }

.try-css { font-size: 0.92em; color: var(--ink-soft); overflow-wrap: anywhere; }
.try-css .label { font-style: italic; margin-right: 0.4em; }
.try-css code { color: var(--ink); }
.try-note { font-size: 0.86em; font-style: italic; color: var(--sepia); }
.try-actions { margin: 0; }

/* ── a face ── */
.face-head { text-align: center; margin-bottom: 1.4em; }
.face-head h2 { font-size: clamp(44px, 7vw, 84px); letter-spacing: 0.02em; margin-bottom: 0.25em; }
.face-head .meta { margin: 0; font-size: 0.9em; color: var(--sepia); font-variant-numeric: lining-nums; }
.face-head .meta code { font-size: 0.92em; }
.face .use { max-width: 40em; margin: 0 auto 1.6em; text-align: left; }

.specimen {
  --u: clamp(40px, 10.5vw, 148px);
  margin: 0 0 1.4em;
  padding: 0.3em 0 0.5em;
  border-top: 0.5px solid var(--rule);
  border-bottom: 0.5px solid var(--rule);
  overflow: hidden;
}
.specimen .line { line-height: 1.12; overflow-wrap: break-word; }
.specimen .line + .line { margin-top: 0.12em; }
.para { font-size: clamp(20px, 2.3vw, 27px); line-height: 1.45; max-width: 36em; margin: 0 0 1.2em; }

.waterfall { margin: 0; }
.waterfall .row {
  display: grid;
  grid-template-columns: 3.2em 1fr;
  align-items: baseline;
  gap: 0.6em;
  padding: 0.1em 0;
  border-bottom: 0.5px solid rgba(42, 29, 20, 0.14);
}
.waterfall .px { font-size: 13px; color: var(--sepia); font-variant-numeric: lining-nums tabular-nums; text-align: right; }
.waterfall .txt { white-space: nowrap; overflow: hidden; line-height: 1.3; min-width: 0; }

/* a long table that opens and closes under its heading */
.fold > summary { list-style: none; cursor: pointer; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary h3 { display: flex; align-items: baseline; gap: 0.6em; min-height: 44px; }
.fold > summary h3::before {
  content: "";
  flex: none;
  width: 0.42em; height: 0.42em;
  border-right: 1.5px solid var(--rubric);
  border-bottom: 1.5px solid var(--rubric);
  transform: translateY(-0.12em) rotate(-45deg);
  transition: transform 0.15s ease;
}
.fold[open] > summary h3::before { transform: translateY(-0.25em) rotate(45deg); }
.fold > summary .count { margin-left: auto; font-family: var(--serif); font-size: 0.66em; letter-spacing: 0; font-style: italic; color: var(--sepia); }
.fold > summary:hover h3 { color: var(--rubric); }

/* glyph cells: the glyph on a hairline that marks its advance */
.charset, .forms-cells { display: flex; flex-wrap: wrap; gap: 4px; }
.cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-width: 62px;
  padding: 4px 4px 3px;
  background: rgba(255, 250, 235, 0.28);
  border: 0.5px solid rgba(42, 29, 20, 0.2);
  border-radius: 1px;
  color: var(--ink);
  cursor: pointer;
  text-align: center;
}
.cell:hover { border-color: var(--rubric); background: rgba(255, 250, 235, 0.55); }
.cell.on { border-color: var(--rubric); box-shadow: inset 0 0 0 0.5px var(--rubric); }
.cell .g {
  display: inline-block;
  font-size: 44px;
  line-height: 1.5;
  white-space: pre;
  border-bottom: 1px solid rgba(110, 88, 65, 0.45);
  min-width: 2px;
}
.cell .lab {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.2;
  color: var(--sepia);
  font-style: italic;
  white-space: nowrap;
  font-variant-numeric: lining-nums;
}
.cell .lab code { font-style: normal; font-size: 10.5px; }
.cell .rot {
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: 11px;
  line-height: 1;
  color: var(--rubric);
  font-variant-numeric: lining-nums;
}
.charset .cell { width: 66px; }
.charset .cell .g { font-size: 34px; }

.forms { display: flex; flex-wrap: wrap; gap: 14px 22px; }
.forms-set { display: flex; flex-direction: column; gap: 3px; }
.forms-set .key { font-size: 0.86em; color: var(--ink-soft); font-style: italic; font-variant-numeric: lining-nums; }
.forms-set .key code { font-style: normal; }
.leaf .forms-kind { margin: 1.6em 0 0.5em; font-size: 0.95em; font-style: italic; color: var(--ink-soft); }
.forms-cells .cell .lab { min-height: 2.4em; }
.legend { font-size: 0.88em; color: var(--ink-soft); }
.legend .rotmark { color: var(--rubric); font-variant-numeric: lining-nums; }

/* demonstrations: the same text with a feature off and on */
.demo { margin: 0 0 1.6em; }
.demo h4 { margin: 0 0 0.35em; font-weight: normal; font-style: italic; font-size: 1em; color: var(--ink-soft); }
.demo h4 code { font-style: normal; color: var(--ink); }
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 6px; }
.panel {
  min-width: 0;
  padding: 0.35em 0.6em 0.5em;
  background: rgba(255, 250, 235, 0.26);
  border: 0.5px solid rgba(42, 29, 20, 0.18);
}
.panel .pl { display: block; font-size: 12px; color: var(--sepia); font-style: italic; font-variant-numeric: lining-nums; }
.panel .pl code { font-style: normal; font-size: 11.5px; color: var(--ink-soft); }
.panel .pt { display: block; font-size: 34px; line-height: 1.3; overflow-wrap: break-word; }
.panel.is-default .pl::after { content: " (default)"; }
.panels.big .pt { font-size: clamp(30px, 4.4vw, 52px); }
.panels.many { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.panels.many .pt { font-size: 26px; }
.joins { display: flex; flex-wrap: wrap; gap: 6px; }
.join {
  display: flex;
  align-items: baseline;
  gap: 0.35em;
  padding: 0.15em 0.55em 0.25em;
  background: rgba(255, 250, 235, 0.26);
  border: 0.5px solid rgba(42, 29, 20, 0.18);
  font-size: 40px;
  line-height: 1.35;
}
.join .arrow { font-family: var(--serif); font-size: 15px; color: var(--sepia); }

/* ── feature reference ── */
.feature-table { border-top: 1px solid rgba(42, 29, 20, 0.5); }
.frow {
  display: grid;
  grid-template-columns: 11em minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 0.4em 1.6em;
  padding: 1em 0;
  border-bottom: 0.5px solid var(--rule);
}
.frow .ftag code { font-size: 1.05em; color: var(--rubric); }
.frow .fname { display: block; font-style: italic; color: var(--ink-soft); font-size: 0.94em; line-height: 1.3; margin-top: 0.15em; }
.frow .fdef { display: block; font-size: 0.82em; color: var(--sepia); margin-top: 0.35em; }
.frow .fdesc { font-size: 0.95em; }
.frow .fdesc p { margin: 0 0 0.5em; }
.frow .fdesc .counts { font-size: 0.9em; color: var(--sepia); font-variant-numeric: lining-nums; }
.frow .fex .panel .pt { font-size: 30px; }
.frow .fex .panels { grid-template-columns: 1fr; }
.frow .fex .exface { font-size: 12px; color: var(--sepia); font-style: italic; margin: 0 0 0.2em; }
.frow .fex .exface + .panels + .exface { margin-top: 0.6em; }

/* ── how it was made ── */
.making .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2.6em; }
.making .cols h3:first-child { margin-top: 0.2em; }
.limits-h { margin-top: 1.6em; }
.limits { margin: 0; padding: 0; list-style: none; max-width: 46em; }
.limits li { margin: 0 0 0.6em; padding-left: 1.3em; text-indent: -1.3em; }
.limits li::before { content: "\2766"; display: inline-block; width: 1.3em; text-indent: 0; color: var(--rubric); font-size: 0.8em; }
.limits b { font-family: var(--hand-display); font-weight: normal; letter-spacing: 0.03em; }

/* ── the files ── */
.files { list-style: none; margin: 0 0 1.4em; padding: 0; border-top: 1px solid rgba(42, 29, 20, 0.5); }
.files li {
  display: grid;
  grid-template-columns: 9em minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.3em 1.2em;
  padding: 0.6em 0;
  border-bottom: 0.5px solid var(--rule);
}
.files .fface { font-size: 1.7em; line-height: 1.2; }
.files .finfo { font-size: 0.92em; color: var(--ink-soft); font-variant-numeric: lining-nums; overflow-wrap: anywhere; }
.files .finfo code { color: var(--ink); }
.dl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 1.1em;
  border: 1px solid var(--ink);
  border-radius: 1px;
  color: var(--ink);
  font-style: italic;
  white-space: nowrap;
}
.dl:hover { color: var(--rubric); border-color: var(--rubric); }
.snippet {
  margin: 0 0 0.6em;
  padding: 0.9em 1.1em;
  background: rgba(42, 29, 20, 0.06);
  border: 0.5px solid var(--rule);
  font-size: 15px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.snippet code { font-size: 0.92em; }
.copied { font-size: 0.9em; font-style: italic; color: var(--sepia); margin-left: 0.6em; }

/* ── the glyph inspector: a slip of vellum at the foot of the window ── */
.inspector {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom, 0));
  transform: translateX(-50%);
  z-index: 10;
  width: min(640px, calc(100vw - 24px));
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.4em 1.2em;
  padding: 14px 44px 14px 20px;
  background-color: rgba(var(--vellum), 0.97);
  background-image: var(--paper-grain);
  color: var(--ink);
  box-shadow: 0 0 0 0.5px rgba(60, 40, 20, 0.5), 0.3em 0.6em 2em -0.2em rgba(0, 0, 0, 0.75);
}
.inspector[hidden] { display: none; }
.inspector::before { content: ""; position: absolute; inset: 5px; border: 0.5px solid rgba(42, 29, 20, 0.35); pointer-events: none; }
.inspector .x {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 44px;
  height: 44px;
  background: none;
  border: 0;
  font-size: 26px;
  line-height: 1;
  color: var(--sepia);
  cursor: pointer;
}
.inspector .x:hover { color: var(--rubric); }
.ins-glyph {
  min-width: 1.1em;
  font-size: 92px;
  line-height: 1.35;
  text-align: center;
  white-space: pre;
}
.ins-glyph span { border-bottom: 1px solid rgba(110, 88, 65, 0.5); }
.ins-text p { margin: 0 0 0.3em; }
.ins-name { font-family: var(--mono); font-size: 0.92em; color: var(--rubric); overflow-wrap: anywhere; }
.ins-what { font-size: 0.95em; }
.ins-css { font-size: 0.9em; color: var(--ink-soft); overflow-wrap: anywhere; }

/* ── narrow screens ── */
@media (max-width: 900px) {
  .frow { grid-template-columns: 9em minmax(0, 1fr); }
  .frow .fex { grid-column: 1 / -1; }
  .making .cols { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  main { padding: 0 0 16px; }
  /* (page.css's narrow leaf comes before .masthead in the cascade now: keep its foot) */
  .masthead { padding-bottom: 30px; }
  .hero .name:nth-child(n) { align-self: center; margin: 0; }
  .try-sliders { grid-template-columns: 1fr; gap: 0; }
  .feature-toggles { grid-template-columns: 1fr; }
  .frow { grid-template-columns: 1fr; gap: 0.3em; }
  .frow .fex .panel .pt { font-size: 26px; }
  .panel .pt { font-size: 28px; }
  .glance th, .glance td { padding: 0.4em 0.45em; }
  .glance { font-size: 0.86em; }
  .glance thead th { font-size: 1.05em; }
  .files li { grid-template-columns: minmax(0, 1fr) auto; }
  .files .finfo { grid-column: 1 / -1; grid-row: 2; }
  .cell { min-width: 56px; }
  .cell .g { font-size: 32px; }
  .charset .cell { width: 54px; min-width: 54px; }
  .charset .cell .g { font-size: 28px; }
  .join { font-size: 32px; }
  .waterfall .row { grid-template-columns: 2.4em 1fr; gap: 0.4em; }
  .ins-glyph { font-size: 64px; }
  .inspector { padding: 12px 40px 12px 14px; gap: 0.3em 0.8em; }
  .snippet { font-size: 13px; padding: 0.8em; }
}
