/* ---------- Home  ---------- */
/* #region Home */

/* Theme tokens (scoped to #home to avoid globals) */
#home {
  --panel-padding: clamp(1rem, 4vw, 2.5rem);
  --text-shadow-strong: 0 2px 8px rgba(0, 0, 0, 0.25);
  --bubble-color: rgba(102, 178, 255, 0.2);
  --bubble-color-dark: rgba(0, 51, 102, 0.2);
  --bubble-shadow-inset: 0 10px 24px rgba(0, 0, 0, 0.12) inset;
  --bubble-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

#home {
  position: relative;
  display: flex;
  justify-content: space-between;
  width: 100%;
  height: 100vh;
  max-height: 1080px;
  overflow: hidden;
  color: #fff;
  background: var(--bg-main-color);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: rgba(0, 0, 0, 0.16) 0 10px 36px 0, rgba(0, 0, 0, 0.06) 0 0 0 1px;
}

#home .container {
  position: relative;
  display: flex;
  justify-content: center;
}

#home .panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-flow: column nowrap;
  justify-content: center;
  gap: 2rem;
  padding: 0 clamp(2rem, 4vw, 10rem);
}

/* ============ Bubbles ============ */
#home .panel .bubble {
  position: absolute;
  width: 10rem;
  height: 10rem;
  border-radius: 50%;
  background: var(--bubble-color);
  backdrop-filter: blur(2px);
  box-shadow: var(--bubble-shadow-inset), var(--bubble-shadow);
  /* subtle floating */
  --float-speed: 12s;
  --float-delay: 0s;
  --float-range: 10px; /* vertical travel */
  --float-drift: 8px; /* horizontal drift */
  will-change: transform;
  animation: bubbleFloat var(--float-speed) ease-in-out var(--float-delay)
    infinite alternate;
}

/* Individual bubble layout + slight motion variance */
#home .panel .nr1 {
  top: 15%;
  left: 30%;
  width: 5rem;
  height: 5rem;
  --float-speed: 11s;
  --float-delay: 0.2s;
  --float-range: 8px;
  --float-drift: 6px;
}
#home .panel .nr2 {
  top: 17%;
  left: 38%;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 13rem;
  height: 13rem;
  font-size: 2.1rem;
  line-height: 2rem;
  font-weight: 300;
  color: #66b2ff;
  text-align: center;
  --float-speed: 15s;
  --float-delay: 0.1s;
  --float-range: 12px;
  --float-drift: 10px;
}
#home .panel .nr3 {
  top: 10%;
  left: 50%;
  width: 8rem;
  height: 8rem;
  --float-speed: 12.5s;
  --float-delay: 0.35s;
  --float-range: 10px;
  --float-drift: 7px;
}
#home .panel .nr4 {
  top: 65%;
  left: 55%;
  width: 5rem;
  height: 5rem;
  --float-speed: 9.5s;
  --float-delay: 0.15s;
  --float-range: 7px;
  --float-drift: 6px;
}
#home .panel .nr5 {
  top: 75%;
  left: 45%;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 15rem;
  height: 15rem;
  font-size: 1.6rem;
  line-height: 2rem;
  font-weight: 300;
  color: #66b2ff;
  text-align: center;
  background: var(--bubble-color-dark);
  --float-speed: 16s;
  --float-delay: 0.25s;
  --float-range: 12px;
  --float-drift: 10px;
}
#home .panel .nr6 {
  top: 75%;
  left: 70%;
  width: 8rem;
  height: 8rem;
  background: var(--bubble-color-dark);
  --float-speed: 13s;
  --float-delay: 0.4s;
  --float-range: 9px;
  --float-drift: 7px;
}

/* ============ Panel content ============ */
#home .panel h1 {
  z-index: 2;
  margin: 0 0 0.6rem 0;
  font-size: clamp(4.7rem, 5.5vw, 10rem);
  line-height: clamp(3rem, 5.5vw, 6.5rem);
  font-weight: 700;
  letter-spacing: 0.2px;
  text-shadow: var(--text-shadow-strong);
}

#home .panel p {
  max-width: 60ch;
  font-size: 2rem;
  line-height: 1.35;
  font-weight: 200;
}

#home .panel .contact {
  display: inline-block;
  width: fit-content;
  padding: 0.9rem 2rem;
  font-size: 2rem;
  font-weight: 700;
  color: #113a71;
  background: #fff;
  border-radius: 10px;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease, box-shadow 0.25s ease, background 0.25s ease;
}
#home .panel .contact:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25);
}
#home .panel .contact:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}

/* ============ Image ============ */
#home img {
  display: block;
  width: 50%;
  height: 100%;
  object-fit: cover;
  border-radius: 0 0 2rem 0;
  transform-origin: center;
  /* Complex clip-path kept as-is */
  clip-path: shape(
    nonzero from 53.71px 1080px,
    curve to 997px 1080px with 422.09px 1080px / 628.62px 1080px,
    line to 997px 0px,
    line to 53.71px 0.5px,
    curve to 117.17px 73.07px with 53.71px 0.5px / 88.1px 14.49px,
    curve to 53.71px 303.28px with 156.07px 151.49px / 44.67px 216.18px,
    curve to 130.66px 568.53px with 67.79px 439.02px / 150.24px 433.47px,
    curve to 0.69px 850.79px with 114.02px 683.32px / 10.57px 735.22px,
    curve to 53.71px 1080px with -7.11px 942.06px / 53.71px 1080px,
    close
  );
}

/* ============ On-load reveal targets (start hidden) ============ */
#home .panel h1,
#home .panel p,
#home .panel .contact,
#home > img {
  opacity: 0;
  transform: translateY(10px);
  will-change: transform, opacity;
}

/* ============ On-load animations ============ */
body.loaded #home .panel h1 {
  animation: revealUp 0.75s cubic-bezier(0.2, 0.65, 0.2, 1) 0.05s forwards;
}
body.loaded #home .panel p {
  animation: revealUp 0.75s cubic-bezier(0.2, 0.65, 0.2, 1) 0.18s forwards;
}
body.loaded #home .panel .contact {
  animation: revealUp 0.75s cubic-bezier(0.2, 0.65, 0.2, 1) 0.3s forwards;
}
body.loaded #home > img {
  animation: heroIn 1s cubic-bezier(0.2, 0.65, 0.2, 1) 0.15s forwards;
}

/* ============ Keyframes ============ */
@keyframes revealUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes heroIn {
  0% {
    opacity: 0;
    transform: scale(1.04) translateY(6px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
/* subtle floating path for bubbles */
@keyframes bubbleFloat {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(var(--float-drift), calc(-1 * var(--float-range)), 0)
      scale(1.015);
  }
  100% {
    transform: translate3d(calc(-1 * var(--float-drift)), 0, 0) scale(1);
  }
}

/* ============ Breakpoints ============ */
@media (max-width: 992px) {
  #home img {
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    clip-path: none;
    mix-blend-mode: multiply;
    background-color: var(--accent-color);
    filter: brightness(80%);
  }

  #home .container {
    width: 100%;
    height: 100%;
    align-items: stretch;
  }
}

/* #endregion */

/* ---- Respect prefers-reduced-motion for #home ---- */
@media (prefers-reduced-motion: reduce) {
  /* Nuke animations/transitions and smooth scrolling */
  #home,
  #home *,
  #home *::before,
  #home *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  /* Ensure items that start hidden become visible immediately */
  #home .panel h1,
  #home .panel p,
  #home .panel .contact,
  #home > img {
    opacity: 1 !important;
    transform: none !important;
  }

  /* Stop bubble motion (keep or hide: choose one) */
  #home .panel .bubble {
    animation: none !important;
    transform: none !important;
  }
  /* If you prefer to hide decorative bubbles entirely, uncomment: */
  /* #home .panel .bubble { display: none !important; } */

  /* Disable hover lift on the CTA */
  #home .panel .contact,
  #home .panel .contact:hover,
  #home .panel .contact:active {
    transform: none !important;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2) !important; /* steady shadow */
  }

  /* Hero image: no scale/slide-in */
  #home > img {
    transform: none !important;
    filter: none; /* optional: reduce jank on low-power devices */
  }
}
