/* Testbed site styles. Colours come only from tokens.css. */

* { box-sizing: border-box; }

body { font-size: 14px; line-height: 1.6; }

a { color: var(--ink-900); text-underline-offset: 2px; text-decoration-color: var(--ink-300); }
a:hover { text-decoration-color: var(--ink-900); }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header { border-bottom: var(--rule-width) solid var(--rule-strong); background: var(--surface); }
.site-header .wrap { display: flex; align-items: center; gap: 24px; min-height: 56px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 500; }
.brand svg { width: 20px; height: 20px; }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a {
  text-decoration: none; color: var(--ink-700); padding: 6px 10px; border-radius: var(--radius-control);
  transition: background var(--dur-fast), color var(--dur-fast);
}
.site-nav a:hover { background: var(--surface-sub); color: var(--ink-900); }
.site-nav a[aria-current="page"] { color: var(--ink-900); font-weight: 500; background: var(--surface-sub); }

main.wrap { padding-top: 32px; padding-bottom: 48px; }
.site-footer { border-top: var(--rule-width) solid var(--rule); padding: 20px 0 32px; color: var(--ink-500); font-size: 13px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Type */
h1 { font-size: 24px; line-height: 1.2; font-weight: 500; margin: 0 0 8px; }
h2 { font-size: 15px; line-height: 1.3; font-weight: 500; margin: 32px 0 8px; }
h3 { font-size: 14px; font-weight: 500; margin: 20px 0 4px; }
p { margin: 0 0 12px; }
.lede { color: var(--ink-700); max-width: 65ch; margin-bottom: 24px; }
.muted { color: var(--ink-500); }
.label { font-size: 11px; line-height: 1.2; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-500); }
.prose { max-width: 65ch; }
.prose ul, .prose ol { padding-left: 20px; margin: 0 0 12px; }
.prose li { margin-bottom: 4px; }
blockquote { margin: 16px 0; padding: 4px 0 4px 14px; border-left: 2px solid var(--rule-strong); color: var(--ink-700); }
pre {
  background: var(--surface-sub); border: var(--rule-width) solid var(--rule); border-radius: var(--radius-control);
  padding: 12px 14px; overflow-x: auto; font-size: 13px; line-height: 1.5;
}
code { font-size: 13px; }
:not(pre) > code { background: var(--surface-sub); padding: 1px 5px; border-radius: 3px; }
hr { border: 0; border-top: var(--rule-width) solid var(--rule); margin: 28px 0; }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Cards */
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.card {
  background: var(--surface); border: var(--rule-width) solid var(--rule-strong); border-radius: var(--radius-card);
  padding: 16px; display: block; text-decoration: none; transition: border-color var(--dur-fast);
}
a.card:hover { border-color: var(--ink-300); }
.card .label { display: block; margin-bottom: 6px; }
.card strong { display: block; font-weight: 500; margin-bottom: 4px; }
.card p { color: var(--ink-700); margin: 0; }

/* Tables */
.table-wrap { overflow-x: auto; border: var(--rule-width) solid var(--rule-strong); border-radius: var(--radius-card); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 8px 12px; border-bottom: var(--rule-width) solid var(--rule); vertical-align: top; }
td code, th { white-space: nowrap; }
th { background: var(--surface-sub); font-size: 11px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-500); }
th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
th button:focus-visible { box-shadow: 0 0 0 2px var(--canvas), 0 0 0 3px var(--ink-900); border-radius: 3px; }
tbody tr:hover { background: var(--surface-sub); }
tbody tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Forms */
.form { display: grid; gap: 16px; max-width: 560px; }
.field { display: grid; gap: 6px; }
.field > span, .field legend { font-size: 11px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-500); }
fieldset.field { border: 0; padding: 0; margin: 0; }
input[type="text"], input[type="email"], input[type="number"], input[type="date"], input[type="url"],
input[type="search"], input[type="password"], select, textarea {
  font: inherit; color: var(--ink-900); background: var(--surface);
  border: 1px solid var(--ink-300); border-radius: var(--radius-control); padding: 8px 10px; width: 100%;
}
textarea { min-height: 96px; resize: vertical; }
input[type="range"] { width: 100%; accent-color: var(--ink-900); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--ink-900); }
.choice { display: flex; gap: 8px; align-items: center; color: var(--ink-700); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
form.row { align-items: end; margin-bottom: 12px; }
.grow { flex: 1 1 220px; }

.btn {
  font: inherit; font-weight: 500; cursor: pointer; border-radius: var(--radius-control); padding: 8px 14px;
  border: 1px solid var(--ink-900); background: var(--ink-900); color: var(--surface);
  text-decoration: none; display: inline-block; transition: opacity var(--dur-fast), border-color var(--dur-fast);
}
.btn:hover { opacity: 0.88; }
.btn.secondary { background: transparent; color: var(--ink-900); border-color: var(--rule-strong); }
.btn.secondary:hover { border-color: var(--ink-900); opacity: 1; }

/* Notices */
.notice { background: var(--surface); border-left: 2px solid var(--ink-900); padding: 10px 14px; border-radius: 0 var(--radius-control) var(--radius-control) 0; }
.notice.error { border-left-color: var(--loss); }
.dot { width: 6px; height: 6px; border-radius: 999px; display: inline-block; background: var(--ink-300); }
.dot.ok { background: var(--gain); }
.dot.err { background: var(--loss); }

/* Gallery */
.gallery { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.gallery figure { margin: 0; background: var(--surface); border: var(--rule-width) solid var(--rule-strong); border-radius: var(--radius-card); overflow: hidden; }
.gallery img { display: block; width: 100%; height: auto; background: var(--surface-sub); }
.prose figure { margin: 20px 0; }
.prose img { display: block; max-width: 100%; height: auto; border: var(--rule-width) solid var(--rule-strong); border-radius: var(--radius-card); }
.prose figcaption { font-size: 13px; margin-top: 8px; }
.gallery figcaption { padding: 10px 12px; color: var(--ink-700); font-size: 13px; }

.stat { display: grid; gap: 4px; }
.stat .v { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 22px; line-height: 1.1; font-weight: 500; }

details { background: var(--surface); border: var(--rule-width) solid var(--rule-strong); border-radius: var(--radius-card); padding: 10px 14px; margin-bottom: 8px; }
summary { cursor: pointer; font-weight: 500; }

@media (max-width: 480px) {
  main.wrap { padding-top: 24px; }
  .site-header .wrap { gap: 8px; padding-top: 8px; padding-bottom: 8px; }
}
