/* Clay & Cortex: shared page chrome for the landing site and both study apps.
 *
 * CANONICAL COPY: site/public/css/theme.css. The copies at
 *   experiments/tint-filter/css/theme.css
 *   experiments/occlusion-discrimination/css/theme.css
 * are byte-for-byte identical and kept so by site/scripts/sync-theme.sh
 * (`--check` fails when they drift). Edit here, then sync. Each app keeps its
 * own small site.css for what only it needs.
 *
 * The palette is the study pages' palette: a warm off-white ground, near-black
 * ink, a slate blue for anything interactive, and blaze orange, the colour of a
 * standard clay, used sparingly as the accent. Nothing here is used on the
 * stimulus surface; the experiments paint their own field. */

:root {
  --ink: #1b2026; --ink-2: #4a535c; --muted: #6b7480; --rule: #d9dcd6;
  --bg: #f3f4f1; --card: #ffffff; --card-2: #f8f8f5;
  --accent: #d24a1c; --accent-ink: #b03a10;
  --blue: #2f5d7c; --blue-ink: #264b64;
  --ok: #1a6b2a; --bad: #8a2018;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--blue); }
a:hover { color: var(--blue-ink); }

/* ---------------------------------------------------------------- top bar */
.topbar {
  display: flex; align-items: center; gap: .75rem 1.25rem; flex-wrap: wrap;
  background: var(--card); border-bottom: 1px solid var(--rule); padding: .65rem clamp(1rem, 4vw, 2.5rem);
}
.topbar .brand { font-weight: 700; text-decoration: none; color: var(--ink); letter-spacing: .01em; white-space: nowrap; display: inline-flex; align-items: center; gap: .5rem; }
.topbar .brand .mark { width: 1.05em; height: 1.05em; flex: none; }
.topbar .brand .amp { color: var(--accent); font-weight: 400; }
.topbar .app { color: var(--ink-2); text-decoration: none; white-space: nowrap; padding-left: 1rem; border-left: 1px solid var(--rule); font-size: .95rem; }
.topbar .app:hover { color: var(--ink); }
.topbar nav { margin-left: auto; display: flex; flex-wrap: wrap; gap: .2rem 1rem; font-size: .92rem; }
.topbar nav a { text-decoration: none; }
.topbar nav a:hover { text-decoration: underline; }
.topbar nav .who { color: var(--muted); }
@media (max-width: 560px) {
  .topbar .app { border-left: 0; padding-left: 0; width: 100%; }
  .topbar nav { margin-left: 0; width: 100%; }
}

/* ------------------------------------------------------------------ layout */
.wrap { max-width: 980px; margin: 0 auto; padding: 2rem clamp(1rem, 4vw, 2.5rem) 4rem; }
.wrap.narrow { max-width: 460px; }
.hero { padding: 1.5rem 0 1rem; max-width: 62ch; }
.hero h1 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); line-height: 1.15; margin: 0 0 .6rem; text-wrap: balance; }
.hero p { font-size: 1.08rem; color: var(--ink-2); }
.eyebrow { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 .4rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.1rem; margin: 1.4rem 0; }
.card { background: var(--card); border: 1px solid var(--rule); border-radius: 6px; padding: 1.4rem 1.6rem; margin-bottom: 1.1rem; }
.card h2 { font-size: 1.1rem; margin: 0 0 .4rem; }
.card h2 + p { margin-top: .3rem; }
.card p { margin: .5rem 0; }
.card .cta { margin-top: .8rem; }
.grid .card { margin-bottom: 0; }

h1 { font-size: 1.5rem; margin: 0 0 .4rem; }
h2 { font-size: 1.15rem; margin: 1.6rem 0 .6rem; }
h3 { font-size: 1rem; margin: 1.2rem 0 .4rem; }
p { margin: .6rem 0; }
.lede { color: var(--ink-2); margin-bottom: 1.2rem; }
.hint { color: var(--muted); font-size: .87rem; }
.prose { max-width: 68ch; }
ul, ol { padding-left: 1.3rem; }
li { margin: .25rem 0; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 1.5rem 0; }

/* ------------------------------------------------------------------- forms */
label { display: block; margin: .8rem 0; font-size: .94rem; }
input, select, textarea { font: inherit; padding: .45rem .55rem; border: 1px solid #b8bdb6; border-radius: 4px; width: 100%; margin-top: .25rem; background: #fff; color: var(--ink); }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .6rem 1rem; }
button { font: inherit; padding: .6rem 1.2rem; border-radius: 5px; cursor: pointer; border: 1px solid transparent; margin: .3rem .4rem .3rem 0; }
.primary, button.primary { background: var(--blue); color: #fff; }
.primary:hover:not(:disabled), button.primary:hover:not(:disabled) { background: var(--blue-ink); }
.secondary, button.secondary { background: #fff; color: #444; border-color: #b8bdb6; }
.secondary:hover:not(:disabled) { border-color: var(--ink-2); color: var(--ink); }
a.button { display: inline-block; text-decoration: none; padding: .6rem 1.2rem; border-radius: 5px; border: 1px solid transparent; margin: .3rem .4rem .3rem 0; }
a.button.primary { color: #fff; }
button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------------------------------------------------------------- messages */
.msg { margin: .8rem 0; padding: .6rem .8rem; border-radius: 4px; font-size: .9rem; display: none; }
.msg.err { display: block; background: #fdeceb; border: 1px solid #e5a6a0; color: var(--bad); }
.msg.ok { display: block; background: #eaf6ec; border: 1px solid #a8d3b0; color: var(--ok); }
.notice { border-radius: 5px; padding: .8rem 1.1rem; margin: 1rem 0; font-size: .95rem; }
.notice.caution { background: #fff8e1; border: 1px solid #e3cf8a; }
.notice.info { background: #e8edf1; border: 1px solid #c3d0da; }
.notice ul { margin: .3rem 0 0; padding-left: 1.2rem; }

/* ------------------------------------------------------------------ tables */
table { border-collapse: collapse; width: 100%; font-size: .88rem; margin: .5rem 0 1rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: .45rem .6rem; border-bottom: 1px solid #e8e8e8; vertical-align: top; }
th { color: #444; font-weight: 600; white-space: nowrap; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; }
td.n, th.n { text-align: right; white-space: nowrap; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .85em; }
.pill { display: inline-block; padding: .1rem .5rem; border-radius: 10px; background: #eef2f7; font-size: .78rem; color: #33506e; }
.empty { color: #777; font-style: italic; padding: .8rem 0; }
.scroll { overflow-x: auto; }
kbd { font: inherit; font-size: .85em; background: #eee; border: 1px solid #bbb; border-bottom-width: 2px; border-radius: 3px; padding: .05em .4em; }

/* ------------------------------------------------------------------ footer */
footer.site { margin-top: 3rem; padding-top: 1.2rem; border-top: 1px solid var(--rule); font-size: .85rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; align-items: baseline; }
footer.site .brand { color: var(--ink); font-weight: 600; text-decoration: none; }
footer.site .brand .amp { color: var(--accent); font-weight: 400; }
footer.site a { color: var(--blue); }
footer.site .spacer { flex: 1 1 auto; }
