/* DevOps Nimbus Terraform. Calm, product-page styling: system font, solid surfaces,
   hairline borders, generous space, and one accent (violet). */
:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #fbfbfd;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --hair: rgba(0, 0, 0, .08);
  --accent: #804fff; --accent-fill: #b294ff; --accent-fill-hover: #9d82e0; --on-fill: #1d1d1f;
  --accent-hover: #6d43d9;
  --accent-2: #2f7fe0;
  --stage-accent: #b294ff; /* the dark stage keeps the dark-mode accent */
  --accent-soft: #f6f2ff;
  --on-accent: #ffffff;
  --stage: #0b0b0d;
  --stage-text: #f5f5f7;
  --stage-muted: #8e8e93;
  --stage-line: rgba(255, 255, 255, .09);
  --ok: #1d8a3a;
  --ok-soft: #e9f6ec;
  --bad: #d70015;
  --bad-soft: #fdecee;
  --warn: #c77700;
  --warn-text: #8a5300;
  --warn-soft: #fff4e0;
  --code-bg: #f0f0f3;
  --nav: #fbfbfd;
  --shadow: 0 2px 8px rgba(0, 0, 0, .04), 0 12px 32px rgba(0, 0, 0, .06);
  --radius: 18px;
  --radius-sm: 12px;
  --ease: cubic-bezier(.28, .11, .32, 1);
  --dur-fast: .15s;
  --dur: .24s;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1c1c1e;
    --surface-2: #161617;
    --text: #f5f5f7;
    --muted: #a1a1a6;
    --line: #424245;
    --hair: rgba(255, 255, 255, .1);
    --accent: #b294ff; --accent-fill: #b294ff; --accent-fill-hover: #bea4ff; --on-fill: #000000;
    --accent-hover: #c1a9ff;
    --accent-2: #5b9ae7;
    --accent-soft: #322d42;
    --on-accent: #000000;
    --ok: #30d158;
    --ok-soft: #0f2e18;
    --bad: #ff6961;
    --bad-soft: #3a1414;
    --warn: #ffb340;
    --warn-text: #ffcc80;
    --warn-soft: #3a2a0c;
    --code-bg: #2c2c2e;
    --nav: #111113;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.47 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  letter-spacing: -.01em;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; font-size: .86em; letter-spacing: 0; }
:not(pre) > code { background: var(--code-bg); padding: .12em .4em; border-radius: 6px; }
pre { background: var(--code-bg); padding: 14px 16px; border-radius: var(--radius-sm); overflow-x: auto; margin: 0; line-height: 1.6; }
h1, h2, h3, h4 { letter-spacing: -.02em; line-height: 1.1; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

.wrap { max-width: 1024px; margin: 0 auto; padding: 0 22px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 6px 10px; z-index: 30; }
.muted { color: var(--muted); }
.note { color: var(--muted); font-size: .88rem; }
.lede { color: var(--muted); font-size: 1.15rem; margin: -6px 0 24px; max-width: 680px; }

/* Navigation: a translucent bar that content scrolls under; its hairline shows once it does. */
.top {
  position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--nav) 72%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid transparent; transition: border-color .2s;
}
.top.scrolled { border-bottom-color: var(--hair); }
.top-inner { display: flex; align-items: center; gap: 20px; height: 52px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .95rem; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { display: block; width: 22px; height: 22px; }
/* Two modes: Learn (the course) and Fix (the reference for something broken now). */
.mode-banner { margin: 32px 0 0; padding: 12px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--hair); box-shadow: inset 3px 0 0 var(--oncall); font-size: .95rem; }

main { padding-top: 8px; padding-bottom: 64px; min-height: 70vh; }
.tab > h2 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 700; margin: 48px 0 14px; }
.tab > .mode-banner + h2 { margin-top: 28px; }

.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 22px;
  border-radius: 99px; font: inherit; font-size: 1rem; color: var(--accent); background: transparent;
  border: 1px solid var(--accent); cursor: pointer; transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.pill:hover { text-decoration: none; background: var(--accent-soft); }
.pill.primary { background: var(--accent-fill); color: var(--on-fill); border-color: var(--accent-fill); }
.pill.primary:hover { background: var(--accent-fill-hover); border-color: var(--accent-fill); }
.small-pill { min-height: 36px; padding: 0 18px; font-size: .9rem; }

.section-title { font-size: clamp(1.7rem, 3.5vw, 2.4rem); font-weight: 700; margin: 72px 0 8px; }
.section-title code { font-size: .78em; }
.section-sub { color: var(--muted); font-size: 1.1rem; margin: 0 0 24px; }

/* Request flow */
.flow-block { margin-top: 24px; }
.flow { list-style: none; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; position: relative; }
.flow::before { content: ""; position: absolute; left: 7%; right: 7%; top: 34px; height: 2px; background: var(--line); z-index: 0; }
.step { position: relative; z-index: 1; }
.step button {
  width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px 12px;
  font: inherit; color: var(--text); background: transparent; border: 0; border-radius: var(--radius-sm); cursor: pointer;
  transition: background .25s var(--ease);
}
.step button:hover { background: var(--surface); }
.step .dot {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: .9rem;
  background: var(--surface); color: var(--muted); border: 2px solid var(--line);
  transition: background .35s var(--ease), border-color .35s var(--ease), color .35s var(--ease), transform .35s var(--ease), box-shadow .35s var(--ease);
}
.step.past .dot { border-color: var(--accent); color: var(--accent); }
.step.on .dot { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-fill); transform: scale(1.12); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 22%, transparent); }
.step-name { font-weight: 600; font-size: .9rem; text-align: center; }
.step-role { font-size: .75rem; color: var(--muted); text-align: center; }
.flow-detail { min-height: 196px; }
.flow-detail h3 { font-size: 1.5rem; margin: 2px 0 8px; }
.flow-detail p { margin: 0 0 14px; max-width: 720px; }
.flow-controls { display: flex; justify-content: center; margin-top: 16px; }

/* Start */
.start-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 20px; }
.start-grid h3 { font-size: 1.3rem; margin: 0 0 4px; }
.start-grid .muted { margin: 0 0 16px; }
pre.start { line-height: 1.7; }
pre.start .cm { color: var(--muted); font-style: normal; }
.start-note { margin: 14px 0 0; font-size: .86rem; line-height: 1.5; color: var(--muted); }
.start-note strong { color: var(--text); font-weight: 600; }
.start-note code { font-size: .82rem; background: var(--code-bg); border-radius: 6px; padding: 1px 6px; }

/* Stages */
.stages { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 22px 0 18px; }
.stage-card {
  display: flex; flex-direction: column; gap: 2px; padding: 16px; border-radius: var(--radius); background: var(--surface);
  color: var(--text); box-shadow: var(--shadow); border: 1px solid var(--hair); transition: transform .25s var(--ease);
}
.stage-card:hover { text-decoration: none; transform: translateY(-2px); }
.stage-card strong { font-size: 1rem; }
.stage-card .muted { font-size: .8rem; }
.stage-num { font-size: .72rem; color: var(--muted); }
.ring {
  --p: 0; width: 28px; height: 28px; border-radius: 50%; margin-bottom: 8px;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--line) 0);
  -webkit-mask: radial-gradient(circle, transparent 9px, #000 10px); mask: radial-gradient(circle, transparent 9px, #000 10px);
}
.stage-card.complete .ring { background: var(--ok); }

.progress-row { display: flex; align-items: center; gap: 14px; margin: 6px 0 8px; }
.bar { flex: 1; height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--accent-fill); border-radius: 99px; transition: width .5s var(--ease); }
#bar-text { color: var(--muted); font-size: .85rem; white-space: nowrap; }

/* Levels */
.stage-title { font-size: 1.25rem; font-weight: 700; margin: 40px 0 12px; }
.levels { list-style: none; padding: 0; margin: 0; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--hair); overflow: hidden; }
.level { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 16px; padding: 16px 20px; border-top: 1px solid var(--hair); transition: background .2s; }
.level:first-child { border-top: 0; }
.level:hover { background: var(--surface-2); }
.level input { width: 20px; height: 20px; accent-color: var(--ok); }
.level .num { font: .82rem "SF Mono", ui-monospace, Menlo, monospace; color: var(--muted); }
.level .what { display: flex; flex-direction: column; min-width: 0; }
.level .what a { font-weight: 600; color: var(--text); }
.level.done .what a { color: var(--muted); }
.level .topic { color: var(--muted); font-size: .88rem; }
.level .actions { display: flex; gap: 14px; align-items: center; }
.small { font-size: .9rem; }
.cmd { font-size: .78rem; }

/* Cards and forms */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--hair); padding: 24px 26px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; color: var(--muted); max-width: 560px; margin-bottom: 22px; }
select, input[type="search"] {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 11px 14px; transition: border-color .2s;
}
select:focus, input[type="search"]:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 4px var(--accent-soft); }

/* Quiz */
.score {
  position: sticky; top: 60px; z-index: 5; background: var(--surface); box-shadow: var(--shadow);
  border: 1px solid var(--hair); border-radius: var(--radius); padding: 14px 20px; margin-bottom: 18px; display: grid; gap: 10px;
}
.score .meter { display: block; height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.score .fill { display: block; height: 100%; width: 0; background: var(--accent-fill); transition: width .35s var(--ease); }
.score .result { margin: 0; }
.linkish { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; }
.linkish:hover { text-decoration: underline; }
.question { margin-bottom: 16px; }
.question h3 { font-size: 1.15rem; margin: 0 0 16px; font-weight: 600; line-height: 1.35; letter-spacing: -.02em; }
.tag { margin: 0 0 6px; font-size: .78rem; color: var(--muted); font-weight: 500; }
.options { display: grid; gap: 10px; }
.opt {
  font: inherit; font-size: 1rem; text-align: left; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 13px 16px; cursor: pointer;
  transition: border-color .2s var(--ease), background .2s var(--ease), transform .15s var(--ease);
}
.opt:hover:not(:disabled) { border-color: var(--accent); background: var(--surface); }
.opt:active:not(:disabled) { transform: scale(.995); }
.opt:disabled { cursor: default; }
.opt.right { border-color: var(--ok); background: var(--ok-soft); }
.opt.right::before { content: "✓  "; color: var(--ok); font-weight: 700; }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.wrong::before { content: "✕  "; color: var(--bad); font-weight: 700; }
.opt:disabled:not(.right):not(.wrong) { opacity: .55; }
.feedback { margin: 14px 0 0; line-height: 1.5; }
.feedback:empty { display: none; }
.feedback.ok strong { color: var(--ok); }
.feedback.bad strong { color: var(--bad); }

/* YAML X-ray */
.seg { display: inline-flex; background: var(--code-bg); border-radius: 99px; padding: 3px; margin-bottom: 18px; flex-wrap: wrap; }
.seg button { font: inherit; font-size: .9rem; border: 0; background: transparent; color: var(--muted); padding: 7px 18px; border-radius: 99px; cursor: pointer; transition: background .2s, color .2s; }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.xray { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.code { list-style: none; margin: 0; padding: 10px 0; background: var(--surface); border: 1px solid var(--hair); box-shadow: var(--shadow); border-radius: var(--radius); overflow-x: auto; counter-reset: ln; }
.code li { counter-increment: ln; display: flex; }
.code li::before { content: counter(ln); width: 38px; flex: none; text-align: right; padding-right: 12px; color: var(--muted); font: .78rem/2.1 "SF Mono", ui-monospace, Menlo, monospace; opacity: .6; }
.line {
  flex: 1; text-align: left; border: 0; background: transparent; color: var(--text);
  font: .85rem/2.1 "SF Mono", ui-monospace, Menlo, Consolas, monospace; white-space: pre; padding: 0 14px 0 4px; cursor: pointer; border-radius: 6px;
  transition: background .15s;
}
.line:hover { background: var(--accent-soft); }
.line.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
#xray-note { position: sticky; top: 72px; }
.line.blank { cursor: default; }
.line.blank:hover { background: none; }
.line.warn { box-shadow: inset 3px 0 0 var(--warn); }
.line.unknown { color: var(--muted); }
.xray-warn { color: var(--warn-text); background: var(--warn-soft); padding: 8px 12px; border-radius: 10px; font-size: .92rem; }
.xray-paste { margin-bottom: 18px; }
.xray-paste-label { display: block; font-weight: 600; margin-bottom: 8px; }
#xray-input {
  width: 100%; font: .86rem/1.6 "SF Mono", ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0; color: var(--text);
  background: var(--code-bg); border: 1px solid transparent; border-radius: var(--radius-sm); padding: 12px 14px; resize: vertical;
}
#xray-input:focus { outline: none; border-color: var(--accent); }
.xray-paste-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 12px; }
.xray-paste { scroll-margin-top: 72px; }
.xray[hidden] { display: none; }
#xray-error { margin: 12px 0 0; }
.xray-result-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 18px; }
.xray-result-bar .note { margin: 2px 0 0; }
.xray-result-title { margin: 0; font-weight: 600; font-size: 1.02rem; }
.xray-result-actions { display: flex; gap: 10px; }
#xray-review:not(:empty) { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--hair); }
.xray-missing summary { cursor: pointer; font-size: .9rem; font-weight: 600; color: var(--warn-text); }
.xray-missing[open] summary { margin-bottom: 6px; }
/* On narrow screens the explanation opens under the line that was picked. */
.code li.note-slot { display: block; counter-increment: none; padding: 6px 10px 10px; }
.code li.note-slot::before { content: none; }
.code li.note-slot #xray-note { position: static; box-shadow: none; }
.xray-review { margin: 6px 0 0; padding-left: 20px; font-size: .9rem; color: var(--muted); }
.xray-review li { margin: 4px 0; }
.strong { font-weight: 600; margin-bottom: 0; }
.quiz-again { margin: -8px 0 20px; }
#xray-note pre { margin-bottom: 14px; white-space: pre-wrap; }

/* Pod doctor */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip { font: inherit; font-size: .88rem; border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 8px 16px; border-radius: 99px; cursor: pointer; transition: border-color .2s, background .2s; }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.doctor-groups { margin: 0 0 20px; padding: 4px 20px; background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); box-shadow: var(--shadow); }
.doctor-group { display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: start; gap: 8px 16px; padding: 12px 0; }
.doctor-group[hidden] { display: none; }
.doctor-group:not([hidden]) ~ .doctor-group:not([hidden]) { border-top: 1px solid var(--hair); }
.doctor-group-name { display: flex; align-items: center; gap: 8px; min-height: 34px; font-size: .84rem; font-weight: 600; letter-spacing: -.01em; }
.doctor-group-count { font-size: .72rem; font-weight: 500; color: var(--muted); background: var(--code-bg); border-radius: 99px; padding: 2px 8px; font-variant-numeric: tabular-nums; }
.doctor-group-items { display: flex; flex-wrap: wrap; gap: 8px; }
.doctor-group .chip { display: inline-flex; align-items: center; min-height: 34px; padding: 6px 14px; font-size: .84rem; line-height: 1.3; text-align: left; }
.doctor-group .chip[hidden] { display: none; }
#doctor-out { scroll-margin-top: 72px; }
#doctor-out h3 { margin-top: 0; font: 600 1.15rem "SF Mono", ui-monospace, Menlo, monospace; letter-spacing: 0; }
#doctor-out h4 { margin: 20px 0 8px; font-size: .9rem; color: var(--muted); font-weight: 600; letter-spacing: -.01em; }
#doctor-out ul { margin: 0; padding-left: 20px; }
#doctor-out .card { min-width: 0; }
#doctor-out pre { max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; }
.doctor-practise { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.doctor-practise > span { margin-right: 4px; }
.learn-it { margin-top: 24px; padding: 18px 20px; border-radius: 14px; background: var(--accent-soft); border: 1px solid var(--hair); }
#doctor-out .learn-it h4 { margin-top: 0; color: var(--text); }
.learn-it > p { margin: 4px 0 0; }

/* Cheat sheet */
.group { font-size: 1rem; color: var(--muted); margin: 28px 0 10px; font-weight: 600; }
.cheats { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--hair); box-shadow: var(--shadow); border-radius: var(--radius); overflow: hidden; }
.cheats li { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 18px; border-top: 1px solid var(--hair); }
.cheats li:first-child { border-top: 0; }
.cheats li > div:first-child { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cheats code { background: none; padding: 0; overflow-wrap: anywhere; }
.cheats .muted { font-size: .86rem; }
.copy { font: inherit; font-size: .8rem; border: 1px solid var(--line); background: var(--surface); color: var(--accent); padding: 5px 12px; border-radius: 99px; cursor: pointer; flex: none; }
.copy:hover { border-color: var(--accent); }
.cheat-actions { display: flex; gap: 6px; flex: none; }
.cheat-actions > :first-child { min-width: 52px; text-align: center; }
.copy.lab { color: var(--muted); text-decoration: none; }
.copy.lab:hover { color: var(--text); border-color: var(--muted); }
.cheat-fill-box summary { cursor: pointer; font-size: .9rem; color: var(--accent); margin-bottom: 10px; width: fit-content; }
.cheat-tools { display: grid; gap: 14px; margin-bottom: 8px; }
.cheat-fill { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.fill { display: grid; gap: 4px; font-size: .78rem; color: var(--muted); }
.fill input {
  font: .84rem "SF Mono", ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; min-width: 0;
}
.fill input:focus { outline: none; border-color: var(--accent); }
.filled { color: var(--accent); font-weight: 600; }
.hole { color: var(--muted); }

.foot { margin-top: 96px; background: var(--surface-2); border-top: 1px solid var(--hair); color: var(--muted); font-size: .86rem; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding-top: 48px; padding-bottom: 36px; }
.foot-brand .brand { font-size: 1.05rem; gap: 10px; }
.foot-brand .brand img { width: 28px; height: 28px; }
.foot-brand p { margin: 14px 0 18px; max-width: 420px; line-height: 1.55; }
.foot-col { display: flex; flex-direction: column; gap: 10px; }
.foot-col h2 { margin: 4px 0 4px; font-size: .8rem; font-weight: 600; color: var(--text); letter-spacing: 0; }
.foot-col a { color: var(--muted); width: fit-content; transition: color var(--dur-fast) var(--ease); }
.foot-col a:hover { color: var(--text); text-decoration: none; }
.foot-base { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--hair); padding-top: 18px; padding-bottom: 40px; font-size: .8rem; }
.foot-base p { margin: 0; }
.foot-base a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.foot-base .foot-tm { margin-top: 4px; font-size: .74rem; }

@media (max-width: 860px) {
  .flow { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 4px; }
  .flow::before { display: none; }
  .start-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .hero { padding: 48px 0 24px; }
  .flow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .level { grid-template-columns: auto 1fr; padding: 14px 16px; }
  .level .num { display: none; }
  .level .actions { grid-column: 2; }
  .level .cmd { display: none; }
  .xray { grid-template-columns: 1fr; }
  .cheat-fill { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #xray-note { position: static; }
  .card { padding: 20px; }
}
/* "How to use this" guide on every page */
.guide { margin: 0 0 24px; background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); box-shadow: var(--shadow); }
.guide summary {
  cursor: pointer; padding: 14px 20px; font-weight: 600; font-size: .95rem; color: var(--accent); list-style: none;
  display: flex; align-items: center; gap: 8px;
}
.guide summary::-webkit-details-marker { display: none; }
.guide summary::before { content: "›"; display: inline-block; transition: transform .2s var(--ease); font-size: 1.1rem; line-height: 1; }
.guide[open] summary::before { transform: rotate(90deg); }
.guide-body { padding: 0 20px 18px; font-size: .95rem; }
.guide-body > p { margin: 0 0 14px; max-width: 760px; }
.guide-cols { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 8px 32px; }
.guide h3 { font-size: .82rem; color: var(--muted); font-weight: 600; margin: 4px 0 6px; letter-spacing: 0; }
.guide ol, .guide ul { margin: 0 0 12px; padding-left: 20px; }
.guide li { margin: 5px 0; }
@media (max-width: 720px) {
  .guide-cols { grid-template-columns: 1fr; }
  .guide-body { padding: 0 16px 16px; }
}

/* Search button and command palette */
.kbd-btn {
  display: inline-flex; align-items: center; gap: 10px; font: inherit; font-size: .8rem; color: var(--muted);
  background: var(--code-bg); border: 1px solid transparent; border-radius: 99px; padding: 5px 6px 5px 14px; cursor: pointer;
  transition: border-color .2s;
}
.kbd-btn:hover { border-color: var(--line); }
kbd {
  font: 500 .72rem/1 "SF Mono", ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0; color: var(--muted);
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px;
}
/* The palette is a material: --p (0 to 1, set by app.js) scales it out of the search button
   and brings in its opacity, its blur and the dimming behind it together. */
.palette {
  --p: 1; width: min(600px, calc(100vw - 32px)); margin: 12vh auto auto; padding: 0; border: 1px solid var(--hair);
  border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--text);
  box-shadow: 0 32px 80px rgba(0, 0, 0, .22), 0 2px 8px rgba(0, 0, 0, .06);
  -webkit-backdrop-filter: saturate(calc(1 + .8 * var(--p))) blur(calc(30px * var(--p))); backdrop-filter: saturate(calc(1 + .8 * var(--p))) blur(calc(30px * var(--p)));
  opacity: var(--p); transform: scale(calc(.92 + .08 * var(--p))); transform-origin: var(--ox, 50%) var(--oy, 0);
}
.palette::backdrop { background: rgb(0 0 0 / calc(var(--p, 1) * .28)); }
.palette-grip { display: none; }
/* On phones it opens as a bottom sheet (class set by app.js): docked to the bottom edge and moved
   by --y; its grip strip is the handle for dragging it down. It covers most of the screen, so it
   is solid: through it the page would only show as ghosts. ::after carries the surface below it
   when it is pulled up. */
.palette.sheet { width: 100%; max-width: none; max-height: 80vh; margin: auto 0 0; overflow: visible; border-width: 1px 0 0; border-radius: 22px 22px 0 0;
  padding-bottom: max(16px, env(safe-area-inset-bottom)); background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none;
  opacity: 1; transform: translateY(var(--y, 0px)); }
.palette.sheet[open] { display: flex; flex-direction: column; }
.palette.sheet::after { content: ""; position: absolute; top: 100%; left: 0; right: 0; height: 120px; background: inherit; }
.palette.sheet .palette-grip { display: block; flex: none; height: 22px; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.palette.sheet .palette-grip::before { content: ""; display: block; width: 40px; height: 5px; margin: 9px auto 0; border-radius: 3px; background: var(--line); }
.palette.sheet #palette-list { flex: 1 1 auto; min-height: 0; max-height: none; }
#palette-input {
  width: 100%; font: inherit; font-size: 1.1rem; color: var(--text); background: transparent;
  border: 0; border-bottom: 1px solid var(--hair); padding: 18px 20px; outline: none;
}
#palette-list { list-style: none; margin: 0; padding: 8px; max-height: 50vh; overflow-y: auto; }
#palette-list li { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
#palette-list li[aria-selected="true"] { background: var(--accent-soft); }
#palette-list li[aria-selected="true"] .pal-label { color: var(--accent); }
.pal-kind { color: var(--muted); font-size: .78rem; flex: none; }
#palette-list .pal-empty { color: var(--muted); cursor: default; }
.palette-foot { font-size: .76rem; margin: 0; padding: 10px 20px 14px; border-top: 1px solid var(--hair); }

/* Playground: a simulated terminal beside a live cluster map */
.playground { margin-top: 8px; }
.pg-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.pg-head .section-title { margin-top: 32px; }
.pg-goal {
  margin: 0 0 24px; font-size: .9rem; font-weight: 500; padding: 8px 14px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--hair); color: var(--muted);
}
.pg-goal.done { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
/* app.js sets --term, the terminal's share, from the divider; the side panel takes the rest. */
.pg-body { position: relative; display: grid; grid-template-columns: minmax(0, var(--term, 72%)) minmax(0, 1fr); gap: 16px; align-items: start; }
.pg-split { position: absolute; top: 0; bottom: 0; left: calc(var(--term, 72%) + 2px); width: 12px; cursor: col-resize; touch-action: none; }
.pg-split::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; margin-left: -.5px; background: var(--hair); transition: background-color .15s, transform .15s; }
.pg-split:is(:hover, :focus-visible, :active)::before { transform: scaleX(3); background: var(--accent); }
.pg-split:focus-visible { outline: none; } /* the thick accent line is its focus ring */
.pg-term {
  background: #0d1117; color: #e6edf3; border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden; cursor: text;
  border: 1px solid var(--hair);
}
.pg-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.pg-bar span { width: 11px; height: 11px; border-radius: 50%; background: #3a3f47; }
.pg-bar em { margin-left: auto; font-style: normal; font-size: .76rem; color: #8b949e; }
.pg-out {
  overflow: auto; padding: 14px 18px 4px; height: clamp(460px, 62vh, 720px);
  font: 13px/1.6 "SF Mono", ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0;
}
.pg-line { white-space: pre-wrap; word-break: break-word; min-height: 1.6em; }
.pg-line.row, .pg-line.head { white-space: pre; word-break: normal; }
.pg-line.dim, .pg-line.na { color: #8b949e; }
.pg-line.head { color: #8b949e; }
.pg-line.cmd { color: #79c0ff; }
.pg-line.warn { color: #ffa198; }
.pg-line.ok { color: #56d364; font-weight: 600; }
.pg-form { display: flex; align-items: center; gap: 10px; padding: 10px 18px 16px; font: 13px "SF Mono", ui-monospace, Menlo, Consolas, monospace; }
.pg-form span { color: #56d364; }
#pg-input {
  flex: 1; font: inherit; color: #e6edf3; background: transparent; border: 0; outline: none; padding: 4px 0; caret-color: #56d364;
}
#pg-input::placeholder { color: #484f58; }
.pg-term:focus-within { border-color: var(--accent); }
.pg-side { display: flex; flex-direction: column; gap: 12px; }
.pg-map { display: grid; gap: 10px; }
.pg-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.pg-meta-item { font-size: .76rem; padding: 5px 10px; border-radius: 99px; background: var(--surface); border: 1px solid var(--hair); }
.pg-meta-item strong { font-weight: 600; }
.pg-meta-item.bad { background: var(--warn-soft); border-color: transparent; color: var(--warn-text); }
.pg-meta-item.bad .muted { color: inherit; }
.pg-res { display: grid; gap: 6px; background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius-sm); padding: 10px; }
.pg-r {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; width: 100%; text-align: left;
  font: .76rem/1.3 "SF Mono", ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0; color: inherit;
  padding: 7px 10px 7px 7px; border-radius: 10px; border: 0; background: var(--code-bg); cursor: pointer;
}
.pg-r:hover { box-shadow: 0 0 0 1px var(--line); }
.pg-r-addr { overflow-wrap: anywhere; }
.pg-r-note { color: var(--muted); font-size: .72rem; }
.pg-dot { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; font-size: .66rem; font-weight: 700; color: #fff; background: var(--muted); }
.pg-r.ok .pg-dot { background: var(--ok); }
.pg-r.drift, .pg-r.gone { background: var(--warn-soft); color: var(--warn-text); }
.pg-r.drift .pg-dot, .pg-r.gone .pg-dot { background: var(--warn); }
.pg-r.gone .pg-r-addr { text-decoration: line-through; }
.pg-r.plan { background: transparent; border: 1px dashed var(--line); }
.pg-r.plan .pg-dot { background: var(--accent-fill); }
.pg-check { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--hair); background: var(--surface); font-size: .84rem; }
.pg-check-label { font-weight: 600; }
.pg-check-text { margin-left: auto; font-weight: 500; }
.pg-check.ok .pg-check-text { color: var(--ok); }
.pg-check.bad .pg-check-text { color: var(--bad); }
.pg-scenarios { margin: 0 0 16px; padding: 4px 20px; background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); box-shadow: var(--shadow); }
.pg-group { display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: start; gap: 8px 16px; padding: 12px 0; }
.pg-group + .pg-group { border-top: 1px solid var(--hair); }
/* As tall as one row of buttons, so the name lines up with the first row. */
.pg-group-name { display: flex; align-items: center; gap: 8px; min-height: 34px; font-size: .84rem; font-weight: 600; color: var(--text); letter-spacing: -.01em; }
.pg-group-count { font-size: .72rem; font-weight: 500; color: var(--muted); background: var(--code-bg); border-radius: 99px; padding: 2px 8px; font-variant-numeric: tabular-nums; }
.pg-group-count.done { color: var(--ok); }
.pg-group-items { display: flex; flex-wrap: wrap; gap: 8px; }
.pg-scn {
  font: inherit; font-size: .84rem; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 99px; white-space: nowrap;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; transition: border-color .2s, background .2s;
}
.pg-scn:hover { border-color: var(--accent); }
.pg-scn[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.pg-scn-done { color: var(--ok); font-weight: 700; }
.pg-scn[aria-pressed="true"] .pg-scn-done { color: inherit; }
.pg-try { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pg-try .chip { font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; font-size: .76rem; letter-spacing: 0; padding: 6px 12px; }
@media (prefers-color-scheme: dark) {
  .pg-term { background: #0d1117; border-color: rgba(255, 255, 255, .12); }
  .pg-dot { color: #000; }
  .palette { box-shadow: 0 32px 80px rgba(0, 0, 0, .7); }
  .palette::backdrop { background: rgb(0 0 0 / calc(var(--p, 1) * .55)); }
}
@media (max-width: 860px) {
  .doctor-group { grid-template-columns: 1fr; }
  .doctor-group-name { min-height: 0; }
  .pg-body { grid-template-columns: 1fr; }
  .pg-split { display: none; }
  .pg-group { grid-template-columns: 1fr; gap: 8px; }
  .pg-group-name { min-height: 0; }
  .pg-out { height: 280px; }
  .pg-term { min-height: 0; }
}
@media (max-width: 720px) {
  .kbd-btn span { display: none; }
  .kbd-btn { padding: 5px; }
  .pg-goal { margin-bottom: 16px; }
  .pg-out, .pg-form { font-size: 12px; padding-left: 14px; padding-right: 14px; }
  .pg-scenarios { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -22px 14px; padding: 2px 22px; scroll-snap-type: x proximity; background: none; border: 0; border-radius: 0; box-shadow: none; }
  .pg-group, .pg-group-items { display: contents; }
  .pg-group-name { flex: none; align-self: center; min-height: 0; padding: 0 0 0 12px; margin-left: 4px; border-left: 1px solid var(--line); }
  .pg-group:first-child .pg-group-name { border-left: 0; padding-left: 0; }
  .pg-scenarios::-webkit-scrollbar { display: none; }
  .pg-scn { flex: none; scroll-snap-align: start; }
}

/* Motion: one easing, two durations, and only where it says what changed. */
@keyframes kq-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes kq-pod-in { from { opacity: 0; transform: scale(.9); } }
@keyframes kq-pop { 0% { opacity: 0; transform: scale(.4); } 60% { transform: scale(1.25); } 100% { opacity: 1; transform: none; } }
@keyframes kq-bump { 50% { transform: scale(1.2); } }
@keyframes kq-nudge { 50% { transform: scale(1.015); } }
@keyframes kq-shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@keyframes kq-heal { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); } to { box-shadow: 0 0 0 10px transparent; } }
.tab.tab-in { animation: kq-in var(--dur) var(--ease) both; }
.pg-r.is-new { animation: kq-pod-in .32s var(--ease) both; }
.pg-r.is-healed { animation: kq-heal .9s var(--ease); }
.pg-r.is-healed .pg-dot { animation: kq-pop .45s var(--ease) both; }
.pg-goal.done { animation: kq-in var(--dur) var(--ease); }
.pg-scn.just-solved .pg-scn-done { display: inline-block; animation: kq-pop .5s var(--ease) both; }
.pg-group-count.bump { display: inline-block; animation: kq-bump .4s var(--ease) .1s; }
.opt.right { animation: kq-nudge .3s var(--ease); }
.opt.wrong { animation: kq-shake .36s var(--ease); }
.feedback.ok, .feedback.bad { animation: kq-in var(--dur) var(--ease) both; }
.copy, .chip, .pg-scn, .pg-r { transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
.score, .pg-group-count, .doctor-group-count, .arch-step { font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}


.link-btn { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* Architecture: a diagram whose components explain themselves. */
:root { --arch-cp: color-mix(in srgb, var(--accent) 8%, transparent); }
.arch-figure { position: relative; background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.arch-svg { display: block; width: 100%; height: auto; font-family: inherit; }
.arch-panel { fill: var(--surface-2); stroke: var(--line); stroke-width: 1; }
.arch-panel.arch-cp { fill: var(--arch-cp); stroke: none; }
.arch-panel.arch-addon { stroke-dasharray: 5 4; }
.arch-panel-label { fill: var(--muted); font-size: 12px; font-weight: 600; }
.arch-edge { fill: none; stroke: var(--line); stroke-width: 1.5; transition: stroke .15s, opacity .15s; }
.arch-edge.is-on { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 6 5; animation: arch-flow .9s linear infinite; }
@keyframes arch-flow { to { stroke-dashoffset: -11; } }
.arch-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; opacity: 0; transition: opacity .2s; }
.arch-dot.is-on { opacity: 1; }
.arch-tour { display: flex; align-items: center; gap: 14px; margin-top: 14px; flex-wrap: wrap; }
.arch-caption { margin: 0; color: var(--muted); font-size: .95rem; flex: 1; min-width: 220px; }
.arch-step { display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: .78rem; font-weight: 600; }
.arch-svg.is-entering .arch-panel, .arch-svg.is-entering .arch-panel-label { animation: arch-fade .5s var(--ease) both; }
.arch-svg.is-entering .arch-box { animation: arch-rise .5s var(--ease) both; }
.arch-svg.is-entering .arch-edge { animation: arch-fade .6s var(--ease) .7s both; }
@keyframes arch-fade { from { opacity: 0; } }
@keyframes arch-rise { from { opacity: 0; transform: translateY(6px); } }
#arch-arrow path { fill: var(--line); }
#arch-arrow-on path { fill: var(--accent); }
.arch-box { cursor: pointer; outline: none; transition: opacity .15s; }
.arch-box rect { fill: var(--surface); stroke: var(--line); stroke-width: 1; transition: fill .15s, stroke .15s; }
.arch-box.arch-cp rect { stroke: var(--accent); }
.arch-box.arch-addon rect { stroke-dasharray: 4 3; }
.arch-name { fill: var(--text); font-weight: 600; text-anchor: middle; }
.arch-short { fill: var(--muted); text-anchor: middle; }
.arch-box:hover rect, .arch-box.is-on rect { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2; filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--accent) 22%, transparent)); }
.arch-box.is-near rect { stroke: var(--accent); }
.arch-box:focus-visible rect { stroke: var(--accent); stroke-width: 3; }
.has-focus .arch-box:not(.is-on):not(.is-near) { opacity: .4; }
.has-focus .arch-edge:not(.is-on) { opacity: .4; }
.arch-tip { position: absolute; left: 0; top: 0; width: 300px; pointer-events: none; background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 14px 16px; z-index: 2;
  opacity: 0; visibility: hidden; transform: translateY(4px); transition: opacity .16s var(--ease), transform .16s var(--ease), visibility .16s; }
.arch-tip.is-shown { opacity: 1; visibility: visible; transform: none; }
.arch-tip h3 { margin: 0 0 4px; font-size: 1rem; }
.arch-tip p { margin: 0 0 8px; font-size: .86rem; line-height: 1.45; }
.arch-tip p:last-child { margin: 0; }
.arch-detail { margin-top: 16px; }
.arch-detail h3 { margin: 0 0 6px; font-size: 1.15rem; }
.arch-detail h4 { margin: 14px 0 4px; font-size: .85rem; color: var(--muted); font-weight: 600; }
.arch-detail p, .arch-detail ul { margin: 0; font-size: .92rem; line-height: 1.5; }
.arch-detail ul { padding-left: 18px; }
.arch-detail pre { margin: 6px 0 0; font-size: .8rem; white-space: pre-wrap; word-break: break-word; }
.arch-detail .doctor-practise { margin-top: 14px; }
.arch-where { color: var(--accent); font-size: .78rem; font-weight: 600; }
.arch-detail .arch-where { margin: 0 0 2px; }
@media (max-width: 720px) {
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 28px; padding-top: 36px; }
  .foot-brand { grid-column: 1 / -1; }
  .cheats li { flex-direction: column; align-items: stretch; gap: 10px; }
  .cheats code { overflow-wrap: break-word; }
  .arch-figure { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .arch-edge, .arch-box, .arch-box rect, .arch-tip, .arch-dot { transition: none; }
  .arch-edge.is-on { animation: none; stroke-dasharray: none; }
}

/* Landing: the approved split composition, a stage for the signature, stats and a bento grid. */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 56px; align-items: center; padding: 72px 0 40px; position: relative; }
.eyebrow { display: flex; align-items: center; gap: 10px; color: var(--accent); font-weight: 600; font-size: 1.1rem; margin: 0 0 8px; }
.eyebrow img { width: 28px; height: 28px; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); font-weight: 700; letter-spacing: -.02em; margin: 0 0 18px; line-height: 1.04; }
.hero .sub { color: var(--muted); font-size: clamp(1.1rem, 2vw, 1.4rem); line-height: 1.38; max-width: 560px; margin: 0 0 30px; letter-spacing: -.02em; }
.ctas { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.link-more { font-size: 1.05rem; }
.link-more::after { content: " ›"; }
/* The doors span a row of their own under the text and the stage; on phones they come before the stage. */
.doors { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }
.door { padding: 24px 26px; border-radius: 22px; border: 1px solid var(--hair); background: var(--surface); display: flex; flex-direction: column; gap: 6px; }
.door h2 { margin: 0; font-size: 1.35rem; letter-spacing: -.02em; }
.door p { margin: 0; color: var(--muted); }
.door .door-k { font-size: .85rem; font-weight: 600; color: var(--accent); }
.door .ctas { margin-top: 10px; }
.door-search { display: flex; gap: 8px; margin-top: 10px; }
.door-search input[type="search"] { flex: 1; min-width: 0; border-radius: 99px; }
.stage {
  position: relative; margin: 0; background: var(--stage); color: var(--stage-text); border-radius: 30px; padding: 30px; min-height: 340px;
  overflow: hidden; isolation: isolate; box-shadow: 0 30px 80px -30px color-mix(in srgb, var(--accent) 45%, transparent);
}
.stage::before { content: ""; position: absolute; inset: -40% -10% auto; height: 120%; background: radial-gradient(closest-side, color-mix(in srgb, var(--stage-accent) 30%, transparent), transparent 70%); z-index: -1; pointer-events: none; }
.stage-bar { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 20px; font-size: .8rem; color: var(--stage-muted); flex-wrap: wrap; }
.stage-bar strong { display: block; color: var(--stage-text); font-weight: 600; font-size: .95rem; }
.toggle { font: inherit; font-size: .8rem; border: 1px solid var(--stage-line); background: rgba(255, 255, 255, .06); color: var(--stage-text); border-radius: 99px; padding: 7px 14px; cursor: pointer; transition: background .2s, border-color .2s; }
.toggle:hover, .toggle[aria-pressed="true"] { border-color: var(--stage-accent); background: color-mix(in srgb, var(--stage-accent) 18%, transparent); }
.mono { font: 13px/1.65 "SF Mono", ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0; }
.plan div { padding: 6px 10px; border-radius: 8px; transition: background .3s var(--ease), opacity .3s; }
.plan .replace { background: rgba(255, 69, 58, .14); }
.plan .pin { background: rgba(48, 209, 88, .1); }
.s-ok { color: #30d158; } .s-warn { color: #ffd60a; } .s-bad { color: #ff6961; } .s-dim { color: var(--stage-muted); }
.summary { margin-top: 16px; font-size: .9rem; }
.stage-foot { margin-top: 18px; font-size: .8rem; }
.stage-foot a { color: var(--stage-accent); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--hair); border-radius: 22px; overflow: hidden; margin: 24px 0 0; border: 1px solid var(--hair); }
.stats div { background: var(--surface); padding: 24px 26px; }
.stats b { display: block; font-size: 2.4rem; letter-spacing: -.04em; line-height: 1.1; }
.stats span { color: var(--muted); font-size: .92rem; }
.bento-block h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -.02em; line-height: 1.08; margin: 88px 0 32px; max-width: 760px; }
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; }
.tile {
  background: var(--surface); border: 1px solid var(--hair); border-radius: 26px; padding: 26px; grid-column: span 2; min-height: 200px; color: var(--text);
  display: flex; flex-direction: column; justify-content: space-between; box-shadow: var(--shadow); transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.tile:hover { text-decoration: none; transform: translateY(-3px); }
.tile.wide { grid-column: span 3; }
.tile .k { color: var(--accent); font-weight: 600; font-size: .9rem; }
.tile h3 { font-size: 1.5rem; letter-spacing: -.03em; line-height: 1.12; margin: 8px 0 0; }
.tile p { color: var(--muted); margin: 10px 0 0; font-size: .92rem; }
/* Press feedback lands on pointer-down. It comes after the hover lifts so that a press wins. */
:is(.pill, .kbd-btn, .copy, .toggle, .chip, .pg-scn, .pg-r, .tile, .stage-card, .sw):active { transform: scale(.97); transition: transform .1s ease-out; }

/* Playground additions: story, copy link, editor beside the terminal. */
.pg-title-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.pg-story { margin: 0 0 14px; color: var(--muted); max-width: 760px; }
.pg-story strong { color: var(--text); }
.pg-main { display: grid; gap: 12px; min-width: 0; }
.pg-editor { padding: 16px 18px; }
.pg-panel-name { font-size: .78rem; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.pg-tabs { display: flex; flex-wrap: wrap; max-width: 100%; }
.pg-tabs button { font: .78rem "SF Mono", ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0; padding: 6px 12px; }
.pg-edit {
  width: 100%; font: 13px/1.6 "SF Mono", ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0; color: var(--text); tab-size: 2;
  background: var(--code-bg); border: 1px solid transparent; border-radius: var(--radius-sm); padding: 12px 14px; resize: vertical; white-space: pre; overflow: auto;
}
.pg-edit:focus { outline: none; border-color: var(--accent); }
.pg-editor .note { margin: 8px 0 0; }
.pg-line.add { color: #56d364; }
.pg-line.chg { color: #e3b341; }
.pg-line.del { color: #ffa198; }
.pg-line.plan { font-weight: 600; }
.pg-line.prompt { color: #d2a8ff; }
.pg-line.note, .pg-line.na { color: #8b949e; }
.copy-link { font: inherit; font-size: .8rem; border: 1px solid var(--line); background: var(--surface); color: var(--accent); padding: 4px 12px; border-radius: 99px; cursor: pointer; }
.copy-link:hover { border-color: var(--accent); }

/* Path: levels with what you learn and their labs. */
.level { grid-template-columns: auto auto 1fr; align-items: start; }
.level .what strong { font-weight: 600; }
.level .learn { color: var(--muted); font-size: .9rem; margin: 4px 0 8px; }
.level-labs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.level-labs .chip { font-size: .78rem; padding: 4px 12px; }
.level-labs a.small { margin-left: 4px; }

/* Troubleshoot: reference answers. */
.doctor-search { display: grid; gap: 6px; max-width: 760px; margin-bottom: 18px; font-size: .9rem; color: var(--muted); }
#doctor-q { font: .9rem/1.5 "SF Mono", ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 14px; resize: vertical; min-height: 48px; }
#doctor-q:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 4px var(--accent-soft); }
.doctor-hits { margin: 0 0 18px; }
.problem-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.problem-head h3 { margin: 0; font-size: 1.3rem; }
pre.err { color: var(--bad); white-space: pre-wrap; overflow-wrap: anywhere; }
.problem ol, .problem ul { margin: 0; padding-left: 20px; }
.problem li { margin: 4px 0; }
.problem ol.causes { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; counter-reset: cause; }
.problem li.cause { margin: 0; padding: 14px 16px 14px 46px; border: 1px solid var(--hair); border-radius: var(--radius-sm); position: relative; counter-increment: cause; }
.problem li.cause::before { content: counter(cause); position: absolute; left: 16px; top: 14px; width: 20px; height: 20px; border-radius: 99px; background: var(--code-bg); color: var(--muted); font-size: .78rem; line-height: 20px; text-align: center; }
.cause-why { margin: 0; }
.cause-label { margin: 12px 0 4px; font-size: .78rem; font-weight: 500; color: var(--muted); }
.cause-fix { margin: 0; }
.cause-check { position: relative; }
.cause-check pre { padding-right: 64px; }
.cause-check .copy { position: absolute; top: 8px; right: 8px; }
@media (max-width: 520px) {
  .problem li.cause { padding: 12px 12px 12px 40px; }
  .problem li.cause::before { left: 12px; top: 12px; }
  .cause-check pre { padding-right: 16px; }
  .cause-check .copy { position: static; margin-top: 6px; }
}

/* OpenTofu note and practise-at-home cards. */
.tofu p { margin: 0 0 10px; }

@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 36px; padding-top: 48px; }
  .bento { grid-template-columns: 1fr; }
  .tile, .tile.wide { grid-column: auto; min-height: 0; }
  .stages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .stats { grid-template-columns: 1fr; }
  .doors { grid-template-columns: minmax(0, 1fr); }
  .door-search { flex-direction: column; }
  .stage { padding: 20px; border-radius: 24px; min-height: 0; }
  .mono { font-size: 11.5px; }
  .level { grid-template-columns: auto minmax(0, 1fr); }
  .pg-edit { font-size: 12px; }
}

/* problems.html, the plain reference */
.problems-page { padding-top: 40px; }
.problems-page h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 12px; }
.problems-page nav h2 { font-size: 1rem; margin: 24px 0 6px; }
.problems-page nav ul { margin: 0; padding-left: 20px; columns: 2; }
.problems-page .problem { margin-top: 24px; min-width: 0; }
.problems-page pre { max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; }
.problems-page .problem h2 { margin-top: 0; font-size: 1.3rem; }
.problems-page .problem h3 { font-size: .9rem; color: var(--muted); margin: 16px 0 6px; }
@media (max-width: 720px) { .problems-page nav ul { columns: 1; } }
.problem :not(pre) > code, .problems-page li code { overflow-wrap: anywhere; }
.problem li, .problem p, .problem h2, .problem h3 { overflow-wrap: anywhere; }

/* Learning loop: continue, on-call shift, score, skill radar and learning uptime. */
.engage { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 16px 0 0; text-align: left; }
.eng-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 24px; border-radius: 22px; background: var(--surface); border: 1px solid var(--hair); }
.eng-card h3 { margin: 0; font-size: 1.2rem; letter-spacing: -.02em; }
.eng-card p { margin: 0; color: var(--muted); font-size: .95rem; }
.eng-card > .pill, .eng-card > .eng-row { margin-top: auto; }
.eng-card > p:not(.eng-k) { margin-bottom: 10px; }
.eng-k { display: flex; align-items: center; gap: 8px; color: var(--accent) !important; font-weight: 600; font-size: .85rem !important; }
.eng-shift.paging { background: var(--warn-soft); border-color: var(--warn); }
.eng-shift.paging .eng-k { color: var(--warn-text) !important; }
.eng-time { font-variant-numeric: tabular-nums; }
.eng-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--warn); animation: eng-page 1.2s ease-in-out infinite; }
@keyframes eng-page { 50% { opacity: .25; } }
.eng-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 12px; }
.eng-row .more { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 0; }
.eng-score { display: flex; align-items: baseline; gap: 10px; color: var(--text) !important; font-size: 2.2rem !important; font-weight: 700; letter-spacing: -.04em; line-height: 1.1; }
.eng-score span { font-size: .95rem; font-weight: 600; letter-spacing: 0; color: var(--accent); }
.eng-bar { display: block; width: 100%; height: 6px; border-radius: 99px; background: var(--code-bg); overflow: hidden; margin: 4px 0; }
.eng-bar-fill { display: block; height: 100%; border-radius: inherit; background: var(--accent-fill); }
.eng-session { font-size: .85rem !important; font-variant-numeric: tabular-nums; }
.eng-board { grid-column: 1 / -1; padding: 24px; border-radius: 22px; background: var(--surface); border: 1px solid var(--hair); display: grid; gap: 16px; }
.eng-panels { display: grid; grid-template-columns: 1fr 1.3fr; gap: 16px; }
.eng-panel { display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--hair); }
.eng-panel p { margin: 0; color: var(--muted); font-size: .9rem; }
.eng-radar { width: 100%; max-width: 340px; align-self: center; margin: 4px 0; overflow: visible; }
.eng-r-grid { fill: none; stroke: var(--line); stroke-width: 1; }
.eng-r-shape { fill: color-mix(in srgb, var(--accent) 22%, transparent); stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.eng-r-dot { fill: var(--accent); }
.eng-r-label { fill: var(--muted); font-size: 10.5px; font-family: inherit; }
.eng-slo { padding: 3px 10px; border-radius: 99px; font-size: .78rem !important; }
.eng-slo.ok { color: var(--ok) !important; background: var(--ok-soft); }
.eng-slo.low { color: var(--warn-text) !important; background: var(--warn-soft); }
.eng-uptime { display: flex; gap: 2px; height: 96px; margin-top: 14px; }
.eng-30 { display: none; }
.eng-up { flex: 1; border-radius: 2px; background: var(--code-bg); }
.eng-up.on { background: var(--accent-2); }
.eng-up-axis { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); }
.eng-budget { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 10px; font-size: .88rem; }
.eng-pips { display: flex; gap: 4px; }
.eng-pips span { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--accent-2); }
.eng-pips span.on { background: var(--accent-2); }
.eng-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--hair); border-radius: 14px; overflow: hidden; border: 1px solid var(--hair); }
.eng-stats div { background: var(--surface); padding: 14px 16px; display: flex; flex-direction: column; }
.eng-stats b { font-size: 1.3rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.eng-stats span { color: var(--muted); font-size: .82rem; }
.eng-msg { margin: 0; font-size: .9rem; color: var(--muted); }
@media (max-width: 860px) { .engage { grid-template-columns: 1fr; } .eng-panels, .eng-stats { grid-template-columns: 1fr 1fr; } .eng-panels { grid-template-columns: 1fr; } .eng-up:nth-child(-n+60), .eng-90 { display: none; } .eng-30 { display: inline; } .eng-uptime { height: 64px; gap: 3px; } .eng-stats div:last-child { grid-column: 1 / -1; } }

/* DevOps Nimbus brand: the loop mark in the header and footer. */
.brand .mark { width: 37px; }
.foot-brand .brand img.mark { width: 47px; }
.eng-carry { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.eng-file { position: relative; }
.eng-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.eng-file:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Header: a Learn | Fix switch, then the current mode's pages. Learn is light; Fix is "on-call dark". */
:root { --oncall: #1d1d1f; --on-oncall: #ffffff; }
@media (prefers-color-scheme: dark) { :root { --oncall: #f5f5f7; --on-oncall: #000000; } }
.top { padding-bottom: 0; }
.top-inner { justify-content: space-between; }
.switch { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 99px; background: var(--code-bg); flex: none; }
/* The chip is moved by app.js and sits under the labels. data-side is the side it is nearer:
   that label takes the highlight and lets presses through, so the chip itself can be dragged. */
.switch { isolation: isolate; }
.sw-chip { position: absolute; z-index: -1; inset: 3px auto 3px 3px; width: calc(50% - 3px); border-radius: 99px; background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
  cursor: grab; touch-action: none; transition: background-color .2s, scale .1s ease-out; }
.sw-chip:active { cursor: grabbing; scale: .97; }
.switch[data-side="fix"] .sw-chip { background: var(--oncall); }
.switch[data-side="learn"] .sw.learn, .switch[data-side="fix"] .sw.fix { pointer-events: none; }
.sw { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 96px; padding: 6px 16px; border-radius: 99px; font-size: .86rem; font-weight: 600; color: var(--muted); text-decoration: none; transition: color .28s; }
.sw:hover { text-decoration: none; color: var(--text); }
.switch[data-side="learn"] .sw.learn { color: var(--accent); }
.switch[data-side="fix"] .sw.fix { color: var(--on-oncall); }
.sub-row { box-shadow: 0 -1px 0 var(--hair); max-width: none; }
.sub-row > .subnav { max-width: 1080px; margin: 0 auto; }
.subnav { position: relative; display: flex; justify-content: center; }
.subnav .mode { display: flex; align-items: center; gap: 4px; }
.subnav .mode.fix, [data-mode="fix"] .subnav .mode.learn { display: none; }
[data-mode="fix"] .subnav .mode.fix { display: flex; }
.subnav .mode-k { font-size: .78rem; color: var(--muted); margin-right: 14px; white-space: nowrap; }
.subnav a { position: relative; padding: 11px 12px; font-size: .84rem; color: var(--text); opacity: .75; text-decoration: none; white-space: nowrap; }
.subnav a:hover { opacity: 1; text-decoration: none; }
.subnav a[aria-current="page"] { opacity: 1; font-weight: 600; }
/* One underline for the row, 1px wide and scaled to the active tab by app.js. */
.tab-ind { display: none; position: absolute; left: 0; bottom: 0; width: 1px; height: 2px; background: var(--accent-fill); transform-origin: 0 0; pointer-events: none; }
[data-mode] .tab-ind { display: block; }
[data-mode="fix"] .tab-ind { background: var(--oncall); }
@media (max-width: 720px) {
  .top-inner { flex-wrap: wrap; height: auto; gap: 8px 10px; padding-top: 8px; padding-bottom: 8px; }
  .brand { flex: 1; }
  .switch { order: 3; flex-basis: 100%; }
  .subnav .mode-k { display: none; }
  .subnav { justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  .sw { min-width: 0; padding: 6px 12px; }
  .subnav a { padding: 11px 8px; font-size: .8rem; }
}
@media (prefers-reduced-transparency: reduce) {
  .top { background: var(--nav); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .palette { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  .top, .top.scrolled { background: var(--nav); -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom-color: var(--text); }
  .palette { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; border-color: var(--text); }
  .sw-chip { box-shadow: 0 0 0 1px var(--text); }
}
.door.fix { background: var(--oncall); border-color: transparent; color: var(--on-oncall); }
.door.fix p, .door.fix .door-k { color: color-mix(in srgb, var(--on-oncall) 72%, transparent); }
.door.fix .pill { background: var(--on-oncall); color: var(--oncall); border-color: transparent; font-weight: 600; }
.door.fix .pill:hover { background: color-mix(in srgb, var(--on-oncall) 88%, var(--oncall)); }
.door.fix input[type="search"] { border-color: transparent; }

/* Header brand: the loop and "DevOps Nimbus" go back to all tracks. */
.brand > a { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand-hub { color: inherit; }
.brand > a:hover { text-decoration: none; }
.brand-hub:hover > span { opacity: .75; }
.brand-hub:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* Narrow phones: the logo stands for DevOps Nimbus so the header keeps one row. */

/* While a feature's code is still arriving, its space shows calm grey shapes of what is coming,
   sized to what replaces them, and the first screen fades in once as one piece. Both stop for
   reduced motion. */
.pg-scenarios:empty, .pg-story:empty, main:has(.pg-scenarios:empty) .pg-out:empty, .pg-editor:empty, .pg-map:empty, #quiz-list:empty {
  background: repeating-linear-gradient(to bottom, var(--code-bg) 0 12px, transparent 12px 28px) content-box;
  animation: nimbus-skel 1.6s ease-in-out infinite alternate;
}
.pg-scenarios:empty { min-height: 968px; padding-top: 20px; padding-bottom: 20px; }
.pg-story:empty { align-self: flex-start; width: 760px; max-width: 100%; min-height: 50px; background-size: 80% 100%; background-repeat: no-repeat; }
main:has(.pg-scenarios:empty) .pg-out:empty { background-image: repeating-linear-gradient(to bottom, color-mix(in srgb, #fff 9%, transparent) 0 10px, transparent 10px 24px); background-size: 70% 100%; background-repeat: no-repeat; }
.pg-editor:empty { min-height: 360px; }
.pg-map:empty { min-height: 225px; border-radius: var(--radius-sm); }
#quiz-list:empty { min-height: 320px; }
#pg-goal:empty, .pg-try:empty::before { background: var(--code-bg); border-radius: 99px; }
#pg-goal:empty { display: inline-block; vertical-align: middle; width: min(310px, 80vw); height: 39px; border: 0; animation: nimbus-skel 1.6s ease-in-out infinite alternate; }
/* Pills for the Try commands: two rows beside the terminal, one row below it. */
.pg-try:empty { min-height: 72px; animation: nimbus-skel 1.6s ease-in-out infinite alternate; }
.pg-try:empty::before { content: ""; width: 120px; height: 30px; box-shadow: 128px 0 0 var(--code-bg), 0 40px 0 var(--code-bg); }
/* The diagram: an empty card of the same size, 2:1 on wide screens. */
#arch:empty {
  padding-top: calc(50% + 69px); border: 1px solid var(--hair); border-radius: var(--radius); box-shadow: var(--shadow);
  background: var(--surface) linear-gradient(var(--code-bg), var(--code-bg)) 50% 50% / calc(100% - 56px) calc(100% - 56px) no-repeat;
  animation: nimbus-skel 1.6s ease-in-out infinite alternate;
}
@keyframes nimbus-skel { from { opacity: .5; } to { opacity: 1; } }
/* The picker card wraps its scenario buttons into more rows as the page narrows. */
@media (max-width: 1001px) { .pg-scenarios:empty { min-height: 1010px; } }
@media (max-width: 995px) { .pg-scenarios:empty { min-height: 1094px; } }
@media (max-width: 979px) { .pg-scenarios:empty { min-height: 1136px; } }
@media (min-width: 861px) and (max-width: 910px) { .pg-editor:empty { min-height: 381px; } }
@media (max-width: 860px) { .pg-scenarios:empty { min-height: 1086px; } .pg-map:empty { min-height: 168px; } .pg-try:empty { min-height: 32px; } .pg-try:empty::before { box-shadow: 128px 0 0 var(--code-bg), 256px 0 0 var(--code-bg); } }
@media (max-width: 825px) { .pg-scenarios:empty { min-height: 1128px; } }
@media (max-width: 813px) { .pg-scenarios:empty { min-height: 1170px; } }
@media (max-width: 765px) { .pg-scenarios:empty { min-height: 1212px; } }
@media (max-width: 753px) { .pg-scenarios:empty { min-height: 1296px; } }
@media (max-width: 741px) { .pg-scenarios:empty { min-height: 1338px; } }
@media (max-width: 720px) {
  /* The scenario picker is one scrolling row of pills here. */
  .pg-scenarios:empty { min-height: 38px; padding-top: 2px; padding-bottom: 2px; background: none; }
  .pg-scenarios:empty::before { content: ""; flex: none; width: 96px; height: 34px; border-radius: 99px; background: var(--code-bg); box-shadow: 104px 0 0 var(--code-bg), 208px 0 0 var(--code-bg), 312px 0 0 var(--code-bg), 416px 0 0 var(--code-bg); }
  .pg-story:empty { min-height: 47px; }
  .pg-editor:empty { min-height: 345px; }
  #arch:empty { padding-top: calc(261.11% + 6px); background-size: calc(100% - 32px) calc(100% - 32px); }
}
@media (max-width: 712px) { #arch:empty { padding-top: calc(261.11% + 15px); } }
@media (max-width: 605px) { .pg-editor:empty { min-height: 366px; } }
@media (max-width: 500px) { #arch:empty { padding-top: calc(261.11% + 65px); } }
@media (max-width: 505px) { .pg-story:empty { min-height: 71px; } }
@media (max-width: 430px) { .pg-map:empty { min-height: 203px; } }
@media (max-width: 405px) { .pg-map:empty { min-height: 225px; } .pg-try:empty { min-height: 72px; } .pg-try:empty::before { box-shadow: 128px 0 0 var(--code-bg), 0 40px 0 var(--code-bg); } }
@media (max-width: 379px) { .pg-story:empty { min-height: 94px; } }
@media (max-width: 369px) { .pg-editor:empty { min-height: 414px; } }
#signature:not(:empty), #stats:not(:empty), #engage:not(:empty), #bento:not(:empty), #levels:not(:empty) { animation: nimbus-fade .2s ease-out both; }
@keyframes nimbus-fade { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) {
  .pg-scenarios:empty, .pg-story:empty, main:has(.pg-scenarios:empty) .pg-out:empty, .pg-editor:empty, .pg-map:empty, .pg-try:empty, #quiz-list:empty, #pg-goal:empty, #arch:empty { animation: none; }
  #signature:not(:empty), #stats:not(:empty), #engage:not(:empty), #bento:not(:empty), #levels:not(:empty) { animation: none; }
}

/* The eyebrow's command chip stands for the track; the $ takes the track colour. */
.eyebrow-cmd { font: 500 .8rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: #1d1d1f; color: #f5f5f7;
  padding: 5px 8px; border-radius: 7px; white-space: nowrap; }
.eyebrow-cmd span { color: #b294ff; }
.eyebrow:has(.eyebrow-cmd) { display: block; }
.eyebrow-cmd { display: inline-block; margin-right: 8px; vertical-align: .12em; }

/* A short light in the track colour travels round the edge of the home cards, each at its own point.
   On white it uses a deeper shade so it still shows; in dark mode the bright track colour. */
:root { --accent-edge: #9c75ff; }
@media (prefers-color-scheme: dark) { :root { --accent-edge: var(--accent-fill); } }
@property --edge { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.door, .tile, .stage-card { position: relative; }
.door::before, .tile::before, .stage-card::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 2.5px; pointer-events: none;
  background: conic-gradient(from var(--edge), transparent 0 64%, color-mix(in srgb, var(--accent-edge) 55%, transparent) 80%, var(--accent-edge) 90%, var(--accent-edge) 97%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: edge 7s linear infinite; animation-delay: calc(var(--i, 0) * -1.3s); }
@keyframes edge { to { --edge: 360deg; } }
:is(.door, .tile, .stage-card):nth-child(2) { --i: 1; } :is(.door, .tile, .stage-card):nth-child(3) { --i: 2; }
:is(.door, .tile, .stage-card):nth-child(4) { --i: 3; } :is(.door, .tile, .stage-card):nth-child(5) { --i: 4; }
:is(.door, .tile, .stage-card):nth-child(6) { --i: 5; } :is(.door, .tile, .stage-card):nth-child(7) { --i: 6; }
@media (prefers-reduced-motion: reduce) { .door::before, .tile::before, .stage-card::before { display: none; } }
.doctor-none { max-width: 760px; padding: 16px 20px; background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); }
.doctor-none-head { margin: 0 0 4px; font-weight: 600; }
.doctor-none > .muted { margin: 0; }
.doctor-none .doctor-practise { margin-top: 12px; }

/* Nimbus, the loop with eyes (nimbus.js, nimbus.css): small touches in the search box, on the
   score card and in the terminal (nimbus-site.js, nimbus-terminal.js), and the quiz's pipeline
   (nimbus-quiz.js). */
.palette > .nimbus { position: absolute; left: 18px; top: 17px; width: 34px; pointer-events: none; }
.palette #palette-input { padding-left: 64px; }
.palette.sheet > .nimbus { top: 37px; }
.eng-score-card { position: relative; }
.eng-score-card > .nimbus { position: absolute; top: 20px; right: 20px; width: 52px; cursor: pointer; }
.pg-bar .nimbus { width: 34px; margin-left: auto; --nimbus-ink: #e6edf3; --nimbus-halo: #0d1117; --nimbus-ok: #56d364; --nimbus-warn: #ffa198; --nimbus-flow: #79c0ff; }
.pg-bar .nimbus + em { margin-left: 10px; }
.rule-out { margin-top: 2px; padding: 0; border: 0; background: none; font: inherit; font-size: .9rem; color: var(--accent, var(--accent-fill)); cursor: pointer; }
.rule-out:hover { text-decoration: underline; }
.opt.ruled { opacity: .45; text-decoration: line-through; }
/* The quiz's pipeline: across the sticky score bar on narrow screens, down the margin on wide
   ones. Stages turn green or amber as questions are answered. */
/* The score bar sits just below the header (95px; up to 141px on phones), so the pipeline in it shows. */
.score { top: 103px; }
@media (max-width: 720px) { .score { top: 149px; } }
#quiz-list { position: relative; }
#quiz-list > .nimbus, .nimbus-strip .nimbus { position: absolute; left: 0; top: 0; z-index: 6; width: 44px; cursor: pointer; }
.quiz-rail { position: absolute; background: var(--line); border-radius: 2px; }
.quiz-rail span { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--line); transition: background .3s var(--ease), border-color .3s var(--ease); }
.quiz-rail .passed { background: var(--ok); border-color: var(--ok); }
.quiz-rail .failed { background: var(--warn); border-color: var(--warn); }
@keyframes nimbus-release { 50% { transform: scale(1.7); box-shadow: 0 0 0 4px var(--accent-soft); } }
.quiz-rail.released span { animation: nimbus-release .5s var(--ease) calc(var(--i) * 90ms) both; }
.score:has(.nimbus-strip) .meter { display: none; } /* the pipeline shows progress instead */
.nimbus-strip { position: relative; height: 30px; margin: 0 22px; }
.nimbus-strip .quiz-rail { left: 0; right: 0; top: 15px; height: 2px; }
.nimbus-strip .quiz-rail span { top: 1px; }
.nimbus-strip .nimbus { top: 1px; }
/* On phones Nimbus is bigger, so its crest and tail still read. */
@media (max-width: 720px) {
  .nimbus-strip { height: 46px; margin: 0 32px; }
  .nimbus-strip .quiz-rail { top: 23px; }
  .nimbus-strip .nimbus { width: 62px; top: 2px; }
  .pg-bar .nimbus { width: 46px; }
  .eng-score-card > .nimbus { width: 62px; }
}
@media (min-width: 1180px) {
  #quiz-list > .nimbus { left: -96px; width: 80px; }
  #quiz-list > .quiz-rail { left: -57px; width: 2px; }
  #quiz-list > .quiz-rail span { left: 1px; width: 12px; height: 12px; margin: -6px 0 0 -6px; }
}
/* Nimbus's colours on this site: the track's theme. */
.nimbus { --nimbus-ink: var(--text); --nimbus-halo: var(--bg); --nimbus-ok: var(--ok); --nimbus-warn: var(--warn); --nimbus-flow: var(--accent-fill);
  /* It wears this track's theme colour. */
  /* Like a chameleon mid-change: from the theme colour to its neighbour on the colour wheel. */
  --nimbus-body-a: var(--accent-fill); --nimbus-body-b: color-mix(in srgb, var(--accent-fill) 78%, #000);
  --nimbus-body-b: oklch(from var(--accent-fill) calc(l - .04) c calc(h + 70));
  --nimbus-iris: color-mix(in srgb, var(--accent-fill) 70%, #000); }
.nimbus-strip .nimbus, .eng-card .nimbus, .palette .nimbus { --nimbus-halo: var(--surface); }
@media (prefers-reduced-motion: reduce) { .quiz-rail.released span { animation: none; } }

/* The narrowest phones (320px wide): everything keeps inside the screen. */
@media (max-width: 380px) {
  .doors { grid-template-columns: minmax(0, 1fr); }
  .door { min-width: 0; padding: 20px 18px; }
  .door .ctas, .door form, .door .row { flex-wrap: wrap; }
  .door input { min-width: 0; flex: 1 1 130px; }
  .arch-tip { width: min(300px, calc(100vw - 32px)); }
  .doctor-group .chip, .doctor-group-name { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  a.mono { overflow-wrap: anywhere; }
}
