/* School Management System, case study.
   Same tokens and materials as the portfolio: grey studio paper for the opening,
   then the charcoal of the ID card photo. Plates are the card's matte black,
   wells are its recessed window, the slot marks a plate as a badge.
   Honey is kept for links, actions and the selected state. */
:root {
  --paper: #84878D;
  --ink: #111215;

  --char: #16171B;
  --char-deep: #0F1013;
  --plate-hi: #23252A;
  --plate: #1C1D22;
  --plate-lo: #17181C;
  --well: #0F1013;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .15);
  --text: #ECEDEF;
  --muted: #9A9DA4;

  --honey: #E7AE5C;
  --honey-hi: #F1C27F;
  --honey-ink: #1B1307;

  --r-plate: 24px;
  --r-well: 16px;
  --r-btn: 12px;
  --edge: inset 0 1px 0 rgba(255, 255, 255, .06);

  --fs-meta: .75rem;
  --fs-small: .875rem;
  --fs-body: 1rem;
  --fs-lead: 1.25rem;
  --fs-h4: 1.5625rem;

  --display: 'Bricolage Grotesque', 'Segoe UI', sans-serif;
  --body: 'Instrument Sans', 'Segoe UI', sans-serif;
  --code: 'JetBrains Mono', Consolas, monospace;
  --gutter: clamp(16px, 5vw, 72px);
  --vp-wide: 1280px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--char);
  color: var(--text);
  font: 400 var(--fs-body)/1.6 var(--body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
ul, ol { list-style: none; }
h1, h2, h3, h4 { font-weight: 600; }
::selection { background: rgba(231, 174, 92, .35); }
:focus-visible { outline: 2px solid var(--honey); outline-offset: 2px; border-radius: 8px; }
.on-paper :focus-visible { outline-color: var(--ink); }
section[id] { scroll-margin-top: 96px; }
.skip {
  position: fixed; left: 16px; top: -64px; z-index: 100;
  background: var(--honey); color: var(--honey-ink); padding: 12px 16px;
  border-radius: var(--r-btn); font-weight: 600; text-decoration: none;
}
.skip:focus { top: 16px; }
.wrap { max-width: var(--vp-wide); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Materials ---------- */
.plate {
  position: relative;
  background: linear-gradient(165deg, var(--plate-hi) 0%, var(--plate) 45%, var(--plate-lo) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-plate);
  box-shadow: var(--edge), 0 24px 48px -32px rgba(0, 0, 0, .7);
}
.well {
  background: var(--well);
  border: 1px solid rgba(255, 255, 255, .05);
  border-radius: var(--r-well);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .55);
}
.slot {
  position: absolute; left: 50%; top: 16px; width: 48px; height: 8px; margin-left: -24px;
  border-radius: 4px; background: #08090B;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .9), 0 1px 0 rgba(255, 255, 255, .06);
}
.rows > * + * { border-top: 1px solid var(--line); }
.cells { display: grid; overflow: hidden; }
.cells > * { box-shadow: -1px -1px 0 var(--line); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px; border-radius: var(--r-btn);
  border: 1px solid transparent; background: transparent;
  font: 600 var(--fs-body)/1.2 var(--body); text-decoration: none; cursor: pointer;
  transition: background-color .15s ease-out, border-color .15s ease-out, color .15s ease-out;
}
.btn--primary { background: var(--honey); color: var(--honey-ink); }
.btn--primary:hover { background: var(--honey-hi); }
.btn--ghost { border-color: var(--line-2); color: var(--text); }
.btn--ghost:hover { border-color: rgba(255, 255, 255, .35); }

/* ---------- Top bar: the portfolio's bar, with the way back ---------- */
.nav { position: fixed; top: 12px; left: 12px; right: 12px; z-index: 50; }
.nav-bar {
  min-height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 8px max(8px, calc(var(--gutter) - 12px));
  background: linear-gradient(170deg, var(--plate-hi), var(--plate-lo));
  border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--edge);
}
.nav-name { display: flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; font: 600 var(--fs-body)/1.2 var(--display); }
.nav-avatar { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; flex: none; border: 1px solid rgba(255, 255, 255, .1); }
.nav-first { color: var(--honey); }
.nav-divider { color: #4A4D54; font-weight: 400; margin: 0 4px; }
.nav-role { color: var(--muted); font: 500 var(--fs-small)/1.2 var(--body); }
.nav-back { min-height: 44px; padding: 0 16px; font-size: var(--fs-small); flex: none; }

/* ---------- Opening: on the studio paper ---------- */
.opening {
  position: relative;
  background: var(--paper) url("assets/studio-backdrop.jpg") center top / cover no-repeat;
  color: var(--ink);
  padding: 136px 0 0;
}
/* the lights dim into the charcoal below */
.opening::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 240px; pointer-events: none;
  background: linear-gradient(to bottom, rgba(22, 23, 27, 0), var(--char));
}
.opening-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; align-items: end; }
.crumb { font-size: var(--fs-small); font-weight: 500; }
.crumb a { text-underline-offset: 4px; }
.opening h1 {
  margin-top: 16px;
  font: 600 clamp(2.5rem, 5.4vw, 4.5rem)/1.1 var(--display);
  letter-spacing: -0.035em; max-width: 14ch;
}
.opening-lede { margin-top: 24px; font-size: var(--fs-lead); line-height: 1.5; font-weight: 500; max-width: 40ch; }
.opening-meta { margin-top: 24px; display: grid; gap: 4px; font-size: var(--fs-small); }
.opening-meta dt { font-weight: 600; }
.opening-meta dd + dt { margin-top: 12px; }
.opening-copy { padding-bottom: 96px; }

/* A screenshot set in a badge plate: slot on top, the screen in the recessed window */
.shot { padding: 40px 16px 16px; }
.shot .well { overflow: hidden; padding: 0; background: #F4F7FB; }
.shot .well img { width: 100%; }
.shot figcaption { margin-top: 12px; padding: 0 8px; font-size: var(--fs-meta); color: var(--muted); }
.opening .shot { margin-bottom: 48px; }

/* ---------- Chapters ---------- */
.chapter { padding: 96px 0 0; }
.chapter-head { max-width: 760px; }
.chapter-head h2 { font: 600 clamp(2rem, 3.6vw, 3rem)/1.1 var(--display); letter-spacing: -0.03em; }
.chapter-head p { margin-top: 16px; color: var(--muted); max-width: 65ch; }
.chapter-head p strong { color: var(--text); font-weight: 600; }

/* At a glance */
.glance { margin-top: 48px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.glance div { padding: 24px; }
.glance dt { font: 600 2rem/1.1 var(--display); }
.glance dd { margin-top: 8px; color: var(--muted); font-size: var(--fs-small); line-height: 1.5; }

/* Problem: what the school had to keep in order */
.needs { margin-top: 40px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.needs li { padding: 24px; }
.needs h3 { font: 600 var(--fs-lead)/1.2 var(--display); }
.needs p { margin-top: 8px; color: var(--muted); font-size: var(--fs-small); }

/* Two sides of one system */
.sides { margin-top: 40px; display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.side { padding: 48px 32px 32px; }
.side-kind { font-size: var(--fs-small); color: var(--muted); }
.side h3 { margin-top: 4px; font: 600 var(--fs-h4)/1.2 var(--display); letter-spacing: -0.01em; }
.side .well { margin-top: 24px; }
.side .well li { padding: 12px 16px; font-size: var(--fs-small); display: grid; gap: 2px; }
.side .well li strong { font-weight: 600; color: var(--text); }
.side .well li span { color: var(--muted); }

/* Core workflows: modules grouped, then one screen per workflow */
.groups { margin-top: 40px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.groups > div { padding: 24px; }
.groups h3 { font: 600 var(--fs-body)/1.3 var(--body); }
.groups p { margin-top: 8px; color: var(--muted); font-size: var(--fs-small); line-height: 1.6; }
.flows { margin-top: 24px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.flow { padding: 16px; }
.flow-shot {
  height: 340px; overflow: hidden; background: #F4F7FB;
  display: flex; align-items: center; justify-content: center;
}
.flow-shot a { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.flow-shot img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
/* Phone screens are long; the top holds what matters, so the rest is cut off */
.flow-shot.is-phone-shot, .flow-shot.is-phone-shot a { align-items: flex-start; }
.flow-shot.is-phone-shot img { width: 200px; max-height: none; }
.flow figcaption { padding: 20px 8px 8px; }
.flow-who { font-size: var(--fs-meta); font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.flow h3 { margin-top: 4px; font: 600 var(--fs-lead)/1.25 var(--display); }
.flow figcaption p + p:not(.flow-who), .flow h3 + p { margin-top: 8px; color: var(--muted); font-size: var(--fs-small); line-height: 1.6; max-width: 60ch; }
/* The closing workflow spans the row: phone on one side, words on the other */
.flow--wide { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px 32px; align-items: center; }
.flow--wide .flow-shot { height: 420px; }
.flow--wide .flow-shot.is-phone-shot, .flow--wide .flow-shot.is-phone-shot a { align-items: center; }
.flow--wide .flow-shot.is-phone-shot img { width: 280px; }
.flow--wide figcaption { padding: 8px 16px 8px 0; }
/* A screen still to be captured: same frame, marked plainly */
.flow-shot.pending {
  align-items: center; text-align: center; padding: 32px;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .02) 0 12px, transparent 12px 24px), var(--well);
  border-style: dashed; border-color: var(--line-2);
  color: var(--muted); font-size: var(--fs-small);
}
.pending strong { display: block; color: var(--text); font-weight: 600; margin-bottom: 4px; }

/* Architecture: why it is built this way */
/* the arrow sits on the divider, on the plate's colour so it cuts the line */
  content: "\2192"; position: absolute; left: -9px; top: 20px; width: 16px; text-align: center;
  background: var(--plate); color: var(--muted); font-size: var(--fs-small); line-height: 1.5;
}
.why { margin-top: 24px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.why li { padding: 24px; }
.why h3 { font: 600 var(--fs-body)/1.3 var(--body); }
.why p { margin-top: 4px; color: var(--muted); font-size: var(--fs-small); line-height: 1.6; }

/* Engineering decisions: problem, decision, result */
.decisions { margin-top: 40px; display: grid; gap: 16px; }
.decision { padding: 32px; }
.decision-no { font: 500 var(--fs-meta)/1.5 var(--code); color: var(--honey); }
.decision h3 { margin-top: 4px; font: 600 var(--fs-h4)/1.2 var(--display); letter-spacing: -0.01em; }
.dwr { margin-top: 20px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.dwr dt { font-size: var(--fs-small); font-weight: 600; color: var(--text); }
.dwr dd { margin-top: 4px; color: var(--muted); font-size: var(--fs-small); line-height: 1.6; }

/* Security and testing */
.facts { margin-top: 40px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.facts li { padding: 20px 24px; }
.facts h3 { font: 600 var(--fs-body)/1.3 var(--body); }
.facts p { margin-top: 4px; color: var(--muted); font-size: var(--fs-small); line-height: 1.5; }
.tests { margin-top: 40px; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.test { padding: 28px; }
.test h3 { font: 600 var(--fs-lead)/1.2 var(--display); }
.test .count { margin-top: 4px; font: 500 var(--fs-meta)/1.5 var(--code); color: var(--muted); }
.test .count + p { margin-top: 12px; color: var(--muted); font-size: var(--fs-small); line-height: 1.6; }

/* Lessons */
.lessons { margin-top: 40px; max-width: 840px; }
.lessons li { padding: 24px 0; display: grid; grid-template-columns: 40px 1fr; gap: 8px; }
.lessons li::before { content: ""; width: 12px; height: 12px; margin-top: 8px; border-radius: 50%; border: 2px solid var(--muted); }
.lessons li:last-child::before { border-color: var(--honey); background: var(--honey); }
.lessons h3 { font: 600 var(--fs-lead)/1.3 var(--display); }
.lessons p { margin-top: 4px; color: var(--muted); }

/* Close */
.close {
  margin-top: 120px; padding: 96px 0;
  background:
    radial-gradient(ellipse 46% 64% at 72% 46%, rgba(74, 62, 56, .45), rgba(22, 23, 27, 0) 72%),
    linear-gradient(var(--char), var(--char-deep));
  border-top: 1px solid var(--line);
}
.close-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.close h2 { font: 600 clamp(2rem, 4vw, 3.5rem)/1.1 var(--display); letter-spacing: -0.035em; }
.close-status { margin-top: 16px; color: var(--muted); max-width: 44ch; }
.close .actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }
.built { padding: 48px 32px 32px; }
.built h3 { font-size: var(--fs-small); font-weight: 600; color: var(--muted); }
.built ul { margin-top: 12px; }
.built li { padding: 12px 0; display: flex; justify-content: space-between; gap: 16px; font-size: var(--fs-body); }
.built li span { color: var(--muted); font-size: var(--fs-small); text-align: right; }

footer { background: var(--char-deep); border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-small); }
.footer-inner { max-width: var(--vp-wide); margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding: 24px var(--gutter) 32px; }

/* ---------- Narrow (below 768px) ---------- */
@media (max-width: 767.98px) {
  .nav { top: 8px; left: 8px; right: 8px; }
  .nav-bar { padding: 8px; gap: 8px; }
  .nav-title { display: flex; flex-direction: column; gap: 2px; }
  .nav-divider { display: none; }
  .nav-role { font-size: var(--fs-meta); }
  .opening { padding-top: 112px; }
  .opening-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .opening-copy { padding-bottom: 0; }
  .close-grid, .flows, .flow--wide { grid-template-columns: minmax(0, 1fr); }
  .flow-shot, .flow--wide .flow-shot { height: 280px; }
  .flow--wide figcaption { padding: 20px 8px 8px; }
  .dwr { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .decision, .side { padding-left: 20px; padding-right: 20px; }
  .chapter { padding-top: 72px; }
  .close { margin-top: 72px; padding: 72px 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
}

/* ---------- Evidence: the system map, one request traced, the tables behind it ----------
   Same block in both case studies. Honey marks only the rule the traced request runs into. */

/* System map: tiers from the browser down to the database, each named on the left */
.arch { margin-top: 40px; padding: 24px; }
.arch-tier { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; align-items: start; }
.arch-tier--split { grid-template-columns: 96px repeat(2, minmax(0, 1fr)); }
.arch-name { padding-top: 15px; font-size: var(--fs-small); font-weight: 600; color: var(--muted); }
.arch-box {
  display: grid; gap: 4px; align-content: start; padding: 14px 18px;
  border: 1px solid var(--line-2); border-radius: var(--r-well); background: rgba(255, 255, 255, .02);
}
.arch-box strong { font: 600 var(--fs-body)/1.3 var(--display); }
.arch-box > span { color: var(--muted); font-size: var(--fs-small); line-height: 1.5; }
.arch-box--db { background: rgba(255, 255, 255, .045); }
/* what crosses between two tiers, on a dashed line that runs from one box into the next */
.arch-hop {
  margin-left: calc(96px + 16px + 28px); padding: 10px 0 10px 18px;
  border-left: 2px dashed rgba(255, 255, 255, .14);
  color: var(--muted); font-size: var(--fs-meta); line-height: 1.4;
}
.arch-sub { margin-top: 14px; font-size: var(--fs-meta); font-weight: 600; color: var(--muted); }
.arch-pipe { margin-top: 6px; display: flex; flex-wrap: wrap; row-gap: 6px; font-size: var(--fs-small); }
.arch-pipe li { display: inline-flex; align-items: center; }
.arch-pipe li + li::before { content: "\2192"; margin: 0 8px; color: var(--muted); }
.arch-mods { margin-top: 6px; display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 6px; }
.arch-mods li {
  padding: 8px 10px; border-radius: 10px; font-size: var(--fs-small);
  background: var(--well); border: 1px solid rgba(255, 255, 255, .05);
}
.arch-shared { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.arch-shared li { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-2); font-size: var(--fs-small); }
.arch-shared .is-key { border-color: rgba(231, 174, 92, .5); color: var(--honey-hi); }

/* One request: the checks in order on the left, the real exchange on the right */
.trace { margin-top: 40px; display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 24px; align-items: start; }
.gates { padding: 20px 24px 8px; }
.gates-head { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); font-size: var(--fs-meta); font-weight: 600; color: var(--muted); }
.gates ol { counter-reset: gate; }
.gates li { counter-increment: gate; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; padding: 16px 0; }
.gates li + li { border-top: 1px solid var(--line); }
.gates li::before {
  content: counter(gate); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--line-2); font: 600 var(--fs-meta)/1 var(--body); color: var(--muted);
}
.gates h3 { font: 600 var(--fs-body)/1.3 var(--display); }
.gates h3 + p { margin-top: 2px; color: var(--muted); font-size: var(--fs-small); line-height: 1.55; }
.gates code { font: 500 .8125rem/1.4 var(--code); color: var(--text); }
.gate-out { padding-top: 2px; font: 600 var(--fs-small)/1.3 var(--body); color: var(--muted); font-variant-numeric: tabular-nums; }
.gates .is-stop::before { border-color: var(--honey); background: var(--honey); color: var(--honey-ink); }
.gates .is-stop h3, .gates .is-stop .gate-out { color: var(--honey-hi); }
.gates .is-ok .gate-out { color: var(--text); }

.exchange { padding: 24px; }
.exchange figcaption { font-size: var(--fs-small); color: var(--muted); line-height: 1.55; }
.exchange figcaption strong { color: var(--honey-hi); font-weight: 600; }
.code-label { margin-top: 18px; font-size: var(--fs-meta); font-weight: 600; color: var(--muted); }
.code {
  margin-top: 6px; padding: 14px 16px;
  font: 400 .8125rem/1.65 var(--code); color: var(--text);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.code .st { color: var(--honey-hi); font-weight: 500; }
/* Arabic values read in a face that can join Arabic letters; the mono face cannot */
.code bdi[lang="ar"] { font-family: system-ui, "Segoe UI", Tahoma, sans-serif; font-size: .875rem; }
.code-gloss { margin-top: 8px; font-size: var(--fs-meta); color: var(--muted); line-height: 1.5; }
.exchange-src { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: var(--fs-meta); color: var(--muted); line-height: 1.5; }
.exchange-src code { font-family: var(--code); color: var(--text); overflow-wrap: anywhere; }

/* The tables behind the answer: an SVG excerpt of the schema, scrollable inside its well on phones */
.erd-wrap { margin-top: 40px; padding: 16px; }
.erd-scroll { overflow-x: auto; padding: 8px; }
.erd-scroll:focus-visible { outline-offset: -2px; }
.erd { display: block; width: 100%; min-width: 880px; height: auto; }
.erd text { font-family: var(--body); fill: var(--text); }
.erd .t { font: 600 15px var(--display); }
.erd .c { font-size: 13px; }
.erd .k { font: 500 11px var(--code); fill: var(--muted); }
.erd .tx-hl { fill: var(--honey-hi); }
.erd .box { fill: var(--plate-hi); stroke: var(--line-2); }
.erd .head { fill: rgba(255, 255, 255, .04); }
.erd .sep { stroke: var(--line-2); }
.erd .ln { fill: none; stroke: #6E727A; stroke-width: 1.5; }
.erd .ln-hl { fill: none; stroke: var(--honey); stroke-width: 2; }
.erd .brk { fill: none; stroke: #4A4D54; stroke-width: 1.5; }
.erd .note { font-size: 13px; fill: var(--muted); }
.erd .note-h { font: 600 16px var(--display); fill: var(--honey-hi); }
.erd .leg { font-size: 12px; fill: var(--muted); }
.erd-wrap figcaption { margin-top: 12px; padding: 0 8px; font-size: var(--fs-small); color: var(--muted); max-width: 80ch; }
.erd-hint { display: none; padding: 0 8px; font-size: var(--fs-meta); color: var(--muted); }

@media (max-width: 999.98px) {
  .trace { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767.98px) {
  .arch { padding: 16px; }
  .arch-tier, .arch-tier--split { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .arch-name { padding-top: 0; }
  .arch-hop { margin-left: 24px; }
  .arch-mods { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }
  .gates { padding: 16px 16px 4px; }
  .exchange { padding: 16px; }
  .erd-hint { display: block; margin-top: 8px; }
}

/* ---------- Tests and CI: the pipeline job by job, then a real run ----------
   Same block in both case studies. Steps are numbered because each job runs them in order. */
.block-h { font: 600 var(--fs-lead)/1.2 var(--display); }
.block-h + p { margin-top: 4px; font-size: var(--fs-small); color: var(--muted); max-width: 70ch; }
.block-h + p code, .run figcaption code { font: 500 .8125rem/1.4 var(--code); color: var(--text); }

.ci { margin-top: 24px; padding: 24px; }
.ci-jobs { margin-top: 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ci-job { padding: 18px 20px; border: 1px solid var(--line-2); border-radius: var(--r-well); background: rgba(255, 255, 255, .02); }
.ci-job h4 { font: 600 var(--fs-body)/1.3 var(--display); }
.ci-on { margin-top: 2px; font-size: var(--fs-meta); color: var(--muted); }
.ci-job ol { margin-top: 10px; counter-reset: step; }
.ci-job li { counter-increment: step; display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 8px; padding: 6px 0; font-size: var(--fs-small); line-height: 1.5; }
.ci-job li + li { border-top: 1px solid var(--line); }
.ci-job li::before { content: counter(step); font: 600 var(--fs-meta)/1.9 var(--body); color: var(--muted); }
.ci-job li span { color: var(--muted); }
/* the job that waits for the others: full width, with the hand-off said above it */
.ci-needs { grid-column: 1 / -1; padding: 2px 0 2px 18px; margin-left: 20px; border-left: 2px dashed rgba(255, 255, 255, .14); font-size: var(--fs-meta); color: var(--muted); }
.ci-job--last { grid-column: 1 / -1; }
.ci-job--last ol { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); column-gap: 24px; }
.ci-job--last li + li { border-top: 0; }
.ci-outside { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: var(--fs-small); color: var(--muted); padding-right: max(0px, calc(100% - 80ch)); }
.ci-outside strong { color: var(--text); font-weight: 600; }

.run { margin-top: 24px; padding: 24px; }
.run .code { margin-top: 16px; }
.run .code .cmd { color: var(--muted); }
.run figcaption { margin-top: 12px; font-size: var(--fs-small); color: var(--muted); line-height: 1.55; max-width: 80ch; }

@media (max-width: 767.98px) {
  .ci, .run { padding: 16px; }
  .ci-job { padding: 16px; }
  .ci-jobs { grid-template-columns: minmax(0, 1fr); }
}
