/* The eight pictures of the first screen (index.html), one shown at a time: html[data-hero] picks it (?hero=..., the picker under the logo, localStorage "anvil-hero");
   without a choice it is "spec". The picker opens from the logo at the top left of the first page (heroes.js). Motion: the CSS animations stop under
   prefers-reduced-motion unless html has the class "motion" (the switch in the picker, localStorage "anvil-motion"); the step-driven ones (data-loop) then show their last frame. */
.hv { display: none; width: 100%; max-width: 580px; justify-self: end; }
html:not([data-hero]):not([data-reel]) .hv[data-hv="spec"], html[data-hero="spec"] .hv[data-hv="spec"], html[data-hero="line"] .hv[data-hv="line"], html[data-hero="anvil"] .hv[data-hv="anvil"],
html[data-hero="stack"] .hv[data-hv="stack"], html[data-hero="log"] .hv[data-hv="log"], html[data-hero="blueprint"] .hv[data-hv="blueprint"],
html[data-hero="sprints"] .hv[data-hv="sprints"], html[data-hero="eco"] .hv[data-hv="eco"] { display: block; }
@media (max-width: 900px) { .hv { justify-self: center; } }
@media (prefers-reduced-motion: reduce) { html:not(.motion) .hv *, html:not(.motion) .hv *::before, html:not(.motion) .hv *::after { animation-play-state: paused !important; } }

/* ---------- the picker ---------- */
.bar { position: relative; }
.hv-picker { position: absolute; left: var(--gut); top: calc(100% + 10px); z-index: 60; width: min(420px, calc(100vw - 2 * var(--gut))); padding: 16px; border-radius: 16px; background: var(--ink2); border: 2px solid var(--line-d); box-shadow: 10px 10px 0 rgba(0, 0, 0, .35); }
.hv-picker[hidden] { display: none; }
.hv-picker p { font: 500 12px/1.3 var(--mono); letter-spacing: 2px; text-transform: uppercase; color: var(--teal); margin-bottom: 10px; }
.hv-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hv-list button { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: baseline; text-align: left; padding: 10px 12px; border-radius: 10px; border: 2px solid var(--line-d); background: var(--ink); color: var(--paper); cursor: pointer; font: inherit; transition: border-color .15s; }
.hv-list button:hover { border-color: var(--soft-d); }
.hv-list button[aria-pressed="true"] { border-color: var(--amber); }
.hv-list b { grid-row: span 2; font: 500 12px/1 var(--mono); color: var(--amber); }
.hv-list span { font-size: 14px; font-weight: 600; line-height: 1.2; }
.hv-list small { font-size: 12px; line-height: 1.3; color: var(--soft-d); }
.hv-motion { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--soft-d); cursor: pointer; }
.hv-motion input { accent-color: var(--amber); }
html.picking .logo .mark { color: var(--amber); }
@media (max-width: 560px) { .hv-list { grid-template-columns: 1fr; } }

/* ---------- a box that a step loop (heroes.js) drives: children with data-at turn on at that step ---------- */
.hv-stage { position: relative; width: 100%; container-type: inline-size; }
.hv-cap { display: flex; justify-content: space-between; gap: 16px; font: 400 13px/1.3 var(--mono); color: #7D8B98; margin-top: 10px; }
.hv-cap a { color: var(--teal); text-decoration: none; white-space: nowrap; } .hv-cap a:hover { color: var(--paper); }

/* ---------- 1 spec: a brief goes in, the product comes out ---------- */
.sx { aspect-ratio: 560 / 400; }
.sx-doc { position: absolute; left: 0; top: 4%; width: 40%; padding: 3.2cqw; border-radius: 2.4cqw; background: var(--paper); color: var(--ink); box-shadow: 1.6cqw 1.6cqw 0 rgba(0, 0, 0, .3); overflow: hidden; }
.sx-doc-h { display: flex; justify-content: space-between; font: 500 1.9cqw/1 var(--mono); color: var(--soft-l); }
.sx-doc-t { margin: 2.4cqw 0 2cqw; font-size: 4cqw; font-weight: 700; letter-spacing: -0.02em; }
.sx-req { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.5cqw; }
.sx-req li { display: flex; align-items: center; gap: 1.6cqw; font-size: 2.3cqw; line-height: 1.25; color: var(--soft-l); transition: color .3s; }
.sx-req li::before { content: ""; flex: none; width: 2.4cqw; height: 2.4cqw; border-radius: .6cqw; border: .35cqw solid var(--line-l); transition: background .3s, border-color .3s; }
.sx-req li.on { color: var(--ink); } .sx-req li.on::before { background: var(--teal-d) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 8 3 3 5-6' fill='none' stroke='%23fff' stroke-width='2.4'/%3E%3C/svg%3E") center / 80% no-repeat; border-color: var(--teal-d); }
.sx-scan { position: absolute; left: 0; right: 0; height: 12%; top: -12%; background: linear-gradient(transparent, rgba(60, 199, 176, .25), transparent); animation: sx-scan 2.4s linear infinite; }
@keyframes sx-scan { to { top: 100%; } }
.sx-pipe { position: absolute; top: 36%; height: .5cqw; background: repeating-linear-gradient(90deg, var(--line-d) 0 1.4cqw, transparent 1.4cqw 2.4cqw); }
.sx-pipe.a { left: 41%; width: 9%; } .sx-pipe.b { left: 58%; width: 5%; }
.sx-pipe i { position: absolute; top: -.6cqw; width: 1.6cqw; height: 1.6cqw; border-radius: 50%; background: var(--amber); opacity: 0; }
.sx-pipe.on i { animation: sx-flow 1s linear infinite; } .sx-pipe.on i:nth-child(2) { animation-delay: .33s; } .sx-pipe.on i:nth-child(3) { animation-delay: .66s; }
.sx-pipe.b.on i { background: var(--teal); }
@keyframes sx-flow { 0% { left: 0; opacity: 0; } 20% { opacity: 1; } 80% { opacity: 1; } 100% { left: 100%; opacity: 0; } }
.sx-core { position: absolute; left: 50%; top: 36%; width: 8%; aspect-ratio: 1; transform: translate(-0%, -50%); border-radius: 50%; display: grid; place-items: center; background: var(--ink2); border: .4cqw solid var(--line-d); color: var(--paper); transition: border-color .3s, box-shadow .3s; }
.sx-core .mark { width: 62%; height: 62%; }
.sx-core.on { border-color: var(--amber); box-shadow: 0 0 0 1.4cqw rgba(242, 178, 74, .15), 0 0 5cqw rgba(242, 178, 74, .5); }
.sx-app { position: absolute; right: 0; top: 14%; width: 37%; border-radius: 2cqw; background: #0A1017; border: .4cqw solid var(--line-d); overflow: hidden; box-shadow: 1.6cqw 1.6cqw 0 rgba(0, 0, 0, .3); }
.sx-app .term-bar { padding: 1.6cqw 2cqw; font-size: 1.8cqw; gap: 1cqw; } .sx-app .term-bar i { width: 1.3cqw; height: 1.3cqw; }
.sx-body { display: flex; gap: 1.6cqw; padding: 2cqw; background: #fff; aspect-ratio: 4 / 3.6; }
.sx-side { width: 26%; display: grid; align-content: start; gap: 1.4cqw; }
.sx-main { flex: 1; display: grid; align-content: start; gap: 1.6cqw; }
.sx-body [data-at] { border-radius: .8cqw; background: #E6E8EE; opacity: 0; transform: translateY(1cqw); transition: opacity .3s, transform .3s, background .5s; }
.sx-body [data-at].on { opacity: 1; transform: none; }
.sx-side b { display: block; height: 2.4cqw; } .sx-side b:first-child { background: #CBD2DC; }
.sx-h { height: 4cqw; width: 70%; }
.sx-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6cqw; } .sx-cards div { height: 10cqw; }
.sx-app.on .sx-side b:first-child { background: var(--amber); } .sx-app.on .sx-h { background: var(--ink); }
.sx-app.on .sx-cards div:nth-child(1) { background: #3CC7B0; } .sx-app.on .sx-cards div:nth-child(2) { background: #F2B24A; } .sx-app.on .sx-cards div:nth-child(3) { background: #18232F; } .sx-app.on .sx-cards div:nth-child(4) { background: #B9C4CE; }
.sx-live { position: absolute; right: 2cqw; bottom: 2cqw; display: inline-flex; align-items: center; gap: 1cqw; padding: .8cqw 1.8cqw; border-radius: 99px; background: var(--ink); color: var(--teal); font: 600 1.9cqw/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; opacity: 0; transform: scale(.6); transition: opacity .3s, transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.sx-live::before { content: ""; width: 1.2cqw; height: 1.2cqw; border-radius: 50%; background: var(--teal); }
.sx-live.on { opacity: 1; transform: none; }
.sx-steps { position: absolute; left: 0; right: 0; bottom: 0; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4cqw; counter-reset: sx; }
.sx-steps li { counter-increment: sx; padding-top: 1.6cqw; border-top: .5cqw solid var(--line-d); font: 500 2.1cqw/1.3 var(--mono); color: #7D8B98; transition: color .3s, border-color .3s; }
.sx-steps li::before { content: "0" counter(sx) " "; color: var(--line-d); transition: color .3s; }
.sx-steps li.on { color: var(--paper); border-color: var(--amber); } .sx-steps li.on::before { color: var(--amber); }

/* ---------- 5 log: the whole process as one console run ---------- */
.lg { aspect-ratio: 560 / 400; display: flex; flex-direction: column; border-radius: 16px; background: #0A1017; border: 2px solid var(--line-d); overflow: hidden; box-shadow: 10px 10px 0 rgba(0, 0, 0, .28); }
.lg pre { margin: 0; padding: 22px 24px 26px; font: 400 clamp(11px, 2.4cqw, 14px)/1.85 var(--mono); color: var(--soft-d); white-space: pre; overflow: hidden; flex: 1; }
.lg pre > span { display: block; opacity: 0; transform: translateX(-6px); transition: opacity .25s, transform .25s; }
.lg pre > span.on { opacity: 1; transform: none; }
.lg .c { color: var(--paper); } .lg .m { color: #6B7A88; } .lg .k { color: var(--amber); } .lg .g { color: var(--teal); }
.lg .cmd.on .c { display: inline-block; overflow: hidden; vertical-align: bottom; animation: lg-type 1s steps(30) both; }
@keyframes lg-type { from { width: 0; } to { width: 30ch; } }

/* ---------- 6 blueprint: a wireframe is drawn, then filled in ---------- */
.bp { aspect-ratio: 560 / 400; border-radius: 16px; overflow: hidden; border: 2px solid var(--line-d); background: #0D2236; }
.bp svg { display: block; width: 100%; height: 100%; }
.bp .ln { fill: none; stroke: #7FD9CB; stroke-width: 1.5; stroke-dasharray: 900; stroke-dashoffset: 900; transition: stroke-dashoffset 1s ease-out; }
.bp .ln.on { stroke-dashoffset: 0; }
.bp .fl { opacity: 0; transition: opacity .5s; } .bp .fl.on { opacity: 1; }
.bp text { font: 500 11px/1 var(--mono); fill: #7FD9CB; letter-spacing: 1.5px; }
.bp .tag { transition: opacity .4s; } .bp .tag.on { opacity: 0; }
.bp .tag2 { opacity: 0; transition: opacity .4s; } .bp .tag2.on { opacity: 1; }

/* ---------- 7 sprints: a ready module every two weeks ---------- */
.sr { aspect-ratio: 560 / 400; display: flex; flex-direction: column; border-radius: 16px; background: var(--ink2); border: 2px solid var(--line-d); padding: 22px 22px 18px; box-shadow: 10px 10px 0 rgba(0, 0, 0, .28); }
.sr-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; font: 500 12px/1 var(--mono); letter-spacing: 2px; text-transform: uppercase; color: var(--teal); }
.sr-head b { font: 700 28px/1 var(--sans); letter-spacing: -0.02em; color: var(--paper); text-transform: none; }
.sr-grid { position: relative; flex: 1; display: grid; grid-template-columns: 92px 1fr; align-content: space-evenly; row-gap: 10px; }
.sr-grid span { font-size: 13px; color: var(--soft-d); align-self: center; }
.sr-track { position: relative; height: 22px; border-radius: 6px; background: repeating-linear-gradient(90deg, rgba(185, 196, 206, .06) 0 calc(100% / 6 - 2px), transparent calc(100% / 6 - 2px) calc(100% / 6)); }
.sr-track i { position: absolute; top: 0; bottom: 0; left: var(--l); width: 0; border-radius: 6px; background: var(--amber); transition: width .5s ease-out, background .4s; }
.sr-track i.on { width: var(--w); background: var(--teal); }
.sr-axis { display: grid; grid-template-columns: 92px repeat(6, 1fr); margin-top: 10px; font: 400 11px/1 var(--mono); color: #6B7A88; }
.sr-axis span:not(:first-child) { text-align: right; }
.sr-play { position: absolute; top: -6px; bottom: -6px; left: calc(92px + (100% - 92px) * var(--p, 0)); width: 2px; background: var(--amber); box-shadow: 0 0 10px var(--amber); transition: left .45s linear; }

/* ---------- 8 ecosystem: everything the business runs on, wired to one core ---------- */
.ec { aspect-ratio: 560 / 400; }
.ec svg { display: block; width: 100%; height: 100%; overflow: visible; }
.ec .wire { stroke: #3E5163; stroke-width: 1.5; stroke-dasharray: 3 5; }
.ec .node rect { fill: var(--ink2); stroke: var(--line-d); stroke-width: 2; transition: stroke .2s; }
.ec .node text { font: 500 12px/1 var(--mono); fill: var(--paper); letter-spacing: .5px; }
.ec .node:hover rect { stroke: var(--amber); }
.ec .pk { fill: var(--amber); } .ec .pk.t { fill: var(--teal); }
.ec .core { fill: var(--ink2); stroke: var(--amber); stroke-width: 2.5; }
.ec .ring { fill: none; stroke: var(--amber); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; animation: ec-ring 2.4s ease-out infinite; }
.ec .ring.b { animation-delay: 1.2s; }
@keyframes ec-ring { from { transform: scale(1); opacity: .8; } to { transform: scale(1.9); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { html:not(.motion) .lg .cmd.on .c { animation: none; } }

.sr-lbl { font-style: normal; }

/* ---------- the showreel (the default): spec, log, sprints and ecosystem in turn, one box size; heroes.js sets html[data-reel] ---------- */
html[data-reel="spec"] .hv[data-hv="spec"], html[data-reel="log"] .hv[data-hv="log"], html[data-reel="sprints"] .hv[data-hv="sprints"], html[data-reel="eco"] .hv[data-hv="eco"] { display: block; animation: hv-in .6s ease-out; }
@keyframes hv-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.hv-dots { display: none; }
html[data-reel] .hv-dots { grid-column: 2; display: flex; gap: 8px; justify-content: flex-end; width: 100%; max-width: 580px; justify-self: end; margin-top: -4px; }
.hv-dots button { width: 34px; height: 6px; padding: 0; border: 0; border-radius: 3px; background: var(--line-d); cursor: pointer; overflow: hidden; position: relative; }
.hv-dots button[aria-current="true"]::after { content: ""; position: absolute; inset: 0; background: var(--amber); transform-origin: left; animation: hv-dot var(--dur, 8s) linear forwards; }
@keyframes hv-dot { from { transform: scaleX(0); } to { transform: none; } }
@media (max-width: 900px) { html[data-reel] .hv-dots { grid-column: 1; justify-self: center; justify-content: center; } }

