/* The Lab: tools, apps, plugin and games. Same brand tokens as the site; app-screen rules (quiet, flat, square). */
:root {
  color-scheme: light;
  --bg: #f8f4ea; --bg-deep: #efe8d8; --surface: #fffdf7; --surface-2: #f1ead9; --ink: #0f1830; --ink-dim: #4a5368; --muted: #4a5368; --muted-2: #6b7387;
  --accent: #c8a24b; --accent-strong: #94701f; --accent-ink: #0f1830; --peacock-soft: #2f6f69; --line: rgba(15, 24, 48, 0.12); --radius: 4px;
  --good: #2f6f69; --bad: #a8452c; --paper: #fffdf7; --paper-ink: #0f1830;
  --font-display: "Fraunces", Georgia, serif;
  --font-text: "Manrope", "Segoe UI", Arial, sans-serif;
  --margin: clamp(1rem, 2.2vw, 2rem);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-text); font-size: 1.0625rem; line-height: 1.55; -webkit-font-smoothing: antialiased; min-height: 100svh; display: flex; flex-direction: column; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul[class], ol[class] { padding: 0; list-style: none; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.02em; line-height: 1.1; text-wrap: balance; }
h1 { font-size: clamp(1.6rem, 1.3rem + 1vw, 2rem); }
h2 { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem); }
h3 { font-size: 1.2rem; }
a { color: inherit; }
p { text-wrap: pretty; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--accent-ink); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* chrome */
.bar { border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem var(--margin); }
.bar__brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; }
.bar__brand img { width: 34px; height: 34px; display: block; }
.bar__nav { display: flex; gap: 1.25rem; font-size: 0.85rem; font-weight: 500; letter-spacing: 0.02em; }
.bar__nav a { text-decoration: none; color: var(--muted); }
.bar__nav a:hover, .bar__nav a[aria-current] { color: var(--accent-strong); }
.page { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 2rem var(--margin) 4rem; }
.lead { max-width: 60ch; color: var(--muted); margin-top: 0.75rem; font-size: 1.1rem; }
.proves { margin-top: 0.5rem; color: var(--muted); font-size: 0.95rem; max-width: 60ch; }
.foot { padding: 2rem var(--margin); color: var(--muted); font-size: 0.95rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: space-between; }
.foot a { color: var(--ink-dim); }
.foot { border-top: 1px solid var(--line); font-size: 0.85rem; }

/* surfaces and controls */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 1.25rem; }
.panel + .panel { margin-top: 1rem; }
.stack { display: grid; gap: 1rem; }
.row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.9rem; padding: 0 1.2rem; background: var(--accent); color: var(--accent-ink); font-weight: 600; border-radius: 2px; text-decoration: none; white-space: nowrap; transition: background-color 180ms ease, transform 140ms var(--ease-out); }
.button:hover { background: var(--accent-strong); }
.button:active { transform: scale(0.97); }
.button--quiet { background: var(--surface-2); color: var(--ink); }
.button--quiet:hover { background: #223050; }
.button[disabled] { opacity: 0.5; cursor: default; }
.field { width: 100%; min-height: 2.9rem; padding: 0.6rem 0.8rem; background: var(--bg); border: 1px solid var(--line); color: var(--ink); }
.field:focus { border-color: var(--accent); outline: 0; }
textarea.field { min-height: 5.5rem; resize: vertical; }
label.lbl { display: block; font-size: 0.9rem; color: var(--muted); margin-bottom: 0.35rem; }
.chip { display: inline-flex; align-items: center; min-height: 2.2rem; padding: 0 0.8rem; background: var(--surface-2); font-size: 0.95rem; }
.chip--on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.note { color: var(--muted); font-size: 0.95rem; }
.good { color: var(--good); }
.bad { color: var(--bad); }
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); background: var(--paper); color: var(--paper-ink); padding: 0.7rem 1rem; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity 200ms ease; }
.toast.is-on { opacity: 1; }
.big { font-family: var(--font-display); font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem); line-height: 1.15; }
.stat { font-family: var(--font-display); font-size: 2rem; line-height: 1; font-variant-numeric: tabular-nums; }
kbd { font-family: inherit; background: var(--surface-2); padding: 0.1em 0.45em; font-size: 0.9em; }

/* the lab index */
.lab-list { display: grid; gap: 1rem; margin-top: 2rem; }
.lab-item { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem 1.5rem; align-items: start; padding: 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; text-decoration: none; transition: background-color 180ms ease; }
.lab-item:hover { background: var(--surface-2); }
.lab-item h2 { font-size: 1.5rem; }
.lab-item p { color: var(--muted); max-width: 60ch; }
.lab-item .kind { color: var(--peacock-soft); font-size: 0.95rem; white-space: nowrap; }

@media (max-width: 760px) {
  .grid-2 { grid-template-columns: 1fr; }
  .bar { flex-wrap: wrap; gap: 0.5rem 1rem; }
  .bar__brand { white-space: nowrap; font-size: 1rem; }
  .bar__nav { gap: 0.9rem; font-size: 0.9rem; margin-left: auto; }
  .lab-item { grid-template-columns: 1fr; }
  .page { padding-bottom: 3rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

[hidden] { display: none !important; }
