html:has(body.site--home) {
  scroll-snap-type: y proximity;
  scroll-padding-top: 4.5rem;
}

body.site--home .lab-ambient {
  transition: filter 0.85s ease, background 0.85s ease;
}

body.site--home.is-home-panel-3 .lab-ambient {
  filter: brightness(1.18) saturate(1.12);
  background:
    radial-gradient(ellipse 90% 55% at 50% -8%, rgba(236, 196, 64, 0.42), transparent 58%),
    linear-gradient(180deg, #5c4a16 0%, #3f3512 55%, #2c2610 100%);
}

body.site--home.is-home-panel-3 .lab-ambient__orb--a {
  background: #d4b24a;
}

body.site--home.is-home-panel-3 .lab-ambient__orb--b {
  background: #8a6a18;
}

body.site--home.is-home-panel-3 .lab-ambient__grid {
  background-image:
    linear-gradient(rgba(240, 214, 120, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(240, 214, 120, 0.08) 1px, transparent 1px);
}

body.site--home .home-stage {
  padding: 0;
  min-height: 0;
}

.home-panel {
  position: relative;
  min-height: calc(100dvh - 4.5rem);
  padding: clamp(1.25rem, 3vw, 2.25rem) clamp(1rem, 3vw, 1.75rem) 3.4rem;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.home-panel--main {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.site--home-auth .home-panel--main {
  justify-content: flex-start;
}

.site--home-guest .home-login {
  margin-block: 0 auto;
  scroll-margin-top: 5.5rem;
}

.home-panel__more {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.12rem;
  color: #c5d8e8;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  z-index: 3;
}

.home-panel__more-icon {
  font-size: 1.2rem;
  line-height: 1;
  animation: home-more-bounce 1.8s ease-in-out infinite;
}

.home-panel--discover {
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.045);
}

.home-discover {
  width: min(42rem, 100%);
  text-align: center;
}

.home-discover__kicker {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: #9dc0dc;
}

.home-discover__title {
  margin: 0 0 0.9rem;
  font-size: clamp(1.55rem, 4.2vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.35;
  color: #f4f8fb;
}

.home-discover__lead {
  margin: 0 auto 1.45rem;
  max-width: 36rem;
  font-size: 0.98rem;
  line-height: 1.9;
  color: rgba(232, 238, 244, 0.78);
}

.home-discover__search {
  display: flex;
  align-items: stretch;
  width: 100%;
  border-radius: 0.4rem;
  overflow: hidden;
  background: rgba(8, 24, 40, 0.55);
  border: 1px solid rgba(160, 198, 224, 0.42);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.home-discover__search:focus-within {
  border-color: #7eb0d4;
  box-shadow: 0 0 0 3px rgba(31, 95, 153, 0.28);
}

.home-discover__input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.95rem 1.1rem;
  border: 0;
  background: transparent;
  color: #f4f8fb;
  font: inherit;
  font-size: 1.04rem;
  font-weight: 600;
  text-align: right;
}

.home-discover__input::placeholder {
  color: rgba(232, 238, 244, 0.4);
}

.home-discover__input:focus {
  outline: none;
}

.home-discover__submit {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.95rem 1.4rem;
  border: 0;
  background: var(--lab-accent, #1f5f99);
  color: #fff;
  font: inherit;
  font-size: 0.98rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.home-discover__submit:hover {
  background: #184e80;
}

.home-discover__submit:disabled,
.home-discover__submit.is-busy {
  cursor: wait;
  opacity: 0.78;
}

.home-panel--widgets {
  display: grid;
  place-items: center;
  background: rgba(232, 196, 72, 0.08);
}

.home-widgets {
  width: min(56rem, 100%);
  text-align: center;
}

.home-widgets__title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.55rem, 4.2vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.35;
  color: #ffe9a8;
}

.home-widgets__lead {
  margin: 0 auto 1.8rem;
  max-width: 34rem;
  font-size: 1.02rem;
  line-height: 1.9;
  color: rgba(255, 241, 196, 0.82);
}

.home-widgets__mosaic {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  column-gap: clamp(0.35rem, 2.4vw, 1.8rem);
  row-gap: 0.2rem;
  padding: 0.2rem 0.4rem 0.6rem;
}

.home-widgets__tile {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 8.6rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.home-widgets__tile:nth-child(odd) {
  margin-top: 1.45rem;
}

.home-widgets__tile:nth-child(3n) {
  margin-top: 2.25rem;
}

.home-widgets__tile:nth-child(4n+2) {
  margin-top: 0.2rem;
}

.home-widgets__tile:nth-child(5n) {
  margin-inline: 0.7rem;
}

.home-widgets__tile:nth-child(6n+4) {
  margin-top: 1.85rem;
  margin-inline-start: 1.1rem;
}

.home-widgets__tile:nth-child(3n+1) {
  transform: rotate(-6deg);
}

.home-widgets__tile:nth-child(3n+2) {
  transform: rotate(4.5deg);
}

.home-widgets__tile:nth-child(3n) {
  transform: rotate(-2.8deg);
}

.home-widgets__tile:nth-child(5n+1) {
  transform: rotate(6.5deg);
}

.home-widgets__tile:hover,
.home-widgets__tile:focus-visible {
  z-index: 3;
  outline: none;
  transform: rotate(0deg) translateY(-0.18rem);
}

.home-widgets__bubble {
  position: relative;
  display: grid;
  place-items: center;
  width: 9.4rem;
  height: 9.4rem;
  animation: home-widgets-float 2.8s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 0.28s);
}

.home-widgets__tile:nth-child(even) .home-widgets__bubble {
  animation-duration: 3.2s;
}

.home-widgets__orbit {
  position: absolute;
  inset: auto;
  width: 7.4rem;
  height: 7.4rem;
  border: 1px solid rgba(255, 220, 120, 0.28);
  border-radius: 50%;
  animation: home-widgets-pulse 2.4s ease-out infinite;
  animation-delay: calc(var(--i, 0) * 0.18s);
}

.home-widgets__orbit--b {
  width: 9.4rem;
  height: 9.4rem;
  animation-delay: calc(0.7s + var(--i, 0) * 0.18s);
}

.home-widgets__icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 4.6rem;
  height: 4.6rem;
  overflow: hidden;
  border-radius: 1.1rem;
  color: #2c2610;
  background: linear-gradient(160deg, #ffe38a, #d4a017);
  box-shadow:
    0 0 0 6px rgba(232, 196, 72, 0.16),
    0 14px 28px rgba(0, 0, 0, 0.28);
}

.home-widgets__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-widgets__tile:hover .home-widgets__icon,
.home-widgets__tile:focus-visible .home-widgets__icon {
  box-shadow:
    0 0 0 8px rgba(232, 196, 72, 0.28),
    0 18px 32px rgba(0, 0, 0, 0.34);
}

.home-widgets__label {
  position: relative;
  z-index: 1;
  max-width: 8.4rem;
  margin-top: -0.35rem;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.45;
  color: #ffe9a8;
  text-shadow: 0 0 18px rgba(255, 214, 90, 0.35);
}

@keyframes home-widgets-pulse {
  0% { transform: scale(0.72); opacity: 0.7; }
  100% { transform: scale(1.18); opacity: 0; }
}

@keyframes home-widgets-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-0.45rem); }
}

@keyframes home-more-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(0.28rem); }
}

@media (max-width: 640px) {
  .home-discover__search {
    flex-direction: column;
  }

  .home-discover__input {
    text-align: center;
  }

  .home-widgets__tile {
    width: 7.4rem;
    transform: none !important;
    margin-top: 0.55rem !important;
    margin-inline: 0 !important;
  }

  .home-widgets__bubble {
    width: 8.2rem;
    height: 8.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html:has(body.site--home) {
    scroll-snap-type: none;
  }

  body.site--home .lab-ambient {
    transition: none;
  }

  .home-panel__more-icon,
  .home-widgets__orbit,
  .home-widgets__bubble {
    animation: none;
  }
}
