/*
 * Homepage section flow
 * Full-viewport opening, progressive section reveals and natural scrolling.
 */

:root {
  --home-header-height: 80px;
  --home-flow-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

#hero.hero-section {
  box-sizing: border-box;
  min-height: 100vh;
  min-height: 100svh;
  padding-top: max(7.5rem, calc(var(--home-header-height) + 2.5rem));
  padding-bottom: clamp(6.5rem, 11vh, 8rem);
  isolation: isolate;
}

#hero.hero-section::after {
  content: "";
  position: absolute;
  z-index: 1;
  right: 8%;
  bottom: -1px;
  left: 8%;
  height: clamp(80px, 13vh, 140px);
  pointer-events: none;
  background:
    radial-gradient(ellipse at 24% 100%, rgba(0, 210, 255, 0.13), transparent 48%),
    radial-gradient(ellipse at 76% 100%, rgba(177, 84, 255, 0.13), transparent 48%);
  filter: blur(10px);
  opacity: 0.78;
}

.home-scroll-cue {
  position: absolute;
  z-index: 5;
  bottom: clamp(1.1rem, 2.4vh, 1.75rem);
  left: 50%;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #eafcff;
  background:
    radial-gradient(circle at 30% 20%, rgba(121, 232, 246, 0.18), transparent 46%),
    linear-gradient(145deg, rgba(8, 20, 35, 0.78), rgba(18, 10, 34, 0.82));
  border: 1px solid rgba(135, 230, 248, 0.42);
  border-radius: 50%;
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.42),
    0 0 24px rgba(70, 214, 244, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform: translateX(-50%);
  opacity: 1;
  visibility: visible;
  transition:
    opacity 0.24s ease,
    visibility 0s linear 0s,
    border-color 0.24s ease,
    box-shadow 0.24s ease,
    background 0.24s ease;
}

.home-scroll-cue svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: home-cue-float 1.9s ease-in-out infinite;
}

.home-scroll-cue:hover {
  color: #fff;
  border-color: rgba(190, 139, 255, 0.66);
  box-shadow:
    0 14px 40px rgba(0, 0, 0, 0.46),
    0 0 30px rgba(147, 102, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.home-scroll-cue:focus-visible {
  outline: 3px solid rgba(121, 232, 246, 0.86);
  outline-offset: 4px;
}

.home-scroll-cue.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.24s ease,
    visibility 0s linear 0.24s,
    border-color 0.24s ease,
    box-shadow 0.24s ease,
    background 0.24s ease;
}

@keyframes home-cue-float {
  0%, 100% { transform: translateY(-2px); }
  50% { transform: translateY(4px); }
}

#portfolio,
#services-list,
#contact-section {
  scroll-margin-top: var(--home-header-height);
}

.home-section-transition {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  left: 0;
  height: clamp(76px, 10vw, 132px);
  pointer-events: none;
}

#portfolio .home-section-transition {
  background:
    linear-gradient(90deg, transparent 8%, rgba(92, 226, 246, 0.3) 35%, rgba(180, 105, 255, 0.32) 67%, transparent 92%) top / 100% 1px no-repeat,
    radial-gradient(ellipse at 50% 0%, rgba(99, 102, 241, 0.12), transparent 58%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.96), transparent 82%);
}

#services-list .home-section-transition {
  background:
    linear-gradient(90deg, transparent 8%, rgba(45, 212, 191, 0.27) 34%, rgba(139, 92, 246, 0.25) 66%, transparent 92%) top / 100% 1px no-repeat,
    linear-gradient(180deg, rgba(1, 4, 10, 0.68), transparent 88%);
}

#contact-section .home-section-transition {
  background:
    linear-gradient(90deg, transparent 8%, rgba(103, 232, 249, 0.24) 38%, rgba(244, 114, 182, 0.22) 68%, transparent 92%) top / 100% 1px no-repeat,
    linear-gradient(180deg, rgba(8, 14, 31, 0.56), transparent 88%);
}

.portfolio-container,
.services-container,
.contact-shell {
  z-index: 3;
}

body.home-flow-enhanced .home-reveal {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  transition:
    opacity 0.62s var(--home-flow-ease) var(--home-reveal-delay, 0ms),
    transform 0.72s var(--home-flow-ease) var(--home-reveal-delay, 0ms);
  will-change: opacity, transform;
}

body.home-flow-enhanced .home-reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  will-change: auto;
}

@media (max-width: 900px) {
  #hero.hero-section {
    min-height: 100vh;
    min-height: 100svh;
  }
}

@media (max-width: 600px) {
  :root { --home-header-height: 68px; }

  #hero.hero-section {
    min-height: 100vh !important;
    min-height: 100svh !important;
    align-items: flex-start !important;
    padding: clamp(6.7rem, 13.5svh, 7.6rem) 0 6rem !important;
  }

  .home-scroll-cue {
    bottom: max(1rem, env(safe-area-inset-bottom));
    width: 44px;
    height: 44px;
  }

  .home-scroll-cue svg {
    width: 20px;
    height: 20px;
  }

  .home-section-transition {
    height: 82px;
  }

  body.home-flow-enhanced .home-reveal {
    transform: translate3d(0, 16px, 0);
  }
}

@media (max-height: 700px) and (max-width: 600px) {
  #hero.hero-section {
    padding: 5.25rem 0 4.75rem !important;
  }

  #hero .hero-title {
    margin-bottom: 0.8rem !important;
    font-size: clamp(1.7rem, 8.7vw, 2.15rem) !important;
  }

  #hero .hero-ctas {
    gap: 6px !important;
  }

  #hero .hero-cta {
    min-height: 44px !important;
    padding-block: 0.5rem !important;
  }

  #hero .hero-desc {
    margin-top: 0.8rem !important;
    font-size: 0.79rem !important;
    line-height: 1.42 !important;
  }

  .home-scroll-cue {
    bottom: max(0.6rem, env(safe-area-inset-bottom));
    width: 38px;
    height: 38px;
  }
}

@media (max-height: 760px) and (min-width: 601px) {
  #hero.hero-section {
    padding-top: max(6.25rem, calc(var(--home-header-height) + 1.25rem));
    padding-bottom: 5.4rem;
  }

  #hero .hero-title {
    margin-bottom: 1.2rem;
    font-size: min(4rem, 4.25vw);
  }

  #hero .hero-cta {
    min-height: 60px;
  }

  #hero .hero-ctas + .hero-desc {
    margin-top: 1.2rem;
    font-size: 0.98rem;
  }

  .home-scroll-cue {
    bottom: 0.85rem;
    width: 42px;
    height: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }

  .home-scroll-cue,
  .home-scroll-cue svg,
  body.home-flow-enhanced .home-reveal {
    animation: none !important;
    transition: none !important;
  }

  .home-flow-enhanced .home-reveal {
    opacity: 1;
    transform: none;
  }
}
