/* ===========================================================
   Hero: настоящая 3D-модель ящика (Three.js) + текст
   Геометрия/материалы самого ящика — в js/crate3d.js
=========================================================== */

.hero{
  position:relative;
  height:340vh; /* даёт место для 3 текстовых блоков + вращения */
}
.hero-sticky{
  position:sticky; top:0;
  height:100vh;
  display:grid;
  grid-template-columns:1.05fr 1fr;
  align-items:center;
  overflow:hidden;
  padding:0 var(--pad);
  gap:40px;
}

/* --- сцена --- */
.crate-stage{
  position:relative;
  height:82vmin; max-height:740px;
}
.crate-3d{
  position:absolute; inset:0;
}
.crate-3d canvas{
  display:block; width:100% !important; height:100% !important;
}
.crate-glow{
  position:absolute; top:2%; left:50%; transform:translateX(-50%);
  width:130%; height:80%;
  background:radial-gradient(ellipse at center, rgba(230,198,140,0.18), transparent 68%);
  pointer-events:none;
  z-index:0;
}

/* --- текстовые блоки --- */
.hero-text{ position:relative; height:60vmin; max-height:520px; }
.htext{
  position:absolute; inset:0;
  display:flex; flex-direction:column; justify-content:center;
  opacity:0; transform:translateY(28px);
  transition:opacity .25s linear;
  pointer-events:none;
}
.htext.is-visible{ opacity:1; pointer-events:auto; }
.htext h1{ margin-bottom:18px; }
.htext .lead{ font-size:calc(var(--a11y-scale) * 18px); color:var(--white); max-width:44ch; margin-bottom:26px; }
.htext .actions{ display:flex; gap:14px; flex-wrap:wrap; margin-top:8px; }
.htext-h2{ margin-top:14px; margin-bottom:22px; }
.htext-lead-b{ margin-bottom:22px; }
.htext-checklist{ max-width:420px; }

.stat-row{
  display:flex; gap:32px; flex-wrap:wrap;
  margin-top:34px; padding-top:26px;
  border-top:1px solid var(--line);
}
.stat{ max-width:170px; }
.stat b{
  display:block; font-family:var(--ff-display); text-transform:uppercase;
  font-size:calc(var(--a11y-scale) * 19px); letter-spacing:0.01em; color:var(--wood-light); margin-bottom:6px;
}
.stat b .counter{ color:var(--white); }
/* только прямой дочерний span-описание, не число внутри <b> */
.stat > span{ font-size:calc(var(--a11y-scale) * 13px); color:var(--gray); line-height:1.45; }
.counter{ display:inline-block; font-variant-numeric:tabular-nums; }

.scroll-hint{
  position:absolute; left:var(--pad); bottom:30px;
  font-family:var(--ff-mono); font-size:calc(var(--a11y-scale) * 11px); letter-spacing:0.14em;
  color:var(--gray-dim); text-transform:uppercase;
  display:flex; align-items:center; gap:10px;
  opacity:1; transition:opacity .3s ease;
}
.scroll-hint::after{
  content:""; width:1px; height:26px; background:var(--gray-dim);
  animation:hintline 1.8s ease-in-out infinite;
}
@keyframes hintline{ 0%,100%{ transform:scaleY(0.4); opacity:.4;} 50%{ transform:scaleY(1); opacity:1; } }
.hero.scrolled .scroll-hint{ opacity:0; }

@media (max-width:860px){
  .hero{ height:300vh; }
  .hero-sticky{
    grid-template-columns:1fr; grid-template-rows:auto 1fr;
    align-items:stretch; /* было center — из-за этого текстовый блок схлопывался в 0 высоты */
    padding-top:86px; padding-bottom:12px; gap:6px;
  }
  .crate-stage{ height:24vh; }
  .hero-text{ height:auto; }
  .htext{ justify-content:flex-start; overflow-y:auto; padding-right:2px; }
  .scroll-hint{ display:none; }
  /* одна прокручиваемая вбок строка вместо 3 строк друг под другом — экономит высоту */
  .stat-row{
    margin-top:18px; padding-top:14px; gap:14px;
    flex-wrap:nowrap; overflow-x:auto; -webkit-overflow-scrolling:touch;
    padding-bottom:4px;
  }
  .stat{ flex:0 0 auto; max-width:none; width:150px; }
  .htext-h2{ margin-top:6px; margin-bottom:10px; font-size:calc(var(--a11y-scale) * 22px); line-height:1.16; }
  .htext-lead-b{ margin-bottom:12px; font-size:calc(var(--a11y-scale) * 14.5px); line-height:1.45; }
  .htext-checklist{ gap:6px; }
  .htext-checklist li{ padding-bottom:6px; font-size:calc(var(--a11y-scale) * 13.5px); }
}
@media (max-width:400px){
  .crate-stage{ height:24vh; }
  .htext .lead{ margin-bottom:16px; }
  .stat-row{ margin-top:12px; padding-top:12px; }
  .stat{ width:135px; }
}