/* Layout: one centred column of full-width bands; hero carries the pipeline, then the dashboard
   (assets/dashboard.css, styled after the CloudWatch console), then how it works.
   Colours: cool console neutrals, platform colours from the README diagram (RHEL red, Windows blue). */
:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #eef1f4;
  --ink: #131a22;
  --muted: #586473;
  --line: #d9dee5;
  --accent: #b0125c;        /* Step Functions magenta, used for links and focus */
  --rhel: #c8102e;
  --rhel-2: #e07a1f;
  --win: #0a6ccf;
  --ok: #157a3c;
  --warn: #a85d00;
  --bad: #c41d1d;
  --sev-critical: #8f0d0d;
  --sev-important: #e2621b;
  --sev-moderate: #d9a40b;
  --sev-low: #3d7fd1;
  --sev-unrated: #9aa3ad;
  --grid: #e6e9ee;
  --shadow: 0 1px 2px rgba(19, 26, 34, .06), 0 4px 16px rgba(19, 26, 34, .05);
  --font-sans: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --step--1: .8125rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.625rem;
  --step-3: clamp(2rem, 1.4rem + 2.6vw, 3.1rem);
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117; --surface: #151b23; --surface-2: #1b232d; --ink: #e5e9ef; --muted: #98a3b1; --line: #29323d;
    --accent: #ff5ca8; --rhel: #ff4d5e; --rhel-2: #ffa24a; --win: #47a3ff;
    --ok: #4cc777; --warn: #f0a83a; --bad: #ff6464;
    --sev-critical: #ff4d4d; --sev-important: #ff8a3d; --sev-moderate: #e8c33a; --sev-low: #5b9bf0; --sev-unrated: #6e7884;
    --grid: #222a34; --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1117; --surface: #151b23; --surface-2: #1b232d; --ink: #e5e9ef; --muted: #98a3b1; --line: #29323d;
  --accent: #ff5ca8; --rhel: #ff4d5e; --rhel-2: #ffa24a; --win: #47a3ff;
  --ok: #4cc777; --warn: #f0a83a; --bad: #ff6464;
  --sev-critical: #ff4d4d; --sev-important: #ff8a3d; --sev-moderate: #e8c33a; --sev-low: #5b9bf0; --sev-unrated: #6e7884;
  --grid: #222a34; --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-sans); font-size: var(--step-0); line-height: 1.55; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; margin: 0; }
p { margin: 0; }
a { color: var(--accent); }
code { font-family: var(--font-mono); font-size: .88em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 0 .3em; overflow-wrap: anywhere; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: .5rem 1rem; z-index: 20; }
.skip:focus { left: 1rem; }

.wrap { max-width: 72rem; margin-inline: auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
@media (min-width: 700px) { .wrap { padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px)); } }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .7rem; flex-wrap: wrap; }
.brand { font-family: var(--font-mono); font-weight: 600; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: .55rem; }
.brand-mark { width: 14px; height: 14px; border-radius: 3px; background: linear-gradient(135deg, var(--rhel) 50%, var(--win) 50%); }
.topbar nav { display: flex; gap: 1.1rem; flex-wrap: wrap; font-size: var(--step--1); }
.topbar nav a { color: var(--muted); text-decoration: none; }
.topbar nav a:hover { color: var(--ink); }
.topbar-in nav { margin-left: auto; }
.theme { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px; gap: 2px; }
.theme button { font: inherit; font-size: .75rem; font-weight: 500; color: var(--muted); background: none; border: 0; border-radius: 999px; padding: .2rem .65rem; cursor: pointer; }
.theme button:hover { color: var(--ink); }
.theme button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* hero */
.hero { border-bottom: 1px solid var(--line); background:
  radial-gradient(circle at 1px 1px, var(--line) 1px, transparent 1.5px) 0 0 / 22px 22px, var(--bg); }
.hero-in { padding-block: clamp(1.5rem, 3.2vw, 2.4rem) clamp(1.25rem, 2.6vw, 1.9rem); display: flex; flex-direction: column; gap: .7rem; }
.eyebrow { font-family: var(--font-mono); font-size: var(--step--1); color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.hero h1 { font-size: clamp(1.75rem, 1.25rem + 1.6vw, 2.5rem); font-weight: 600; letter-spacing: -.015em; }
.lede { font-size: 1.05rem; color: var(--muted); max-width: 72ch; line-height: 1.5; }
.hero-status { margin-top: .15rem; }
.hero-status a { color: var(--accent); text-decoration: none; font-weight: 500; white-space: nowrap; }
.hero-status a:hover { text-decoration: underline; }

.pipeline { list-style: none; margin: .35rem 0 0; padding: 0; display: flex; flex-wrap: wrap; align-items: flex-start; gap: .6rem 0; }
.pipeline > li { display: flex; flex-direction: column; gap: .3rem; position: relative; padding-right: 2.2rem; }
.pipeline > li:not(:last-child)::after { content: ""; position: absolute; right: .55rem; top: .85rem; width: 1.1rem; height: 2px; background: var(--muted); opacity: .6; }
.pipeline > li:not(:last-child)::before { content: ""; position: absolute; right: .45rem; top: calc(.85rem - 4px); border: 5px solid transparent; border-left-color: var(--muted); border-right: 0; opacity: .6; }
.pipe-split { gap: .35rem; }
.svc { display: inline-block; font-family: var(--font-mono); font-size: .78rem; font-weight: 500; padding: .3rem .6rem; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); white-space: nowrap; box-shadow: var(--shadow); }
.svc-trigger { border-left: 4px solid #7c3aed; }
.svc-orch { border-left: 4px solid #e7157b; }
.svc-fn { border-left: 4px solid #ff9900; }
.svc-rhel { border-left: 4px solid var(--rhel); }
.svc-win { border-left: 4px solid var(--win); }
.svc-obs { border-left: 4px solid #2563eb; }
.pipe-note { font-size: .7rem; color: var(--muted); padding-left: .2rem; }
@media (max-width: 640px) {
  .pipeline { flex-direction: column; gap: 1.2rem; }
  .pipeline > li { padding-right: 0; }
  .pipeline > li:not(:last-child)::after { right: auto; left: 1.1rem; top: auto; bottom: -1rem; width: 2px; height: .8rem; }
  .pipeline > li:not(:last-child)::before { display: none; }
  .svc { white-space: normal; }
}

.hero-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin-top: .6rem; }
.views { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; }
.views button { font: inherit; font-size: var(--step--1); font-weight: 500; color: var(--muted); background: none; border: 0; border-radius: 999px; padding: .35rem .85rem; cursor: pointer; display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap; }
.views button:hover { color: var(--ink); }
.views button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.views button:disabled { opacity: .5; cursor: not-allowed; }
.live-dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--ok); }
.views button[aria-pressed="false"] .live-dot { background: var(--muted); }
.status-line { display: inline-flex; align-items: center; gap: .6rem; align-self: flex-start; font-size: var(--step--1); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .4rem .9rem; }
.status-line .dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--muted); flex: none; }
.status-line.is-ok .dot { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.status-line.is-warn .dot { background: var(--warn); }
.status-line.is-running { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
.status-line.is-running .dot { background: var(--warn); }
@media (prefers-reduced-motion: no-preference) {
  .status-line.is-running .dot { animation: pulse 1.6s ease-out infinite; }
  @keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--warn) 55%, transparent); } 100% { box-shadow: 0 0 0 9px transparent; } }
}

/* bands and sections */
.band { padding-block: clamp(2rem, 5vw, 3.25rem); }
.band + .band { padding-top: 0; }
.section-head { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1.1rem; max-width: 62ch; }
.section-head h2 { font-size: var(--step-2); font-weight: 600; letter-spacing: -.01em; }
.section-note { font-size: var(--step--1); color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.25rem; box-shadow: var(--shadow); min-width: 0; margin: 0; }
.card h3 { font-size: var(--step-1); font-weight: 600; }
.card figcaption { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .8rem; }

/* how it works */
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: .9rem; }
.steps li { counter-increment: step; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.15rem; display: flex; flex-direction: column; gap: .45rem; min-width: 0; }
.steps li::before { content: counter(step); font-family: var(--font-mono); font-size: .78rem; font-weight: 600; color: var(--accent); }
.steps h3 { font-size: var(--step-0); font-weight: 600; }
.steps p { font-size: var(--step--1); color: var(--muted); }

/* footer */
.foot { border-top: 1px solid var(--line); background: var(--surface); }
.foot-in { padding-block: 2rem 2.5rem; display: flex; flex-direction: column; gap: .9rem; font-size: var(--step--1); color: var(--muted); }
.foot-in strong { color: var(--ink); font-weight: 600; }
.foot-note { max-width: 75ch; }

.empty { color: var(--muted); font-size: var(--step--1); padding: 1rem 0; }
.hosts > .empty, .tiles > .empty { grid-column: 1 / -1; }

/* architecture diagram (inline SVG in "How a patch cycle runs"; colours from the theme tokens) */
.arch { margin: 0 0 1.4rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1rem .9rem; box-shadow: var(--shadow); }
.arch-scroll { overflow-x: auto; }
.arch-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.arch-svg { display: block; width: 100%; min-width: 860px; height: auto; }
.arch figcaption { margin-top: .6rem; font-size: var(--step--1); color: var(--muted); max-width: 80ch; }
.arch figcaption strong { color: var(--ink); }
.arch .ab rect:first-child { fill: var(--surface-2); stroke: var(--line); stroke-width: 1; }
.arch .ab-t { fill: var(--ink); font-family: var(--font-sans); font-size: 13.5px; font-weight: 600; }
.arch .ab-t.mono { font-family: var(--font-mono); font-size: 12.5px; }
.arch .ab-s { fill: var(--muted); font-family: var(--font-sans); font-size: 11.5px; }
.arch .ab-band { fill: var(--muted); font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .08em; }
.arch .vpc { fill: none; stroke: var(--muted); stroke-opacity: .55; stroke-width: 1.25; stroke-dasharray: 6 5; }
.arch .vpc-l { fill: var(--muted); font-family: var(--font-mono); font-size: 11px; }
.arch .ae { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linejoin: round; }
.arch .ae-d { stroke-dasharray: 4 4; }
.arch .arr-h { fill: var(--muted); }
.arch .ae-l { fill: var(--ink); font-family: var(--font-mono); font-size: 11px; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
@media (min-width: 900px) { .arch-scroll { overflow-x: visible; } }
