/* === Design Tokens === */
:root {
  --bg: #16191B;
  --amber: #D4A853;
  --text: #F5F2ED;
  --muted: rgba(245, 242, 237, 0.5);
  --dim: rgba(245, 242, 237, 0.15);
  --teal: #5B8A8A;
  --font: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'Space Mono', monospace;
  --slide-transition: 400ms ease-out;
  --content-max: 68rem;
  --lesson-max: 920px;
  --slide-x: clamp(2rem, 8vw, 7rem);
  --slide-top: clamp(5.5rem, 11vh, 7.5rem);
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Structural grid overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    repeating-linear-gradient(
      to right,
      rgba(245, 242, 237, 0.02) 0px,
      rgba(245, 242, 237, 0.02) 1px,
      transparent 1px,
      transparent 40px
    ),
    repeating-linear-gradient(
      to bottom,
      rgba(245, 242, 237, 0.02) 0px,
      rgba(245, 242, 237, 0.02) 1px,
      transparent 1px,
      transparent 40px
    );
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, black 0%, rgba(0,0,0,0.15) 60%, rgba(0,0,0,0.05) 100%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, black 0%, rgba(0,0,0,0.15) 60%, rgba(0,0,0,0.05) 100%);
  pointer-events: none;
  z-index: 0;
}

/* Film grain texture */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
  opacity: 0.035;
  pointer-events: none;
  z-index: 0;
}

/* === Slide Container === */
.deck {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.slide {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  justify-items: center;
  gap: 1rem;
  padding: clamp(2rem, 6vw, 5rem);
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
  overflow-y: auto;
  text-align: center;
}

.slide--active {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}

/* --- Transitions --- */
.slide--enter {
  animation: slideFadeIn 180ms ease-out forwards;
}

.slide--exit-left {
  opacity: 0;
  z-index: 0;
}

.slide--exit-right {
  opacity: 0;
  z-index: 0;
}

.slide--enter-right {
  opacity: 0;
}

.slide--enter-left {
  opacity: 0;
}

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

/* === Typography === */
.slide__title {
  font-size: clamp(1.75rem, 2.85vw, 2.15rem);
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 0;
  color: var(--text);
  line-height: 1.05;
  text-align: center;
  max-width: var(--lesson-max);
  text-wrap: balance;
}

.slide__subtitle {
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--muted);
  margin-bottom: 2rem;
  max-width: min(760px, 100%);
  text-align: center;
  text-wrap: balance;
}

/* === Shared Content Slide System === */
.slide:not(.title-slide):not(#chapter-fundamentals):not(#chapter-exercises):not(#conclusion) {
  align-content: center;
  justify-items: center;
  padding: clamp(3rem, 7vw, 5rem) clamp(2rem, 6vw, 5rem);
}

.slide:not(.title-slide):not(#chapter-fundamentals):not(#chapter-exercises):not(#conclusion) > .slide__title,
.slide:not(.title-slide):not(#chapter-fundamentals):not(#chapter-exercises):not(#conclusion) > .slide__subtitle,
.slide:not(.title-slide):not(#chapter-fundamentals):not(#chapter-exercises):not(#conclusion) > .method-ledger,
.slide:not(.title-slide):not(#chapter-fundamentals):not(#chapter-exercises):not(#conclusion) > .definition-list,
.slide:not(.title-slide):not(#chapter-fundamentals):not(#chapter-exercises):not(#conclusion) > .definition-cards,
.slide:not(.title-slide):not(#chapter-fundamentals):not(#chapter-exercises):not(#conclusion) > .ranked-list,
.slide:not(.title-slide):not(#chapter-fundamentals):not(#chapter-exercises):not(#conclusion) > .exercise-card,
.slide:not(.title-slide):not(#chapter-fundamentals):not(#chapter-exercises):not(#conclusion) > .prompt-block,
.slide:not(.title-slide):not(#chapter-fundamentals):not(#chapter-exercises):not(#conclusion) > .pipeline-flow,
.slide:not(.title-slide):not(#chapter-fundamentals):not(#chapter-exercises):not(#conclusion) > .download-layout,
.slide:not(.title-slide):not(#chapter-fundamentals):not(#chapter-exercises):not(#conclusion) > .concept-grid,
.slide:not(.title-slide):not(#chapter-fundamentals):not(#chapter-exercises):not(#conclusion) > .evidence-pipeline,
.slide:not(.title-slide):not(#chapter-fundamentals):not(#chapter-exercises):not(#conclusion) > .fact-grid,
.slide:not(.title-slide):not(#chapter-fundamentals):not(#chapter-exercises):not(#conclusion) > .fact-limit {
  width: 100%;
  max-width: var(--lesson-max);
  margin-inline: auto;
}

.slide:not(.title-slide):not(#chapter-fundamentals):not(#chapter-exercises):not(#conclusion) > .slide__title {
  text-align: center;
  font-size: clamp(1.75rem, 2.85vw, 2.15rem);
  line-height: 1.06;
  margin-bottom: clamp(1.2rem, 3vh, 2rem);
}

.slide:not(.title-slide):not(#chapter-fundamentals):not(#chapter-exercises):not(#conclusion) > .slide__subtitle {
  text-align: center;
  font-size: clamp(1rem, 1.35vw, 1.18rem);
  line-height: 1.45;
  margin-bottom: clamp(1.2rem, 3vh, 2rem);
  max-width: min(760px, 100%);
}

#desktop-agent > .slide__title {
  max-width: 760px;
}

/* === Title Slide === */
.title-slide {
  text-align: center;
  overflow: hidden;
  justify-content: center;
  gap: 0.75rem;
}

.hero-wordmark svg { width: min(420px, 40vw); height: auto; color: var(--text); }
.tagline-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.title-slide .tagline {
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  max-width: 40rem;
}

/* === Chapter Divider Slide === */
.chapter-divider {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6rem;
}

.chapter-divider__ghost {
  display: none;
}

.chapter-divider__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
  max-width: 56rem;
}

.chapter-divider__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}

.chapter-divider__label {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--amber);
  opacity: 0.7;
}

.chapter-divider__title {
  font-size: 3rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: 0;
  max-width: 44rem;
}

.chapter-divider__subtitle {
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--muted);
  max-width: 34rem;
  text-align: center;
  line-height: 1.5;
}

/* Chapter divider title + subtitle appear instantly — redact-reveal handles text */
.chapter-divider__title.anim,
.chapter-divider__subtitle.anim {
  opacity: 1;
  transform: translateY(0);
  transition: none;
}

/* === Conclusion Slide === */
#conclusion {
  overflow: hidden;
}

#conclusion .scan-field {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 0;
}

#conclusion .scan-field__origin-dot,
#conclusion .scan-field__origin-line {
  display: none;
}

.conclusion {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -40px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.5rem;
}

.conclusion__signal {
  margin-bottom: 0.5rem;
}

.conclusion__email {
  font-size: 1.45rem;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.conclusion__email:hover {
  text-decoration: underline;
}

.conclusion__links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.conclusion__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--dim);
  border-radius: 8px;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.conclusion__link:hover {
  border-color: var(--amber);
  color: var(--text);
  background: rgba(212, 168, 83, 0.05);
}

.conclusion__link svg {
  color: var(--amber);
}

/* === Chapter Bar === */
.chapter-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  height: 32px;
}

.chapter-segment {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  cursor: pointer;
}

.chapter-segment__label {
  font-family: 'Space Mono', monospace;
  font-size: 0.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.3s ease;
}

.chapter-segment--future .chapter-segment__label { color: rgba(245, 242, 237, 0.15); }
.chapter-segment--past .chapter-segment__label { color: rgba(212, 168, 83, 0.4); }
.chapter-segment--active .chapter-segment__label { color: var(--amber); }

.chapter-segment__track {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(245, 242, 237, 0.06);
}

.chapter-segment__fill {
  height: 100%;
  width: 0%;
  border-radius: 0 1px 1px 0;
  transition: width 0.4s ease-out, background 0.3s ease;
}

.chapter-segment--past .chapter-segment__fill {
  width: 100%;
  background: rgba(212, 168, 83, 0.3);
}

.chapter-segment--active .chapter-segment__fill {
  background: var(--amber);
  box-shadow: 0 0 8px rgba(212, 168, 83, 0.5);
}

.chapter-segment--future .chapter-segment__fill {
  width: 0%;
  background: transparent;
}

/* ===========================
   CLI-Specific Components
   =========================== */

/* --- Card Grid --- */
.card-grid {
  display: grid;
  gap: 1.2rem;
  max-width: 56rem;
  width: 100%;
}

.card-grid--3 { grid-template-columns: repeat(3, 1fr); }
.card-grid--4 {
  grid-template-columns: repeat(4, 1fr);
  max-width: 64rem;
}
.card-grid--center { justify-content: center; margin-left: auto; margin-right: auto; }

@media (max-width: 900px) {
  .card-grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .card-grid--4 { grid-template-columns: 1fr; }
}

/* --- Generic Content Card --- */
.content-card {
  padding: 1.4rem;
  border: 1px solid var(--dim);
  border-radius: 12px;
  background: rgba(245, 242, 237, 0.03);
}

.content-card__icon {
  color: var(--amber);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(212, 168, 83, 0.08);
}

.content-card__title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.content-card__desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
}

/* --- Tool Card (prerequisites) --- */
.tool-card {
  padding: 1.8rem 1.4rem;
  border: 1px solid var(--dim);
  border-radius: 12px;
  background: rgba(245, 242, 237, 0.03);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.tool-card:hover {
  border-color: var(--amber);
  background: rgba(212, 168, 83, 0.05);
  transform: translateY(-2px);
}

.tool-card__logo {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-card__logo svg {
  width: 48px;
  height: 48px;
}

.tool-card__name {
  font-weight: 700;
  font-size: 1.1rem;
}

.tool-card__badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--amber);
  padding: 0.25rem 0.6rem;
  border: 1px solid rgba(212, 168, 83, 0.3);
  border-radius: 6px;
}

/* --- Pipeline Flow (Spotlight orchestrator) --- */
.pipeline-flow {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: var(--content-max);
  width: 100%;
  margin: 0 auto;
  justify-content: flex-start;
  flex-wrap: wrap;
}
.pipeline-node {
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--dim);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(245, 242, 237, 0.03);
}
.pipeline-node--accent {
  border-color: var(--amber);
  color: var(--amber);
  background: rgba(212, 168, 83, 0.08);
}
.pipeline-arrow {
  color: var(--muted);
  font-size: 1.2rem;
}
.pipeline-loop {
  display: flex;
  align-items: center;
  gap: 0;
}
.pipeline-loop__nodes {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: stretch;
}
.pipeline-loop__arrows {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  color: var(--muted);
}
.pipeline-loop__arrows svg {
  color: var(--muted);
}
@media (max-width: 768px) {
  .pipeline-flow { flex-direction: column; }
}

/* --- Command Table --- */
.cmd-table {
  width: 100%;
  max-width: 48rem;
  border-collapse: collapse;
}

.cmd-table tr {
  border-bottom: 1px solid rgba(245, 242, 237, 0.06);
}

.cmd-table tr:last-child {
  border-bottom: none;
}

.cmd-table td {
  padding: 0.6rem 0.75rem;
  vertical-align: top;
}

.cmd-table__cmd {
  font-family: 'Space Mono', monospace;
  font-size: 0.9rem;
  color: var(--amber);
  white-space: nowrap;
  width: 1%;
}

.cmd-table__desc {
  font-size: 0.9rem;
  color: var(--muted);
}

/* --- Code Block --- */
.code-block {
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(245, 242, 237, 0.08);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: var(--amber);
  max-width: 48rem;
  width: 100%;
  line-height: 1.6;
  margin-top: 0.75rem;
}

.code-block__comment {
  color: rgba(245, 242, 237, 0.35);
}

.code-block__prompt {
  color: rgba(245, 242, 237, 0.5);
  user-select: none;
}

/* --- QR Container --- */
.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.qr-container svg {
  border-radius: 12px;
}

/* --- Exercise Card --- */
.exercise-card {
  padding: 1.4rem 1.6rem 1.5rem;
  border: 1px solid var(--dim);
  border-radius: 12px;
  background: rgba(245, 242, 237, 0.025);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) 1px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  column-gap: 1.6rem;
  row-gap: 0.85rem;
  text-align: left;
  align-items: start;
}

.exercise-card__header {
  grid-column: 1 / 2;
  grid-row: 1 / 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}

.exercise-card__badge {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--amber);
  background: transparent;
  padding: 0;
  border-radius: 0;
  white-space: nowrap;
}

.exercise-card__title {
  font-weight: 700;
  font-size: 1.45rem;
  line-height: 1.15;
  color: var(--text);
  text-wrap: balance;
}

.exercise-card__desc {
  grid-column: 1 / 2;
  grid-row: 2 / 3;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.55;
  max-width: 32rem;
  margin: 0;
}

.exercise-card::before {
  content: '';
  grid-column: 2 / 3;
  grid-row: 1 / 3;
  width: 1px;
  height: 100%;
  background: var(--dim);
  opacity: 0.6;
}

.exercise-card__tasks {
  grid-column: 3 / 4;
  grid-row: 1 / 3;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  counter-reset: task;
}

.exercise-card__tasks li {
  font-size: 0.92rem;
  color: var(--text);
  padding-left: 2.1rem;
  position: relative;
  line-height: 1.4;
  counter-increment: task;
}

.exercise-card__tasks li::before {
  content: counter(task, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--amber);
  opacity: 0.85;
  background: none;
  width: auto;
  height: auto;
  border-radius: 0;
  letter-spacing: 0.05em;
}

.exercise-card__tasks li code {
  font-size: 0.85rem;
  color: var(--text);
  background: rgba(212, 168, 83, 0.08);
  padding: 0.05rem 0.35rem;
  border-radius: 3px;
}

/* --- Concept Cards (GitHub basics) --- */
.concept-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  max-width: 52rem;
  width: 100%;
}

.concept-grid--4 {
  grid-template-columns: repeat(4, 1fr);
  max-width: 64rem;
}

.concept-card {
  padding: 1.5rem;
  border: 1px solid var(--dim);
  border-radius: 12px;
  background: rgba(245, 242, 237, 0.03);
  text-align: center;
}

.concept-card__icon {
  color: var(--amber);
  margin-bottom: 0.75rem;
}

.concept-card__title {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}

.concept-card__desc {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}

.ranked-list {
  list-style: none;
  counter-reset: none;
  width: 100%;
  max-width: var(--lesson-max);
  margin: 0 auto;
  padding: 0 clamp(1rem, 2.4vw, 1.8rem);
  border-top: 1px solid var(--dim);
  border-bottom: 1px solid var(--dim);
  background: rgba(245, 242, 237, 0.018);
  text-align: left;
  box-sizing: border-box;
}

.ranked-item {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr);
  gap: 1.1rem;
  align-items: start;
  padding: 0.72rem 0;
  border-bottom: 1px solid rgba(245, 242, 237, 0.08);
}

.ranked-item:last-child {
  border-bottom: 0;
}

.ranked-item--accent .ranked-item__title {
  color: var(--amber);
}

.ranked-item__num {
  font-family: var(--font-mono);
  color: var(--amber);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.45;
  text-align: right;
}

.ranked-item__body {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.ranked-item__title {
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.28;
  overflow-wrap: normal;
}

.ranked-item__desc {
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.38;
  overflow-wrap: normal;
}

.slide--definitions {
  align-content: center;
  justify-items: center;
}

.slide--definitions .slide__title {
  width: 100%;
  max-width: var(--lesson-max);
  margin: 0 auto clamp(1.2rem, 3vh, 2rem);
  text-align: center;
}

.definition-cards {
  width: 100%;
  max-width: var(--lesson-max);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  text-align: left;
}

.definition-card {
  border: 1px solid var(--dim);
  background: rgba(245, 242, 237, 0.025);
  border-radius: 8px;
  padding: 1.05rem 1.15rem;
}

.definition-card--wide {
  grid-column: 1 / -1;
}

.definition-card span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 0.75rem;
}

.definition-card strong {
  display: block;
  color: var(--text);
  font-size: 1.02rem;
  line-height: 1.35;
  margin-bottom: 0.45rem;
}

.definition-card p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  margin: 0;
}

.definition-card--accent {
  border-color: rgba(212, 168, 83, 0.45);
}

.definition-list {
  width: 100%;
  max-width: var(--lesson-max);
  margin: 0 auto;
  padding: 0 clamp(1rem, 2.4vw, 1.8rem);
  border-top: 1px solid var(--dim);
  border-bottom: 1px solid var(--dim);
  background: rgba(245, 242, 237, 0.018);
  text-align: left;
  box-sizing: border-box;
}

.definition-row {
  display: grid;
  grid-template-columns: minmax(6.25rem, 7.5rem) minmax(0, 1fr);
  gap: 1.2rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid rgba(245, 242, 237, 0.08);
}

.definition-row:last-child {
  border-bottom: 0;
}

.definition-row span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  padding-top: 0.16rem;
}

.definition-row strong {
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 650;
  line-height: 1.36;
  max-width: none;
  overflow-wrap: normal;
}

.definition-row--accent strong {
  font-size: 1rem;
}

.method-ledger {
  width: 100%;
  max-width: var(--lesson-max);
  margin-inline: auto;
  padding: 0 clamp(1rem, 2.4vw, 1.8rem);
  border-top: 1px solid var(--dim);
  border-bottom: 1px solid var(--dim);
  background: rgba(245, 242, 237, 0.018);
  text-align: left;
  box-sizing: border-box;
}

.method-ledger--two {
  max-width: 50rem;
  margin-top: 1.4rem;
}

.method-ledger--compact {
  max-width: 56rem;
  margin-top: 1rem;
}

.method-ledger--compact .method-row {
  grid-template-columns: minmax(6.5rem, 8rem) minmax(0, 1fr);
  padding: 0.65rem 0.2rem;
}

.method-ledger--compact .method-row strong {
  font-size: 0.84rem;
}

.method-row {
  display: grid;
  grid-template-columns: minmax(6.25rem, 7.5rem) minmax(0, 1fr);
  gap: 1.2rem;
  align-items: baseline;
  padding: 0.86rem 0;
  border-bottom: 1px solid rgba(245, 242, 237, 0.08);
}

.method-row:last-child {
  border-bottom: 0;
}

.method-row span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
}

.method-row strong {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.36;
  max-width: none;
  overflow-wrap: normal;
}

.source-note {
  margin-top: 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: rgba(245, 242, 237, 0.38);
  text-align: center;
}

/* --- Agent Toggle --- */
.agent-toggle {
  max-width: 48rem;
  width: 100%;
}

.agent-toggle__tabs {
  display: flex;
  border-bottom: 1px solid var(--dim);
  margin-bottom: 1.5rem;
}

.agent-toggle__tab {
  flex: 1;
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.agent-toggle__tab:hover {
  color: var(--text);
}

.agent-toggle__tab--active {
  color: var(--amber);
  border-bottom-color: var(--amber);
}

.agent-toggle__panel {
  border: 1px solid var(--dim);
  border-radius: 12px;
  background: rgba(245, 242, 237, 0.03);
  padding: 1.5rem;
}

.agent-toggle__badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--amber);
  margin-bottom: 1rem;
}

.agent-toggle__cmd {
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(245, 242, 237, 0.08);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: var(--amber);
  line-height: 1.6;
}

/* --- Exercise QR --- */
.exercise-qr {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

.exercise-qr svg {
  border-radius: 8px;
  flex-shrink: 0;
}

.exercise-download {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.6rem 1.4rem;
  background: var(--amber);
  color: var(--bg);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.exercise-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(212, 168, 83, 0.3);
}

/* --- Prompt List (GitHub deploy) --- */
.prompt-list {
  max-width: 44rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.prompt-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 1.2rem;
  border: 1px solid var(--dim);
  border-radius: 10px;
  background: rgba(245, 242, 237, 0.02);
}

.prompt-item__number {
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--amber);
  background: rgba(212, 168, 83, 0.1);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.prompt-item__code {
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  color: var(--amber);
  line-height: 1.5;
  padding-top: 0.2rem;
}

/* --- Steps Callout (auth, pages setup) --- */
.steps-callout {
  max-width: 44rem;
  width: 100%;
  margin-top: 1.5rem;
  padding: 1.2rem 1.5rem;
  border: 1px solid var(--dim);
  border-radius: 12px;
  background: rgba(245, 242, 237, 0.03);
  text-align: left;
}

.steps-callout__title {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--amber);
  margin-bottom: 0.75rem;
}

.steps-callout__list {
  list-style: none;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0;
}

.steps-callout__list li {
  counter-increment: step;
  font-size: 0.85rem;
  color: var(--muted);
  padding-left: 2rem;
  position: relative;
  line-height: 1.5;
}

.steps-callout__list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--amber);
  background: rgba(212, 168, 83, 0.1);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  top: 0.1em;
}

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

/* --- Warning Callout --- */
.warning-callout {
  max-width: 44rem;
  width: 100%;
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  border: 1px solid rgba(212, 168, 83, 0.25);
  border-radius: 10px;
  background: rgba(212, 168, 83, 0.04);
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.warning-callout svg {
  flex-shrink: 0;
  color: var(--amber);
  margin-top: 0.1rem;
}

.warning-callout div {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

.warning-callout strong {
  color: var(--text);
  font-weight: 600;
}

.warning-callout code {
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  color: var(--amber);
  background: rgba(0, 0, 0, 0.3);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

/* --- Prompt Block (copyable prompt) --- */
.prompt-block {
  max-width: var(--content-max);
  width: 100%;
  margin-top: 0.75rem;
  position: relative;
}

.prompt-block::before {
  content: 'PROMPT À COPIER';
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--amber);
  opacity: 0.75;
  margin-bottom: 0.45rem;
}

.prompt-block__code {
  position: relative;
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(245, 242, 237, 0.08);
  border-radius: 10px;
  padding: 1rem 2.75rem 1rem 1.25rem;
  color: var(--amber);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.prompt-block__copy {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  background: rgba(245, 242, 237, 0.06);
  border: 1px solid rgba(245, 242, 237, 0.1);
  border-radius: 6px;
  padding: 0.35rem;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.prompt-block__copy:hover {
  color: var(--amber);
  border-color: rgba(212, 168, 83, 0.3);
  background: rgba(212, 168, 83, 0.08);
}

.prompt-block__copy--done {
  color: #6fcf97;
  border-color: rgba(111, 207, 151, 0.3);
}

/* --- Exercise Card (consistent width) --- */
.exercise-card {
  max-width: var(--lesson-max);
  width: 100%;
}

.prompt-block {
  max-width: var(--lesson-max);
  margin-top: 0.85rem;
  text-align: left;
}

.prompt-block__code {
  text-align: left;
}

/* --- GIF Background Slide --- */
.qa-slide__bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: 0.45;
}

/* --- Vibe Journalist Slide --- */
.vibe-journalist-slide {
  text-align: center;
  overflow: hidden;
}

.vibe-journalist__title {
  position: relative;
  z-index: 1;
  font-size: 3.1rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--text);
  line-height: 1.2;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.9), 0 0 60px rgba(0, 0, 0, 0.6);
}

.vibe-journalist__subtitle {
  position: relative;
  z-index: 1;
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--muted);
  margin-top: 1rem;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.8);
}

/* --- Stat Row (demo slides) --- */
.stat-row {
  display: flex;
  gap: 3rem;
  justify-content: center;
  max-width: 48rem;
  width: 100%;
}

.stat-item {
  text-align: center;
}

.stat-item__number {
  font-size: 3.6rem;
  font-weight: 700;
  color: var(--amber);
  line-height: 1;
}

.stat-item__label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.5rem;
  max-width: 10rem;
}

/* --- Database Link --- */
.database-link {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--amber);
  text-decoration: none;
  border: 1px solid rgba(212, 168, 83, 0.3);
  padding: 0.5rem 1.2rem;
  border-radius: 8px;
  transition: border-color 200ms, background 200ms;
}

.database-link:hover {
  border-color: var(--amber);
  background: rgba(212, 168, 83, 0.08);
}

/* --- Prompt Excerpt (methodology slide) --- */
.prompt-excerpt {
  max-width: 48rem;
  width: 100%;
}

.prompt-excerpt__label {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--amber);
  margin-bottom: 0.5rem;
}

.prompt-excerpt__code {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(245, 242, 237, 0.08);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  color: var(--text);
  line-height: 1.7;
  white-space: pre-wrap;
}

.prompt-excerpt__code strong {
  color: var(--amber);
  font-weight: 700;
}

/* --- Agent Toggle: desktop-app variant --- */
.agent-toggle__desc {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 1rem;
  opacity: 0.9;
}

.agent-toggle__steps {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.25rem;
}

.agent-toggle__step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.5;
}

.agent-toggle__step a {
  color: var(--amber);
  text-decoration: none;
  border-bottom: 1px solid rgba(212, 168, 83, 0.4);
}

.agent-toggle__step a:hover {
  border-bottom-color: var(--amber);
}

.agent-toggle__step-num {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border: 1px solid var(--amber);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--amber);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* --- Grounding Flow Diagram --- */
.grounding-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  max-width: 60rem;
  width: 100%;
  margin-bottom: 1.4rem;
}

.grounding-flow__node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--dim);
  border-radius: 12px;
  background: rgba(245, 242, 237, 0.03);
  min-width: 8rem;
}

.grounding-flow__node--accent {
  border-color: rgba(212, 168, 83, 0.5);
  background: rgba(212, 168, 83, 0.07);
}

.grounding-flow__icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(212, 168, 83, 0.1);
  color: var(--amber);
  display: flex;
  align-items: center;
  justify-content: center;
}

.grounding-flow__label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text);
  text-align: center;
}

.grounding-flow__node--accent .grounding-flow__label {
  color: var(--amber);
}

.grounding-flow__arrow {
  color: var(--amber);
  font-size: 1.4rem;
  font-weight: 700;
  opacity: 0.55;
}

.grounding-rules {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 56rem;
  width: 100%;
  margin-bottom: 1rem;
}

.grounding-rules__rule {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  border: 1px solid var(--dim);
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--text);
  background: rgba(245, 242, 237, 0.03);
}

.grounding-rules__num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--amber);
  letter-spacing: 0.1em;
}

/* --- Directory Tree --- */
.directory-tree {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(245, 242, 237, 0.08);
  border-radius: 10px;
  padding: 1.4rem 1.6rem;
  color: var(--text);
  line-height: 1.85;
  max-width: 44rem;
  width: 100%;
  white-space: pre-wrap;
  display: block;
}

.download-layout {
  display: grid;
  grid-template-columns: 18rem minmax(0, 1fr);
  gap: 1.5rem;
  align-items: stretch;
  width: 100%;
  max-width: var(--lesson-max);
  text-align: left;
}

.download-layout--simple {
  grid-template-columns: 17rem minmax(0, 30rem);
  justify-content: center;
  align-items: center;
}

.download-side {
  display: grid;
  gap: 1rem;
  align-self: center;
  justify-items: start;
  text-align: left;
}

.download-qr {
  border: 1px solid var(--dim);
  border-radius: 12px;
  background: rgba(245, 242, 237, 0.03);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.25rem;
}

.download-qr img {
  width: 13rem;
  height: 13rem;
  background: #fff;
  padding: 0.5rem;
  border-radius: 8px;
}

.download-qr--large img {
  width: 14rem;
  height: 14rem;
}

.download-qr a {
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.steps-callout--download {
  margin: 0;
  align-self: center;
  text-align: left;
}

.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 15rem;
  justify-self: start;
  border: 1px solid var(--amber);
  border-radius: 8px;
  background: var(--amber);
  color: #18130f;
  font-weight: 800;
  text-decoration: none;
  padding: 0.9rem 1.15rem;
  line-height: 1;
  box-shadow: 0 18px 44px rgba(214, 145, 71, 0.16);
}

.download-button:hover,
.download-button:focus-visible {
  background: #f0b36d;
  border-color: #f0b36d;
}

.directory-tree--compact {
  max-width: none;
  height: 100%;
  margin: 0;
  font-size: 0.78rem;
}

.directory-tree__path {
  display: block;
  color: var(--amber);
  font-weight: 700;
  margin-bottom: 0.45rem;
}

.directory-tree__line {
  display: block;
}

.directory-tree__dir {
  color: var(--amber);
}

.directory-tree__file {
  color: var(--text);
}

.directory-tree__comment {
  color: rgba(245, 242, 237, 0.35);
  font-style: italic;
}

.directory-caption {
  font-size: 0.95rem;
  color: var(--muted);
  text-align: center;
  margin-top: 1rem;
  max-width: 44rem;
}

/* --- Beat Compare (manual vs cron) --- */
.beat-compare {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1.5rem;
  align-items: stretch;
  max-width: 56rem;
  width: 100%;
}

.beat-compare__col {
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--dim);
  border-radius: 12px;
  background: rgba(245, 242, 237, 0.03);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.beat-compare__col--after {
  border-color: rgba(212, 168, 83, 0.45);
  background: rgba(212, 168, 83, 0.05);
}

.beat-compare__label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
}

.beat-compare__col--after .beat-compare__label {
  color: var(--amber);
}

.beat-compare__title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

.beat-compare__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.beat-compare__list li {
  font-size: 0.85rem;
  color: var(--muted);
  padding-left: 1rem;
  position: relative;
  line-height: 1.5;
}

.beat-compare__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber);
  opacity: 0.5;
}

.beat-compare__list code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--amber);
}

.beat-compare__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--amber);
  opacity: 0.6;
}

/* --- Beat Output (terminal-style) --- */
.beat-output {
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(245, 242, 237, 0.08);
  border-radius: 10px;
  max-width: 44rem;
  width: 100%;
  margin-top: 1rem;
  overflow: hidden;
}

.beat-output__path {
  background: rgba(212, 168, 83, 0.08);
  border-bottom: 1px solid rgba(212, 168, 83, 0.2);
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  color: var(--amber);
}

.beat-output__body {
  padding: 1rem 1.2rem;
  font-size: 0.78rem;
  color: var(--text);
  line-height: 1.7;
  white-space: pre-wrap;
}

.beat-output__body strong {
  color: var(--amber);
  font-weight: 700;
}

.beat-output__flag {
  color: var(--teal);
  font-weight: 700;
}

.beat-footnote {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  margin-top: 1rem;
  max-width: 44rem;
}

.beat-footnote a {
  color: var(--amber);
  text-decoration: none;
  border-bottom: 1px solid rgba(212, 168, 83, 0.4);
}

.beat-footnote a:hover {
  border-bottom-color: var(--amber);
}

/* --- Spotlight Start Flow --- */
.spotlight-start-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.spotlight-start-flow__step {
  padding: 0.5rem 1rem;
  border: 1px solid var(--dim);
  border-radius: 8px;
  background: rgba(245, 242, 237, 0.03);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text);
}

.spotlight-start-flow__step--cycle {
  border-color: rgba(212, 168, 83, 0.5);
  background: rgba(212, 168, 83, 0.08);
  color: var(--amber);
  font-weight: 700;
}

.spotlight-start-flow__sep {
  color: var(--amber);
  opacity: 0.55;
}

/* === Evidence Pipeline (scraping / parsing / OCR → grounding) === */
.evidence-pipeline {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.25rem;
  text-align: left;
}

.evidence-pipeline__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.evidence-pipeline__label--accent { color: var(--amber); }

.evidence-pipeline__cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.evidence-pipeline__arrow {
  display: flex;
  justify-content: center;
  color: var(--amber);
  opacity: 0.7;
  margin: -0.25rem 0;
}

.evidence-pipeline__arrow svg { width: 26px; height: 26px; }

.evidence-pipeline__output { width: 100%; }

.evidence-card {
  border: 1px solid var(--dim);
  background: rgba(245, 242, 237, 0.025);
  border-radius: 10px;
  padding: 0.95rem 1.05rem 1.05rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 100%;
}

.evidence-card__head {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  margin-bottom: 0.15rem;
}

.evidence-card__num {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  opacity: 0.7;
}

.evidence-card__tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
}

.evidence-card__lede {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.evidence-card__desc {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--muted);
}

.evidence-card--accent {
  border-color: rgba(212, 168, 83, 0.45);
  background: linear-gradient(180deg, rgba(212, 168, 83, 0.06), rgba(212, 168, 83, 0.02));
  padding: 1.1rem 1.3rem 1.2rem;
}

.evidence-card--accent .evidence-card__lede {
  font-size: 1.12rem;
  color: var(--text);
}

.evidence-card--accent .evidence-card__desc {
  font-size: 0.94rem;
  color: rgba(245, 242, 237, 0.78);
  max-width: 50rem;
}

/* === Fact Grid (reusable card grid for fundamentals) === */
.fact-grid {
  display: grid;
  gap: 0.95rem;
  text-align: left;
  width: 100%;
}

.fact-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fact-grid--2x2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.fact-card {
  border: 1px solid var(--dim);
  background: rgba(245, 242, 237, 0.025);
  border-radius: 10px;
  padding: 1rem 1.15rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.fact-card__head {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  margin-bottom: 0.15rem;
}

.fact-card__num {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  opacity: 0.7;
}

.fact-card__tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
}

.fact-card__lede {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  text-wrap: balance;
}

.fact-card__desc {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--muted);
}

.fact-limit {
  margin-top: 1rem;
  border-left: 2px solid var(--amber);
  background: rgba(212, 168, 83, 0.04);
  padding: 0.85rem 1.1rem;
  border-radius: 0 6px 6px 0;
  display: flex;
  gap: 1rem;
  align-items: baseline;
  text-align: left;
}

.fact-limit__tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  flex-shrink: 0;
}

.fact-limit__body {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
}

/* === Responsive === */
@media (max-width: 768px) {
  .slide { padding: 2rem 1.5rem; }
  .slide__title { font-size: 2.2rem; }
  .slide__subtitle { font-size: 1.05rem; }
  .title-slide .tagline { font-size: 1.35rem; }
  .chapter-divider__title { font-size: 2.2rem; }
  .chapter-divider__subtitle { font-size: 1rem; }
  .card-grid--3 { grid-template-columns: 1fr; }
  .concept-grid { grid-template-columns: 1fr; }
  .ranked-item { grid-template-columns: 2rem 1fr; }
  .conclusion__links { flex-direction: column; align-items: center; }
  .chapter-divider { padding: 0 2rem; }
  .exercise-qr { flex-direction: column; align-items: center; text-align: center; }
  .agent-toggle__tabs { flex-direction: column; }
  .stat-row { flex-direction: column; gap: 1.5rem; }
  .beat-compare { grid-template-columns: 1fr; }
  .beat-compare__arrow { transform: rotate(90deg); }
  .grounding-flow__arrow { transform: rotate(90deg); }
  .grounding-flow { flex-direction: column; }
  .download-layout { grid-template-columns: 1fr; }
  .download-button { width: 100%; }
  .definition-row { grid-template-columns: 1fr; gap: 0.35rem; }
  .method-row { grid-template-columns: 1fr; gap: 0.35rem; }
  .method-ledger--compact .method-row { grid-template-columns: 1fr; }
  .evidence-pipeline__cards { grid-template-columns: 1fr; }
  .fact-grid--3, .fact-grid--2x2 { grid-template-columns: 1fr; }
  .fact-limit { flex-direction: column; gap: 0.4rem; }
}

@media (max-width: 480px) {
  .slide { padding: 1.5rem 1rem; }
  .chapter-divider { padding: 0 1.5rem 2.5rem; }
  .slide__title { font-size: 1.8rem; }
  .chapter-divider__title { font-size: 1.8rem; }
}
