/* Scroll-driven homepage hero. Only active on the home page. */
html.nxh-wait main.container, html.nxh-wait .site-meta-section { visibility: hidden; }
#nxHeroTrack { display: none; position: relative; z-index: 2; pointer-events: none; }
body.nxh-on #nxHeroTrack { display: block; height: calc(var(--nxh-stage) + var(--nxh-length)); }
body.nxh-on #welcomeBanner { display: none; }
body.nxh-on:not(.nxh-static) main.container { position: relative; z-index: 1; margin-top: calc(var(--nxh-stage) * -1); }

#nxHero { position: sticky; top: var(--nxh-nav); height: var(--nxh-stage); pointer-events: auto; }
#nxHero.nxh-done { visibility: hidden; pointer-events: none; }

.nxh-layer { position: absolute; inset: 0; overflow: hidden; background: #171310; }
.nxh-layer canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#nxHeroSoil { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* A dark sky for the text. It sits over the footage and doesn't alter it. */
.nxh-dim { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to bottom, rgba(10, 8, 6, 0.86) 0%, rgba(10, 8, 6, 0.72) 28%, rgba(10, 8, 6, 0.28) 48%, rgba(10, 8, 6, 0) 66%); }

.nxh-text { position: absolute; left: 0; right: 0; top: clamp(12px, 2.5%, 28px); display: flex; flex-direction: column; align-items: center; padding: 0 16px; text-align: center; color: #F5F1EA; --nxh-scale: inherit; }
.nxh-wordmark { margin: 0 0 16px; width: calc(clamp(270px, 46vw, 760px) * var(--nxh-scale, 1)); max-width: 100%; line-height: 0; }
.nxh-wordmark img { display: block; width: 100%; height: auto; filter: drop-shadow(0 2px 18px rgba(0, 0, 0, 0.55)); }
.nxh-headline { margin: 0 0 20px; font-family: 'Playfair Display', Georgia, 'Times New Roman', serif; font-style: italic; font-weight: 500; font-size: calc(clamp(26px, 3.6vw, 52px) * var(--nxh-scale, 1)); line-height: 1.2; color: #F5F1EA; text-shadow: 0 2px 24px rgba(0, 0, 0, 0.6); }
.nxh-word { display: inline-block; }
.nxh-spaced { margin-right: 0.26em; }
.nxh-nowrap { white-space: nowrap; }
.nxh-accent { color: var(--orange); }
.nxh-subline { margin: 0; max-width: 560px; font-family: Manrope, 'Inter', -apple-system, Roboto, Arial, sans-serif; font-weight: 400; font-size: clamp(15px, 1.3vw, 19px); line-height: 1.45; letter-spacing: 0.02em; color: #F5F1EA; opacity: 0.85; text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6); }

.nxh-cta { position: absolute; left: 50%; bottom: 20px; width: min(620px, calc(100% - 32px)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 10px; }
.nxh-search { position: relative; }
.nxh-search i { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: #6b7a8a; }
.nxh-search input { width: 100%; min-height: 50px; padding: 0 18px 0 46px; box-sizing: border-box; border: 0; border-radius: 40px; background: rgba(255, 255, 255, 0.96); color: #0b1a2a; font: inherit; font-size: 16px; box-shadow: 0 8px 26px rgba(0, 0, 0, 0.3); }
.nxh-buttons { display: flex; gap: 10px; }
.nxh-buttons button { flex: 1; min-height: 48px; padding: 0 12px; border-radius: 40px; font: inherit; font-weight: 600; font-size: 0.95rem; cursor: pointer; transition: transform 0.2s; }
.nxh-buttons button:active { transform: scale(0.97); }
.nxh-solid { border: 2px solid var(--orange); background: var(--orange); color: #fff; }
.nxh-outline { border: 2px solid #fff; background: rgba(20, 16, 12, 0.35); color: #fff; }

.nxh-controls { position: absolute; left: 0; right: 0; bottom: 142px; display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none; }
.nxh-hint { color: #fff; font-size: 0.95rem; font-weight: 600; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.75); }
.nxh-hint i { display: block; margin-top: 2px; text-align: center; animation: nxh-bob 1.6s ease-in-out infinite; }
@keyframes nxh-bob { 50% { transform: translateY(5px); } }

/* Reduced motion and data saver: one picture and the logo, with no scrolling effect. */
body.nxh-static #nxHeroTrack { height: auto; }
body.nxh-static #nxHero { position: relative; top: 0; }
body.nxh-static .nxh-dim { opacity: 1; }
body.nxh-static .nxh-controls, body.nxh-static #nxHeroSoil { display: none; }

.nxh-short .nxh-search { display: none; }

/* On wider screens, search and buttons share one row and cover less of the machine. */
@media (min-width: 900px) {
  .nxh-controls { bottom: 84px; }
  .nxh-cta { flex-direction: row; align-items: center; width: min(1040px, calc(100% - 200px)); }
  .nxh-search { flex: 1 1 auto; min-width: 0; }
  .nxh-buttons { flex: 0 0 auto; }
  .nxh-buttons button { flex: 0 0 auto; padding: 0 22px; white-space: nowrap; }
}

/* On phones, the headline breaks so that "moves business." stays together. */
@media (max-width: 600px) {
  .nxh-nowrap { display: block; }
  .nxh-subline { max-width: 90%; }
  .nxh-buttons button { font-size: 0.88rem; padding: 0 6px; }
}

@media (max-width: 800px) {
  body.nxh-on.nxh-in-view .nx-chat-button,
  body.nxh-on.nxh-in-view .floating-cart,
  body.nxh-on.nxh-in-view .dark-toggle,
  body.nxh-on.nxh-in-view .mk-help-button { opacity: 0; pointer-events: none; transition: opacity 0.2s; }
}

@media (prefers-reduced-motion: reduce) {
  .nxh-hint i { animation: none; }
}
