.sp-home {
  --sp-bg: #07090d;
  --sp-text: #f8fafc;
  --sp-muted: #9aa8bc;
  --sp-blue: #1678ff;
  min-height: 100svh;
  position: relative;
  overflow: hidden;
  color: var(--sp-text);
  background:
    radial-gradient(circle at 15% 8%, rgba(22, 120, 255, 0.16), transparent 34rem),
    radial-gradient(circle at 88% 90%, rgba(99, 102, 241, 0.13), transparent 36rem),
    var(--sp-bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.sp-home::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.2;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.032) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: radial-gradient(circle at center, black 8%, transparent 80%);
}

.sp-home__main {
  min-height: 100svh;
  display: flex;
  align-items: stretch;
  padding: 20px;
}

.sp-home__shell {
  width: min(1560px, 100%);
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

.sp-home__grid {
  min-height: calc(100svh - 40px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.sp-home__card {
  min-width: 0;
  min-height: calc(100svh - 40px);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: clamp(26px, 2.5vw, 40px);
  color: var(--sp-text);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 34px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.018)),
    rgba(255, 255, 255, 0.038);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.055),
    0 32px 100px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(22px);
  transition:
    transform 260ms ease,
    border-color 260ms ease,
    background-color 260ms ease,
    box-shadow 260ms ease;
}

.sp-home__card::before,
.sp-home__card::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(4px);
  transition: transform 500ms ease, opacity 500ms ease;
}

.sp-home__card::before {
  width: 520px;
  height: 520px;
  right: -260px;
  top: -250px;
  opacity: 0.72;
}

.sp-home__card::after {
  width: 420px;
  height: 420px;
  left: -260px;
  bottom: -260px;
  opacity: 0.28;
}

.sp-home__card--labels::before {
  background: radial-gradient(circle, rgba(22, 120, 255, 0.46), rgba(22, 120, 255, 0));
}

.sp-home__card--labels::after {
  background: radial-gradient(circle, rgba(14, 165, 233, 0.36), rgba(14, 165, 233, 0));
}

.sp-home__card--video::before {
  background: radial-gradient(circle, rgba(99, 102, 241, 0.44), rgba(99, 102, 241, 0));
}

.sp-home__card--video::after {
  background: radial-gradient(circle, rgba(139, 92, 246, 0.32), rgba(139, 92, 246, 0));
}

.sp-home__card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.22);
  background-color: rgba(255, 255, 255, 0.055);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.075),
    0 42px 120px rgba(0, 0, 0, 0.3);
}

.sp-home__card:hover::before {
  transform: scale(1.12) translate(-18px, 18px);
}

.sp-home__card:hover::after {
  transform: scale(1.1) translate(18px, -18px);
  opacity: 0.4;
}

.sp-home__card:focus-visible {
  outline: 3px solid rgba(22, 120, 255, 0.82);
  outline-offset: 4px;
}

.sp-home__card-head,
.sp-home__scene,
.sp-home__card-bottom {
  position: relative;
  z-index: 2;
}

.sp-home__card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.sp-home__meta {
  color: #a7b5c8;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sp-home__arrow {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.065);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
  transition: transform 240ms ease, background-color 240ms ease;
}

.sp-home__arrow svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.8;
}

.sp-home__card:hover .sp-home__arrow {
  transform: translate(3px, -3px);
  background: rgba(255, 255, 255, 0.12);
}

.sp-home__scene {
  flex: 1;
  min-height: 390px;
  margin: 18px 0 12px;
}

.sp-home__card-bottom {
  padding-top: 18px;
}

.sp-home__card h2 {
  margin: 0;
  font-size: clamp(42px, 4.8vw, 70px);
  line-height: 0.96;
  letter-spacing: -0.055em;
  font-weight: 760;
}

.sp-home__card p {
  max-width: 500px;
  margin: 16px 0 0;
  color: #aab6c7;
  font-size: clamp(15px, 1.25vw, 18px);
  line-height: 1.55;
  letter-spacing: -0.012em;
}

/* Labels scene */
.sp-home__scene--labels {
  perspective: 1000px;
}

.sp-label-sheet,
.sp-label-preview,
.sp-label-link {
  position: absolute;
  transition: transform 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sp-label-sheet {
  width: min(66%, 430px);
  left: 2%;
  top: 12%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  color: #dbeafe;
  background: rgba(8, 15, 28, 0.92);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.32);
  transform: rotate(-3.5deg) translateZ(0);
}

.sp-label-sheet__bar {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
}

.sp-label-sheet__bar span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
}

.sp-label-sheet__bar b {
  margin-left: 6px;
  color: #91a4bd;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.sp-label-sheet__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.9fr;
  font-size: clamp(9px, 0.8vw, 12px);
}

.sp-label-sheet__grid div {
  min-width: 0;
  padding: 12px 10px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  border-right: 1px solid rgba(255, 255, 255, 0.055);
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  color: #aab9cd;
}

.sp-label-sheet__grid div:nth-child(3n) {
  border-right: 0;
}

.sp-label-sheet__grid .is-head {
  color: #e4edfa;
  font-weight: 700;
  background: rgba(22, 120, 255, 0.1);
}

.sp-label-preview {
  width: min(45%, 300px);
  right: 1%;
  bottom: 9%;
  padding: clamp(18px, 2vw, 28px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 20px;
  color: #101828;
  background: #f8fafc;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.38);
  transform: rotate(4deg) translateZ(40px);
}

.sp-label-preview::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(15, 23, 42, 0.13);
  border-radius: 13px;
  pointer-events: none;
}

.sp-label-preview__size {
  display: block;
  margin-bottom: 18px;
  color: #64748b;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.sp-label-preview strong {
  display: block;
  font-size: clamp(18px, 2vw, 28px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.sp-label-preview small {
  display: block;
  margin-top: 8px;
  color: #64748b;
  font-size: clamp(8px, 0.75vw, 11px);
}

.sp-barcode,
.sp-order-barcode {
  background: repeating-linear-gradient(
    90deg,
    currentColor 0 2px,
    transparent 2px 4px,
    currentColor 4px 5px,
    transparent 5px 8px,
    currentColor 8px 11px,
    transparent 11px 13px
  );
}

.sp-barcode {
  height: clamp(38px, 5vw, 58px);
  margin-top: 22px;
  color: #111827;
}

.sp-barcode-number {
  display: block;
  margin-top: 6px;
  text-align: center;
  color: #475569;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 8px;
  letter-spacing: 0.16em;
}

.sp-label-link {
  width: 46px;
  height: 46px;
  left: 53%;
  top: 48%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: #bfdbfe;
  background: rgba(10, 18, 32, 0.88);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  transform: translate(-50%, -50%);
}

.sp-label-link svg {
  width: 18px;
  height: 18px;
}

.sp-home__card--labels:hover .sp-label-sheet {
  transform: rotate(-5deg) translate(-5px, -7px);
}

.sp-home__card--labels:hover .sp-label-preview {
  transform: rotate(2deg) translate(7px, -9px) scale(1.025);
}

.sp-home__card--labels:hover .sp-label-link {
  transform: translate(-44%, -50%);
}

/* Video scene */
.sp-home__scene--video {
  display: flex;
  align-items: center;
  justify-content: center;
}

.sp-camera-frame {
  width: 86%;
  height: 78%;
  min-height: 300px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 30px;
  background:
    radial-gradient(circle at 50% 42%, rgba(99, 102, 241, 0.22), transparent 31%),
    linear-gradient(145deg, rgba(10, 16, 31, 0.94), rgba(5, 8, 17, 0.97));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 34px 90px rgba(0, 0, 0, 0.34);
  transition: transform 420ms cubic-bezier(0.2, 0.8, 0.2, 1), border-color 320ms ease;
}

.sp-camera-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: radial-gradient(circle at center, black 12%, transparent 78%);
}

.sp-camera-frame__top {
  position: absolute;
  z-index: 3;
  top: 20px;
  left: 22px;
  right: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sp-rec,
.sp-timecode {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  color: #dbe5f4;
  background: rgba(3, 7, 18, 0.56);
  backdrop-filter: blur(8px);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.sp-rec {
  gap: 7px;
  color: #fecaca;
}

.sp-rec i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #ef4444;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.8);
}

.sp-camera-focus {
  width: 44%;
  aspect-ratio: 1.16;
  position: absolute;
  left: 50%;
  top: 45%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(219, 234, 254, 0.55);
  transform: translate(-50%, -50%);
}

.sp-camera-focus > svg {
  width: clamp(62px, 8vw, 94px);
  height: clamp(62px, 8vw, 94px);
  stroke-width: 1;
}

.sp-corner {
  width: 28px;
  height: 28px;
  position: absolute;
  border-color: rgba(191, 219, 254, 0.62);
  border-style: solid;
}

.sp-corner--tl {
  left: 0;
  top: 0;
  border-width: 2px 0 0 2px;
  border-radius: 8px 0 0 0;
}

.sp-corner--tr {
  right: 0;
  top: 0;
  border-width: 2px 2px 0 0;
  border-radius: 0 8px 0 0;
}

.sp-corner--bl {
  left: 0;
  bottom: 0;
  border-width: 0 0 2px 2px;
  border-radius: 0 0 0 8px;
}

.sp-corner--br {
  right: 0;
  bottom: 0;
  border-width: 0 2px 2px 0;
  border-radius: 0 0 8px 0;
}

.sp-order-tag {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 20px;
  width: min(74%, 360px);
  padding: 13px 15px 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 15px;
  background: rgba(4, 8, 18, 0.76);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  transform: translateX(-50%);
}

.sp-order-tag span {
  display: block;
  color: #7f91aa;
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.sp-order-tag strong {
  display: block;
  margin-top: 3px;
  color: #e5edf8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(11px, 1vw, 14px);
  letter-spacing: 0.04em;
}

.sp-order-barcode {
  height: 18px;
  margin-top: 9px;
  color: rgba(226, 232, 240, 0.72);
}

.sp-home__card--video:hover .sp-camera-frame {
  transform: scale(1.025) rotate(-0.6deg);
  border-color: rgba(255, 255, 255, 0.22);
}

@media (max-width: 980px) {
  .sp-home__main {
    padding: 14px;
  }

  .sp-home__grid {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .sp-home__card {
    min-height: 680px;
  }

  .sp-home__scene {
    min-height: 390px;
  }

  .sp-label-sheet {
    width: min(62%, 470px);
  }

  .sp-label-preview {
    width: min(42%, 310px);
  }
}

@media (max-width: 620px) {
  .sp-home__main {
    padding: 10px;
  }

  .sp-home__grid {
    gap: 10px;
  }

  .sp-home__card {
    min-height: 610px;
    padding: 22px;
    border-radius: 26px;
  }

  .sp-home__scene {
    min-height: 330px;
    margin-top: 10px;
  }

  .sp-home__card h2 {
    font-size: clamp(38px, 13vw, 56px);
  }

  .sp-home__card p {
    font-size: 14px;
  }

  .sp-label-sheet {
    width: 72%;
    left: -3%;
    top: 11%;
  }

  .sp-label-preview {
    width: 51%;
    right: -3%;
    bottom: 8%;
    padding: 18px;
  }

  .sp-label-link {
    left: 52%;
    top: 50%;
  }

  .sp-camera-frame {
    width: 100%;
    height: 80%;
    min-height: 280px;
    border-radius: 24px;
  }

  .sp-camera-focus {
    width: 53%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sp-home__card,
  .sp-home__card::before,
  .sp-home__card::after,
  .sp-home__arrow,
  .sp-label-sheet,
  .sp-label-preview,
  .sp-label-link,
  .sp-camera-frame {
    transition: none;
  }
}
