/* ============================================================
   .s-agents-md — Act 4 opener.
   "Encode project-specific knowledge."

   Step 0 — Knowledge:
     A real AGENTS.md excerpt (fabric8 K8s client) with three
     annotated gems: canonical command, operational gotcha, CI
     reproduction. The audience reads the artifact, not bullets.

   Step 1 — Rituals (tell-then-show on the canonical command):
     The AGENTS.md panel collapses to its top section and the
     callouts dim. A Makefile / build.gradle.kts side-by-side
     reveals below — the same `quick-build` ritual in two
     dialects — followed by an agent-invocation caption.

   Theme: light slide. Code artifacts (AGENTS.md panel, Makefile,
   Gradle) stay dark terminals so they read as files, not text
   blocks. Same idiom as s-code.light.
   ============================================================ */

/* The .light class on the section pulls in cream bg + navy ink
   via light-overrides.css; chrome rails inherit shared.css. */

/* Faint dotted grid — atmosphere only */
.s-agents-md::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--grid) 1.2px, transparent 1.4px);
  background-size: 44px 44px;
  pointer-events: none;
  z-index: 0;
}

/* ============================================================
   Body grid — header / stage / tagline
   ============================================================ */
.s-agents-md .body {
  position: absolute;
  inset: 56px 0 56px 0;
  z-index: 1;
  padding: 36px var(--pad-x) 28px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  row-gap: 24px;
}

/* === Header === */
.s-agents-md .head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  column-gap: 48px;
}
.s-agents-md .head .eyebrow {
  grid-column: 1;
  font-family: 'JetBrains Mono', monospace;
  font-size: 20px;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  color: var(--accent-ink);
  margin-bottom: 14px;
}
.s-agents-md .head .title {
  grid-column: 1;
  font-size: 64px;
  line-height: 1.06;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0;
  color: var(--fg);
}
.s-agents-md .head .title em {
  font-style: normal;
  color: var(--accent);
}
.s-agents-md .head .sub {
  grid-column: 2;
  margin: 0 0 8px 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 20px;
  line-height: 1.45;
  color: var(--fg-dim);
  text-align: right;
}
.s-agents-md .head .sub .t-readme { color: var(--fg-mute); }
.s-agents-md .head .sub .t-agents { color: var(--accent-ink); font-weight: 600; }
.s-agents-md .head .sub .arrow { color: var(--fg-mute); margin: 0 6px; }

/* ============================================================
   Stage — 2-col grid:
     col1 = AGENTS.md panel (left) + Makefile (bottom-left)
     col2 = callouts (right) + Gradle (bottom-right)
   The cmd-pair + caption are zero-height on step 0 and reveal
   on step 1; the AGENTS.md panel compresses at the same time.
   ============================================================ */
.s-agents-md .stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  grid-template-areas:
    "agents callouts"
    "make   gradle"
    "cap    cap";
  column-gap: 40px;
  row-gap: 22px;
  align-items: stretch;
}

/* ---------- AGENTS.md panel ----------
   Dark terminal-style panel on the cream slide. Same idiom as
   s-code.light. All in-panel colors are pinned explicitly so they
   don't pick up the light theme's navy ink overrides. */
.s-agents-md .agents-panel {
  grid-area: agents;
  background: #060D3A;
  border: 1px solid rgba(10, 21, 84, 0.22);
  border-radius: 10px;
  overflow: hidden;
  box-shadow:
    0 24px 60px rgba(10, 21, 84, 0.20),
    0 4px 12px rgba(10, 21, 84, 0.10);
  display: flex;
  flex-direction: column;
  align-self: start;
}

.s-agents-md .agents-panel .panel-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 14px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  color: #8A93BC;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.s-agents-md .agents-panel .panel-bar .dot {
  width: 11px; height: 11px; border-radius: 50%;
}
.s-agents-md .agents-panel .panel-bar .dot.r { background: #FF5F57; }
.s-agents-md .agents-panel .panel-bar .dot.y { background: #FEBC2E; }
.s-agents-md .agents-panel .panel-bar .dot.g { background: #28C840; }
.s-agents-md .agents-panel .panel-bar .path { margin-left: 14px; color: #B4BAD8; }

.s-agents-md .agents-panel .panel-body {
  padding: 22px 30px 26px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  line-height: 1.45;
  color: #C8CCE4;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}
.s-agents-md .ln { display: block; }
.s-agents-md .ln.md-h {
  color: var(--cyan);
  font-weight: 600;
  margin-top: 6px;
}
.s-agents-md .ln.md-h:first-child { margin-top: 0; }
.s-agents-md .ln.dim { color: rgba(200,204,228,0.55); }
.s-agents-md .ln.sep { height: 12px; }
.s-agents-md .ln.gem { color: #FFFFFF; }
.s-agents-md .ln .lit {
  color: var(--orange-soft);
  background: rgba(225, 99, 9, 0.14);
  border: 1px solid rgba(225, 99, 9, 0.32);
  border-radius: 4px;
  padding: 1px 6px;
}
.s-agents-md .ln .hot { color: var(--pink); font-weight: 600; }

/* On step 1, the rows below the first section collapse out.
   Single beat: opacity and max-height share one ease + duration.
   No staged delays — the line fades AND collapses as one motion. */
.s-agents-md .ln.fade-step-1 {
  transition:
    opacity 350ms cubic-bezier(.2,.7,.2,1),
    max-height 350ms cubic-bezier(.2,.7,.2,1);
  max-height: 60px;
  overflow: hidden;
}
.s-agents-md[data-step="1"] .ln.fade-step-1 {
  opacity: 0;
  max-height: 0;
}

/* ---------- Annotation callouts (right rail, step 0) ---------- */
.s-agents-md .callouts {
  grid-area: callouts;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 14px;
  transition: opacity 350ms cubic-bezier(.2,.7,.2,1);
}
.s-agents-md[data-step="1"] .callouts {
  opacity: 0.50;
}
.s-agents-md .callouts .co {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 14px;
  row-gap: 4px;
  padding: 16px 20px;
  background: #FFFFFF;                         /* lift card off the cream paper */
  border: 1px solid rgba(10, 21, 84, 0.16);
  border-left: 3px solid var(--accent-ink);    /* the colored gem stripe */
  border-radius: 8px;
  position: relative;
  box-shadow:
    0 8px 18px rgba(10, 21, 84, 0.10),
    0 2px 4px rgba(10, 21, 84, 0.06);
}
.s-agents-md .callouts .co::before {
  /* leader tick toward the AGENTS.md panel */
  content: "";
  position: absolute;
  left: -20px;
  top: 50%;
  width: 20px;
  height: 1px;
  background: rgba(10, 21, 84, 0.30);
}
.s-agents-md .callouts .co .num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--accent-ink);
  align-self: baseline;
  padding-top: 4px;
}
.s-agents-md .callouts .co .lbl {
  font-size: 24px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.005em;
  line-height: 1.1;
}
.s-agents-md .callouts .co .d {
  grid-column: 2;
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  color: var(--fg-dim);
  line-height: 1.34;
  letter-spacing: 0.01em;
}
.s-agents-md .callouts .co.co-2 {
  /* the laugh-line callout gets the orange accent stripe so it
     visually pops out of the cyan family. */
  border-left-color: var(--accent-2-ink);
}
.s-agents-md .callouts .co.co-2::before { background: rgba(160, 71, 7, 0.45); }
.s-agents-md .callouts .co.co-2 .num { color: var(--accent-2-ink); }

/* ============================================================
   Step 1 — Makefile / Gradle pair + caption
   ============================================================ */
.s-agents-md .cmd-panel.make { grid-area: make; }
.s-agents-md .cmd-panel.gradle { grid-area: gradle; }
.s-agents-md .cmd-caption { grid-area: cap; }

.s-agents-md .cmd-panel,
.s-agents-md .cmd-caption {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition:
    opacity 350ms cubic-bezier(.2,.7,.2,1),
    max-height 350ms cubic-bezier(.2,.7,.2,1);
}

.s-agents-md[data-step="1"] .cmd-panel {
  opacity: 1;
  max-height: 320px;
}
.s-agents-md[data-step="1"] .cmd-caption {
  opacity: 1;
  max-height: 60px;
}

.s-agents-md .cmd-panel {
  background: #060D3A;
  border: 1px solid rgba(10, 21, 84, 0.22);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 18px 40px rgba(10, 21, 84, 0.18),
    0 4px 10px rgba(10, 21, 84, 0.08);
}
.s-agents-md .cmd-panel .panel-bar.mini {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--cyan);
  background: rgba(91,233,240,0.10);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  letter-spacing: 0.06em;
  text-transform: lowercase;
}
.s-agents-md .cmd-panel .panel-bar.mini .tag {
  margin-left: auto;
  color: #8A93BC;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.s-agents-md .cmd-panel .cmd-body {
  margin: 0;
  padding: 18px 22px 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  line-height: 1.5;
  color: #C8CCE4;
  white-space: pre;
  overflow: hidden;
}
.s-agents-md .cmd-panel .cmd-body .t-name { color: var(--cyan); font-weight: 600; }
.s-agents-md .cmd-panel .cmd-body .t-cmd  { color: var(--orange-soft); }
.s-agents-md .cmd-panel .cmd-body .t-kw   { color: #B89AE8; }                 /* lighter purple — better on dark navy */
.s-agents-md .cmd-panel .cmd-body .t-str  { color: #B6E3A8; }
.s-agents-md .cmd-panel .cmd-body .t-cmt  { color: #8B95BD; font-style: italic; }  /* explicit: ~5:1 on dark */
.s-agents-md .cmd-panel .cmd-body .t-fn   { color: var(--cyan); }

/* Caption row — sits on cream paper, so use ink variants */
.s-agents-md .cmd-caption {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  color: var(--fg-dim);
}
.s-agents-md .cmd-caption .prompt { color: var(--accent-ink); font-weight: 700; }
.s-agents-md .cmd-caption .cmd { color: var(--fg); }
.s-agents-md .cmd-caption .arrow { color: var(--accent-ink); font-weight: 600; margin: 0 4px; }
.s-agents-md .cmd-caption .hl { color: var(--fg); }
.s-agents-md .cmd-caption .hl code {
  color: var(--accent-ink);
  font-family: 'JetBrains Mono', monospace;
  background: rgba(184, 23, 66, 0.08);
  border: 1px solid rgba(184, 23, 66, 0.28);
  border-radius: 4px;
  padding: 1px 8px;
}

/* ============================================================
   Tag line — morphs between step 0 and step 1
   ============================================================ */
.s-agents-md .tag-line {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 56px;
}
.s-agents-md .tag-line .lbl {
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-mute);
}
.s-agents-md .tag-line .quotes {
  position: relative;
  min-height: 40px;
}
.s-agents-md .tag-line .quote {
  font-size: 32px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--fg);
  letter-spacing: -0.005em;
  text-wrap: balance;
  transition: opacity 350ms cubic-bezier(.2,.7,.2,1);
}
.s-agents-md .tag-line .quote em {
  font-style: normal;
  color: var(--accent-ink);
}
.s-agents-md .tag-line .quote.q-1 {
  position: absolute;
  inset: 0;
  opacity: 0;
}
.s-agents-md[data-step="1"] .tag-line .quote.q-0 { opacity: 0; }
.s-agents-md[data-step="1"] .tag-line .quote.q-1 { opacity: 1; }

/* ============================================================
   Print — drop heavy shadows / backdrop-filters so Chromium's
   page.pdf() doesn't rasterise them as opaque rectangles.
   On step-able slides, export:pdf renders both steps, so the
   step-1 visuals must remain legible without animation.
   ============================================================ */
@media print {
  .s-agents-md .agents-panel,
  .s-agents-md .cmd-panel,
  .s-agents-md .callouts .co { box-shadow: none; }
}
