/* 52-try.css - the tester on try.html. Class prefix: try-.
   Every page loads this file, so every rule starts from a try- class.
   Rows, in the order of the source at every width: the name and the law; the sample;
   the type (style, weight, size, tracking, leading); the setting (text, alignment,
   kerning, case); the four styles, each at its own job; the closing cell with Reset. The sample keeps one height and is
   held under the bar, at every width: the control cells pass under it, and a text
   taller than the cell scrolls inside it. */

/* ── The grid ────────────────────────────────────────────────────────────── */
.try-grid {
  --try-bar: var(--pl-bar);             /* the fixed bar above the page */
  --try-row: var(--pl-field);           /* the height of a control cell */
  --try-view: 100vh;                    /* the window, without a phone's own bars where the browser knows them */
  /* The height of the sample: two control rows short of the window, so both stand
     under it where the window allows; never less than one field, never more than two. */
  --try-stage: clamp(var(--pl-field), calc(var(--try-view) - var(--try-bar) - 2 * (var(--try-row) + var(--pl-hairline))), 2 * var(--pl-field));
  --try-kerning: normal;                /* the two switches: the sample and the proofs beside the switches read them */
  --try-features: normal;
  /* A window taller than the page gives its spare height to the opening; the sample keeps its height. */
  grid-template-rows: 1fr;
}
@supports (height: 100svh) { .try-grid { --try-view: 100svh; } }
/* A window too short for that keeps one control row under a lower sample. */
@media (max-height: 519.98px) {
  .try-grid { --try-stage: clamp(136px, calc(var(--try-view) - var(--try-bar) - var(--try-row) - var(--pl-hairline)), var(--pl-field)); }
}

/* ── The name ──────────────────────────────────────────────────────────────
   The y of "Try it" hangs 0.123em below its line box (the shared .pe-word has
   line-height .86). As on Glyphs, the word is lifted until the tail clears the
   hairline under the cell by 8px, and where the law stands beside the word (six
   fields) it is lifted as far, so the two baselines stay level. The arm of the T
   has a side bearing of 0.019em, not a stem's, so the word hangs by that much and
   the arm meets the inset. */
.try-open .pe-word { margin-left: -0.019em; padding-bottom: max(0px, calc(0.123em - 12px)); }
@media (min-width: 1224px) {
  .try-open .pl-law { padding-bottom: max(0px, calc(0.123 * clamp(3.5rem, 21cqw, 15rem) - 12px)); }   /* the clamp is .pe-word's own size */
}

/* ── A control cell: the label on top, one Vlak control on the floor ─────── */
/* Spans where the fields get fewer: a toggle group and the select keep two fields. */
.try-wide { --pl-two: 2; }
/* A group spans its cell like a slider does, so both edges meet the insets
   (Vlak does the same to a toggle group on a phone). */
.try-control > .rs-toggle-group { display: flex; width: 100%; }
.try-control .rs-toggle-grouped { flex: 1 1 0; }
/* A choice the visitor can make is ink, as the value in the select is. Gray is
   for what is not there yet: a style to be drawn keeps Vlak's gray, in the
   reading weight, and the pointer says so too. */
.try-control .rs-toggle:not(:disabled):not(.rs-toggle-pressed) { color: var(--text); }
.try-control :is(.rs-toggle, .rs-switch):disabled { cursor: not-allowed; }
.try-control .rs-toggle:disabled { font-weight: 400; }
/* Vlak draws the focus ring of a grouped toggle inside the segment, in ink. On
   the pressed segment that is ink on ink, so there the ring is paper. */
.try-control .rs-toggle-pressed:focus-visible { outline-color: var(--bg); outline-offset: -4px; }
.try-control .rs-native-select-icon { width: 1rem; height: 1rem; }
/* a control reached by keyboard shows its whole cell under the sample: it stands 64px above the foot of its cell */
.try-grid :is(button, input, select) {
  scroll-margin: calc(var(--try-bar) + var(--try-stage) + var(--pl-hairline) + var(--try-row) - 64px) 0 var(--pl-cell-pad);
}
.try-close a { scroll-margin-top: calc(var(--try-bar) + var(--try-stage) + var(--pl-cell-pad)); }
/* On six fields both control rows stand under the sample where the window holds them.
   There a control reached by keyboard asks for the whole window: the sample under the
   bar and the two rows under the sample, so the page comes to rest on the tester. The
   margins are measured from the control's own box: 64px above the foot of its row, a
   segment of a group 65px (the group's frame is 1px). */
@media (min-width: 1224px) and (min-height: 686px) {
  .try-grid {
    --try-above: calc(var(--try-bar) + var(--try-stage) + var(--pl-hairline) + var(--try-row));   /* from the window's top to the foot of the first row */
    --try-below: calc(var(--try-view) - var(--try-above) + var(--pl-cell-pad));                   /* from a control of that row to the window's foot */
    --try-step: calc(var(--try-row) + var(--pl-hairline));
  }
  .try-type :is(input, select, .rs-switch) { scroll-margin: calc(var(--try-above) - 64px) 0 var(--try-below); }
  .try-type .rs-toggle { scroll-margin: calc(var(--try-above) - 65px) 0 calc(var(--try-below) + 1px); }
  .try-setting :is(input, select, .rs-switch) { scroll-margin: calc(var(--try-above) + var(--try-step) - 64px) 0 calc(var(--try-below) - var(--try-step)); }
  .try-setting .rs-toggle { scroll-margin: calc(var(--try-above) + var(--try-step) - 65px) 0 calc(var(--try-below) - var(--try-step) + 1px); }
}

/* ── A switch and what it does ─────────────────────────────────────────────
   Beside each switch stand a few characters at the height of the control, set
   as the site sets a few characters large (.pe-glyphs): two pairs that kerning
   closes, the signs that rise to the capitals. Each reads its own switch and
   nothing else, so a switch shows what it does whatever the sample says. The
   proof ends on the cell's inset, under the value in the label. */
.try-switch { container-type: inline-size; }
.try-proof-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.try-proof {
  flex: none;
  margin-right: calc(var(--try-proof-hang, 0.03) * -1em);   /* the last character's side bearing; the script measures the font in use */
  font-family: var(--pe-spec);
  /* the control's height, or what the cell holds beside the switch (the wider proof is 2.8em
     in the Sans and 3em in the Mono, whose five characters each take a cell of 0.6em) */
  font-size: min(var(--hit), calc((100cqw - var(--hit) - 12px) / 3.05));
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.02em;
  white-space: nowrap;
  font-synthesis: none;
}
.try-proof[data-try-proof="kerning"] { font-kerning: var(--try-kerning); }
.try-proof[data-try-proof="case"] { font-feature-settings: var(--try-features); }
/* a feature this build lacks has nothing to show */
.try-proof[data-try-none] { color: var(--text-secondary); }

/* ── The sample ──────────────────────────────────────────────────────────── */
/* The row that holds the sample cell. It stays in view under the bar while the
   control cells pass under it, and keeps one height there, so no control moves
   while it is used. Under the cell it carries one hairline of the grid's own
   ground, laid over the gap below it, so the seam travels with the cell. The
   cell has no line of its own. While the text is edited that seam is ink: the
   one sign of focus besides the caret, on the grid from edge to edge. */
.try-pin {
  grid-column: 1 / -1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: var(--try-bar);
  z-index: 2;
  height: calc(var(--try-stage) + var(--pl-hairline));
  margin-bottom: calc(-1 * var(--pl-hairline));
  background: var(--bg);
}
.try-pin::after {
  content: "";
  flex: none;
  height: var(--pl-hairline);
  background: var(--divider);
  transition: background-color var(--duration) var(--ease);
}
.try-pin:focus-within::after { background: var(--text); }
/* Reached with Tab the cell is ringed, as a link cell is, and the seam stays quiet. */
.try-pin[data-try-keys]::after { background: var(--divider); }
.try-pin[data-try-keys] > .try-sample { outline: 2px solid var(--text); outline-offset: -4px; }

.try-sample {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  cursor: text;
  --try-gap: 16px;                    /* between the label and the text, as in every pe-cell */
  gap: var(--try-gap);
  --try-size: 120px;
  --try-weight: 600;
  --try-tracking: -0.035em;
  --try-leading: 1;
  --try-floor: 0.563;                 /* descender depth below the middle of the line, in em; set from the build */
  --try-hang: 0.076;                  /* how far the block hangs out of the left inset, in em; measured from the font */
  --try-hang-right: 0.04;             /* and out of the right one */
}
.try-sample > .pe-label { position: relative; cursor: default; }
.try-sample > .pe-label :is(b, span) { white-space: nowrap; }
/* While a text taller than the cell is scrolled under its label, one hairline
   closes the label's strip from edge to edge, as the bar's does when the page
   passes under it. It lies on the upper edge of the scrolling part. */
.try-sample > .pe-label::after {
  content: "";
  position: absolute;
  inset: calc(100% + var(--try-gap) - var(--pl-hairline)) calc(-1 * var(--pl-cell-pad)) auto;
  height: var(--pl-hairline);
  pointer-events: none;
  transition: background-color var(--duration) var(--ease);
}
.try-sample[data-try-over] > .pe-label::after { background: var(--divider); }

/* The part of the cell under the label. It reaches the cell's edges, so the
   text can hang into the inset, and it is what scrolls when the text is taller
   than the cell: it runs down to the seam, so a scrolled text is cut on the
   hairline, and the inset under the last line is the text's own margin. The
   script keeps a long text on its floor. */
.try-scroll {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 0 calc(-1 * var(--pl-cell-pad)) calc(-1 * var(--pl-cell-pad));
  padding-inline: var(--pl-cell-pad);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--control-border) transparent;
}

/* The text stands on the floor of its cell and grows upward. On the side it is
   aligned to it hangs out by the smallest side bearing among its lines, so the
   first stem meets the inset under the label and no line crosses it; on the
   other side by 0.04em. It keeps a reading measure at text sizes (the script widens it
   to 80 characters in a fixed-width style, so a line of code stays one line). Where the
   leading is tighter than the descenders are deep, the block is padded by the
   difference: no descender crosses the inset or the hairline under it. */
.try-text {
  flex: none;
  align-self: flex-start;
  width: calc(100% + (var(--try-hang) + var(--try-hang-right)) * 1em);
  max-width: var(--try-measure, 34em);
  min-height: calc(var(--try-leading) * 1em);
  margin: auto calc(var(--try-hang-right) * -1em) var(--pl-cell-pad) calc(var(--try-hang) * -1em);
  padding-bottom: max(0em, calc((var(--try-floor) - var(--try-leading) / 2) * 1em));
  font-family: var(--pe-spec);
  font-size: var(--try-size);
  font-weight: var(--try-weight);
  letter-spacing: var(--try-tracking);
  line-height: var(--try-leading);
  font-kerning: var(--try-kerning);
  font-feature-settings: var(--try-features);
  font-synthesis: none;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.try-sample[data-try-align="center"] .try-text { align-self: center; text-align: center; }
.try-sample[data-try-align="right"] .try-text { align-self: flex-end; text-align: right; }
/* A starting point is broken evenly; running text, the visitor's own too, without
   a stray last word. The visitor's own display lines break where they fall. */
.try-sample[data-try-wrap="balance"] .try-text { text-wrap: balance; }
.try-sample[data-try-wrap="pretty"] .try-text { text-wrap: pretty; }
/* The shared line under an editable block would run outside the insets here; the seam shows the focus. */
.try-text:focus-visible { box-shadow: none; }
/* Selected words turn gray, as the placeholder is: no system colour on the page. A fill is
   left out on purpose. The browser fills the whole height of the face on every line, so at
   a leading of 1 a solid fill covers the descenders of the line above and a clear one
   doubles in a band between the lines. */
.try-text::selection { background: transparent; color: var(--text-secondary); }
/* an empty sample asks for words; the caret stands before the line, as in a text field */
.try-text.try-empty::after { content: attr(data-placeholder); color: var(--text-secondary); pointer-events: none; }

/* measures a line at 100px without taking part in the layout */
.try-ruler { position: absolute; left: 0; top: 0; width: 0; height: 0; overflow: hidden; visibility: hidden; pointer-events: none; }
.try-ruler span {
  display: inline-block;
  white-space: pre;
  font-family: var(--pe-spec);
  font-size: 100px;
  font-weight: var(--try-weight);
  letter-spacing: var(--try-tracking);
  font-kerning: var(--try-kerning);
  font-feature-settings: var(--try-features);
  font-synthesis: none;
}

/* ── The four styles, each at its job ──────────────────────────────────────
   Four cells after the controls, as the home page shows the styles at work: the Sans
   setting short text, the Serif a paragraph to read, the Slab a heading, the Mono the
   typeface's own source. Each is set at the size it is made for and each is a button:
   it loads its words into the sample, in its style. A whole cell that acts is drawn as
   the site's link cell is (.pe-link-cell): paper, the control fill under the pointer,
   Vlak's ring inside the cell. */
.try-job {
  -webkit-appearance: none; appearance: none;
  box-sizing: border-box;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}
/* reached by keyboard, the whole cell comes to stand under the sample */
.try-grid .try-job { scroll-margin: calc(var(--try-bar) + var(--try-stage) + var(--pl-hairline)) 0 0; }
@media (hover: hover) and (pointer: fine) { .try-job:hover:not(:disabled) { background: var(--control-fill); } }
.try-job:focus-visible { outline: 2px solid var(--text); outline-offset: -4px; }
.try-job .pe-label { width: 100%; }
.try-job-text { display: block; min-width: 0; max-width: 100%; }
.try-job .pe-text { display: block; }
/* the Serif at the larger of its reading sizes, in the reading weight */
.try-job-read { font-size: 22px; line-height: 1.4; letter-spacing: -.01em; font-weight: 400; }
/* the source keeps its lines; one the cell cannot hold is cut at the inset, as the cell is not a scroller */
.try-job .pe-code { overflow: hidden; }
/* the cell whose words stand in the sample says so in its label: the value turns to ink */
.try-job[aria-pressed="true"] .pe-label span { color: var(--text); }
/* a style the build does not hold: its label says so, and no other face stands in for it */
.try-job:disabled { cursor: not-allowed; }
.try-job:disabled .try-job-text { display: none; }
/* On a phone the source is set a size smaller and the cell shows its first six lines, the
   ones a phone holds whole: the same six the sample loads there. */
@media (max-width: 640px) { .try-job .pe-code { font-size: 12px; max-height: calc(6 * 1.55em); } }

/* ── The closing cell ────────────────────────────────────────────────────── */
.try-close .rs-btn-ghost { align-self: flex-start; }
.try-close .pl-meta { max-width: 40em; text-wrap: pretty; }
/* The ways on stand in a row of their own under the note, a dot between them.
   Each link keeps its hairline under its words; a transparent box gives it the
   44px target, and the focus ring is Vlak's. A link the row cannot hold takes
   the next line, a target below. The dot belongs to the link it stands before
   and lies in the gap, so before the first link of a line it falls outside the
   row and is clipped: no line begins or ends with a dot, at any width. */
.try-on {
  --try-between: 1.08em;                /* a space, the dot, a space, and room for a focus ring on either side */
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--hit) - 1.2em - 1px) var(--try-between);   /* rows a target apart: a link is 1.2em and its hairline */
  margin: .7em -4px 0;
  padding: .125em 4px;                  /* the line box of the note above: 1.45em around links of 1.2em; 4px for the ring */
  overflow-x: clip;
}
.try-close .pl-meta a { position: relative; white-space: nowrap; line-height: 1.2; }
.try-close .pl-meta a::after { content: ""; position: absolute; inset: calc(50% - var(--hit) / 2) 0; }
.try-close .pl-meta a:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.try-on a + a::before {
  content: "\00b7";
  content: "\00b7" / "";                /* a mark between two links, not a word to read out */
  position: absolute;
  right: 100%;
  width: var(--try-between);
  text-align: center;
  color: var(--text-secondary);
  pointer-events: none;
}
@media (max-width: 640px) {
  .try-close .pl-meta a { display: block; min-width: 0; min-height: 0; }
}

/* ── Below six fields ────────────────────────────────────────────────────────
   Vlak's start tiles are 136px where they stack. The control cells take that
   height, so two rows of them stand under the sample and three rows are as tall
   as two fields. */
@media (max-width: 1223.98px) {
  .try-grid { --try-row: 136px; grid-auto-rows: minmax(136px, auto); }
  .try-control { min-height: 136px; }
  .try-sample { --try-size: 88px; }
}
@media (max-width: 815.98px) { .try-sample { --try-size: 56px; } }
@media (max-width: 640px) {
  .try-grid { --try-bar: calc(var(--pl-bar-phone) + env(safe-area-inset-top, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
  .try-job { transition: none; }
  .try-pin::after, .try-sample > .pe-label::after { transition: none; }
}
