/* PyTrace content pages (examples, about). Same tokens, header and cards as the visualizer (index.html). */
:root {
  --bg: #0f1115; --panel: #171a21; --panel-2: #1e222b; --border: #2a2f3a;
  --text: #e6e8ee; --muted: #8b93a7; --accent: #7aa2ff; --ok: #3ecf8e; --on-accent: #0b1020;
  --header-bg: rgba(15, 17, 21, .86);
  --shadow-sm: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 4px 14px rgba(0, 0, 0, .18);
  --p0: #f5a524; --p1: #22d3ee;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f3f4f7; --panel: #ffffff; --panel-2: #f2f4f8; --border: #dde1e8;
  --text: #1a1e27; --muted: #646d82; --accent: #3a66e8; --ok: #0f9d58; --on-accent: #ffffff;
  --header-bg: rgba(243, 244, 247, .86);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05), 0 3px 10px rgba(16, 24, 40, .05);
  --p0: #c47a06; --p1: #0891b2;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: .9em; background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }

/* ---- header (same as the visualizer) ---- */
header { display: flex; align-items: center; gap: 12px; padding: 0 16px; height: 48px;
  position: sticky; top: 0; z-index: 20; background: var(--header-bg);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
header .logo { font-size: 15px; margin: 0; font-weight: 600; letter-spacing: .2px; white-space: nowrap; }
header .logo a { color: inherit; text-decoration: none; }
header .tagline { color: var(--muted); font-weight: 400; font-size: 13px; }
header .ver { color: var(--muted); font-size: 11px; font-family: var(--mono); opacity: .7; white-space: nowrap; }
@media (max-width: 900px) { header .tagline, header .ver { display: none; } }
@media (max-width: 420px) { .navlink[href="/"] { display: none; } }
header nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.navlink { color: var(--muted); font-size: 13px; padding: 6px 10px; border-radius: 6px; white-space: nowrap; }
.navlink:hover { color: var(--text); text-decoration: none; }
.navlink[aria-current="page"] { color: var(--text); background: var(--panel-2); }
.gh-link { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 32px;
  color: var(--muted); border-radius: 8px; transition: color .15s; }
.gh-link:hover, .gh-link:focus-visible { color: var(--text); }
button { background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 10px; font: inherit; cursor: pointer; }
button:hover { border-color: var(--accent); }
button.icon { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 32px; padding: 0; }
:root[data-theme="dark"] #themeBtn .moon, :root[data-theme="light"] #themeBtn .sun { display: none; }

/* ---- cards (same as the visualizer) ---- */
main { max-width: 1180px; margin: 0 auto; padding: 12px; display: grid; gap: 12px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-sm); overflow: hidden; min-width: 0; }
.card-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; min-height: 38px;
  border-bottom: 1px solid var(--border); }
.card-head h2, .card-head .label { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .8px;
  color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-head .label a { color: var(--muted); }
.card-head .label a:hover { color: var(--text); text-decoration: none; }
.card-head .spacer { flex: 1; }
.card-head .meta { color: var(--muted); font: 11px var(--mono); white-space: nowrap; }
.card-body { padding: 14px 16px; line-height: 1.6; }
.card-body > :first-child { margin-top: 0; }
.card-body > :last-child { margin-bottom: 0; }
.card-body p { margin: 0 0 10px; }
.card-body ul { margin: 0; padding-left: 18px; }
.card-body li { margin: 3px 0; }
.card-body h3 { font-size: 14px; margin: 16px 0 4px; }
.muted { color: var(--muted); }

.hero h1 { font-size: 22px; line-height: 1.25; margin: 0 0 10px; letter-spacing: -.2px; }
.hero .card-body { padding: 18px 20px 16px; font-size: 15px; }
.hero .cx { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 14px 0 0;
  padding-top: 12px; border-top: 1px solid var(--border); font-size: 14px; }
.hero .cx-k { font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 600; }

/* Run pill: same as the visualizer's Run button */
.run { display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px 4px 5px; border-radius: 999px;
  background: var(--accent); border: 1px solid var(--accent); color: var(--on-accent);
  font-weight: 600; font-size: 12.5px; white-space: nowrap; transition: filter .15s, transform .1s; }
.run:hover { filter: brightness(1.1); text-decoration: none; }
.run:active { transform: scale(.96); }
.run .ico { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px;
  border-radius: 50%; background: color-mix(in srgb, var(--on-accent) 18%, transparent); font-size: 9px; padding-left: 1px; }

/* layouts */
.cols-2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 12px; align-items: stretch; }
.stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
/* both columns share the taller one's height: the code area / the last card on the right grow to fill it */
.cols-2 > .card { display: flex; flex-direction: column; }
.cols-2 > .card > .code { flex: 1; }
.cols-2 .stack > .card:last-child { flex: 1; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 12px; }
@media (max-width: 860px) { .cols-2 { grid-template-columns: 1fr; } }

/* code card: looks like the editor (gutter + CodeMirror theme colors) */
.code { display: flex; font: 14px/1.5 var(--mono); overflow-x: auto; }
.code pre { margin: 0; padding: 10px 0; font: inherit; }
.code .gutter { flex: none; padding: 10px 8px 10px 14px; text-align: right; color: var(--muted); opacity: .7;
  border-right: 1px solid var(--border); user-select: none; }
.code .src { flex: 1; padding: 10px 14px; background: transparent !important; color: var(--text); }

/* inputs card: looks like the visualizer's input rows */
.inputs { display: grid; gap: 7px; }
.inputs .row { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 8px; }
.inputs .k { font-family: var(--mono); color: var(--muted); text-align: right; font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inputs .v { font-family: var(--mono); font-size: 13px; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 10px; overflow-x: auto; white-space: nowrap; }

/* chips (links to other examples) */
.chips, .card-body .chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.chips a { display: inline-block; padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--panel-2); color: var(--text); font-size: 13px; }
.chips a:hover { border-color: var(--accent); text-decoration: none; }

/* example cards on /examples/ */
.ex-card { display: flex; flex-direction: column; }
.ex-card .card-body { flex: 1; }
.ex-card h2 a { color: var(--muted); }
.ex-card h2 a:hover { color: var(--text); text-decoration: none; }
.ex-card .foot { display: flex; align-items: center; gap: 10px; padding: 0 16px 14px; }
.ex-card .foot .more { font-size: 13px; }

/* FAQ */
details { border-top: 1px solid var(--border); padding: 10px 0; }
details:first-of-type { border-top: 0; padding-top: 0; }
summary { cursor: pointer; font-weight: 600; }
details p { margin: 6px 0 0; color: var(--muted); }

/* footer: same as the visualizer */
.site-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; padding: 14px 16px 22px;
  font-size: 12px; color: var(--muted); }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); text-decoration: none; }
