/* ==========================================================================
   Charles Gibbs — career site
   Warm ivory, charcoal type, cobalt actions, amber for degraded, green for
   healthy. Drafting grid, fine linework, mono annotations.
   ========================================================================== */

:root {
  --ivory: #f6f4ee;
  --ivory-deep: #efece4;
  --paper: #fbfaf7;
  --ink: #1c1d20;
  --ink-2: #55575d;
  --ink-3: #8a8c92;
  --rule: #dcd8ce;
  --rule-soft: #e8e5dc;
  --rule-strong: #c9c4b7;
  --grid: #e6e3da;

  --cobalt: #2246d9;
  --cobalt-deep: #1a37ad;
  --cobalt-soft: #e9edfb;
  --cobalt-line: #b9c5f2;

  --amber: #b9760f;
  --amber-soft: #fbf3e2;
  --amber-line: #e9cf8f;

  --green: #1f7f4c;
  --green-soft: #e6f3ea;
  --green-line: #a9d6b8;

  --font-sans: "Geist", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --gutter: clamp(20px, 4vw, 48px);
  --max: 1240px;
  --ease: cubic-bezier(.22, .75, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body { margin: 0; min-height: 100vh; }
img, svg { display: block; }
h1, h2, h3, p { overflow-wrap: anywhere; }
a { color: var(--cobalt); text-decoration: none; }
a:hover { color: var(--cobalt-deep); text-decoration: underline; text-underline-offset: .18em; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; border-radius: 4px; }
button { font: inherit; color: inherit; }

.wrap { max-width: var(--max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--gutter); top: -80px; z-index: 100;
  background: var(--ink); color: var(--ivory); padding: 10px 14px; border-radius: 8px;
  font-size: 14px; font-weight: 500;
}
.skip-link:focus { top: 12px; text-decoration: none; }

/* Mono annotation helpers */
.mono-label {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-3);
}

/* --------------------------------------------------------------------------
   Badges, chips, buttons
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--rule); background: var(--paper);
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-2); white-space: nowrap;
  transition: color .4s, background-color .4s, border-color .4s;
}
.badge[data-tone="amber"]  { color: var(--amber);  background: var(--amber-soft);  border-color: var(--amber-line); }
.badge[data-tone="cobalt"] { color: var(--cobalt); background: var(--cobalt-soft); border-color: var(--cobalt-line); }
.badge[data-tone="green"]  { color: var(--green);  background: var(--green-soft);  border-color: var(--green-line); }
.badge-icon { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; display: none; }
.badge[data-tone="amber"]  .badge-icon[data-icon="warn"]  { display: block; }
.badge[data-tone="cobalt"] .badge-icon[data-icon="clock"] { display: block; }
.badge[data-tone="green"]  .badge-icon[data-icon="check"] { display: block; }
@media (max-width: 480px) { .badge { white-space: normal; height: auto; padding: 6px 12px; line-height: 1.3; text-align: left; } }

.chip {
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-3);
  background: var(--ivory-deep); padding: 3px 8px; border-radius: 4px;
}

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 48px; padding: 0 22px; border-radius: 10px;
  font-family: var(--font-sans); font-size: 16px; font-weight: 500; line-height: 1;
  border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .2s, color .2s, border-color .2s, transform .2s, opacity .3s, visibility .3s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--cobalt); color: #fff; border-color: var(--cobalt); }
.btn-primary:hover { background: var(--cobalt-deep); border-color: var(--cobalt-deep); color: #fff; }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.btn-outline:hover { border-color: var(--ink); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--rule); height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 8px; }
.btn-ghost:hover { color: var(--ink); border-color: var(--rule-strong); }
.btn-ghost:disabled { opacity: .5; cursor: default; }
.btn-lg { height: 58px; padding: 0 30px; font-size: 17px; border-radius: 12px; }
.btn-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.btn-ghost .btn-icon { width: 15px; height: 15px; }

/* --------------------------------------------------------------------------
   Entrance overlay (only displayed when <html class="intro"> is set by JS)
   -------------------------------------------------------------------------- */
.intro {
  display: none;
  position: fixed; inset: 0; z-index: 50; overflow: auto;
  grid-template-rows: auto 1fr auto;
  background-color: var(--ivory);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: center top;
}
html.has-intro .intro { display: grid; }
html.has-intro { overflow: hidden; }
html.has-intro main, html.has-intro .site-header, html.has-intro .site-footer { visibility: hidden; }

.intro-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  min-height: 60px; padding: 10px var(--gutter);
  border-bottom: 1px solid var(--rule); background: var(--ivory);
}
.intro-bar-left, .intro-bar-right { display: flex; align-items: center; gap: 14px; min-width: 0; }
.intro-brand { font-weight: 600; font-size: 14px; text-transform: uppercase; letter-spacing: .01em; white-space: nowrap; }
.intro-bar-sep { color: var(--ink-3); font-family: var(--font-mono); }
.intro-bar-role { font-family: var(--font-mono); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.intro-bar-status {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: .05em; text-transform: uppercase;
  transition: color .4s;
}
.intro-bar-status[data-tone="amber"]  { color: var(--amber); }
.intro-bar-status[data-tone="cobalt"] { color: var(--cobalt); }
.intro-bar-status[data-tone="green"]  { color: var(--green); }
.intro-skip {
  font-family: var(--font-mono); font-size: 13px; color: var(--ink-2);
  text-decoration: underline; text-underline-offset: .22em; text-decoration-color: var(--rule-strong); white-space: nowrap;
}
.intro-skip:hover { color: var(--ink); text-decoration-color: currentColor; }
@media (max-width: 720px) { .intro-bar-role, .intro-bar-sep { display: none; } }
@media (max-width: 560px) { .intro-bar-status { display: none; } }

.intro-body {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(20px, 3vh, 32px); padding: clamp(20px, 3vh, 40px) var(--gutter); text-align: center;
}
.intro-head { display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 680px; }
.intro-title {
  font-size: clamp(36px, 5vw, 58px); font-weight: 700; letter-spacing: -.04em; line-height: 1.02; margin: 0;
  text-wrap: balance;
}
.intro-sub { font-size: 17px; color: var(--ink-2); margin: 0; max-width: 560px; text-wrap: pretty; }
.intro-stage {
  --dw: max(560px, min(880px, calc((100vh - 510px) * 1.53)));
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px;
  width: 100%; max-width: 880px; max-width: var(--dw);
}
.intro-stage-diagram { min-width: 0; }
.intro-stage-log { position: relative; min-width: 0; }

/* kubectl transcript. Lines are appended by script.js as the recovery runs. */
.kube-log {
  display: flex; flex-direction: column; height: 200px;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 14px; overflow: hidden;
  font-family: var(--font-mono); font-size: 11.5px; line-height: 1.5; text-align: left; color: var(--ink-2);
}
.kube-log-head {
  display: flex; align-items: center; gap: 10px; flex: none; padding: 8px 12px;
  border-bottom: 1px solid var(--rule-soft); color: var(--ink-3); font-size: 11px; letter-spacing: .04em; text-transform: uppercase;
}
.kube-log-dots { display: inline-flex; gap: 5px; }
.kube-log-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--rule-strong); }
.kube-log-body { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 12px 14px; white-space: pre-wrap; overflow-wrap: anywhere; scroll-behavior: smooth; }
.kube-line { display: block; animation: kube-line-in .25s ease both; }
.kube-line + .kube-line-cmd, .kube-line + .kube-line-note { margin-top: 8px; }
.kube-line-cmd { color: var(--ink); font-weight: 600; }
.kube-line-cmd::before { content: "$ "; color: var(--cobalt); font-weight: 500; }
.kube-line-err { color: var(--amber); }
.kube-line-ok { color: var(--green); }
.kube-line-note { color: var(--ink-3); }
@keyframes kube-line-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

@media (min-width: 1000px) {
  .intro-stage { grid-template-columns: minmax(0, 1fr) 320px; max-width: calc(var(--dw) + 334px); align-items: stretch; }
  .kube-log { position: absolute; inset: 0; height: auto; }
}

.intro-cta { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.intro-cta-slot { display: grid; justify-items: center; align-items: center; }
.intro-cta-slot > * { grid-area: 1 / 1; margin: 0; }
.intro-status {
  display: inline-flex; align-items: center; gap: 10px; height: 58px; padding: 0 24px; border-radius: 12px;
  font-family: var(--font-mono); font-size: 13px; font-weight: 500; letter-spacing: .05em; text-transform: uppercase;
  background: var(--cobalt-soft); color: var(--cobalt); border: 1px solid var(--cobalt-line);
  opacity: 0; visibility: hidden; transform: scale(.98);
  transition: opacity .35s, visibility .35s, transform .35s, color .4s, background-color .4s, border-color .4s;
}
.intro-status[data-tone="green"] { background: var(--green-soft); color: var(--green); border-color: var(--green-line); }
.intro-cta-slot.is-paging .btn { opacity: 0; visibility: hidden; transform: scale(.96); pointer-events: none; }
.intro-cta-slot.is-paging .intro-status { opacity: 1; visibility: visible; transform: none; }
.intro-tags { font-family: var(--font-mono); font-size: 13px; color: var(--ink-2); margin: 0; letter-spacing: .01em; }
.intro-meta { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); margin: 0; flex-wrap: wrap; justify-content: center; }
.intro-skip-2 { color: var(--ink-2); text-decoration: underline; text-underline-offset: .2em; text-decoration-color: var(--rule-strong); }
.intro-skip-2:hover { color: var(--ink); text-decoration-color: currentColor; }
.intro-foot {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); text-align: center;
  padding: 10px var(--gutter); border-top: 1px solid var(--rule); background: var(--ivory);
}

/* Reveal: the overlay lets go, the page underneath fades up */
html.is-revealed .intro { background: transparent; pointer-events: none; }
html.is-revealed .intro > * { opacity: 0; transition: opacity .3s ease; }

/* --------------------------------------------------------------------------
   Cluster diagram
   The diagram is authored at a fixed intrinsic size (--iw × --ih) and scaled
   to its container with a pure-CSS factor, so wiring stays exact at any size.
   -------------------------------------------------------------------------- */
.cluster-frame { container-type: inline-size; position: relative; width: 100%; }
.cluster-frame.is-flipping { position: relative; z-index: 60; will-change: transform; transition: transform .9s var(--ease); }
.cluster-stage {
  --iw: 680; --ih: 444;
  position: relative; width: 100%;
  /* scale = container width / intrinsic width, as a unitless number */
  height: calc(var(--ih) * 1px * tan(atan2(100cqw, var(--iw) * 1px)));
}
.cluster-stage::before {
  content: ""; position: absolute; inset: -32px; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 45%, transparent 80%);
  mask-image: radial-gradient(ellipse at center, #000 45%, transparent 80%);
  opacity: 0; transition: opacity 1.2s ease .3s;
}
html:not(.has-intro) .cluster-stage::before { opacity: 1; }

.cluster {
  --layout: row;
  position: absolute; top: 0; left: 0; z-index: 1; margin: 0;
  width: calc(var(--iw) * 1px); height: calc(var(--ih) * 1px);
  transform: scale(tan(atan2(100cqw, var(--iw) * 1px))); transform-origin: 0 0;
  display: grid; grid-template-rows: 18px 16px 62px 60px 207px 45px;
  padding: 18px 20px;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 16px;
  font-family: var(--font-mono); font-size: 12px; line-height: 1.3; color: var(--ink);
  text-align: left;
}
.cluster::after { /* acknowledgement pulse */
  content: ""; position: absolute; inset: 0; border-radius: 16px; pointer-events: none; z-index: 5;
  background: linear-gradient(180deg, transparent 0%, rgba(34, 70, 217, .14) 50%, transparent 100%);
  background-size: 100% 45%; background-repeat: no-repeat; background-position: 0 -60%;
  opacity: 0;
}
.cluster[data-state="acknowledged"]::after { animation: pulse 1s ease-in-out both; }
@keyframes pulse {
  0%   { opacity: 0; background-position: 0 -60%; }
  20%  { opacity: 1; }
  100% { opacity: 0; background-position: 0 160%; }
}

.card-head, .card-foot {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3);
}
.card-head { grid-row: 1; align-items: center; white-space: nowrap; }
.card-foot { grid-row: 6; align-items: flex-start; border-top: 1px solid var(--rule-soft); margin-top: 16px; padding-top: 12px; }
.card-status { color: var(--ink-2); font-weight: 500; transition: color .4s; white-space: nowrap; }
.card-status-key { color: var(--ink-3); font-weight: 400; }
.card-status[data-tone="amber"]  { color: var(--amber); }
.card-status[data-tone="cobalt"] { color: var(--cobalt); }
.card-status[data-tone="green"]  { color: var(--green); }
.card-note { text-transform: none; letter-spacing: .01em; font-size: 11px; text-align: right; white-space: nowrap; }

.svc {
  grid-row: 3; justify-self: center; position: relative; z-index: 2;
  width: 260px; height: 62px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  border: 1px solid var(--rule); border-radius: 10px; background: var(--paper);
  transition: border-color .5s;
}
.svc-label { display: inline-flex; align-items: center; gap: 7px; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); transition: color .4s; }
.svc-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); transition: background-color .4s; }
.svc-name { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink); }
.svc-icon { width: 13px; height: 13px; fill: none; stroke: var(--cobalt); stroke-width: 1.4; stroke-linejoin: round; transition: stroke .4s; }
.svc[data-status="degraded"]   .svc-dot { background: var(--amber); }
.svc[data-status="degraded"]   .svc-label { color: var(--amber); }
.svc[data-status="recovering"] .svc-dot { background: var(--cobalt); }
.svc[data-status="recovering"] .svc-label { color: var(--cobalt); }
.svc[data-status="recovering"] { border-color: var(--cobalt-line); }
.svc[data-status="healthy"]    .svc-dot { background: var(--green); }
.svc[data-status="healthy"]    .svc-label { color: var(--green); }
.svc[data-status="healthy"]    .svc-icon { stroke: var(--green); }
.svc[data-status="healthy"]    { border-color: var(--green-line); }

.lane { grid-row: 4; }

.nodes { grid-row: 5; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.node {
  position: relative; z-index: 2; height: 207px; padding: 12px;
  border: 1px solid var(--rule); border-radius: 12px; background: var(--paper);
  transition: border-color .5s, background-color .5s, opacity .6s;
}
.node[data-status="notready"] { border-color: var(--amber-line); background: var(--amber-soft); }
.node[data-status="isolated"] { border-style: dashed; opacity: .62; }
.cluster[data-state="recovering"] .node[data-status="ready"] { border-color: var(--cobalt-line); }
.cluster[data-state="restored"]   .node[data-status="ready"] { border-color: var(--green-line); }

.node-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; height: 34px; }
.node-id { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.node-zone { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.node-name { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.node[data-status="isolated"] .node-name { color: var(--ink-2); }
.node[data-status="notready"] .node-zone { color: var(--amber); }
.node-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 20px; padding: 0 8px; border-radius: 999px;
  font-size: 10px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
  border: 1px solid var(--rule); color: var(--ink-2); background: var(--paper);
  transition: color .4s, background-color .4s, border-color .4s;
}
.pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.node[data-status="ready"]    .node-pill { color: var(--green); background: var(--green-soft); border-color: var(--green-line); }
.node[data-status="notready"] .node-pill { color: var(--amber); background: #fff; border-color: var(--amber-line); }
.node[data-status="notready"] .pill-dot { border-radius: 0; width: 7px; height: 6px; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.node[data-status="isolated"] .node-pill { color: var(--ink-3); background: transparent; border-color: var(--rule); }
.node[data-status="isolated"] .pill-dot { display: none; }

.pods { list-style: none; margin: 10px 0 0; padding: 10px 0 0; border-top: 1px solid var(--rule-soft); display: grid; gap: 6px; }
.pod {
  height: 30px; padding: 0 9px; border-radius: 6px;
  border: 1px solid var(--rule-soft); background: var(--ivory-deep);
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px;
  font-size: 11.5px; color: var(--ink);
  transition: border-color .4s, background-color .4s, opacity .4s, color .4s;
}
.pod-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex: none; transition: background-color .4s; }
.pod-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pod-state { font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; transition: color .4s; }
.pod[data-status="ready"] .pod-state { color: var(--green); }
.pod[data-status="ready"].is-new { border-color: var(--green-line); background: var(--green-soft); }
.pod[data-status="starting"] { border-color: var(--cobalt-line); background: var(--cobalt-soft); }
.pod[data-status="starting"] .pod-state { color: var(--cobalt); }
.pod[data-status="starting"] .pod-dot { background: transparent; border: 1.5px solid var(--cobalt); border-right-color: transparent; animation: spin .9s linear infinite; }
.pod[data-status="terminating"] { background: transparent; border-color: var(--amber-line); }
.pod[data-status="terminating"] .pod-dot { background: var(--amber); }
.pod[data-status="terminating"] .pod-name { text-decoration: line-through; color: var(--ink-2); }
.pod[data-status="terminating"] .pod-state { color: var(--amber); }
.pod[data-status="terminated"] { background: transparent; border-style: dashed; opacity: .75; }
.pod[data-status="terminated"] .pod-dot { background: var(--rule-strong); }
.pod[data-status="terminated"] .pod-name { text-decoration: line-through; color: var(--ink-3); }
.pod[data-status="spare"] { background: transparent; border-style: dashed; color: var(--ink-3); }
.pod[data-status="spare"] .pod-dot { background: transparent; border: 1px dashed var(--rule-strong); }
.pod[data-status="spare"] .pod-name { font-weight: 400; }
@keyframes spin { to { transform: rotate(360deg); } }

.node-foot {
  display: flex; justify-content: space-between; gap: 8px; margin-top: 10px;
  font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap;
}
.node[data-status="notready"] .node-foot { color: var(--amber); }
.node-foot-r { display: none; }

/* Wiring */
.wires { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 1; }
.wire { fill: none; stroke: var(--rule-strong); stroke-width: 1.5; stroke-linecap: round; transition: stroke .5s; }
.wire[data-status="ready"]    { stroke: var(--ink-2); }
.wire[data-status="notready"] { stroke: var(--amber); stroke-dasharray: 3 4; }
.wire[data-status="isolated"] { stroke: var(--rule-strong); stroke-dasharray: 3 4; }
.cluster[data-state="acknowledged"] .wire[data-status="ready"] { stroke: var(--cobalt); }
.cluster[data-state="recovering"]   .wire[data-status="ready"] { stroke: var(--cobalt); stroke-dasharray: 4 5; animation: flow .7s linear infinite; }
.cluster[data-state="restored"]     .wire[data-status="ready"] { stroke: var(--green); }
.cluster[data-state="restored"]:not(.is-settled) .wire[data-status="ready"] { stroke-dasharray: 4 5; animation: flow .7s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -9; } }

.drop-dot { fill: var(--ink-2); stroke: var(--paper); stroke-width: 1.5; transition: fill .5s; }
.drop-dot[data-status="notready"], .drop-dot[data-status="isolated"] { display: none; }
.cluster[data-state="acknowledged"] .drop-dot[data-status="ready"],
.cluster[data-state="recovering"]   .drop-dot[data-status="ready"] { fill: var(--cobalt); }
.cluster[data-state="restored"]     .drop-dot[data-status="ready"] { fill: var(--green); }
.drop-x { display: none; }
.drop-x path { fill: none; stroke-width: 1.5; stroke-linecap: round; }
.drop-x[data-status="notready"] { display: block; }
.drop-x[data-status="notready"] path { stroke: var(--amber); }
.drop-x[data-status="isolated"] { display: block; }
.drop-x[data-status="isolated"] path { stroke: var(--rule-strong); }

/* Stacked layout for narrow containers (phones): service on top, nodes in a
   column joined by short centred connectors, annotations trimmed. */
@container (max-width: 500px) {
  .cluster-stage { --iw: 360; --ih: 664; }
  .cluster { --layout: stack; grid-template-rows: 0 0 56px 24px 519px 37px; padding: 14px; }
  .card-head { display: none; }
  .card-foot { margin-top: 12px; padding-top: 10px; }
  .card-note { display: none; }
  .svc { width: auto; justify-self: stretch; height: 56px; }
  .nodes { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .node { height: 157px; padding: 10px; }
  .node-head { height: 22px; align-items: center; }
  .node-zone { display: none; }
  .pods { margin-top: 8px; padding-top: 8px; }
  .pod { height: 28px; }
  .node-foot { display: none; }
}

/* --------------------------------------------------------------------------
   Site header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(246, 244, 238, .88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.nav { display: flex; justify-content: space-between; align-items: center; gap: 12px 20px; flex-wrap: wrap; min-height: 60px; padding-top: 10px; padding-bottom: 10px; }
.nav-brand { display: inline-flex; align-items: baseline; gap: 12px; color: var(--ink); text-decoration: none; min-width: 0; }
.nav-brand:hover { text-decoration: none; color: var(--ink); }
.nav-name { font-weight: 600; font-size: 14px; text-transform: uppercase; letter-spacing: .01em; white-space: nowrap; }
.nav-sep { color: var(--ink-3); font-family: var(--font-mono); }
.nav-role { font-family: var(--font-mono); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.nav-links { display: flex; align-items: center; gap: 22px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.nav-links a {
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-2); text-decoration: none;
}
.nav-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: .25em; }
.nav-links .nav-resume { color: var(--cobalt); border: 1px solid var(--cobalt-line); background: var(--cobalt-soft); padding: 7px 12px; border-radius: 999px; }
.nav-links .nav-resume:hover { color: var(--cobalt-deep); border-color: var(--cobalt); text-decoration: none; }
@media (max-width: 860px) { .nav-role, .nav-sep { display: none; } }
@media (max-width: 420px) { .nav-links { gap: 14px; } }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 10fr) minmax(0, 11fr);
  gap: clamp(32px, 5vw, 72px); align-items: center;
  padding-top: clamp(48px, 8vh, 96px); padding-bottom: clamp(48px, 8vh, 96px);
}
.hero-photo {
  margin: 0 0 24px; width: 112px; height: 112px; border-radius: 18px; overflow: hidden;
  border: 1px solid var(--rule); background: var(--ivory-deep);
}
.hero-photo[hidden] { display: none; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.eyebrow { margin: 0 0 24px; }
.hero-name { font-size: clamp(56px, 7.5vw, 104px); font-weight: 700; letter-spacing: -.045em; line-height: .95; margin: 0 0 22px; }
.hero-name:focus { outline: none; }
.hero-headline { font-size: clamp(22px, 2.4vw, 30px); font-weight: 600; letter-spacing: -.025em; line-height: 1.15; margin: 0 0 18px; text-wrap: balance; }
.hero-intro { font-size: 17px; color: var(--ink-2); margin: 0 0 30px; max-width: 54ch; text-wrap: pretty; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-visual { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.hero-visual-slot { position: relative; }

.demo-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; font-size: 14px; }
.demo-details summary {
  cursor: pointer; color: var(--cobalt); font-weight: 500; list-style: none;
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 2px; border-radius: 4px;
}
.demo-details summary::-webkit-details-marker { display: none; }
.demo-details summary::after { content: "+"; font-family: var(--font-mono); color: var(--ink-3); }
.demo-details[open] summary::after { content: "–"; }
.demo-details[open] { flex-basis: 100%; }
.demo-details-body {
  margin-top: 10px; padding: 18px 20px; border: 1px solid var(--rule); border-radius: 12px; background: var(--paper);
  font-size: 15px; color: var(--ink-2); max-width: 62ch;
}
.demo-details-body p { margin: 0 0 12px; }
.demo-details-body p:last-child { margin-bottom: 0; }
.demo-details-body strong { color: var(--ink); font-weight: 600; }
.demo-details-note { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); padding-top: 12px; border-top: 1px solid var(--rule-soft); }
.demo-status { margin: 0; font-family: var(--font-mono); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--cobalt); }
.demo-status:empty { display: none; }
.demo-status[data-tone="green"] { color: var(--green); }

/* Reveal choreography */
html.is-revealed .site-header { animation: fade .6s ease .25s both; }
html.is-revealed .hero-copy > * { animation: rise .7s var(--ease) both; }
html.is-revealed .hero-copy > :nth-child(1) { animation-delay: .20s; }
html.is-revealed .hero-copy > :nth-child(2) { animation-delay: .28s; }
html.is-revealed .hero-copy > :nth-child(3) { animation-delay: .36s; }
html.is-revealed .hero-copy > :nth-child(4) { animation-delay: .44s; }
html.is-revealed .hero-copy > :nth-child(5) { animation-delay: .52s; }
html.is-revealed .hero-copy > :nth-child(6) { animation-delay: .60s; }
html.is-revealed .demo-controls { animation: fade .6s ease .9s both; }
html.is-revealed .section, html.is-revealed .site-footer { animation: fade .8s ease .6s both; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 40px; align-items: start; }
  .hero-name { font-size: clamp(48px, 13vw, 80px); }
  .hero-photo { width: 96px; height: 96px; border-radius: 16px; }
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.section { padding-top: clamp(56px, 8vh, 104px); padding-bottom: clamp(56px, 8vh, 104px); border-top: 1px solid var(--rule); }
.section-head { display: grid; gap: 14px; max-width: 760px; margin-bottom: clamp(32px, 5vh, 56px); }
.section-index { font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--cobalt); }
.section-title { font-size: clamp(30px, 3.6vw, 46px); font-weight: 700; letter-spacing: -.035em; line-height: 1.05; margin: 0; text-wrap: balance; }
.section-lede { color: var(--ink-2); font-size: 17px; margin: 0; text-wrap: pretty; }

.work-item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: 20px 48px; padding: 40px 0; border-top: 1px solid var(--rule); }
.work-item:last-child { border-bottom: 1px solid var(--rule); }
.work-meta { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.work-meta .badge { white-space: normal; height: auto; padding: 6px 12px; line-height: 1.3; text-align: left; }
.work-index { font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.work-title { font-size: clamp(22px, 2.2vw, 28px); font-weight: 600; letter-spacing: -.025em; line-height: 1.15; margin: 0 0 22px; text-wrap: balance; }
.work-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 0; }
.work-grid dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--rule-soft); }
.work-grid dd { margin: 0; font-size: 15.5px; color: var(--ink-2); line-height: 1.55; }

.ph {
  font-family: var(--font-mono); font-size: .86em; color: var(--amber);
  background: var(--amber-soft); border: 1px dashed var(--amber-line); border-radius: 4px; padding: 1px 6px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline-item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: 12px 48px; padding: 32px 0; border-top: 1px solid var(--rule); }
.timeline-item:last-child { border-bottom: 1px solid var(--rule); }
.timeline-when { font-family: var(--font-mono); font-size: 13px; color: var(--ink-2); padding-top: 4px; }
.timeline-role { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin: 0 0 6px; line-height: 1.2; }
.timeline-org { margin: 0 0 14px; color: var(--ink-2); }
.timeline-points { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 15.5px; }
.timeline-points li { margin: 4px 0; }
.timeline-points strong { color: var(--ink); font-weight: 600; }
.timeline-item--compact { padding: 22px 0; }
.timeline-item--compact .timeline-role { font-size: 18px; }
.timeline-item--compact .timeline-org { margin-bottom: 6px; }
.timeline-summary { margin: 0; color: var(--ink-2); font-size: 15.5px; }

.credentials { margin: 0; padding: 0; }
.credentials-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: 8px 48px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.credentials-key { font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding-top: 3px; }
.credentials-val { margin: 0; color: var(--ink-2); font-size: 15.5px; }

.contact-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.contact-list li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: 8px 48px; padding: 22px 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.contact-key { font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.contact-val { font-size: clamp(19px, 2.4vw, 28px); font-weight: 600; letter-spacing: -.02em; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
a.contact-val:hover { color: var(--cobalt); text-decoration: none; }

.site-footer { border-top: 1px solid var(--rule); padding: 28px 0; }
.site-footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); }
.site-footer a { color: var(--ink-2); text-decoration: underline; text-underline-offset: .2em; text-decoration-color: var(--rule-strong); }
.site-footer a:hover { color: var(--ink); }

@media (max-width: 760px) {
  .work-item, .timeline-item, .credentials-row, .contact-list li { grid-template-columns: minmax(0, 1fr); }
  .work-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .work-meta { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
}

/* --------------------------------------------------------------------------
   Reduced motion: no choreography, no flow, no pulse — state changes only
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .cluster-frame.is-flipping { transition: none; }
  .kube-log-body { scroll-behavior: auto; }
  .cluster[data-state="recovering"] .wire[data-status="ready"],
  .cluster[data-state="restored"]:not(.is-settled) .wire[data-status="ready"] { stroke-dasharray: none; }
}

/* --------------------------------------------------------------------------
   Narrow screens: button before the diagram, fewer chrome lines, static nav
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .intro-body { justify-content: flex-start; gap: 22px; }
  .intro-cta { display: contents; }
  .intro-cta-slot { order: 2; }
  .intro-stage { order: 3; max-width: none; }
  .intro-tags { order: 4; }
  .intro-meta { order: 5; }
  .intro-meta-sep { display: none; }
  .intro-foot { display: none; }
  .intro-sub { font-size: 16px; }
  .site-header { position: static; backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--ivory); }
}
