/* =====================================================================
   Paper and Ink · essays/when-everything-has-to-change-at-once.css
   "When Everything Has to Change at Once": the figures only this essay uses.
   Loaded after the shared stylesheets; everything shared lives in css/.
   ===================================================================== */

/* Layout: one 64ch reading column on grained paper; two figures break out to 860px:
   a service report beside a compatibility worksheet (Figure 1), and a four-state
   migration route on graph paper with a support toggle (Figure 2).
   Gold = continuity of service; blue = freedom to change; graphite = not acceptable now. */

/* ---- footnote markers -------------------------------------------------- */
sup.ref { font-family: var(--sans); font-size: .62em; line-height: 0; margin-left: 1px; }
sup.ref a { text-decoration: none; color: var(--life); padding: 0 1px; }
sup.ref a:hover { text-decoration: underline; }
.sources li:target { color: var(--ink); background: var(--life-soft); }

/* ---- the route review in the running text ------------------------------ */
.prose ol.review { padding-left: 1.4em; }
.prose ol.review li { margin: 0 0 .55em; }

/* ---- Figure 1: two sheets on one desk ---------------------------------- */
.cwfig { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 44px; align-items: start; padding: 10px 4px 6px; }
.cw-col { display: grid; gap: 18px; justify-items: start; }
/* each wrap carries the tilt, so a sheet and its stamp turn together; nothing here clips */
.cw-wrap { position: relative; width: 100%; padding-bottom: 10px; }
.sr-wrap { transform: rotate(-1.3deg); }
.ws-wrap { transform: rotate(.7deg); margin-top: 18px; }
.sr, .ws {
  box-sizing: border-box; background: var(--noise), var(--slip);
  font-family: var(--mono); font-size: .78rem; line-height: 1.75;
}
.sr { padding: 22px 22px 74px; }
.ws { padding: 22px 20px 74px; background: var(--noise), linear-gradient(var(--grid-minor) 1px, transparent 1px) 0 6px / 100% 1.75em, var(--sheet); }
.cwfig .sh { margin: 0; text-align: center; letter-spacing: .18em; text-transform: uppercase; font-weight: 500; }
.cwfig .ss { margin: 0 0 8px; text-align: center; font-size: .7rem; letter-spacing: .04em; }
.sr .rule { border-top: 1px dashed currentColor; opacity: .45; margin: 8px 0; }
.sr .ln { display: flex; gap: 6px; margin: 0; }
.sr .ln span { flex: none; }
.sr .ln span:first-child { flex: 0 1 auto; min-width: 0; }
.sr .ln i { flex: 1; min-width: 10px; border-bottom: 1px dotted currentColor; opacity: .4; transform: translateY(-.45em); }
.sr .ln-once { color: var(--slip-once); font-weight: 500; }
.cwfig .foot { margin: 8px 0 0; font-family: var(--serif); font-style: italic; font-size: .95rem; line-height: 1.35; color: var(--slip-ink); }

.wst { width: 100%; border-collapse: collapse; margin: 6px 0 0; font-size: .72rem; line-height: 1.45; }
.wst .vh-cap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wst th, .wst td { text-align: left; vertical-align: top; padding: 6px 6px 6px 0; border-bottom: 1px dashed var(--grid-major); }
.wst thead th { font-family: var(--sans); font-weight: 600; font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; color: var(--slip-ink); }
.wst tbody th { font-weight: 500; color: var(--slip-ink); }
.wst td { color: var(--slip-ink); }
.wst .ok { color: var(--slip-life); font-weight: 500; }
.wst .no { color: var(--graphite); font-style: italic; font-family: var(--serif); font-size: .82rem; }
.wst .no s { font-style: normal; font-family: var(--mono); font-size: .72rem; color: var(--slip-life); text-decoration-color: var(--graphite); text-decoration-thickness: 1.5px; margin-right: .3em; }

.cwfig .stamp { position: absolute; }
.cwfig .st1 { color: var(--slip-once); left: 22px; bottom: 30px; transform: rotate(-6deg); animation-delay: .7s; }
.cwfig .st2 { color: var(--graphite); right: 18px; bottom: 28px; transform: rotate(4deg); animation-delay: 2s; }
.cw-note { margin: 0; max-width: 30ch; color: var(--ink); animation: fade .7s ease both; }
.cw-note.n1 { animation-delay: 1.1s; }
.cw-note.n2 { animation-delay: 2.4s; }

/* ---- Figure 2: the route that needs a bridge ---------------------------- */
.ctl { border: 0; margin: 0 0 1.2rem; padding: 0; display: grid; gap: .5rem; max-width: 680px; font-family: var(--sans); font-size: .86rem; color: var(--ink); }
.ctl legend { padding: 0; margin-bottom: .35rem; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.ctl .opts { display: flex; flex-wrap: wrap; gap: .4rem 1.3rem; }
.ctl label { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; }
.ctl label.off { color: var(--muted); cursor: default; }
.ctl input { accent-color: var(--life); margin: 0; }
.ctl input:focus-visible { outline: 2px solid var(--life); outline-offset: 3px; }
.ctl .fixed { margin: 0; font-size: .8rem; color: var(--muted); }

.sheet.route2 { cursor: default; }
.sheet.route2:not(.on) { display: none; }
.route2 .pen-g { fill: var(--slip-ink); }
.route2 .lab-life { fill: var(--slip-life); }
.route2 .lab-once { fill: var(--slip-once); }
.route2 .cfg { fill: var(--slip-ink); font-size: 14px; font-weight: 500; }
.route2 .tag-life { fill: var(--slip-life); font-weight: 500; }
.route2 .tag-ink { fill: var(--slip-ink); }
.route2 .ink .main { stroke-width: 2.6; }
.route2 .ink .edge { stroke-width: .9; opacity: .45; }
.route2 .st-end path { stroke: var(--slip-once); }
.route2 .st-ok path, .route2 .mv-ok path { stroke: var(--slip-life); }
.route2 .st-no path, .route2 .mv-no path, .route2 .mv-alt path { stroke: var(--graphite); stroke-dasharray: 3 6; animation: none; }
.route2 .st-no .main, .route2 .mv-no .main, .route2 .mv-alt .main { stroke-width: 1.8; }
.route2 .st-no .edge, .route2 .mv-no .edge, .route2 .mv-alt .edge { display: none; }
.route2 .xmark { fill: none; stroke: var(--graphite); stroke-width: 2; stroke-linecap: round; }
.route2 .still .ink path, .route2 .still .fade, .route2 svg.still .fade { animation: none; }

.route-tab { width: 100%; border-collapse: collapse; margin: 1rem 0 0; font-family: var(--sans); font-size: .8rem; color: var(--ink); }
.route-tab caption { text-align: left; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding-bottom: .4rem; }
.route-tab th, .route-tab td { text-align: left; vertical-align: top; padding: .35rem .6rem .35rem 0; border-bottom: 1px solid var(--rule); }
.route-tab thead th { font-weight: 600; color: var(--muted); }
.route-tab tbody th { font-weight: 500; }
.route-tab td:nth-child(2), .route-tab td:nth-child(3) { font-family: var(--mono); }

@media (max-width: 640px) {
  .cwfig { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .cw-col { justify-items: stretch; }
  .cw-wrap { width: min(100%, 420px); margin-inline: auto; }
  .ws-wrap { margin-top: 0; }
  .cw-note { max-width: none; width: min(100%, 420px); margin-inline: auto; }
}

/* Phone mode: the two sheets stack; the route is redrawn by the page script as a column of
   states with the coordinated move down the right side; figure text grows; the table stacks. */
@media (max-width: 560px) {
  .sr { padding: 18px 16px 70px; font-size: .74rem; }
  .ws { padding: 18px 12px 70px; }
  .wst { font-size: .7rem; }
  .wst th, .wst td { padding-right: 4px; }
  .sheet.route2 { min-width: 0; user-select: none; }
  .sheet-scroll:has(.route2) { overflow-x: clip; }
  .route2 .svgnote { font-size: 16px; }
  .route2 .svglab { font-size: 19px; }
  .route2 .tagtext { font-size: 15.5px; }
  .route2 .cfg { font-size: 16px; }
  .route-tab thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .route-tab tr { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .8rem; padding: .5rem 0; border-bottom: 1px solid var(--rule); }
  .route-tab th, .route-tab td { border: 0; padding: .1rem 0; }
  .route-tab tbody th { grid-column: 1 / -1; }
  .route-tab td:nth-child(2)::before { content: "App "; font-family: var(--sans); color: var(--muted); }
  .route-tab td:nth-child(3)::before { content: "Database "; font-family: var(--sans); color: var(--muted); }
  .route-tab td:nth-child(4)::before { content: "Earlier: "; color: var(--muted); }
  .route-tab td:nth-child(5)::before { content: "Later: "; color: var(--muted); }
}
