/* ─────────────────────────────────────────────────────────────────
 * Growth House overrides on top of the Nerdstack Webflow template.
 *
 * This file MUST load after the three template CSS files
 * (normalize.css, webflow.css, nerdstack-template.webflow.css) so it
 * wins on cascade order. layout.tsx links them in that sequence.
 *
 * ── Primary CTA hover: "cross to left, point right" ──
 *
 *   1. Scale: button grows ~3% on hover ("tiny bit bigger").
 *   2. Label roll-up: .button_text-mask is an overflow:hidden clip one
 *      line tall, and .text-button carries a text-shadow clone of
 *      itself 1.5em below in the HOVER color. Translating the label up
 *      by 1.5em rolls the original out the top and the colored clone
 *      into its place.
 *   3. Arrow cross: the markup has TWO right-pointing arrow wraps
 *      (.left and .right), kept IN the flex flow. Each arrow's natural
 *      footprint is exactly 1.5rem (1rem icon + 0.5rem gap margin, both
 *      from the template). At rest the right arrow is 1.5rem wide and
 *      the left is collapsed to 0; on hover that reverses. Because one
 *      expands as the other collapses, the button's TOTAL width is
 *      constant, so outer padding stays symmetric and never reflows —
 *      the label just slides across the center while the arrows
 *      cross-fade. overflow:hidden on each wrap clips the collapsed one.
 *
 * Two tunable knobs:
 *   - Outer padding (label-to-edge): .button-inner padding-left/right
 *   - Text-to-arrow gap: the 0.5rem margins on .icon_button.left/.right
 *     (template default; override below if you want a different gap)
 *
 * Applies to both CTAs (secondary has no arrows, so it just scales +
 * rolls its label in the secondary color).
 * ───────────────────────────────────────────────────────────────── */

/* 1. Button: subtle scale on hover. */
.cta_primary {
  transition: transform 300ms ease;
}

.cta_primary:hover {
  transform: scale(1.03);
}

/* 2. Label roll-up. */
.text-button {
  transition: transform 300ms ease;
}

.cta_primary:hover .text-button {
  transform: translateY(-1.5em);
}

/* ── Secondary CTA: cross-fade, not swipe ──
 * The secondary variant (Browse templates) should NOT do the swipe-up
 * roll. The template's secondary tokens already fade dark-text/gray-fill
 * at rest to white-text/black-fill on hover; we just (a) cancel the
 * label swipe, (b) restore the color transition the base rule above
 * removed, and (c) ease everything a touch slower for a soft fade. */
.cta_primary.w-variant-1ff8d96e-78cc-eac8-de90-206ecdaded5f {
  transition: color 400ms ease, transform 300ms ease;
}

.cta_primary:hover .text-button.w-variant-1ff8d96e-78cc-eac8-de90-206ecdaded5f {
  transform: none;
}

.btn-bg.w-variant-1ff8d96e-78cc-eac8-de90-206ecdaded5f {
  transition: background-color 400ms ease, border-color 400ms ease;
}

/* 3. Symmetric outer padding (label-to-edge gutter). */
.button-inner {
  justify-content: center;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* Text-to-arrow gap. Template default is 0.5rem on each icon; set
 * explicitly here so the gap is obvious and easy to tune. The wrap
 * widths below must equal 1rem (icon) + this gap. */
.icon_button.left {
  margin-right: 0.5rem;
}

.icon_button.right {
  margin-left: 0.5rem;
}

/* Both arrow wraps stay in flow and collapse to 0 width when inactive.
 * Active width = 1rem icon + 0.5rem gap = 1.5rem. One expands as the
 * other collapses, so the button never changes width. */
.icon-wrap_button {
  overflow: hidden;
  transition: width 300ms ease, opacity 300ms ease;
}

/* Right arrow: shown at rest, collapses out on hover. */
.icon-wrap_button.right {
  width: 1.5rem;
  opacity: 1;
}

.cta_primary:hover .icon-wrap_button.right {
  width: 0;
  opacity: 0;
}

/* Left arrow: collapsed at rest, expands in on hover. Width tracks the
 * right arrow with no delay (keeps total width constant); only the
 * fade-in is delayed 80ms so it reads "out the right, then in left." */
.icon-wrap_button.left {
  width: 0;
  opacity: 0;
  transition: width 300ms ease, opacity 300ms ease 80ms;
}

.cta_primary:hover .icon-wrap_button.left {
  width: 1.5rem;
  opacity: 1;
}

/* ─────────────────────────────────────────────────────────────────
 * Navigation Bar with Mega Menu
 *
 * The NavBar component reuses the template's nav classes but drives
 * open/close + mobile state with React (no Webflow JS). These rules:
 *   - make the bar sticky
 *   - style the temporary text wordmark
 *   - re-anchor the large mega panel under the relative .nav-container
 *     (template floats it with position:fixed + a JS-set top)
 *   - collapse the whole menu into a slide-in overlay at <=991px
 * ───────────────────────────────────────────────────────────────── */

.master_navigation {
  position: sticky;
  top: 0;
  z-index: 9999;
  transition: transform 320ms ease;
}

/* Hide-on-scroll-down, reveal-on-scroll-up (driven by NavBar state). */
.master_navigation.is-hidden {
  transform: translateY(-100%);
}

/* The bar is transparent at the top of the page. The floating rounded
 * card (.nav-container_bg, a white pill with shadow + 20px radius) fades
 * in once the page is scrolled OR a dropdown is open. The open-state
 * fill doubles as the opaque backing that keeps the bar bright above the
 * scrim, so no separate bar fill is needed. */
.nav-container_bg {
  transition: opacity 320ms ease;
}

.master_navigation.is-scrolled .nav-container_bg,
.master_navigation.has-dropdown .nav-container_bg {
  opacity: 1;
}

/* When a dropdown is open, the bar card and the panel directly below it
 * share the same width and edges, so squaring the card's bottom corners
 * fuses them into one rounded card (panel keeps square top / rounded
 * bottom). */
.master_navigation.has-dropdown .nav-container_bg {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

/* Temporary brand wordmark (no real logo yet — coral glyph + text). */
.gh-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-stacksans-headline);
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: #231f23;
  white-space: nowrap;
  text-decoration: none;
}

.gh-wordmark_glyph {
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 5px;
  background: #ed7472;
  flex: none;
}

/* Reset native chrome on the toggle/hamburger buttons. */
.dropdown-toggle,
.menu-button {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border: 0;
  cursor: pointer;
}

/* Invisible "bridge" filling the dead zone between a toggle and its
 * panel. Because it's a pseudo-element of the toggle (inside .dropdown),
 * the cursor stays within the hover region the whole way down, so the
 * menu never flickers closed while crossing the gap. */
.dropdown-toggle {
  position: relative;
}

/* Only while the menu is open — otherwise it would be a phantom hover
 * strip below every closed toggle. */
.dropdown.is-open .dropdown-toggle::after {
  content: "";
  position: absolute;
  top: 100%;
  left: -0.5rem;
  right: -0.5rem;
  height: 2.5rem;
}

/* The template makes .nav-menu position:relative (Webflow base), which
 * would anchor the absolute mega panel to the narrow menu. Reset it to
 * static on desktop so the panel anchors to the full-width, relative
 * .nav-container instead. (The mobile block below re-positions it.) */
.nav-menu {
  position: static;
}

/* Large mega panel: full-container-width dropdown anchored under the
 * (relative) nav-container. Opaque fill is required because the
 * template's token (light-0 = #f7f6f500) is transparent and the
 * JS-expanded .dropdown-bg isn't present without Webflow's runtime. */
.dropdown-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
  box-shadow: 0 24px 60px rgba(35, 31, 35, 0.12);
  overflow: hidden;
}

/* Opaque fill, written at the same specificity as the template's
 * .dropdown-list.w--open rule (which sets the transparent light-0 token)
 * and later in the cascade, so the open panel isn't see-through. */
.dropdown-list,
.dropdown-list.w--open {
  background-color: #f7f6f5;
}

/* The CTA tile's background image (nav-cta.avif) isn't shipped; use the
 * signature Core Coral -> Cache Sand brand halo instead. The tile's
 * own token overrides already flip text to light and the button to a
 * light fill, so contrast holds on the gradient. */
.nav-cta_desktop {
  background-image: linear-gradient(135deg, #ed7472 0%, #f0a07e 55%, #f4e7c7 100%);
}

/* Small dropdown panel sits just below its toggle. */
.dropdown.small {
  position: relative;
}

.dropdown-list_small {
  z-index: 50;
  margin-top: 0.5rem;
}

/* Hamburger hidden on desktop. */
.menu-button {
  display: none;
}

/* ── Mobile (<=991px): slide-in overlay menu ── */
@media (max-width: 991px) {
  .menu-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 8px;
    color: #231f23;
  }

  .nav_button-desktop {
    display: none;
  }

  .nav-menu {
    position: fixed;
    top: 4.75rem;
    right: 0;
    bottom: 0;
    width: min(22rem, 88vw);
    background: #f7f6f5;
    box-shadow: 0 4px 80px rgba(35, 31, 35, 0.16);
    transform: translateX(105%);
    transition: transform 320ms ease;
    overflow-y: auto;
    padding: 1.5rem 1.25rem 2rem;
    z-index: 90;
  }

  .nav-menu.is-open {
    transform: translateX(0);
  }

  .nav_wrap-menu {
    height: 100%;
  }

  .nav-menu_inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
  }

  .nav-menu_inner .dropdown,
  .nav-menu_inner .dropdown.small {
    width: 100%;
  }

  .dropdown-toggle,
  .nav-menu_inner .link_nav {
    width: 100%;
    justify-content: space-between;
  }

  /* Dropdowns expand inline (accordion) on mobile, not floating panels. */
  .nav-menu .dropdown-list,
  .nav-menu .dropdown-list_small {
    position: static;
    box-shadow: none;
    border-radius: 0;
    margin-top: 0;
  }

  .dropdown_inner {
    flex-direction: column;
    padding: 1rem 0;
    gap: 1.5rem;
  }

  .left_nav-menu {
    grid-template-columns: 1fr;
  }

  .nav-cta_desktop {
    max-width: none;
  }

  .nav-menu_mobile-button {
    display: block;
    margin-top: 1rem;
  }
}

/* Translucent-black scrim behind an open dropdown / mobile menu. It's a
 * root-level sibling of the nav (not a child), fixed over the viewport
 * at z-9998 — just under the nav's z-9999, above all page content. It
 * is purely visual: pointer-events stay off so it can never interfere
 * with hover/hit-testing (which is what was glitching the menu). */
.nav_bg {
  background-color: rgba(26, 23, 26, 0.5);
  transition: opacity 320ms ease;
  z-index: 9998;
  pointer-events: none;
}

.nav_bg.is-visible {
  opacity: 1;
}

/* ── /start voice-note recorder: animated equalizer waveform ──
   Bars get a base height inline; this scales them up and down on a
   per-bar delay/duration (also set inline) so the wave "moves" while
   recording. Only applied when the .gh-wave-bar class is present. */
@keyframes gh-wave {
  0%, 100% { transform: scaleY(0.32); }
  50%      { transform: scaleY(1); }
}
.gh-wave-bar {
  transform-origin: center;
  animation-name: gh-wave;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  will-change: transform;
}

/* ── /start recorder: pulsing glow behind the idle mic button ──
   Draws the eye to the mic so people know to click it. The blurred coral
   halo scales + fades on a loop; it brightens on .group hover of the card. */
@keyframes gh-glow {
  0%, 100% { transform: scale(1);   opacity: 0.45; }
  50%      { transform: scale(1.5); opacity: 0.85; }
}
.gh-glow { animation: gh-glow 2.2s ease-in-out infinite; }
.group:hover .gh-glow { animation-duration: 1.1s; opacity: 0.95; }
