/* Everwood — магазин: живое дерево.
   Ствол — колонка из настоящей коры в потоке страницы (прокручивается вместе с ней: «спускаемся по стволу»).
   Дерево первого экрана рисует tree.js на холсте поверх колонки; плоды и текст встают по его раскладке.
   --trunk — ширина видимой части ствола, --j — сколько css-пикселей в 100 единицах дерева. */
/* масштаб дерева привязан и к ширине, и к высоте окна — первый экран целиком помещается */
:root { --trunk: clamp(120px, min(10.4vw, 17.4vh), 200px); --j: calc(var(--trunk) / 4.2); }
body { position: relative; }

.barkcol { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--trunk) + var(--j) * 0.11); z-index: 1; pointer-events: none;
  background: url(img/tree/trunk-tile.webp?v=2) repeat-y right top / calc(var(--j) * 5.12) auto; }
/* мягкая тень ствола на странице */
.barkcol::before { content: ''; position: absolute; top: 0; bottom: 0; left: calc(100% - 10px); width: 46px; background: linear-gradient(90deg, rgba(43, 35, 28, .26), rgba(43, 35, 28, 0)); z-index: -1; }
.trunk { position: fixed; left: 0; top: 0; bottom: 0; width: var(--trunk); z-index: 40; pointer-events: none; }
.trunk-nav { right: 0; }
.knot { width: min(96px, 86%); }
.knot span.k { background: rgba(250, 246, 238, .16); border-color: rgba(255, 246, 232, .42); backdrop-filter: blur(7px) saturate(1.2) brightness(1.08); -webkit-backdrop-filter: blur(7px) saturate(1.2) brightness(1.08); }

/* шапка над кроной: пока страница вверху — почти прозрачная, листва просвечивает */
.head { background: rgba(242, 237, 228, .5); }
.head.stuck { background: rgba(242, 237, 228, .9); }

/* ── первый экран ── */
.hero { position: relative; margin-left: var(--trunk); height: var(--tree-h, 760px); overflow: visible; }
.tree-gl { position: absolute; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .9s ease; max-width: none; }
.tree-gl.on { opacity: 1; }
.fruits { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.fruit { position: absolute; pointer-events: auto; animation: pend 7s ease-in-out infinite; transform-origin: 50% 0; will-change: transform; }
.fruit.b { animation-duration: 8.6s; animation-delay: -2s; }
.fruit .stalk { width: 2px; background: linear-gradient(180deg, #2f241a, #56432f); }
.fruit .stalk i { top: -5px; width: 9px; height: 9px; margin-left: -4.5px; background: #2f241a; }
.fruit .disc { background: radial-gradient(circle at 38% 30%, #fdfaf4 0%, #f1ebdf 58%, #e6decf 100%); border: 0;
  box-shadow: 0 0 0 1px rgba(61, 90, 44, .28), 0 0 0 7px rgba(251, 248, 242, .92), 0 0 0 8px rgba(61, 90, 44, .16), 0 34px 54px rgba(43, 35, 28, .2), inset 0 -14px 30px rgba(43, 35, 28, .07); }
.fruit .tag { margin-top: 6px; }
.fruit .tag .cap { color: var(--leaf); letter-spacing: .14em; }
.hero-txt { position: absolute; left: var(--gut); top: 330px; width: 400px; z-index: 3; bottom: auto; }
.hero-txt h1 { font-size: clamp(2.5rem, 3.6vw, 4.4rem); }
.hero-txt p { max-width: 40ch; }

/* телефон: крона сверху, плоды и текст идут ниже обычным потоком */
@media (max-width: 960px) {
  :root { --trunk: 72px; --j: 24px; }
  .barkcol { background-image: url(img/tree/trunk-tile-m.webp?v=2); }
  .hero { height: auto; padding-top: var(--tree-h, 380px); overflow: visible; }
  .hero .fruits { position: relative; inset: auto; display: flex; justify-content: center; align-items: flex-start; gap: 14px; padding: 0 var(--gut); margin-top: -34px; }
  .hero .fruit { position: relative; left: auto !important; top: auto !important; }
  .hero .fruit .stalk { height: 44px; }
  .hero-txt { position: relative; left: auto; top: auto !important; width: auto !important; padding: 18px var(--gut) 0; }
}
@media (prefers-reduced-motion: reduce) { .fruit { animation: none; } }

.promo { position: relative; z-index: 31; }

/* текст первого экрана масштабируется вместе с деревом (--ts) */
@media (min-width: 961px) {
  .hero-txt h1 { font-size: calc(3.3rem * var(--ts, 1)); margin-top: calc(14px * var(--ts, 1)); white-space: nowrap; }
  .hero-txt p { font-size: calc(1.05rem * max(.92, var(--ts, 1))); margin-top: calc(18px * var(--ts, 1)); }
  .hero-txt .hero-cta { margin-top: calc(28px * var(--ts, 1)); }
  .fruit .tag b { font-size: calc(1.5rem * var(--ts, 1)); }
  .fruit .tag .cap { font-size: calc(.7rem * max(.9, var(--ts, 1))); }
}
@media (min-width: 961px) and (max-height: 800px) {
  .hero-txt .cap { display: none; }
  .hero-txt h1 { margin-top: 0; font-size: calc(3.1rem * var(--ts, 1)); }
  .hero-txt p { margin-top: 12px; }
  .hero-txt .hero-cta { margin-top: 18px; }
  .hero-txt .btn.big { min-height: 48px; }
}

/* ── бирки подбора на суку ── */
.htags { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.htag { position: absolute; display: flex; flex-direction: column; align-items: center; width: 0; pointer-events: auto; transform-origin: 50% 0; will-change: transform; text-decoration: none; color: var(--ink); animation: pend 6.2s ease-in-out infinite; }
.htag:nth-child(2) { animation-duration: 7.4s; animation-delay: -1.3s; }
.htag:nth-child(3) { animation-duration: 8.3s; animation-delay: -3.1s; }
.htag:nth-child(4) { animation-duration: 6.9s; animation-delay: -2.2s; }
.phys .htag, .phys .fruit { animation: none; }
.htag .stalk { position: relative; flex: none; width: 1.5px; height: 40px; background: linear-gradient(180deg, #2f241a, #6a553d); }
.htag .stalk i { position: absolute; left: 50%; top: -4px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: #2f241a; box-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.htag .lbl { position: relative; flex: none; display: flex; flex-direction: column; align-items: center; gap: 1px; width: max-content; max-width: calc(132px * var(--ts, 1)); margin-top: -1px; padding: calc(15px * var(--ts, 1)) calc(11px * var(--ts, 1)) calc(8px * var(--ts, 1)); text-align: center;
  background: linear-gradient(172deg, #fbf7ee, #efe7d8); border-radius: 9px; box-shadow: 0 0 0 1px rgba(92, 72, 48, .22), 0 10px 22px rgba(43, 35, 28, .16), inset 0 -6px 12px rgba(120, 96, 64, .07); transition: box-shadow .3s, background .3s; }
/* люверс, через который продета нить */
.htag .lbl::before { content: ''; position: absolute; left: 50%; top: 5px; width: 7px; height: 7px; margin-left: -3.5px; border-radius: 50%; background: #d9cdb8; box-shadow: inset 0 1px 2px rgba(43, 35, 28, .5), 0 0 0 1.5px rgba(139, 111, 74, .45); }
.htag b { font: 600 calc(.78rem * max(.9, var(--ts, 1)))/1.15 var(--sans, inherit); letter-spacing: .01em; white-space: nowrap; }
.htag .lbl span { font-size: calc(.68rem * max(.9, var(--ts, 1))); color: var(--leaf); white-space: nowrap; }
.htag:hover .lbl, .htag:focus-visible .lbl { background: linear-gradient(172deg, #fffdf7, #f4eddf); box-shadow: 0 0 0 1px rgba(61, 90, 44, .5), 0 14px 26px rgba(43, 35, 28, .2); }
@media (min-width: 961px) { .hero-txt h1 { margin-top: 0; } }
@media (max-width: 960px) {
  .hero .htags { position: relative; inset: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 22px var(--gut) 0; }
  .hero .htag { position: relative; left: auto !important; top: auto !important; width: auto; animation: none; transform: none !important; }
  .hero .htag .stalk { display: none; }
  .hero .htag .lbl { width: 100%; max-width: none; padding: 12px 10px; }
  .hero .htag .lbl::before { display: none; }
}
/* телефон: сначала слова, потом бирки подбора; подписи плодов в одну-две ровные строки */
@media (max-width: 960px) {
  .hero { display: flex; flex-direction: column; }
  .hero .htags { order: 3; }
  .hero .fruit .tag .cap { letter-spacing: .06em; font-size: .62rem; max-width: 15ch; text-wrap: balance; }
}
/* ствол стоит на месте, прокручивается страница */
.barkcol { position: fixed; bottom: auto; height: calc(100vh + var(--lock, 0px)); height: calc(100lvh + var(--lock, 0px)); will-change: transform; }

/* ════ финальные правки 1 ════ */
/* ствол: едет со страницей, пока ветка на экране (--lock), потом стоит — средствами CSS, без рывков */
.barkcol { position: sticky; top: calc(-1 * var(--lock, 0px)); bottom: auto; transform: none !important; will-change: auto;
  height: calc(100vh + var(--lock, 0px)); margin-bottom: calc(-100vh - var(--lock, 0px));
  height: calc(100lvh + var(--lock, 0px)); margin-bottom: calc(-100lvh - var(--lock, 0px));
  background-position: calc(100% + 2px) top; filter: drop-shadow(7px 0 9px rgba(43, 35, 28, .26)); }
.barkcol::before { display: none; }
/* зазоры у коры: тёмная полоса уходит под рельеф коры, шапка начинается мягко */
.barktop { position: absolute; left: 0; top: 0; z-index: 32; pointer-events: none; width: calc(var(--trunk) + var(--j) * 0.11); height: var(--promo);
  background: url(img/tree/trunk-tile.webp?v=2) repeat-y calc(100% + 2px) top / calc(var(--j) * 5.12) auto; }
.promo { margin-left: calc(var(--trunk) - 16px); }
.promo[hidden] + * { }
.head { margin-left: calc(var(--trunk) - 16px); padding-left: calc(var(--gut) + 16px);
  -webkit-mask-image: linear-gradient(90deg, transparent 13px, #000 42px); mask-image: linear-gradient(90deg, transparent 13px, #000 42px); }
@media (max-width: 960px) { .barktop { background-image: url(img/tree/trunk-tile-m.webp?v=2); } }

/* кнопки на стволе — «выпиленные»: светлый спил с кольцами в тёмной лунке */
.knot { color: #fff; }
.knot span.k { background: radial-gradient(circle at 50% 50%, #f3e7cf 0 14%, #e6d5b6 15% 30%, #efe0c4 31% 47%, #dcc9a6 48% 63%, #e9d9bb 64% 80%, #cdb891 81% 100%);
  border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; color: #2a1f15;
  box-shadow: inset 0 3px 7px rgba(40, 26, 14, .55), inset 0 -1px 0 rgba(255, 255, 255, .5), 0 0 0 3px rgba(26, 18, 11, .82), 0 0 0 4px rgba(255, 240, 215, .16), 0 6px 14px rgba(0, 0, 0, .5); }
.knot span.k .ico { stroke: #2a1f15; stroke-width: 1.9; }
.knot:hover span.k { background: radial-gradient(circle at 50% 50%, #fbf2de 0 14%, #efdfc1 15% 30%, #f7ead0 31% 47%, #e6d4b2 48% 63%, #f1e3c7 64% 80%, #d8c39d 81% 100%); transform: scale(1.06); }
.knot[aria-current=page] span.k { box-shadow: inset 0 3px 7px rgba(40, 26, 14, .5), 0 0 0 3px #3d5a2c, 0 0 0 5px rgba(255, 246, 228, .85), 0 6px 14px rgba(0, 0, 0, .5); background: radial-gradient(circle at 50% 50%, #fbf2de 0 14%, #efdfc1 15% 30%, #f7ead0 31% 47%, #e6d4b2 48% 63%, #f1e3c7 64% 80%, #d8c39d 81% 100%); }
.knot b { background: rgba(18, 12, 8, .82); color: #fff6e6; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: 0 1px 0 rgba(255, 255, 255, .08); }
.knot[aria-current=page] b { background: #3d5a2c; }
.trunk-nav { gap: 2px; }
@media (min-width: 961px) { .knot span.k { width: clamp(40px, 5.6vh, 58px); height: clamp(40px, 5.6vh, 58px); } .knot { gap: clamp(2px, .6vh, 6px); } }
@media (max-width: 960px) { .knot span.k { width: 40px; height: 40px; } .knot b { font-size: .44rem; } .trunk-nav { top: 118px; gap: 2px; } }
@media (max-width: 960px) and (max-height: 760px) { .knot b { display: none; } }

/* первый экран: срезы слева (линия ведёт к их месту в стволе и суку), текст справа */
.cuts { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.cut { position: absolute; display: grid; justify-items: center; gap: 12px; width: var(--d); text-decoration: none; color: var(--ink); pointer-events: auto; }
.cut .disc { position: relative; width: var(--d); height: var(--d); border-radius: 50%; display: grid; place-items: center; overflow: hidden; transition: transform .6s var(--ex), box-shadow .6s;
  background: radial-gradient(circle at 38% 30%, #fdfaf4 0%, #f1ebdf 58%, #e6decf 100%);
  box-shadow: 0 0 0 1px rgba(61, 90, 44, .28), 0 0 0 7px rgba(251, 248, 242, .92), 0 0 0 8px rgba(61, 90, 44, .16), 0 30px 50px rgba(43, 35, 28, .18), inset 0 -14px 30px rgba(43, 35, 28, .07); }
.cut .disc img { position: absolute; inset: 7%; width: 86%; height: 86%; object-fit: contain; transform: rotate(-12deg); filter: drop-shadow(0 12px 12px rgba(43, 35, 28, .3)); transition: transform .8s var(--ex); }
.cut:hover .disc { transform: scale(1.03); }
.cut:hover .disc img { transform: rotate(-6deg) scale(1.04); }
.cut .tag { display: grid; justify-items: center; gap: 2px; text-align: center; width: max-content; max-width: 30ch; }
.cut .tag .cap { color: var(--leaf); letter-spacing: .14em; font-size: calc(.68rem * max(.9, var(--ts, 1))); }
.cut .tag b { font: 300 calc(1.5rem * var(--ts, 1))/1.1 var(--serif); }
.cut .tag span { font: 500 .95rem var(--sans); }
.cut-lines { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; z-index: 3; pointer-events: none; }
.cut-lines line { stroke: #2f241a; stroke-width: 1.4; stroke-dasharray: 2 5; stroke-linecap: round; opacity: .8; }
.cut-lines .slab { fill: rgba(255, 244, 222, .1); stroke: #fff3dc; stroke-width: 1.6; stroke-dasharray: 7 6; stroke-linecap: round; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .55)); }
.cut-lines circle { fill: #fff3dc; stroke: #2f241a; stroke-width: 1.4; }
@media (min-width: 961px) { .hero-txt { left: auto; } }
@media (max-width: 960px) {
  .cut-lines { display: none; }
  .hero .cuts { position: relative; inset: auto; display: flex; justify-content: center; align-items: flex-start; gap: 14px; padding: 0 var(--gut); margin-top: -10px; }
  .hero .cut { position: relative; left: auto !important; top: auto !important; }
  .hero .cut .tag { max-width: 16ch; width: auto; }
  .hero .cut .tag .cap { letter-spacing: .06em; font-size: .62rem; text-wrap: balance; }
  .hero .cut .tag b { font-size: 1.15rem; }
}

/* якоря под липкую шапку */
#reviews, #made, #why, #best { scroll-margin-top: calc(var(--head) + 18px); }

/* изделия из слэбов */
.made-row, .made-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.made-grid { gap: 34px 22px; }
.made-c { display: grid; gap: 14px; align-content: start; min-width: 0; }
.made-img { display: block; aspect-ratio: 3 / 2; border-radius: 12px; overflow: hidden; background: var(--bone-2); }
.made-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 1.1s var(--ex); }
.made-c:hover .made-img img { transform: scale(1.035); }
.made-b h3 { font: 300 1.5rem/1.15 var(--serif); margin: 0; }
.made-b p { margin: 6px 0 0; color: var(--ink-2); max-width: 44ch; }
.made-l { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font: 500 .9rem var(--sans); color: var(--leaf); text-decoration: none; }
.made-l .cap { color: var(--ink-3); margin-right: 6px; }
.made-l:hover { text-decoration: underline; }
.made-l .ico { width: 16px; height: 16px; }
.made-note { margin-top: 18px; }
.made-intro { max-width: 70ch; padding: 34px 0 30px; display: grid; gap: 14px; }
.made-intro h1 { font-size: clamp(2.4rem, 4.6vw, 4.4rem); line-height: 1.02; margin: 0; }
.made-intro h1 em { color: var(--leaf); }
.made-intro p { margin: 0; color: var(--ink-2); font-size: 1.05rem; }
.made-cta { margin-top: clamp(50px, 6vw, 90px); padding: clamp(26px, 3.4vw, 46px); border-radius: 12px; background: var(--bone); border: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.made-cta h2 { font-size: clamp(1.7rem, 2.6vw, 2.5rem); margin: 0; }
.made-cta p { margin: 8px 0 0; color: var(--ink-2); max-width: 52ch; }
.made-cta .hero-cta { margin-top: 0; }
@media (max-width: 960px) { .made-row, .made-grid { grid-template-columns: 1fr; gap: 26px; } .made-cta { flex-direction: column; align-items: flex-start; } }
