/* Premium home — Knowledge Hub + Onboarding */
.home-premium {
  --hp-white: #fff;
  --hp-milk: #f8faf9;
  --hp-gray: #f1f5f3;
  --hp-text: #0f172a;
  --hp-muted: #64748b;
  --hp-g1: #cff7d3;
  --hp-g2: #a7f3b0;
  --hp-g4: #34c759;
  --hp-g5: #12853d;
  --hp-radius: 20px;
  --hp-shadow: 0 20px 50px rgba(15, 23, 42, 0.06);
  --hp-glass: rgba(255, 255, 255, 0.78);
}

/* Knowledge Hub */
.home-hub {
  background: linear-gradient(180deg, var(--hp-milk) 0%, #fff 100%);
}

.home-hub__head {
  margin-bottom: 22px;
}

.home-hub__title {
  margin: 0;
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.home-hub__grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 640px) {
  .home-hub__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .home-hub__grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.home-hub-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 108px;
  padding: 12px 10px;
  border-radius: 16px;
  background: var(--hp-glass);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(52, 199, 89, 0.16);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.home-hub-card:hover {
  transform: translateY(-4px);
  border-color: rgba(52, 199, 89, 0.35);
  box-shadow: 0 14px 32px rgba(52, 199, 89, 0.12);
}

.home-hub-card__icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(160deg, var(--hp-g1), #fff);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.home-hub-card__icon--img img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.home-hub-card__label {
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

/* Instagram — CSS logo */
.home-hub-card--instagram .home-hub-card__icon {
  background: linear-gradient(160deg, #fdf2f8, #faf5ff);
}

.hp-insta-logo {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f9ce34, #ee2a7b 45%, #6228d7 78%, #8134af);
  background-size: 200% 200%;
  animation: hp-insta-gradient 4s ease infinite;
  box-shadow: 0 10px 24px rgba(238, 42, 123, 0.28);
}

.hp-insta-logo__lens {
  position: absolute;
  inset: 11px;
  border: 3px solid #fff;
  border-radius: 10px;
  box-sizing: border-box;
}

.hp-insta-logo__lens::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 2px solid #fff;
  border-radius: 50%;
}

.hp-insta-logo__flash {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
}

.home-hub-card--instagram:hover .hp-insta-logo {
  animation: hp-insta-gradient 2s ease infinite, hp-insta-pop 0.45s ease;
}

@keyframes hp-insta-gradient {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes hp-insta-pop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.08) rotate(-3deg);
  }
  100% {
    transform: scale(1);
  }
}

/* GLN animated digits on card */
.home-hub-card--gln .home-hub-card__viz {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 48px;
  padding: 4px;
}

.home-hub-card--gln .home-hub-card__digit {
  min-width: 0.95em;
  padding: 3px 2px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.85);
  font-size: 9px;
  font-weight: 800;
  color: var(--hp-g5);
  font-variant-numeric: tabular-nums;
  transition: transform 0.25s ease, background 0.25s ease;
}

.home-hub-card--gln:hover .home-hub-card__digit {
  animation: hp-digit-pop 0.5s ease backwards;
}

.home-hub-card--gln:hover .home-hub-card__digit:nth-child(odd) {
  background: linear-gradient(135deg, var(--hp-g4), var(--hp-g5));
  color: #fff;
}

/* Acquiring NFC hover */
.home-hub-card--acq .home-hub-card__viz {
  width: 48px;
  height: 40px;
}

.home-hub-card--acq .home-hub-card__viz svg {
  width: 100%;
  height: 100%;
}

.home-hub-card--acq .hp-nfc-ring {
  opacity: 0.35;
  transform-origin: center;
}

.home-hub-card--acq:hover .hp-nfc-ring {
  animation: hp-nfc-pulse 1.2s ease-in-out infinite;
}

.home-hub-card--acq .hp-pay-ok {
  opacity: 0;
  transition: opacity 0.35s ease;
}

.home-hub-card--acq:hover .hp-pay-ok {
  opacity: 1;
}

/* Onboarding — horizontal scroll */
.home-guide {
  background: linear-gradient(180deg, #fff 0%, var(--hp-milk) 40%, #fff 100%);
  overflow: visible;
}

.home-guide__head {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 20px;
  padding-top: 8px;
}

.home-guide__title {
  margin: 0 0 10px;
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.home-guide__lead {
  margin: 0;
  color: var(--hp-muted);
  font-size: 17px;
  line-height: 1.55;
}

.hp-onboard-root {
  width: 100%;
}

.hp-onboard__controls {
  max-width: 1100px;
  margin: 0 auto 16px;
  padding: 0 20px;
}

.hp-onboard__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 18px;
}

.hp-onboard__tab {
  padding: 12px 22px;
  border-radius: 14px;
  border: 1px solid rgba(52, 199, 89, 0.2);
  background: var(--hp-glass);
  backdrop-filter: blur(10px);
  font-weight: 700;
  font-size: 14px;
  color: var(--hp-muted);
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.hp-onboard__tab.is-active {
  background: linear-gradient(135deg, var(--hp-g4), var(--hp-g5));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 12px 28px rgba(52, 199, 89, 0.28);
}

.hp-onboard__progress-wrap {
  display: grid;
  gap: 8px;
}

.hp-onboard__progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--hp-muted);
}

.hp-onboard__progress-meta strong {
  color: var(--hp-g5);
  font-variant-numeric: tabular-nums;
}

.hp-onboard__progress {
  height: 4px;
  border-radius: 999px;
  background: rgba(52, 199, 89, 0.12);
  overflow: hidden;
}

.hp-onboard__progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--hp-g2), var(--hp-g4), var(--hp-g5));
  box-shadow: 0 0 12px rgba(52, 199, 89, 0.45);
  transition: width 0.15s ease-out;
}

.hp-onboard__stage {
  display: none;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.hp-onboard__stage.is-active {
  display: block;
  opacity: 1;
}

.hp-carousel {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 12px 8px;
}

.hp-carousel__nav {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(52, 199, 89, 0.25);
  background: var(--hp-glass);
  backdrop-filter: blur(10px);
  color: var(--hp-g5);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.hp-carousel__nav:hover:not(:disabled) {
  background: rgba(207, 247, 211, 0.6);
  border-color: var(--hp-g4);
}

.hp-carousel__nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.hp-carousel__viewport {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(52, 199, 89, 0.35) transparent;
  padding: 4px 0 12px;
}

.hp-carousel__viewport:focus-visible {
  outline: 2px solid var(--hp-g4);
  outline-offset: 4px;
  border-radius: 12px;
}

.hp-carousel__track {
  display: flex;
  flex-wrap: nowrap;
  gap: 14px;
  padding: 8px 0;
}

.hp-carousel__pad {
  flex: 0 0 max(12px, calc(50% - min(140px, 39vw)));
  pointer-events: none;
}

.hp-slide {
  flex: 0 0 min(280px, 78vw);
  scroll-snap-align: center;
}

.hp-slide__inner {
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--hp-glass);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06), 0 0 0 1px rgba(52, 199, 89, 0.08);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.hp-slide.is-active .hp-slide__inner {
  border-color: rgba(52, 199, 89, 0.32);
  box-shadow: 0 16px 40px rgba(52, 199, 89, 0.12), 0 0 0 1px rgba(52, 199, 89, 0.15);
}

.hp-slide--success .hp-slide__inner {
  background: linear-gradient(160deg, rgba(207, 247, 211, 0.55), #fff);
  border-color: rgba(52, 199, 89, 0.35);
}

.hp-slide__idx {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--hp-g4);
  margin-bottom: 12px;
}

.hp-slide__title {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.hp-slide__text {
  margin: 0;
  font-size: 13px;
  color: var(--hp-muted);
  line-height: 1.5;
}

.hp-slide__link {
  font-weight: 700;
  color: var(--hp-g5);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.hp-slide__link:hover {
  color: var(--hp-g4);
}

.hp-slide__link--btn {
  display: inline;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  cursor: pointer;
}

@media (max-width: 640px) {
  .hp-carousel {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .hp-carousel__nav {
    display: none;
  }

}

@media (prefers-reduced-motion: reduce) {
  .hp-insta-logo {
    animation: none;
  }

  .home-hub-card--instagram:hover .hp-insta-logo {
    animation: none;
  }

  .hp-carousel__viewport {
    scroll-behavior: auto;
  }

  .hp-slide__inner {
    transition: none;
  }
}

.hp-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.hp-reveal.is-in {
  opacity: 1;
  transform: none;
}

@keyframes hp-digit-pop {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes hp-nfc-pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(1);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hp-reveal {
    opacity: 1;
    transform: none;
  }

  .home-hub-card--gln:hover .home-hub-card__digit,
  .home-hub-card--acq:hover .hp-nfc-ring {
    animation: none;
  }
}
