/* letters.css · P41's page: the layout of the field, the letter strip and the
   instruments. Every colour, size of type and radius is a token of the design
   system; the controls are its parts. The field, the strip and the loss chart
   are canvases the page paints with the same tokens. */

.lt { flex: 1; min-height: 0; overflow: auto; background: var(--paper); }
.lt-wrap { display: flex; flex-direction: column; gap: 28px; max-width: 1240px; margin: 0 auto; padding: 28px 32px 80px; box-sizing: border-box; }
.lt-head { display: flex; flex-direction: column; gap: 6px; max-width: 820px; }
.lt-head > h1 { margin: 0; font-size: var(--fs-16); line-height: var(--lh-16); font-weight: var(--fw-550); color: var(--ink); }
.lt-head > p { margin: 0; color: var(--ink-2); text-wrap: pretty; }
.lt-stage { display: grid; grid-template-columns: minmax(0, clamp(360px, calc(100svh - 360px), 760px)) 320px; gap: 40px; align-items: start; }
.lt-left { min-width: 0; }

/* the field: the network's output, painted for each pixel */
.lt .field { position: relative; aspect-ratio: 1 / 1; width: 100%; border-radius: var(--r-contain); background: var(--raised); box-shadow: 0 0 0 var(--px) var(--line-3); overflow: hidden; touch-action: none; cursor: crosshair; outline: none; }
.lt .field:focus-visible { box-shadow: 0 0 0 var(--px) var(--line-3), var(--ring-in); }
.lt .field canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.lt .field.grab { cursor: grabbing; }
.lt .probe { position: absolute; left: 0; top: 0; width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; border-radius: 50%; box-shadow: 0 0 0 1.25px var(--accent), 0 0 0 3px color-mix(in oklab, var(--raised) 70%, transparent); pointer-events: none; opacity: 0; transition: opacity 160ms var(--ease-quad); }
.lt .probe.on { opacity: 1; }
.lt .state { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 12px; color: var(--ink-2); font-size: var(--fs-13); line-height: var(--lh-13); pointer-events: none; transition: opacity 300ms var(--ease-quad); }
.lt .state.off { opacity: 0; }
.lt-bar { width: 160px; }
.lt-bar > [data-part="fill"] { width: 0; }
.lt .fallback { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; padding: 24px; text-align: center; color: var(--ink-2); }

/* the alphabet under the field: 26 letters, each the network's output */
.lt .strip { position: relative; margin-top: 12px; border-radius: var(--r-contain); background: var(--raised); box-shadow: 0 0 0 var(--px) var(--line-3); overflow: hidden; }
.lt .strip canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.lt .strip .keys { position: relative; display: grid; grid-template-columns: repeat(13, 1fr); }
.lt .strip .keys button { appearance: none; border: 0; background: transparent; aspect-ratio: 1 / 1; cursor: default; border-radius: var(--r-row); padding: 0; color: transparent; font-size: 1px; }
.lt .strip .keys button:hover { background: var(--plane-hover); }
.lt .strip .keys button[aria-pressed="true"] { box-shadow: inset 0 0 0 1.25px var(--accent); }
.lt .strip .keys button:focus-visible { outline: none; box-shadow: var(--ring-in); }
.lt .strip.plain .keys button { color: var(--ink-2); font-size: var(--fs-15); line-height: var(--lh-15); font-weight: var(--fw-500); }
.lt-fieldbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; margin-top: 10px; font-size: var(--fs-12); line-height: var(--lh-12); color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* the instruments: the design system's properties, with the loss on top */
.lt-panel { min-width: 0; }
.lt-props { padding: 0; gap: 24px; }
.lt-props [data-r="property"] { grid-template-columns: minmax(0, 1fr) auto; }
.lt-props [data-part="value"] { font-size: var(--fs-13); line-height: var(--lh-13); color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; }
.lt-props [data-part="value"].none { color: var(--ink-3); }
.lt-props [data-part="value"][hidden], .lt-props [data-r="property"][hidden] { display: none; }
.lt-big { display: flex; align-items: baseline; gap: 10px; }
.lt-big > span:first-child { font-size: var(--fs-24); line-height: var(--lh-24); font-weight: var(--fw-500); color: var(--ink); font-variant-numeric: tabular-nums; }
.lt-big > span:last-child { font-size: var(--fs-12); line-height: var(--lh-12); color: var(--ink-3); }
.lt-chart { width: 100%; height: 64px; display: block; margin: 8px 0 4px; }
.lt-slider { margin-top: 4px; }
.lt-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--row-32); font-size: var(--fs-13); line-height: var(--lh-13); color: var(--ink-2); }
.lt-note { margin: 4px 0 0; font-size: var(--fs-12); line-height: var(--lh-12); color: var(--ink-3); text-wrap: pretty; }
.lt-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.lt-props #views { width: 100%; }
.lt-acts kbd { margin-left: 6px; }
.lt .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 900px) {
  .lt-wrap { padding: 20px 16px 64px; }
  .lt-stage { grid-template-columns: 1fr; gap: 28px; }
}
@media (prefers-reduced-motion: reduce) { .lt * { transition: none !important; } }
