/* =========================================================
   Hero 3D Illustration — isometric workspace scene
   Scoped entirely under .hero3d — safe to include anywhere.

   Structure note: every floating piece is a position-only
   wrapper (.hero3d-browser, .chip-code, etc.) around an
   "-inner"/"-card" element that carries the visual style and
   animation. This keeps the mouse-parallax transform (applied
   to the wrapper by hero-3d.js) from fighting with the CSS
   float/entrance animations (applied to the inner element) —
   both animate `transform` but on different elements.
   ========================================================= */

.hero3d{
  --h3-orange:#F15922;
  --h3-orange-dark:#C8401A;
  --h3-orange-light:#FF8A4D;
  --h3-cream:#FFF8F3;
  --h3-peach:#FFE5D8;
  --h3-ink:#1D1A17;
  --h3-purple:#A78BFA;
  --h3-skin:#F0B98C;
  --h3-hair:#2A211B;
  --h3-white:#FFFFFF;

  position:relative;
  width:100%;
  max-width:560px;
  aspect-ratio: 1 / 1.02;
  margin:0 auto;
}
.hero3d-scene{ position:absolute; inset:0; }

/* ---------- Ambient glow (keeps the cream/peach identity, no hard card edge) ---------- */
.hero3d-glow{
  position:absolute; inset:-10%; z-index:0; pointer-events:none;
  background:
    radial-gradient(ellipse 55% 45% at 68% 30%, rgba(241,89,34,.16), transparent 65%),
    radial-gradient(ellipse 50% 45% at 22% 72%, rgba(167,139,250,.14), transparent 65%);
  filter: blur(6px);
}
.hero3d-floor{
  position:absolute; left:10%; right:10%; bottom:6%; height:14%; z-index:1; pointer-events:none;
  background: radial-gradient(ellipse 60% 100% at 50% 50%, rgba(26,23,21,.14), transparent 75%);
  filter: blur(4px);
}

/* ---------- Floating browser window ---------- */
.hero3d-browser{ position:absolute; top:2%; right:-2%; width:62%; z-index:2; }
.hero3d-browser-inner{
  background:var(--h3-white); border-radius:18px; box-shadow:0 26px 50px rgba(26,23,21,.16);
  border:1px solid rgba(26,23,21,.06); overflow:hidden; transform:rotate(-3deg);
  animation: h3FloatA 7s ease-in-out infinite, h3EnterDown .8s ease-out .1s backwards;
}
.hero3d-browser-bar{ display:flex; align-items:center; gap:6px; padding:10px 14px; background:var(--h3-cream); }
.hero3d-browser-bar span{ width:7px; height:7px; border-radius:50%; background:var(--h3-peach); }
.hero3d-browser-bar span:first-child{ background:var(--h3-orange-light); }
.hero3d-browser-url{ margin-left:8px; flex:1; height:9px; border-radius:5px; background:rgba(26,23,21,.08); }
.hero3d-browser-body{ padding:12px 14px 16px; }
.hero3d-browser-hero{
  height:38px; border-radius:10px; margin-bottom:10px;
  background: linear-gradient(120deg, var(--h3-orange-light), var(--h3-orange) 60%, var(--h3-purple));
}
.hero3d-browser-row{ height:7px; border-radius:4px; background:rgba(26,23,21,.09); margin-bottom:6px; }
.hero3d-browser-row.short{ width:58%; }

/* ---------- Analytics card ---------- */
.hero3d-analytics{ position:absolute; left:-6%; top:46%; width:46%; z-index:4; }
.hero3d-analytics-inner{
  background:var(--h3-white); border-radius:16px; box-shadow:0 22px 44px rgba(26,23,21,.15);
  border:1px solid rgba(26,23,21,.06); padding:14px 16px; transform:rotate(4deg);
  animation: h3FloatB 8s ease-in-out infinite .3s, h3EnterUp .8s ease-out .25s backwards;
}
.hero3d-analytics-head{ display:flex; align-items:center; justify-content:space-between; font-size:.74rem; font-weight:700; color:var(--h3-ink); margin-bottom:10px; }
.hero3d-analytics-head span{ color:var(--h3-orange); font-weight:800; }
.hero3d-chart{ display:flex; align-items:flex-end; gap:6px; height:38px; }
.hero3d-chart span{
  flex:1; display:block; border-radius:4px 4px 2px 2px; height:var(--h);
  background:linear-gradient(180deg, var(--h3-orange-light), var(--h3-orange-dark));
  transform:scaleY(0); transform-origin:bottom; animation:h3Grow .7s ease-out forwards;
}
.hero3d-chart span:nth-child(1){ animation-delay:.5s; }
.hero3d-chart span:nth-child(2){ animation-delay:.6s; }
.hero3d-chart span:nth-child(3){ animation-delay:.7s; }
.hero3d-chart span:nth-child(4){ animation-delay:.8s; }
.hero3d-chart span:nth-child(5){ animation-delay:.9s; background:linear-gradient(180deg, var(--h3-purple), var(--h3-orange)); }

/* ---------- Floating icon chips ---------- */
.hero3d-chip{ position:absolute; z-index:5; }
.hero3d-chip-inner{
  display:grid; place-items:center; border-radius:16px; box-shadow:0 16px 30px rgba(26,23,21,.14);
}
.hero3d-chip-inner svg{ display:block; }

.chip-code{ top:32%; left:-9%; }
.chip-code .hero3d-chip-inner{
  width:54px; height:54px; background:var(--h3-ink); color:var(--h3-orange-light);
  animation: h3FloatA 6s ease-in-out infinite .5s, h3EnterUp .7s ease-out .4s backwards;
}
.chip-www{ top:4%; left:2%; }
.chip-www .hero3d-chip-inner{
  width:46px; height:46px; border-radius:50%; background:var(--h3-orange); color:var(--h3-white);
  font-size:.62rem; font-weight:800; letter-spacing:.02em;
  animation: h3FloatB 7.5s ease-in-out infinite .2s, h3EnterUp .7s ease-out .55s backwards;
}
.chip-wp{ bottom:20%; right:-8%; }
.chip-wp .hero3d-chip-inner{
  width:48px; height:48px; border-radius:50%; background:var(--h3-purple); color:var(--h3-white);
  font-family:var(--font-display); font-weight:700; font-size:1.1rem;
  animation: h3FloatA 6.8s ease-in-out infinite .35s, h3EnterUp .7s ease-out .7s backwards;
}
.chip-ui{ bottom:0%; left:14%; }
.chip-ui .hero3d-chip-inner{
  width:92px; padding:10px 12px; background:var(--h3-white); display:block;
  animation: h3FloatB 7.2s ease-in-out infinite .15s, h3EnterUp .7s ease-out .85s backwards;
}
.chip-ui .ui-dots{ display:flex; gap:5px; margin-bottom:6px; }
.chip-ui .ui-dots span{ width:9px; height:9px; border-radius:50%; }
.chip-ui .ui-dots span:nth-child(1){ background:var(--h3-orange); }
.chip-ui .ui-dots span:nth-child(2){ background:var(--h3-purple); }
.chip-ui .ui-dots span:nth-child(3){ background:var(--h3-ink); }
.chip-ui .ui-type{ font-family:var(--font-display); font-weight:700; font-size:1rem; color:var(--h3-ink); }

/* ---------- Desk + character group (kept mostly stable, no parallax) ---------- */
.hero3d-desk-group{ position:absolute; left:0; right:0; bottom:2%; height:62%; z-index:3; }

.hero3d-chair{ position:absolute; left:26%; width:48%; bottom:14%; height:58%; z-index:1; }
.hero3d-chair .chair-back{
  position:absolute; left:14%; width:72%; bottom:34%; height:66%; border-radius:30px 30px 12px 12px;
  background:linear-gradient(160deg, #332c26, var(--h3-ink));
}
.hero3d-chair .chair-seat{
  position:absolute; left:0; width:100%; bottom:24%; height:16%; border-radius:12px;
  background:linear-gradient(180deg, #3a332c, var(--h3-ink));
}
.hero3d-chair .chair-base{
  position:absolute; left:40%; width:20%; bottom:0; height:26%; border-radius:4px;
  background:linear-gradient(180deg, #453e35, #262220);
}

.hero3d-character{
  position:absolute; left:32%; width:36%; bottom:18%; height:60%; z-index:2;
  transform-origin:bottom center; animation: h3Breathe 4.6s ease-in-out infinite, h3EnterUp .8s ease-out .15s backwards;
}
.char-head{
  position:absolute; top:0; left:50%; width:46%; aspect-ratio:1; border-radius:50%;
  transform:translateX(-50%); background:linear-gradient(160deg, #F6CBA0, var(--h3-skin));
  box-shadow:inset -4px -6px 10px rgba(0,0,0,.08); overflow:hidden; z-index:2;
}
.char-hair{
  position:absolute; top:-14%; left:-4%; width:108%; height:56%; border-radius:50% 50% 40% 40%;
  background:linear-gradient(160deg, #3a2e25, var(--h3-hair));
}
.char-torso{
  position:absolute; top:34%; left:50%; width:88%; height:66%; border-radius:34px 34px 18px 18px;
  transform:translateX(-50%); background:linear-gradient(165deg, var(--h3-orange-light), var(--h3-orange) 55%, var(--h3-orange-dark));
  box-shadow:inset 6px -10px 16px rgba(0,0,0,.12); z-index:1;
}
.char-torso::before{
  content:''; position:absolute; top:0; left:50%; width:34%; height:12%; border-radius:0 0 50% 50%;
  transform:translateX(-50%); background:rgba(255,255,255,.22);
}
.char-shoulder{
  position:absolute; top:28%; width:26%; height:20%; border-radius:50%; z-index:1;
  background:linear-gradient(165deg, var(--h3-orange-light), var(--h3-orange-dark));
}
.char-shoulder.left{ left:-8%; }
.char-shoulder.right{ right:-8%; }

.hero3d-desk{
  position:absolute; left:2%; right:2%; bottom:14%; height:20%; z-index:4;
  background:linear-gradient(175deg, #FFFFFF, var(--h3-cream));
  border-radius:20px; border:1px solid rgba(26,23,21,.08);
  box-shadow:0 26px 36px rgba(26,23,21,.18), inset 0 1.5px 0 rgba(255,255,255,.9), inset 0 -10px 16px rgba(26,23,21,.05);
}
.hero3d-desk::before{
  content:''; position:absolute; left:6%; right:6%; top:0; height:4px; border-radius:2px;
  background:linear-gradient(90deg, var(--h3-orange-light), var(--h3-purple));
  opacity:.8;
}

.hero3d-hand{
  position:absolute; bottom:33.5%; width:18px; height:18px; border-radius:50%; z-index:6;
  background:linear-gradient(160deg, #F6CBA0, var(--h3-skin)); box-shadow:0 4px 8px rgba(26,23,21,.14);
}
.hero3d-hand.left{ left:40%; }
.hero3d-hand.right{ right:40%; }

.hero3d-laptop{ position:absolute; left:50%; bottom:34%; width:42%; transform:translateX(-50%); z-index:5; }
.hero3d-laptop .lid{
  position:relative; height:46px; border-radius:8px 8px 3px 3px; transform-origin:bottom; transform:rotateX(8deg);
  background:linear-gradient(165deg, #322b25, var(--h3-ink)); display:grid; place-items:center;
  box-shadow:0 10px 18px rgba(26,23,21,.24);
}
.hero3d-laptop .lid .brand{
  font-family:var(--font-display); font-weight:700; font-size:.86rem; color:var(--h3-orange-light);
  text-shadow:0 0 10px rgba(255,138,77,.7);
}
.hero3d-laptop .base{
  height:7px; margin-top:-2px; border-radius:3px 3px 12px 12px;
  background:linear-gradient(180deg, #423b33, #262220);
}

.hero3d-mug{
  position:absolute; right:7%; bottom:34%; width:20px; height:22px; border-radius:4px 4px 7px 7px; z-index:6;
  background:linear-gradient(165deg, var(--h3-white), var(--h3-peach));
  box-shadow:0 8px 14px rgba(26,23,21,.16);
}
.hero3d-mug::after{
  content:''; position:absolute; right:-7px; top:25%; width:8px; height:9px; border-radius:0 6px 6px 0;
  border:3px solid var(--h3-peach); border-left:none;
}

.hero3d-plant{ position:absolute; left:5%; bottom:34%; width:34px; height:44px; z-index:6; }
.hero3d-plant .pot{ position:absolute; bottom:0; left:6px; width:22px; height:17px; border-radius:3px 3px 8px 8px; background:linear-gradient(165deg, var(--h3-orange), var(--h3-orange-dark)); }
.hero3d-plant .leaf{ position:absolute; bottom:13px; width:15px; height:24px; border-radius:50% 50% 50% 4%; background:linear-gradient(160deg,#7FBF7A,#4F9A54); }
.hero3d-plant .leaf.l1{ left:0; transform:rotate(-20deg); }
.hero3d-plant .leaf.l2{ left:9px; transform:rotate(2deg); height:28px; }
.hero3d-plant .leaf.l3{ left:18px; transform:rotate(22deg); }

.hero3d-books{ position:absolute; left:3%; bottom:34%; width:30px; z-index:5; display:flex; flex-direction:column-reverse; gap:2px; }
.hero3d-books span{ display:block; height:6px; border-radius:2px; }
.hero3d-books span:nth-child(1){ background:var(--h3-purple); width:30px; }
.hero3d-books span:nth-child(2){ background:var(--h3-orange); width:26px; }
.hero3d-books span:nth-child(3){ background:var(--h3-ink); width:28px; }

/* ---------- Animations ---------- */
@keyframes h3FloatA{ 0%,100%{ transform:rotate(-3deg) translateY(0); } 50%{ transform:rotate(-3deg) translateY(-10px); } }
@keyframes h3FloatB{ 0%,100%{ transform:rotate(4deg) translateY(0); } 50%{ transform:rotate(4deg) translateY(9px); } }
@keyframes h3Breathe{ 0%,100%{ transform:scale(1); } 50%{ transform:scale(1.012) translateY(-2px); } }
@keyframes h3Grow{ to{ transform:scaleY(1); } }
@keyframes h3EnterUp{ from{ opacity:0; transform:translateY(22px); } to{ opacity:1; transform:translateY(0); } }
@keyframes h3EnterDown{ from{ opacity:0; transform:translateY(-18px); } to{ opacity:1; transform:translateY(0); } }

.hero3d-browser, .hero3d-analytics, .hero3d-chip{ will-change:transform; }

@media (prefers-reduced-motion: reduce){
  .hero3d-browser-inner, .hero3d-analytics-inner, .hero3d-chip-inner, .hero3d-character, .hero3d-chart span{
    animation:none !important; opacity:1 !important; transform:none !important;
  }
  .chip-code .hero3d-chip-inner, .chip-wp .hero3d-chip-inner{ transform:none !important; }
}

/* Chip icons keep their un-animated final rotation under reduced motion individually, so set it explicitly */
@media (prefers-reduced-motion: reduce){
  .hero3d-browser-inner{ transform:rotate(-3deg) !important; }
  .hero3d-analytics-inner{ transform:rotate(4deg) !important; }
}

/* ---------- Responsive ---------- */
@media (max-width:1080px){
  .hero3d{ max-width:440px; }
}
@media (max-width:640px){
  .hero3d{ max-width:360px; aspect-ratio:1/1.08; }
  .chip-ui{ display:none; }
  .hero3d-analytics{ width:50%; left:-3%; }
  .hero3d-analytics-inner{ padding:10px 12px; }
  .hero3d-browser{ width:66%; right:0; }
  .chip-code .hero3d-chip-inner{ width:44px; height:44px; }
  .chip-code{ left:-5%; }
  .chip-wp .hero3d-chip-inner{ width:40px; height:40px; }
  .chip-wp{ right:-4%; }
  .chip-www .hero3d-chip-inner{ width:38px; height:38px; }
}
