/* MEK.type · project layer on the MEK design system (Light and Dark, starting Light: MEK's Buildermek sketch
   "screen", 2026-11-30)
   The store's own pieces: the side panel, and the rack of fonts beside it (each a column the window's height, in its
   own world, scrolled sideways). Never edit design/. Raw values only where nothing fits, listed in CLAUDE.md
   "Deviations". */

:root { --font-heading: var(--font-dosage); --rhythm: var(--space-16); --grid-gap: var(--space-12); }   /* the sketch's airy space */

/* ---------- The page: the side panel, then the rack (or a page of words) beside it ---------- */
.store { --page-max: none; padding: 0; display: grid; grid-template-columns: 360px minmax(0, 1fr); height: 100dvh; }

/* The side panel (the sketch): the mark and name, a word about the foundry, the fonts as a tree, then Licences, Help
   and the theme at its foot. Scrolls on its own when a short window can't hold it. */
.side { display: flex; flex-direction: column; gap: var(--space-8); padding: var(--space-6); overflow-y: auto; min-height: 0;
  border-right: var(--stroke) solid var(--line); }   /* its own edge, kept as the rack scrolls under it (MEK's ask) */
.side-mark { display: flex; align-items: center; gap: var(--space-2); color: var(--text-strong); text-decoration: none; }
.side-mark .t-heading { color: inherit; }
.side-about { display: grid; gap: var(--space-4); margin-top: calc(-1 * var(--space-3)); }   /* 20px under the name: level with the facts (MEK's ask) */
.side-intro { max-width: 36ch; margin: 0; color: var(--text-soft); }   /* mektxt.com's bio, as there */
.socials { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); }
.socials .link { --ink: var(--accent); --ink-to: var(--accent); }
/* The fonts as mektxt.com's font cards (forked from mektxt-web index.html .ft-card, 2026-11-30; to promote as a
   design system card part): the Ag in the font, in the accent, on a 200 ground over its name (Dosage, a step under the
   heading) and a quiet Mono line; the one in view (.on) edged in the accent, others darkening their edge on hover */
.side-fonts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }   /* two across (MEK's ask) */
.side-fonts > .part-label { grid-column: 1 / -1; }
.side-fonts > .part-label:not(:first-child) { margin-top: var(--space-3); }
.ft-card { display: grid; align-content: start; gap: var(--space-1); padding: var(--space-2) var(--space-2) var(--space-4);
  text-decoration: none; color: var(--text); --edge-to: var(--text-soft); }
.ft-card.on { --edge: var(--accent); --edge-to: var(--accent); }
.ft-spec { display: grid; place-items: center; height: 96px; margin-bottom: var(--space-3); background: var(--200);
  border-radius: var(--radius); color: var(--accent); font-size: var(--spec-sm); line-height: 1; overflow: hidden; }   /* the card's small Ag (mektxt.com's phone size): two across */
.ft-card .ft-name { padding-inline: var(--space-2); }
.ft-card .ft-name { color: var(--text-strong); font: var(--text-md)/1.25 var(--font-dosage); }   /* a long name wraps, two across */
.ft-card .ft-star { width: 15px; height: 15px; margin: 0 0 0 -1.5px; vertical-align: -2px; color: var(--accent); }
/* The arrows over the foot (MEK's ask): the font before and after; none on a phone, where the panel sits over the rack */
.side-keys { display: flex; align-items: center; gap: var(--space-2); margin-top: auto; }
.side-keys + .side-foot { margin-top: 0; }
.side-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); margin-top: auto; }
.side-foot > nav { --gap: var(--space-6); }

/* ---------- A page of words (Licences, Help) ----------
   In the specimens' look (MEK's ask): its title as big as MEK.type and level with it, a word under it, then its
   parts 48px apart (--grid-gap), each under a small Mono label as a specimen's Glyphs, all in Dosage, one column
   640px wide at most. Not the landing kit's hero, kickers and boxed ask. */
main.doc-main { overflow-y: auto; min-height: 0; padding: var(--space-6) var(--space-8) var(--space-12); }
.doc { max-width: 760px; display: grid; gap: var(--grid-gap); }
.doc-head { display: grid; gap: var(--space-2); }
.doc-head h1 { margin: 0; color: var(--text-strong); }
.doc-lede { margin: 0; max-width: 56ch; }
.doc-part { display: grid; gap: var(--space-3); }
.doc-note { margin: 0; max-width: 56ch; }
.doc-list { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-6); margin: 0; }
.doc-list dt { color: var(--text-strong); }
.doc-list dd { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); }
.doc .data { font-family: var(--font-dosage); }
.doc .data :is(th, td) { font-family: inherit; }
.doc .data th[scope="row"] { color: var(--text-muted); }
/* The tier table with room (MEK's ask): 12px over and under each row, 24 between columns, the row names on one line
   where they fit, the tiers' names in the strong ink */
.doc .data { width: 100%; border-collapse: collapse; }
.doc .data :is(th, td) { padding: var(--space-3) var(--space-6) var(--space-3) 0; vertical-align: top; text-align: left; }
.doc .data :is(th, td):last-child { padding-right: 0; }
.doc .data thead th { color: var(--text-strong); padding-bottom: var(--space-4); }
.doc .data th[scope="row"] { min-width: 16ch; }
/* Help's questions: the system's disclose, a rule over each and under the last, 12px over and under (as the landing
   kit had them) */
.faq-list { display: grid; }
.faq-list > .disclose { padding: var(--space-3) 0; border-top: var(--stroke) solid var(--line); }
.faq-list > .disclose:last-child { border-bottom: var(--stroke) solid var(--line); }

/* ---------- The rack ----------
   The fonts side by side, each a column the window's height and 516px wide (the sketch's), scrolled sideways, settling
   on the nearest font when close (js/rack.js eases the wheel, snaps and takes a card to its column). */
.rack { position: relative; display: flex; height: 100dvh; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; }
.rack:focus-visible { outline-offset: -4px; }
.rack > .card { flex: none; width: 516px; height: 100%; box-sizing: border-box; }

/* ---------- A font's specimen ----------
   Its sections 48px apart (--grid-gap, the sketch's airy space; 32 on a phone: MEK's ask).
   In the page's own theme (Light or Dark, MEK's ask), a rule after each column: its name (as big as MEK.type) and what
   it is, in Dosage, then its glyph grid filling the room and the type test, in the font; then how to get it. */
.card { color: var(--text); border-right: var(--stroke) solid var(--line); }   /* a rule after each (the side has its own) */
.card-in { display: flex; flex-direction: column; gap: var(--grid-gap); height: 100%; box-sizing: border-box;
  padding: var(--space-6) var(--space-8) var(--space-8); }   /* the name level with MEK.type (the side's 24px) */
.card-title { display: grid; gap: var(--space-2); }
.card-name { margin: 0; color: var(--text-strong); }   /* .t-heading: as big as MEK.type (MEK's ask) */
.card-top { position: relative; display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); }
/* The chosen font's cursor (MEK's ask, as a game's menu points at its choice): the system's play triangle, in the
   column's margin, pointing at the name, nudging a pixel at a time; only on the font chosen in the side panel
   (.current, js/rack.js); still under reduced motion */
.card-cursor { position: absolute; left: calc(-1 * var(--space-6) - 2px); top: calc(50% - var(--icon-text) / 2); width: var(--icon-text); height: var(--icon-text);   /* 1.5×, as an icon beside words */
  color: var(--text-strong); visibility: hidden; }
.card.current .card-cursor { visibility: visible; animation: card-cursor 600ms steps(1, end) infinite; }
@keyframes card-cursor { 50% { translate: 2px 0; } }
@media (prefers-reduced-motion: reduce) { .card.current .card-cursor { animation: none; } }
.card-no { flex: none; font: var(--text-sm)/1 var(--font-mono); color: var(--text-muted); }   /* #1, #2… by its place on the page (MEK's ask) */
/* Its facts (mektxt.com's fonts.json): a name and its value a row, as many rows held as the most any font has, so
   every column's tester starts level (MEK's asks) */
.card-facts { display: grid; grid-template-columns: max-content 1fr; grid-auto-rows: minmax(20px, auto); gap: 0 var(--space-4); margin: var(--space-3) 0 0;   /* 12px more under the name: level with the bio (MEK's ask) */
  min-height: calc(var(--facts-rows) * 20px); align-content: start; font-size: var(--text-sm); line-height: 20px; }
.card-facts dt { color: var(--text-muted); }
.card-facts dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }

/* The glyph grid (forked from the Dosage site's, js/glyphs.js): square tiles, as many columns as the width takes and
   as many rows, so the grid is square; each tile dissolves to the hover edge and ink as a button, muted while it rolls. Its type a
   whole step of the face's grid (--tile-type, css/fonts.css). */
.glyphs { flex: none; display: flex; flex-direction: column; gap: var(--space-2); }   /* its rows from the room (js/glyphs.js) */
/* The bar over the grid: Glyphs, then View details beside it, all in the small Mono note's size (MEK's ask) */
.gbar { display: flex; align-items: baseline; gap: var(--space-3); font: var(--text-xs)/18px var(--font-mono); }
.gbar > span { color: var(--text-muted); }
.gbar .link { font: inherit; }
.gbar .view { text-decoration: underline; text-underline-offset: 3px; --ink: var(--accent); --ink-to: var(--accent); }   /* in the accent (MEK's ask) */

/* View details: an overlay of the font (the design system's large dialog, MEK's ask: the whole window,
   on the page's ground at 85%, not the system's wash), its tiles in a box that scrolls (js/glyphs.js) */
.glyphs-dialog[open] { display: flex; flex-direction: column; gap: var(--space-6); }
.glyphs-dialog::backdrop { background: color-mix(in srgb, var(--bg) 85%, transparent); background-image: none; }   /* the ground at 85% (MEK's ask) */
/* Its motion (MEK's ask: smooth): on a desk the box rises 12px, a whole pixel a display frame (--px-frame), fading in,
   and the ground behind fades up; it goes the same way back, sinking 8px (js/glyphs.js waits for it before shutting).
   In place of the system's two-frame pop and zoom outlines (data-zoom="off"); a phone keeps the system's sheet. */
@media (width > 640px) {
  .glyphs-dialog[open] { animation: glyphs-in calc(12 * var(--px-frame)) steps(12, end) both; }
  .glyphs-dialog[open]::backdrop { animation: glyphs-fade calc(12 * var(--px-frame)) ease-out both; }
  .glyphs-dialog.leaving { animation: glyphs-out calc(8 * var(--px-frame)) steps(8, end) both; }
  .glyphs-dialog.leaving::backdrop { animation: glyphs-fade calc(8 * var(--px-frame)) ease-in reverse both; }
}
@keyframes glyphs-in { from { translate: 0 12px; opacity: 0; } }
@keyframes glyphs-out { to { translate: 0 8px; opacity: 0; } }
@keyframes glyphs-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .glyphs-dialog[open], .glyphs-dialog[open]::backdrop, .glyphs-dialog.leaving, .glyphs-dialog.leaving::backdrop { animation: none; }
}
/* Its tabs (the design system's): Glyphs, Groups, Pairs; the chosen panel scrolls in the room under them. Groups and
   Pairs each under a small Mono label as Glyphs is; pairs on a line each, in the font at its first step of 24 or over
   (--pair-type) */
.glyphs-tabs { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: var(--space-6); }
.glyphs-tabs > .tab-panel { flex: 1; min-height: 0; overflow-y: auto; }
.groups { display: grid; gap: var(--space-8); }
.groups > section { display: grid; gap: var(--space-3); }
.part-label { margin: 0; font: var(--text-xs)/18px var(--font-mono); color: var(--text-muted); }
.pairs { display: grid; align-content: start; gap: var(--space-2); font-family: var(--face); font-size: var(--pair-type);
  line-height: calc(var(--pair-type) + var(--em)); color: var(--text-strong); }
.pairs > p { margin: 0; overflow-wrap: anywhere; }
/* Specimen: its pictures in use, two across (one on a phone), each its own shape, on the 200 ground while it loads */
.specimens { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); align-items: start; }
.specimens > img { width: 100%; height: auto; border-radius: var(--radius); background: var(--200); }
.specimens > img.crisp-art { image-rendering: pixelated; }
@media (max-width: 640px) { .specimens { grid-template-columns: 1fr; } }
/* Scale: its size over each line, the line cut at the panel's edge; Samples: body text and the testers' words */
.scale, .samples { display: grid; align-content: start; gap: var(--space-6); }
.scale-row, .samples > section { display: grid; gap: var(--space-2); }
.scale-line { margin: 0; font-family: var(--face); color: var(--text-strong); white-space: nowrap; overflow: hidden; }
.body-sample { margin: 0; max-width: 72ch; font-family: var(--face); color: var(--text-strong); }
.pangram { margin: 0; font-family: var(--face); color: var(--text-strong); overflow-wrap: anywhere; }
.samples > section { gap: var(--space-3); }
.all-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 6px; }
.gbar .t-note { margin: 0; }
.glyph-grid { display: grid; grid-template-columns: repeat(var(--cols, 6), minmax(0, 1fr));
  grid-auto-rows: max-content; align-content: start; gap: 6px; overflow: clip; }
.tile { aspect-ratio: 1; display: grid; place-items: center; font-family: var(--face); font-size: var(--tile-type); line-height: 1;
  --ink: var(--text); --ink-to: var(--text-strong); --edge-to: var(--line-hover); }

/* The type test (forked from the Dosage site's, js/tester.js): the field, its sizes and styles, then the words in the
   font at the size picked, a line a step more, wrapping; the grid above gives up its rows to it. */
.tester { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: var(--space-4); }   /* the room left: words fill it */
.tbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); }
.tbar .field { flex: 1 1 100%; min-width: 0; }
.tbar .field label { color: var(--text-muted); }   /* "Type", quiet (MEK's ask) */
.card-sample { flex: 1; min-height: 0; overflow: hidden; }   /* the words cut to whole lines in it (js/tester.js) */
.sample { overflow: hidden; margin: 0; font-family: var(--face); font-size: var(--size); line-height: var(--size-lh);
  color: var(--text-strong); overflow-wrap: break-word; }
.sample[hidden] { display: none; }

/* The foot: Buy, the font's website, On the way, or Licence and Download: a button in every one, so all are one height
   and the grids above line up (MEK's ask) */
.card-foot { padding-top: var(--space-4); border-top: var(--stroke) solid var(--line); }
.card-act { --gap: var(--space-4); align-items: center; justify-content: space-between; }

/* The tier table's row names wrap, so on a phone the tiers get the room (the table scrolls in its box past that) */
.data th[scope="row"] { white-space: normal; min-width: 12ch; }

/* A phone: the side panel over the rack, the page scrolling down to it; a font a screen wide */
@media (max-width: 640px) {   /* --bp-phone */
  .store { display: block; height: auto; }
  .side { overflow: visible; padding: var(--space-4); gap: var(--space-6); }
  .rack { height: auto; }   /* a column as tall as its specimen (Parched's letters run long), at least the screen */
  .rack { scroll-snap-type: x proximity; }   /* a swipe settles on the nearest font (MEK's ask; a desk's by js/rack.js) */
  .rack > .card { width: 100vw; height: auto; scroll-snap-align: start; }
  .card-in { height: auto; min-height: 100dvh; padding: var(--space-4); gap: var(--space-8); }
  .tester, .card-sample { flex: none; }
  .glyph-grid { gap: 4px; }
  .side { border-right: 0; }
  .side-keys { display: none; }
  .card { border-right: 0; }
  .card-act, .card-act .btn { width: 100%; justify-content: center; }
  main.doc-main { padding: var(--space-6) var(--space-4) var(--space-12); }
  .store:has(> .doc-main) { display: flex; flex-direction: column; }   /* a page of words first, the fonts after it */
  .store > .doc-main { order: -1; padding-bottom: var(--space-8); border-bottom: var(--stroke) solid var(--line); }
}
