/* The explorables room: what every page shares (lithium-ion, nerves, solar-heat, led). Each page
   links this first, then keeps its own colour tokens (:root, light and dark) and anything of its
   own in an inline <style>, which comes later and so wins. The tokens this file uses and every page
   defines: --bg --bg-2 --surface --line --line-2 --ink --ink-2 --muted --e --charge --warn --bar. */
:root {
  --display: "Big Shoulders Display", "Arial Narrow", "Roboto Condensed", sans-serif-condensed, sans-serif;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --mono: "Martian Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font-family: var(--serif); font-size: 19px; line-height: 1.6;
  background: radial-gradient(1200px 600px at 70% -10%, var(--bg-2), transparent 70%), var(--bg);
}
.wrap { padding-inline: 22px; }
.col { max-width: 700px; margin-inline: auto; }
.wide { max-width: 1000px; margin-inline: auto; }
a { color: var(--e); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--e); outline-offset: 2px; }
p { margin: 0 0 16px; }
sub, sup { line-height: 0; }
.warn { color: var(--warn); }
.num { font-family: var(--mono); font-size: .78em; font-stretch: 87.5%; white-space: nowrap; }

/* header */
.toprow { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.theme { font-family: var(--mono); font-stretch: 87.5%; font-size: 12px; background: transparent; color: var(--muted); border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 11px; cursor: pointer; }
.theme:hover { color: var(--ink); }
.crumbs { font-family: var(--mono); font-size: 12px; font-stretch: 87.5%; color: var(--muted); padding-top: 20px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumbs span { margin-inline: 6px; opacity: .6; }
header.top { padding-block: 40px 10px; }
.kicker { font-family: var(--mono); font-size: 12.5px; font-stretch: 87.5%; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 14px; }
h1 { font-family: var(--display); font-weight: 900; font-size: clamp(52px, 10vw, 104px); line-height: .9; letter-spacing: .005em; text-transform: uppercase; margin: 0 0 22px; text-wrap: balance; }
h1 em { font-style: normal; }
.byline { font-family: var(--mono); font-size: 12px; font-stretch: 87.5%; color: var(--muted); margin: 0 0 26px; }
.byline span { margin-inline: 6px; opacity: .6; }
.lede { font-size: 22px; line-height: 1.5; color: var(--ink-2); }

/* the bar: the controls, pinned to the top */
.bar { position: sticky; top: 0; z-index: 20; background: var(--bar); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-block: 1px solid var(--line); margin-top: 26px; }
.bar-in { max-width: 1000px; margin-inline: auto; padding: 10px 22px; display: flex; gap: 14px 22px; align-items: center; flex-wrap: wrap; font-family: var(--mono); font-stretch: 87.5%; font-size: 12.5px; }
.ctl { display: grid; gap: 2px; min-width: 170px; flex: 1 1 170px; }
.ctl label { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); }
.ctl label b { color: var(--ink); font-weight: 600; white-space: nowrap; }
input[type=range] { width: 100%; accent-color: var(--charge); margin: 0; height: 22px; }
.chk { display: inline-flex; gap: 7px; align-items: center; cursor: pointer; color: var(--ink-2); }
.chk input { accent-color: var(--warn); width: 16px; height: 16px; margin: 0; }
.btn { font: inherit; font-size: 12.5px; background: transparent; border: 1px solid var(--line-2); color: var(--ink-2); border-radius: 8px; padding: 7px 11px; cursor: pointer; }
.btn:hover { color: var(--ink); border-color: var(--muted); }
.status { color: var(--muted); }
@media (max-width: 700px) {
  body { font-size: 18px; }
  .bar-in { padding: 8px 14px; gap: 8px 12px; }
  .wrap { padding-inline: 16px; }
  .ctl { flex-basis: 100%; }
  .fig { padding: 8px; margin-inline: -8px; border-radius: 10px; }
}

/* sections and figures */
section { padding-block: 64px 0; }
.num-h { font-family: var(--mono); font-size: 12px; font-stretch: 87.5%; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
h2 { font-family: var(--display); font-weight: 800; font-size: clamp(38px, 6vw, 58px); line-height: .95; text-transform: uppercase; letter-spacing: .01em; margin: 0 0 18px; text-wrap: balance; }
h3 { font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 1; text-transform: uppercase; margin: 32px 0 10px; }
figure { margin: 26px 0 22px; }
.fig { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; box-shadow: 0 24px 60px -40px rgba(0, 0, 0, .7); }
.fig canvas { display: block; width: 100%; height: auto; }
figcaption { font-family: var(--mono); font-stretch: 87.5%; font-size: 12px; line-height: 1.55; color: var(--muted); margin-top: 10px; }
.hero-fig { margin-top: 34px; }
/* Shows / Hides */
.sh { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); margin-top: 22px; font-size: 16.5px; line-height: 1.5; }
.sh > div { padding: 12px 18px 0 0; }
.sh > div + div { padding-left: 18px; border-left: 1px solid var(--line); }
.sh h4 { font-family: var(--mono); font-stretch: 87.5%; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 4px; font-weight: 600; }
.sh .shows h4 { color: var(--charge); }
.sh .hides h4 { color: var(--muted); }
@media (max-width: 560px) { .sh { grid-template-columns: 1fr; } .sh > div + div { padding-left: 0; border-left: 0; border-top: 1px dashed var(--line); } }
.eqn { font-family: var(--mono); font-stretch: 87.5%; font-size: 14.5px; line-height: 1.7; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; overflow-x: auto; }
.eqn-note { color: var(--muted); font-size: 12.5px; }

/* tables and the footer */
table { border-collapse: collapse; width: 100%; font-size: 16px; line-height: 1.45; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--line); }
th { font-family: var(--mono); font-stretch: 87.5%; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
td:first-child { font-family: var(--display); font-weight: 800; font-size: 20px; text-transform: uppercase; white-space: nowrap; }
.tablewrap { overflow-x: auto; margin: 18px 0; }
footer { padding-block: 70px 80px; }
.about { font-size: 16px; color: var(--ink-2); }
.about h2 { font-size: 34px; }
.about li { margin-bottom: 6px; }
.credit { border-left: 3px solid var(--e); padding: 4px 0 4px 16px; margin: 0 0 22px; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
