/* Continuity illustration, redrawn plainly on 2026-11-17 (the earlier card with icon circles,
   status dots, a pill switch and a clock timeline is in archive/home-2026-11-17-before-polish/).
   It now reads like a figure in a manual: the platform as a labelled box, the base station as its
   own picture, the three local actions as labels at the ends of thin wires (drawn by
   continuity.js between the real positions), and plain text for every state. A signal is a short
   dash running along its wire. Under the figure: two plain buttons for the internet, one button
   that records a confirmation, and the list of records. The only colour is the muted red of the
   break mark. */
.continuity-chapter {
  --c-error: color-mix(in srgb, var(--n8) 70%, #b5544a);
  /* Opaque, so wires that meet do not add up to a darker spot. */
  --line: color-mix(in srgb, var(--n8) 45%, var(--n0));
  --cycle: 3.2s;
}
.continuity-interaction { margin-top: 36px; border-block: 1px solid var(--n4); }

/* The line above the figure: with the simulation running, only the current step is shown. */
.has-simulation .continuity-timeline { display: block; margin-top: 40px; min-height: 5.2em; }
.has-simulation .continuity-timeline li { display: none; padding: 0; border: 0; }
.has-simulation .continuity-timeline li::before { content: none; }
.has-simulation .continuity-timeline li.is-current { display: block; }
.has-simulation .continuity-timeline h3 { margin-top: 0; }
.has-simulation .continuity-timeline p { max-width: none; margin-top: 6px; }

/* Figure */
.continuity-stage { --flow: row; position: relative; display: grid; grid-template-columns: auto minmax(40px, 1fr) minmax(200px, 300px) minmax(64px, 1fr) auto; grid-template-areas: "cloud . hub . local"; align-items: center; padding: clamp(40px, 5vw, 64px) 0 clamp(64px, 7vw, 84px); }
.continuity-wires { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.continuity-node, .continuity-hub, .continuity-local { position: relative; z-index: 1; }
.continuity-node-name { display: block; color: var(--n10); font-size: 17px; font-weight: 500; }
.continuity-status { display: block; margin-top: 2px; color: var(--n8); font-size: 15px; white-space: nowrap; }
/* Every part of a state change happens at the same moment: no fades, so the figure never shows
   half of one state and half of the other (a cross on a whole wire, a greyed box that says
   "synchronising"). */
.continuity-cloud { grid-area: cloud; justify-self: start; min-width: 13.5em; padding: 14px 18px; border: 1px solid var(--line); border-radius: 4px; background: var(--n1); }
:lang(en) .continuity-cloud { min-width: 11.5em; }
[data-online='false'] .continuity-cloud { opacity: .55; }
.continuity-hub { grid-area: hub; }
.continuity-hub img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; filter: var(--hub-filter, none) drop-shadow(0 14px 14px color-mix(in srgb, var(--c-shadow) 40%, transparent)); }
/* The caption hangs below the picture, so the picture's centre lines up with the other nodes. */
.continuity-caption { position: absolute; top: calc(100% - 8px); left: 50%; text-align: center; white-space: nowrap; transform: translateX(-50%); }
.continuity-local { grid-area: local; justify-self: end; display: grid; gap: 26px; }
.continuity-device { display: flex; align-items: center; gap: 12px; color: var(--n10); }
.continuity-device strong { min-width: 6.5em; font-size: 16px; font-weight: 400; }
.continuity-end { flex: none; display: block; width: 9px; height: 9px; background: var(--n9); }
[data-record='0'] .continuity-device:nth-child(2) .continuity-end { animation: continuity-mark-a .7s ease-out; }
[data-record='1'] .continuity-device:nth-child(2) .continuity-end { animation: continuity-mark-b .7s ease-out; }
@keyframes continuity-mark-a { from { transform: scale(2); } to { transform: none; } }
@keyframes continuity-mark-b { from { transform: scale(2); } to { transform: none; } }

/* Wires and signals (SVG). Signal paths are 100 units long (pathLength), so one dash pattern
   (a 5-unit dash, then a gap longer than any wire) gives exactly one dash per wire. */
.continuity-wire { fill: none; stroke: var(--line); stroke-width: 1.2; }
[data-online='false'] .continuity-wire-up { stroke-dasharray: 4 5; }
.continuity-signal { fill: none; stroke: var(--n10); stroke-width: 2.4; stroke-dasharray: 5 300; stroke-dashoffset: 8; animation: var(--cycle) linear infinite paused; }
.is-visible .continuity-signal { animation-play-state: running; }
.continuity-signal-local { animation-name: continuity-local; }
.continuity-signal-up { animation-name: continuity-up; }
[data-online='false'] .continuity-signal-up { opacity: 0; }
/* While records are being sent, the uplink carries them one after another. */
[data-syncing='true'] .continuity-signal-up { animation: continuity-burst .55s linear infinite; }
@keyframes continuity-local { 0% { stroke-dashoffset: 8; } 55%, 100% { stroke-dashoffset: -104; } }
@keyframes continuity-up { 0%, 55% { stroke-dashoffset: 8; } 85%, 100% { stroke-dashoffset: -104; } }
@keyframes continuity-burst { from { stroke-dashoffset: 8; } to { stroke-dashoffset: -104; } }
.continuity-break { position: absolute; z-index: 2; padding: 0 6px; background: var(--n0); color: var(--c-error); font-size: 22px; line-height: 1; transform: translate(-50%, -50%); opacity: 0; }
[data-online='false'] .continuity-break { opacity: 1; }

/* Controls: plain buttons. The chosen internet state is the filled one. */
.continuity-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 16px 0; border-top: 1px solid var(--n4); }
.continuity-choice { display: flex; }
.continuity-choice button, :root [data-record-pick] { min-height: 44px; padding: 10px 18px; border: 1px solid var(--n9); border-radius: 6px; background: transparent; color: var(--n10); -webkit-text-fill-color: var(--n10); font: inherit; font-size: 16px; cursor: pointer; }
.continuity-choice button:first-child { border-radius: 6px 0 0 6px; }
.continuity-choice button:last-child { margin-left: -1px; border-radius: 0 6px 6px 0; }
.continuity-choice button[aria-pressed='true'] { background: var(--n10); color: var(--n0); -webkit-text-fill-color: var(--n0); }
/* Hover only where there is a pointer: on a touch screen the last tapped button would stay grey. */
:root [data-record-pick]:hover { background: transparent; color: var(--n10); -webkit-text-fill-color: var(--n10); }
@media (hover: hover) {
  .continuity-choice button:not([aria-pressed='true']):hover, :root [data-record-pick]:hover { background: var(--n3); }
}
:root [data-record-pick]:active { background: var(--n4); }
.continuity-controls button:focus-visible { outline: 2px solid var(--n10); outline-offset: 2px; }

/* Sync state and the latest records, side by side. */
.continuity-records { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 12px 40px; padding: 18px 0 22px; border-top: 1px solid var(--n4); }
.continuity-sync { margin: 0; color: var(--n10); font-size: 16px; }
.continuity-record-count { display: block; margin-top: 4px; color: var(--n8); font-size: 15px; }
.continuity-events { min-height: 84px; margin: 0; padding: 0; list-style: none; }
.continuity-events li { display: flex; align-items: baseline; gap: 14px; padding: 3px 0; font-size: 15px; }
.continuity-events li > span { color: var(--n7); font-variant-numeric: tabular-nums; }
.continuity-events strong { color: var(--n10); font-weight: 400; }
.continuity-events small { margin-left: auto; color: var(--n8); font-size: 15px; }
.continuity-events [data-pending='true'] small { color: var(--n10); font-weight: 500; }

@media (max-width: 1000px) {
  .continuity-stage { grid-template-columns: auto minmax(28px, 1fr) minmax(170px, 230px) minmax(44px, 1fr) auto; }
  /* The platform box keeps its width here too, so nothing moves when its status text changes. */
}
/* Phones: the platform on top, the base station in the middle, the actions in a row below. */
@media (max-width: 760px) {
  .continuity-interaction { margin-top: 28px; }
  .has-simulation .continuity-timeline { margin-top: 28px; min-height: 6.6em; }
  .continuity-stage { --flow: column; grid-template-columns: minmax(0, 1fr); grid-template-areas: "cloud" "." "hub" "." "local"; grid-template-rows: auto 44px auto 96px auto; justify-items: center; padding: 26px 0 24px; }
  .continuity-cloud, :lang(en) .continuity-cloud { justify-self: center; min-width: 13.5em; max-width: none; text-align: center; }
  .continuity-hub { width: min(240px, 72%); }
  .continuity-local { justify-self: stretch; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .continuity-device { flex-direction: column; gap: 8px; }
  .continuity-device strong { min-width: 0; font-size: 15px; text-align: center; }
  .continuity-controls { gap: 10px; }
  .continuity-choice { width: 100%; }
  .continuity-choice button { flex: 1; padding-inline: 8px; }
  :root [data-record-pick] { width: 100%; }
  .continuity-records { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .continuity-interaction *, .continuity-interaction *::before, .continuity-interaction *::after { animation: none !important; transition: none !important; }
  .continuity-signal { display: none; }
}
@media print { .continuity-interaction { display: none; } }
