:is(figure#night-c-loop, figure.night-c-loop) {
  --f-ground: #0B1226;
  --f-ink: #FFFFFF;
  --f-dim: #AEB9CC;
  --f-blue: #427BFF;
  --f-line: #27345A;
  container: night-c / inline-size;
  width: 100%;
  min-width: 0;
  margin: 0;
  color: var(--f-ink);
  background: transparent;
}

.on-paper :is(figure#night-c-loop, figure.night-c-loop) {
  --f-ground: #EEF2FA;
  --f-ink: #0B1226;
  --f-dim: #46536C;
  --f-blue: #427BFF;
  --f-line: #C5D0E6;
}

.nc-map {
  --nc-unit: clamp(1px, .078125cqi, 1.25px);
  --nc-surface: calc(168 * var(--nc-unit));
  --nc-public-y: calc(32 * var(--nc-unit));
  --nc-pill-height: calc(52 * var(--nc-unit));
  --nc-bridge-start: calc(var(--nc-public-y) + var(--nc-pill-height) / 2);
  --nc-bridge-end: calc(208 * var(--nc-unit));
  --nc-bridge-label-y: calc(104 * var(--nc-unit));
  --nc-bridge-label-offset: 30px;
  --nc-deposit-x: 16.40625%;
  --nc-receive-x: 83.59375%;
  --nc-lock-x: 33.984375%;
  --nc-lock-y: calc(318 * var(--nc-unit));
  --nc-cover-x: 62.890625%;
  --nc-cover-y: calc(318 * var(--nc-unit));
  --nc-lock-w: clamp(196px, 16.4cqi, 262px);
  --nc-cover-w: clamp(180px, 19cqi, 304px);
  --nc-disc: calc(36 * var(--nc-unit));
  --nc-inset: calc(11px + var(--nc-disc) / 2);
  --nc-noise: url("/assets/art/blue-noise.png");
  --nc-rim: color-mix(in srgb, var(--f-line) 69%, var(--f-dim));
  --nc-track: color-mix(in srgb, var(--f-blue) 48%, var(--f-line));
  --nc-live: color-mix(in srgb, var(--f-blue) 85%, var(--f-ink));
  position: relative;
  isolation: isolate;
  height: calc(440 * var(--nc-unit));
  overflow: clip;
  font: 500 calc(16 * var(--nc-unit))/1.2 var(--font-body, sans-serif);
}

.nc-water {
  position: absolute;
  inset: var(--nc-surface) 0 0;
  mask-image: linear-gradient(#000, transparent 92%);
}

.nc-water::before,
.nc-bridge-bed::before,
.nc-cover::before,
.nc-disc::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--f-blue);
  mask: var(--nc-noise) 0 0 / 128px 128px repeat luminance;
  image-rendering: pixelated;
}

.nc-water::before { opacity: .25; }

.nc-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  clip-path: inset(var(--nc-bridge-end) 0 0);
  pointer-events: none;
}

.nc-wide path {
  d: path("M210 32V208C210 270 324 318 435 318H805C930 318 1070 275 1070 208V32");
}

.nc-tall { display: none; }

.nc-lines path, .nc-crossing path {
  fill: none;
  stroke-width: 1.5px;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.nc-surface {
  position: absolute;
  top: var(--nc-surface);
  width: 100%;
  height: 1.5px;
  background: color-mix(in srgb, var(--f-blue) 52%, var(--f-dim));
  transform: translateY(-50%);
}
.nc-route { stroke: var(--nc-track); }
.nc-lines .nc-current { stroke: var(--nc-live); opacity: 0; }

.nc-network {
  position: absolute;
  left: clamp(14px, 1.9cqi, 24px);
  color: var(--f-dim);
  font-size: calc(15 * var(--nc-unit));
}

.nc-network strong {
  color: var(--f-ink);
  font: 600 calc(17 * var(--nc-unit))/1.2 var(--font-display, sans-serif);
}

.nc-ethereum {
  top: calc(var(--nc-surface) - 16px - .75px);
  transform: translateY(-100%);
}

.nc-midnight { top: calc(var(--nc-surface) + 15px); }

.nc-crossing {
  position: absolute;
  top: var(--nc-bridge-start);
  width: 26.4px;
  height: calc(var(--nc-bridge-end) - var(--nc-bridge-start));
  transform: translateX(-50%);
  pointer-events: none;
}

.nc-crossing-in { left: var(--nc-deposit-x); }
.nc-crossing-out { left: var(--nc-receive-x); }

.nc-bridge-bed {
  position: absolute;
  inset: 0 2.2px;
  background: color-mix(in srgb, var(--f-ground) 90%, var(--f-blue));
}

.nc-bridge-bed::before { opacity: .42; }

.nc-crossing svg {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
}

.nc-rails { stroke: color-mix(in srgb, var(--nc-track), var(--f-dim) 30%); }

.nc-crossing .nc-flow {
  stroke: var(--nc-live);
  stroke-width: 3.5px;
  stroke-dasharray: 0 14px;
  stroke-dashoffset: -7px;
}

.nc-crossing::before,
.nc-crossing::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 30px;
  height: 6px;
  transform: translateX(-50%);
  border: 1px solid color-mix(in srgb, var(--nc-track), var(--f-dim) 40%);
  border-radius: 999px;
  background: var(--f-ground);
}

.nc-crossing::before { top: 0; }
.nc-crossing::after { bottom: 0; }

.nc-bridge {
  position: absolute;
  top: var(--nc-bridge-label-y);
  display: grid;
  gap: 3px;
  font-size: clamp(13px, calc(10px + .235vw), 16px);
  color: var(--f-dim);
}

.nc-bridge::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -8px;
  border-radius: 12px;
  background: var(--f-ground);
}

.nc-bridge strong {
  color: var(--f-ink);
  font-size: clamp(15px, calc(12px + .3125vw), 20px);
  font-weight: 500;
}

.nc-bridge-in { left: calc(var(--nc-deposit-x) + var(--nc-bridge-label-offset)); }

.nc-bridge-out {
  right: calc(100% - var(--nc-receive-x) + var(--nc-bridge-label-offset));
  text-align: right;
}

.nc-pill,
.nc-lock,
.nc-cover {
  position: absolute;
  border: 1px solid var(--nc-rim);
  background-color: var(--f-ground);
}

.nc-pill {
  top: var(--nc-public-y);
  height: var(--nc-pill-height);
  display: flex;
  align-items: center;
  gap: 10px;
  padding-inline: 10px 17px;
  border-radius: 999px;
  white-space: nowrap;
  transform: translateY(-50%);
}

.nc-deposit { left: calc(var(--nc-deposit-x) - var(--nc-inset)); }
.nc-receive {
  right: calc(100% - var(--nc-receive-x) - var(--nc-inset));
  padding-inline: 17px 10px;
}

.nc-token,
.nc-seat {
  display: block;
  width: var(--nc-disc);
  height: var(--nc-disc);
  flex: none;
}

.nc-seat {
  position: relative;
  border-radius: 50%;
  outline: 1px solid var(--f-line);
  outline-offset: -1px;
}

.nc-disc {
  position: relative;
  border: 1px solid color-mix(in srgb, var(--f-blue) 71%, var(--f-dim));
  border-radius: 50%;
  background-color: color-mix(in srgb, var(--f-ground) 75%, var(--f-blue));
}

.nc-disc::before { opacity: .85; }

.nc-lock {
  left: var(--nc-lock-x);
  top: calc(var(--nc-lock-y) - var(--nc-disc) / 2 - 11px);
  transform: translateX(-50%);
  width: var(--nc-lock-w);
  border-radius: 12px;
  display: grid;
  justify-items: center;
  padding: 10px 0 12px;
  gap: 10px;
}

.nc-lock-label {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.nc-padlock {
  position: relative;
  width: 11px;
  height: 8px;
  margin-top: 4px;
  border: 1px solid currentColor;
  border-radius: 2px;
  color: var(--f-dim);
}

.nc-padlock::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 1px;
  width: 7px;
  height: 6px;
  border: 1px solid currentColor;
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
}

[data-nc-locked] .nc-lock { border-color: var(--f-blue); }

.nc-cover {
  z-index: 3;
  left: var(--nc-cover-x);
  top: var(--nc-cover-y);
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: var(--nc-cover-w);
  height: calc(106 * var(--nc-unit));
  border-radius: 999px;
  overflow: clip;
}

.nc-cover::before {
  opacity: .63;
  mask-position: var(--nc-drift, 0 0);
}

.nc-cover > span {
  position: relative;
  padding: 8px 15px;
  border: 1px solid var(--nc-rim);
  border-radius: 999px;
  background: var(--f-ground);
}

.nc-mover {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  opacity: 0;
  pointer-events: none;
}

.nc-mover > * { position: absolute; inset: 0; }
.nc-mover .nc-logo { clip-path: inset(0 0 calc(100% - var(--nc-clear)) 0); }
.nc-mover .nc-disc { clip-path: inset(var(--nc-clear) 0 0 0); }
.nc-mover.nc-outbound .nc-disc::before { mask-position: 28px 34px; }

[data-nc-live] .nc-seat > * { visibility: hidden; }
.nc-mover { visibility: hidden; }
[data-nc-live] .nc-mover { visibility: visible; }

@container night-c (width < 1040px) {
  .nc-map { --nc-bridge-label-y: 66px; }
  .nc-network { left: calc(var(--nc-deposit-x) + var(--nc-bridge-label-offset)); }
}

@container night-c (width < 700px) {
  .nc-map {
    --nc-surface: 182px;
    --nc-public-y: 34px;
    --nc-pill-height: 44px;
    --nc-bridge-end: 218px;
    --nc-bridge-label-y: 76px;
    --nc-deposit-x: 7.714285714%;
    --nc-receive-x: 92.285714286%;
    --nc-lock-x: 32%;
    --nc-lock-y: 306px;
    --nc-cover-x: 66.571428571%;
    --nc-cover-y: 430px;
    --nc-lock-w: clamp(160px, 47cqi, 182px);
    --nc-cover-w: clamp(144px, 47cqi, 226px);
    --nc-disc: 28px;
    --nc-inset: 24px;
    height: 540px;
    font-size: 13px;
  }

  .nc-wide { display: none; }
  .nc-tall { display: inline; }
  .nc-pill { padding-inline: 9px 13px; gap: 7px; }
  .nc-receive { padding-inline: 13px 9px; }
  .nc-network { font-size: 13px; }
  .nc-network strong { font-size: 15px; }
  .nc-bridge {
    max-width: min(120px, calc(50% - var(--nc-deposit-x) - var(--nc-bridge-label-offset) - 8px));
    font-size: 13px;
  }

  .nc-bridge strong { font-size: 15px; }
  .nc-bridge span { text-wrap: balance; }
  .nc-lock { row-gap: 12px; }
  .nc-cover { height: 94px; }
}

@container night-c (width < 315px) {
  .nc-map { --nc-bridge-label-y: 66px; }
}

@media (min-width: 961px) and (max-width: 1600px) {
  .section:has(> .wrap > #night-c-loop) {
    --section-gap: clamp(88px, 10vw, 120px);
  }
}

/* Round 9: deposit and receive are nodes centred on their bridge, with the caption above.
   The seat keeps a faint token when the live one is away, so it never reads as empty. */
.nc-map { --nc-pill-height: calc(var(--nc-disc) + 16px); }
.nc-pill, .nc-receive {
  left: var(--nc-deposit-x); right: auto; width: var(--nc-pill-height); height: var(--nc-pill-height);
  display: grid; place-items: center; gap: 0; padding: 0; border-radius: 50%;
  transform: translate(-50%, -50%);
}
.nc-receive { left: var(--nc-receive-x); }
.nc-pill .nc-seat { outline: 0; }
[data-nc-live] .nc-pill .nc-seat > * { visibility: visible; opacity: .3; }
.nc-cap {
  position: absolute; left: 50%; bottom: calc(100% + 12px); transform: translateX(-50%);
  display: grid; gap: 2px; justify-items: center; text-align: center; white-space: nowrap;
}
.nc-cap strong { font-weight: 500; font-size: calc(17 * var(--nc-unit)); line-height: 1.25; color: var(--f-ink); }
.nc-cap span { font-size: calc(14 * var(--nc-unit)); line-height: 1.3; color: var(--f-dim); }
#night-c-loop { margin-top: 56px; }
@container night-c (width < 700px) {
  .nc-map { --nc-pill-height: 42px; }
  .nc-cap { bottom: calc(100% + 8px); }
  .nc-cap strong { font-size: 15px; } .nc-cap span { font-size: 13px; }
  .nc-deposit .nc-cap { left: -6px; transform: none; justify-items: start; text-align: left; }
  .nc-receive .nc-cap { left: auto; right: -6px; transform: none; justify-items: end; text-align: right; }
  #night-c-loop { margin-top: 76px; }
}
.nc-map { overflow: visible; }
.explain--stack #night-c-loop { margin-top: 56px; }
@media (max-width: 760px) { .explain--stack #night-c-loop { margin-top: 76px; } }
.nc-cap, .nc-network { text-shadow: 0 0 10px var(--f-ground), 0 0 18px var(--f-ground); }
