/* Thinking Tools Lab — single stylesheet, system fonts only, no external requests. */
:root {
  color-scheme: light dark;
  --paper: #fbfaf7;
  --surface: #ffffff;
  --ink: #1c1b19;
  --muted: #5d5a54;
  --line: #e4e0d8;
  --accent: #2f5d50;
  --accent-ink: #ffffff;
  --accent-soft: #e5efeb;
  --warn-soft: #fbf3df;
  --warn-ink: #6b4e0f;
  --radius: 14px;
  --max: 68rem;
  --measure: 40rem;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Iowan Old Style", "New York", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #141513; --surface: #1c1e1b; --ink: #ecebe6; --muted: #a9a69e;
    --line: #2e312d; --accent: #8cc7b3; --accent-ink: #0f1a16; --accent-soft: #1f2c27;
    --warn-soft: #2b2619; --warn-ink: #e9cf8c;
  }
}
:root[data-theme="dark"] {
  --paper: #141513; --surface: #1c1e1b; --ink: #ecebe6; --muted: #a9a69e;
  --line: #2e312d; --accent: #8cc7b3; --accent-ink: #0f1a16; --accent-soft: #1f2c27;
  --warn-soft: #2b2619; --warn-ink: #e9cf8c;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 1.0625rem/1.65 var(--font-sans);
  text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: .08em; }
a:hover { text-decoration-thickness: .14em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: .5rem; background: var(--accent); color: var(--accent-ink); padding: .5rem .9rem; border-radius: 8px; z-index: 10; }
.skip:focus { left: .75rem; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }
.prose { max-width: var(--measure); }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 88%, transparent); position: sticky; top: 0; z-index: 5; backdrop-filter: saturate(1.4) blur(8px); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 650; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.brand svg { width: 1.6rem; height: 1.6rem; color: var(--accent); flex: none; }
.nav { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.nav ul { list-style: none; display: flex; gap: .15rem; margin: 0; padding: 0; flex-wrap: wrap; }
.nav a { display: block; padding: .4rem .7rem; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: .95rem; }
.nav a:hover { color: var(--ink); background: var(--accent-soft); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--accent-soft); font-weight: 600; }
.theme-toggle { margin-left: .35rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; width: 2.25rem; height: 2.25rem; display: inline-grid; place-items: center; cursor: pointer; }
.theme-toggle svg { width: 1.1rem; height: 1.1rem; }

/* Type */
h1, h2, h3 { line-height: 1.2; letter-spacing: -.015em; }
h1 { font-family: var(--font-serif); font-weight: 600; font-size: clamp(2.1rem, 4.5vw + 1rem, 3.4rem); margin: 0 0 1rem; }
h2 { font-size: 1.5rem; margin: 2.75rem 0 .9rem; }
h3 { font-size: 1.12rem; margin: 0 0 .4rem; }
.lead { font-size: 1.22rem; color: var(--muted); max-width: 38rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 650; color: var(--accent); margin: 0 0 .75rem; }
code, kbd { font-family: var(--font-mono); font-size: .9em; background: var(--accent-soft); padding: .08em .35em; border-radius: 5px; }
main { padding: 3.25rem 0 4.5rem; }
main:focus { outline: none; }

/* Hero */
.hero { padding: 1.5rem 0 1rem; }
.hero .lead { margin-bottom: 1.75rem; }
.pillars { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); margin: 2.5rem 0 0; padding: 0; list-style: none; }
.pillar { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 1.25rem 1.3rem; }
.pillar p { margin: 0; color: var(--muted); font-size: .98rem; }
.button { display: inline-flex; align-items: center; gap: .45rem; background: var(--accent); color: var(--accent-ink); padding: .65rem 1.1rem; border-radius: 999px; text-decoration: none; font-weight: 600; }
.button:hover { filter: brightness(1.06); }
.button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; }

/* App cards */
.cards { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); margin: 0; padding: 0; list-style: none; }
.card { position: relative; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 1.4rem 1.4rem 1.25rem; display: flex; flex-direction: column; gap: .5rem; transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--accent); }
@media (prefers-reduced-motion: no-preference) { .card:hover { transform: translateY(-2px); } }
.card h3 { font-size: 1.3rem; font-family: var(--font-serif); }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card p { margin: 0; color: var(--muted); }
.card .tag-row { margin-top: auto; padding-top: .6rem; }
.tag-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag { font-size: .8rem; border: 1px solid var(--line); border-radius: 999px; padding: .12rem .6rem; color: var(--muted); }
.tag.status { background: var(--warn-soft); color: var(--warn-ink); border-color: transparent; }

/* App page */
.app-head { display: grid; gap: .5rem; margin-bottom: 1.5rem; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.25rem; margin: 1.75rem 0; padding: 1.1rem 1.3rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); max-width: var(--measure); }
.facts dt { font-weight: 600; }
.facts dd { margin: 0; color: var(--muted); }
.features { list-style: none; padding: 0; margin: 0; display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.features li { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; background: var(--surface); }
.features li p { margin: 0; color: var(--muted); font-size: .97rem; }
.note { border-left: 4px solid var(--accent); background: var(--accent-soft); padding: 1rem 1.2rem; border-radius: 0 var(--radius) var(--radius) 0; max-width: var(--measure); }
.note h2, .note h3 { margin-top: 0; }
.note p:last-child, .note ul:last-child { margin-bottom: 0; }
.media { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.placeholder { aspect-ratio: 16 / 10; border: 2px dashed var(--line); border-radius: var(--radius); display: grid; place-items: center; text-align: center; padding: 1rem; color: var(--muted); background: repeating-linear-gradient(135deg, transparent 0 14px, color-mix(in srgb, var(--line) 35%, transparent) 14px 15px); }
.placeholder strong { display: block; color: var(--ink); font-size: 1rem; }
.placeholder span { font-size: .88rem; }
.placeholder.video { aspect-ratio: 16 / 9; grid-column: 1 / -1; }

/* Articles */
.empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 2.5rem 1.5rem; text-align: center; color: var(--muted); max-width: var(--measure); }
.empty h2 { margin-top: 0; color: var(--ink); }
.article-list { list-style: none; padding: 0; margin: 0; max-width: var(--measure); }
.article-list li { border-bottom: 1px solid var(--line); padding: 1.1rem 0; }
.article-list time { color: var(--muted); font-size: .9rem; }
.article-list a { font-family: var(--font-serif); font-size: 1.25rem; color: var(--ink); text-decoration: none; }
.article-list a:hover { color: var(--accent); }
.article-meta { color: var(--muted); font-size: .95rem; margin-bottom: 2rem; }
.article-body { font-family: var(--font-serif); font-size: 1.15rem; line-height: 1.72; }
.article-body h2 { font-family: var(--font-sans); }
.sources { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); max-width: var(--measure); }
.sources h2 { margin-top: 0; font-size: 1.15rem; }
.sources ol { padding-left: 1.3rem; }
.sources li { margin-bottom: .5rem; }
.sources .src-note { color: var(--muted); font-size: .93rem; }
.banner { background: var(--warn-soft); color: var(--warn-ink); padding: .8rem 1rem; border-radius: 10px; margin-bottom: 1.5rem; max-width: var(--measure); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 2rem 0 2.5rem; color: var(--muted); font-size: .92rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.site-footer ul { list-style: none; display: flex; gap: 1rem; margin: 0; padding: 0; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }

@media (max-width: 40rem) {
  body { font-size: 1rem; }
  main { padding-top: 2rem; }
  .site-header .wrap { padding-top: .5rem; padding-bottom: .5rem; }
  .facts { grid-template-columns: 1fr; }
  .facts dd { margin-bottom: .5rem; }
}
@media print { .site-header, .site-footer, .theme-toggle { display: none; } }
.article-body blockquote { margin: 1.5rem 0; padding: .2rem 0 .2rem 1.1rem; border-left: 3px solid var(--line); color: var(--muted); }
.article-list p { margin: .3rem 0 0; color: var(--muted); }
.h3 { font-size: 1.12rem; margin: 0 0 .4rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.features.punchy { margin-top: .5rem; }
.features.punchy h3 { font-size: 1.15rem; }
.card-role { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 650; color: var(--accent) !important; }
.detail-list { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.detail-list h3 { margin-top: .75rem; }
.detail-list p { margin: 0; color: var(--muted); font-size: .97rem; }
.also li { margin-bottom: .35rem; }
.home-note, section.note { margin-top: 2.5rem; }
.placeholder.video { max-width: 52rem; }
.license-line { font-size: .95rem; color: var(--muted); margin: .4rem 0 0; }
.media-note { color: var(--muted); font-size: .93rem; max-width: var(--measure); }
figure { margin: 0; }
figure.demo { margin: 1.5rem 0 2.25rem; max-width: 60rem; }
figure.demo figcaption { margin-bottom: .6rem; max-width: var(--measure); }
figure.demo video { display: block; width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); background: #000; }
.gallery-h { margin: 2rem 0 .8rem; font-size: 1.15rem; }
.gallery { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); }
.gallery.pair { grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); max-width: 60rem; }
.shot img { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.shot a:focus-visible img { outline: 3px solid var(--accent); outline-offset: 2px; }
.shot figcaption { margin-top: .45rem; color: var(--muted); font-size: .92rem; }
