/* ==========================================================================
   TUNE — showcase.css
   Hero 3D stage: CSS-built laptop, animated dashboard mockup,
   floating metric chips, pointer-driven tilt
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Hero layout
   -------------------------------------------------------------------------- */
.hero-layout {
  display: grid;
  align-items: center;
  gap: clamp(48px, 6vw, 80px);
  width: 100%;
}

@media (min-width: 1100px) {
  .hero-layout {
    grid-template-columns: minmax(0, 7fr) minmax(0, 6fr);
  }
}

.hero-copy {
  position: relative;
  z-index: 1;
}

/* --------------------------------------------------------------------------
   2. Stage & 3D scene
   -------------------------------------------------------------------------- */
.stage {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  padding-block: clamp(12px, 3vw, 32px);
}

.stage-glow {
  position: absolute;
  inset: -14%;
  background: radial-gradient(closest-side, rgba(10, 10, 10, 0.08), transparent 70%);
  pointer-events: none;
}

.scene {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  aspect-ratio: 10 / 8.8;
  perspective: 1500px;
  transform-style: preserve-3d;
  isolation: isolate;
}

.laptop-shadow {
  position: absolute;
  left: 50%;
  bottom: 2%;
  z-index: 0;
  width: 72%;
  height: 34px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(10, 10, 10, 0.26), transparent 68%);
  filter: blur(8px);
  animation: shadow-bob 6.5s ease-in-out infinite;
}

.float {
  position: absolute;
  inset: 0;
  z-index: 1;
  transform-style: preserve-3d;
  animation: bob 6.5s ease-in-out infinite;
}

.laptop {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 78%;
  transform-style: preserve-3d;
  transform: translate(-50%, -50%) rotateX(var(--rx, 9deg)) rotateY(var(--ry, -15deg));
}

/* Lid (screen) */
.laptop-lid {
  position: relative;
  width: 100%;
  padding: clamp(7px, 2.2%, 13px) clamp(7px, 2.2%, 13px) clamp(9px, 2.6%, 15px);
  background: linear-gradient(#202024, #0e0e10);
  border-radius: 20px 20px 8px 8px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 44px 80px -36px rgba(10, 10, 10, 0.45);
  transform-origin: 50% 100%;
  transform: rotateX(-6deg);
}

.laptop-lid::before {
  content: "";
  position: absolute;
  top: calc(clamp(7px, 2.2%, 13px) / 2 - 3px);
  left: 50%;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: #3a3a40;
}

.laptop-screen {
  overflow: hidden;
  aspect-ratio: 16 / 9.4;
  background: #fff;
  border-radius: 9px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* Base (deck) */
.laptop-base {
  position: relative;
  left: -7%;
  width: 114%;
  height: clamp(24px, 6.4vw, 34px);
  margin-top: -2px;
  background: linear-gradient(#303036, #17171a 62%, #0b0b0d);
  border-radius: 8px 8px 22px 22px;
  box-shadow: 0 28px 52px -24px rgba(10, 10, 10, 0.55);
  transform-origin: 50% 0;
  transform: rotateX(-77deg);
}

.laptop-base::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 13%;
  height: 42%;
  transform: translateX(-50%);
  background: #0b0b0d;
  border-radius: 0 0 12px 12px;
}

.laptop-base::after {
  content: "";
  position: absolute;
  inset: 16% 7% 30%;
  border-radius: 6px;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.06) 0 6px,
    transparent 6px 10px
  );
  opacity: 0.55;
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

@keyframes shadow-bob {
  0%,
  100% {
    transform: translateX(-50%) scaleX(1);
    opacity: 1;
  }
  50% {
    transform: translateX(-50%) scaleX(0.93);
    opacity: 0.75;
  }
}

/* --------------------------------------------------------------------------
   3. Floating metric chips
   -------------------------------------------------------------------------- */
.chip {
  position: absolute;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 11px 15px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  animation: chip-float var(--dur, 5s) ease-in-out infinite alternate;
}

.chip-a {
  top: 3%;
  left: -4%;
  --dur: 4.6s;
}

.chip-b {
  top: 44%;
  right: -6%;
  --dur: 5.6s;
}

.chip-c {
  bottom: 4%;
  left: 0;
  --dur: 5s;
}

.chip b {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.chip b::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--ink);
}

.chip span {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey-500);
}

@keyframes chip-float {
  from {
    transform: translateZ(70px) translateY(0);
  }
  to {
    transform: translateZ(70px) translateY(-11px);
  }
}

@media (max-width: 600px) {
  .chip-a,
  .chip-b,
  .chip-c {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   4. Dashboard app mockup (on the laptop screen)
   -------------------------------------------------------------------------- */
.dash {
  display: flex;
  height: 100%;
  background: #fafafa;
  font-size: 10px;
  user-select: none;
}

.dash-side {
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: 19%;
  padding: 10px 8px;
  background: #101013;
}

.dash-logo {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #fff;
  font-weight: 800;
  font-size: 8.5px;
  letter-spacing: 0.08em;
}

.dash-logo i {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: #fff;
}

.dash-nav {
  display: block;
  margin-top: 4px;
}

.dash-nav i {
  display: block;
  height: 5px;
  margin-bottom: 7px;
  border-radius: 3px;
  background: #35353c;
}

.dash-nav i.on {
  background: #c9c9cf;
}

.dash-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 9px 10px;
}

.dash-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-title {
  font-weight: 800;
  font-size: 10.5px;
  color: #111;
}

.dash-user {
  display: flex;
  gap: 4px;
}

.dash-user u {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #e4e4e7;
  text-decoration: none;
}

.dash-user u.me {
  background: #111;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.kpi {
  display: grid;
  gap: 2px;
  justify-items: start;
  padding: 6px;
  background: #fff;
  border: 1px solid #ececf0;
  border-radius: 6px;
}

.kpi span {
  font-size: 6.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #a1a1aa;
}

.kpi b {
  font-size: 10px;
  color: #0a0a0a;
  font-variant-numeric: tabular-nums;
}

.kpi em {
  padding: 1px 5px;
  border-radius: 999px;
  background: #0a0a0a;
  color: #fff;
  font-style: normal;
  font-size: 6.5px;
  font-weight: 700;
}

.dash-chart {
  position: relative;
  display: flex;
  flex: 1;
  align-items: flex-end;
  gap: 5%;
  padding: 8px 10px 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0 24%,
      rgba(10, 10, 10, 0.05) 24% calc(24% + 1px)
    ),
    #fff;
  border: 1px solid #ececf0;
  border-radius: 8px 8px 0 0;
  border-bottom: none;
}

.bar {
  flex: 1;
  height: var(--h, 50%);
  border-radius: 3px 3px 0 0;
  background: #141417;
  transform-origin: bottom;
  animation: bar-pulse 3.4s ease-in-out infinite alternate;
}

.bar:nth-child(even) {
  opacity: 0.82;
}

.bar:nth-child(2n) {
  animation-delay: -0.7s;
}

.bar:nth-child(3n) {
  animation-delay: -1.6s;
}

.bar:nth-child(5n) {
  animation-delay: -2.3s;
}

@keyframes bar-pulse {
  from {
    transform: scaleY(0.55);
  }
  to {
    transform: scaleY(1);
  }
}

.dash-chart svg {
  position: absolute;
  inset: 10% 6% 4%;
  width: 88%;
  height: 86%;
  overflow: visible;
}

.dash-chart polyline {
  fill: none;
  stroke: #71717a;
  stroke-width: 1.6;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 30 70;
  animation: line-flow 6s linear infinite;
}

@keyframes line-flow {
  to {
    stroke-dashoffset: -100;
  }
}

/* --------------------------------------------------------------------------
   5. Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .float,
  .laptop-shadow,
  .chip,
  .bar,
  .dash-chart polyline {
    animation: none;
  }

  .bar {
    transform: none;
  }
}
