/* ============================================
   AMBYKIT EXTRAS
   Loads AFTER ambystech-theme.css.
   Never modifies the shared theme; only extends it.
   ============================================ */

/* ---------- Typography override ----------
   The shared theme asks for Calibri / Consolas but never loads a webfont,
   so the deck silently falls back to a generic sans on non-Windows machines
   and in PDF export. index.html loads these three; we point the vars at them.
------------------------------------------------ */
:root {
  --font-display: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --font-body:    'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Consolas', monospace;
}

.reveal { font-weight: 400; }
.reveal p, .reveal li { font-weight: 400; }
.reveal h1, .reveal h2 { letter-spacing: -0.025em; }

/* ---------- Footer brand logo (persists on every slide) ----------
   .amby-footer lives OUTSIDE .reveal, so the `.reveal img` sizing rules don't
   reach it — it needs its own. Drop the real mark at that path and this picks it up.
------------------------------------------------ */
.amby-footer .brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.amby-footer .brand-logo {
  height: 54px;
  width: auto;
  display: block;
  opacity: 0.95;
}
.amby-footer .site {
  color: var(--amby-fg-dim);
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  /* line-height 1 so the text's optical centre matches the logo's box centre */
  line-height: 1;
  display: flex;
  align-items: center;
}

/* Right side: confidentiality notice + legal entity (configured in package.json) */
.amby-footer .url {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
}
.amby-footer .notice {
  color: var(--amby-warn);
  font-weight: 600;
}
/* Separator only when there IS a notice. A public deck has an empty notice
   ({{FOOTER_NOTICE}} → ''), so the dash must not render on its own. */
.amby-footer .notice:not(:empty)::after {
  content: "—";
  color: var(--amby-fg-dim);
  font-weight: 400;
  margin-left: 8px;
}
.amby-footer .entity {
  color: var(--amby-fg-dim);
  text-transform: none;
  letter-spacing: 0.08em;
}

/* ---------- Title slide: logo lockup in place of the <h1> ----------
   The theme's h1 gradient no longer applies (the wordmark carries its own colour),
   so match the h1's old rhythm: same left edge, same gap down to .subtitle.
------------------------------------------------ */
.reveal section.title-slide img.title-logo {
  max-height: 210px;
  width: auto;
  margin: 0 0 0.45em;
  filter: drop-shadow(0 0 34px rgba(238, 17, 153, 0.3));
}

/* ---------- Mermaid diagrams ----------
   A ```mermaid fence in a slide .md is replaced by one of these at runtime.
------------------------------------------------ */
.mermaid-diagram {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0.9em 0;
}
.mermaid-diagram svg {
  max-width: 100%;
  max-height: 52vh;
  height: auto;
}
/* Reveal's global img/svg rules don't cover injected SVG text — keep labels legible */
.mermaid-diagram .nodeLabel,
.mermaid-diagram .edgeLabel,
.mermaid-diagram .label {
  font-family: var(--font-body);
}

/* ---------- Speaker-notes button ----------
   Reveal has no on-screen control for notes; "S" is the only way in. This is it.
------------------------------------------------ */
#notes-btn {
  position: fixed;
  top: 14px;
  left: 26px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 20px;
  background: rgba(17, 21, 31, 0.72);
  border: 1px solid rgba(0, 204, 255, 0.22);
  color: var(--amby-fg-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
#notes-btn:hover {
  opacity: 1;
  background: rgba(0, 204, 255, 0.14);
  border-color: var(--amby-cyan);
  color: var(--amby-cyan);
}
#notes-btn .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amby-fuchsia);
  display: block;
}
/* the presenter's own screen only — never in the PDF export */
.print-pdf #notes-btn { display: none; }

/* Export mode (?export=1, set by `npm run pdf`). decktape steps the deck itself and never
   enters Reveal's print mode, so .print-pdf never applies — without this the NOTES button
   and the nav arrows are baked into every page of the exported PDF. */
body.exporting #notes-btn,
body.exporting .reveal .controls,
body.exporting .reveal .progress {
  display: none !important;
}

/* ---------- Nav arrows ----------
   Reveal's defaults give a 36px chevron jammed against the viewport edge, and the
   back arrow at opacity .3 — it reads as disabled. Make them real buttons:
   bigger hit area, inset from the edge, visible at rest, obvious on hover.
------------------------------------------------ */
.reveal .controls {
  right: 14px;
  left: 14px;
  bottom: 14px;
  top: 14px;
  color: var(--amby-cyan);
}
.reveal .controls .navigate-left,
.reveal .controls .navigate-right {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(17, 21, 31, 0.72);
  border: 1px solid rgba(0, 204, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.72;
  transition: opacity 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.reveal .controls .navigate-left:hover,
.reveal .controls .navigate-right:hover {
  opacity: 1;
  background: rgba(0, 204, 255, 0.14);
  border-color: var(--amby-cyan);
}
/* Reveal draws the chevron with a CSS-border triangle; recentre it in the new button */
.reveal .controls .controls-arrow {
  margin: 0;
}
/* a disabled arrow (first/last slide) should actually look disabled */
.reveal .controls .navigate-left:not(.enabled),
.reveal .controls .navigate-right:not(.enabled) {
  opacity: 0.15;
  border-color: rgba(255, 255, 255, 0.06);
}

/* ---------- Chrome: keep the slide number off the footer ----------
   The theme pins .amby-footer to the bottom edge; Reveal's slide number
   defaults to the same corner and the two collide. Move it up top.
------------------------------------------------ */
.reveal .slide-number {
  top: 16px;
  right: 26px;
  bottom: auto;
  left: auto;
  letter-spacing: 0.12em;
}

/* Code blocks: never center code, and keep <code> a block.
   When it computes to display:inline the padding only applies to the first line box,
   so every following line sits flush against the border. */
.reveal pre,
.reveal pre code { text-align: left; }
.reveal pre code {
  display: block;
  box-sizing: border-box;
  width: 100%;
  overflow-x: auto;
}

/* ---------- Base: kill Reveal's default image frame ---------- */
.reveal img {
  border: none;
  box-shadow: none;
  background: transparent;
  margin: 0;
  max-width: 100%;
  max-height: 60vh;
  display: block;
}

/* ---------- Size utilities ----------
   ![AmbyKit](assets/img/logo.png) <!-- .element class="img-md" -->
------------------------------------------------ */
.reveal img.img-xs  { max-height: 90px; }
.reveal img.img-sm  { max-height: 160px; }
.reveal img.img-md  { max-height: 300px; }
.reveal img.img-lg  { max-height: 460px; }
.reveal img.img-xl  { max-height: 62vh; }
.reveal img.center  { margin-left: auto; margin-right: auto; }

.reveal img.framed {
  border: 1px solid rgba(60, 105, 231, 0.25);
  border-radius: 8px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
}

.reveal img.glow {
  filter: drop-shadow(0 0 24px rgba(238, 17, 153, 0.35));
}

/* ---------- Full-bleed image slide ---------- */
section.image-slide { text-align: left; }
section.image-slide::before {
  content: "";
  position: absolute;
  inset: -10vh -10vw;
  background: linear-gradient(90deg, rgba(10, 13, 20, 0.92) 0%, rgba(10, 13, 20, 0.55) 55%, transparent 100%);
  z-index: -1;
}

/* ---------- Figure + caption ---------- */
.reveal figure { margin: 0.6em 0; text-align: center; }
.reveal figure figcaption {
  font-family: var(--font-mono);
  font-size: 0.5em;
  color: var(--amby-fg-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 0.8em;
}

/* ---------- Hero: logo + text side by side ---------- */
.hero {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2.2em;
  align-items: center;
  text-align: left;
}
.hero img { max-height: 200px; width: 100%; object-fit: contain; }

/* ---------- Logo row ---------- */
.logo-row {
  display: flex;
  gap: 2.5em;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin: 1.2em 0;
}
.logo-row img { max-height: 72px; opacity: 0.85; filter: grayscale(0.2); }

/* ---------- Terminal frame (for vhs / asciinema GIFs) ---------- */
.terminal {
  background: var(--amby-bg-2);
  border: 1px solid rgba(60, 105, 231, 0.25);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
  max-width: 90%;
  margin: 0.8em auto;
}
.terminal .bar {
  display: flex;
  gap: 7px;
  padding: 9px 14px;
  background: var(--amby-bg-3);
  align-items: center;
}
.terminal .bar i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.terminal .bar i:nth-child(1) { background: var(--amby-fuchsia); }
.terminal .bar i:nth-child(2) { background: var(--amby-warn); }
.terminal .bar i:nth-child(3) { background: var(--amby-ok); }
.terminal .bar span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--amby-fg-dim);
  margin-left: 10px;
  letter-spacing: 0.08em;
}
.terminal img { width: 100%; max-height: 52vh; object-fit: contain; }
.terminal pre { margin: 0; border: none; border-radius: 0; box-shadow: none; }

/* ---------- Flow steps (4 across) ---------- */
.flow { display: flex; align-items: stretch; gap: 0; margin-top: 1.2em; }
.flow .step {
  flex: 1;
  background: var(--amby-bg-2);
  border-top: 3px solid var(--amby-fuchsia);
  padding: 16px 18px;
  text-align: left;
  position: relative;
}
.flow .step:nth-child(2) { border-top-color: var(--amby-orchid); }
.flow .step:nth-child(3) { border-top-color: var(--amby-blue); }
.flow .step:nth-child(4) { border-top-color: var(--amby-cyan); }
.flow .step + .step { margin-left: 14px; }
.flow .step::after {
  content: "→";
  position: absolute;
  right: -13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--amby-fg-dim);
  font-size: 0.7em;
  z-index: 3;
}
.flow .step:last-child::after { content: none; }
.flow .step .n {
  font-family: var(--font-mono);
  font-size: 0.5em;
  color: var(--amby-fuchsia);
  letter-spacing: 0.2em;
  display: block;
  margin-bottom: 0.5em;
}
.flow .step h4 { font-size: 0.72em; color: var(--amby-fg); margin-bottom: 0.4em; }
.flow .step p { font-size: 0.55em; color: var(--amby-fg-dim); line-height: 1.4; }

/* ============================================
   NEW COMPONENTS
   ============================================ */

/* ---------- .phases — the 8-phase rail (2 x 4) ----------
   .flow hardcodes four cards; AmbyKit has eight.
------------------------------------------------ */
.phases {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 0.9em;
  text-align: left;
}
.phases .p {
  background: var(--amby-bg-2);
  border-top: 3px solid var(--amby-blue);
  border-radius: 4px;
  padding: 12px 14px;
  position: relative;
}
/* cycle the brand ramp across the eight cells */
.phases .p:nth-child(4n+1) { border-top-color: var(--amby-fuchsia); }
.phases .p:nth-child(4n+2) { border-top-color: var(--amby-orchid); }
.phases .p:nth-child(4n+3) { border-top-color: var(--amby-blue); }
.phases .p:nth-child(4n+4) { border-top-color: var(--amby-cyan); }

.phases .p .cmd {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.5em;
  color: var(--amby-fg);
  font-weight: 600;
  margin-bottom: 0.45em;
  letter-spacing: -0.01em;
}
.phases .p .io {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.4em;
  color: var(--amby-fg-dim);
  line-height: 1.5;
}
.phases .p .io b {
  color: var(--amby-cyan);
  font-weight: 600;
}
/* the two optional phases read as secondary */
.phases .p.opt { opacity: 0.72; border-top-style: dashed; }

/* ---------- .stat-row — oversized numbers ---------- */
.stat-row {
  display: flex;
  gap: 2.6em;
  margin-top: 1.1em;
  text-align: left;
}
.stat-row .stat .v {
  display: block;
  font-family: var(--font-display);
  font-size: 1.7em;
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(135deg, var(--amby-fuchsia), var(--amby-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-row .stat .k {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.42em;
  color: var(--amby-fg-dim);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 0.6em;
}

/* ---------- .callout — the one-line takeaway ---------- */
.callout {
  margin-top: 1.1em;
  padding: 12px 20px;
  background: var(--amby-bg-2);
  border-left: 4px solid;
  border-image: linear-gradient(180deg, var(--amby-fuchsia), var(--amby-cyan)) 1;
  border-radius: 0 6px 6px 0;
  font-size: 0.68em;
  text-align: left;
  color: var(--amby-fg);
}

/* ---------- .matrix — the comparison table ---------- */
.matrix { margin-top: 0.5em; }
.reveal .matrix table {
  font-size: 0.55em;
  width: 100%;
  border-collapse: collapse;
}
.reveal .matrix th,
.reveal .matrix td {
  padding: 7px 10px;
  text-align: center;
  white-space: nowrap;
}
.reveal .matrix thead th {
  background: var(--amby-bg-3);
  color: var(--amby-fg-dim);
  font-family: var(--font-mono);
  font-size: 0.85em;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
/* first column: the axis labels, left-aligned */
.reveal .matrix th:first-child,
.reveal .matrix td:first-child {
  text-align: left;
  color: var(--amby-fg);
  font-weight: 600;
}
/* last column: AmbyKit — where the eye should land */
.reveal .matrix th:last-child {
  color: var(--amby-cyan);
  border-top: 3px solid;
  border-image: linear-gradient(90deg, var(--amby-fuchsia), var(--amby-cyan)) 1;
}
.reveal .matrix td:last-child {
  background: rgba(0, 204, 255, 0.05);
  color: var(--amby-fg);
  font-weight: 600;
}
.reveal .matrix tbody tr:hover { background: rgba(0, 204, 255, 0.04); }
.reveal .matrix tbody tr:hover td:last-child { background: rgba(0, 204, 255, 0.09); }

/* marks */
.matrix .yes  { color: var(--amby-ok);      font-weight: 700; }
.matrix .part { color: var(--amby-warn);    font-weight: 700; }
.matrix .no   { color: var(--amby-fg-dim);  opacity: 0.55; }
/* the row AmbyKit loses — do not dress it up */
.reveal .matrix tr.concede td:last-child {
  background: rgba(255, 176, 32, 0.06);
  font-weight: 400;
}
/* a row where everyone ties — drop the cyan wash so it doesn't read as a win */
.reveal .matrix tr.tie td:last-child {
  background: rgba(255, 255, 255, 0.03);
  font-weight: 400;
}

.matrix .legend {
  font-family: var(--font-mono);
  font-size: 0.4em;
  color: var(--amby-fg-dim);
  letter-spacing: 0.08em;
  margin-top: 0.7em;
  text-align: left;
}

/* ---------- .emit — one source, N tool configs ---------- */
.emit {
  display: grid;
  grid-template-columns: 210px 40px 1fr;
  align-items: center;
  gap: 0;
  margin-top: 1em;
  text-align: left;
}
.emit .src {
  background: var(--amby-bg-2);
  border-left: 3px solid var(--amby-fuchsia);
  border-radius: 4px;
  padding: 14px 16px;
}
.emit .src .t {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.45em;
  color: var(--amby-fuchsia);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.5em;
}
.emit .src .f {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.44em;
  color: var(--amby-fg-dim);
  line-height: 1.7;
}
.emit .fan {
  height: 100%;
  background:
    linear-gradient(90deg, var(--amby-fuchsia), var(--amby-cyan)) center/100% 2px no-repeat;
}
.emit .outs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.emit .outs .o {
  background: var(--amby-bg-2);
  border: 1px solid rgba(0, 204, 255, 0.18);
  border-radius: 4px;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 0.42em;
  color: var(--amby-fg-dim);
}
.emit .outs .o b { color: var(--amby-cyan); font-weight: 600; }

/* ---------- .anatomy — annotated single line of code ---------- */
.anatomy {
  background: var(--amby-bg-2);
  border: 1px solid rgba(60, 105, 231, 0.2);
  border-left: 3px solid var(--amby-cyan);
  border-radius: 6px;
  padding: 20px 24px;
  margin-top: 1em;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.62em;
  white-space: nowrap;
  overflow-x: auto;
}
.anatomy .seg { position: relative; padding: 2px 1px; }
.anatomy .s-box  { color: var(--amby-ok); }
.anatomy .s-id   { color: var(--amby-fuchsia); font-weight: 700; }
.anatomy .s-par  { color: var(--amby-warn); font-weight: 700; }
.anatomy .s-us   { color: var(--amby-cyan); font-weight: 700; }
.anatomy .s-desc { color: var(--amby-fg); }
.anatomy .s-file { color: var(--amby-fg-dim); }

.anatomy-key {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 1em;
  text-align: left;
}
.anatomy-key .k {
  font-family: var(--font-mono);
  font-size: 0.38em;
  line-height: 1.5;
  color: var(--amby-fg-dim);
  border-top: 2px solid rgba(255, 255, 255, 0.08);
  padding-top: 8px;
}
.anatomy-key .k b { display: block; margin-bottom: 3px; font-weight: 700; }
.anatomy-key .k:nth-child(1) b { color: var(--amby-ok); }
.anatomy-key .k:nth-child(2) b { color: var(--amby-fuchsia); }
.anatomy-key .k:nth-child(3) b { color: var(--amby-warn); }
.anatomy-key .k:nth-child(4) b { color: var(--amby-cyan); }
.anatomy-key .k:nth-child(5) b { color: var(--amby-fg); }

/* ---------- .shoulders — borrowed / added / missing ---------- */
.shoulders {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1em;
  margin-top: 1em;
  text-align: left;
}
.shoulders .s {
  background: var(--amby-bg-2);
  border-radius: 6px;
  padding: 16px 18px;
  border-top: 3px solid var(--amby-fg-dim);
}
.shoulders .s.add  { border-top-color: var(--amby-ok); }
.shoulders .s.miss { border-top-color: var(--amby-warn); }
.shoulders .s h4 {
  font-family: var(--font-mono);
  font-size: 0.5em;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.7em;
  color: var(--amby-fg-dim);
}
.shoulders .s.add h4  { color: var(--amby-ok); }
.shoulders .s.miss h4 { color: var(--amby-warn); }
.shoulders .s ul { margin: 0; padding-left: 1.1em; }
.shoulders .s li { font-size: 0.55em; line-height: 1.45; margin: 0.35em 0; }
.shoulders .s li::marker { color: var(--amby-fg-dim); }
