/* ================= product page ================= */
/* desktop: the story on the left, the jar pinned on the right; phones: the jar pinned on top, the story slides under it */
.p-top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); column-gap: clamp(24px, 4vw, 72px); padding: 0 var(--gutter); }
.p-col { grid-column: 1; grid-row: 1; padding-top: 17vh; }
.p-stage { grid-column: 2; grid-row: 1; position: sticky; top: 0; height: 100vh; height: 100svh; align-self: start;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--pc) 24%, transparent), transparent) 50% 56% / 92% 82% no-repeat; }
.p-stage canvas { width: 100%; height: 100%; display: block; touch-action: pan-y; cursor: grab; opacity: 0; transition: opacity .45s ease; }
.p-stage canvas.ready { opacity: 1; }   /* product.js: once the label texture is loaded — no white label flash */
.p-stage canvas:active { cursor: grabbing; }
.p-hint { position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%); font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: .16em; color: var(--muted);
  pointer-events: none; transition: opacity .5s ease; white-space: nowrap; }
.p-hint span { color: var(--pc); }
.p-hint.gone { opacity: 0; }

.p-hero { min-height: 83vh; }
.p-hero .h-m { font-size: clamp(44px, 4.8vw, 76px); }
.p-to { font-size: 19px; line-height: 1.5; color: var(--body); margin-top: 20px; max-width: 26em; text-wrap: pretty; }
.p-buy { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); max-width: 31em; }
.p-price { display: flex; align-items: baseline; gap: 14px; }
.p-price .now { font-family: 'Oswald', sans-serif; font-weight: 600; font-size: clamp(40px, 3.4vw, 52px); line-height: 1; }
.p-price s { color: var(--muted); font-size: 15px; }
.p-price .per { margin-left: auto; font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: .1em; color: var(--muted); }
.p-actions { display: flex; gap: 10px; margin-top: 20px; }
.p-actions .stepper { margin: 0; height: 56px; }
.p-actions .stepper button { height: 54px; width: 46px; }
.stepper.zero { display: none; }
.p-add { flex: 1; min-height: 56px; }
.p-add.in { background: var(--text); }
.p-ship { font-size: 13px; color: var(--muted); margin-top: 14px; }
.p-buy .link { display: inline-block; margin-top: 18px; font-size: 11px; }

.p-beat { min-height: 78vh; display: flex; flex-direction: column; justify-content: center; }
#open { min-height: 118vh; justify-content: flex-start; padding-top: 30vh; }   /* room for the jar to open while this is on screen */
/* "what's inside": a long beat; its text stays put while the jar opens and one capsule comes apart */
.p-inside, .p-inside#open { display: block; min-height: 280vh; padding-top: 0; }   /* long: the unboxing should breathe */
.p-inside-in { position: sticky; top: 26vh; }
.p-from { display: block; font-family: 'Manrope', sans-serif; font-weight: 400; font-size: 15px; color: var(--muted); margin-top: 6px; }
.dose { list-style: none; margin-top: 22px; max-width: 30em; border-top: 1px solid var(--line); }
.dose li { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 16px; row-gap: 8px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.dose-n { font-size: 16px; color: var(--body); }
.dose b { font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 22px; line-height: 1; justify-self: end; }
.dose-bar { grid-column: 1; height: 3px; background: #222; align-self: center; overflow: hidden; }
.dose-bar i { display: block; height: 100%; width: var(--v); transform-origin: left; transform: scaleX(0); transition: transform 1.2s cubic-bezier(.23,1,.32,1) .3s; }
.rv.in .dose-bar i { transform: none; }
.dose-p { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: .08em; color: var(--muted); justify-self: end; }
.dose-note { font-size: 12px; color: #77736C; margin-top: 12px; }
/* "why it works" on the product page: a few sentences — body type, larger than the rest (in the display face it was a wall) */
.p-why { font-size: 20px; line-height: 1.6; color: var(--text); margin-top: 6px; max-width: 30em; text-wrap: pretty; }
@media (max-width: 860px) { .p-why { font-size: 17px; } }
.p-cap { font-size: 17px; line-height: 1.5; color: var(--body); margin-top: 14px; max-width: 24em; text-wrap: pretty; }
/* tags over the piles in the 3D scene: name, amount, share of the daily norm; a hairline down to the pile */
/* the tags may reach out of the stage (into the text column, past its edges) — they must not be cut there. A tag waiting off
   screen must not widen the page either: that is clipped on the page itself (body), not on the stage */
.pile-tags { position: absolute; inset: 0; pointer-events: none; }
body { overflow-x: clip; }
.pile-tag { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; opacity: 0; white-space: nowrap; will-change: transform, opacity; }
.pile-tag::before { content: ''; width: 1px; height: 14px; margin-bottom: 6px; background: linear-gradient(transparent, var(--pc)); }
/* a tag over a thing (the dose quarter of a tablet, the scoop): the hairline goes down to it */
.pile-tag.above::before { display: none; }
.pile-tag.above::after { content: ''; width: 1px; height: 16px; margin-top: 6px; background: linear-gradient(var(--pc), transparent); }
/* a tag beside a thing: left-aligned, a short horizontal hairline pointing back at it */
.pile-tag.side { align-items: flex-start; padding-left: 30px; }
.pile-tag.side::before { position: absolute; left: 0; top: 14px; width: 24px; height: 1px; margin: 0; background: linear-gradient(90deg, transparent, var(--pc)); }   /* level with the middle of the title */
/* the same on the other side: right-aligned, the hairline points right, back at the thing */
.pile-tag.left { align-items: flex-end; padding-right: 30px; text-align: right; }
.pile-tag.left::before { position: absolute; right: 0; top: 14px; width: 24px; height: 1px; margin: 0; background: linear-gradient(90deg, var(--pc), transparent); }
/* the helix (ZMA ?pour=e): four tags around one figure, each in its own colour — smaller titles, the role on a second line */
.pile-tag.hx b { font-size: 21px; color: var(--pc); white-space: normal; max-width: 172px; }
.pile-tag.hx small { white-space: normal; max-width: 172px; line-height: 1.3; }
.pile-tag.hx.above, .pile-tag.hx:not(.side):not(.left) { text-align: center; }
.pile-tag.hx.side::before, .pile-tag.hx.left::before { top: 10px; }
.pile-tag { gap: 4px; }
.pile-tag b { font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 28px; line-height: 1; text-transform: uppercase; }
.pile-tag span { font-family: 'JetBrains Mono', monospace; font-size: 13px; letter-spacing: .06em; color: var(--body); }
.pile-tag em { font-style: normal; color: var(--pc); }
.pile-tag small { font-family: 'Manrope', sans-serif; font-size: 13px; color: var(--muted); }
@media (max-width: 860px), (max-aspect-ratio: 9/10) {
  .pile-tag b { font-size: 21px; } .pile-tag span { font-size: 11.5px; } .pile-tag small { display: none; }
  .pile-tag.side { padding-left: 24px; } .pile-tag.side::before { top: 10px; width: 18px; }
  .pile-tag.left { padding-right: 24px; } .pile-tag.left::before { top: 10px; width: 18px; }
  .pile-tag.hx b { font-size: 15px; max-width: 112px; } .pile-tag.hx.side::before, .pile-tag.hx.left::before { top: 8px; }
  .pile-tag.hx small { display: block; font-size: 10.5px; max-width: 104px; }   /* on the helix the role is the point: kept on phones */
}
/* a vitamin's name right at its molecule (B-Complex): no hairline, small, in its colour */
.pile-tag.mini::before { display: none; }
.pile-tag.mini b { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--pc); }
@media (max-width: 860px), (max-aspect-ratio: 9/10) { .pile-tag.mini b { font-size: 10.5px; } }
/* B-Complex on a phone: the group tags as a legend under the wheel — no hairline, no percentages (they are in the list) */
.pile-tag.legend::before, .pile-tag.legend::after { display: none; }
.pile-tag.legend span { display: none; }
.pile-tag.legend b, .pile-tag.legend small { max-width: none; white-space: nowrap; }
.pile-tag.legend { flex-direction: row; align-items: baseline; gap: 8px; }   /* one row: «B1 · B5  Еда превращается в энергию» */
/* long formulas (B-Complex: nine vitamins) — tiles, three in a row, so the list fits beside / under the jar */
.dose-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; border-top: 0; }
.dose-grid li { grid-template-columns: 1fr auto; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 0; row-gap: 6px; }
.dose-grid .dose-n { font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: .06em; color: #B5B1A9; }
.dose-grid b { font-size: 16px; grid-column: 1 / -1; grid-row: 2; justify-self: start; }
.dose-grid .dose-p { grid-column: 2; grid-row: 1; }
.dose-grid .dose-bar { grid-column: 1 / -1; grid-row: 3; }
.p-big { font-family: 'Oswald', sans-serif; font-weight: 500; font-size: clamp(26px, 2.3vw, 38px); line-height: 1.25; max-width: 17em; text-wrap: pretty; }
.p-beat .res { display: grid; max-width: 30em; }
.p-beat .res .to { font-size: clamp(22px, 1.9vw, 30px); }
.p-sub { font-size: 16px; color: var(--muted); margin-top: 16px; }

/* what's inside */
.facts-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(28px, 4vw, 72px); max-width: 1320px; align-items: start; }
/* the label files have a hairline of white at their edges: always a little zoomed in, on a dark ground, so it never shows */
.f-label-img { display: block; width: 100%; padding: 0; border: 1px solid #222; background: #0A0A0A; cursor: zoom-in; overflow: hidden; }
.f-label-img img { display: block; width: 100%; height: auto; transform: scale(1.025); transition: transform .6s cubic-bezier(.23,1,.32,1); }
.f-label-img:hover img { transform: scale(1.05); }
.f-label figcaption { font-size: 13px; color: var(--muted); margin-top: 12px; }
.f-list { border-top: 1px solid var(--line); }
.f-item { padding: 22px 0; border-bottom: 1px solid var(--line); }
.f-item .n { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: .14em; color: var(--muted); }
.f-item p { font-size: 16px; line-height: 1.55; color: var(--body); margin-top: 8px; text-wrap: pretty; }
.f-item .link { display: inline-block; margin-top: 12px; font-size: 11px; }
.f-dots { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.f-dots a { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 12px; border: 1px solid #333; font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: .08em; }
.f-dots a:hover { border-color: var(--text); }
.f-dots i { width: 7px; height: 7px; border-radius: 50%; }

.p-revs .txt { columns: 3; }

/* the rest of the shelf */
/* a lighter cousin of the home line-up: the jar peeks over the card's top edge (right), lifts and glows in its colour on
   hover; on a phone the card in the middle of the row gets the same (.on, product-page.js). A note says how the jar goes
   with the one on this page: combo (its colour) or overlap (muted) */
.shelf { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; max-width: 1320px; padding-top: 42px; }
.shelf li { display: flex; flex-direction: column; }
.shelf-card { position: relative; flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 24px 22px; background: #101010; border: 1px solid #1C1C1C;
  transition: border-color .25s ease, transform .3s cubic-bezier(.23,1,.32,1), background-color .3s ease; }
.shelf-card::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .35s ease;
  background: radial-gradient(70% 60% at 85% 0%, color-mix(in srgb, var(--oc) 16%, transparent), transparent 70%); }
/* no filter on the jar (15.10): Safari cut its drop-shadow glow off at the picture's box — a straight bright edge above the
   jar on every card. The colour now lives only inside the card (::before) */
.shelf-jar { position: absolute; right: 8px; top: -42px; height: 124px; width: auto; pointer-events: none; transition: transform .4s cubic-bezier(.23,1,.32,1); }
.shelf-card:hover, .shelf-card.on { border-color: var(--oc); transform: translateY(-3px); }
.shelf-card:hover::before, .shelf-card.on::before { opacity: 1; }
.shelf-card:hover .shelf-jar, .shelf-card.on .shelf-jar { transform: translateY(-8px) rotate(-3deg); }
@media (prefers-reduced-motion: reduce) { .shelf-card:hover .shelf-jar, .shelf-card.on .shelf-jar { transform: none; } }
.shelf-card .kick { margin: 0; font-size: 11px; padding-right: 74px; }
/* the headline keeps clear of the jar: the narrow jars take ~60 % of their picture's width, creatine (a wide tub) ~84 % —
   so creatine is drawn smaller, and one padding fits every jar */
.shelf-h { font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 24px; line-height: 1.15; text-transform: uppercase; flex: 1; padding-right: 78px; }
.shelf-card.k-creatine .shelf-jar { height: 100px; top: -30px; }
.shelf-note { position: relative; font-size: 13px; line-height: 1.45; color: var(--body); padding-left: 10px; border-left: 2px solid var(--oc); text-wrap: pretty; }
.shelf-note b { display: block; font-family: 'JetBrains Mono', monospace; font-weight: 500; font-size: 10px; letter-spacing: .12em; color: var(--oc); margin-bottom: 3px; }
.shelf-note .nw { white-space: nowrap; }
.shelf-card.overlap .shelf-note { border-left-color: #3A3A3A; color: var(--muted); }
.shelf-card.overlap .shelf-note b { color: #8E8A82; }
.shelf-p { font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 22px; }
.shelf-p s { font-family: 'Manrope', sans-serif; font-weight: 400; font-size: 13px; color: var(--muted); margin-left: 6px; }
.shelf .add { width: 100%; margin-top: -1px; }

/* the label, full size */
/* the white lines round the label at full size (15.10) were in the label files themselves — a white last column and row,
   cleaned at the source now (tools/render.html, cleanEdges). Dark ground and no frame, so nothing outlines the label */
.zoom { margin: auto; width: min(1500px, 96vw); max-width: 96vw; max-height: 92vh; padding: 0; border: 0; background: #0A0A0A; }
.zoom-hint { display: none; }
.zoom::backdrop { background: rgba(0,0,0,.82); }
.zoom .x { position: absolute; top: 10px; right: 10px; z-index: 2; background: #0A0A0A; }
.zoom-in { overflow: auto; max-height: 92vh; }
.zoom-in img { display: block; width: 100%; min-width: 900px; height: auto; }

/* phones: price bar */
.p-bar { display: none; }

@media (max-width: 860px), (max-aspect-ratio: 9/10) {
  .p-top { grid-template-columns: minmax(0, 1fr); padding: 0; }
  .p-stage { grid-column: 1; grid-row: 1; z-index: 3; height: 52svh; padding-top: 64px; background-color: var(--bg);
    background-image: radial-gradient(closest-side, color-mix(in srgb, var(--pc) 26%, transparent), transparent); background-position: 50% 60%; background-size: 110% 90%;
    box-shadow: 0 18px 24px -6px var(--bg); }
  .p-col { grid-column: 1; grid-row: 2; padding: 26px 20px 0; position: relative; z-index: 1; }
  .p-hero { min-height: 0; padding-bottom: 12svh; }
  .p-back { margin-bottom: 12px; }
  .p-hero .h-m { font-size: clamp(36px, 10.4vw, 56px); }
  .p-to { font-size: 16px; margin-top: 14px; }
  .p-buy { margin-top: 22px; padding-top: 16px; }
  .p-price .now { font-size: 38px; }
  .p-beat { min-height: 56svh; }
  #open { min-height: 100svh; padding-top: 6svh; }
  .p-inside#open { min-height: 260svh; padding-top: 0; }
  .p-inside-in { top: calc(52svh + 12px); }   /* just under the pinned jar */
  .dose li { padding: 10px 0; }
  .dose b { font-size: 19px; }
  .p-big { font-size: 24px; }
  .facts-grid { grid-template-columns: 1fr; }
  .p-revs .txt { columns: auto; }
  .shelf { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; margin: 0 -16px; padding: 54px 16px 6px; scrollbar-width: none; }   /* top: room for the jars inside the scroller */
  .shelf::-webkit-scrollbar { display: none; }
  .shelf li { flex: 0 0 72%; scroll-snap-align: start; scroll-margin-left: 16px; }
  .shelf-h { font-size: 21px; }
  /* phones: the label at a readable size, panned sideways (it scrolls now: data-lenis-prevent); a hint says so */
  .zoom-in img { min-width: 1100px; }
  .zoom-hint { display: block; position: absolute; left: 12px; bottom: 10px; z-index: 2; padding: 6px 10px; background: rgba(10,10,10,.85); pointer-events: none;
    font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: .14em; color: var(--text); }
  .p-bar { display: flex; position: fixed; z-index: 18; left: 0; right: 0; bottom: 0; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(10,10,10,.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid #1F1F1F;
    transform: translateY(105%); transition: transform .4s cubic-bezier(.23,1,.32,1); }
  .p-bar.on { transform: none; }
  .p-bar .now { font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 26px; }
  .p-bar s { font-size: 12px; color: var(--muted); margin-left: 8px; }
  .p-bar .btn { min-height: 48px; }
  .p-bar .btn.in { background: var(--text); }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
}
/* the rendered picture of the jar: while the 3D jar waits for its label, product.js lays it exactly where the camera will
   show the jar (.placed), the canvas fades in over it, then it goes (.gl-ready). No WebGL: it stays, centred */
.p-still { position: absolute; left: 0; top: 0; width: auto; max-width: none; pointer-events: none; opacity: 0; transform-origin: 0 0; transition: opacity .3s ease; }
.p-still.placed { opacity: 1; }
.p-stage.gl-ready .p-still { opacity: 0; transition: opacity .2s ease .45s; }
html.no-gl .p-still { opacity: 1; left: 50%; top: 50%; height: min(72%, 560px); transform: translate(-50%, -50%); }
html.no-gl #gl, html.no-gl .p-hint, html.no-gl .pile-tags { display: none; }
html.no-gl .dose.sr-only { position: static !important; width: auto; height: auto; clip-path: none; white-space: normal; }
html.no-gl .p-inside, html.no-gl .p-inside#open { min-height: 0; }
html.no-gl .p-inside-in { position: static; }

/* recording a reel: nothing but the page itself */
html.rec .nav, html.rec .p-hint, html.rec .p-bar, html.rec .toast, html.rec .grain { display: none !important; }
html.rec .p-stage { padding-top: 0; }
