/* Physics Is Awesome: one stylesheet for the whole site. Light by default, dark on request or system setting. */
:root {
  --bg: #ffffff; --bg-soft: #f4f7fb; --panel: #ffffff; --line: #dfe6ef; --line-strong: #c5d1df;
  --text: #13213a; --muted: #55657d; --head: #0f1f3d;
  --brand: #1877c9; --brand-ink: #125e9f; --brand-soft: #e8f1fa;
  --accent: #e8890c; --accent-soft: #fff4e2;
  --good: #16794a; --bad: #b42318; --bad-soft: #fdecea;
  --plot-grid: #e6ecf3; --plot-axis: #8796ab; --plot-a: #1877c9; --plot-b: #e8890c; --plot-c: #16794a; --plot-ghost: #b9c6d6;
  --radius: 12px; --shadow: 0 1px 2px rgba(15, 31, 61, .06), 0 4px 16px rgba(15, 31, 61, .06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0c1628; --bg-soft: #111e35; --panel: #13223c; --line: #243553; --line-strong: #33496d;
  --text: #dde6f3; --muted: #9aabc4; --head: #f2f6fc;
  --brand: #5aa7ec; --brand-ink: #86c0f3; --brand-soft: #16304f;
  --accent: #f5a524; --accent-soft: #3a2a10;
  --good: #4cc38a; --bad: #ff8a80; --bad-soft: #3d1c1c;
  --plot-grid: #1d2e4a; --plot-axis: #6f84a3; --plot-a: #5aa7ec; --plot-b: #f5a524; --plot-c: #4cc38a; --plot-ghost: #3a4f70;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1628; --bg-soft: #111e35; --panel: #13223c; --line: #243553; --line-strong: #33496d;
    --text: #dde6f3; --muted: #9aabc4; --head: #f2f6fc;
    --brand: #5aa7ec; --brand-ink: #86c0f3; --brand-soft: #16304f;
    --accent: #f5a524; --accent-soft: #3a2a10;
    --good: #4cc38a; --bad: #ff8a80; --bad-soft: #3d1c1c;
    --plot-grid: #1d2e4a; --plot-axis: #6f84a3; --plot-a: #5aa7ec; --plot-b: #f5a524; --plot-c: #4cc38a; --plot-ghost: #3a4f70;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.6 var(--font); }
img, svg, canvas { max-width: 100%; }
a { color: var(--brand-ink); text-underline-offset: 2px; }
a:hover { color: var(--brand); }
h1, h2, h3 { color: var(--head); line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.6rem); margin: .3em 0 .35em; letter-spacing: -.02em; }
h2 { font-size: clamp(1.3rem, 1.1rem + .8vw, 1.65rem); margin: 1.8em 0 .5em; }
h3 { font-size: 1.12rem; margin: 1.4em 0 .4em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--head); color: var(--bg); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; font-weight: 700; color: var(--brand-ink); margin: 0 0 .4em; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 46em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.header-row { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; color: var(--head); text-decoration: none; white-space: nowrap; letter-spacing: -.01em; font-size: 1.05rem; }
.brand .atom { width: 30px; height: 30px; color: var(--brand); flex: none; }
.main-nav { display: flex; gap: 4px; margin-left: auto; }
.main-nav a { color: var(--text); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: .95rem; font-weight: 600; white-space: nowrap; }
.main-nav a:hover, .main-nav a[aria-current] { background: var(--brand-soft); color: var(--brand-ink); }
.theme-btn { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--muted); display: grid; place-items: center; cursor: pointer; flex: none; }
.theme-btn svg { width: 17px; height: 17px; }
@media (max-width: 700px) {
  .header-row { height: auto; flex-wrap: wrap; padding-top: 8px; padding-bottom: 6px; gap: 6px 10px; }
  .theme-btn { margin-left: auto; }
  .main-nav { order: 3; width: 100%; margin: 0 -10px; overflow-x: auto; scrollbar-width: none; }
  .main-nav::-webkit-scrollbar { display: none; }
  .main-nav a { font-size: .9rem; padding: 5px 10px; }
}

/* Breadcrumbs */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 16px 0 0; font-size: .85rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 4px; color: var(--line-strong); }
.crumbs a { color: var(--muted); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--brand); color: #fff; border: 0; border-radius: 10px; padding: 11px 18px; font: 700 .98rem var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--brand-ink); color: #fff; }
:root[data-theme="dark"] .btn:not(.secondary), :root[data-theme="dark"] .btn:not(.secondary):hover { color: #08172b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn:not(.secondary), :root:not([data-theme="light"]) .btn:not(.secondary):hover { color: #08172b; } }
.btn.secondary { background: transparent; color: var(--brand-ink); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.btn.secondary:hover { background: var(--brand-soft); }
.btn.small { padding: 6px 12px; font-size: .88rem; border-radius: 8px; }
.btn[aria-disabled="true"] { background: var(--line); color: var(--muted); cursor: not-allowed; }

/* Hero */
.hero { padding: 40px 0 28px; background: linear-gradient(180deg, var(--bg-soft), var(--bg)); border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 36px; align-items: center; }
.hero h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.1rem); }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.hero-demo { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 14px; }
.hero-demo canvas { display: block; width: 100%; height: 240px; }
.hero-demo .demo-row { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--muted); margin-top: 8px; }
.hero-demo input[type=range] { flex: 1; accent-color: var(--brand); }
.hero-demo output { font-family: var(--mono); color: var(--head); min-width: 3.2em; text-align: right; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; gap: 22px; } .hero { padding-top: 26px; } .hero-demo canvas { height: 200px; } }

/* Sections and cards */
.section { padding: 36px 0; }
.section h2:first-child { margin-top: 0; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.tool-card { display: flex; gap: 14px; align-items: flex-start; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; color: var(--text); transition: border-color .15s, transform .15s; }
.tool-card:hover { border-color: var(--brand); transform: translateY(-1px); color: var(--text); }
.tool-card .icon { width: 42px; height: 42px; flex: none; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.tool-card .icon svg { width: 26px; height: 26px; }
.tool-card strong { display: block; color: var(--head); font-size: 1rem; line-height: 1.3; margin-bottom: 3px; }
.tool-card span { font-size: .88rem; color: var(--muted); line-height: 1.45; display: block; }
.topic-head { display: flex; align-items: baseline; gap: 10px; margin: 28px 0 12px; }
.topic-head h2 { margin: 0; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature { padding: 18px; border-radius: var(--radius); background: var(--bg-soft); border: 1px solid var(--line); }
.feature h3 { margin-top: 0; }
.feature p { margin: 0; color: var(--muted); font-size: .95rem; }
@media (max-width: 860px) { .features { grid-template-columns: 1fr; } }

.cta-card { display: flex; gap: 20px; align-items: center; justify-content: space-between; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: var(--radius); padding: 18px 20px; margin: 32px 0; }
.cta-card p { margin: 0 0 .3em; }
.cta-card .cta-title { font-weight: 800; color: var(--head); }
.cta-card .eyebrow { color: var(--accent); }
@media (max-width: 640px) { .cta-card { flex-direction: column; align-items: flex-start; } }

/* Tool layout */
.tool-head { padding: 6px 0 4px; }
.tool-head .lead { margin-bottom: 0; }
.tool { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 18px; margin: 20px 0 8px; align-items: start; }
@media (max-width: 860px) { .tool { grid-template-columns: 1fr; } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; min-width: 0; }
.panel h2 { font-size: 1rem; margin: 0 0 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.field { margin-bottom: 12px; }
.field > label, .field > .label { display: block; font-weight: 650; font-size: .9rem; color: var(--head); margin-bottom: 4px; }
.field .hint { font-size: .8rem; color: var(--muted); margin-top: 3px; }
.input-row { display: flex; gap: 6px; }
.input-row input { flex: 1; min-width: 0; }
input[type=number], input[type=text], select { font: 16px var(--font); color: var(--text); background: var(--bg); border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; height: 40px; }
select { padding-right: 6px; }
.input-row select { flex: none; max-width: 46%; }
.input-row .suffix { flex: none; align-self: center; color: var(--muted); font-size: .9rem; white-space: nowrap; }
input:focus, select:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
input[aria-invalid="true"] { border-color: var(--bad); background: var(--bad-soft); }
.field .error { color: var(--bad); font-size: .82rem; margin-top: 4px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 9px; padding: 2px; background: var(--bg-soft); flex-wrap: wrap; }
.seg button { font: 600 .85rem var(--font); border: 0; background: none; color: var(--muted); padding: 5px 10px; border-radius: 7px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--panel); color: var(--head); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.tool-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.form-error { color: var(--bad); background: var(--bad-soft); border-radius: 8px; padding: 8px 10px; font-size: .9rem; margin: 8px 0 0; }
.form-error:empty { display: none; }

.results { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.result { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.result .k { font-size: .78rem; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.result .v { font: 700 1.25rem/1.3 var(--font); color: var(--head); font-variant-numeric: tabular-nums; }
.result .v small { font-size: .8rem; font-weight: 600; color: var(--muted); margin-left: 3px; }
.result.main { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 35%, transparent); }
.plot-wrap { position: relative; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); overflow: hidden; }
.plot-wrap canvas { display: block; width: 100%; height: 320px; }
@media (max-width: 600px) { .plot-wrap canvas { height: 240px; } }
.plot-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; font-size: .88rem; color: var(--muted); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); margin-left: auto; }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }

/* Worked steps */
.steps { margin-top: 16px; }
.steps summary { cursor: pointer; font-weight: 700; color: var(--head); padding: 6px 0; }
.steps ol { margin: 8px 0 0; padding-left: 1.4em; }
.steps li { margin-bottom: 10px; }
.steps .step-label { font-weight: 650; color: var(--head); }
.eq { font-family: var(--mono); font-size: .92rem; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin: 4px 0; overflow-x: auto; white-space: nowrap; }

/* Article content under tools */
.content { max-width: 760px; }
.content .eq-block { font-family: var(--mono); background: var(--bg-soft); border-left: 3px solid var(--brand); border-radius: 0 8px 8px 0; padding: 10px 14px; margin: 0 0 1em; overflow-x: auto; }
.content ul, .content ol { padding-left: 1.3em; }
.content li { margin-bottom: .4em; }
.content table { border-collapse: collapse; width: 100%; margin: 0 0 1.2em; font-size: .95rem; }
.content th, .content td { border-bottom: 1px solid var(--line); padding: 7px 8px; text-align: left; vertical-align: top; }
.content th { color: var(--head); font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
.table-wrap { overflow-x: auto; }
.callout { background: var(--accent-soft); border-radius: 10px; padding: 12px 16px; margin: 0 0 1em; }
.callout strong:first-child { color: var(--head); }
.faq details { border-bottom: 1px solid var(--line); padding: 10px 0; }
.faq summary { cursor: pointer; font-weight: 650; color: var(--head); }
.faq details p { margin: 8px 0 0; }
.related { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }

/* Product page */
.product-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; padding: 28px 0; }
@media (max-width: 860px) { .product-hero { grid-template-columns: 1fr; } }
.price-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 16px 0; }
@media (max-width: 520px) { .price-cards { grid-template-columns: 1fr; } }
.price-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--panel); display: flex; flex-direction: column; gap: 8px; }
.price-card .amt { font-size: 2rem; font-weight: 800; color: var(--head); line-height: 1; }
.price-card ul { margin: 0; padding-left: 1.1em; font-size: .92rem; color: var(--muted); flex: 1; }
.preview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.preview-grid figure { margin: 0; }
.preview-grid img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); background: #fff; }
.preview-grid figcaption { font-size: .85rem; color: var(--muted); margin-top: 6px; }
@media (max-width: 700px) { .preview-grid { grid-template-columns: 1fr; } }
.toc-list { columns: 2; padding-left: 1.2em; }
@media (max-width: 600px) { .toc-list { columns: 1; } }

/* Sign-up */
.signup { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.signup form { display: flex; gap: 8px; flex-wrap: wrap; }
.signup input[type=email] { flex: 1; min-width: 200px; font: 16px var(--font); height: 42px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 12px; background: var(--bg); color: var(--text); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-soft); margin-top: 48px; padding: 26px 0 18px; font-size: .9rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 20px; }
.footer-grid nav { display: flex; flex-direction: column; gap: 6px; }
.footer-grid nav a { color: var(--muted); text-decoration: none; }
.footer-grid nav a:hover { color: var(--brand-ink); text-decoration: underline; }
.footer-brand p { color: var(--muted); margin: 8px 0 0; }
.footer-small { color: var(--muted); font-size: .8rem; margin-top: 18px; }
@media (max-width: 640px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* Legal and text pages */
.prose { max-width: 760px; }
.prose h2 { font-size: 1.25rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .site-header, .site-footer, .cta-card, .tool-actions, .theme-btn { display: none !important; } body { font-size: 12pt; } }

/* ---------- Mathematics: textbook typesetting (see assets/js/math.mjs) ---------- */
:root { --math: "STIX Two Text", "STIX Two Math", Cambria, "Cambria Math", "Times New Roman", serif; }
.eq, .content .eq-block, td.math { font-family: var(--math); font-size: 1.08rem; letter-spacing: 0; }
.eq var, .eq-block var, td.math var { font-style: italic; }
.eq sub, .eq-block sub, td.math sub { font-size: .72em; line-height: 0; }
.eq .fn, .eq-block .fn, td.math .fn { font-style: normal; }
.eq .u, .eq-block .u, td.math .u { font-style: normal; }
td.math { white-space: nowrap; }
[hidden] { display: none !important; }
@media (max-width: 420px) {
  .results { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .result { padding: 8px 10px; }
  .result .k { font-size: .7rem; letter-spacing: .02em; }
  .result .v { font-size: 1.08rem; }
}

/* ===================== Identity refinement (Nov 27 audit) =====================
   Lab-notebook precision: graph-paper fields, hairline rules, tighter corners, navy ink, one amber highlight. */
:root { --radius: 8px; --grid-line: rgba(24, 119, 201, .07); --grid-major: rgba(24, 119, 201, .12); }
:root[data-theme="dark"] { --grid-line: rgba(90, 167, 236, .06); --grid-major: rgba(90, 167, 236, .11); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --grid-line: rgba(90, 167, 236, .06); --grid-major: rgba(90, 167, 236, .11); } }
.grid-paper { background-color: var(--bg-soft); background-image: linear-gradient(var(--grid-major) 1px, transparent 1px), linear-gradient(90deg, var(--grid-major) 1px, transparent 1px), linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px; background-position: -1px -1px; }
.panel { border-radius: 10px; box-shadow: 0 1px 2px rgba(15, 31, 61, .05); }
.btn { border-radius: 7px; }
input[type=number], input[type=text], input[type=search], select { border-radius: 6px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; }
.eyebrow::before { content: ""; width: 18px; height: 2px; background: var(--accent); border-radius: 1px; }
h1, h2 { font-weight: 780; }

/* Hero */
.hero { padding: 44px 0 40px; border-bottom: 1px solid var(--line); background: none; }
.hero.grid-paper { background-color: var(--bg-soft); }
.hero-grid { grid-template-columns: 1fr minmax(320px, 460px); gap: 44px; }
.hero h1 { font-size: clamp(2rem, 1.25rem + 2.6vw, 3rem); margin-top: .2em; }
.proof-line { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 20px 0 0; font-size: .88rem; color: var(--muted); font-weight: 600; }
.proof-line span::before { content: "✓"; color: var(--good); margin-right: 6px; font-weight: 800; }
.demo { margin: 0; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 10px 30px rgba(15, 31, 61, .08); padding: 14px 16px 12px; }
.demo-head { display: flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.demo-tag { background: var(--accent); color: #fff; border-radius: 4px; padding: 1px 6px; font-size: .7rem; letter-spacing: .08em; }
.demo canvas { display: block; width: 100%; height: 220px; }
.demo .demo-row { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--muted); margin: 6px 0 4px; }
.demo input[type=range] { flex: 1; accent-color: var(--brand); height: 28px; }
.demo output { font: 700 .95rem var(--font); color: var(--head); min-width: 2.6em; text-align: right; font-variant-numeric: tabular-nums; }
.demo-eq { margin: 6px 0 8px; font-size: 1rem; }
.demo-stats { display: flex; gap: 18px; font-size: .88rem; color: var(--muted); }
.demo-stats b { color: var(--head); font-variant-numeric: tabular-nums; }
.demo-link { display: inline-block; margin-top: 10px; font-size: .9rem; font-weight: 650; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; gap: 26px; } .hero { padding: 26px 0 28px; } .demo canvas { height: 190px; } }

/* Section heads */
.section { padding: 44px 0; }
.section-alt { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 20px; flex-wrap: wrap; margin-bottom: 18px; }
.section-head h2 { margin: 0; }
.section-head p { margin: 0; color: var(--muted); }

/* Example questions */
.examples { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; border-top: 1px solid var(--line); }
.examples li { border-bottom: 1px solid var(--line); }
.examples a { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "tag go" "q go"; gap: 2px 14px; padding: 14px 4px; text-decoration: none; color: var(--text); }
.examples a:hover .ex-q { color: var(--brand-ink); }
.examples a:hover .ex-go { transform: translateX(3px); color: var(--brand); }
.ex-tag { grid-area: tag; font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--accent); }
.ex-q { grid-area: q; font-weight: 600; color: var(--head); line-height: 1.4; }
.ex-go { grid-area: go; align-self: center; font-size: 1.2rem; color: var(--muted); transition: transform .15s; }
@media (max-width: 760px) { .examples { grid-template-columns: 1fr; } }

/* Tool index (home + tools page) */
.index { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px 32px; }
.index-group h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 14px 0 4px; padding-bottom: 6px; border-bottom: 1px solid var(--line-strong); }
.index-group ul { list-style: none; margin: 0; padding: 0; }
.index-group a { display: flex; gap: 12px; align-items: flex-start; padding: 10px 6px; margin: 0; border-radius: 6px; text-decoration: none; color: var(--text); }
.index-group a:hover { background: var(--brand-soft); }
.ix-icon { width: 26px; height: 26px; flex: none; color: var(--brand); margin-top: 1px; }
.ix-icon svg { width: 26px; height: 26px; }
.ix-text strong { display: block; color: var(--head); font-size: .98rem; line-height: 1.3; }
.ix-text span { display: block; font-size: .86rem; color: var(--muted); line-height: 1.4; }
.finder { display: flex; align-items: center; gap: 12px; margin: 8px 0 12px; max-width: 520px; }
.finder input { flex: 1; height: 44px; font: 16px var(--font); padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg); color: var(--text); }
.finder input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }

/* How we check */
.checks { max-width: 860px; }
.checks ol { counter-reset: c; list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 14px; }
.checks li { counter-increment: c; position: relative; padding-left: 44px; color: var(--muted); }
.checks li::before { content: counter(c); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--brand); color: var(--brand-ink); font-weight: 800; font-size: .85rem; display: grid; place-items: center; }
.checks li strong { color: var(--head); }

/* Tool pages: graph-paper plots, cleaner result tiles */
.plot-wrap { background-color: var(--bg); border-radius: 8px; }
.result { border-radius: 7px; }
.tool-card, .related .tool-card { border-radius: 8px; }
.tool-card .icon { background: none; width: 30px; height: 30px; }
/* Grid children may shrink below their content (a long equation must never widen the page) */
.hero-grid, .tool, .product-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 460px); }
.tool { grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); }
@media (max-width: 860px) { .hero-grid, .tool, .product-hero { grid-template-columns: minmax(0, 1fr); } }
.demo-eq { white-space: normal; overflow-wrap: anywhere; }
.eq { max-width: 100%; }

/* ===================== Brand palette (brand guide, Nov 27) ===================== */
:root { --brand: #1668C7; --brand-ink: #1257A8; --brand-soft: #E8F2FD; --head: #0B1D3F; --text: #13213A; --muted: #55657D; --accent: #D9940A; --accent-soft: #FFF6E0; --plot-a: #1668C7; --plot-b: #D9940A; }
:root[data-theme="dark"] { --brand: #3D9BF0; --brand-ink: #7DBDF5; --brand-soft: #12305A; --head: #F2F6FC; --accent: #F5B018; --plot-a: #3D9BF0; --plot-b: #F5B018; --bg: #0B1D3F; --bg-soft: #0E2349; --panel: #102750; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --brand: #3D9BF0; --brand-ink: #7DBDF5; --brand-soft: #12305A; --head: #F2F6FC; --accent: #F5B018; --plot-a: #3D9BF0; --plot-b: #F5B018; --bg: #0B1D3F; --bg-soft: #0E2349; --panel: #102750; } }
/* Logo: colour version on light, reversed on dark */
.brand .logo { height: 31px; width: auto; display: block; }
.footer-brand .logo { height: 24px; }
.logo-dark { display: none !important; }
:root[data-theme="dark"] .logo-light { display: none !important; }
:root[data-theme="dark"] .logo-dark { display: block !important; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-light { display: none !important; } :root:not([data-theme="light"]) .logo-dark { display: block !important; } }
.about-logo { float: right; width: 190px; height: auto; margin: 0 0 12px 20px; }
@media (max-width: 520px) { .about-logo { float: none; display: block; margin: 0 auto 14px; width: 200px; } }
@media (max-width: 360px) { .brand .logo { height: 24px; } }
