/* ── Berkeley Mono ── */
@font-face {
  font-family: 'Berkeley Mono';
  src: local('Berkeley Mono'),
       url('vendor/fonts/BerkeleyMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'Berkeley Mono';
  src: local('Berkeley Mono Bold'),
       url('vendor/fonts/BerkeleyMono-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
}

/* ── Tokyo Night palette ── */
:root {
  --tn-bg:        #1a1b2e;
  --tn-bg2:       #16213e;
  --tn-surface:   #0f3460;
  --tn-fg:        #a9b1d6;
  --tn-fg-bright: #c0caf5;
  --tn-comment:   #565f89;
  --tn-blue:      #7aa2f7;
  --tn-cyan:      #7dcfff;
  --tn-green:     #9ece6a;
  --tn-yellow:    #e0af68;
  --tn-orange:    #ff9e64;
  --tn-red:       #f7768e;
  --tn-purple:    #bb9af7;
  --tn-magenta:   #ff007c;

  /* macOS traffic lights */
  --mac-close:    #ff5f57;
  --mac-min:      #febc2e;
  --mac-max:      #28c840;
}

/* ── Global reset ── */
.reveal-viewport { background: var(--tn-bg) !important; }

.reveal {
  font-family: 'Berkeley Mono', 'Menlo', 'Consolas', monospace !important;
  color: var(--tn-fg) !important;
  background: transparent !important;
}

/* CRT scanline overlay on the entire viewport */
.reveal-viewport::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0,0,0,0.08) 3px,
    rgba(0,0,0,0.08) 4px
  );
}

/* Subtle vignette */
.reveal-viewport::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.55) 100%);
}

/* ── Slides base ── */
.reveal .slides section {
  text-align: left;
  padding: 0 !important;
  height: 100%;
  display: flex !important;
  flex-direction: column;
}

/* ── macOS terminal window ── */
.terminal-window {
  background: rgba(15, 16, 30, 0.97);
  border: 1px solid rgba(122, 162, 247, 0.2);
  border-radius: 10px;
  overflow: hidden;
  box-shadow:
    0 32px 80px rgba(0,0,0,0.7),
    0 0 0 1px rgba(255,255,255,0.04),
    inset 0 1px 0 rgba(255,255,255,0.06);
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Title bar */
.terminal-titlebar {
  background: linear-gradient(180deg, #2a2c3e 0%, #1e2030 100%);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(122,162,247,0.12);
  flex-shrink: 0;
  position: relative;
}

.terminal-titlebar .dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.dot-close  { background: var(--mac-close);  box-shadow: 0 0 4px rgba(255,95,87,0.4); }
.dot-min    { background: var(--mac-min);    box-shadow: 0 0 4px rgba(254,188,46,0.4); }
.dot-max    { background: var(--mac-max);    box-shadow: 0 0 4px rgba(40,200,64,0.4); }

.terminal-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Berkeley Mono', monospace;
  font-size: 0.55rem;
  color: var(--tn-comment);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Terminal body */
.terminal-body {
  padding: 6px 36px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
  position: relative;
}

/* ── Prompt prefix ── */
.prompt {
  color: var(--tn-green);
  font-size: 0.75rem;
  padding: 28px 36px 0;
  display: block;
  letter-spacing: 0.02em;
  opacity: 0.7;
  flex-shrink: 0;
}
.prompt::after { content: ' $'; color: var(--tn-comment); }

/* ── Typography ── */
.reveal h1, .reveal h2, .reveal h3 {
  font-family: 'Berkeley Mono', monospace !important;
  text-transform: none !important;
  letter-spacing: -0.02em;
}

.reveal h1 {
  font-size: 2.4rem !important;
  color: var(--tn-blue) !important;
  line-height: 1.15 !important;
  font-weight: 700 !important;
  text-shadow: 0 0 40px rgba(122,162,247,0.25);
}

.reveal h2 {
  font-size: 1.6rem !important;
  color: var(--tn-cyan) !important;
  font-weight: 700 !important;
  margin-bottom: 0.6em !important;
}

.reveal h3 {
  font-size: 1.0rem !important;
  color: var(--tn-yellow) !important;
  font-weight: 400 !important;
  margin-bottom: 0.8em !important;
}

.reveal p {
  font-size: 0.9rem !important;
  line-height: 1.7 !important;
  color: var(--tn-fg) !important;
  margin: 0 0 0.7em !important;
}

.reveal ul, .reveal ol {
  margin: 0 0 0.8em 0 !important;
  padding-left: 1.2em !important;
}

.reveal li {
  font-size: 0.88rem !important;
  line-height: 1.75 !important;
  color: var(--tn-fg) !important;
  margin-bottom: 0.25em !important;
  list-style: none !important;
  position: relative;
  padding-left: 0.2em;
}

.reveal li::before {
  content: '▸';
  color: var(--tn-blue);
  position: absolute;
  left: -1.1em;
  font-size: 0.8em;
}

/* ── Inline code ── */
.reveal code {
  font-family: 'Berkeley Mono', monospace !important;
  background: rgba(122,162,247,0.1) !important;
  color: var(--tn-cyan) !important;
  padding: 0.1em 0.35em !important;
  border-radius: 3px !important;
  font-size: 0.9em !important;
  border: 1px solid rgba(122,162,247,0.15) !important;
}

/* ── Code blocks ── */
.reveal pre {
  width: 100% !important;
  margin: 0.5em 0 !important;
  border-radius: 6px !important;
  overflow: hidden !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5) !important;
  border: 1px solid rgba(122,162,247,0.15) !important;
}

.reveal pre code {
  background: #0d0e1a !important;
  color: var(--tn-fg) !important;
  padding: 1em 1.2em !important;
  font-size: 0.72rem !important;
  line-height: 1.65 !important;
  border: none !important;
  border-radius: 0 !important;
  display: block !important;
  overflow-x: auto !important;
}

/* ── Accent / highlight spans ── */
.hi-blue   { color: var(--tn-blue) !important; }
.hi-cyan   { color: var(--tn-cyan) !important; }
.hi-green  { color: var(--tn-green) !important; }
.hi-yellow { color: var(--tn-yellow) !important; }
.hi-orange { color: var(--tn-orange) !important; }
.hi-red    { color: var(--tn-red) !important; }
.hi-purple { color: var(--tn-purple) !important; }
.hi-dim    { color: var(--tn-comment) !important; }

/* ── Two-column layout ── */
.cols {
  display: grid;
  gap: 12px;
}
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ── Callout box ── */
.callout {
  border-left: 3px solid var(--tn-blue);
  background: rgba(122,162,247,0.06);
  padding: 12px 16px;
  border-radius: 0 6px 6px 0;
  margin: 0.2em 0;
}
.callout.green  { border-color: var(--tn-green);  background: rgba(158,206,106,0.06); }
.callout.yellow { border-color: var(--tn-yellow); background: rgba(224,175,104,0.06); }
.callout.red    { border-color: var(--tn-red);    background: rgba(247,118,142,0.06); }
.callout p { margin: 0 !important; font-size: 0.85rem !important; }
.callout p.icon-line { display: flex; align-items: flex-start; gap: 0.5em; }

/* ── Big stat / number ── */
.big-stat {
  font-size: 4rem;
  color: var(--tn-blue);
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 0 60px rgba(122,162,247,0.4);
  display: block;
  margin-bottom: 0.15em;
}

/* ── Divider ── */
.rule {
  border: none;
  border-top: 1px solid rgba(122,162,247,0.15);
  margin: 1em 0;
}

/* ── Tag / badge ── */
.tag {
  display: inline-block;
  background: rgba(122,162,247,0.12);
  border: 1px solid rgba(122,162,247,0.25);
  color: var(--tn-blue);
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 3px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: middle;
  margin-left: 8px;
}
.tag.green  { background: rgba(158,206,106,0.12); border-color: rgba(158,206,106,0.25); color: var(--tn-green); }
.tag.yellow { background: rgba(224,175,104,0.12); border-color: rgba(224,175,104,0.25); color: var(--tn-yellow); }

/* ── ASCII diagram / loop box ── */
.loop-diagram {
  font-family: 'Berkeley Mono', monospace;
  font-size: 0.72rem;
  color: var(--tn-fg);
  background: #0d0e1a;
  border: 1px solid rgba(122,162,247,0.2);
  border-radius: 6px;
  padding: 1.2em 1.6em;
  line-height: 1.8;
  white-space: pre;
}

/* ── Footer strip ── */
.slide-footer {
  padding: 8px 36px 10px;
  border-top: 1px solid rgba(122,162,247,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.55rem;
  color: var(--tn-comment);
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

/* ── Title slide extras ── */
.title-eyebrow {
  font-size: 0.65rem;
  color: var(--tn-comment);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 0.5em;
  display: block;
}

.title-sub {
  font-size: 1.0rem !important;
  color: var(--tn-purple) !important;
  margin-top: 0.4em !important;
}

.blink {
  animation: blink-cursor 1.1s step-end infinite;
}
@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── Reveal overrides ── */
.reveal .progress { background: rgba(122,162,247,0.15) !important; }
.reveal .progress span { background: var(--tn-blue) !important; }

.reveal .controls button { color: var(--tn-blue) !important; }

.reveal .slide-number {
  font-family: 'Berkeley Mono', monospace !important;
  font-size: 0.6rem !important;
  background: transparent !important;
  color: var(--tn-comment) !important;
}

/* fragment fade */
.reveal .fragment { opacity: 0; transition: opacity 0.3s ease; }
.reveal .fragment.visible { opacity: 1; }

/* ── Slide content fade (chrome stays) ── */
/* Non-present bodies and titles are forced invisible.                  */
/* On becoming .present an animation always re-fires from opacity 0→1, */
/* which is more reliable than transitions (no stale intermediate       */
/* values). Terminal-title is included because it changes per slide.    */
.reveal .slides section:not(.present) .terminal-body,
.reveal .slides section:not(.present) .terminal-title {
  opacity: 0 !important;
}
.reveal .slides section.present .terminal-body,
.reveal .slides section.present .terminal-title {
  animation: content-fade-in 0.12s ease forwards;
}
@keyframes content-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Side-by-side code comparison ── */
.code-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.code-compare-label {
  font-size: 0.6rem;
  color: var(--tn-comment);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}


/* ── Diff highlight ── */
.diff-same { opacity: 0.45; }
.diff-diff { color: var(--tn-yellow) !important; opacity: 1; }

/* ── Terminal body variants ── */
.terminal-body.centered {
  justify-content: center;
  gap: 0;
}

/* ── Title slide type treatments ── */
.title-tagline {
  font-size: 0.8rem !important;
  color: var(--tn-comment) !important;
  margin-top: 0.2em !important;
}

.nav-hint {
  font-size: 0.7rem !important;
  color: var(--tn-comment) !important;
  margin: 0 !important;
}

/* ── Column section header ── */
.col-header {
  font-size: 0.75rem !important;
  color: var(--tn-comment) !important;
  letter-spacing: 0.08em;
  margin-bottom: 0.4em !important;
}

/* ── Shell prompt display line (end of takeaway slide) ── */
.shell-line {
  margin-top: 1em !important;
  font-size: 0.82rem !important;
  color: var(--tn-comment) !important;
}

/* ── Foreground colour accent ── */
.hi-fg { color: var(--tn-fg) !important; }

/* ── Smaller code block for tight two-column layouts ── */
.reveal pre.sm code {
  font-size: 0.62rem !important;
}

/* ── Compact loop diagram (tall diagrams on dense slides) ── */
.loop-diagram.compact {
  line-height: 1.4;
  font-size: 0.68rem;
}

/* ── Hero loop diagram (takeaway slide) ── */
.loop-diagram.hero {
  font-size: 0.8rem;
  padding-left: 3em;
  margin: 0.6em 0 1em;
}

/* ── Callout inside a code-compare panel (tighter margin) ── */
.code-compare .callout {
  margin-top: 8px;
}
