/* Interactive hero styles. This stylesheet is loaded only by the portfolio root page. */
#home {
  gap: clamp(2rem, 4vw, 6rem);
  overflow: hidden;
  padding-top: max(112px, 12rem);
  padding-bottom: 15rem;
}

/* Home portrait only: keep a fluid size without crowding the fixed navbar. */
#home > .img4 {
  display: block;
  flex: 0 1 auto;
  width: clamp(18rem, calc(14rem + 10vw), 32rem);
  max-width: 36%;
  height: auto;
  margin: clamp(24px, 4vh, 48px) 0 0;
  align-self: center;
}

#home .text-content {
  position: relative;
  z-index: 2;
  min-width: 0;
}

#home .hero-badges {
  position: relative;
  width: min(70rem, 100%);
  margin-bottom: 8px;
}

#home .hero-badges + h1 {
  margin-top: 0;
  line-height: 1.2;
}

#home .hero-physics-field {
  position: relative;
  width: 100%;
  height: clamp(14rem, 22vh, 19rem);
  /* Physics contains the shape; let only decorative shadows extend past it. */
  overflow: visible;
  touch-action: none;
  isolation: isolate;
}

#home .hero-badge {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 4.4rem;
  padding: .9rem 1.5rem;
  border: .16rem solid rgba(148, 163, 184, .42);
  border-radius: 999px;
  background: rgba(8, 17, 42, .96);
  box-shadow: 0 .45rem 0 rgba(0, 0, 0, .5), 0 1rem 2.4rem rgba(0, 0, 0, .2);
  color: #e8eefc;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
  cursor: grab;
  user-select: none;
  opacity: 0;
  transform: translate(-50%, -50%) translate(var(--physics-x, 0), var(--physics-y, 0)) rotate(var(--physics-angle, 0));
  will-change: transform;
}

#home .hero-physics-field.is-ready .hero-badge { opacity: 1; }
#home .hero-badge.is-dragging { z-index: 8; cursor: grabbing; border-color: #80f5ce; box-shadow: 0 .7rem 0 rgba(0, 0, 0, .45), 0 1.6rem 3rem rgba(37, 99, 235, .35); }
#home .hero-badge span { margin-right: .55rem; color: #2dbe50; font-size: 1.5rem; text-shadow: 0 0 .65rem rgba(45, 190, 80, .24); }
#home .hero-badge-light { border-color: rgba(255, 255, 255, .9); background: #f8fafc; color: #081632; }
#home .hero-badge-light span { color: #15933a; text-shadow: none; }
#home .hero-badge-round { width: 4.8rem; min-width: 4.8rem; height: 4.8rem; padding: 0; border-color: rgba(128, 245, 206, .55); }
#home .hero-badge-round span { margin: 0; font-size: 2.2rem; }

#home .hero-badge-tools {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 3.2rem;
  margin-top: .15rem;
  color: #94a3b8;
  font-size: 1rem;
}

#home .hero-badge-tools > span { color: inherit; }
#home .hero-reset {
  min-height: 4.4rem;
  padding: .55rem .8rem;
  border: 0;
  background: transparent;
  color: #b9cbfc;
  font-size: 1.05rem;
  cursor: pointer;
}

#home .hero-reset:hover { color: #80f5ce; }
#home .hero-badge:focus-visible,
#home .hero-reset:focus-visible { outline: .2rem solid #80f5ce; outline-offset: .35rem; }

#home.hero-physics-fallback .hero-physics-field {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: .8rem;
}
#home.hero-physics-fallback .hero-badge { position: relative; inset: auto; opacity: 1; transform: none; }

@media (max-width: 768px) {
  #home { gap: 1rem; padding-bottom: clamp(8rem, 14vh, 11rem); }
  #home > .img4 {
    flex: none;
    width: clamp(130px, 38vw, 220px);
    max-width: 70%;
    margin: 0 0 1.5rem;
  }
  #home .text-content { width: 100%; max-width: 100%; padding-inline: 2rem; }
  #home .hero-badges { margin-top: 1.2rem; }
  #home .hero-physics-field { height: clamp(13rem, 20vh, 15rem); }
  #home .hero-badge { min-height: 4rem; padding: .75rem 1.15rem; font-size: 1.15rem; }
  #home .hero-badge-tools { justify-content: center; }
  #home .hero-badge-tools > span { max-width: 22rem; text-align: center; }
  #home .text-content h1 { margin-top: 0; }
  #home .text-content h1, #home .text-content p { max-width: 100%; text-align: center; overflow-wrap: anywhere; }
}

@media (max-width: 450px) {
  #home .hero-badge { padding: .7rem 1rem; font-size: 1.05rem; }
}

@media (prefers-reduced-motion: reduce) {
  #home *, #home *::before, #home *::after { animation: none !important; transition: none !important; }
  #home .hero-physics-field { display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: .8rem; height: auto; min-height: 10rem; overflow: visible; touch-action: auto; }
  #home .hero-badge { position: relative; inset: auto; opacity: 1; transform: none !important; will-change: auto; }
  #home .text-content h1, #home .text-content p, #home .text-animation h2, #home .social-media i { opacity: 1; transform: none; }
  #home .text-animation h2 { color: #22c55e; background-position: 0 0; }
  #home .text-animation::before, #home .btn-section::before { display: none; }
  #home > .img4 { scale: 1; }
}
