/* The Kubernetes viewers. Opened full screen or in an iframe, which cannot
   see the site's own light/dim switch, so they follow the reader's system
   preference, as the networking demos do. */

:root {
  --bg: #ffffff;
  --card: #ffffff;
  --border: #dfe3e8;
  --text: #22272e;
  --dim: #5f6b78;
  --accent: #326ce5;
  --btn: #f4f5f7;
  --panel: #0d2436;
  --panel-text: #eaf1f6;
  --raw: #f7f8fa;
  --flash: rgba(255, 196, 0, 0.3);
  --ok: #1f8a45;
  --warn: #b7791f;
  --bad: #d23b3b;
  --cp: #7a4fd0;
  --cp-strong: #6334c9;
  --node: #2f7d9a;
  --net: #c96a12;
  --app-hello: #c96a12;
  --app-web: #326ce5;
  --app-shop: #1f8a45;
  --term: #0e1a24;
  --term-text: #d7e3ec;
  --srv-body: #e6ebf0;
  --srv-edge: #8795a3;
  --srv-bay: #c9d2db;
  --skin: #d7a47c;
  --hair: #4a3426;
  --sea: #cfe4f7;
  --sys: #eef1f4;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1d2b;
    --card: #112b40;
    --border: #234862;
    --text: #eaf1f6;
    --dim: #9fb2c2;
    --accent: #6f9bff;
    --btn: #16374f;
    --panel: #081b29;
    --panel-text: #eaf1f6;
    --raw: #0d2233;
    --flash: rgba(255, 196, 0, 0.18);
    --ok: #5fd38a;
    --warn: #f2c14e;
    --bad: #ff6b6b;
    --cp: #b79bff;
    --cp-strong: #6d45d8;
    --node: #6cc4e0;
    --net: #f0a050;
    --app-hello: #f0a050;
    --app-web: #7ea6ff;
    --app-shop: #5fd38a;
    --term: #06121b;
    --srv-body: #1d3b52;
    --srv-edge: #6f8ea5;
    --srv-bay: #2c5575;
    --sea: #173f5e;
    --sys: #0d2436;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.dim { color: var(--dim); font-weight: 400; }
.kv-app { padding: 0.5rem 16px 1rem; max-width: 1640px; margin: 0 auto; }
.kv-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.9rem; margin: 0 0 0.45rem; }
.kv-head h1 { font-size: 1.3rem; margin: 0; letter-spacing: -0.01em; }
.kv-head p { margin: 0; color: var(--dim); font-size: 0.92rem; }
/* Inside the viewer page (layouts/_default/viewer.html) the title and the
   subtitle are in the page's top bar, so the viewer drops its own and gives
   the stage the height. */
.in-viewer .kv-head { display: none; }

/* --- controls */
.kv-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin-bottom: 0.6rem; }
.kv-bar .count { font-family: ui-monospace, Menlo, monospace; font-size: 0.8rem; color: var(--dim); }
.kv-btn {
  background: var(--btn); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.35rem 0.9rem; font-size: 0.88rem; cursor: pointer; font-family: inherit;
}
.kv-btn:hover:not(:disabled) { border-color: var(--accent); }
.kv-btn:disabled { opacity: 0.45; cursor: default; }
.kv-btn.play { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; min-width: 6rem; }
.kv-btn.go { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.kv-btn.tiny { padding: 0.05rem 0.45rem; font-size: 0.74rem; border-radius: 5px; }
.kv-app select {
  background: var(--btn); color: var(--text); border: 1px solid var(--border); border-radius: 7px;
  padding: 0.3rem 0.4rem; font-size: 0.86rem; font-family: inherit; min-width: 0;
}

/* --- the stage: you and the internet on the left, the cluster in the
   middle, the events on the right. Every card has a fixed size and scrolls
   inside. */
.kv-stage {
  position: relative; display: grid; gap: 12px;
  grid-template-columns: minmax(0, 330px) minmax(0, 1fr) minmax(0, 340px);
  grid-template-rows: 148px minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "net cluster cloud" "net cluster log" "user cluster log";
  height: max(720px, calc(100vh - 6.2rem));
}
@media (min-width: 1101px) { .in-viewer .kv-stage { height: max(720px, calc(100vh - 4.1rem)); } }
.kv-user { grid-area: user; } .kv-net { grid-area: net; } .kv-log { grid-area: log; } .kv-cloud { grid-area: cloud; }
.kv-cluster { grid-area: cluster; }
@media (max-width: 1100px) {
  .kv-stage { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); height: auto;
    grid-template-rows: 330px 820px 150px 420px; grid-template-areas: "net user" "cluster cluster" "cloud cloud" "log log"; }
}
@media (max-width: 640px) {
  .kv-stage { grid-template-columns: minmax(0, 1fr); grid-template-rows: 190px 340px auto 170px 420px;
    grid-template-areas: "net" "user" "cluster" "cloud" "log"; }
}

.kv-card { display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden;
  border: 1px solid var(--border); border-radius: 12px; background: var(--card); font-size: 0.84rem;
  transition: box-shadow 0.25s, border-color 0.25s; }
.kv-card.here { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.kv-card > header { flex: none; padding: 0.45rem 0.7rem 0.4rem; border-bottom: 1px solid var(--border); }
.kv-card h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.1rem 0.4rem; font-size: 0.95rem; margin: 0; }
.kv-card h2 .ico { font-size: 1.05rem; }
.kv-card h2 code { font-size: 0.74rem; color: var(--dim); font-weight: 400; }
.kv-card .turn { margin-top: 0.35rem; padding: 0.25rem 0.7rem; font-size: 0.8rem; }
.kv-card.due > header { background: color-mix(in srgb, var(--accent) 10%, var(--card)); }
.kv-body { flex: 1; min-height: 0; overflow: auto; padding: 0.5rem 0.7rem 0.7rem; position: relative; }
.kv-body h3 { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--dim); margin: 0.55rem 0 0.3rem; }
.kv-body h3:first-child { margin-top: 0; }
.empty { color: var(--dim); font-size: 0.78rem; margin: 0.2rem 0 0; }

/* --- the cluster: the control plane on top, the workers under it */
.kv-cluster { position: relative; display: grid; gap: 10px; min-height: 0;
  border: 2px dashed color-mix(in srgb, var(--node) 55%, var(--border)); border-radius: 16px; padding: 22px 12px 10px 12px;
  column-gap: 22px; row-gap: 34px;
  grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr) minmax(0, 1.15fr);
  grid-template-areas: "cp1 cp1 cp1 cp2 cp2 cp2" "w1 w1 w2 w2 w3 w3"; }
.kv-cluster::before { content: 'the cluster'; position: absolute; top: 3px; left: 14px; font-size: 0.68rem;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--node); font-weight: 700; }
@media (max-width: 640px) {
  .kv-cluster, .kv-cluster.folded { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto;
    grid-template-areas: none; }
  .kv-cluster > * { grid-area: auto !important; min-height: 180px; max-height: 420px; }
}
#kv-cp1 { grid-area: cp1; } #kv-cp2 { grid-area: cp2; }
#kv-w1 { grid-area: w1; } #kv-w2 { grid-area: w2; } #kv-w3 { grid-area: w3; }
.kv-cluster .gone { display: none; }
.m-cp { border-top: 4px solid var(--cp); }
.m-w { border-top: 4px solid var(--node); }
.kv-user { border-top: 4px solid var(--accent); }


/* A software component, drawn as a chip on its machine */
.comps { display: grid; gap: 0.35rem; }
.comp { --c: var(--cp); border: 1px solid color-mix(in srgb, var(--c) 45%, var(--border)); border-left: 4px solid var(--c);
  border-radius: 7px; background: var(--raw); padding: 0.25rem 0.5rem; position: relative; z-index: 1; }
.comp b { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.8rem; }
.comp span { display: block; color: var(--dim); font-size: 0.74rem; line-height: 1.3; }
.comp.agent { --c: var(--node); }
.comp.act { background: color-mix(in srgb, var(--c) 16%, var(--card)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 40%, transparent); }
.comps.small { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.comps.small .comp { padding: 0.08rem 0.4rem; }
.comps.small .comp b { font-size: 0.72rem; }
.comps.small .comp span { display: none; }

/* etcd's records: the objects the cluster was asked for */
.store { margin-top: 0.1rem; border: 1px solid var(--border); border-radius: 8px; padding: 0.35rem 0.45rem; background: var(--raw); }
.store h3 { margin: 0 0 0.25rem; }
.recs { display: flex; flex-wrap: wrap; gap: 0.2rem; }
.rec { --t: var(--dim); display: inline-flex; gap: 0.3rem; align-items: baseline; border: 1px solid var(--border);
  border-left: 3px solid var(--t); border-radius: 5px; padding: 0.02rem 0.35rem; font-size: 0.72rem; background: var(--card); white-space: nowrap; }
.rec i { font-style: normal; font-weight: 700; color: var(--t); font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.04em; }
.rec em { font-style: normal; color: var(--dim); }
.rec.now { box-shadow: 0 0 0 2px color-mix(in srgb, var(--t) 45%, transparent); }
.rec.gone-soon { opacity: 0.55; text-decoration: line-through; }
.rec.k-node { --t: var(--node); }
.rec.a-hello { --t: var(--app-hello); } .rec.a-web { --t: var(--app-web); } .rec.a-shop { --t: var(--app-shop); }

/* A pod on its worker */
.pods { display: grid; gap: 0.35rem; margin-top: 0.45rem; }
.pod { --a: var(--dim); border: 1px solid color-mix(in srgb, var(--a) 50%, var(--border)); border-radius: 9px;
  background: color-mix(in srgb, var(--a) 7%, var(--card)); padding: 0.25rem 0.45rem 0.3rem; position: relative; z-index: 1; }
.pod.a-hello { --a: var(--app-hello); } .pod.a-web { --a: var(--app-web); } .pod.a-shop { --a: var(--app-shop); }
.pod .ph { display: flex; flex-wrap: wrap; gap: 0 0.4rem; align-items: baseline; }
.pod .ph b { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.76rem; overflow-wrap: anywhere; }
.pod .ph small { color: var(--dim); font-size: 0.7rem; }
.pod .ctr { display: inline-block; margin-top: 0.15rem; border: 1px solid var(--border); border-radius: 4px;
  background: var(--card); padding: 0 0.3rem; font-size: 0.7rem; font-family: ui-monospace, Menlo, Consolas, monospace; }
.pod .st { float: right; font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.st.running { color: var(--ok); } .st.creating { color: var(--warn); } .st.terminating { color: var(--bad); }
.pod.now { box-shadow: 0 0 0 3px color-mix(in srgb, var(--a) 40%, transparent); }
.rules { margin-top: 0.4rem; border-top: 1px dashed var(--border); padding-top: 0.3rem; font-size: 0.7rem; position: relative; z-index: 1; }
.rules div { font-family: ui-monospace, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.rules.now { background: color-mix(in srgb, var(--flash) 45%, transparent); }
.m-head-ip { font-family: ui-monospace, Menlo, Consolas, monospace; }

/* You: a laptop with a terminal */
.term { background: var(--term); color: var(--term-text); border-radius: 8px; padding: 0.4rem 0.5rem;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.7rem; line-height: 1.35; min-height: 0; overflow: auto; }
.term .ln { white-space: pre; }
.term .cmd { color: #8fe3a8; }
.term .cmd::before { content: '$ '; color: #7f93a3; }
.term .cmd.now { background: rgba(255, 196, 0, 0.18); }
.term .out { color: var(--term-text); opacity: 0.88; }
.kv-user .kv-body { padding: 0.4rem; display: flex; flex-direction: column; }
.kv-user .term { flex: 1; }

/* The internet: a visitor, and the cloud's load balancer */
.net-row { display: grid; gap: 0.4rem; }
.thing { border: 1px solid var(--border); border-left: 4px solid var(--net); border-radius: 7px; background: var(--raw);
  padding: 0.25rem 0.5rem; position: relative; z-index: 1; }
.thing b { font-size: 0.8rem; }
.thing span { display: block; color: var(--dim); font-size: 0.72rem; }
.thing.now, .thing.act { box-shadow: 0 0 0 3px color-mix(in srgb, var(--net) 40%, transparent); }


/* The events so far, each with its explanation */
.log { list-style: none; margin: 0; padding: 0; }
.log-intro { font-size: 0.84rem; line-height: 1.45; }
.log-intro p { margin: 0 0 0.4rem; }
.log-intro .main { font-weight: 600; }
.log li { border-bottom: 1px dashed var(--border); }
.log-head { all: unset; box-sizing: border-box; width: 100%; display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) auto; gap: 0.4rem; align-items: baseline; padding: 0.15rem 0.3rem; cursor: pointer; }
.log-head::after { content: '▸'; color: var(--dim); font-size: 0.7rem; }
.log li.open .log-head::after { content: '▾'; }
.log-head:focus-visible { outline: 2px solid var(--accent); }
.log li:hover .log-head { background: color-mix(in srgb, var(--flash) 40%, transparent); }
.log li.now .log-head { background: color-mix(in srgb, var(--flash) 75%, transparent); }
.log li.now.open .log-body { background: color-mix(in srgb, var(--flash) 30%, transparent); }
.log-body { padding: 0.2rem 0.5rem 0.5rem 2.1rem; font-size: 0.8rem; line-height: 1.42; }
.log-body p { margin: 0 0 0.3rem; }
.log-body .where { font-size: 0.72rem; font-weight: 700; color: var(--dim); }
.log-body .main { font-weight: 600; font-size: 0.9rem; }
.log .n { color: var(--dim); font-family: ui-monospace, Menlo, monospace; font-size: 0.72rem; }
.log .scene { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--dim); padding: 0.5rem 0.3rem 0.15rem; border-bottom: none; }

/* What is in the air: a message flying along its arrow */
#kv-fly { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
#kv-fly .trail { position: fixed; inset: 0; width: 100%; height: 100%; overflow: visible; }
#kv-fly .trail line { stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 3 7; }
#kv-fly .trail path { fill: var(--accent); }
#kv-fly .msg { position: fixed; transform: translate(-50%, -50%); background: var(--panel); color: var(--panel-text);
  border-radius: 6px; padding: 0.12rem 0.5rem; font-size: 0.74rem; font-weight: 600; white-space: nowrap;
  font-family: ui-monospace, Menlo, Consolas, monospace; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3); }
#kv-fly .ghost { position: fixed; margin: 0; }

/* --- the drawings: a card starts as its drawing alone */
.kv-card.icon-only { border: none; background: transparent; box-shadow: none; align-items: center; justify-content: flex-start; padding-top: 14px;
  gap: 0.35rem; text-align: center; overflow: visible; }
.kv-card.icon-only .art-wrap { transition: filter 0.25s; }
.kv-card.icon-only.here .art-wrap, .kv-card.icon-only.due .art-wrap { filter: drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 55%, transparent)); }
.art-wrap svg { display: block; height: min(130px, 22vh); width: auto; }

.kv-user.icon-only, .kv-net.icon-only { justify-content: center; }
.art-label b { display: block; font-size: 0.95rem; }
.art-label code { display: block; font-size: 0.74rem; color: var(--dim); }
.art .body, .art .lid { fill: var(--srv-body); stroke: var(--srv-edge); stroke-width: 1.5; }
.art .bay { fill: var(--srv-bay); }
.art .led { fill: var(--ok); }
.art .vent { stroke: var(--srv-edge); stroke-width: 1.6; stroke-linecap: round; }
.art .power { fill: var(--srv-bay); stroke: var(--srv-edge); }
.art .foot { fill: var(--srv-edge); }
.art.cp .stripe { fill: var(--cp); } .art.w .stripe { fill: var(--node); }
.art .skin { fill: var(--skin); } .art .hair { fill: var(--hair); } .art .shirt { fill: var(--accent); }
.art .logo { fill: var(--ok); font: 700 13px ui-monospace, Menlo, Consolas, monospace; }
.art .sea { fill: var(--sea); stroke: var(--net); stroke-width: 1.5; }
.art .grid { fill: none; stroke: var(--net); stroke-width: 1.2; opacity: 0.7; }
#kv-fly .art-ghost { transform-origin: top left; z-index: 5; }
#kv-fly .art-ghost svg { width: 100%; height: 100%; display: block; }

/* A grown card keeps its drawing in the footer: for a machine, the footer
   is the machine itself, its operating system and hardware, under
   everything that runs on it. */
.art-foot { flex: none; display: flex; align-items: center; gap: 0.5rem; padding: 0.25rem 0.6rem; min-height: 44px;
  border-top: 1px solid var(--border); background: var(--sys); font-size: 0.74rem; color: var(--dim); }
.art-corner { display: flex; gap: 3px; }
.art-corner svg { display: block; height: 36px; width: auto; }
.art-corner [data-key] { transform-origin: top left; }
.m-w .art-foot, .m-cp .art-foot { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 600; }
.kv-user .art-foot { font-family: inherit; }
.kv-user .foot-text { display: flex; flex-wrap: wrap; gap: 0.15rem 0.3rem; align-items: center; min-width: 0; line-height: 1.25; }
.tool { font-size: 0.72rem; border: 1px solid var(--border); border-radius: 5px; padding: 0 0.4rem; color: var(--dim); }
.tool.on { border-color: var(--accent); color: var(--accent); font-weight: 700; }

/* A worker, bottom up: the machine (the footer), the Kubernetes programs on
   it, and on top the pods: containers that are processes on this machine. */
.pod { border-style: dashed; border-width: 2px; }
.pod .ctr { display: block; margin-top: 0.25rem; border: 1px solid var(--border); border-radius: 6px; background: var(--card);
  padding: 0.12rem 0.4rem; font-size: 0.74rem; font-family: ui-monospace, Menlo, Consolas, monospace; }
.pod .ctr em { font-style: normal; color: var(--ok); font-weight: 700; }
.pod .ctr small { display: block; color: var(--dim); font-size: 0.66rem; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
.pod .gear { color: var(--a); }
.rules { margin-top: 0; }

/* --- every node: the kubelet at the top, the entrance every pod comes
   through; the pods under it; containerd and the computer in the footer */
.art-foot .comp.small { padding: 0.05rem 0.4rem; }
.art-foot .comp.small b { font-size: 0.72rem; }

/* A pod of the system's own, in kube-system */
.spods { display: grid; gap: 0.25rem; margin-bottom: 0.4rem; }
.spod { --c: var(--cp); border: 1.5px dashed color-mix(in srgb, var(--c) 60%, var(--border)); border-radius: 7px;
  background: color-mix(in srgb, var(--c) 6%, var(--card)); padding: 0.18rem 0.45rem; position: relative; z-index: 1; }
.spod b { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.76rem; }
.spod small { color: var(--dim); font-size: 0.66rem; overflow-wrap: anywhere; }
.spod span { display: block; color: var(--dim); font-size: 0.7rem; line-height: 1.25; }
.spod.act { background: color-mix(in srgb, var(--c) 18%, var(--card)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 40%, transparent); }
.spods.small { display: flex; flex-wrap: wrap; gap: 0.2rem; }
.spod.small { padding: 0 0.35rem; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.7rem; }
.rec.k-ns { --t: var(--cp); }

/* The internet: a globe, the wire through it, the visitor and the load
   balancer beside it */
.kv-net { display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 0.4rem; min-height: 0; font-size: 0.84rem; }
.net-globe { display: flex; flex-direction: column; align-items: center; }
.net-globe svg { display: block; height: 78px; width: auto; }
.net-globe > span { position: relative; z-index: 1; border-radius: 50%; }
.net-globe b { font-size: 0.85rem; }
.kv-net.here .net-globe > span { box-shadow: 0 0 0 4px color-mix(in srgb, var(--net) 40%, transparent); }
.kv-net .net-row { width: 100%; }
#kv-wires { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; overflow: visible; }
#kv-wires .wire { fill: none; stroke: var(--net); stroke-width: 3; stroke-linejoin: round; opacity: 0.6; }
#kv-wires .wire-label { fill: var(--net); font: 700 11px ui-monospace, Menlo, Consolas, monospace; }
#kv-wires .spoke { stroke: var(--cp); stroke-width: 1.5; stroke-dasharray: 4 5; opacity: 0.35; }
.kv-card, .kv-cluster { position: relative; z-index: 1; }
.kv-cluster { background: transparent; }

/* The laptop, seen from behind */
.art .screen { fill: #0b0f14; }
.art .prompt { fill: #8fe3a8; font: 700 6.2px ui-monospace, Menlo, Consolas, monospace; }
.art .prompt.dim { fill: #b8c4ce; font-weight: 400; }

/* Messages in the air: a document is drawn as one; a burst where a wave
   leaves one place together */
#kv-fly .trail polyline { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 3 7; }
#kv-fly .msg.doc { background: #fffdf4; color: #22272e; border: 1px solid #c9b98a; border-radius: 3px 10px 3px 3px; font-size: 0.78rem; }
#kv-fly .burst { position: fixed; width: 90px; height: 90px; border-radius: 50%; border: 3px solid var(--accent);
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%); }
.m-node .foot-text { display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem; }
.m-node .foot-text .hw { white-space: nowrap; }
.kv-cluster.folded { grid-template-rows: minmax(0, 1.3fr) minmax(0, 1fr); }
.rules { font-size: 0.64rem; }

/* You: the picture, and a prompt on its monitor while it is drawn large */
.art.you { position: relative; display: block; }
.art.you img { display: block; height: 100%; width: auto; }
.art-wrap .art.you { height: min(230px, 30vh); }
.art-corner .art.you { height: 40px; }
.you-screen { text-align: left; position: absolute; left: 45%; top: 13.5%; width: 32%; height: 17%; color: #8fe3a8; line-height: 1.35;
  font: 700 clamp(6px, 0.95vh, 9px) ui-monospace, Menlo, Consolas, monospace; overflow: hidden; overflow-wrap: anywhere; }
.art-corner .you-screen { display: none; }
#kv-fly .art-ghost .art.you { height: 100%; }

/* The internet: a cloud at the bottom of the top half, level with the cluster */
.net-cloud { position: relative; z-index: 1; width: 100%; display: flex; justify-content: center; }
.net-cloud svg { display: block; width: min(230px, 90%); height: auto; }
.art .puff { fill: var(--sea); stroke: var(--net); stroke-width: 2.5; }
.art .cloud-label { fill: var(--text); font: 700 17px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
.kv-net.here .puff { stroke-width: 4; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--net) 60%, transparent)); }

/* The node badge, top right of every node card */
.m-node > header { position: relative; padding-right: 5.6rem; }
.k8s-kind { position: absolute; top: 0.3rem; right: 0.45rem; display: inline-flex; align-items: center; gap: 0.25rem;
  font-size: 0.74rem; font-weight: 700; color: var(--app-web); }
.k8s-kind img { width: 38px; height: 38px; display: block; }
.k8s-kind { font-size: 0.85rem !important; }

/* The kubelet: a port on the middle of the node's edge that faces the rest
   of the cluster, half outside the card: what the control plane plugs into
   to control the node. The workers' faces up, control-plane-2's left,
   control-plane-1's down. Centred with insets and auto margins, not a
   transform: the slide animation replaces an element's transform while it
   plays. */
.m-node.grown { overflow: visible; }
.m-node.grown > header { border-radius: 11px 11px 0 0; }
.m-node.grown > .art-foot { border-radius: 0 0 11px 11px; }
.m-node.grown[data-port="left"] > .kv-body { padding-left: 1.25rem; }
.m-node.grown[data-port="top"] > header { padding-top: 1rem; }
.m-node.grown[data-port="bottom"] > .art-foot { padding-bottom: 1rem; }
.kubelet-port { position: absolute; z-index: 4; display: flex; align-items: center; justify-content: center;
  border-radius: 7px; background: var(--node); color: #fff; border: 2px solid color-mix(in srgb, var(--node) 70%, #000);
  font: 700 0.72rem ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.04em; cursor: help;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); }
.kubelet-port.left { left: -15px; top: 0; bottom: 0; margin: auto 0; width: 1.55rem; height: 6.2rem; writing-mode: vertical-rl; }
.kubelet-port.top { top: -14px; left: 0; right: 0; margin: 0 auto; width: 6.2rem; height: 1.55rem; }
.kubelet-port.bottom { bottom: -14px; left: 0; right: 0; margin: 0 auto; width: 6.2rem; height: 1.55rem; }
.kubelet-port::before { content: ''; position: absolute; width: 9px; height: 9px; border-radius: 50%;
  background: var(--card); border: 2px solid var(--node); }
.kubelet-port.left::before { left: -9px; top: 50%; translate: 0 -50%; }
.kubelet-port.top::before { top: -9px; left: 50%; translate: -50% 0; }
.kubelet-port.bottom::before { bottom: -9px; left: 50%; translate: -50% 0; }
.kubelet-port.act { background: color-mix(in srgb, var(--node) 80%, #fff); box-shadow: 0 0 0 4px color-mix(in srgb, var(--node) 45%, transparent); }
.art-row { display: flex; align-items: flex-start; gap: 0.35rem; }
.icon-only .k8s-kind { position: static; margin-top: 0.2rem; }

/* The control plane's pods in purple, kube-proxy in the nodes' teal */
.spod.cp { --c: var(--cp); border-width: 2px; }
.spod.proxy { --c: var(--node); }
.spod.cp i { display: block; font-style: normal; font-size: 0.6rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--cp); }

/* Precise colours: the control plane's four pods solid purple; the node
   components (kubelet, containerd, kube-proxy) teal */
.spod.cp { background: var(--cp-strong); border: 2px solid color-mix(in srgb, var(--cp-strong) 70%, #000); color: #fff; }
.spod.cp small, .spod.cp span { color: rgba(255, 255, 255, 0.82); }
.spod.cp b { color: #fff; }
.spod.cp i { color: #fff; opacity: 0.9; }
.spod.cp.act { background: var(--cp-strong); box-shadow: 0 0 0 4px color-mix(in srgb, var(--cp-strong) 45%, transparent); }
.spod.proxy { border-width: 2px; }
.spod.proxy i { display: block; font-style: normal; font-size: 0.6rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--node); }

/* A tour step's spotlight: what it names pulses, the rest of the cluster dims */
.kv-stage.spotlight .kv-cluster [data-key]:not(.act),
.kv-stage.spotlight .kv-cluster h3, .kv-stage.spotlight .kv-cluster .store:not(.act) { opacity: 0.28; transition: opacity 0.4s; }
.kv-stage.spotlight .kv-cluster .act { animation: kv-pulse 1.1s ease-in-out 3; }
@keyframes kv-pulse { 50% { transform: scale(1.035); filter: brightness(1.15); } }
/* In a spotlight, a lit node component is solid teal */
.kv-stage.spotlight .comp.agent.act { background: var(--node); border-color: color-mix(in srgb, var(--node) 70%, #000);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--node) 45%, transparent); }
.kv-stage.spotlight .comp.agent.act b { color: #fff; }
.kv-stage.spotlight .kubelet-port.act { background: var(--node); box-shadow: 0 0 0 5px color-mix(in srgb, var(--node) 45%, transparent); }
/* containerd, lit: larger, with what it does, pulsing harder */
.comp .desc { display: none; font-style: normal; }
.kv-stage.spotlight .art-foot .comp.act { padding: 0.25rem 0.7rem; animation: kv-pulse-big 1.1s ease-in-out 4; }
.kv-stage.spotlight .art-foot .comp.act b { font-size: 0.95rem; }
.kv-stage.spotlight .art-foot .comp.act .desc { display: block; color: #fff; font-size: 0.72rem; }
@keyframes kv-pulse-big { 50% { transform: scale(1.12); filter: brightness(1.2); } }
.art-foot .comp { transform-origin: left center; }
.kv-stage.spotlight .hw.act { color: var(--text); background: var(--flash); border-radius: 4px; padding: 0 0.3rem; animation: kv-pulse 1.1s ease-in-out 3; }
.hw { transform-origin: left center; }

/* A tour step's connections: moving lines between the parts it names */
#kv-wires .link { stroke: var(--cp-strong); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 7 6;
  animation: kv-march 0.9s linear infinite; }
#kv-wires .wire.lit { opacity: 1; stroke-width: 4; stroke-dasharray: 9 6; animation: kv-march 0.9s linear infinite; }
@keyframes kv-march { to { stroke-dashoffset: -26; } }

/* etcd's data as a disk. Lit, the cylinder's bands flash in turn as if being
   written, its light blinks, and the records drop in one after another. */
.store h3 { display: flex; align-items: center; gap: 0.35rem; }
.disk { width: 20px; height: 23px; flex: none; }
.db-body, .db-top { fill: color-mix(in srgb, var(--cp) 22%, var(--card)); stroke: var(--cp-strong); stroke-width: 1.6; }
.db-band { fill: none; stroke: var(--cp-strong); stroke-width: 1.3; }
.db-led { fill: var(--ok); }
.kv-stage.spotlight .kv-cluster .store.act [data-key], .kv-stage.spotlight .kv-cluster .store.act h3 { opacity: 1; }
.store.act { border-color: var(--cp-strong); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cp-strong) 35%, transparent); }
.store.act .disk { width: 34px; height: 39px; }
.store.act .db-band { animation: kv-db-write 1.2s linear infinite; }
.store.act .db-band.b2 { animation-delay: 0.4s; } .store.act .db-band.b3 { animation-delay: 0.8s; }
.store.act .db-led { animation: kv-db-led 0.3s steps(2) infinite; }
.store.act .rec { animation: kv-rec-in 0.5s ease-out both; animation-delay: calc(var(--i) * 0.28s + 0.3s); }
@keyframes kv-db-write { 0%, 60%, 100% { stroke: var(--cp-strong); stroke-width: 1.3; } 20% { stroke: var(--ok); stroke-width: 3; } }
@keyframes kv-db-led { 50% { opacity: 0.1; } }
@keyframes kv-rec-in { from { opacity: 0; transform: translateY(-10px) scale(0.9); } }
/* A tour step that is not about etcd's data folds it to its title line */
.kv-stage.spotlight .store:not(.act) .recs, .kv-stage.spotlight .store:not(.act) .empty { display: none; }

/* The Kubernetes symbols beside each component and kind */
.spod .sym { float: left; width: 30px; height: 30px; margin: 0.05rem 0.45rem 0 0; }
.spod.cp .sym { filter: drop-shadow(0 0 1.5px rgba(255, 255, 255, 0.9)); }
.kubelet-port .sym { width: 18px; height: 18px; margin: 0 0.3rem 0 0; filter: drop-shadow(0 0 1px #fff); }
.kubelet-port.left .sym { margin: 0 0 0.3rem 0; }
.pod .ph .sym { width: 20px; height: 20px; align-self: center; }
.rec .rsym { width: 14px; height: 14px; align-self: center; }
.spod { display: flow-root; }
/* etcd's records scroll inside the disk, so the pods under it stay in view */
.store .recs { max-height: 5.6rem; overflow-y: auto; position: relative; }
.kv-stage.spotlight .store.act .recs { max-height: none; }

/* The cloud providers, the one the cluster runs in lit, linked to
   cloud-controller-manager */
.kv-cloud { border-top: 4px solid var(--net); }
.kv-cloud .kv-body { padding: 0.35rem 0.5rem; }
.clouds { display: grid; gap: 0.25rem; }
.cloud-p { border: 1px solid var(--border); border-left: 4px solid var(--border); border-radius: 6px; padding: 0.1rem 0.45rem;
  font-size: 0.74rem; color: var(--dim); position: relative; z-index: 1; background: var(--card); }
.cloud-p b { color: var(--text); font-size: 0.8rem; margin-right: 0.35rem; }
.cloud-p em { font-style: normal; font-size: 0.6rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--net); }
.cloud-p span { display: block; font-size: 0.68rem; }
.cloud-p.used { border-left-color: var(--net); background: color-mix(in srgb, var(--net) 8%, var(--card)); }
.cloud-p.act { box-shadow: 0 0 0 3px color-mix(in srgb, var(--net) 45%, transparent); animation: kv-pulse 1.1s ease-in-out 3; }
#kv-wires .cloud-link { fill: none; stroke-linejoin: round; stroke: var(--net); stroke-width: 2.5; stroke-dasharray: 5 5; opacity: 0.7; }
#kv-wires .cloud-link.lit { opacity: 1; stroke-width: 3.5; animation: kv-march 0.9s linear infinite; }
.cloud-p { display: grid; grid-template-columns: 3.4rem 1fr; column-gap: 0.45rem; align-items: center; }
.cloud-p .logo { grid-row: span 2; justify-self: center; height: 22px; width: auto; max-width: 3.2rem; object-fit: contain;
  background: #fff; border-radius: 4px; padding: 2px 3px; }
.cloud-p b { margin: 0; } .cloud-p em { display: none; }
.cloud-p.used b::after { content: ' · this cluster'; font-size: 0.6rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--net); }
