/* Impossible machinery: etched brass, translucent pipes, patient little lights. */
#view-field { position: relative; isolation: isolate; }
.machine-network { position: absolute; inset: 0 0 auto; z-index: -1; pointer-events: none; overflow: hidden; }
.machine-network > svg { display: block; width: 100%; height: 100%; overflow: hidden; }
.machine-network .mw-network-tube .mw-pipe-shadow { stroke-width: 11; }
.machine-network .mw-network-tube .mw-pipe-glass { stroke-width: 8; }
.machine-network .mw-network-tube .mw-pipe-water { stroke-width: 5; }
.machine-network .mw-network-tube .mw-pipe-glint { transform: translate(-1px, -1px); opacity: .65; }
.machine-network .mw-network-tube .mw-stream { stroke-width: 2; opacity: .55; }
.machine-network .mw-small-tube .mw-pipe-shadow { stroke-width: 7; }
.machine-network .mw-small-tube .mw-pipe-glass { stroke-width: 5; }
.machine-network .mw-small-tube .mw-pipe-water { stroke-width: 3; }
/* One shared circuit. Its lanes reserve space for carriers and their labels. */
html #field[data-circuit] {
  position: relative; display: block; width: min(1020px, calc(100% - 24px));
  min-height: 0; margin: 36px auto 38px; padding: 0; isolation: isolate;
  --cargo: 88px; --carrier-width: 136px;
}
.mw-circuit-board { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; overflow: hidden; }
#field[data-circuit] .orb {
  position: absolute; inset: auto; width: var(--carrier-width); padding: 0; margin: 0; z-index: 2;
  transform: none !important; will-change: auto; touch-action: pan-y;
}
#field[data-circuit] .orb .sphere { width: var(--cargo); height: var(--cargo); touch-action: pan-y; flex: none; }
#field[data-circuit] .orb .sphere::after, #field[data-circuit] .orb::before, #field[data-circuit] .orb::after,
#field[data-circuit] .orb .halo, #field[data-circuit] .orb .pills { display: none; }
#field[data-circuit] .orb .timer {
  width: 100%; max-width: none; margin: 8px 0 0; padding: 5px 4px 2px; min-height: 25px;
  font-size: .74rem; line-height: 1.4; white-space: normal; overflow-wrap: anywhere;
  background: #15231b; color: var(--ink); border-radius: 8px 8px 0 0; text-shadow: none;
}
#field[data-circuit] .orb .caption {
  width: 100%; margin: 0; padding: 2px 4px 6px; font-size: .7rem; line-height: 1.35;
  white-space: normal; overflow-wrap: anywhere; background: #15231b; border-radius: 0 0 8px 8px;
}
#field[data-circuit] .orb.ready .timer { color: var(--accent-2); }
#field[data-circuit] .orb:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 5px; border-radius: 12px; }
.mw-circuit-board .mw-pipe-shadow { stroke-width: 15; }
.mw-circuit-board .mw-pipe-glass { stroke-width: 10; }
.mw-circuit-board .mw-pipe-water { stroke-width: 6; }
.mw-circuit-board .mw-stream { stroke-width: 2; opacity: .65; }
.mw-circuit-board [data-route="1"] .mw-pipe-glass { stroke: #bbaa787d; }
.mw-circuit-board [data-route="1"] .mw-pipe-water { stroke: #4d4730; }
.mw-circuit-board [data-route="1"] .mw-stream { stroke: #e8ce98; }
.mw-circuit-board [data-route="2"] .mw-pipe-glass { stroke: #87afb580; }
.mw-circuit-board [data-route="2"] .mw-pipe-water { stroke: #2d4449; }
.mw-circuit-board [data-route="2"] .mw-stream { stroke: #c1e0e8; }
.mw-shaft { stroke: #877d58; stroke-width: 2; stroke-dasharray: 3 7; opacity: .5; }
.mw-loading-rig { position: absolute; z-index: 4; overflow: visible; pointer-events: none; }
#field .orb[data-loading] .tp-jar { animation: none; }
#field .orb[data-loading] .sphere { transform-origin: 50% 75%; }
.mw-orbit-ring { stroke: url(#mw-brass); stroke-width: 2; }
#collectionHead { position: relative; }
.mw-circuit-board.is-resting *, .machine-network.is-resting *, html:has(dialog[open]) .machine-network *,
html:has(dialog[open]) .mw-circuit-board * { animation-play-state: paused !important; }
html.calm .machine-network *, html.calm .mw-circuit-board * { animation: none !important; transition: none !important; }
html.calm #field[data-circuit] .orb { transition: none !important; }
.home-hero { max-width: 1180px; grid-template-columns: 1fr 1.2fr; gap: 30px; margin-top: 12px; }
.home-workshop { min-width: 0; text-align: center; }
.machine-scene {
  position: relative; width: 100%; max-width: 540px; aspect-ratio: 520 / 590; margin: 0 auto;
  isolation: isolate; border-radius: 48% 48% 12px 12px;
  background: radial-gradient(ellipse at 50% 38%, #7c9e7120, transparent 68%);
}
.machine-drawing, .machine-thoughts { position: absolute; inset: 0; pointer-events: none; }
.machine-drawing svg { display: block; width: 100%; height: 100%; overflow: visible; }
.machine-scene .home-bottle { position: absolute; left: 31%; top: -1%; width: 38%; margin: 0; padding: 0; z-index: 2; border-radius: 45%; }
.machine-scene .home-room { height: auto; aspect-ratio: 1; border-radius: 45%; overflow: visible; background: none; }
.machine-scene .home-art { width: 100%; height: 100%; margin: 0; filter: drop-shadow(0 6px 18px #dfcb7130); }
.machine-scene .home-bottle:hover .home-art { filter: drop-shadow(0 6px 20px #dfcb7148); }
.home-workshop .home-bottle-status { margin-top: -8px; }
.home-workshop .home-bottle-hint { color: var(--accent-2); }
.machine-caption { color: var(--ink-3); font-size: .75rem; line-height: 1.6; margin: 14px auto 0; max-width: 34em; }
.machine-name {
  position: absolute; bottom: 3.8%; left: 0; width: 100%; font: italic 400 clamp(14px, 1.6vw, 18px)/1.2 var(--serif);
  color: #b6ac8b; letter-spacing: .08em; pointer-events: none;
}
.mw-frame { stroke: #857856; stroke-width: 3; opacity: .45; }
.mw-hairline { stroke: #d7c79c; stroke-width: 1; opacity: .6; }
.mw-brace { stroke: #777758; stroke-width: 5; }
.mw-shadow { fill: #000; opacity: .2; }
.mw-brass, .mw-rod { stroke: url(#mw-brass); stroke-width: 3; stroke-linecap: round; }
.mw-plinth { fill: #3c4333; stroke: url(#mw-brass); stroke-width: 1.8; stroke-linejoin: round; }
.mw-step { fill: #52604a66; stroke: #c7c59b; stroke-width: 1; }
.mw-stairs { opacity: .45; }
.mw-return { stroke: #748468; stroke-width: 2; }
.mw-gear { fill: #29392d; stroke: url(#mw-brass); stroke-width: 1.6; stroke-linejoin: round; }
.mw-rim { fill: none; stroke: #c2a773; stroke-width: 1.2; opacity: .7; }
.mw-spoke { stroke: url(#mw-brass); stroke-width: 3.5; stroke-linecap: round; }
.mw-hub { fill: #697051; stroke: #d6bd86; stroke-width: 1; }
.mw-rivet { fill: #e2cca0; }
.mw-belt { stroke: #29392d; stroke-width: 4; }
.mw-belt-stitch { stroke: #b8a878; stroke-width: 1.2; stroke-dasharray: 2 5; animation: mw-belt 38s linear infinite; }
.mw-weight { fill: #4b5038; stroke: url(#mw-brass); stroke-width: 2; }
.mw-union { fill: url(#mw-brass); stroke: #eee0b1; stroke-width: .6; }
.mw-pipe-shadow { stroke: #13221b; stroke-width: 17; stroke-linejoin: round; stroke-linecap: round; }
.mw-pipe-glass { stroke: #8bab9580; stroke-width: 12; stroke-linejoin: round; stroke-linecap: round; }
.mw-pipe-water { stroke: #294b3d; stroke-width: 8; stroke-linejoin: round; stroke-linecap: round; }
.mw-pipe-glint { stroke: #cbe5bd70; stroke-width: 1; stroke-linecap: round; transform: translate(-2px, -1px); }
.mw-stream {
  stroke: #e8ebbc; stroke-width: 2.8; stroke-linecap: round; stroke-dasharray: 1 179; opacity: .8;
  animation: mw-flow var(--flow, 36s) linear var(--delay, 0s) infinite;
}
.mw-funnel { fill: #83b89a33; stroke: #b7c8a1; stroke-width: 1.4; }
.mw-gauge-face { fill: #1e2a22; stroke: #918663; }
.mw-needle { stroke: #e1b57b; stroke-width: 1.5; transform-origin: 0 0; animation: mw-needle 23s ease-in-out infinite alternate; }
.mw-reservoir { fill: url(#mw-glass); stroke: #a7c7ac; stroke-width: 1.3; }
.mw-liquid { fill: #a2c99426; stroke: #b6d3a060; stroke-width: 1; }
.mw-coil { stroke: #a4c6b099; stroke-width: 4; stroke-linecap: round; }
.mw-moon { fill: #d9c18d33; stroke: #d9c18d99; stroke-width: 1; }
.mw-star { stroke: #d2d5a6; stroke-width: 1; opacity: .55; }
.mw-rotor { animation: mw-turn var(--turn, 90s) linear infinite; animation-direction: var(--direction, normal); }
.mw-pendulum { transform-origin: 0 0; animation: mw-swing 12s ease-in-out infinite alternate; }
.mw-counterweight { animation: mw-weight 18s ease-in-out infinite alternate; }
@keyframes mw-turn { to { transform: rotate(360deg); } }
@keyframes mw-flow { to { stroke-dashoffset: -180; } }
@keyframes mw-belt { to { stroke-dashoffset: -70; } }
@keyframes mw-swing { from { transform: rotate(-12deg); } to { transform: rotate(12deg); } }
@keyframes mw-weight { from { transform: translateY(-6px); } to { transform: translateY(10px); } }
@keyframes mw-needle { from { transform: rotate(-30deg); } to { transform: rotate(20deg); } }
.machine-thought {
  position: absolute; display: grid; place-items: center; width: 48px; height: 48px; min-height: 48px; padding: 0;
  transform: translate(-50%, -50%); border: 0; border-radius: 50%; background: transparent; pointer-events: auto;
  transition: left 1.2s linear, top 1.2s linear; touch-action: pan-y; z-index: 3;
}
.machine-orb {
  position: relative; display: block; width: 29px; height: 29px; border-radius: 50%;
  background: radial-gradient(circle at 32% 25%, #fff9, transparent 27%),
    radial-gradient(circle at 50% 65%, hsl(var(--orb-hue) 48% 65% / .7), hsl(var(--orb-hue) 34% 25% / .95));
  border: 1px solid hsl(var(--orb-hue) 65% 82% / .8);
  box-shadow: inset -3px -4px 7px #0006, 0 0 13px hsl(var(--orb-hue) 60% 75% / .22);
  transition: box-shadow .7s ease, filter .7s ease;
  animation: mw-arrive 1.8s ease-out both;
}
@keyframes mw-arrive { from { opacity: 0; filter: blur(4px); } to { opacity: 1; filter: blur(0); } }
.machine-thought.is-opening .machine-orb { animation: archive-dissolve 3.8s ease-in-out forwards; }
.machine-core { position: absolute; inset: 10px; border-radius: 50%; background: #f4f1cc; box-shadow: 0 0 8px #edf5b2aa; }
.machine-orbit { position: absolute; inset: 5px 2px; border: 1px solid #f1ecd266; border-radius: 50%; transform: rotate(-38deg); }
.machine-thought.is-ready .machine-orb { box-shadow: inset -3px -4px 7px #0004, 0 0 18px #e8d19677; border-color: #eee0b5; }
.machine-thought:hover, .machine-thought:focus-visible { z-index: 5; outline: 1px solid var(--accent-2); outline-offset: 0; background: #cddda70a; }
.machine-thought:hover .machine-orb, .machine-thought:focus-visible .machine-orb { filter: brightness(1.15); }
.machine-tip {
  position: absolute; bottom: calc(100% + 5px); left: 50%; transform: translateX(-50%);
  width: max-content; max-width: 200px; pointer-events: none; padding: 8px 11px; border: 1px solid #667454;
  background: #1c2b22; color: var(--ink); font-size: .72rem; line-height: 1.5; border-radius: 8px;
  box-shadow: 0 5px 20px #0004; visibility: hidden; opacity: 0; transition: opacity .4s ease;
}
.machine-thought.near-left .machine-tip { left: 0; transform: none; }
.machine-thought.near-right .machine-tip { left: auto; right: 0; transform: none; }
.machine-thought:hover .machine-tip, .machine-thought:focus-visible .machine-tip { visibility: visible; opacity: 1; }
.machine-scene.is-resting *, html:has(dialog[open]) .machine-drawing * { animation-play-state: paused !important; }
html.calm .machine-scene * { animation: none !important; transition: none !important; }
@media (max-width: 700px) {
  .machine-network .mw-network-tube .mw-pipe-shadow { stroke-width: 8; }
  .machine-network .mw-network-tube .mw-pipe-glass { stroke-width: 6; }
  .machine-network .mw-network-tube .mw-pipe-water { stroke-width: 3; }
  .home-hero { grid-template-columns: 1fr; gap: 0; padding-inline: 24px; }
  .home-workshop { grid-row: 4; width: calc(100% + 24px); margin: 6px -12px 16px; }
  .machine-scene { max-width: 430px; }
  .home-workshop .home-bottle-status { font-size: .9rem; margin-top: -3px; }
  .machine-caption { max-width: 28em; padding-inline: 10px; font-size: .7rem; margin-top: 10px; }
  .machine-orb { width: 27px; height: 27px; }
}
@media (prefers-reduced-motion: reduce) {
  .machine-scene *, .machine-network *, .mw-circuit-board *, #field[data-circuit] .orb { animation: none !important; transition: none !important; }
}

/* light, not thoughts, travels the pipes up here: each thought appears once, as its jar below */
.mw-pulse { fill: #f3dca8; opacity: 0; filter: drop-shadow(0 0 4px rgba(243, 220, 168, .85)); }
html.calm .mw-pulse, .machine-scene.is-resting .mw-pulse { display: none; }
@media (prefers-reduced-motion: reduce) { .mw-pulse { display: none; } }
.machine-more {
  border: 0; background: none; padding: 6px 10px; border-radius: 999px; cursor: pointer;
  font: inherit; color: var(--brass-hi, #e8cf98); letter-spacing: .02em;
}
.machine-more:hover, .machine-more:focus-visible { background: rgba(214, 190, 140, .1); outline: none; }
.machine-more:focus-visible { box-shadow: 0 0 0 2px var(--accent); }

/* ---------- the B+C machine: engine, shafts, orrery; verdigris leads, brass is the accent ---------- */
/* B+C: the engine, shafts and linkages of B in C's orrery workshop. Green glass and verdigris
   lead; full brass is kept for the focal pieces (housing, gauge, orrery, unions, a few hubs). */
.mw-v .mw-gear { fill: #1b2a22; stroke: url(#mw-verd); }
.mw-v .mw-rim { stroke: #77a68e; opacity: .55; }
.mw-v .mw-spoke, .mw-v .mw-brass, .mw-v .mw-rod { stroke: url(#mw-verd); }
.mw-v .mw-hub { fill: #33483c; stroke: #8dbba2; }
.mw-v .mw-rivet { fill: #a4c9b2; }
.mw-v .mw-weight { fill: #29392f; stroke: url(#mw-verd); }
.mw-v .mw-union { fill: url(#mw-verd); stroke: #c4dfcc; }
.mw-v .mw-hairline { stroke: #a4c9b2; }
.mw-v .mw-belt-stitch { stroke: #86ad95; }
.mw-bz .mw-gear { fill: #241f17; stroke: url(#mw-bronze); }
.mw-bz .mw-rim { stroke: #8c7552; opacity: .5; }
.mw-bz .mw-spoke, .mw-bz .mw-brass { stroke: url(#mw-bronze); }
.mw-bz .mw-weight { fill: #332c20; stroke: url(#mw-bronze); }
.mw-bz .mw-hairline { stroke: #b49c74; opacity: .45; }
.mw-bz .mw-rivet { fill: #c7b088; }
.mw-far { opacity: .2; }
.mw-far .mw-gear { fill: #16241d; stroke: #6fa88c; }
.mw-far .mw-rim, .mw-far .mw-hairline { stroke: #6fa88c; }
.mw-far .mw-spoke { stroke: #6fa88c; }
.mw-far .mw-hub { fill: #1e3228; stroke: #6fa88c; }
.mw-far .mw-rivet { fill: #8cc0a5; }
.mw-shaft-v { stroke: url(#mw-verd); stroke-width: 2.6; stroke-linecap: round; opacity: .7; }
/* shafts (B), in oxidised tones; the running light matches the light in the pipes */
.mw-axle-bed { stroke: #14211a; stroke-width: 8; stroke-linecap: round; }
.mw-axle { stroke: #4f7766; stroke-width: 4.4; stroke-linecap: round; }
.mw-axle-hi { stroke: #b6dbc4; stroke-width: 1; opacity: .45; }
.mw-axle-run { stroke: #e8ebbc; stroke-width: 1.8; stroke-dasharray: 2.5 9.5; opacity: .7; animation: mw-run var(--run, 1.8s) linear infinite; }
.mw-axle-g.thin .mw-axle-bed { stroke-width: 6; } .mw-axle-g.thin .mw-axle { stroke-width: 3; }
.mw-teeth { stroke: #9cc9ae; stroke-width: 2.4; stroke-dasharray: 1.6 2.4; animation: mw-teeth 1.2s linear infinite; }
.mw-bz .mw-teeth { stroke: #b49c74; }
.mw-cam { fill: #2e4136; stroke: #8dbba2; stroke-width: 1.4; }
.mw-gov-arm { stroke: #8dbba2; stroke-width: 2; stroke-linecap: round; }
.mw-worm-line { stroke: #b6dbc4; stroke-width: 2.2; stroke-linecap: round; }
.mwc-ring-in { fill: #121b16; stroke: #77a68e; stroke-width: 1.2; stroke-linejoin: round; }
.mwc-orbit { opacity: .3; stroke-dasharray: 1.5 4; }
/* motion: B's linkages */
.mw-worm-thread { animation: mw-worm 1.4s linear infinite; }
.mw-gov, .mw-follow, .mw-beam, .mw-slide, .mw-conrod, .mw-gov-ball { transform-origin: 0 0; }
.mw-gov { animation: mw-gov 2.6s ease-in-out infinite alternate; }
.mw-gov-ball { animation: mw-gov-ball 2.6s ease-in-out infinite alternate; }
.mw-gov-ball.far { animation-name: mw-gov-ball-far; }
.mw-follow { animation: mw-follow 24s linear infinite; }
.mw-follow-inv { animation-name: mw-follow-inv; }
.mw-beam { animation: mw-beam 24s linear infinite; }
.mw-slide { animation: mw-slide 6s ease-in-out infinite alternate; }
.mw-conrod { animation: mw-conrod 12s linear infinite; }
@keyframes mw-run { to { stroke-dashoffset: -12; } }
@keyframes mw-teeth { to { stroke-dashoffset: -4; } }
@keyframes mw-worm { to { transform: translateY(-6px); } }
@keyframes mw-gov { from { transform: scaleX(1); } to { transform: scaleX(-1); } }
@keyframes mw-gov-ball { to { transform: translateX(-44px); } }
@keyframes mw-gov-ball-far { to { transform: translateX(44px); } }
@keyframes mw-slide { to { transform: translateX(-20px); } }
/* quarter-waves: ease-out away from rest, ease-in towards the turn, so they track the wheels */
@keyframes mw-conrod {
  0% { transform: rotate(0); animation-timing-function: ease-out; } 25% { transform: rotate(-11.5deg); animation-timing-function: ease-in; }
  50% { transform: rotate(0); animation-timing-function: ease-out; } 75% { transform: rotate(11.5deg); animation-timing-function: ease-in; }
  100% { transform: rotate(0); } }
@keyframes mw-follow {
  0% { transform: translateY(0); animation-timing-function: ease-out; } 25% { transform: translateY(-5px); animation-timing-function: ease-in; }
  50% { transform: translateY(0); animation-timing-function: ease-out; } 75% { transform: translateY(5px); animation-timing-function: ease-in; }
  100% { transform: translateY(0); } }
@keyframes mw-follow-inv {
  0% { transform: translateY(0); animation-timing-function: ease-out; } 25% { transform: translateY(4.6px); animation-timing-function: ease-in; }
  50% { transform: translateY(0); animation-timing-function: ease-out; } 75% { transform: translateY(-4.6px); animation-timing-function: ease-in; }
  100% { transform: translateY(0); } }
@keyframes mw-beam {
  0% { transform: rotate(0); animation-timing-function: ease-out; } 25% { transform: rotate(-11deg); animation-timing-function: ease-in; }
  50% { transform: rotate(0); animation-timing-function: ease-out; } 75% { transform: rotate(11deg); animation-timing-function: ease-in; }
  100% { transform: rotate(0); } }
/* motion: C's clockwork */
.mwc-tick { animation: mw-turn var(--turn, 30s) steps(var(--steps, 30)) infinite; animation-direction: var(--direction, normal); }
.mwc-rock { animation: mwc-rock 1s ease-in-out infinite alternate; }
.mwc-balance { animation: mwc-balance 1s ease-in-out infinite alternate; }
.mwc-geneva { animation: mwc-geneva var(--turn, 8s) ease-in-out infinite; }
@keyframes mwc-rock { from { transform: rotate(-6deg); } to { transform: rotate(6deg); } }
@keyframes mwc-balance { from { transform: rotate(-150deg); } to { transform: rotate(150deg); } }
@keyframes mwc-geneva { 0%, 37.5% { transform: rotate(0deg); } 62.5%, 100% { transform: rotate(-90deg); } }
.mw-v .mw-coupling .mw-union { fill: url(#mw-brass); stroke: #eee0b1; }
