:root {
  --bg: #0b0d12;
  --panel: #12151c;
  --panel-2: #171b24;
  --border: #252a36;
  --text: #e6e9f0;
  --muted: #98a1b3;
  --accent: #5b8cff;
  --accent-ink: #0b0d12;
  --code-bg: #0f121a;
  --ok: #4cc38a;
  --nav-h: 57px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f8f9fc; --panel: #ffffff; --panel-2: #f1f3f9; --border: #dde1ec;
    --text: #161a24; --muted: #566074; --accent: #2f5fdc; --accent-ink: #ffffff; --code-bg: #f1f3f9;
    --ok: #16794c; color-scheme: light;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }
main:focus { outline: none; }
code, pre { font-family: var(--mono); }

.topbar { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1180px; margin: 0 auto; padding: 0 16px; height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 650; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; flex: none; color: var(--text); }
/* The Line mark is a status light, not decoration. Its pills move only while <html data-dev-status="active"> (or "ending": the cycle in
 * progress finishes so nothing snaps back), and how they move is a motion (the Logo Lab's JSON) that assets/js/logo-status.js turns into
 * keyframes and injects as <style id="logo-motion">: the built-in one, the site's (logo.json), or this browser's own. The pills are
 * `.pill-white` and `.pill-blue` in the header logo. Nothing here animates by itself. */
.logo-panel { position: fixed; right: 16px; bottom: 16px; z-index: 50; display: grid; gap: 8px; width: min(320px, calc(100vw - 32px)); padding: 12px 14px; background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25); font-size: 0.9rem; }
.logo-panel h2 { margin: 0; font-size: 1rem; }
.logo-panel label { display: grid; gap: 4px; }
.logo-panel select, .logo-panel input, .logo-panel textarea { font: inherit; padding: 4px 6px; }
.logo-panel textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8rem; resize: vertical; }
.logo-panel-note { margin: 0; color: var(--muted); min-height: 1.2em; }
@media (prefers-reduced-motion: reduce) { .brand-mark, .brand-mark * { animation: none !important; } }
.brand-name { font-weight: 600; letter-spacing: 0.3em; text-transform: uppercase; font-size: 0.95rem; }
.brand-sub { color: var(--muted); font-weight: 500; padding-left: 10px; border-left: 1px solid var(--border); }
.topbar nav { display: flex; gap: 4px; }
.topbar nav a { color: var(--muted); padding: 6px 12px; border-radius: 6px; font-size: 14.5px; }
.topbar nav a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.topbar nav a[aria-current="page"] { color: var(--text); background: var(--panel-2); }

.shell { max-width: 1180px; margin: 0 auto; padding: 32px 16px 64px; }
.shell.has-sidebar { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 48px; }
main { min-width: 0; max-width: 820px; }
.shell:not(.has-sidebar) main { max-width: 1100px; margin: 0 auto; width: 100%; }
.sidebar { position: sticky; top: 88px; align-self: start; max-height: calc(100vh - 110px); overflow: auto; font-size: 14px; padding-right: 8px; }
.side-h { text-transform: uppercase; letter-spacing: .08em; font-size: 11.5px; color: var(--muted); margin: 0 0 8px; font-weight: 600; }
.sidebar ul, .sidebar ol { list-style: none; margin: 0 0 24px; padding: 0; }
.sidebar li a { display: block; padding: 5px 10px; border-left: 2px solid var(--border); color: var(--muted); line-height: 1.4; }
.sidebar li a:hover { color: var(--text); text-decoration: none; border-left-color: var(--muted); }
.sidebar li.current > a, .sidebar a[aria-current="page"] { color: var(--text); border-left-color: var(--accent); }
.side-toc { counter-reset: t; }
.side-toc li a::before { counter-increment: t; content: counter(t) ". "; color: var(--muted); }

h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin: 0 0 12px; }
h2 { font-size: 1.6rem; margin: 0 0 8px; }
.eyebrow { color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: .1em; font-size: 12.5px; margin: 0 0 12px; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 68ch; }
.meta { color: var(--muted); font-size: 13.5px; margin: 8px 0 0; }
.crumbs { font-size: 13.5px; color: var(--muted); margin-bottom: 16px; }

.hero { padding: 24px 0 40px; border-bottom: 1px solid var(--border); margin-bottom: 40px; }
.hero h1 { max-width: 20ch; font-size: clamp(2rem, 5vw, 3.1rem); }
.pillars { list-style: none; padding: 0; margin: 28px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.pillars li { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 16px; color: var(--muted); font-size: 14.5px; line-height: 1.55; }
.pillars strong { color: var(--text); display: block; margin-bottom: 4px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 24px 0 0; }
.btn { display: inline-block; padding: 10px 18px; border-radius: 8px; border: 1px solid var(--border); color: var(--text); font-weight: 600; font-size: 15px; background: var(--panel); }
.btn:hover { text-decoration: none; border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.1); }
.section-note { color: var(--muted); margin: 0 0 24px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card-media { display: block; aspect-ratio: 16 / 9; background: var(--code-bg); border-bottom: 1px solid var(--border); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; object-position: top left; display: block; }
.card-media.ph { display: grid; place-items: center; background: linear-gradient(135deg, var(--panel-2), var(--code-bg)); color: var(--muted); font-family: var(--mono); font-size: 13px; letter-spacing: .08em; }
.card-media.ph:hover { text-decoration: none; }
.card-body { padding: 16px 18px 18px; }
.card h3 { margin: 0 0 6px; font-size: 1.1rem; }
.card h3 a { color: var(--text); }
.card p { margin: 0; color: var(--muted); font-size: 14.5px; }
.card .meta { margin-top: 10px; }

.guide-head { margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.toc-h { font-size: 1.05rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.toc { list-style: none; counter-reset: s; padding: 0; margin: 12px 0 48px; display: grid; gap: 10px; }
.toc li { counter-increment: s; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px 12px 52px; position: relative; }
.toc li::before { content: counter(s); position: absolute; left: 16px; top: 12px; width: 24px; height: 24px; border-radius: 50%; background: var(--panel-2); color: var(--accent); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.toc a { font-weight: 600; }
.toc span { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }

.story { padding-top: 40px; margin-top: 8px; border-top: 1px solid var(--border); }
.story-num { color: var(--accent); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; margin: 0 0 6px; }
.story h2 { position: relative; }
.anchor { position: absolute; left: -1.1em; color: var(--muted); opacity: 0; font-weight: 400; }
.story h2:hover .anchor, .anchor:focus { opacity: 1; text-decoration: none; }
.badge { display: inline-block; border: 1px solid var(--border); border-radius: 999px; padding: 1px 10px; margin: 0 8px; font-size: 12.5px; color: var(--ok); }
.benefit { border-left: 3px solid var(--accent); background: var(--panel); border-radius: 0 10px 10px 0; padding: 12px 18px; margin: 16px 0; }
.benefit p { margin: 4px 0; }
.benefit-h { color: var(--accent); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; }

.prose { overflow-wrap: anywhere; }
.prose h3 { font-size: 1.25rem; margin: 32px 0 8px; }
.prose h4 { font-size: 1.05rem; margin: 24px 0 6px; }
.prose p, .prose li { max-width: 74ch; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: 4px 0; }
.prose code { background: var(--code-bg); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; font-size: .88em; }
.prose pre { background: var(--code-bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; overflow-x: auto; font-size: 13.5px; line-height: 1.55; }
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.prose img { max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: 10px; display: block; margin: 16px 0; background: var(--code-bg); }
.prose figure.video { margin: 0; }
.prose figure.video figcaption { font-size: 0.85rem; color: var(--muted, #6b7280); margin: -8px 0 16px; }
.prose video { max-width: 100%; height: auto; aspect-ratio: 16 / 9; border: 1px solid var(--border); border-radius: 10px; display: block; margin: 16px 0; background: #0d0f12; }
.prose a:has(> img) { display: block; }
.prose blockquote { margin: 16px 0; padding: 4px 16px; border-left: 3px solid var(--border); color: var(--muted); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 32px 0; }
.prose table { border-collapse: collapse; display: block; overflow-x: auto; max-width: 100%; }
.prose th, .prose td { border: 1px solid var(--border); padding: 6px 12px; text-align: left; }
.prose th { background: var(--panel); }
.lede-block { color: var(--muted); font-size: 1.08rem; }
.reference { margin-top: 28px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
.reference > summary { cursor: pointer; padding: 12px 18px; font-weight: 600; }
.reference > .prose { padding: 0 18px 12px; }
.notfound { text-align: center; padding: 80px 0; }
.notfound .cta { justify-content: center; }

.footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 13.5px; }
.footer-inner { max-width: 1180px; margin: 0 auto; padding: 20px 16px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .shell.has-sidebar { display: block; }
  .sidebar { position: static; max-height: none; margin-bottom: 24px; padding: 14px 16px 0; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; }
  .side-toc { display: none; }
  .pillars { grid-template-columns: 1fr; }
  .brand-sub { display: none; }
  .anchor { display: none; }
}
@media (max-width: 480px) {
  .cards { grid-template-columns: 1fr; }
  .shell { padding-top: 20px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .card { transition: none; } }

.user-story { margin: 16px 0; padding: 12px 18px; border-left: 3px solid var(--accent); background: var(--panel-2); border-radius: 0 10px 10px 0; font-size: 1.05rem; }
.toc .toc-benefit { color: var(--ok); }
.guide-hero { margin: 20px 0; }
.guide-hero img { width: 100%; height: auto; border: 1px solid var(--border); border-radius: 10px; display: block; }
.benefit ul { margin: 4px 0; padding-left: 1.2em; }
.prose code { overflow-wrap: anywhere; }
.prose pre code { overflow-wrap: normal; }
.benefit code, .toc code, .user-story code { overflow-wrap: anywhere; }
.benefit { overflow-wrap: anywhere; }

/* ---- Home hero backdrop (#282) --------------------------------------
   A real Cockpit screenshot behind the top of the home page only, scoped
   by the `is-home` body class the layout adds for `section === 'home'`.

   The screenshot has to stay RECOGNISABLE as the Cockpit, so the blur is
   only enough to stop text fighting text. Readability instead comes from
   the shape of the light: a radial mask centred above the top edge, so
   the image is brightest and sharpest at the top and falls away down and
   outward, like a soft light source above the page. The scrim (::after)
   then carries the fade into the page background. */
.is-home { position: relative; }
.is-home::before,
.is-home::after,
.hero-slides {
  content: "";
  position: absolute;
  /* Start below the sticky nav (.topbar-inner is 56px + 1px border), so the
     Cockpit's own top bar is not hidden behind ours. */
  inset: var(--nav-h) 0 auto 0;
  height: min(92vh, 860px);
  pointer-events: none;
}
.is-home::before,
.hero-slides {
  z-index: -2;
  background-image: image-set(
    url("../img/cockpit-hero.webp") type("image/webp"),
    url("../img/cockpit-hero.jpg") type("image/jpeg")
  );
  background-size: cover;
  background-position: top center;
  /* Softened, but never past the point where the screen is identifiable. */
  filter: blur(3px) saturate(0.9) brightness(0.8);
  opacity: 0.85;
  /* The focal light: fully lit at the top, dissolving down and to the
     sides. This is what makes it read as lit rather than pasted on. */
  -webkit-mask-image: radial-gradient(102% 86% at 50% -10%, #000 0%, #000 26%, rgba(0, 0, 0, 0.42) 58%, rgba(0, 0, 0, 0.12) 82%, transparent 100%);
  mask-image: radial-gradient(102% 86% at 50% -10%, #000 0%, #000 26%, rgba(0, 0, 0, 0.42) 58%, rgba(0, 0, 0, 0.12) 82%, transparent 100%);
}
/* Dark theme: the backdrop is a slideshow of real Cockpit screens (six
   spans inside .hero-slides). Each slide fades in over the previous one
   (which stays fully opaque until the new one is opaque, so there is never a
   dip to the page background) and z-index is animated so the incoming slide
   is always on top, including on the wrap from the last slide to the first.
   Pure CSS: 6 slides x 6s = 36s cycle, no script. Light theme keeps the
   single light still on ::before, because only that screen exists in light. */
.hero-slides { background-image: none; overflow: hidden; }
.hero-slides span {
  position: absolute; inset: 0;
  background-size: cover; background-position: top center;
  opacity: 0; z-index: 1;
  animation: hero-slide 36s linear infinite both;
  animation-delay: calc(var(--i) * 6s - 1.44s);
}
.hero-slides span:nth-child(1) { --i: 0; background-image: url("../img/cockpit-hero.webp"); }
.hero-slides span:nth-child(2) { --i: 1; background-image: url("../img/cockpit-plan-impact.webp"); }
.hero-slides span:nth-child(3) { --i: 2; background-image: url("../img/cockpit-plan-run.webp"); }
.hero-slides span:nth-child(4) { --i: 3; background-image: url("../img/cockpit-review-change.webp"); }
.hero-slides span:nth-child(5) { --i: 4; background-image: url("../img/cockpit-tests-coverage.webp"); }
.hero-slides span:nth-child(6) { --i: 5; background-image: url("../img/cockpit-tests-steps.webp"); }
@keyframes hero-slide {
  0%      { opacity: 0; z-index: 2; }
  4%      { opacity: 1; z-index: 2; }
  4.01%   { opacity: 1; z-index: 1; }
  20.67%  { opacity: 1; z-index: 1; }
  20.68%  { opacity: 0; z-index: 1; }
  100%    { opacity: 0; z-index: 1; }
}
.is-home::before { display: none; }
.is-home::after {
  z-index: -1;
  background:
    /* the glow itself, tinted with the accent, strongest at top centre */
    radial-gradient(85% 50% at 50% -8%, color-mix(in srgb, var(--accent) 14%, transparent) 0%, transparent 72%),
    /* and the fade into the page */
    linear-gradient(
      to bottom,
      color-mix(in srgb, var(--bg) 42%, transparent) 0%,
      color-mix(in srgb, var(--bg) 68%, transparent) 42%,
      color-mix(in srgb, var(--bg) 90%, transparent) 78%,
      var(--bg) 100%
    );
}
/* The screenshot is a dark UI, so light mode uses the Cockpit's own light
   theme. Fading the dark one out instead reads as grey noise at any
   opacity, because a dark UI has no light pixels to show through. */
@media (prefers-color-scheme: light) {
  .hero-slides { display: none; }
  .is-home::before { display: block; }
  .is-home::before {
    background-image: image-set(
      url("../img/cockpit-hero-light.webp") type("image/webp"),
      url("../img/cockpit-hero-light.jpg") type("image/jpeg")
    );
    opacity: 0.9;
  }
  .is-home::after {
    background:
      radial-gradient(85% 50% at 50% -8%, color-mix(in srgb, var(--accent) 10%, transparent) 0%, transparent 72%),
      linear-gradient(
        to bottom,
        color-mix(in srgb, var(--bg) 48%, transparent) 0%,
        color-mix(in srgb, var(--bg) 72%, transparent) 42%,
        color-mix(in srgb, var(--bg) 90%, transparent) 78%,
        var(--bg) 100%
      );
  }
}
/* The backdrop is decoration; print and reduced-motion get it plain. */
@media (prefers-reduced-motion: reduce) {
  .is-home::before { transform: none; }
  .hero-slides span { animation: none; }
  .hero-slides span:first-child { opacity: 1; }
}
@media print {
  .is-home::before, .is-home::after, .hero-slides { display: none; }
}
