/* DENIM BY47 in 3D (V18): the sticky stage, the steps and the labels pinned to the parts.
   Markup and API: V18-notes/device/DEVICE.md. Colours follow the site tokens (v17.css). */
.d3 { --d3-step: 88vh; position: relative; height: calc(var(--d3-step) * 8.7 + 100vh); }
/* V22 (the owner: on a phone, when the address bar hides, a strip opens at the bottom): the stage is the LARGE viewport (100lvh)
   - it never changes size while the browser's bars come and go (no canvas resize, no hole); what must stay in sight (the step
   card, the step's middle) is moved by the bars' height (100lvh - 100dvh), which is 0 on computers. */
.d3 { --d3-bars: 0px; }
@supports (height: 100dvh) { .d3 { --d3-bars: calc(100lvh - 100dvh); } }
.d3__stage { position: sticky; top: 0; height: 100vh; height: 100lvh; overflow: hidden; }
.d3__cv { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; cursor: grab; -webkit-tap-highlight-color: transparent; user-select: none; }
.d3__cv:active { cursor: grabbing; }
.d3__frame { position: absolute; left: 35%; top: 10%; width: 62%; height: 82%; pointer-events: none; }
.d3__still { display: none; }

/* V22: the story is longer than 8.7 steps of scroll (denim3d.js SW: HQ joins BYPASS, the tools read four at a time) */
.d3[data-denim3d] { --d3-len: 10; height: calc(var(--d3-step) * var(--d3-len) + 100vh + var(--d3-lead, 0px)); }

/* V22 liquid glass (the owner: "в стиле Liquid Glass, как у нас в менюшке внутри плагина"): DENIM 1.1.0's BY47 menu
   (MenuSheet.cpp: dark glass 0.60 -> 0.78, a soft light from the top-left, a breath of red bottom-right, a thin light rim,
   corners 24) for what sits on the device; the same glass made light and matte for what sits on the light page.
   The tokens (--glass-*) live in assets/v22.css (:root, one set for the whole site; the shell lifted them there in V22).
   denim/index.html loads v22.css; without it the cards fall back to no glass (plain text over the board). */

/* the steps: one at a time, beside the device (V22: light matte glass) */
.d3__steps { position: absolute; z-index: 3; left: max(24px, 5vw); top: calc(50% - var(--d3-bars) / 2); width: min(31vw, 430px); margin: 0; padding: 0; list-style: none; pointer-events: none; }
/* the blur only on what is shown (and until it has faded out): 34 hidden panes with a backdrop filter cost frames for nothing */
.d3__step { position: absolute; left: 0; right: 0; top: 0; transform: translateY(-50%) translateY(16px); opacity: 0; transition: opacity .32s ease, transform .5s cubic-bezier(.2, .7, .2, 1), -webkit-backdrop-filter 0s .36s, backdrop-filter 0s .36s; pointer-events: none; padding: 24px 26px 26px; border-radius: var(--glass-r); background: var(--glass-light-hi), var(--glass-light); box-shadow: var(--glass-light-rim), var(--glass-shadow); }
.d3__step.is-on { opacity: 1; transform: translateY(-50%); pointer-events: auto; -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); transition: opacity .32s ease, transform .5s cubic-bezier(.2, .7, .2, 1); }
/* warm-up (denim3d.js warm()): one dark card, one light card and a label drawn at 2 % for 1.2 s after the device is ready */
.d3 .d3__step.d3-warm:not(.is-on) { opacity: .02; transition: none; -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.d3 .d3-tag.d3-warm:not(.is-on) { opacity: .02; transition: none; }
/* close-ups (knobs, valve, BYPASS / HQ, presets): the card lies on the device itself - DENIM's own dark glass, as its menu */
.d3__step[data-glass="dark"] { background: var(--glass-dark-hi), var(--glass-dark); box-shadow: var(--glass-dark-rim), 0 22px 44px -24px rgba(0, 0, 0, .7); }
.d3__step[data-glass="dark"] .d3__h { color: var(--glass-dark-ink); }
.d3__step[data-glass="dark"] .d3__p { color: var(--glass-dark-mute); }
.d3__step[data-glass="dark"] .d3__p b, .d3__step[data-glass="dark"] .d3__phs { color: var(--glass-dark-ink); }
.d3__step[data-glass="dark"] .d3__no { color: rgba(243, 241, 238, .55); }
.d3.d3--noblur .d3__step[data-glass="dark"] { background: var(--glass-dark-hi), var(--glass-dark-solid); }
/* the tools' card: its line changes with the group in front (data-r, denim3d.js) - stacked, so the card never changes size */
.d3__phs.d3__live { display: grid; margin: 10px 0 0; font: 700 15.5px/1.45 Montserrat, system-ui, sans-serif; color: var(--ink, #111); }
.d3__ph { grid-area: 1 / 1; opacity: 0; transform: translateY(6px); transition: opacity .28s ease, transform .4s cubic-bezier(.2, .7, .2, 1); }
.d3__ph.is-on { opacity: 1; transform: none; }
/* no blur where the browser has none, or where the device is busy (denim3d.js: .d3--noblur): the same glass, denser */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .d3 .d3__step { background: var(--glass-light-hi), var(--glass-light-solid); } .d3 .d3-tag__t { background: var(--glass-dark-hi), var(--glass-dark-solid); } }
.d3.d3--noblur .d3__step { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--glass-light-hi), var(--glass-light-solid); }
.d3.d3--noblur .d3-tag__t, .d3.d3--noblur .d3-tag.is-on[data-v="1"] .d3-tag__t { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--glass-dark-hi), var(--glass-dark-solid); }
.d3__no { margin: 0 0 10px; font: 700 10.5px/1.6 Montserrat, system-ui, sans-serif; letter-spacing: .16em; text-transform: uppercase; color: var(--muted, #5e5e5e); font-variant-numeric: tabular-nums; }
.d3__no b { color: var(--red, #D9202C); font-weight: 700; }
.d3__h { margin: 0 0 14px; font-family: var(--rough, "BY47 Rough", Montserrat, sans-serif); font-weight: 900; font-size: clamp(36px, 3.7vw, 62px); line-height: .92; letter-spacing: -.01em; color: var(--ink, #111); }
.d3__p { margin: 0; max-width: 25em; font: 500 15.5px/1.5 Montserrat, system-ui, sans-serif; color: var(--ink-2, #2a2a2a); }
.d3__p b { font-weight: 700; color: var(--ink, #111); }
.d3__list { margin: 14px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px 8px; font: 700 10.5px/1.3 Montserrat, system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2, #2a2a2a); }
.d3__list li { padding: 5px 8px; border: 1px solid var(--line-2, rgba(17,17,17,.24)); border-radius: 3px; }
.d3__again { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; }
.d3__again a:not(.btn) { font: 700 12px/1.4 Montserrat, system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--ink, #111); }
.d3__live { display: inline; } .d3__rm { display: none; }
.d3__hint { margin: 16px 0 0; font: 700 10px/1.5 Montserrat, system-ui, sans-serif; letter-spacing: .16em; text-transform: uppercase; color: var(--faint, #8a8a8a); }

/* labels pinned to 3D points (the worker sends where each point is) */
.d3__tags { position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.d3-tag { position: absolute; left: 0; top: 0; opacity: 0; transition: opacity .28s ease; will-change: transform; color: var(--ink, #111); }
.d3-tag.is-on[data-v="1"] { opacity: 1; }
/* (no blur under the labels: they lie on the dark device, where a blur shows nothing, and a blurred pane costs ~45 ms the
   first time it shows - measured, V22-notes/device/DEVICE-V22.md; their glass is the rim, the light and the red breath) */
/* V23 (owner 2026-10-23: the labels covered the parts): only a numbered pin sits on the device; its name and line are in the step
   card, after the same number (.d3-k). The pin is the size the old dot + rings had (18 px), so it hides no more of a part than before. */
.d3-tag__dot { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%; background: var(--red, #D9202C); color: #fff; font: 700 10.5px/18px Montserrat, system-ui, sans-serif; font-style: normal; text-align: center; letter-spacing: 0; font-variant-numeric: tabular-nums; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .92), 0 3px 8px -2px rgba(0, 0, 0, .55); transition: transform .22s cubic-bezier(.2, .7, .2, 1), box-shadow .22s ease; }
.d3-tag__dot::after { content: ""; position: absolute; inset: -1.5px; border-radius: 50%; box-shadow: 0 0 0 1.5px rgba(217, 32, 44, .7); opacity: 0; pointer-events: none; }
.d3-tag.is-on[data-v="1"] .d3-tag__dot::after { animation: d3-ping 1.5s cubic-bezier(.2, .7, .2, 1) .15s 1; }
.d3-tag.is-hot .d3-tag__dot { transform: scale(1.3); box-shadow: 0 0 0 2px #fff, 0 0 0 5px rgba(217, 32, 44, .35), 0 3px 8px -2px rgba(0, 0, 0, .55); }
@keyframes d3-ping { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(2.2); } }
.d3[data-d3-lay="land"] .d3-tag__dot, .d3[data-d3-lay="port"] .d3-tag__dot { left: -8px; top: -8px; width: 16px; height: 16px; font-size: 9.5px; line-height: 16px; }
/* the same number in the card, before the part's name; hovering or tapping it lights the pin (denim3d.js) */
.d3-k { white-space: nowrap; }
.d3-k > i { display: inline-block; width: 1.42em; height: 1.42em; margin: 0 .38em 0 0; border-radius: 50%; background: var(--red, #D9202C); color: #fff; font: 700 .66em/1.42em Montserrat, system-ui, sans-serif; font-style: normal; text-align: center; letter-spacing: 0; vertical-align: .14em; margin-left: .12em; font-variant-numeric: tabular-nums; box-shadow: 0 0 0 1px rgba(255, 255, 255, .6); }
.d3__step.is-on .d3-k { cursor: default; }
/* the tools' card: the four tools in front, one row each (stacked groups, so the card never changes size) */
.d3__phs.d3__live { font-weight: 500; }
.d3__ph { display: flex; flex-direction: column; gap: 3px; }
.d3-kl { display: block; font: 500 14.5px/1.4 Montserrat, system-ui, sans-serif; color: var(--ink-2, #2a2a2a); }
.d3-kl .d3-k { font-weight: 700; color: var(--ink, #111); }
.d3[data-d3-lay="port"] .d3-kl { font-size: 13.5px; }
.d3[data-d3-lay="land"] .d3-kl { font-size: 12px; line-height: 1.35; }
.d3[data-d3-lay="land"] .d3__phs.d3__live { margin-top: 6px; }
/* an upright phone: the card covers less of the board - the bands in two short rows, a tighter card on short screens */
.d3[data-d3-lay="port"] .d3__list { margin-top: 10px; gap: 4px 5px; font-size: 9.5px; letter-spacing: .06em; }
.d3[data-d3-lay="port"] .d3__list li { padding: 3px 6px; }
@media (max-height: 800px) {
  .d3[data-d3-lay="port"] .d3__step { padding: 14px 16px 15px; }
  .d3[data-d3-lay="port"] .d3__h { font-size: clamp(26px, 7.6vw, 32px); margin-bottom: 8px; }
  .d3[data-d3-lay="port"] .d3__p { font-size: 14px; line-height: 1.42; }
  .d3[data-d3-lay="port"] .d3__no { margin-bottom: 4px; }
}
/* still picture / no WebGL: there are no pins, so no numbers either */
.d3[class].d3--still .d3-k > i, .d3[class].d3--off .d3-k > i { display: none; }
.d3-tag__ln { position: absolute; left: 0; top: 0; width: 30px; height: 1px; background: rgba(243, 241, 238, .8); box-shadow: 0 0 0 .5px rgba(17, 17, 17, .45); transform-origin: 0 0; }
/* V22: the labels on the device - DENIM's own dark glass */
.d3-tag__t { position: absolute; left: 30px; top: 0; transform: translateY(-50%); white-space: nowrap; padding: 7px 12px 8px; border-radius: var(--glass-r-sm); background: var(--glass-dark-hi), var(--glass-dark-tag); box-shadow: var(--glass-dark-rim), 0 10px 22px -12px rgba(0, 0, 0, .6); font: 700 11px/1.25 Montserrat, system-ui, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--glass-dark-ink); }
.d3-tag__t small { display: block; margin-top: 2px; font: 500 12.5px/1.25 Montserrat, system-ui, sans-serif; letter-spacing: 0; text-transform: none; color: var(--glass-dark-mute); }
.d3-tag[data-side="l"] .d3-tag__ln { transform: scaleX(-1); }
.d3-tag[data-side="l"] .d3-tag__t { left: auto; right: 30px; text-align: right; }
.d3-tag[data-side="u"] .d3-tag__ln { width: 1px; height: 26px; top: -26px; }
.d3-tag[data-side="u"] .d3-tag__t { left: 0; top: -26px; transform: translate(calc(-50% + var(--sx, 0px)), -100%); text-align: center; }
.d3-tag[data-side="d"] .d3-tag__ln { width: 1px; height: 26px; }
.d3-tag[data-side="d"] .d3-tag__t { left: 0; top: 26px; transform: translate(calc(-50% + var(--sx, 0px)), 0); text-align: center; }

/* phone, upright: the device on top, the step under it */
.d3[data-d3-lay="port"] { --d3-step: 78vh; }
.d3[data-d3-lay="port"] .d3__frame { left: 3%; top: 9%; width: 94%; height: 63%; }
.d3[data-d3-lay="port"] .d3__steps { left: 16px; right: 16px; width: auto; top: auto; bottom: calc(18px + env(safe-area-inset-bottom, 0px) + var(--d3-bars)); }
.d3[data-d3-lay="port"] .d3__step { top: auto; bottom: 0; transform: translateY(14px); padding: 16px 18px 18px; }
.d3[data-d3-lay="port"] .d3__step.is-on { transform: none; }
.d3[data-d3-lay="port"] .d3__h { font-size: clamp(30px, 8.6vw, 40px); margin-bottom: 10px; }
.d3[data-d3-lay="port"] .d3__p { font-size: 14.5px; line-height: 1.45; }
.d3[data-d3-lay="port"] .d3__no { margin-bottom: 6px; }
.d3[data-d3-lay="port"] .d3-tag__t { padding: 5px 7px; font-size: 11px; }
.d3[data-d3-lay="port"] .d3-tag__t small { font-size: 12px; }
.d3[data-d3-lay="port"] .d3-tag__ln { width: 18px; }
.d3[data-d3-lay="port"] .d3-tag__t { left: 18px; }
.d3[data-d3-lay="port"] .d3-tag[data-side="l"] .d3-tag__t { left: auto; right: 18px; }
.d3[data-d3-lay="port"] .d3-tag[data-side="u"] .d3-tag__t, .d3[data-d3-lay="port"] .d3-tag[data-side="d"] .d3-tag__t { left: 0; }
/* V22: above / below on a phone - a short upright line (the 18 px width above made it a white block) */
.d3[data-d3-lay="port"] .d3-tag[data-side="u"] .d3-tag__ln { width: 1px; height: 18px; top: -18px; }
.d3[data-d3-lay="port"] .d3-tag[data-side="d"] .d3-tag__ln { width: 1px; height: 18px; }
.d3[data-d3-lay="port"] .d3-tag[data-side="u"] .d3-tag__t { top: -18px; }
.d3[data-d3-lay="port"] .d3-tag[data-side="d"] .d3-tag__t { top: 18px; }
.d3[data-d3-lay="port"] .d3__hint { display: none; }
/* phone, sideways: the step on the left, the device on the right */
.d3[data-d3-lay="land"] { --d3-step: 92vh; }
.d3[data-d3-lay="land"] .d3__frame { left: 37%; top: calc(var(--head-h, 52px) + 6px); width: 61%; height: calc(95% - var(--head-h, 52px) - 6px); }   /* V22: below the header (it hid the top of the tools' column) */
.d3[data-d3-lay="land"] .d3__steps { left: max(16px, env(safe-area-inset-left, 0px)); width: 33vw; }
.d3[data-d3-lay="land"] .d3__h { font-size: clamp(24px, 3.6vw, 34px); margin-bottom: 8px; }
.d3[data-d3-lay="land"] .d3__p { font-size: 13px; line-height: 1.4; }
.d3[data-d3-lay="land"] .d3__no { margin-bottom: 4px; }
.d3[data-d3-lay="land"] .d3__step { padding: 12px 14px 14px; }
.d3[data-d3-lay="land"] .d3__list { margin-top: 8px; gap: 4px 5px; font-size: 9px; }
.d3[data-d3-lay="land"] .d3__list li { padding: 3px 5px; }
.d3[data-d3-lay="land"] .d3-tag__t { padding: 4px 6px; font-size: 9px; }
.d3[data-d3-lay="land"] .d3-tag__t small { font-size: 11px; }
.d3[data-d3-lay="land"] .d3__hint { display: none; }
.d3[data-d3-lay="land"] .d3__again { margin-top: 10px; }

/* still: no scroll story, the device assembled, every step as a list */
.d3[class].d3[class].d3--still { height: auto; }
.d3[class].d3--still .d3__stage { position: relative; height: auto; overflow: visible; padding-top: max(360px, min(72vh, 640px)); }
.d3[class].d3--still .d3__cv { height: max(360px, min(72vh, 640px)); }
.d3[class].d3--still .d3__frame { left: 4%; top: 8px; width: 92%; height: calc(max(360px, min(72vh, 640px)) * .94); }
.d3[class].d3--still .d3__steps, .d3[class].d3--off .d3__steps { position: static; width: auto; max-width: 1100px; margin: 24px auto 0; padding: 0 max(16px, 4vw); display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 28px 32px; pointer-events: auto; }
.d3[class].d3--still .d3__step, .d3[class].d3--off .d3__step { position: static; opacity: 1; transform: none; pointer-events: auto; padding: 0; background: none; box-shadow: none; border-radius: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
.d3[class].d3--still .d3__h, .d3[class].d3--off .d3__h { font-size: clamp(26px, 2.4vw, 36px); color: var(--ink, #111); }
.d3[class].d3--still .d3__p, .d3[class].d3--off .d3__p { color: var(--ink-2, #2a2a2a); }
.d3[class].d3--still .d3__p b, .d3[class].d3--off .d3__p b { color: var(--ink, #111); }
.d3[class].d3--still .d3__no, .d3[class].d3--off .d3__no { color: var(--muted, #5e5e5e); }
.d3[class].d3--still .d3__live, .d3[class].d3--off .d3__live, .d3[class].d3--still .d3__hint, .d3[class].d3--off .d3__hint { display: none; }
.d3[class].d3--still .d3__rm, .d3[class].d3--off .d3__rm { display: inline; }
.d3[class].d3--still .d3__tags, .d3[class].d3--off .d3__tags { display: none; }
.d3[class].d3--still[data-d3-lay="port"] .d3__stage { padding-top: max(300px, 52vh); }
.d3[class].d3--still[data-d3-lay="port"] .d3__cv { height: max(300px, 52vh); }
.d3[class].d3--still[data-d3-lay="port"] .d3__frame { height: calc(max(300px, 52vh) * .94); }
/* no 3D at all: the window as a picture */
.d3[class].d3[class].d3--off { height: auto; }
.d3[class].d3--off .d3__stage { position: relative; height: auto; overflow: visible; padding: 24px max(16px, 4vw) 0; }
.d3[class].d3--off .d3__frame, .d3[class].d3--off .d3__cv { display: none; }
.d3[class].d3--off .d3__still { display: block; max-width: 1100px; margin: 0 auto; }
.d3[class].d3--off .d3__still img { display: block; width: 100%; height: auto; border-radius: 10px; box-shadow: 0 1px 0 rgba(17,17,17,.05), 0 18px 34px -22px rgba(17,17,17,.5); }
/* the device fades in on its first frame (the section sits below the fold, so it is ready long before) */
.d3__cv { opacity: 0; transition: opacity .6s ease; }
.d3--live .d3__cv { opacity: 1; }
/* with no script at all the page adds <noscript><style>.d3{height:auto}…</style></noscript> (see DEVICE.md) */
@media (prefers-reduced-motion: reduce) { .d3__step, .d3-tag { transition: none; } }
@media print { .d3 { height: auto; } .d3__stage { position: static; height: auto; } .d3__cv, .d3__tags { display: none; } .d3__still { display: block !important; position: static !important; width: 100% !important; } .d3__steps { position: static; width: auto; } .d3__step { position: static; opacity: 1; transform: none; margin-bottom: 18px; } }
