/* Homepage — native scroll-snap fullpage (stable, no JS scroll hijack) */

html:has(body.nico-home--fullpage),
body.nico-home--fullpage {
  scroll-snap-type: y proximity;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

@media (prefers-reduced-motion: reduce) {
  html:has(body.nico-home--fullpage),
  body.nico-home--fullpage {
    scroll-behavior: auto;
    scroll-snap-type: none;
  }
}

body.nico-home--fullpage {
  overflow-x: hidden;
  overflow-y: visible;
}

/* Each panel = one full screen */
body.nico-home--fullpage .nico-home__panel {
  scroll-snap-align: start;
  scroll-snap-stop: normal;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  box-sizing: border-box;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: calc(var(--nico-home-nav-clearance) + var(--nico-home-nav-gap));
  padding-bottom: 2rem;
  overflow: visible;
}

body.nico-home--fullpage .nico-home__hero.nico-home__panel {
  align-items: stretch;
}

body.nico-home--fullpage .nico-home__section.nico-home__panel {
  padding-left: 0;
  padding-right: 0;
}

/* Footer — original layout, scrollable after panels */
body.nico-home--fullpage .nico-home__footer {
  scroll-snap-align: start;
  flex-shrink: 0;
}

/* Content always visible — never hidden */
body.nico-home--fullpage .nico-home__panel .container {
  width: 100%;
  max-width: 1320px;
  margin-left: auto;
  margin-right: auto;
  opacity: 1;
  transform: none;
  overflow: visible;
}

body.nico-home--fullpage .nico-home__panel > .container {
  flex: 0 0 auto;
  transform: none !important;
  opacity: 1 !important;
}

body.nico-home--fullpage .nico-home__section-title {
  margin-bottom: 2rem;
}

body.nico-home--fullpage .nico-home__cta-band {
  margin: 0;
  width: 100%;
}

/* Scroll hint — hide on CTA (last panel) */
body.nico-home--fullpage .nico-home__panel:not(.nico-home__section--cta)::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 1rem;
  width: 22px;
  height: 34px;
  margin-left: -11px;
  border: 2px solid rgba(70, 127, 207, 0.3);
  border-radius: 11px;
  opacity: 0.45;
  pointer-events: none;
  z-index: 2;
}

body.nico-home--fullpage .nico-home__panel:not(.nico-home__section--cta)::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 1.5rem;
  width: 4px;
  height: 7px;
  margin-left: -2px;
  background: var(--nico-accent);
  border-radius: 2px;
  animation: nico-scroll-hint 2.2s ease-in-out infinite;
  pointer-events: none;
  opacity: 0.65;
  z-index: 2;
}

@keyframes nico-scroll-hint {
  0%, 100% { transform: translateY(0); opacity: 0.3; }
  50% { transform: translateY(6px); opacity: 0.9; }
}

@media (prefers-reduced-motion: reduce) {
  body.nico-home--fullpage .nico-home__panel::after,
  body.nico-home--fullpage .nico-home__panel::before {
    display: none;
  }
}

/* Desktop */
@media (min-width: 992px) {
  body.nico-home--fullpage .nico-home__panel {
    padding-top: calc(var(--nico-home-nav-clearance) + var(--nico-home-nav-gap));
    padding-bottom: 2.5rem;
  }

  body.nico-home--fullpage .nico-home__section-title {
    margin-bottom: 2.5rem;
  }
}

/* ── Mobile layout polish ── */
@media (max-width: 991.98px) {
  body.nico-home--fullpage {
    --nico-home-nav-clearance: 3.25rem;
    --nico-home-nav-gap: 0.5rem;
  }

  body.nico-home--fullpage .nico-home__panel {
    min-height: 100svh;
    min-height: 100dvh;
    padding-top: calc(var(--nico-home-nav-clearance) + 0.75rem);
    padding-bottom: calc(var(--nico-home-nav-clearance) + 0.75rem);
    justify-content: center;
    align-items: center;
  }

  body.nico-home--fullpage .nico-home__panel > .container {
    width: 100%;
    flex: 0 0 auto;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    transform: none !important;
    opacity: 1 !important;
    transition: none !important;
  }

  /* AOS 不可加在 container 上，否則 transform 會破壞垂直置中 */
  body.nico-home--fullpage .nico-home__panel > .container.aos-init,
  body.nico-home--fullpage .nico-home__panel > .container.aos-animate {
    transform: none !important;
    opacity: 1 !important;
  }

  body.nico-home--fullpage .nico-home__panel-body {
    width: 100%;
  }

  /* Hero */
  body.nico-home--fullpage .nico-home__hero .row > .col-lg-6:first-child {
    text-align: center !important;
  }

  body.nico-home--fullpage .nico-home__badge {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(240, 245, 255, 0.9));
    border: 1px solid rgba(70, 127, 207, 0.2);
    box-shadow: 0 4px 20px rgba(2, 24, 76, 0.08);
    margin-bottom: 1rem;
  }

  body.nico-home--fullpage .nico-home__title {
    font-size: clamp(1.65rem, 7vw, 2rem);
    line-height: 1.28;
    margin-bottom: 0.85rem;
    background: linear-gradient(135deg, var(--nico-primary) 0%, var(--nico-accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  body.nico-home--fullpage .nico-home__lead {
    font-size: 0.92rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
  }

  body.nico-home--fullpage .nico-home__cta-row {
    gap: 0.7rem;
  }

  body.nico-home--fullpage .nico-home__cta-row .btn-getstarted {
    box-shadow: 0 10px 28px rgba(2, 24, 76, 0.22);
  }

  /* Section headers */
  body.nico-home--fullpage .nico-home__section-title {
    text-align: center !important;
    margin-bottom: 1.25rem;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  body.nico-home--fullpage .nico-home__section-kicker {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    background: rgba(70, 127, 207, 0.1);
    color: var(--nico-accent);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    margin-bottom: 0.55rem;
  }

  body.nico-home--fullpage .nico-home__section-heading {
    font-size: 1.3rem;
    line-height: 1.35;
    position: relative;
    padding-bottom: 0.65rem;
  }

  body.nico-home--fullpage .nico-home__section-heading::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 40px;
    height: 3px;
    margin-left: -20px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--nico-primary), var(--nico-accent));
  }

  /* Stats — 2×2 */
  body.nico-home--fullpage #stats .nico-home__section-title {
    text-align: center !important;
    padding: 0 !important;
    margin-bottom: 1rem;
  }

  body.nico-home--fullpage .nico-home__stats {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.7rem;
    overflow: visible !important;
    padding: 0 !important;
    flex-wrap: unset !important;
  }

  body.nico-home--fullpage .nico-home__stat {
    flex: unset !important;
    text-align: center !important;
    padding: 1.1rem 0.75rem;
    border-radius: 16px;
    background: linear-gradient(160deg, var(--nico-surface) 0%, rgba(240, 245, 255, 0.6) 100%);
    border: 1px solid rgba(70, 127, 207, 0.12);
    box-shadow: 0 6px 24px rgba(2, 24, 76, 0.07);
  }

  body.nico-home--fullpage .nico-home__stat i {
    width: 42px;
    height: 42px;
    margin: 0 auto 0.55rem;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(2, 24, 76, 0.08), rgba(70, 127, 207, 0.15));
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  body.nico-home--fullpage .nico-home__stat-value {
    font-size: 1.45rem;
    font-weight: 700;
  }

  body.nico-home--fullpage .nico-home__stat-label {
    font-size: 0.72rem;
    margin-top: 0.3rem;
  }

  /* Features — 2×2 */
  body.nico-home--fullpage .nico-home__features {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }

  body.nico-home--fullpage .nico-home__feature {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem 0.75rem;
    border-radius: 16px;
    background: var(--nico-surface);
    border: 1px solid rgba(70, 127, 207, 0.1);
    box-shadow: 0 4px 20px rgba(2, 24, 76, 0.06);
    gap: 0.5rem;
  }

  body.nico-home--fullpage .nico-home__feature-icon {
    width: 44px;
    height: 44px;
    margin-bottom: 0.15rem;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--nico-primary), var(--nico-accent));
    box-shadow: 0 6px 16px rgba(2, 24, 76, 0.18);
  }

  body.nico-home--fullpage .nico-home__feature h3 {
    font-size: 0.88rem;
    margin-bottom: 0.2rem;
  }

  body.nico-home--fullpage .nico-home__feature p {
    font-size: 0.74rem;
    line-height: 1.5;
  }

  /* Platforms */
  body.nico-home--fullpage .nico-home__platforms {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
  }

  body.nico-home--fullpage .nico-home__platform {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.85rem 0.4rem;
    gap: 0.45rem;
    border-radius: 14px;
    font-size: 0.72rem;
    box-shadow: 0 3px 14px rgba(2, 24, 76, 0.05);
  }

  body.nico-home--fullpage .nico-home__platform i,
  body.nico-home--fullpage .nico-home__platform .fab {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.15rem;
    background: rgba(70, 127, 207, 0.1);
    color: var(--nico-accent);
  }

  body.nico-home--fullpage .nico-home__platform:nth-child(1) i { background: rgba(225, 48, 108, 0.12); color: #e1306c; }
  body.nico-home--fullpage .nico-home__platform:nth-child(2) i { background: rgba(24, 119, 242, 0.12); color: #1877f2; }
  body.nico-home--fullpage .nico-home__platform:nth-child(3) i { background: rgba(0, 0, 0, 0.08); color: #111; }
  body.nico-home--fullpage .nico-home__platform:nth-child(4) i { background: rgba(255, 0, 0, 0.1); color: #ff0000; }
  body.nico-home--fullpage .nico-home__platform:nth-child(5) i { background: rgba(29, 161, 242, 0.12); color: #1da1f2; }
  body.nico-home--fullpage .nico-home__platform:nth-child(6) .fab { background: rgba(0, 195, 0, 0.12); color: #00c300; }
  body.nico-home--fullpage .nico-home__platform:nth-child(7) i { background: rgba(70, 127, 207, 0.12); color: var(--nico-accent); }

  /* Payments — 4 per row */
  body.nico-home--fullpage .nico-home__payments {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    max-width: 100%;
    width: 100%;
  }

  body.nico-home--fullpage .nico-home__payment {
    min-height: 88px;
    padding: 0.6rem 0.2rem;
    gap: 0.35rem;
    border-radius: 11px;
  }

  body.nico-home--fullpage .nico-home__payment-icon {
    width: 36px;
    height: 36px;
    font-size: 1rem;
    border-radius: 9px;
  }

  body.nico-home--fullpage .nico-home__payment-icon--img {
    padding: 2px;
  }

  body.nico-home--fullpage .nico-home__payment-label {
    font-size: 0.62rem;
    line-height: 1.2;
  }

  /* CTA */
  body.nico-home--fullpage .nico-home__cta-band {
    padding: 1.75rem 1.25rem;
    border-radius: 20px;
    box-shadow: 0 16px 40px rgba(2, 24, 76, 0.25);
  }

  body.nico-home--fullpage .nico-home__cta-band h2 {
    font-size: 1.35rem;
    margin-bottom: 0.65rem;
  }

  body.nico-home--fullpage .nico-home__cta-band p {
    font-size: 0.88rem;
    line-height: 1.65;
    margin-bottom: 1.15rem;
  }

  body.nico-home--fullpage .nico-home__cta-band .btn {
    border-radius: 14px;
    font-weight: 600;
  }

  /* Dark mode */
  body.nico-home--fullpage.nico-home--dark .nico-home__badge {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(21, 30, 46, 0.9));
    border-color: rgba(70, 127, 207, 0.25);
  }
}

@media (max-width: 575px) {
  body.nico-home--fullpage .nico-home__platforms {
    grid-template-columns: repeat(2, 1fr);
  }

  body.nico-home--fullpage .nico-home__platform:nth-child(7) {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: center;
    gap: 0.65rem;
  }

  body.nico-home--fullpage .nico-home__payments {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
  }

  body.nico-home--fullpage .nico-home__payment {
    min-height: 80px;
    padding: 0.5rem 0.15rem;
  }

  body.nico-home--fullpage .nico-home__payment-icon {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }

  body.nico-home--fullpage .nico-home__payment-label {
    font-size: 0.58rem;
  }
}

/* Override home-mobile.css rules that break fullpage panels */
@media (max-width: 991.98px) {
  body.nico-home--fullpage .nico-home__hero.nico-home__panel,
  body.nico-home--fullpage .nico-home__section.nico-home__panel {
    min-height: 100svh !important;
    min-height: 100dvh !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    padding-top: calc(var(--nico-home-nav-clearance) + 0.75rem) !important;
    padding-bottom: calc(var(--nico-home-nav-clearance) + 0.75rem) !important;
    overflow: visible !important;
  }

  body.nico-home--fullpage #stats.nico-home__panel {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}
