/* ==========================================================================
   Mobile responsiveness + sticky header enhancements
   Scoped, non-destructive overrides layered on top of the existing Tailwind
   build. Selectors are intentionally specific so the desktop layout is
   untouched.
   ========================================================================== */

html {
  scroll-behavior: smooth;
}

/* Prevent sideways scroll WITHOUT breaking position: sticky.
   `clip` (unlike `hidden`) does not create a scroll container, so the
   sticky header keeps anchoring to the viewport. */
html,
body {
  overflow-x: clip;
}

/* --------------------------------------------------------------------------
   Sticky announcement bar + header (stacked, pinned together)
   The promo bar pins at the very top; the header pins directly below it.
   --promo-h is measured at runtime so the offset survives the bar wrapping
   onto two lines on small screens.
   -------------------------------------------------------------------------- */

/* Announcement / promo bar — direct child of the page wrapper only,
   so buttons that share bg-primary are never affected. */
.min-h-screen > .bg-primary {
  position: sticky;
  top: 0;
  z-index: 50;
}

/* Header pins right beneath the promo bar */
body header {
  position: sticky;
  top: var(--promo-h, 0px);
  z-index: 40;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

/* Offset in-page anchor jumps so the pinned bar + header don't cover headings */
section[id] {
  scroll-margin-top: calc(var(--promo-h, 44px) + 76px);
}

/* Images never overflow their container */
img {
  max-width: 100%;
  height: auto;
}

/* --------------------------------------------------------------------------
   Mobile menu (injected by the inline script) — hidden by default
   -------------------------------------------------------------------------- */
#mobile-menu {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  background: var(--background, #0b0b0f);
}

#mobile-menu.is-open {
  display: flex;
}

#mobile-menu a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: inherit;
}

#mobile-menu a:hover {
  background: color-mix(in oklab, currentColor 10%, transparent);
}

#mobile-menu a.mobile-cta {
  justify-content: center;
  margin-top: 0.25rem;
  font-weight: 700;
  color: var(--primary-foreground, #fff);
  background: var(--primary, #6d28d9);
}

/* --------------------------------------------------------------------------
   Phones (<= 640px)
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  /* Roomier tap target for the hamburger */
  header button[aria-label="Open menu"] {
    height: 2.5rem;
    width: 2.5rem;
  }

  /* Tighter hero headline so it doesn't overflow small screens */
  main h1 {
    font-size: 2.25rem;
    line-height: 1.1;
  }

  main section h2 {
    font-size: 1.75rem;
    line-height: 1.2;
  }

  /* Full-width primary CTA buttons in the hero */
  .hero-surface a.inline-flex {
    width: 100%;
  }

  /* Keep the announcement bar readable */
  .bg-primary.text-primary-foreground span {
    font-size: 0.8rem;
  }
}

/* --------------------------------------------------------------------------
   Small tablets (641px - 1024px)
   -------------------------------------------------------------------------- */
@media (min-width: 641px) and (max-width: 1024px) {
  .section-shell {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

/* --------------------------------------------------------------------------
   Reusable responsive video wrapper (16:9)
   -------------------------------------------------------------------------- */
.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 0.75rem;
}

.video-container iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
