/* ============================================================
   DATA ENGINEERING 101 — SLIDE DESIGN SYSTEM
   "High-End Editorial Intelligence"
   Design: Luxury business journal meets high-performance terminal.
   ============================================================ */

/* === DESIGN TOKENS === */
:root {
  /* Surfaces */
  --bg:              #131314;
  --surface-low:     #1b1b1c;
  --surface-high:    #2a2a2b;
  --surface-highest: #353436;
  --surface-bright:  #39393a;

  /* Accent */
  --primary:         #61ddef;
  --primary-end:     #3ec1d3;
  --on-primary:      #131314;
  --primary-10:      rgba(97, 221, 239, 0.10);
  --primary-15:      rgba(97, 221, 239, 0.15);
  --primary-30:      rgba(97, 221, 239, 0.30);

  /* Text */
  --text:            #e5e2e3;
  --text-muted:      #9ca3af;
  --outline:         #3d494b;
  --outline-15:      rgba(61, 73, 75, 0.15);

  /* Semantic */
  --danger:          #ff5f56;
  --danger-10:       rgba(255, 95, 86, 0.10);
  --danger-25:       rgba(255, 95, 86, 0.25);
  --warning:         #ffbd2e;
  --warning-10:      rgba(255, 189, 46, 0.10);
  --success:         #27c93f;
  --success-10:      rgba(39, 201, 63, 0.10);
  --success-25:      rgba(39, 201, 63, 0.25);

  /* Typography */
  --font-display:    'Space Grotesk', sans-serif;
  --font-body:       'Work Sans', sans-serif;
  --font-label:      'Inter', sans-serif;
  --font-mono:       'JetBrains Mono', monospace;

  /* Type scale — all clamp() for responsive */
  --size-display-lg: clamp(2rem, 5.5vw, 3.5rem);
  --size-display-md: clamp(1.7rem, 4.5vw, 3rem);
  --size-headline-lg: clamp(1.5rem, 3.5vw, 2.5rem);
  --size-headline-md: clamp(1.3rem, 2.8vw, 2rem);
  --size-title-lg:   clamp(1.1rem, 2.2vw, 1.5rem);
  --size-title-md:   clamp(1rem, 1.8vw, 1.25rem);
  --size-body-lg:    clamp(0.9rem, 1.5vw, 1.125rem);
  --size-body-md:    clamp(0.82rem, 1.3vw, 1rem);
  --size-label-lg:   clamp(0.72rem, 1.1vw, 0.875rem);
  --size-label-md:   clamp(0.65rem, 0.95vw, 0.75rem);
  --size-label-sm:   clamp(0.58rem, 0.8vw, 0.6875rem);

  /* Spacing */
  --slide-pad:       clamp(1.5rem, 4.5vw, 4.5rem);
  --gap-sm:          clamp(0.4rem, 0.8vw, 0.75rem);
  --gap-md:          clamp(0.75rem, 1.5vw, 1.5rem);
  --gap-lg:          clamp(1.25rem, 2.5vw, 2.5rem);
  --gap-xl:          clamp(2rem, 4vw, 4rem);

  /* Radius */
  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  16px;
  --r-xl:  24px;
}

/* === BASE RESET === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* === SLIDE SYSTEM === */
html {
  height: 100%;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  height: 100%;
}

/* Global geometric grid overlay — "Machine" aesthetic */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg,  transparent, transparent 59px, rgba(97,221,239,0.03) 59px, rgba(97,221,239,0.03) 60px),
    repeating-linear-gradient(90deg, transparent, transparent 59px, rgba(97,221,239,0.03) 59px, rgba(97,221,239,0.03) 60px);
  pointer-events: none;
  z-index: 0;
}

/* Each slide = exact viewport */
.slide {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  scroll-snap-align: start;
  display: none;
  flex-direction: column;
  position: relative;
  background: var(--bg);
}

.slide.active {
  display: flex;
}

/* Centered content wrapper */
.slide-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--slide-pad);
  max-height: 100%;
  overflow: hidden;
  position: relative;
  z-index: 1;
  gap: var(--gap-md);
}

.slide-content.top {
  justify-content: flex-start;
  padding-top: clamp(1.5rem, 5vh, 4rem);
}

/* === PROGRESS BAR === */
#progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--primary-end));
  transition: width 0.4s cubic-bezier(.4,0,.2,1);
  z-index: 9999;
  box-shadow: 0 0 12px rgba(97,221,239,0.5);
}

/* === SLIDE COUNTER === */
#slide-counter {
  position: fixed;
  bottom: clamp(0.75rem, 2vh, 1.25rem);
  right: clamp(1rem, 3vw, 2.5rem);
  font-family: var(--font-label);
  font-size: var(--size-label-sm);
  color: var(--surface-highest);
  letter-spacing: 0.08em;
  z-index: 9999;
}

/* === NAV DOTS === */
#nav-dots {
  position: fixed;
  bottom: clamp(0.75rem, 2vh, 1.25rem);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  z-index: 9999;
}

.nav-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--surface-highest);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: all 0.3s ease;
}

.nav-dot.active {
  background: var(--primary);
  box-shadow: 0 0 6px rgba(97,221,239,0.6);
  width: 18px;
  border-radius: 3px;
}

/* === TYPOGRAPHY UTILITIES === */
.display-lg {
  font-family: var(--font-display);
  font-size: var(--size-display-lg);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--text);
}

.display-md {
  font-family: var(--font-display);
  font-size: var(--size-display-md);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
}

.headline-lg {
  font-family: var(--font-display);
  font-size: var(--size-headline-lg);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
}

.headline-md {
  font-family: var(--font-display);
  font-size: var(--size-headline-md);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text);
}

.title-lg {
  font-family: var(--font-body);
  font-size: var(--size-title-lg);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

.title-md {
  font-family: var(--font-body);
  font-size: var(--size-title-md);
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}

.body-lg {
  font-family: var(--font-body);
  font-size: var(--size-body-lg);
  font-weight: 400;
  line-height: 1.7;
  color: var(--text);
}

.body-md {
  font-family: var(--font-body);
  font-size: var(--size-body-md);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-muted);
}

.label-lg {
  font-family: var(--font-label);
  font-size: var(--size-label-lg);
  font-weight: 500;
  line-height: 1.4;
}

.label-md {
  font-family: var(--font-label);
  font-size: var(--size-label-md);
  font-weight: 500;
  line-height: 1.4;
}

.label-sm {
  font-family: var(--font-label);
  font-size: var(--size-label-sm);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

.accent {
  color: var(--primary);
}

.muted {
  color: var(--text-muted);
}

.danger-text {
  color: var(--danger);
}

.success-text {
  color: var(--success);
}

.warning-text {
  color: var(--warning);
}

/* === GLOW BLOBS === */
.g-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.2; }
  50%       { opacity: 0.45; }
}

@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(20px, -15px) scale(1.04); }
  66%       { transform: translate(-12px, 10px) scale(0.97); }
}

.g-blob {
  animation: glowPulse 5s ease-in-out infinite, blobFloat 14s ease-in-out infinite;
}

/* === COMPONENT: SECTION BADGE === */
.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  background: var(--primary-10);
  border: 1px solid var(--primary-30);
  color: var(--primary);
  font-family: var(--font-label);
  font-size: var(--size-label-sm);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.3em 0.9em;
  border-radius: var(--r-sm);
  width: fit-content;
}

/* === COMPONENT: H-RULE === */
.h-rule {
  height: 1px;
  background: linear-gradient(90deg, var(--primary-30), rgba(97,221,239,0.1), transparent);
  flex-shrink: 0;
}

/* === COMPONENT: S-LIST (styled bullet list) === */
.s-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
}

.s-list li {
  font-family: var(--font-body);
  font-size: var(--size-body-md);
  line-height: 1.5;
  color: var(--text-muted);
  padding-left: 1.4em;
  position: relative;
}

.s-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-size: 0.85em;
  top: 0.1em;
}

.s-list.success li::before { color: var(--success); }
.s-list.danger li::before  { color: var(--danger); }
.s-list.warning li::before { color: var(--warning); }

.s-list li strong {
  color: var(--text);
  font-weight: 600;
}

/* === COMPONENT: REVEAL STEPS === */
.reveal-steps {
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
  position: relative;
}

/* Connecting line between steps */
.reveal-steps::before {
  content: '';
  position: absolute;
  left: clamp(14px, 2.2vw, 22px);
  top: clamp(28px, 4vh, 44px);
  bottom: clamp(28px, 4vh, 44px);
  width: 1px;
  background: linear-gradient(to bottom, var(--primary-30), transparent);
}

.step {
  display: flex;
  align-items: flex-start;
  gap: var(--gap-md);
}

.step-number {
  flex-shrink: 0;
  width: clamp(28px, 4vw, 44px);
  height: clamp(28px, 4vw, 44px);
  background: var(--primary-10);
  border: 1px solid var(--primary-30);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: var(--size-label-md);
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0;
  position: relative;
  z-index: 1;
}

.step-content {
  padding-top: clamp(2px, 0.5vh, 6px);
  flex: 1;
}

.step-title {
  font-family: var(--font-body);
  font-size: var(--size-title-md);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.2em;
}

.step-desc {
  font-family: var(--font-body);
  font-size: var(--size-body-md);
  color: var(--text-muted);
  line-height: 1.5;
}

/* === COMPONENT: SPLIT PANEL === */
.split-panel {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--gap-lg);
  align-items: stretch;
  max-height: min(65vh, 560px);
}

.panel {
  background: var(--surface-low);
  border-radius: var(--r-lg);
  padding: clamp(1rem, 2.5vw, 2rem);
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
}

.panel-right {
  background: var(--surface-high);
}

.panel-label {
  color: var(--primary);
  margin-bottom: 0.3em;
}

.panel-right .panel-label {
  color: var(--success);
}

.panel-title {
  font-family: var(--font-display);
  font-size: var(--size-headline-md);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.panel-divider {
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--outline), transparent);
  align-self: stretch;
}

/* === COMPONENT: ICON GRID === */
.icon-grid {
  display: grid;
  gap: var(--gap-md);
}

.icon-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.icon-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.icon-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.i-card {
  background: var(--surface-low);
  border-radius: var(--r-md);
  padding: clamp(0.75rem, 1.8vw, 1.25rem);
  border: 1px solid var(--outline-15);
  transition: border-color 0.3s ease;
}

.i-card:hover {
  border-color: var(--primary-30);
}

.i-card.accent-top  { border-top: 2px solid var(--primary); }
.i-card.danger-top  { border-top: 2px solid var(--danger); }
.i-card.success-top { border-top: 2px solid var(--success); }
.i-card.warning-top { border-top: 2px solid var(--warning); }

.i-card-icon {
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  margin-bottom: 0.4em;
  line-height: 1;
}

.i-card-title {
  font-family: var(--font-body);
  font-size: var(--size-title-md);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25em;
}

.i-card-desc {
  font-family: var(--font-body);
  font-size: var(--size-body-md);
  color: var(--text-muted);
  line-height: 1.5;
}

/* === COMPONENT: STAT BLOCK === */
.stat-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--gap-lg);
}

.stat-number {
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 7rem);
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  letter-spacing: -0.03em;
}

.stat-label {
  font-family: var(--font-display);
  font-size: var(--size-headline-md);
  font-weight: 600;
  color: var(--text);
  margin-top: 0.25em;
}

.stat-context {
  font-family: var(--font-body);
  font-size: var(--size-body-md);
  color: var(--text-muted);
  margin-top: 0.3em;
}

/* === COMPONENT: FLOW DIAGRAM === */
.flow-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.5rem, 1.5vw, 1.5rem);
  flex-wrap: nowrap;
}

.flow-box {
  background: var(--surface-low);
  border: 1px solid var(--outline-15);
  border-radius: var(--r-md);
  padding: clamp(0.6rem, 1.5vw, 1.2rem) clamp(0.8rem, 2vw, 1.5rem);
  text-align: center;
  flex: 1;
  max-width: clamp(130px, 20vw, 220px);
}

.flow-box.accent-box {
  background: var(--primary-10);
  border-color: var(--primary-30);
}

.flow-box-label {
  font-family: var(--font-label);
  font-size: var(--size-label-sm);
  color: var(--primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.3em;
}

.flow-box-title {
  font-family: var(--font-display);
  font-size: var(--size-title-md);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.3em;
}

.flow-box-items {
  list-style: none;
}

.flow-box-items li {
  font-family: var(--font-body);
  font-size: var(--size-label-md);
  color: var(--text-muted);
  line-height: 1.4;
}

.flow-arrow {
  font-size: clamp(1rem, 2vw, 1.5rem);
  color: var(--primary);
  flex-shrink: 0;
}

.flow-arrow-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2em;
}

.flow-arrow-label {
  font-family: var(--font-label);
  font-size: var(--size-label-sm);
  color: var(--text-muted);
  white-space: nowrap;
}

/* === COMPONENT: TERMINAL BLOCK === */
.terminal-block {
  background: #0d1117;
  border: 1px solid var(--outline-15);
  border-radius: var(--r-md);
  overflow: hidden;
  max-height: min(45vh, 320px);
}

/* Inside a code-step: expand to fill available height instead of capping */
.code-step .terminal-block {
  max-height: none;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.5em 0.9em;
  background: var(--surface-low);
  border-bottom: 1px solid var(--outline-15);
}

.t-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.t-dot.red    { background: var(--danger); }
.t-dot.yellow { background: var(--warning); }
.t-dot.green  { background: var(--success); }

.t-title {
  font-family: var(--font-mono);
  font-size: var(--size-label-md);
  color: var(--text-muted);
  margin-left: 0.5em;
}

.terminal-body {
  padding: clamp(0.75rem, 1.5vw, 1.25rem);
  overflow: auto;
  max-height: min(38vh, 270px);
}

/* Inside a code-step: flex-grow fills remaining space, no artificial cap */
.code-step .terminal-body {
  flex: 1;
  max-height: none;
  min-height: 0;
}

.terminal-body code {
  font-family: var(--font-mono);
  font-size: var(--size-label-lg);
  color: var(--text);
  line-height: 1.65;
  white-space: pre;
  display: block;
}

/* Syntax colours */
.t-keyword { color: #ff7b72; }
.t-string  { color: #a5d6ff; }
.t-comment { color: #6e7681; font-style: italic; }
.t-fn      { color: var(--primary); }
.t-num     { color: var(--warning); }

/* === COMPONENT: COMPARISON TABLE === */
.cmp-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--size-body-md);
}

.cmp-tbl th {
  background: var(--primary-10);
  color: var(--primary);
  font-family: var(--font-label);
  font-size: var(--size-label-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.5em 0.85em;
  text-align: left;
  border-bottom: 1px solid var(--primary-30);
}

.cmp-tbl td {
  padding: 0.45em 0.85em;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text-muted);
  line-height: 1.4;
  vertical-align: top;
}

.cmp-tbl tr:nth-child(odd)  td { background: rgba(255,255,255,0.012); }
.cmp-tbl tr:nth-child(even) td { background: rgba(255,255,255,0.025); }
.cmp-tbl tr:hover td { background: var(--primary-10); }
.cmp-tbl td:first-child { color: var(--text); font-weight: 600; white-space: nowrap; }
.cmp-tbl .acc   { color: var(--primary); font-weight: 600; }
.cmp-tbl .acc-g { color: var(--success); font-weight: 600; }
.cmp-tbl .acc-r { color: var(--danger);  font-weight: 600; }
.cmp-tbl .acc-y { color: var(--warning); font-weight: 600; }

/* === COMPONENT: TIMELINE === */
.timeline {
  display: flex;
  align-items: flex-start;
  gap: 0;
  position: relative;
  width: 100%;
}

.timeline::before {
  content: '';
  position: absolute;
  top: clamp(16px, 2.5vw, 24px);
  left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--primary-30), var(--primary-30));
}

.tl-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-sm);
  padding: 0 clamp(0.3rem, 1vw, 0.75rem);
}

.tl-dot {
  width: clamp(28px, 4vw, 40px);
  height: clamp(28px, 4vw, 40px);
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: var(--size-label-md);
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.tl-dot.filled {
  background: var(--primary-10);
}

.tl-content {
  text-align: center;
}

.tl-title {
  font-family: var(--font-body);
  font-size: var(--size-title-md);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.2em;
}

.tl-desc {
  font-family: var(--font-body);
  font-size: var(--size-label-md);
  color: var(--text-muted);
  line-height: 1.4;
}

/* === COMPONENT: QUOTE BLOCK === */
.quote-block {
  max-width: min(80vw, 800px);
  margin: 0 auto;
  text-align: center;
}

.quote-mark {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 6rem);
  color: var(--primary);
  line-height: 0.5;
  opacity: 0.3;
  margin-bottom: 0.5em;
  display: block;
}

.quote-text {
  font-family: var(--font-display);
  font-size: var(--size-headline-lg);
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-style: italic;
}

.quote-attr {
  font-family: var(--font-body);
  font-size: var(--size-body-md);
  color: var(--text-muted);
  margin-top: 1em;
}

/* === COMPONENT: HIERARCHY TREE === */
.hierarchy-tree {
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
}

.h-node {
  display: flex;
  align-items: center;
  gap: 0.75em;
}

.h-node.level-1 { padding-left: clamp(1rem, 3vw, 2rem); }
.h-node.level-2 { padding-left: clamp(2rem, 6vw, 4rem); }
.h-node.level-3 { padding-left: clamp(3rem, 9vw, 6rem); }

.h-dot {
  width: clamp(8px, 1.2vw, 12px);
  height: clamp(8px, 1.2vw, 12px);
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.h-dot.accent  { background: var(--primary); box-shadow: 0 0 6px rgba(97,221,239,0.4); }
.h-dot.success { background: var(--success); }
.h-dot.danger  { background: var(--danger); }
.h-dot.warning { background: var(--warning); }

.h-label {
  font-family: var(--font-body);
  font-size: var(--size-body-md);
  color: var(--text);
  line-height: 1.4;
}

.h-label strong {
  color: var(--text);
  font-weight: 600;
}

/* === COMPONENT: BANNERS === */
.tip-banner, .warn-banner, .info-banner, .danger-banner {
  border-radius: var(--r-md);
  padding: 0.55em 1.1em;
  font-family: var(--font-body);
  font-size: var(--size-body-md);
  font-weight: 600;
  line-height: 1.5;
}

.tip-banner {
  background: var(--success-10);
  border: 1px solid var(--success-25);
  color: var(--success);
}

.warn-banner {
  background: var(--warning-10);
  border: 1px solid rgba(255,189,46,0.25);
  color: var(--warning);
}

.info-banner {
  background: var(--primary-10);
  border: 1px solid var(--primary-30);
  color: var(--primary);
}

.danger-banner {
  background: var(--danger-10);
  border: 1px solid var(--danger-25);
  color: var(--danger);
}

/* === COMPONENT: TWO-COLUMN LAYOUT === */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-lg);
  align-items: start;
}

.two-col.center { align-items: center; }

/* === COMPONENT: STATEMENT CARD === */
.statement-card {
  background: var(--surface-low);
  border: 1px solid var(--outline-15);
  border-left: 3px solid var(--primary);
  border-radius: var(--r-md);
  padding: clamp(0.75rem, 2vw, 1.5rem);
}

.statement-card.danger-border  { border-left-color: var(--danger); }
.statement-card.success-border { border-left-color: var(--success); }
.statement-card.warning-border { border-left-color: var(--warning); }

/* === COMPONENT: DATA GRID CELL (for showing table data) === */
.d-grid {
  display: grid;
  gap: 2px;
  background: var(--surface-low);
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--outline-15);
}

.d-cell {
  padding: 0.3em 0.5em;
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--size-label-md);
  background: rgba(255,255,255,0.02);
  color: var(--text-muted);
}

.d-cell.hdr {
  background: var(--primary-10);
  color: var(--primary);
  font-weight: 700;
  font-family: var(--font-label);
  font-size: var(--size-label-sm);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.d-cell.highlight { background: rgba(97,221,239,0.12); color: var(--primary); }
.d-cell.dim       { color: var(--surface-highest); }
.d-cell.row-hi    { background: rgba(247,129,102,0.16); border-color: rgba(247,129,102,0.35); color: #f78166; }
.d-cell.col-hi    { background: rgba(57,211,83,0.14); border-color: rgba(57,211,83,0.3); color: #39d353; }

/* === COMPONENT: PILL / TAG === */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  background: var(--surface-high);
  color: var(--text-muted);
  font-family: var(--font-label);
  font-size: var(--size-label-sm);
  font-weight: 500;
  padding: 0.25em 0.7em;
  border-radius: 100px;
}

.tag.accent  { background: var(--primary-10); color: var(--primary); border: 1px solid var(--primary-30); }
.tag.success { background: var(--success-10); color: var(--success); }
.tag.danger  { background: var(--danger-10);  color: var(--danger); }

/* === SLIDE TEMPLATES: TITLE SLIDE === */
.title-slide-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: var(--slide-pad);
  position: relative;
  z-index: 1;
  gap: var(--gap-md);
}

/* === SLIDE TEMPLATES: SECTION OPENER === */
.section-opener {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: var(--slide-pad);
  position: relative;
  z-index: 1;
  gap: var(--gap-sm);
}

/* === SLIDE TEMPLATES: FULL STATEMENT === */
.full-statement {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--slide-pad);
  text-align: center;
  position: relative;
  z-index: 1;
  gap: var(--gap-md);
}

/* === ANIMATIONS === */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(28px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes growIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

.slide.active .anim-1 { animation: fadeUp 0.5s cubic-bezier(.22,1,.36,1) 0.08s  both; }
.slide.active .anim-2 { animation: fadeUp 0.5s cubic-bezier(.22,1,.36,1) 0.2s   both; }
.slide.active .anim-3 { animation: fadeUp 0.5s cubic-bezier(.22,1,.36,1) 0.32s  both; }
.slide.active .anim-4 { animation: fadeUp 0.5s cubic-bezier(.22,1,.36,1) 0.44s  both; }
.slide.active .anim-5 { animation: fadeUp 0.5s cubic-bezier(.22,1,.36,1) 0.56s  both; }
.slide.active .anim-6 { animation: fadeUp 0.5s cubic-bezier(.22,1,.36,1) 0.68s  both; }
.slide.active .anim-fade { animation: fadeIn 0.7s ease 0.1s both; }
.slide.active .anim-grow { animation: growIn 0.5s cubic-bezier(.22,1,.36,1) 0.1s both; }

/* === RESPONSIVE: Short viewports === */
@media (max-height: 700px) {
  :root {
    --slide-pad: clamp(1rem, 3.5vw, 3rem);
    --gap-md: clamp(0.5rem, 1.2vw, 1rem);
    --gap-lg: clamp(0.75rem, 1.8vw, 1.75rem);
  }
}

@media (max-height: 600px) {
  :root {
    --slide-pad: clamp(0.75rem, 3vw, 2rem);
    --gap-md: clamp(0.4rem, 1vw, 0.75rem);
    --size-display-lg: clamp(1.4rem, 4vw, 2.5rem);
    --size-display-md: clamp(1.3rem, 3.5vw, 2rem);
    --size-headline-lg: clamp(1.1rem, 2.8vw, 1.75rem);
  }

  #nav-dots { display: none; }
}

@media (max-height: 500px) {
  :root {
    --slide-pad: clamp(0.5rem, 2.5vw, 1.5rem);
    --size-display-lg: clamp(1.2rem, 3.5vw, 2rem);
    --size-body-md: clamp(0.7rem, 1.1vw, 0.85rem);
  }
  #slide-counter { display: none; }
}

/* === RESPONSIVE: Narrow viewports === */
@media (max-width: 700px) {
  .split-panel {
    grid-template-columns: 1fr;
  }
  .panel-divider { display: none; }
  .icon-grid.cols-3,
  .icon-grid.cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .two-col {
    grid-template-columns: 1fr;
  }
  .flow-diagram {
    flex-direction: column;
    align-items: stretch;
  }
  .flow-box {
    max-width: 100%;
  }
  .timeline {
    flex-direction: column;
  }
  .timeline::before { display: none; }
}

/* === COMPONENT: COPY BUTTON === */
.copy-btn {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--outline-15);
  color: var(--text-muted);
  font-family: var(--font-label);
  font-size: var(--size-label-sm);
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.2em 0.65em;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.copy-btn:hover {
  border-color: var(--primary-30);
  color: var(--primary);
}
.copy-btn.copied {
  color: var(--success);
  border-color: var(--success-25);
}

/* === COMPONENT: CODE STEP (left context, right code) === */
.code-step {
  display: grid;
  grid-template-columns: 1fr 1.7fr;
  gap: var(--gap-lg);
  align-items: stretch;
  flex: 1;          /* grow to fill remaining slide height */
  min-height: 0;    /* allow shrinking below content size */
}

.code-step-explain {
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
  justify-content: center; /* vertically centre left column content */
}

.step-badge {
  display: inline-flex;
  align-items: center;
  background: var(--primary-10);
  border: 1px solid var(--primary-30);
  color: var(--primary);
  font-family: var(--font-label);
  font-size: var(--size-label-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25em 0.75em;
  border-radius: var(--r-sm);
  width: fit-content;
}

/* === COMPONENT: MEDALLION STACK === */
.medallion-stack {
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
  width: 100%;
  max-width: min(700px, 90vw);
  margin: 0 auto;
}

.medallion-layer {
  border-radius: var(--r-md);
  padding: clamp(0.75rem, 1.8vw, 1.25rem) clamp(1rem, 2.5vw, 2rem);
  display: flex;
  align-items: center;
  gap: var(--gap-md);
}

.medallion-layer.bronze { background: rgba(205, 127, 50, 0.12); border: 1px solid rgba(205, 127, 50, 0.3); }
.medallion-layer.silver { background: rgba(192, 192, 192, 0.10); border: 1px solid rgba(192, 192, 192, 0.25); }
.medallion-layer.gold   { background: rgba(255, 189, 46, 0.10);  border: 1px solid rgba(255, 189, 46, 0.3); }

.medallion-dot {
  width: clamp(10px, 1.5vw, 16px);
  height: clamp(10px, 1.5vw, 16px);
  border-radius: 50%;
  flex-shrink: 0;
}
.bronze .medallion-dot { background: rgb(205, 127, 50); }
.silver .medallion-dot { background: rgb(192, 192, 192); }
.gold   .medallion-dot { background: var(--warning); }

.medallion-name {
  font-family: var(--font-display);
  font-size: var(--size-title-lg);
  font-weight: 700;
  min-width: clamp(70px, 8vw, 100px);
}
.bronze .medallion-name { color: rgb(205, 127, 50); }
.silver .medallion-name { color: rgb(192, 192, 192); }
.gold   .medallion-name { color: var(--warning); }

.medallion-desc {
  font-family: var(--font-body);
  font-size: var(--size-body-md);
  color: var(--text-muted);
  flex: 1;
}

/* === COMPONENT: PIPELINE DIAGRAM === */
.pipeline-diagram {
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
  width: 100%;
}

.pipeline-row {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
}

.pipeline-box {
  background: var(--surface-low);
  border: 1px solid var(--outline-15);
  border-radius: var(--r-sm);
  padding: 0.4em 0.8em;
  font-family: var(--font-mono);
  font-size: var(--size-label-md);
  color: var(--text-muted);
  white-space: nowrap;
}

.pipeline-box.source  { border-color: var(--primary-30); color: var(--primary); }
.pipeline-box.bronze  { border-color: rgba(205,127,50,0.3); color: rgb(205,127,50); }
.pipeline-box.silver  { border-color: rgba(192,192,192,0.25); color: rgb(192,192,192); }
.pipeline-box.gold    { border-color: rgba(255,189,46,0.3); color: var(--warning); }

.pipeline-arrow {
  color: var(--text-muted);
  font-size: var(--size-label-lg);
  flex-shrink: 0;
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.15s !important;
  }
  html { scroll-behavior: auto; }
  .g-blob { animation: none; }
}
