/*
  Deck-specific overrides/components on top of ../../theme/slides-theme.css.

  .console / .code-block / .code-line and the syntax spans are copied from
  decks/python-intro/custom.css (same look, so the class sees the same
  "Python" styling in both lessons). Third deck to need them should pull
  them up into slides-theme.css instead (see theme/README.md).

  .demo-* classes style the React diagrams mounted by js/pi-demos.js.
*/

:root {
  --happy:     #8fbf7a;
  --happy-dim: rgba(143, 191, 122, 0.14);
  --inside:    var(--accent);   /* darts inside the quarter circle */
  --outside:   var(--cool);     /* darts outside it */
  --r-h2-size: 1.3em;
}

/* ---- Spyder console block ---- */
.console {
  font-family: var(--mono);
  font-size: 0.68em;
  line-height: 1.9;
  background: rgba(255,255,255,0.04);
  border-left: 2px solid var(--cool);
  border-radius: 2px;
  padding: 0.6em 1.1em;
  text-align: left;
  margin: 0.6em 0;
}
.console .cline { color: var(--ink); white-space: pre-wrap; }
.console .cline .ps { color: var(--ink-dim); margin-right: 0.6em; user-select: none; }
.console .cout { color: var(--accent); padding-left: 1.9em; white-space: pre-wrap; }

/* ---- .py script block ---- */
.code-block {
  font-family: var(--mono);
  font-size: 0.56em;
  line-height: 1.7;
  background: rgba(255,255,255,0.04);
  border-left: 2px solid var(--rule);
  border-radius: 2px;
  padding: 0.55em 0;
  text-align: left;
  margin: 0.6em 0;
}
.code-line {
  display: flex;
  align-items: baseline;
  padding: 0 0.9em;
  white-space: pre;
  transition: background 0.3s;
}
.code-line .ln {
  flex: 0 0 2em;
  margin-right: 0.9em;
  color: var(--ink-dim);
  text-align: right;
  user-select: none;
  font-variant-numeric: tabular-nums;
}
.code-line.indent { padding-left: 2.3em; }
.code-line.indent2 { padding-left: 4.3em; }
.code-line.blank .ln { opacity: 0; }
/* a fragment that highlights one line of the script as we talk through it */
.code-line.fragment.hl { opacity: 1; visibility: inherit; }
.code-line.fragment.hl.current-fragment { background: var(--accent-dim); }

.kw  { color: var(--cool); margin-right: 0.35em; }
.kw.tight { margin-right: 0; }
.str { color: var(--happy); }
.num { color: var(--accent); }
.cmt { color: var(--ink-dim); font-style: italic; }
.fn  { color: var(--accent); }

.slide-note {
  font-family: var(--mono);
  font-size: 0.55em;
  color: var(--ink-dim);
  margin-top: 0.8em;
}

/* ---- maths ---- */
.maths {
  font-family: "Cambria Math", "STIX Two Math", "Latin Modern Math", Georgia, serif;
  font-size: 1.15em;
  color: var(--ink);
  margin: 0.5em 0;
  display: flex;
  align-items: center;
  gap: 0.4em;
  flex-wrap: wrap;
}
.maths .hi { color: var(--accent); }
.maths .in { color: var(--inside); }
.maths .out { color: var(--outside); }
.frac {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: middle;
  line-height: 1.15;
  margin: 0 0.15em;
}
.frac > span:first-child { border-bottom: 2px solid currentColor; padding: 0 0.2em; }
.frac > span:last-child { padding: 0 0.2em; }
.maths.big { font-size: 1.6em; }
.maths .label {
  font-family: var(--sans);
  font-size: 0.5em;
  color: var(--ink-dim);
  min-width: 9em;
}

/* ---- layout: diagram on one side, a few words on the other ---- */
.split {
  display: flex;
  align-items: center;
  gap: 2.2em;
  margin-top: 0.4em;
}
.split > .demo-col { flex: 0 0 auto; }
.split > .text-col { flex: 1; }
.split .text-col p { font-size: 0.8em; margin: 0 0 0.6em; }

/* ---- React demos (js/pi-demos.js) ---- */
.demo { font-family: var(--mono); color: var(--ink); }
.demo canvas, .demo svg { display: block; }
.demo-stats {
  display: flex;
  gap: 1.4em;
  font-size: 0.5em;
  margin-top: 0.6em;
  font-variant-numeric: tabular-nums;
}
.demo-stats .stat b { display: block; font-size: 1.6em; font-weight: 600; color: var(--ink); }
.demo-stats .stat span { color: var(--ink-dim); }
.demo-stats .swatch {
  display: inline-block; width: 0.7em; height: 0.7em; border-radius: 50%;
  margin-right: 0.35em; vertical-align: baseline;
}
.demo-buttons { display: flex; gap: 0.5em; margin-top: 0.7em; flex-wrap: wrap; }
.demo-buttons button {
  font-family: var(--mono);
  font-size: 0.45em;
  color: var(--bg-deep);
  background: var(--accent);
  border: 0;
  border-radius: 2px;
  padding: 0.45em 0.9em;
  cursor: pointer;
}
.demo-buttons button.ghost { background: transparent; color: var(--ink-dim); box-shadow: inset 0 0 0 1px var(--rule); }
.demo-buttons button:hover { background: var(--ink); color: var(--bg-deep); }
.demo-estimate { font-size: 0.9em; margin-top: 0.3em; }
.demo-estimate .v { color: var(--accent); font-weight: 600; }
.demo-estimate .err { color: var(--ink-dim); font-size: 0.55em; margin-left: 0.6em; }
.demo-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--bg-deep);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.3em 0.6em;
  font-size: 0.45em;
  white-space: nowrap;
}

/* ---- closing ---- */
.reveal .recap-list { list-style: none; margin: 0.6em 0 0; padding: 0; }
.recap-list li { font-family: var(--mono); font-size: 0.85em; padding: 0.25em 0; color: var(--ink-dim); }
.recap-list li.fragment.visible { color: var(--ink); }
.recap-list li::before { content: "\2713  "; color: var(--happy); }

/* ---- countdown for the coding task ---- */
.countdown { min-width: 9em; }
.countdown-time {
  font-size: 2.6em;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.countdown-bar {
  height: 6px;
  background: var(--rule);
  border-radius: 3px;
  margin-top: 0.5em;
  overflow: hidden;
}
.countdown-bar span { display: block; height: 100%; background: var(--accent); transition: width 0.25s linear; }

/* ---- final slide: QR code to the teaching slides page ---- */
/* white card + quiet zone: phone cameras need dark-on-light to scan reliably */
.reveal .qr-slide img.qr {
  width: 420px;
  height: 420px;
  background: #fff;
  padding: 14px;
  border-radius: 6px;
  display: block;
  margin: 0;
}
.reveal .qr-slide .caption { font-size: 0.6em; }
