/* ==========================================================================
   hero3d.css — PowerTrans Industrial
   Progressive-enhancement layer for the homepage 3D assembly.

   DESIGN INTENT — "you land inside Zejia's studio"
   The hero is a full-bleed photographic studio, not a card on a page. Pure
   white deck, one soft pool of light, the driveline floating free with a real
   contact shadow. No frame, no border, no grid, no glow, no dark wash.
   Premium comes from light and restraint — never from an effect.

   Loaded only on the homepage. Never hides or replaces indexable content.
   ========================================================================== */

/* ---------- The full-bleed hero — the studio IS the first screen ---------- */
.hero-full {
  position: relative;
  display: flex;
  flex-direction: column;
  /* fill the viewport below the utility bar + sticky header */
  min-height: calc(100svh - 74px);
  overflow: hidden;
  isolation: isolate;
  background: var(--canvas);
}
@media (min-width: 768px) {
  .hero-full { min-height: calc(100svh - 114px); }
}

/* ---------- The first screen IS the studio, nothing else ---------- *
   No headline, no buttons, no index visible until you scroll. The driveline
   owns the whole room; the words arrive one screen down (.hero-intro). */

/* ---------- Studio light + contact shadow (behind the object) ---------- */
.hero-full__light {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(36% 22% at 63% 76%, rgba(15, 22, 32, .17) 0%, rgba(15, 22, 32, 0) 68%),
    radial-gradient(135% 115% at 62% 32%, #ffffff 0%, #fafbfc 48%, #f1f3f6 100%);
}

/* ---------- Stage: the canvas fills the studio, no frame at all ---------- */
.hero-full__stage {
  position: absolute;
  inset: 0;
  z-index: 1;
}
[data-hero3d] canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity .8s var(--ease);
  cursor: grab;
}
[data-hero3d].is-ready canvas { opacity: 1; }
[data-hero3d].is-dragging canvas { cursor: grabbing; }

/* ---------- Poster (indexable + no-WebGL layer) ---------- *
   Base state is the pre-init / fallback / mobile state: a clean full-bleed
   photograph, treated as a deliberate element. Once the 3D is live the
   poster is hidden and carries no frame at all.                          */
[data-hero3d] [data-hero3d-poster] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 56%;
  z-index: 2;
  transition: opacity .8s var(--ease);
}
[data-hero3d] [data-hero3d-poster].is-hidden { opacity: 0; pointer-events: none; }

/* ---------- Intro: the words, one screen down ----------
   The first screen is the studio alone. Here the marketing copy arrives as you
   step further in — real HTML, left-aligned, on the paper deck. It also carries
   the single h1, so the page keeps exactly one top-level heading. */
.hero-intro {
  position: relative;
  z-index: 2;
  background: var(--canvas);
  padding: clamp(64px, 11vh, 132px) 0 clamp(56px, 9vh, 104px);
}
.hero-intro__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 44px;
  align-items: start;
}
.hero-intro__copy { max-width: 660px; }

/* The spec plate: the real nameplate data of the featured unit, set like a
   datasheet column so the right half of the intro carries substance, not air. */
.hero-intro__spec { min-width: 0; }
.hero-intro__spec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
  padding: 14px 0 12px;
}
.hero-intro__spec-title {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--ink);
}
.hero-intro__spec-sku {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--subtle);
}
.hero-intro__spec-rows { margin: 0; }
.hero-intro__spec-row {
  display: grid;
  grid-template-columns: 152px minmax(0, 1fr);
  gap: 18px;
  align-items: baseline;
  padding: 15px 0;
  border-bottom: 1px solid var(--line-soft);
}
.hero-intro__spec-row dt {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--subtle);
}
.hero-intro__spec-row dd {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  font-weight: 600;
  color: var(--ink-2);
}
@media (max-width: 560px) {
  .hero-intro__spec-row { grid-template-columns: minmax(0, 1fr); gap: 3px; }
}
@media (min-width: 992px) {
  .hero-intro__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr); gap: 72px; }
}

/* ---------- Proof strip: the numbers, just outside the room ----------
   The studio hero keeps only the caption so the driveline stays the subject.
   The trust figures move into their own quiet plate directly underneath —
   read on the way in, out of the object's way. */
.hero-stats {
  position: relative;
  z-index: 2;
  background: var(--canvas);
  border-top: 1px solid var(--line);
}
.hero-stats__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 24px;
  padding: clamp(28px, 4.4vh, 44px) 0;
}
@media (min-width: 768px) {
  .hero-stats__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 40px; padding-right: 84px; }
  .hero-stats__item + .hero-stats__item { border-left: 1px solid var(--line); padding-left: 40px; }
}

/* ---------- Scroll cue: the way on, into the rest of the site ---------- */
.hero-scroll {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--hero-rail-h, 132px) + 14px);
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--subtle);
  text-decoration: none;
  white-space: nowrap;
  opacity: 0;
  animation: hero-scroll-in .7s var(--ease) .7s forwards;
  transition: color .3s var(--ease);
  pointer-events: auto;
}
@keyframes hero-scroll-in { to { opacity: 1; } }
.hero-scroll:hover { color: var(--accent); }
.hero-scroll svg {
  width: 13px; height: 13px;
  animation: hero-scroll-nudge 2.2s cubic-bezier(.5, 0, .5, 1) infinite;
}
@keyframes hero-scroll-nudge {
  0%, 58%, 100% { transform: translateY(0);   opacity: .7; }
  76%           { transform: translateY(3px); opacity: 1; }
}
@media (max-width: 1023px) { .hero-scroll { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .hero-scroll { animation-duration: .01s; animation-delay: 0s; }
  .hero-scroll svg { animation: none; }
}

/* ---------- Bottom rail: the engineering index ---------- */
.hero-full__rail {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  margin-top: auto;   /* pin to the bottom of the studio */
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .82) 42%, #fff 100%);
  backdrop-filter: blur(2px);
}
.hero-full__rail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px 40px;
  align-items: end;
  padding: 16px 0 20px;
}
@media (min-width: 1024px) {
  /* right padding clears the site's fixed customer-service launcher (#cs-panel,
     56px at bottom-right) so the index is never buried under it. */
  .hero-full__rail-grid { grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); padding-right: 84px; }
}

/* ---------- Drag hint — plain mono type, not a pill ---------- */
.hero3d-hint {
  position: absolute;
  right: 20px;
  top: -30px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--subtle);
  opacity: 0;
  transform: translateY(3px);
  transition: opacity .6s var(--ease) .3s, transform .6s var(--ease) .3s;
  pointer-events: none;
}
@media (min-width: 768px) { .hero3d-hint { right: 32px; } }
[data-hero3d].is-ready .hero3d-hint { opacity: 1; transform: none; }
[data-hero3d].is-dragging .hero3d-hint { opacity: 0; }
.hero3d-hint svg { width: 13px; height: 13px; }

/* ---------- Featured meta — the caption, done typographically ---------- */
.hero3d-meta { min-width: 0; }
.hero3d-meta__main { min-width: 0; }
.hero3d-meta__eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--subtle);
  margin-bottom: 7px;
}
.hero3d-meta__name {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  max-width: 34ch;
}
.hero3d-meta__side {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  margin-top: 12px;
}
.hero3d-meta__spec {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.hero3d-meta__link {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  transition: background-color .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease);
}
.hero3d-meta__link svg { width: 17px; height: 17px; }
.hero3d-meta__link:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---------- Parts index (real HTML — crawlers & a11y read this) ---------- */
.parts-index { min-width: 0; }
.parts-index__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.parts-index__title {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent);
}
.parts-index__count {
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--subtle);
}
.parts-index ol {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
}
@media (min-width: 640px) { .parts-index ol { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .parts-index ol { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; } }

.parts-index li {
  display: flex; align-items: baseline; gap: 8px;
  padding: 6px 7px;
  border-radius: 7px;
  border-left: 1px solid var(--line);
  transition: background-color .25s var(--ease), border-color .25s var(--ease), transform .35s var(--ease);
  cursor: default;
}
.parts-index li .idx {
  font-family: var(--font-mono);
  font-size: 9.5px; color: var(--subtle);
  flex-shrink: 0;
  transition: color .25s;
}
.parts-index li .nm {
  font-size: 12px; font-weight: 600; color: var(--ink-2);
  line-height: 1.25;
  transition: color .25s;
}
.parts-index li .sp {
  font-family: var(--font-mono);
  font-size: 9px; letter-spacing: .05em; color: var(--subtle);
  display: block; margin-top: 2px;
  transition: color .25s;
}
/* linked hover: list <-> 3D part */
.parts-index li:hover,
.parts-index li.is-active {
  background: var(--accent-soft);
  border-left-color: var(--accent);
  transform: translateY(-2px);
}
.parts-index li:hover .nm,
.parts-index li.is-active .nm { color: var(--accent-dark); }
.parts-index li:hover .idx,
.parts-index li.is-active .idx { color: var(--accent); }

/* ---------- Reduced motion / fallback ---------- */
@media (prefers-reduced-motion: reduce) {
  [data-hero3d] canvas { transition: none; }
  .parts-index li { transition: none; }
}
[data-hero3d][data-hero3d-mode="fallback"] canvas,
[data-hero3d][data-hero3d-mode="error"] canvas { display: none; }
[data-hero3d][data-hero3d-mode="fallback"] [data-hero3d-poster],
[data-hero3d][data-hero3d-mode="error"] [data-hero3d-poster] { opacity: 1 !important; }
[data-hero3d][data-hero3d-mode="fallback"] .hero3d-hint,
[data-hero3d][data-hero3d-mode="error"] .hero3d-hint { display: none; }
/* studio light only makes sense behind the 3D */
[data-hero3d][data-hero3d-mode="fallback"] ~ .hero-full__light,
[data-hero3d][data-hero3d-mode="error"] ~ .hero-full__light { display: none; }

/* Small screens: keep the photo hero honest.
   The real product photo is busy, so the copy sits on a soft white sweep —
   the same studio light as desktop, expressed as a top-down scrim. */
@media (max-width: 1023px) {
  .hero-full__stage::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background: linear-gradient(180deg, #ffffff 0%, #ffffff 34%, rgba(255, 255, 255, .95) 48%, rgba(255, 255, 255, .72) 60%, rgba(255, 255, 255, 0) 76%);
  }
  .hero-full__copy { max-width: 100%; }
  .hero-full__counters { margin-top: 32px; }
  .hero-full__rail { background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #ffffff 46%, #ffffff 100%); }
}
