/* carbonian.org, every page. The colours are in palette.css, generated from Carbonian's palette
   source (Forest) by tools/site-palette.py: this file only names roles (--bg, --accent, ...).
   No web fonts: the system's monospace and sans faces. */
:root {
  --mono: ui-monospace, "JetBrains Mono", "Cascadia Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "DejaVu Sans", sans-serif;
  --r: 6px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.62 var(--sans); overflow-x: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hi); text-decoration: underline; }
code, pre, kbd { font-family: var(--mono); }
code { font-size: .92em; color: var(--title); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 0 .3em; }
pre code { background: none; border: 0; padding: 0; color: inherit; }
kbd { font-size: .85em; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 .35em; background: var(--surface); color: var(--title); }
b, strong { color: var(--title); }
h1, h2, h3 { color: var(--title); font-family: var(--mono); font-weight: 700; letter-spacing: -.01em; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.wrap > * , .grid > *, .cards > *, .steps > * { min-width: 0; }
pre { max-width: 100%; }
::selection { background: var(--line); color: var(--title); }

/* the navigation: a status line */
nav { position: sticky; top: 0; z-index: 5; background: var(--nav-bg); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); font-family: var(--mono); }
nav .wrap { display: flex; align-items: center; gap: 18px; min-height: 48px; }
nav .brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; color: var(--title); white-space: nowrap; }
nav .brand img { width: 17px; height: 21px; }
nav .brand i { color: var(--accent); font-style: normal; }
nav .brand:hover { text-decoration: none; }
nav .links { display: flex; gap: 2px; margin-left: auto; font-size: 13px; flex-wrap: wrap; justify-content: flex-end; }
nav .links a { color: var(--muted); padding: 4px 8px; border-radius: 4px; }
nav .links a:hover { color: var(--title); background: var(--surface); text-decoration: none; }
nav .links a[aria-current] { color: var(--bg); background: var(--accent); }
nav .links .sep { color: var(--dim); padding: 4px 2px; }

/* the hero */
header.hero { padding: 56px 0 40px; background: radial-gradient(900px 380px at 50% 0%, var(--accent-wash), transparent 70%); }
.hero .intro { max-width: 780px; margin: 0 auto 32px; text-align: center; }
.hero h1 { font-size: clamp(30px, 5.2vw, 52px); line-height: 1.12; margin: 0 0 16px; }
.hero h1 em, h2 em { font-style: normal; color: var(--accent); }
.hero p.lead { color: var(--muted); font-size: 18px; margin: 0 auto 24px; max-width: 660px; }
.hero .cta { justify-content: center; }
.kicker { font-family: var(--mono); font-size: 13px; color: var(--accent); letter-spacing: .06em; text-transform: lowercase; margin: 0 0 8px; }
.kicker::before { content: "# "; color: var(--dim); }
.cta { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { display: inline-block; padding: 9px 16px; border-radius: var(--r); font: 600 14px var(--mono); border: 1px solid var(--line); color: var(--title); background: var(--surface); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.btn:hover { text-decoration: none; border-color: var(--accent); color: var(--title); }
.btn.primary:hover { background: var(--accent-hi); border-color: var(--accent-hi); color: var(--bg); }

/* sections */
section { padding: 56px 0; border-top: 1px solid var(--line); }
section h2 { font-size: clamp(22px, 3.2vw, 28px); margin: 0 0 8px; }
section h2::before { content: "❯ "; color: var(--accent); }
section h3.part { font-size: 18px; margin: 36px 0 8px; }
section p.sub { color: var(--muted); margin: 0 0 26px; max-width: 740px; }
p.body { max-width: 740px; }
.note { color: var(--muted); font-size: 14px; margin-top: 14px; max-width: 760px; }

/* cards */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.card h3 { margin: 0 0 6px; font-size: 16px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.card p + p { margin-top: 8px; }
.card .tag { display: inline-block; font-family: var(--mono); font-size: 12px; color: var(--accent); margin-bottom: 8px; }

/* the principles: a numbered list, like a man page */
ol.principles { list-style: none; counter-reset: p; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
ol.principles li { counter-increment: p; padding: 12px 0 12px 46px; position: relative; border-bottom: 1px dashed var(--line); color: var(--muted); font-size: 15px; }
ol.principles li::before { content: counter(p, decimal-leading-zero); position: absolute; left: 0; top: 12px; font: 700 14px var(--mono); color: var(--accent); }
ol.principles li b { display: block; color: var(--title); font-size: 16px; margin-bottom: 2px; }

/* tables */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { color: var(--muted); font: 600 12px var(--mono); text-transform: uppercase; letter-spacing: .05em; background: var(--surface); }
td:first-child { color: var(--title); }
td code { white-space: nowrap; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
td.gain { color: var(--ok); font-weight: 600; }
td.flat { color: var(--muted); }
td .live { color: var(--accent); font-family: var(--mono); font-size: 12px; }
td .start { color: var(--warn); font-family: var(--mono); font-size: 12px; }

/* a terminal pane: a file or a command, with its name in the top border */
.pane { margin: 0; background: var(--bg-deep); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.pane .title { display: flex; justify-content: space-between; gap: 10px; padding: 6px 12px; font: 12px var(--mono); color: var(--muted); background: var(--surface); border-bottom: 1px solid var(--line); }
.pane .title b { color: var(--accent); font-weight: 600; }
.pane pre { margin: 0; padding: 12px 14px; overflow-x: auto; font-size: 13px; line-height: 1.55; color: var(--fg); }
.pane .c { color: var(--dim); } .pane .k { color: var(--accent); } .pane .v { color: var(--warn); } .pane .s { color: var(--ok); }
.panes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
pre.cmd { margin: 0; padding: 12px 14px; background: var(--bg-deep); border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; font-size: 13.5px; color: var(--fg); }
pre.cmd .p, pre.prompt .m { color: var(--accent); font-weight: 700; }
pre.prompt .d { color: var(--dim); } pre.prompt .b { color: var(--accent-hi); } pre.prompt .r { color: var(--err); font-weight: 700; }

/* steps */
.steps { counter-reset: s; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.step h3 { margin: 0 0 8px; font-size: 15px; }
.step h3::before { counter-increment: s; content: counter(s); display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 10px; border-radius: 4px; background: var(--accent); color: var(--bg); font-size: 12px; }

/* image slots: a picture when its file exists, a labelled box until then (see SHOTS.md) */
.shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.shots.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
figure.slot { margin: 0; }
.slot .frame { position: relative; aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.slot .frame img, .slot .frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; background: var(--bg); }
.slot.hero-shot .frame { box-shadow: 0 30px 80px -30px rgba(0,0,0,.9), 0 0 60px -24px var(--accent-glow); }
.slot .frame.missing { border-style: dashed; display: grid; place-items: center; padding: 16px;
  background: repeating-linear-gradient(135deg, var(--surface) 0 12px, var(--bg) 12px 24px); }
.slot .frame.missing::after { content: attr(data-shot) "\A" attr(data-want); white-space: pre-line; text-align: center; font: 12.5px/1.5 var(--mono); color: var(--muted);
  background: var(--bg-deep); border: 1px solid var(--line); border-radius: 4px; padding: 8px 12px; max-width: 90%; }
.slot figcaption { color: var(--muted); font-size: 14px; margin-top: 8px; }
.slot figcaption b { color: var(--accent); font-weight: 600; margin-right: 2px; font-family: var(--mono); font-size: 13px; }
.slot .fbnote { display: none; color: var(--dim); }
.slot.fallback .fbnote { display: inline; }

/* recordings */
.demo { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-deep); margin: 0 0 18px; }
.looklist { margin: 16px 0 0; padding-left: 20px; color: var(--muted); }
.looklist li::marker { color: var(--accent); }

/* palettes */
.palettes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 22px; }
.pal { background: var(--p0); border: 1px solid var(--p-line); border-radius: var(--r); padding: 12px; font: 13px var(--mono); color: var(--p7); }
.pal b { color: var(--p5); display: block; margin-bottom: 8px; }
.pal .row { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; }
.pal .row + .row { margin-top: 3px; }
.pal .row i { display: block; height: 14px; border-radius: 2px; }
.pal.on { outline: 2px solid var(--accent); outline-offset: 2px; }
.pal small { display: block; margin-top: 8px; color: var(--p8); }
.palpick { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.palpick button { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; font: 600 13px var(--mono); color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; }
.palpick button i { width: 12px; height: 12px; border-radius: 3px; background: var(--p5); }
.palpick button[aria-pressed="true"] { color: var(--title); border-color: var(--accent); }
.palpick button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* lists */
ul.clean { list-style: none; padding: 0; margin: 0; }
ul.clean li { padding: 7px 0; color: var(--muted); border-bottom: 1px dashed var(--line); }
ul.clean li b { color: var(--title); font-weight: 600; }
ul.clean ul { margin: 6px 0 0; padding-left: 20px; }
ul.clean ul li { border: 0; padding: 2px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.chips li { font: 13px var(--mono); color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 2px 8px; }

/* the Pi page's numbers and flow */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; min-width: 0; }
.stat b { display: block; font: 700 28px var(--mono); color: var(--accent); font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 14px; }
.stamp { color: var(--muted); font-size: 13px; margin-top: 10px; }
.flow { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.flow .node { flex: 1 1 150px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.flow .node b { display: block; color: var(--accent); font: 600 14px var(--mono); margin-bottom: 4px; }
.flow .node span { color: var(--muted); font-size: 13.5px; }
.flow .arrow { align-self: center; color: var(--dim); font-family: var(--mono); }
.micro { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: center; }

footer { padding: 30px 0 44px; color: var(--muted); font: 13px var(--mono); border-top: 1px solid var(--line); }
footer .wrap { display: flex; gap: 14px; flex-wrap: wrap; justify-content: space-between; }

@media (max-width: 900px) {
  .cards, .shots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .palettes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panes, .micro, ol.principles { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  nav .wrap { flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; gap: 6px; }
  nav .links { margin-left: 0; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; width: 100%; padding-bottom: 2px; }
  nav .links a { white-space: nowrap; }
  nav .links .sep { display: none; }
}
@media (max-width: 560px) {
  body { font-size: 15.5px; }
  .wrap { padding: 0 16px; }
  section { padding: 44px 0; }
  .cards, .cards.two, .shots, .shots.two { grid-template-columns: minmax(0, 1fr); }
  .hero p.lead { font-size: 16.5px; }
}
.shots.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .shots.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .shots.four { grid-template-columns: minmax(0, 1fr); } }
