/* elitesoft — look B only (inc/variant.php puts .es-b on <body> and loads this file).
 * 1. the hero building turns under the hand
 * 2. home: one project from scan to render, the building staying in view as the steps scroll
 * 3. category heads: the live building in the state of that category
 * 4. a product picture opens out of the card that was clicked
 * Look A never loads this file. */

/* the canvas of the live building, also outside the home page */
.es-b .scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.es-b > .scene-film { position: fixed; left: 0; top: 0; width: 2px; height: 2px; opacity: 0; pointer-events: none; }

/* ---------- 1. the hand on the model ---------- */
.es-b .hero__draw.is-live, .es-b .story__view, .es-b .chead__draw.is-live { cursor: grab; touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.es-b .hero__draw.is-grab, .es-b .story__view.is-grab, .es-b .chead__draw.is-grab { cursor: grabbing; }
.es-b .hero__draw.is-live .show__what { cursor: auto; -webkit-user-select: text; user-select: text; }
.es-b .hero__draw[data-hint].is-live::after, .story__hint { position: absolute; right: 18px; margin: 0; padding: 7px 13px 7px 34px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(11, 14, 18, .84) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23F2B05E' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10h14M6 6.5 2.5 10 6 13.5M14 6.5l3.5 3.5-3.5 3.5'/%3E%3C/svg%3E") 11px 50% / 16px 16px no-repeat; font: 600 12px/1.2 var(--sans); color: var(--ink-soft); pointer-events: none; transition: opacity 400ms ease; }
.es-b .hero__draw[data-hint].is-live::after { content: attr(data-hint); top: 18px; right: auto; left: 50%; transform: translateX(-50%); z-index: 5; white-space: nowrap; }
.story__hint { bottom: 14px; }
.has-turned .es-b .hero__draw[data-hint]::after, .has-turned .story__hint { opacity: 0; }
@media (max-width: 760px) { .es-b .hero__draw[data-hint].is-live::after { top: auto; bottom: 64px; } }

/* ---------- 2. home: one project, step by step ---------- */
.es-b .scene-bg { transition: opacity 500ms ease; }
.story-on .es-b .scene-bg { opacity: 0; }
.story__grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: clamp(24px, 4.5vw, 72px); align-items: start; }
.story__stage { display: none; }
.story__stage.is-live { display: block; position: sticky; top: calc(var(--top-h) + 20px); height: min(calc(100vh - var(--top-h) - 40px), 700px); border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; background: var(--sheet); }
.story__view { position: absolute; inset: 0; }
.story__now { position: absolute; left: 16px; top: 14px; margin: 0; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(11, 14, 18, .84); font: 600 13px/1.2 var(--sans); color: var(--ink); white-space: pre; pointer-events: none; font-variant-numeric: tabular-nums; }
.story__steps { list-style: none; margin: 0; padding: 0; counter-reset: st; }
.story__step { counter-increment: st; display: grid; align-content: center; gap: 14px; padding: 28px 0; border-top: 1px solid var(--line); }
.story__name { margin: 0; font: 600 clamp(34px, 4.2vw, 62px)/1 var(--display); letter-spacing: -0.03em; }
.story__name::before { content: counter(st); display: block; margin-bottom: 12px; font: 700 15px/1 var(--sans); letter-spacing: 0; color: var(--tungsten); font-variant-numeric: tabular-nums; }
.story__text { margin: 0; max-width: 38ch; font-size: clamp(17px, 1.35vw, 20px); line-height: 1.5; color: var(--ink-soft); }
.story__apps { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.story__apps a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 15px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(11, 14, 18, .9); color: var(--ink); text-decoration: none; font: 600 14px/1 var(--sans); transition: border-color var(--d-fast) ease, color var(--d-fast) ease; }
.story__apps a:hover { border-color: var(--tungsten); color: var(--tungsten); }
.story__apps a:focus-visible, .story__all:focus-visible { outline: 2px solid var(--tungsten); outline-offset: 2px; }
.story__all { justify-self: start; margin-top: 4px; font: 600 15px/1.3 var(--sans); color: var(--tungsten); text-underline-offset: 4px; }
/* with the building in view: each step is a screen of its own, and the one being read is lit */
.story__stage.is-live + .story__steps .story__step { min-height: 66vh; border-top: 0; opacity: .34; transition: opacity 450ms ease; }
.story__stage.is-live + .story__steps .story__step.is-on { opacity: 1; }
.story__stage.is-live + .story__steps .story__step:last-child { min-height: 78vh; }
/* without it (no script, or reduced motion): a plain list across the page */
.story__stage:not(.is-live) + .story__steps { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 0 40px; }
.story__stage:not(.is-live) + .story__steps .story__name { font-size: clamp(28px, 2.6vw, 38px); }
@media (max-width: 900px) {
  .story__grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .story__stage.is-live { top: var(--top-h); height: 44vh; min-height: 260px; z-index: 3; border-radius: var(--r-xs); }
  .story__stage.is-live + .story__steps .story__step { min-height: 54vh; align-content: start; padding-top: 34px; }
  .story__stage.is-live + .story__steps .story__step:last-child { min-height: 50vh; }
  .story__hint { display: none; }
}

/* ---------- 3. category heads: the live building instead of the drawing ---------- */
.es-b .chead__draw.is-live { padding: 0; overflow: hidden; }
.es-b .chead__draw.is-live .art { visibility: hidden; }

/* ---------- 4. the picture of a card becomes the picture of its product page ---------- */
@media (prefers-reduced-motion: no-preference) {
  .es-b .p-photo img { view-transition-name: es-shot; }
  ::view-transition-group(es-shot) { animation-duration: 460ms; animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1); }
  ::view-transition-old(es-shot), ::view-transition-new(es-shot) { height: 100%; object-fit: cover; }
}

/* ---------- 5. every page: the model turns behind it, at the right edge, dimmer than on the home page ---------- */
/* 100vh: the address bar of a phone does not resize it while the page scrolls; fade and dimming: --bg-fade / --bg-alpha (home.css, scene.js) */
.es-b .scene-bg { position: fixed; inset: 0; width: 100%; height: 100vh; z-index: -1; pointer-events: none; --bg-fade: 1.2 .9 .6 .5 .46; }
.scene-page .es-b .scene-bg { --bg-alpha: .55; --bg-fade: .6 .85 .88 .48 .35; }
@media (max-width: 760px) { .scene-page .es-b .scene-bg { --bg-alpha: .32; --bg-fade: none; } }
.scene-page .sec__head, .scene-page .page-head .wrap { isolation: isolate; position: relative; }
.scene-page .sec__head p, .scene-page .sec__head .h2, .scene-page .page-head h1, .scene-page .page-head p, .scene-page .prose, .scene-page .post__title, .scene-page .post__lead { text-shadow: 0 0 3px #0B0E12, 0 0 10px #0B0E12, 0 0 22px #0B0E12; }
/* a product without a picture: the live model, in the state of its category, fills the head */
.es-b .p-stage .stage__render.is-live { inset: 0; }
.es-b .stage__render.is-live::before { display: none; }
.es-b .stage__render.is-live .art { visibility: hidden; }

/* ---------- builder: the client's own sections (inc/builder.php) ---------- */
.htext .sec__head .btn { margin-top: 18px; }
.hcta__band { position: relative; isolation: isolate; overflow: hidden; border: 1px solid var(--tungsten-line); border-radius: 14px; padding: clamp(28px, 5vw, 64px); background: linear-gradient(120deg, var(--surface-2), var(--surface) 60%); }
.hcta__band::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 32px 32px; }
.hcta__band .h2 { max-width: 22ch; }
.hcta__band p { max-width: 62ch; color: var(--ink-soft); }
.hcta__band .btn { margin-top: 22px; }
