/* Zora Constellation: the arm pages. Through a door, into that arm's own lit world.
   The same sky as the home, leaning to the arm's color; one living scene made in code; the visitor's words;
   what the arm is for; what is true today; a next step with a person behind it; and the other doors.
   Always dark: it is space. Motion marks an event, then settles. Reduced motion shows every finished state. */

/* ---------- The stage ---------- */

.arm-page { --focus: var(--hue); --footer-h: 78px; justify-content: flex-start; padding-block: clamp(14px, 2.2vh, 26px) clamp(12px, 1.8vh, 22px); }
.arm-page + .footer-compact { flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; min-height: 78px; }
.arm-grid { display: grid; gap: 16px; align-items: start; }
.arm-page .eyebrow { color: var(--hue); margin-bottom: clamp(10px, 1.6vh, 16px); }
.arm-page .eyebrow::after { background: var(--hue); box-shadow: 0 0 10px 1px rgba(var(--hue-rgb), 0.35), 0 0 3px var(--hue); }
.arm-h1 { font-size: clamp(1.95rem, min(1rem + 2.9vw, 7.4vh), 3.4rem); letter-spacing: -0.03em; line-height: 1.02; text-wrap: balance; text-shadow: 0 2px 40px rgba(3, 6, 15, 0.8); }
.arm-state { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 0.86rem; font-weight: 700; color: var(--text-2); }
.arm-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: 0.6; }
.arm-page[data-status="now"] .arm-state { color: var(--hue); }
.arm-page[data-status="now"] .arm-state::before { opacity: 1; box-shadow: 0 0 10px 2px rgba(var(--hue-rgb), 0.6); }
.arm-for { max-width: 32em; font-size: clamp(1rem, 0.95rem + 0.3vw, 1.15rem); line-height: 1.5; color: var(--text-2); text-shadow: 0 1px 18px rgba(3, 6, 15, 0.9); }
.arm-today { margin-top: clamp(14px, 2.4vh, 22px); }
.arm-h2 { margin-bottom: 8px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--hue); }
.arm-list { display: grid; gap: 7px; max-width: 32em; list-style: none; padding: 0; margin: 0; }
.arm-list li { position: relative; padding-left: 20px; font-size: 0.95rem; line-height: 1.45; color: var(--text-2); text-shadow: 0 1px 14px rgba(3, 6, 15, 0.9); }
.arm-list li::before { content: ""; position: absolute; left: 1px; top: 0.56em; width: 7px; height: 7px; border-radius: 50%; background: var(--hue); box-shadow: 0 0 8px rgba(var(--hue-rgb), 0.7); }
/* What is not here yet is marked with a hollow dot: the shape says "not lit" before the words do. */
.arm-list-coming li::before { background: transparent; border: 1.5px solid var(--hue); box-shadow: none; left: 0; }
.arm-actions { margin-top: 0; gap: 10px 18px; }
.arm-actions .btn-primary { background: var(--hue); color: #03060f; }
.arm-actions .btn-primary:hover { background: var(--hue); filter: brightness(1.1); }
.arm-actions .btn-secondary { background: rgba(6, 13, 26, 0.5); color: var(--text); border-color: rgba(242, 241, 235, 0.3); }
.arm-actions .btn-secondary:hover { border-color: var(--hue); color: var(--hue); }
.arm-actions .text-link { color: var(--hue); }
.arm-actions .text-link:hover { color: var(--text); }
.arm-person { margin-top: 14px; font-size: 0.88rem; line-height: 1.5; color: var(--text-2); text-shadow: 0 1px 14px rgba(3, 6, 15, 0.9); }
.arm-person a { color: var(--text); font-weight: 700; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.arm-person a:hover { color: var(--hue); }
.arm-person .sep { margin-inline: 8px; color: var(--text-3); }
.arm-coming { margin: 0; }

/* Under the arm bar the arm's name is already on screen, in its color: the page starts with the visitor's words. */
.armbar + .arm-page .arm-head .eyebrow { display: none; }
@media (min-width: 900px) and (max-height: 820px) {
  .armbar + .arm-page { padding-top: clamp(14px, 2.4vh, 22px); }
}

/* The words arrive at once; the scene and the doors follow the star. */
.js .arm-page:not(.no-sky) .arm-head, .js .arm-page:not(.no-sky) .arm-body, .js .arm-page:not(.no-sky) .arm-foot, .js .arm-page:not(.no-sky) .arm-coming { animation: home-words 0.6s ease both; }
.js .arm-page:not(.no-sky) .arm-scene { animation: arm-scene-in 0.9s ease both 0.25s; }
.js .arm-page:not(.no-sky) .other-doors { animation: home-words 0.7s ease both 0.9s; }
@keyframes arm-scene-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- The scene: a frame like the door you stepped through, the sky and the star burning through it ---------- */

.arm-scene { position: relative; margin: 0; }
.scene-stage {
  position: relative; height: clamp(240px, 46vh, 420px); overflow: hidden;
  border: 1px solid rgba(242, 241, 235, 0.14); border-radius: 18px;
  background: linear-gradient(180deg, rgba(6, 13, 26, 0.32), rgba(6, 13, 26, 0.5));
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.95), inset 0 0 0 1px rgba(var(--hue-rgb), 0.05), 0 0 60px -20px rgba(var(--hue-rgb), 0.35);
  color: var(--hue);
}
.scene-stage::before { content: ""; position: absolute; left: 10%; right: 10%; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, rgba(var(--hue-rgb), 0.95), transparent); }
.scene-stage .gate-star { position: absolute; left: 50%; top: 50%; width: 1px; height: 1px; transform: translate(-50%, -50%); pointer-events: none; }
.no-sky .scene-stage .gate-star { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle, #fff 0 25%, var(--hue) 45%, transparent 72%); box-shadow: 0 0 30px 8px rgba(var(--hue-rgb), 0.5); }
.scene-svg { position: relative; display: block; width: 100%; height: 100%; overflow: visible; }
.scene-cap { margin-top: 10px; font-size: 0.82rem; line-height: 1.45; color: var(--text-3); }

/* ---------- The other doors: a strip of small lit plates, each in its own color ---------- */

.other-doors { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 16px; padding-top: 12px; border-top: 1px solid rgba(242, 241, 235, 0.1); }
.other-title { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); }
.odoors { grid-row: 2; grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.odoor {
  position: relative; display: inline-flex; align-items: center; gap: 9px; min-height: 40px; padding: 6px 14px 6px 12px;
  border: 1px solid rgba(242, 241, 235, 0.14); border-radius: 999px; background: var(--plate);
  color: var(--text); text-decoration: none; transition: border-color 0.2s ease, transform 0.25s var(--ease), box-shadow 0.25s ease;
}
.odoor:hover, .odoor:focus-visible { border-color: rgba(var(--hue-rgb), 0.75); transform: translateY(-2px); box-shadow: 0 0 24px -8px rgba(var(--hue-rgb), 0.6); }
.odoor:focus-visible { outline: 2px solid var(--hue); outline-offset: 3px; }
.odoor-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--hue); box-shadow: 0 0 10px 1px rgba(var(--hue-rgb), 0.8); }
.odoor-name { font-size: 0.84rem; font-weight: 700; }
.odoor-status { font-size: 0.76rem; color: var(--text-3); }
.odoor[data-status="now"] .odoor-status { color: var(--hue); }
.other-all { grid-row: 1; grid-column: 2; justify-self: end; display: inline-flex; align-items: center; gap: 6px; min-height: 28px; font-size: 0.84rem; font-weight: 700; color: var(--text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.other-all:hover { color: var(--hue); }
.other-all svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Layouts ---------- */

@media (max-width: 899px) {
  .arm-grid { gap: 14px; }
  .arm-h1 { font-size: clamp(1.9rem, 8.6vw, 2.4rem); }
  .scene-stage { height: auto; aspect-ratio: 3 / 2; }
  .arm-today { margin-top: 14px; }
  .arm-actions .btn { flex: 1 1 100%; }
  .odoor { width: 100%; }
}
@media (min-width: 900px) {
  .arm-grid {
    grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
    grid-template-areas: "head scene" "body scene" "foot coming" "strip strip";
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    column-gap: clamp(32px, 4.5vw, 64px); row-gap: 0;
  }
  .arm-head { grid-area: head; }
  .arm-scene { grid-area: scene; }
  .arm-body { grid-area: body; margin-top: clamp(14px, 2.4vh, 24px); }
  .arm-coming { grid-area: coming; margin-top: clamp(14px, 2.4vh, 22px); }
  .arm-foot { grid-area: foot; margin-top: clamp(16px, 2.8vh, 28px); }
  .other-doors { grid-area: strip; margin-top: clamp(16px, 3vh, 30px); }
}
@media (min-width: 900px) and (max-height: 820px) {
  .arm-page { padding-top: clamp(12px, 1.8vh, 20px); }
  .arm-page .eyebrow { margin-bottom: 8px; }
  .arm-h1 { font-size: clamp(1.9rem, min(1rem + 2.5vw, 6.4vh), 2.9rem); }
  .arm-state { margin-top: 8px; }
  .arm-for { font-size: 0.98rem; }
  .arm-list { gap: 5px; }
  .arm-list li { font-size: 0.9rem; }
  .scene-stage { height: clamp(210px, 37vh, 320px); }
  .scene-cap { margin-top: 8px; }
  .arm-body, .arm-coming { margin-top: 12px; }
  .arm-foot { margin-top: 14px; }
  .other-doors { margin-top: 14px; }
}

/* ---------- Scene: the core. Every other door on a ring, each on its own beam, each a real link. ---------- */

.scene-stage-core { overflow: visible; }
.orbit { --r: 37cqmin; position: relative; height: 100%; aspect-ratio: 1; margin-inline: auto; container-type: size; }
.orbit-ring { position: absolute; left: 50%; top: 50%; width: calc(var(--r) * 2); height: calc(var(--r) * 2); border: 1px dashed rgba(242, 241, 235, 0.16); border-radius: 50%; transform: translate(-50%, -50%); }
.orbit-core { position: absolute; left: 50%; top: 50%; width: 42%; aspect-ratio: 1; transform: translate(-50%, -50%); color: var(--hue); }
.orbit-rings { display: block; width: 100%; height: 100%; overflow: visible; }
.or-r1, .or-r2, .or-r3, .or-r4, .or-sat, .or-sat-2 { transform-box: view-box; transform-origin: 100px 100px; }
.or-r1 { animation: or-spin 70s linear infinite; }
.or-r2 { animation: or-spin 44s linear infinite reverse; }
.or-r3 { animation: or-spin 28s linear infinite; }
.or-r4 { animation: or-breathe 5s ease-in-out infinite; }
.or-sat { animation: or-spin 22s linear infinite reverse; }
.or-sat-2 { animation: or-spin 15s linear infinite; }
@keyframes or-spin { to { transform: rotate(360deg); } }
@keyframes or-breathe { 0%, 100% { transform: scale(1); opacity: 0.5; } 50% { transform: scale(1.06); opacity: 0.9; } }
/* A beam: a thin line from the core to a door, in the two colors, grown out once as the page lights; a pulse travels it. */
.orbit-beam { position: absolute; left: 50%; top: 50%; width: var(--r); height: 2px; margin-top: -1px; transform-origin: 0 50%; transform: rotate(var(--ang)); pointer-events: none; }
.orbit-beam::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(159, 227, 222, 0.1), rgba(var(--hue-rgb), 0.6)); transform-origin: 0 50%; }
.orbit-beam::after { content: ""; position: absolute; left: 0; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px 2px rgba(var(--hue-rgb), 0.9); animation: orbit-pulse 3.2s linear infinite; animation-delay: calc(1.6s + var(--i) * 0.55s); opacity: 0; }
.js .arm-page:not(.no-sky) .orbit-beam::before { animation: orbit-grow 0.7s var(--ease) both; animation-delay: calc(0.7s + var(--i) * 0.17s); }
@keyframes orbit-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes orbit-pulse { 0% { transform: translateX(0); opacity: 0; } 8% { opacity: 1; } 85% { opacity: 1; } 100% { transform: translateX(calc(var(--r) - 6px)); opacity: 0; } }
.orbit-nav { position: absolute; inset: 0; }
.orbit-node {
  position: absolute; left: 50%; top: 50%; width: 8.4em;
  display: grid; justify-items: center; gap: 3px; padding: 6px 4px; border-radius: 12px;
  transform: translate(-50%, -50%) rotate(var(--ang)) translate(var(--r)) rotate(calc(var(--ang) * -1));
  color: var(--text); text-decoration: none; text-align: center;
}
.js .arm-page:not(.no-sky) .orbit-node { animation: home-words 0.5s ease both; animation-delay: calc(1.1s + var(--i) * 0.17s); }
.orbit-dot { width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle, #fff 0 30%, var(--hue) 50%, transparent 72%); box-shadow: 0 0 14px 3px rgba(var(--hue-rgb), 0.7); transition: transform 0.25s var(--ease); }
.orbit-name { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; line-height: 1.25; color: var(--hue); }
.orbit-status { font-size: 0.72rem; font-weight: 600; line-height: 1.2; color: var(--text-2); }
.orbit-node[data-status="now"] .orbit-status { color: var(--hue); }
.orbit-node:hover .orbit-dot, .orbit-node:focus-visible .orbit-dot { transform: scale(1.4); }
.orbit-node:hover .orbit-status, .orbit-node:focus-visible .orbit-status { color: var(--text); }
.orbit-node:focus-visible { outline: 2px solid var(--hue); outline-offset: 2px; }
@media (max-width: 899px) {
  .orbit { --r: 38cqmin; }
  .orbit-node { width: 7.2em; }
  .orbit-name { font-size: 0.62rem; letter-spacing: 0.08em; }
  .orbit-status { font-size: 0.66rem; }
}

/* ---------- Scene: the bill. A scan reads the lines; waste is flagged in amber, then trimmed; the total falls. 9 seconds, then again. ---------- */

.scene-bill .gate-star { left: 22%; top: 16%; }
.bl-scan { animation: bl-scan 9s linear infinite; }
@keyframes bl-scan { 0% { transform: translateY(0); opacity: 0; } 3% { opacity: 1; } 40% { transform: translateY(176px); opacity: 1; } 45% { opacity: 0; } 100% { transform: translateY(176px); opacity: 0; } }
.bl-check { opacity: 1; }
.bl-k0 .bl-check { animation: bl-ck0 9s linear infinite; }
.bl-k1 .bl-check { animation: bl-ck1 9s linear infinite; }
.bl-k2 .bl-check { animation: bl-ck2 9s linear infinite; }
.bl-k3 .bl-check { animation: bl-ck3 9s linear infinite; }
.bl-k4 .bl-check { animation: bl-ck4 9s linear infinite; }
@keyframes bl-ck0 { 0%, 4% { opacity: 0; } 7%, 92% { opacity: 1; } 96%, 100% { opacity: 0; } }
@keyframes bl-ck1 { 0%, 9% { opacity: 0; } 12%, 92% { opacity: 1; } 96%, 100% { opacity: 0; } }
@keyframes bl-ck2 { 0%, 19% { opacity: 0; } 22%, 92% { opacity: 1; } 96%, 100% { opacity: 0; } }
@keyframes bl-ck3 { 0%, 24% { opacity: 0; } 27%, 92% { opacity: 1; } 96%, 100% { opacity: 0; } }
@keyframes bl-ck4 { 0%, 34% { opacity: 0; } 37%, 92% { opacity: 1; } 96%, 100% { opacity: 0; } }
.bl-band { opacity: 0.14; }
.bl-tag, .bl-mark { opacity: 1; }
.bl-fa .bl-band, .bl-fa .bl-tag, .bl-fa .bl-mark { animation: bl-fa 9s linear infinite; }
.bl-fb .bl-band, .bl-fb .bl-tag, .bl-fb .bl-mark { animation: bl-fb 9s linear infinite; }
.bl-fc .bl-band, .bl-fc .bl-tag, .bl-fc .bl-mark { animation: bl-fc 9s linear infinite; }
.bl-fa .bl-band { animation-name: bl-fa-band; }
.bl-fb .bl-band { animation-name: bl-fb-band; }
.bl-fc .bl-band { animation-name: bl-fc-band; }
@keyframes bl-fa { 0%, 14% { opacity: 0; } 17%, 92% { opacity: 1; } 96%, 100% { opacity: 0; } }
@keyframes bl-fb { 0%, 29% { opacity: 0; } 32%, 92% { opacity: 1; } 96%, 100% { opacity: 0; } }
@keyframes bl-fc { 0%, 39% { opacity: 0; } 42%, 92% { opacity: 1; } 96%, 100% { opacity: 0; } }
@keyframes bl-fa-band { 0%, 14% { opacity: 0; } 17%, 92% { opacity: 0.14; } 96%, 100% { opacity: 0; } }
@keyframes bl-fb-band { 0%, 29% { opacity: 0; } 32%, 92% { opacity: 0.14; } 96%, 100% { opacity: 0; } }
@keyframes bl-fc-band { 0%, 39% { opacity: 0; } 42%, 92% { opacity: 0.14; } 96%, 100% { opacity: 0; } }
.bl-cut { transform-box: fill-box; transform-origin: 100% 50%; transform: scaleX(0.32); }
.bl-ca { animation: bl-cut-a 9s var(--ease) infinite; }
.bl-cb { animation: bl-cut-b 9s var(--ease) infinite; }
.bl-cc { animation: bl-cut-c 9s var(--ease) infinite; }
@keyframes bl-cut-a { 0%, 52% { transform: scaleX(1); } 60%, 94% { transform: scaleX(0.32); } 100% { transform: scaleX(1); } }
@keyframes bl-cut-b { 0%, 56% { transform: scaleX(1); } 64%, 94% { transform: scaleX(0.32); } 100% { transform: scaleX(1); } }
@keyframes bl-cut-c { 0%, 60% { transform: scaleX(1); } 68%, 94% { transform: scaleX(0.32); } 100% { transform: scaleX(1); } }
.bl-total { transform-box: fill-box; transform-origin: 100% 50%; transform: scaleX(0.7); }
.bl-total { animation: bl-total 9s var(--ease) infinite; }
@keyframes bl-total { 0%, 52% { transform: scaleX(1); } 70%, 94% { transform: scaleX(0.7); } 100% { transform: scaleX(1); } }
.bl-saved { opacity: 0.8; }
.bl-saved { animation: bl-saved 9s linear infinite; }
@keyframes bl-saved { 0%, 64% { opacity: 0; } 72%, 92% { opacity: 0.8; } 96%, 100% { opacity: 0; } }

/* ---------- Scene: the balance. It draws itself in once (forming), then tilts and settles level, again and again (the pace). ---------- */

.scene-balance .gate-star { left: 50%; top: 22%; }
.fb-draw { stroke-dasharray: 1; stroke-dashoffset: 0; }
.js .arm-page:not(.no-sky) .fb-draw { animation: fb-draw 1.1s var(--ease) both; }
.js .arm-page:not(.no-sky) .fb-d1 { animation-delay: 0.3s; }
.js .arm-page:not(.no-sky) .fb-d2 { animation-delay: 0.7s; }
.js .arm-page:not(.no-sky) .fb-d3 { animation-delay: 1.2s; }
.js .arm-page:not(.no-sky) .fb-d4 { animation-delay: 1.4s; }
.js .arm-page:not(.no-sky) .fb-d5 { animation-delay: 1.9s; }
.js .arm-page:not(.no-sky) .fb-d6 { animation-delay: 2.2s; }
@keyframes fb-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.fb-beam { transform-box: view-box; transform-origin: 240px 70px; animation: fb-tilt 12s var(--ease) infinite; }
.fb-pan-l { transform-box: view-box; animation: fb-pan-l 12s var(--ease) infinite; }
.fb-pan-r { transform-box: view-box; animation: fb-pan-r 12s var(--ease) infinite; }
@keyframes fb-tilt { 0%, 30% { transform: rotate(0); } 38% { transform: rotate(-6deg); } 52% { transform: rotate(2.6deg); } 62% { transform: rotate(-1deg); } 72%, 100% { transform: rotate(0); } }
@keyframes fb-pan-l { 0%, 30% { transform: translateY(0); } 38% { transform: translateY(15.5px); } 52% { transform: translateY(-6.7px); } 62% { transform: translateY(2.6px); } 72%, 100% { transform: translateY(0); } }
@keyframes fb-pan-r { 0%, 30% { transform: translateY(0); } 38% { transform: translateY(-15.5px); } 52% { transform: translateY(6.7px); } 62% { transform: translateY(-2.6px); } 72%, 100% { transform: translateY(0); } }
.fb-tok { transform-box: view-box; }
.fb-tok-l { animation: fb-tok-l 12s var(--ease) infinite; }
.fb-tok-r { animation: fb-tok-r 12s var(--ease) infinite; }
@keyframes fb-tok-l { 0%, 26% { transform: translateY(-70px); opacity: 0; } 28% { opacity: 1; } 33% { transform: translateY(0); opacity: 1; } 94% { opacity: 1; } 98%, 100% { opacity: 0; } }
@keyframes fb-tok-r { 0%, 42% { transform: translateY(-70px); opacity: 0; } 44% { opacity: 1; } 49% { transform: translateY(0); opacity: 1; } 94% { opacity: 1; } 98%, 100% { opacity: 0; } }
.fb-level { opacity: 1; animation: fb-level 12s linear infinite; }
@keyframes fb-level { 0%, 72% { opacity: 0; } 78%, 96% { opacity: 1; } 100% { opacity: 0; } }
.fb-pivot { animation: fb-pivot 12s linear infinite; }
@keyframes fb-pivot { 0%, 100% { opacity: 1; } 38% { opacity: 0.6; } 72% { opacity: 1; } }

/* ---------- Scene: the world. It builds itself block by block as the page lights; a sun crosses; a figure walks the road; a beacon and windows wake. ---------- */

.scene-world .gate-star { left: 50%; top: 58%; }
.w-roadtile { color: #e4dbff; }
.w-leaf { color: #cdb5ff; }
.w-leaf-2 { transform-box: fill-box; transform-origin: 50% 100%; transform: scale(0.68); color: #dccbff; }
.wb { transform-box: fill-box; }
.js .arm-page:not(.no-sky) .wb { animation: w-rise 0.7s var(--ease) both; }
.js .arm-page:not(.no-sky) .wd0 { animation-delay: 0.45s; }
.js .arm-page:not(.no-sky) .wd1 { animation-delay: 0.6s; }
.js .arm-page:not(.no-sky) .wd2 { animation-delay: 0.75s; }
.js .arm-page:not(.no-sky) .wd3 { animation-delay: 0.9s; }
.js .arm-page:not(.no-sky) .wd4 { animation-delay: 1.05s; }
.js .arm-page:not(.no-sky) .wd5 { animation-delay: 1.2s; }
.js .arm-page:not(.no-sky) .wd6 { animation-delay: 1.35s; }
.js .arm-page:not(.no-sky) .wd7 { animation-delay: 1.5s; }
.js .arm-page:not(.no-sky) .wd8 { animation-delay: 1.65s; }
.js .arm-page:not(.no-sky) .w-house, .js .arm-page:not(.no-sky) .w-tree, .js .arm-page:not(.no-sky) .w-tower { animation-delay: 2s; }
@keyframes w-rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
.w-sun { transform-box: view-box; transform-origin: 240px 330px; animation: w-sun 48s linear infinite; }
@keyframes w-sun { from { transform: rotate(-100deg); } to { transform: rotate(260deg); } }
.w-stars { opacity: 0.6; }
.ws-1 { animation: w-twinkle 3.2s ease-in-out infinite; }
.ws-2 { animation: w-twinkle 4.1s ease-in-out infinite 1s; }
.ws-3 { animation: w-twinkle 2.7s ease-in-out infinite 0.5s; }
@keyframes w-twinkle { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
.w-beacon { animation: w-beacon 2.4s ease-in-out infinite; }
@keyframes w-beacon { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }
.w-win { animation: w-win 10s ease-in-out infinite; }
.w-win-2 { animation-delay: 1.3s; }
@keyframes w-win { 0%, 35% { opacity: 0.25; } 45%, 85% { opacity: 1; } 95%, 100% { opacity: 0.25; } }
.w-player { transform-box: view-box; transform: translate(240px, 180px); animation: w-walk 7s ease-in-out infinite alternate; animation-delay: 2.2s; }
@keyframes w-walk { from { transform: translate(183px, 152px); } to { transform: translate(297px, 208px); } }

/* ---------- Scene: the workshop. An arm reaches and places; a laser cuts three lines; a printer lays six layers; a home's windows wake. ---------- */

.scene-devices .gate-star { left: 51%; top: 76%; }
.dv-upper { transform-box: view-box; transform-origin: 85px 262px; animation: dv-upper 7s var(--ease) infinite; }
.dv-fore { transform-box: view-box; transform-origin: 85px 186px; animation: dv-fore 7s var(--ease) infinite; }
.dv-hand { transform-box: view-box; transform-origin: 156px 158px; animation: dv-hand 7s var(--ease) infinite; }
@keyframes dv-upper { 0%, 10% { transform: rotate(0); } 32% { transform: rotate(-26deg); } 50% { transform: rotate(-26deg); } 70% { transform: rotate(12deg); } 86%, 100% { transform: rotate(0); } }
@keyframes dv-fore { 0%, 10% { transform: rotate(0); } 32% { transform: rotate(40deg); } 50% { transform: rotate(40deg); } 70% { transform: rotate(-16deg); } 86%, 100% { transform: rotate(0); } }
@keyframes dv-hand { 0%, 34% { transform: rotate(0); } 42% { transform: rotate(-14deg); } 70% { transform: rotate(-14deg); } 78%, 100% { transform: rotate(0); } }
.dv-head { transform-box: view-box; animation: dv-head 9s linear infinite; }
@keyframes dv-head { 0% { transform: translateX(0); } 30% { transform: translateX(80px); } 34% { transform: translateX(80px); } 64% { transform: translateX(0); } 68% { transform: translateX(0); } 98% { transform: translateX(80px); } 100% { transform: translateX(80px); } }
.dv-beam { opacity: 0.8; animation: dv-beam 0.18s linear infinite alternate; }
@keyframes dv-beam { from { opacity: 0.55; } to { opacity: 1; } }
.dv-spark { animation: dv-spark 0.3s linear infinite alternate; }
@keyframes dv-spark { from { r: 2.5px; opacity: 0.7; } to { r: 4px; opacity: 1; } }
.dv-cut { stroke-dasharray: 1; stroke-dashoffset: 0; }
.dv-cut-1 { animation: dv-cut-1 9s linear infinite; }
.dv-cut-2 { animation: dv-cut-2 9s linear infinite; }
.dv-cut-3 { animation: dv-cut-3 9s linear infinite; }
@keyframes dv-cut-1 { 0% { stroke-dashoffset: 1; } 30%, 100% { stroke-dashoffset: 0; } }
@keyframes dv-cut-2 { 0%, 34% { stroke-dashoffset: 1; } 64%, 100% { stroke-dashoffset: 0; } }
@keyframes dv-cut-3 { 0%, 68% { stroke-dashoffset: 1; } 98%, 100% { stroke-dashoffset: 0; } }
.dv-layers rect { opacity: 1; }
.dv-l1 { animation: dv-l1 10s linear infinite; }
.dv-l2 { animation: dv-l2 10s linear infinite; }
.dv-l3 { animation: dv-l3 10s linear infinite; }
.dv-l4 { animation: dv-l4 10s linear infinite; }
.dv-l5 { animation: dv-l5 10s linear infinite; }
.dv-l6 { animation: dv-l6 10s linear infinite; }
@keyframes dv-l1 { 0%, 6% { opacity: 0; } 9%, 90% { opacity: 1; } 95%, 100% { opacity: 0; } }
@keyframes dv-l2 { 0%, 18% { opacity: 0; } 21%, 90% { opacity: 1; } 95%, 100% { opacity: 0; } }
@keyframes dv-l3 { 0%, 30% { opacity: 0; } 33%, 90% { opacity: 1; } 95%, 100% { opacity: 0; } }
@keyframes dv-l4 { 0%, 42% { opacity: 0; } 45%, 90% { opacity: 1; } 95%, 100% { opacity: 0; } }
@keyframes dv-l5 { 0%, 54% { opacity: 0; } 57%, 90% { opacity: 1; } 95%, 100% { opacity: 0; } }
@keyframes dv-l6 { 0%, 66% { opacity: 0; } 69%, 90% { opacity: 1; } 95%, 100% { opacity: 0; } }
.dv-plift { transform-box: view-box; transform: translateY(0); animation: dv-plift 10s steps(1, end) infinite; }
@keyframes dv-plift { 0% { transform: translateY(42px); } 9% { transform: translateY(35px); } 21% { transform: translateY(28px); } 33% { transform: translateY(21px); } 45% { transform: translateY(14px); } 57% { transform: translateY(7px); } 69% { transform: translateY(0); } 95% { transform: translateY(0); } 100% { transform: translateY(42px); } }
.dv-phead { transform-box: view-box; animation: dv-phead 1.1s ease-in-out infinite alternate; }
@keyframes dv-phead { from { transform: translateX(-12px); } to { transform: translateX(12px); } }
.dv-win { animation: dv-win 8s ease-in-out infinite; }
.dv-win-2 { animation-delay: 1.1s; }
@keyframes dv-win { 0%, 30% { opacity: 0.25; } 40%, 80% { opacity: 1; } 90%, 100% { opacity: 0.25; } }
.dv-awake { animation: dv-awake 2.6s ease-in-out infinite; }
@keyframes dv-awake { 0%, 100% { opacity: 0.4; transform: scale(1); } 50% { opacity: 1; transform: scale(1.3); } }
.dv-awake { transform-box: fill-box; transform-origin: center; }

/* ---------- Reduced motion: every scene at rest, in its finished state ---------- */

@media (prefers-reduced-motion: reduce) {
  .arm-page * { animation: none !important; }
  .arm-head, .arm-body, .arm-foot, .arm-coming, .arm-scene, .other-doors, .orbit-node { opacity: 1; }
  .orbit-beam::after { display: none; }
  .bl-scan { opacity: 0; }
  .fb-level, .fb-tok { opacity: 1; }
  .dv-beam { opacity: 0.8; }
}

/* ---------- An arm's own pages: the same sky and color as its door; the words, a few plates, and the next step ---------- */

.arm-sub { --footer-h-sub: var(--footer-h, 78px); justify-content: flex-start; padding-block: clamp(18px, 3.6vh, 40px) clamp(16px, 3vh, 32px); }
.armbar + .arm-sub { min-height: calc(100vh - var(--header-h) - var(--armbar-h) - var(--footer-h-sub)); min-height: calc(100svh - var(--header-h) - var(--armbar-h) - var(--footer-h-sub)); }
.arm-sub .sub-grid { display: grid; gap: 16px; align-items: start; }
.arm-sub .eyebrow { margin-bottom: clamp(10px, 1.6vh, 16px); }
.arm-sub .arm-h1 { max-width: 15em; }
.sub-lead { max-width: 30em; font-size: clamp(1.02rem, 0.95rem + 0.35vw, 1.2rem); line-height: 1.5; color: var(--text-2); text-shadow: 0 1px 18px rgba(3, 6, 15, 0.9); }
.sub-plates { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.plate {
  position: relative; padding: 16px 18px 16px; border: 1px solid rgba(242, 241, 235, 0.13); border-radius: 14px;
  background: var(--plate); box-shadow: 0 30px 50px -30px rgba(0, 0, 0, 0.9);
}
.plate::before { content: ""; position: absolute; left: 14px; right: 14px; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, rgba(var(--hue-rgb), 0.95), transparent); }
.plate-wide { grid-column: 1 / -1; }
.plate-title { margin-bottom: 8px; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.14em; line-height: 1.4; text-transform: uppercase; color: var(--hue); }
.plate p { margin: 0; font-size: 0.95rem; line-height: 1.5; color: var(--text-2); }
.plate p + p, .plate p + ul, .plate p + ol { margin-top: 8px; }
.plate .arm-list li { font-size: 0.93rem; text-shadow: none; }
.plate-steps { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.plate-steps li { position: relative; counter-increment: step; padding-left: 26px; font-size: 0.93rem; line-height: 1.45; color: var(--text-2); }
.plate-steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0.05em; width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center; font-size: 0.7rem; font-weight: 800; color: #03060f; background: var(--hue);
}
.plate-doors { margin-top: 2px; }
.plate-doors .odoor { min-height: 36px; padding-block: 4px; }
.sub-foot { margin-top: 2px; }
.sub-next { display: inline-flex; align-items: center; gap: 6px; }
.sub-next svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.arm-sub .arm-person { margin-top: 12px; }
@media (min-width: 900px) {
  .arm-sub .sub-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); grid-template-areas: "head lead" "plates plates" "foot foot"; column-gap: clamp(32px, 4.5vw, 64px); row-gap: clamp(16px, 3vh, 28px); }
  .sub-head { grid-area: head; }
  .sub-lead { grid-area: lead; align-self: end; }
  .sub-plates { grid-area: plates; }
  .sub-foot { grid-area: foot; }
}
@media (max-width: 899px) {
  .arm-sub .arm-actions .btn { flex: 1 1 100%; }
  .plate-doors .odoor { width: auto; }
}
@media (min-width: 900px) and (max-height: 820px) {
  .arm-sub { padding-block: clamp(14px, 2.6vh, 24px) 16px; }
  .arm-sub .eyebrow { margin-bottom: 8px; }
  .arm-sub .arm-state { margin-top: 8px; }
  .plate { padding: 14px 16px 14px; }
}
