/* Lab: raw / spec-sheet / table explorations. Shared by raw.html, spec.html, table.html.
   Self-contained on purpose; does not load assets/css/styles.css. */

:root {
  --ink: #14161d;
  --ink-3: #666a78;
  --line: #14161d;
  --bg: #fff;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: var(--mono);
  --head: var(--mono);
  --gutter: clamp(1rem, 0.6rem + 1.6vw, 1.75rem);
  color-scheme: light;
}
/* Dark theme: follows the system unless the visitor picked one (data-theme, set by the toggle) */
:root[data-theme="dark"] { --ink: #e6e7ec; --ink-3: #9a9eac; --line: #e6e7ec; --bg: #121318; color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --ink: #e6e7ec; --ink-3: #9a9eac; --line: #e6e7ec; --bg: #121318; color-scheme: dark; }
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 400 1rem/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-underline-offset: 0.18em; }
a:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.skip-link { position: absolute; left: var(--gutter); top: -4rem; background: var(--ink); color: var(--bg); padding: .5rem .75rem; z-index: 10; }
.skip-link:focus { top: var(--gutter); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lab-note { font: 0.75rem/1.4 var(--mono); color: var(--ink-3); }
.lab-switch { display: flex; gap: 1rem; font: 0.75rem/1.4 var(--mono); }
.clock { font-variant-numeric: tabular-nums; }
pre.signal { font: 0.75rem/1 var(--mono); letter-spacing: 0; white-space: pre; overflow: hidden; margin: 0; user-select: none; }

/* ---- 1. Raw: default-HTML brutalism ------------------------------------ */
.raw { --bg: #000; --ink: #fff; --ink-3: #9a9a9a; font: 1rem/1.35 "Times New Roman", Times, serif; min-height: 100vh; padding: 6px var(--gutter) 2.5rem; }
.raw p { max-width: 62ch; }
.raw nav { margin-top: 1rem; display: flex; flex-direction: column; align-items: flex-start; }
.raw .foot { position: fixed; right: var(--gutter); bottom: 6px; display: flex; gap: .5rem; }
.raw .lab-switch { position: fixed; left: var(--gutter); bottom: 6px; font-family: "Times New Roman", Times, serif; font-size: 1rem; }

/* ---- 3. Hybrid: plain index table + signal ------------------------------ */
.table { padding: var(--gutter); font-family: var(--mono); font-size: .8125rem; line-height: 1.5; min-height: 100vh; }
.table header { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-bottom: 1px solid var(--ink); padding-bottom: .75rem; }
.table h1 { font: 500 clamp(1.75rem, 1.1rem + 3vw, 3.25rem)/1.05 var(--head); letter-spacing: -0.025em; margin: 2.5rem 0 1rem; max-width: 20ch; }
.table .signal { margin: 1.5rem 0 2.5rem; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); padding: .75rem 0; }
.table .layout { display: grid; gap: 2rem; }
.table ol { list-style: none; padding: 0; counter-reset: p; }
.table ol li a { display: grid; grid-template-columns: 2.5rem 1fr; gap: .25rem 1rem; padding: .85rem 0; border-bottom: 1px solid var(--ink); text-decoration: none; }
.table ol li a::before { counter-increment: p; content: "0" counter(p); color: var(--ink-3); }
.table ol li a:hover, .table ol li a:focus-visible { background: var(--ink); color: var(--bg); outline: none; }
.table ol li a:hover .meta, .table ol li a:focus-visible .meta { color: #c7c9d4; }
.table .title { font: 500 1.0625rem/1.3 var(--head); }
.table .meta { grid-column: 2; color: var(--ink-3); }
.table .preview { display: none; }
.table dl { display: grid; grid-template-columns: 7rem 1fr; gap: .4rem 1rem; margin-top: 2.5rem; }
.table dt { color: var(--ink-3); }
.table dd { margin: 0; }
@media (min-width: 52rem) {
  .table .layout { grid-template-columns: 1fr 20rem; align-items: start; }
  .table .preview { display: block; position: sticky; top: var(--gutter); border: 1px solid var(--ink); aspect-ratio: 4/3; background: #f4f5f9; }
  .table .preview img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .15s; }
  .table .preview img.on { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
