@font-face {
  font-family: 'IBM Plex Mono';
  src: url('vendor/fonts/IBMPlexMono/IBMPlexMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('vendor/fonts/IBMPlexMono/IBMPlexMono-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
}

:root {
  --bg: #0d0d0d;
  --fg: #f0f0f0;
  --accent: #f0f0f0;
  --accent-slide: #e68b4b;
  --border: #444;
  --nav-height: 3.75rem;
  --font: 'IBM Plex Mono', monospace;
}

[data-theme="light"] {
  --bg: #f5f5f0;
  --fg: #111;
  --accent: #111;
  --accent-slide: #a05e2c;
  --border: #bbb;
}

*, *::before, *::after {
  box-sizing: border-box;
}

[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  transition: background 0.15s, color 0.15s;
}

/* Reveal.js adds .reveal-viewport to body (background-color:#fff); outspecify it */
body.reveal-viewport {
  background: var(--bg);
}

/* ── Nav ─────────────────────────────────────────────── */

#site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  gap: 2.25rem;
  padding: 0 1.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  z-index: 1000;
  font-size: 1.25rem;
}

#site-nav a {
  color: var(--fg);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}

#site-nav a:hover {
  border-bottom-color: var(--border);
}

#site-nav a[aria-current="page"] {
  border-bottom-color: var(--fg);
}

#theme-toggle {
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  color: var(--fg);
  font-family: var(--font);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.1rem 0.4rem;
  line-height: 1.6;
}

#theme-toggle:hover {
  border-color: var(--fg);
}

/* ── Main layout ─────────────────────────────────────── */

main {
  margin-top: var(--nav-height);
  height: calc(100vh - var(--nav-height));
}

/* ── Slides view ─────────────────────────────────────── */

#slides-view {
  width: 100%;
  height: 100%;
}

#slides-view .reveal {
  height: 100%;
}

body.slides-active #site-nav {
  display: none;
}

body.slides-active main {
  margin-top: 0;
  height: 100vh;
}

#slides-back-btn {
  display: none;
  position: fixed;
  top: 0.65rem;
  right: 1rem;
  z-index: 2000;
  background: rgba(13, 13, 13, 0.55);
  border: 1px solid var(--border);
  color: var(--fg);
  font-family: var(--font);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.15rem 0.55rem;
  line-height: 1.6;
  opacity: 0.45;
  transition: opacity 0.15s;
}

body.slides-active #slides-back-btn {
  display: block;
}

#slides-back-btn:hover {
  opacity: 1;
}

/* ── Reveal.js theme overrides ───────────────────────── */

.reveal {
  font-family: var(--font) !important;
  font-size: 2.0rem;
  background: var(--bg);
  color: var(--fg);
}

.reveal .slides section {
  text-align: left;
  box-sizing: border-box;
  padding-top: 1rem;
}

.reveal h1, .reveal h2, .reveal h3, .reveal h4 {
  font-family: var(--font) !important;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  text-shadow: none;
  color: var(--fg);
}

.reveal h1 { font-size: 3.5rem; color: var(--accent-slide); margin-bottom: 0.5rem; }
.reveal h2 { font-size: 2.6rem; margin-top: 1.4rem; margin-bottom: 0.5rem; }
.reveal h3 { font-size: 2.0rem; margin-top: 1.4rem; margin-bottom: 0.5rem; }
.reveal h4 {
  font-size: 1.65rem;
  border-left: 3px solid var(--accent-slide);
  padding-left: 0.6rem;
  border-bottom: none;
  padding-bottom: 0;
  margin-top: 1.2rem;
  margin-bottom: 0.4rem;
}

.reveal p, .reveal li {
  color: var(--fg);
  line-height: 1.7;
}

.reveal ul li, .reveal ol li {
  margin-bottom: 0.6rem;
}

.reveal a {
  color: var(--fg);
  text-decoration: underline;
}

.reveal pre, .reveal code {
  font-family: var(--font) !important;
  background: none;
  box-shadow: none;
  border: 1px solid var(--border);
  color: var(--fg);
}

.reveal pre {
  padding: 0.5rem 0.75rem;
  font-size: 1.35rem;
  overflow-x: auto;
  max-width: 100%;
  margin-top: 0.75rem;
  margin-bottom: 1rem;
}

.reveal code {
  padding: 0.2em 0.35em;
  vertical-align: middle;
}

.reveal pre code {
  border: none;
  padding: 0;
  background: none;
}

.reveal .slides section img {
  max-height: 80vh;
  max-width: 96%;
  width: auto;
  height: auto;
  display: block;
  margin: 0.75rem auto;
  border: 1px solid var(--border);
  background: var(--bg);
  padding: 6px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

.reveal blockquote {
  background: none;
  border: none;
  border-left: 3px solid var(--accent-slide);
  border-radius: 0;
  box-shadow: none;
  padding: 0.2rem 0 0.2rem 0.85rem;
  font-style: italic;
  width: auto;
}

.reveal strong {
  color: var(--accent-slide);
}

/* ── Signals grid (Observability 101 slide) ──────────── */

.reveal .signals-grid {
  display: flex;
  gap: 2.5rem;
  margin: 0.5rem 0 1.5rem;
}

.reveal .signal-item {
  flex: 1;
  min-width: 0;
}

.reveal .signal-item h4 {
  margin-top: 0;
}

/* ── Title slide ─────────────────────────────────────── */

.reveal .slides section.slide-title {
  padding: 0;
}

/* ── Dense slide ─────────────────────────────────────── */

.reveal .slides section.slide-dense {
  font-size: 0.72em;
}

.reveal .slides section.slide-dense h1 { font-size: 2.8rem; }
.reveal .slides section.slide-dense h2 { font-size: 2.1rem; }
.reveal .slides section.slide-dense h3 { font-size: 1.75rem; }
.reveal .slides section.slide-dense h4 { font-size: 1.4rem; }

.reveal .slides section.slide-dense img {
  max-height: 26vh;
  width: auto;
}

.reveal .slides section.slide-dense h2 {
  margin-top: 0.65rem;
  margin-bottom: 0.2rem;
}

.reveal .slides section.slide-dense h3 {
  margin-top: 0.65rem;
  margin-bottom: 0.2rem;
}

.reveal .slides section.slide-dense li {
  margin-bottom: 0.25rem;
}

/* ── Disclaimer slide ────────────────────────────────── */

.reveal .slides section.slide-disclaimers p {
  margin-bottom: 2.2rem;
  line-height: 1.85;
  padding-left: 1rem;
  border-left: 2px solid var(--border);
  max-width: 80ch;
}

/* ── Image gallery (multi-image slides) ─────────────── */

.reveal .slides section .image-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  align-items: flex-start;
  margin: 0.5rem 0;
}

.reveal .slides section .image-gallery p {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
}

.reveal .slides section .image-gallery p img {
  max-height: 80vh;
  width: 100%;
  height: auto;
  margin: 0;
}

/* Slides with code blocks: keep images from overflowing */
.reveal .slides section:has(pre) img {
  max-height: 44vh;
  width: auto;
}

/* Slides with a heading below the image (caption/follow-up line):
   leave room so that text isn't pushed off the bottom of the slide */
.reveal .slides section:has(img):has(h2) img,
.reveal .slides section:has(img):has(h3) img {
  max-height: 56vh;
  width: auto;
}

/* Wide-image slides: stretch small images to fill the slide */
.reveal .slides section.slide-wide img {
  width: 90%;
  max-width: 90%;
}

/* ── Mermaid in slides ───────────────────────────────── */

/* Mermaid sizes foreignObject from generic metrics; IBM Plex Mono is ~10px taller,
   clipping the bottom of edge labels. Allow overflow so text isn't cut off. */
.reveal .mermaid-diagram svg .edgeLabel foreignObject {
  overflow: visible;
}

.reveal .mermaid-diagram {
  margin: 0.75rem auto;
  overflow: auto;
  max-height: 70vh;
  text-align: center;
}

.reveal .mermaid-diagram svg {
  max-width: 100%;
  max-height: 68vh;
  width: auto;
  height: auto;
  display: inline-block;
}

.reveal .controls {
  color: var(--fg);
}

.reveal .progress {
  background: var(--border);
  color: var(--fg);
}

.reveal .slide-background {
  background: var(--bg);
}

/* ── Docs view ───────────────────────────────────────── */

#docs-view {
  display: flex;
  height: 100%;
  overflow: hidden;
}

#docs-nav {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 1rem 0;
}

#docs-nav a {
  display: block;
  padding: 0.35rem 1rem;
  color: var(--fg);
  text-decoration: none;
  font-size: 0.8rem;
  border-left: 2px solid transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#docs-nav a:hover {
  border-left-color: var(--border);
}

#docs-nav a.active {
  border-left-color: var(--fg);
  font-weight: 700;
}

#docs-content {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 3rem;
  font-size: 0.9rem;
  line-height: 1.7;
}

#docs-content h1 { font-size: 1.4rem; margin-top: 0; margin-bottom: 0.5rem; }
#docs-content h2 { font-size: 1.15rem; margin-top: 2.25rem; margin-bottom: 0.5rem; }
#docs-content h3 { font-size: 1rem; margin-top: 1.5rem; margin-bottom: 0.4rem; }

#docs-content p { margin: 0 0 0.85rem; }

#docs-content ul,
#docs-content ol { margin: 0.25rem 0 0.85rem; padding-left: 1.75rem; }
#docs-content li { margin-bottom: 0.35rem; }

#docs-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.25rem 0;
  font-size: 0.85rem;
}

#docs-content th,
#docs-content td {
  border: 1px solid var(--border);
  padding: 0.4rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

#docs-content th { font-weight: 700; }

#docs-content tr:nth-child(even) td {
  background: rgba(128, 128, 128, 0.07);
}

#docs-content a {
  color: var(--fg);
}

#docs-content pre {
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  overflow-x: auto;
  font-size: 0.85rem;
  margin: 1.75rem 0;
}

.mermaid-diagram {
  margin: 1.75rem 0;
  overflow-x: auto;
}

.mermaid-diagram svg {
  max-width: 100%;
  height: auto;
  display: block;
}

#docs-content code {
  font-family: var(--font);
  font-size: 0.9em;
}

#docs-content pre code {
  border: none;
  padding: 0;
}

/* ── About view ──────────────────────────────────────── */

#about-view {
  overflow-y: auto;
  height: 100%;
}

#about-content {
  max-width: 72ch;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
  line-height: 1.75;
  font-size: 0.95rem;
}

#about-content h1 {
  font-size: 2rem;
  margin-bottom: 0.15rem;
  margin-top: 0;
}

#about-content .subtitle {
  font-size: 0.9rem;
  color: var(--border);
  margin-top: 0;
  margin-bottom: 2.5rem;
}

#about-content h2 {
  font-size: 1.1rem;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.25rem;
}

#about-content p {
  margin-bottom: 1rem;
}

#about-content dl {
  margin: 0;
}

#about-content dt {
  font-weight: 700;
  margin-top: 1.25rem;
}

#about-content dd {
  margin: 0.25rem 0 0 1.25rem;
  color: var(--fg);
  opacity: 0.85;
}

#about-content a {
  color: var(--fg);
}

#about-content ul {
  padding-left: 1.5rem;
}

#about-content li {
  margin-bottom: 0.3rem;
}

#about-content code {
  font-family: var(--font);
  font-size: 0.9em;
  border: 1px solid var(--border);
  padding: 0.1em 0.35em;
}

#about-content kbd {
  font-family: var(--font);
  font-size: 0.85em;
  border: 1px solid var(--border);
  padding: 0.1em 0.4em;
}

#dashboard-preview {
  display: block;
  margin-top: 2rem;
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--border);
}

/* ── Mobile ──────────────────────────────────────────── */

@media (max-width: 640px) {
  #site-nav {
    overflow-x: auto;
    scrollbar-width: none;
    gap: 1.25rem;
    padding: 0 1rem;
    font-size: 1rem;
  }

  #site-nav::-webkit-scrollbar { display: none; }

  #theme-toggle {
    margin-left: 1.25rem;
    flex-shrink: 0;
  }

  #docs-view {
    flex-direction: column;
  }

  #docs-nav {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0;
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    white-space: nowrap;
    height: auto;
    flex-shrink: 0;
  }

  #docs-nav a {
    display: inline-block;
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: 0.25rem 0.75rem;
    white-space: nowrap;
    overflow: visible;
  }

  #docs-nav a.active {
    border-left-color: transparent;
    border-bottom-color: var(--fg);
  }

  #docs-content {
    padding: 1rem;
  }
}
