/* Infrastructure Lab page components. Loads after /assets/css/base.css. */

/* ============================== HERO ============================== */

.hero {
  padding-top: clamp(2rem, 5vw, 3.5rem);
  padding-bottom: 0;
}
#architecture {
  padding-top: clamp(3.5rem, 6vw, 5rem);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: end;
}

.hero h1 {
  font-size: var(--fs-hero);
  font-variation-settings: "wdth" 115;
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 0.98;
  max-width: 11ch;
}

.hero__lede {
  font-size: var(--fs-md);
  color: var(--text);
  margin-top: 1.5rem;
  max-width: 34em;
  line-height: 1.45;
}

.hero__copy > p:not(.hero__lede) {
  color: var(--muted);
  margin-top: 1rem;
  max-width: 36em;
}

.hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  margin: 2rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
.hero__facts dt {
  color: var(--faint);
  font-size: var(--fs-sm);
}
.hero__facts dd {
  margin: 0.15rem 0 0;
  font-weight: 500;
}

/* platform spec panel */
.spec {
  margin: 0;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.spec__bar {
  display: flex;
  gap: 6px;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.spec__bar span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line-strong);
}
.spec__list {
  margin: 0;
  padding: 1.1rem 1.25rem 0.5rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.5;
}
.spec__list div {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 1rem;
  padding: 0.28rem 0;
}
.spec__list dt {
  color: var(--public);
}
.spec__list dd {
  margin: 0;
  color: var(--text);
}
.spec figcaption {
  padding: 0.75rem 1.25rem 1rem;
  color: var(--faint);
  font-size: var(--fs-xs);
  border-top: 1px dashed var(--line);
  margin-top: 0.5rem;
}

/* ============================== ARCHITECTURE ============================== */

.views {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.view-btn {
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  transition:
    color 0.2s,
    background 0.2s,
    border-color 0.2s;
}
.view-btn:hover {
  color: var(--text);
  border-color: var(--faint);
}
.view-btn.is-active {
  color: var(--bg);
  background: var(--text);
  border-color: var(--text);
}
.view-btn--public.is-active {
  background: var(--public);
  border-color: var(--public);
}
.view-btn--private.is-active {
  background: var(--private);
  border-color: var(--private);
}

.topo-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-raise);
}

.topo {
  display: block;
  width: 100%;
  min-width: 760px;
  height: auto;
  font-family: var(--sans);
}

.grid-dot {
  fill: #1a2a42;
}

.lane {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
}
.lane--public {
  fill: var(--public);
}
.lane--private {
  fill: var(--private);
}

.zone rect {
  fill: rgba(19, 34, 58, 0.45);
  stroke: var(--line-strong);
  stroke-width: 1;
}
.zone--gpu rect,
.zone--offhost rect {
  stroke-dasharray: 5 5;
  fill: rgba(19, 34, 58, 0.25);
}
.zone__title {
  fill: var(--text);
  font-size: 14px;
  font-weight: 600;
  font-variation-settings: "wdth" 110;
}
.zone__sub,
.zone__state {
  fill: var(--faint);
  font-family: var(--mono);
  font-size: 11px;
}
.zone__state {
  fill: var(--muted);
}

.boundary-tag rect {
  fill: var(--bg-raise);
  stroke: var(--line-strong);
}
.boundary-tag text {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
}

/* edges */
.edge {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
  transition:
    stroke 0.3s,
    opacity 0.3s,
    stroke-width 0.3s;
}
.edge--public {
  stroke: rgba(83, 199, 227, 0.55);
}
.edge--private {
  stroke: rgba(143, 155, 255, 0.55);
}
.edge--ondemand {
  stroke-dasharray: 6 6;
}
.edge--copy {
  stroke-dasharray: 2 5;
}

.edge-labels text {
  fill: var(--faint);
  font-family: var(--mono);
  font-size: 10.5px;
  transition: opacity 0.3s;
}

/* nodes */
.node {
  cursor: pointer;
  outline: none;
}
.node rect {
  fill: var(--panel);
  stroke: var(--line-strong);
  stroke-width: 1;
  transition:
    fill 0.25s,
    stroke 0.25s,
    opacity 0.25s;
}
.node .n-title {
  fill: var(--text);
  font-size: 14.5px;
  font-weight: 600;
  font-variation-settings: "wdth" 92;
  letter-spacing: -0.005em;
}
.node .n-sub {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
}
.node:hover rect,
.node:focus-visible rect {
  stroke: var(--text);
}
.node:focus-visible rect {
  stroke-width: 2;
}
.node.is-selected rect {
  stroke: var(--text);
  stroke-width: 2;
  fill: var(--panel-2);
}

/* status dots, shared by diagram and legend */
.n-status {
  fill: var(--ok);
}
[data-status="building"] .n-status {
  fill: var(--warn);
}
[data-status="target"] .n-status {
  fill: none;
  stroke: var(--faint);
  stroke-width: 1.5;
  stroke-dasharray: 2 2;
}
.node[data-status="target"] rect {
  stroke-dasharray: 5 4;
  fill: rgba(19, 34, 58, 0.6);
}

/* dimming for views and hover */
.topo.is-focused .node,
.topo.is-focused .zone,
.topo.is-focused .edge {
  opacity: 0.22;
}
.topo.is-focused .is-lit {
  opacity: 1;
}
.topo.is-focused .edge.is-lit {
  stroke-width: 2.4;
}
.topo.is-focused .edge--public.is-lit {
  stroke: var(--public);
}
.topo.is-focused .edge--private.is-lit {
  stroke: var(--private);
}
.topo.is-focused .edge--internal.is-lit,
.topo.is-focused .edge--obs.is-lit,
.topo.is-focused .edge--storage.is-lit,
.topo.is-focused .edge--gpu.is-lit {
  stroke: var(--text);
}
.edge-labels text {
  opacity: 0;
}
.topo.is-focused .edge-labels text.is-lit {
  opacity: 1;
  fill: var(--muted);
}

.packet {
  r: 3.2;
  fill: var(--text);
}
.packet--public {
  fill: var(--public);
}
.packet--private {
  fill: var(--private);
}

/* first-view reveal: the one orchestrated moment on the page.
   Scoped to .js so the diagram is fully visible without JavaScript. */
.js .topo:not(.is-revealed) .node,
.js .topo:not(.is-revealed) .zone,
.js .topo:not(.is-revealed) .boundary-tag,
.js .topo:not(.is-revealed) .lane,
.js .topo:not(.is-revealed) .edge {
  opacity: 0;
}
.topo.is-revealed:not(.is-settled) .node,
.topo.is-revealed:not(.is-settled) .zone,
.topo.is-revealed:not(.is-settled) .boundary-tag,
.topo.is-revealed:not(.is-settled) .lane {
  transition: opacity 0.6s var(--ease);
  transition-delay: var(--d, 0s);
}
.topo .node,
.topo .zone {
  transition: opacity 0.3s;
}

.swipe-hint {
  display: none;
  color: var(--faint);
  font-size: var(--fs-xs);
  margin-top: 0.6rem;
}
.topo-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-top: 1rem;
  align-items: center;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: var(--fs-sm);
  color: var(--muted);
}
.legend li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ok);
  display: inline-block;
}
.dot[data-status="building"] {
  background: var(--warn);
}
.dot[data-status="target"] {
  background: transparent;
  border: 1.5px dashed var(--faint);
}
.swatch {
  width: 18px;
  height: 2px;
  display: inline-block;
}
.swatch--public {
  background: var(--public);
}
.swatch--private {
  background: var(--private);
}
.topo-note {
  color: var(--faint);
  font-size: var(--fs-sm);
  max-width: 34rem;
}

/* detail panel */
.detail {
  margin-top: 1.5rem;
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
  min-height: 7rem;
}
.detail__empty p {
  color: var(--faint);
  max-width: 40rem;
}
.detail__head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.1rem;
}
.detail__head h3 {
  font-size: var(--fs-lg);
  font-variation-settings: "wdth" 108;
}
.detail__cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
}
.detail__cols h4 {
  font-size: var(--fs-sm);
  color: var(--faint);
  font-weight: 500;
  margin-bottom: 0.4rem;
  letter-spacing: 0;
}
.detail__cols p {
  color: var(--text);
  font-size: 0.97rem;
}
.detail__cols > div:last-child p {
  color: var(--muted);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--fs-xs);
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
}
.status-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
}
.status-pill[data-status="building"]::before {
  background: var(--warn);
}
.status-pill[data-status="target"]::before {
  background: transparent;
  border: 1.5px dashed var(--faint);
}
.status-pill:empty {
  display: none;
}

/* ============================== REQUEST JOURNEY ============================== */

.journey__controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}
.tabs {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 3px;
}
.tab {
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  padding: 0.45rem 1rem;
  cursor: pointer;
}
.tab[aria-selected="true"] {
  color: var(--bg);
}
.tab--public[aria-selected="true"] {
  background: var(--public);
}
.tab--private[aria-selected="true"] {
  background: var(--private);
}

.stages {
  --accent: var(--public);
  --n: 7;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  gap: 1.25rem;
  position: relative;
  counter-reset: stage;
  /* distance from the first node to the last: everything except the last column */
  --track: calc(100% - (100% - (var(--n) - 1) * 1.25rem) / var(--n));
}
.journey__panel--private .stages {
  --accent: var(--private);
  --n: 5;
}
/* the track the request travels along */
.stages::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 7px;
  width: var(--track);
  height: 2px;
  background: var(--line-strong);
}
.stages::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 7px;
  height: 2px;
  width: calc(var(--track) * var(--progress, 0));
  background: var(--accent);
  transition: width 0.55s var(--ease);
}
.stage {
  position: relative;
  counter-increment: stage;
  padding-top: 2rem;
}
.stage__node {
  position: absolute;
  top: 0;
  left: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--line-strong);
  z-index: 1;
  transition:
    border-color 0.3s,
    background 0.3s,
    box-shadow 0.3s;
}
.stage h3 {
  font-size: 1rem;
  font-variation-settings: "wdth" 96;
  margin-bottom: 0.4rem;
}
.stage h3::before {
  content: counter(stage);
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--faint);
  font-weight: 400;
  margin-right: 0.45rem;
}
.stage p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}
.stage.is-passed .stage__node {
  border-color: var(--accent);
  background: var(--accent);
}
.stage.is-current .stage__node {
  border-color: var(--accent);
  background: var(--bg);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 22%, transparent);
}
.stage.is-current h3 {
  color: var(--accent);
}

/* ============================== SECURITY LAYERS ============================== */

.layers-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 19rem;
  gap: 2rem;
  align-items: start;
}

.layers {
  display: grid;
  gap: 0;
}
.layer,
.layer-base {
  font: inherit;
  color: inherit;
  text-align: left;
  display: grid;
  grid-template-columns: 14rem 1fr;
  gap: 1rem;
  align-items: baseline;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition:
    background 0.25s,
    border-color 0.25s;
}
.layer {
  border-bottom: 0;
}
/* each inner layer is inset, so the stack reads as a cross-section */
.layer--l1 {
  border-radius: var(--radius) var(--radius) 0 0;
}
.layer-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-inline: 1rem;
}
.layer-split .layer {
  grid-template-columns: 1fr;
  gap: 0.3rem;
  border-left-width: 1px;
}
.layer-split .layer + .layer {
  border-left: 0;
}
.layer--public {
  box-shadow: inset 3px 0 0 var(--public);
}
.layer--private {
  box-shadow: inset 3px 0 0 var(--private);
}
.layer--l3 {
  margin-inline: 2rem;
}
.layer--l4 {
  margin-inline: 3rem;
}
.layer-core {
  margin-inline: 4rem;
  padding: 0.85rem 1.25rem;
  border: 1px dashed var(--line-strong);
  border-bottom: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: var(--fs-sm);
  text-align: center;
}
.layer-base {
  cursor: default;
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--bg-raise);
}
.layer:hover {
  background: var(--panel-2);
}
.layer__name {
  font-weight: 600;
  font-variation-settings: "wdth" 104;
}
.layer__desc {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}
.layer[aria-pressed="true"] {
  background: rgba(240, 113, 122, 0.08);
  border-color: rgba(240, 113, 122, 0.55);
  border-style: dashed;
}
.layer[aria-pressed="true"] .layer__name {
  color: var(--bad);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}
.layer[aria-pressed="true"] + .layer,
.layer-split + .layer[aria-pressed="true"] {
  border-top-color: rgba(240, 113, 122, 0.55);
}

.breach {
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  position: sticky;
  top: 8rem;
}
.breach h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
}
.breach__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 1rem;
  margin-bottom: 0.9rem;
}
.breach__label {
  font-size: var(--fs-sm);
}
.breach__label--public {
  color: var(--public);
}
.breach__label--private {
  color: var(--private);
}
.breach__count {
  font-family: var(--mono);
  font-size: var(--fs-sm);
  color: var(--muted);
}
.breach__meter {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.breach__meter i {
  height: 6px;
  border-radius: 2px;
  background: var(--ok);
  transition: background 0.3s;
}
.breach__meter i.is-down {
  background: rgba(240, 113, 122, 0.45);
}
.breach__msg {
  color: var(--muted);
  font-size: var(--fs-sm);
  margin: 0.5rem 0 1rem;
  min-height: 3.2em;
}

/* ============================== DECISIONS ============================== */

.decisions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(2rem, 5vw, 4rem);
}
.decision {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 2rem;
}
.decision h3 {
  font-size: var(--fs-md);
  font-variation-settings: "wdth" 106;
  margin-bottom: 0.65rem;
}
.decision p {
  color: var(--muted);
  max-width: 34em;
}
.decision__cost {
  margin-top: 0.9rem;
  font-size: 0.93rem;
  color: var(--text) !important;
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.75rem;
}
.decision__cost span {
  color: var(--warn);
  font-family: var(--mono);
  font-size: var(--fs-xs);
  padding-top: 0.2em;
}

/* ============================== ISOLATION ============================== */

.iso {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.iso__compare {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-raise);
  overflow: hidden;
}
.cmp__row {
  display: grid;
  grid-template-columns: 6.5rem 1fr 1fr;
  gap: 1rem;
  padding: 0.8rem 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.93rem;
}
.cmp__row [role="rowheader"] {
  color: var(--faint);
  font-size: var(--fs-sm);
}
.cmp__row [role="cell"] {
  color: var(--muted);
}
.cmp__row--head {
  border-top: 0;
  background: var(--panel);
  font-weight: 600;
  font-size: var(--fs-base);
  font-variation-settings: "wdth" 106;
}
.cmp__c {
  color: var(--public);
}
.cmp__v {
  color: var(--private);
}

.vm-life h3 {
  font-size: var(--fs-md);
}
.vm-life > p {
  color: var(--muted);
  margin: 0.6rem 0 1.25rem;
}
.vm-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: vm;
  border-left: 1px solid var(--line-strong);
}
.vm-steps li {
  counter-increment: vm;
  position: relative;
  padding: 0 0 1rem 1.5rem;
  display: grid;
  gap: 0.1rem;
}
.vm-steps li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0.45em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--private);
}
.vm-steps li:first-child::before,
.vm-steps li:last-child::before {
  border-color: var(--faint);
}
.vm-steps li:last-child {
  padding-bottom: 0;
}
.vm-steps strong {
  font-weight: 600;
}
.vm-steps span {
  color: var(--muted);
  font-size: 0.93rem;
}

/* ============================== OBSERVABILITY ============================== */

.pipeline {
  display: grid;
  grid-template-columns: 1fr 2.5rem 1.3fr 2.5rem 1fr 2.5rem 1fr 2.5rem 1fr;
  align-items: stretch;
  margin-bottom: 2.5rem;
}
.pipe {
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 1rem;
}
.pipe h3 {
  font-size: 1rem;
  margin-bottom: 0.35rem;
}
.pipe p {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}
.tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--faint);
  border: 1px dashed var(--line-strong);
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  margin-left: 0.35rem;
  vertical-align: 0.15em;
}
.pipe--next {
  background: transparent;
  border-style: dashed;
}
.pipe__link {
  align-self: center;
  height: 2px;
  background: linear-gradient(90deg, var(--line-strong), var(--ok));
  position: relative;
  overflow: hidden;
}
.pipe__link--next {
  background: repeating-linear-gradient(
    90deg,
    var(--line-strong) 0 4px,
    transparent 4px 8px
  );
}
.pipe__link:not(.pipe__link--next)::after {
  content: "";
  position: absolute;
  top: -1px;
  left: -8px;
  width: 8px;
  height: 4px;
  border-radius: 2px;
  background: var(--ok);
  animation: flow 2.8s linear infinite;
  animation-play-state: var(--play, paused);
}
@keyframes flow {
  to {
    transform: translateX(3.5rem);
  }
}
.pipeline.is-visible {
  --play: running;
}

.obs-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: clamp(2rem, 4vw, 3rem);
  align-items: start;
}
.obs-figure {
  margin: 0;
}
.obs-figure img {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
}
.obs-figure figcaption {
  color: var(--faint);
  font-size: var(--fs-xs);
  margin-top: 0.6rem;
}
.mock {
  background: #111820;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: grid;
  gap: 0.75rem;
}
.mock__row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}
.mock__row--charts {
  grid-template-columns: repeat(3, 1fr);
}
.mock__stat,
.mock__chart {
  background: #181f2a;
  border: 1px solid #222c3a;
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.8rem;
}
.mock__stat span,
.mock__chart span {
  display: block;
  color: var(--faint);
  font-size: var(--fs-xs);
}
.mock__stat strong {
  font-family: var(--mono);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--text);
}
.mock__stat strong.ok {
  color: var(--ok);
}
.mock__chart svg {
  display: block;
  width: 100%;
  height: 70px;
  margin-top: 0.4rem;
}
.spark {
  fill: none;
  stroke-width: 1.6;
  vector-effect: non-scaling-stroke;
}
.spark--cyan {
  stroke: var(--public);
}
.spark--violet {
  stroke: var(--private);
}
.spark--green {
  stroke: var(--ok);
}

.obs-metrics h3 {
  font-size: var(--fs-md);
  margin-bottom: 1rem;
}
.obs-metrics > p {
  color: var(--muted);
  margin-top: 1.25rem;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.chips li {
  font-size: var(--fs-sm);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.6rem;
  color: var(--text);
}

/* ============================== STORAGE ============================== */

.storage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.sto-tree {
  display: grid;
  justify-items: center;
}
.sto-node {
  width: 100%;
  max-width: 17rem;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  font-weight: 600;
}
.sto-node small {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: var(--fs-sm);
  margin-top: 0.15rem;
}
.sto-stem {
  width: 2px;
  height: 1.75rem;
  background: var(--line-strong);
}
.sto-branch {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  position: relative;
  padding-top: 1.75rem;
}
.sto-branch::before {
  content: "";
  position: absolute;
  top: 0;
  left: 25%;
  right: 25%;
  height: 1.75rem;
  border: 2px solid var(--line-strong);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}
.sto-branch::after {
  content: "";
  position: absolute;
  top: -1px;
  left: calc(50% - 1px);
  width: 2px;
  height: 2px;
  background: var(--line-strong);
}
.sto-node--avail {
  box-shadow: inset 0 3px 0 var(--public);
}
.sto-node--recover {
  box-shadow: inset 0 3px 0 var(--ok);
}
.sto-node[data-status="target"] {
  border-style: dashed;
  background: transparent;
}
.sto-node[data-status="target"] small::after {
  content: ", target design";
  color: var(--faint);
}
.sto-node[data-status="building"] small::after {
  content: ", in progress";
  color: var(--warn);
}

.failtable-wrap {
  overflow-x: auto;
}
.failtable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}
.failtable caption {
  text-align: left;
  font-weight: 600;
  font-size: var(--fs-md);
  margin-bottom: 1rem;
}
.failtable th,
.failtable td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--line);
}
.failtable thead th {
  color: var(--faint);
  font-weight: 500;
  font-size: var(--fs-sm);
}
.failtable tbody th {
  font-weight: 500;
  color: var(--text);
  padding-left: 0;
}
.failtable td {
  font-family: var(--mono);
  font-size: 0.8rem;
  white-space: nowrap;
}
.failtable td.y {
  color: var(--ok);
}
.failtable td.n {
  color: var(--faint);
}
.failtable td.p {
  color: var(--warn);
}

/* ============================== GPU ============================== */

.gpu__nodes {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(7rem, 0.5fr) minmax(0, 1fr);
  align-items: stretch;
}
.gpu__nodes .glink {
  align-self: center;
}
.gnode {
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  transition:
    border-color 0.4s,
    background 0.4s;
}
.gnode--gpu {
  border-style: dashed;
  background: transparent;
}
.gnode--gpu.is-awake {
  border-style: solid;
  border-color: var(--ok);
  background: var(--panel);
}
.gnode__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1rem;
}
.gnode__head h3 {
  font-size: var(--fs-md);
  font-variation-settings: "wdth" 106;
}
.gnode__role {
  font-size: var(--fs-xs);
  color: var(--muted);
  font-family: var(--mono);
}
.gstatus {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--mono);
  font-size: 0.8rem;
}
.gstatus li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0;
  border-bottom: 1px dashed var(--line);
}
.gstatus span {
  color: var(--faint);
}
.gstatus b {
  font-weight: 500;
  color: var(--text);
  text-align: right;
}
.gstatus b[data-tone="ok"] {
  color: var(--ok);
}
.gstatus b[data-tone="warn"] {
  color: var(--warn);
}
.gstatus b[data-tone="idle"] {
  color: var(--muted);
}
.vram {
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: 0.8rem;
}
.vram__label {
  display: flex;
  justify-content: space-between;
  color: var(--faint);
  margin-bottom: 0.4rem;
}
.vram__label span:last-child {
  color: var(--text);
}
.vram__bar {
  height: 8px;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--line);
  overflow: hidden;
}
.vram__bar i {
  display: block;
  height: 100%;
  width: var(--fill, 0%);
  background: linear-gradient(90deg, var(--private), var(--public));
  transition: width 0.9s var(--ease);
}
.gnode--gpu.is-awake {
  box-shadow: 0 0 0 4px rgba(69, 212, 154, 0.08);
}
.gnode__does {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 1rem;
}

.glink {
  position: relative;
  height: 60px;
}
.glink__svg {
  width: 100%;
  height: 100%;
  display: block;
}
.glink__svg path {
  stroke: var(--private);
  stroke-width: 2;
  stroke-dasharray: 5 5;
  fill: none;
  vector-effect: non-scaling-stroke;
  opacity: 0.6;
}
.glink__label {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  text-align: center;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--private);
}
.glink__packet {
  position: absolute;
  top: 26px;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--private);
  opacity: 0;
}

.gpu__run {
  margin-top: 2rem;
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
}
.gpu__run-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.sim-tag {
  font-size: var(--fs-xs);
  color: var(--faint);
}
.gpu-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.5rem;
  counter-reset: g;
}
.gpu-steps li {
  counter-increment: g;
  font-size: 0.88rem;
  color: var(--faint);
  border-top: 2px solid var(--line-strong);
  padding-top: 0.6rem;
  transition:
    color 0.3s,
    border-color 0.3s;
}
.gpu-steps li::before {
  content: counter(g);
  display: block;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  margin-bottom: 0.2rem;
}
.gpu-steps li.is-done {
  color: var(--muted);
  border-color: var(--ok);
}
.gpu-steps li.is-current {
  color: var(--text);
  border-color: var(--text);
}

.gpu__notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 3rem);
  margin-top: 2.5rem;
}
.gpu__notes h3 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
}
.gpu__notes p {
  color: var(--muted);
  font-size: 0.95rem;
}

/* ============================== STACK ============================== */

.stack {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.stack__group {
  padding: 1.25rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stack__group h3 {
  font-size: var(--fs-sm);
  color: var(--faint);
  font-weight: 500;
  margin-bottom: 0.75rem;
  letter-spacing: 0;
}
.stack__group ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.stack__group li {
  padding: 0.12rem 0;
}

/* ============================== EVOLUTION + CAPABILITY MAP ============================== */

.evo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
}
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--line-strong);
}
.timeline li {
  position: relative;
  padding: 0 0 1.5rem 1.6rem;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0.4em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ok);
}
.timeline li[data-status="building"]::before {
  background: var(--warn);
}
.timeline li[data-status="target"]::before {
  background: var(--bg);
  border: 1.5px dashed var(--faint);
}
.timeline h3 {
  font-size: 1.02rem;
  margin-bottom: 0.3rem;
}
.timeline p {
  color: var(--muted);
  font-size: 0.93rem;
}

.capmap {
  width: 100%;
  height: auto;
  display: block;
}
.cap-edges line {
  stroke: var(--line-strong);
  stroke-width: 1.2;
  transition:
    stroke 0.25s,
    opacity 0.25s;
}
.cap-nodes rect {
  fill: var(--panel);
  stroke: var(--line-strong);
  transition:
    fill 0.25s,
    stroke 0.25s;
}
.cap-nodes .cap-core rect {
  fill: var(--panel-2);
  stroke: var(--faint);
}
.cap-nodes text {
  fill: var(--text);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 500;
  font-variation-settings: "wdth" 92;
  text-anchor: middle;
  pointer-events: none;
}
.cap-nodes a {
  outline: none;
  transition: opacity 0.25s;
}
.capmap.is-focused .cap-edges line {
  opacity: 0.18;
}
.capmap.is-focused .cap-nodes a {
  opacity: 0.35;
}
.capmap.is-focused .cap-nodes a.is-lit {
  opacity: 1;
}
.capmap.is-focused .cap-edges line.is-lit {
  opacity: 1;
  stroke: var(--public);
}
.cap-nodes a.is-origin rect,
.cap-nodes a:focus-visible rect {
  stroke: var(--public);
  fill: var(--panel-2);
}
.cap-list {
  display: none;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.cap-list a {
  display: inline-block;
  color: var(--text);
  text-decoration: none;
  font-size: var(--fs-sm);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
}

/* ============================== RESPONSIVE ============================== */

@media (max-width: 1000px) {
  .hero__grid,
  .iso,
  .storage,
  .obs-grid,
  .evo-grid {
    grid-template-columns: 1fr;
  }
  .layers-wrap {
    grid-template-columns: 1fr;
  }
  .breach {
    position: static;
  }
  .stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .detail__cols {
    grid-template-columns: 1fr;
    gap: 1.1rem;
  }
  .pipeline {
    grid-template-columns: 1fr;
  }
  .pipe__link {
    width: 2px;
    height: 1.5rem;
    justify-self: center;
    background: var(--line-strong);
  }
  .pipe__link::after {
    display: none;
  }
  .capmap-wrap {
    max-width: 34rem;
  }
}

@media (max-width: 860px) {
  /* request journey turns vertical */
  .stages {
    grid-template-columns: 1fr;
    gap: 1.1rem;
    padding-left: 2rem;
  }
  .stages::before {
    top: 7px;
    bottom: 7px;
    left: 7px;
    width: 2px;
    height: auto;
  }
  .stages::after {
    top: 7px;
    left: 7px;
    width: 2px;
    height: calc((100% - 14px) * var(--progress, 0));
    max-height: calc(100% - 14px);
    transition: height 0.55s var(--ease);
  }
  .stage {
    padding-top: 0;
  }
  .stage__node {
    left: -2rem;
    top: 0.15rem;
  }
  .gpu__nodes {
    grid-template-columns: 1fr;
  }
  .glink {
    height: 4.5rem;
  }
  .glink__svg {
    width: 60px;
    margin-inline: auto;
    transform: rotate(90deg);
  }
  .glink__label {
    top: 50%;
    transform: translateY(-50%);
    left: calc(50% + 2.25rem);
    text-align: left;
  }
  .glink__packet {
    display: none;
  }
  .gpu-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 1rem;
  }
  .gpu__notes {
    grid-template-columns: 1fr;
  }
  .decisions {
    grid-template-columns: 1fr;
  }
  .iso__compare {
    grid-template-columns: 1fr;
  }
  .iso__divider {
    width: auto;
    height: 1px;
  }
}

@media (max-width: 640px) {
  .topo {
    min-width: 960px;
  }
  .views {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
  }
  .view-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }
  .swipe-hint {
    display: block;
  }
  .capmap {
    display: none;
  }
  .cap-list {
    display: flex;
  }
  .cmp__row {
    grid-template-columns: 1fr 1fr;
    row-gap: 0.3rem;
  }
  .cmp__row [role="rowheader"] {
    grid-column: 1 / -1;
  }
  .cmp__row--head span:first-child {
    display: none;
  }
  .failtable td {
    white-space: normal;
  }
  .failtable th,
  .failtable td {
    padding-inline: 0.4rem;
  }
  .layer {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }
  .layer-split {
    grid-template-columns: 1fr;
    margin-inline: 0.5rem;
  }
  .layer-split .layer + .layer {
    border-left: 1px solid var(--line-strong);
  }
  .layer--l3 {
    margin-inline: 1rem;
  }
  .layer--l4 {
    margin-inline: 1.5rem;
  }
  .layer-core {
    margin-inline: 2rem;
  }
  .layer-base {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }
  .stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stack__group {
    padding: 1rem;
  }
  .mock__row {
    grid-template-columns: repeat(2, 1fr);
  }
  .mock__row--charts {
    grid-template-columns: 1fr;
  }
  .spec__list div {
    grid-template-columns: 5.5rem 1fr;
  }
}



/* ============================== STEP 6 AUTUMN VISUAL PASS ============================== */

/*
   The original design had several hard-coded navy/cyan values.
   These overrides make diagrams inherit the active appearance palette.
*/

.grid-dot {
  fill: color-mix(in srgb, var(--line-strong) 72%, transparent);
  opacity: 0.65;
}

.zone rect {
  fill: color-mix(in srgb, var(--panel) 58%, transparent);
}

.zone--gpu rect,
.zone--offhost rect {
  fill: color-mix(in srgb, var(--panel) 34%, transparent);
}

.edge--public {
  stroke: color-mix(in srgb, var(--public) 62%, transparent);
}

.edge--private {
  stroke: color-mix(in srgb, var(--private) 62%, transparent);
}

.node[data-status="target"] rect {
  fill: color-mix(in srgb, var(--panel) 72%, transparent);
}

.layer[aria-pressed="true"] {
  background: color-mix(in srgb, var(--bad) 9%, transparent);
  border-color: color-mix(in srgb, var(--bad) 60%, transparent);
}

.layer[aria-pressed="true"] + .layer,
.layer-split + .layer[aria-pressed="true"] {
  border-top-color: color-mix(in srgb, var(--bad) 60%, transparent);
}

.breach__meter i.is-down {
  background: color-mix(in srgb, var(--bad) 52%, transparent);
}

/* Observability mock now follows the active theme instead of navy. */
.pipeline {
  grid-template-columns:
    minmax(0, 1fr)
    2.5rem
    minmax(0, 1.3fr)
    2.5rem
    minmax(0, 1fr)
    2.5rem
    minmax(0, 1fr);
}

.mock {
  background: color-mix(in srgb, var(--bg-raise) 90%, black);
  border-color: var(--line);
}

.mock__stat,
.mock__chart {
  background: color-mix(in srgb, var(--panel) 88%, black);
  border-color: var(--line-strong);
}

/* The names are legacy; their colors now come from the selected palette. */
.spark--cyan {
  stroke: var(--public);
}

.spark--violet {
  stroke: var(--private);
}

.spark--green {
  stroke: var(--ok);
}

/* Self-hosting principles. */
.principles .decision {
  min-height: 100%;
}

.principles .decision h3 {
  color: var(--text);
}

.principles .decision p {
  color: var(--muted);
}

/* Concise container / VM comparison. */
.iso-brief {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.workload-card {
  position: relative;
  overflow: hidden;
  padding: clamp(1.4rem, 3vw, 2rem);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
}

.workload-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--public);
}

.workload-card--vm::before {
  background: var(--private);
}

.workload-card__eyebrow {
  display: block;
  margin-bottom: 0.7rem;
  color: var(--faint);
  font-family: var(--mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.workload-card h3 {
  font-size: var(--fs-lg);
  margin-bottom: 0.75rem;
}

.workload-card > p {
  color: var(--muted);
  max-width: 40rem;
}

.workload-points {
  display: grid;
  gap: 0.5rem;
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
}

.workload-points li {
  position: relative;
  padding-left: 1.1rem;
  color: var(--text);
  font-size: 0.92rem;
}

.workload-points li::before {
  content: "";
  position: absolute;
  top: 0.65em;
  left: 0;
  width: 0.42rem;
  height: 2px;
  background: var(--ok);
}

/* Static AI architecture with subtle motion only. */
.gpu-simple {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    minmax(8rem, 0.48fr)
    minmax(0, 1fr);
  align-items: stretch;
}

.gpu-simple__node {
  padding: clamp(1.4rem, 3vw, 2rem);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
}

.gpu-simple__node--compute {
  border-color: color-mix(in srgb, var(--private) 58%, var(--line));
}

.gpu-simple__state {
  display: block;
  margin-bottom: 0.65rem;
  color: var(--ok);
  font-family: var(--mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.gpu-simple__node--compute .gpu-simple__state {
  color: var(--private);
}

.gpu-simple__node h3 {
  font-size: var(--fs-md);
  margin-bottom: 0.55rem;
}

.gpu-simple__node p {
  color: var(--muted);
}

.gpu-simple__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1.2rem;
}

.gpu-simple__meta span {
  padding: 0.3rem 0.55rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: var(--fs-xs);
}

.gpu-simple__bridge {
  display: grid;
  align-content: center;
  min-width: 0;
}

.gpu-simple__bridge > span {
  display: block;
  margin-bottom: 0.55rem;
  color: var(--faint);
  text-align: center;
  font-family: var(--mono);
  font-size: var(--fs-xs);
}

.gpu-simple__line {
  position: relative;
  height: 2px;
  background:
    linear-gradient(
      90deg,
      var(--line-strong),
      var(--private),
      var(--line-strong)
    );
}

.gpu-simple__line::before,
.gpu-simple__line::after {
  content: "";
  position: absolute;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
}

.gpu-simple__line::before {
  left: -1px;
}

.gpu-simple__line::after {
  right: -1px;
}

.gpu-simple__line i {
  position: absolute;
  top: -4px;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--public);
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--public) 12%, transparent);
  animation: ai-flow 4.4s ease-in-out infinite;
}

@keyframes ai-flow {
  0%,
  10% {
    left: 0;
    opacity: 0;
  }

  18% {
    opacity: 1;
  }

  48% {
    left: calc(100% - 10px);
    opacity: 1;
    background: var(--private);
  }

  58% {
    left: calc(100% - 10px);
    opacity: 0;
  }

  68% {
    left: calc(100% - 10px);
    opacity: 0;
  }

  76% {
    opacity: 1;
  }

  96% {
    left: 0;
    opacity: 1;
    background: var(--public);
  }

  100% {
    left: 0;
    opacity: 0;
  }
}

.gpu-simple__reasons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.3rem;
}

.gpu-simple__reasons > div {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.gpu-simple__reasons h3 {
  margin-bottom: 0.35rem;
  font-size: 1rem;
}

.gpu-simple__reasons p {
  color: var(--muted);
  font-size: 0.93rem;
}

@media (prefers-reduced-motion: reduce) {
  .gpu-simple__line i {
    animation: none;
    left: calc(50% - 5px);
  }
}

@media (max-width: 820px) {
  .iso-brief {
    grid-template-columns: 1fr;
  }

  .gpu-simple {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .gpu-simple__bridge {
    min-height: 6rem;
  }

  .gpu-simple__line {
    width: 2px;
    height: 4.5rem;
    margin: 0 auto;
    background:
      linear-gradient(
        180deg,
        var(--line-strong),
        var(--private),
        var(--line-strong)
      );
  }

  .gpu-simple__line::before,
  .gpu-simple__line::after {
    left: -3px;
  }

  .gpu-simple__line::before {
    top: 0;
  }

  .gpu-simple__line::after {
    top: auto;
    bottom: 0;
    right: auto;
  }

  .gpu-simple__line i {
    display: none;
  }

  .gpu-simple__reasons {
    grid-template-columns: 1fr;
  }
}
