/* ============================================================
   HOME HERO · Responsive consolidation
   Loaded after the shared typography layer so the opening sequence
   has one predictable set of phone and tablet behaviours.
   ============================================================ */

.hero.demo-section > .shell {
  max-width: 100vw;
  min-width: 0;
}

.stage__view-toggle[hidden],
.hero.demo-section .chat[hidden],
.hero.demo-section .panel[hidden] {
  display: none !important;
}

.stage__view-toggle {
  width: min(100%, 700px);
  margin: 0 auto 10px;
  padding: 4px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 999px;
  background: rgba(231, 233, 234, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 0 rgba(25, 27, 28, 0.18);
}

.stage__view-toggle button {
  min-height: 52px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-family: var(--font-compact);
  font-size: clamp(14px, 1.7vw, 19px);
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: var(--text-muted);
  line-height: 1;
  transition:
    background-color 160ms var(--ease),
    box-shadow 160ms var(--ease),
    color 160ms var(--ease);
}

.stage__view-toggle button[aria-pressed="true"] {
  background: rgba(255, 255, 253, 0.92);
  color: var(--black);
  box-shadow:
    inset 0 0 0 1px rgba(17, 19, 24, 0.14),
    0 3px 10px rgba(17, 19, 24, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

@media (max-width: 1180px) {
  body main .hero.demo-section .hero__title {
    font-size: clamp(38px, 5vw, 59px);
  }

  .hero.demo-section .stage__content {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .hero.demo-section .stage__toggle {
    margin-bottom: 0;
  }

  .hero.demo-section .demo-agents {
    width: 100%;
    padding-top: 0;
    grid-auto-flow: column;
    grid-auto-columns: 54px;
    justify-content: center;
    align-content: initial;
    gap: 9px;
    margin-block: clamp(18px, 2.6vw, 28px);
  }

  .hero.demo-section .demo-agents button,
  .hero.demo-section .demo-agents button:hover {
    width: 54px;
    min-width: 54px;
    max-width: 54px;
    height: 54px;
    min-height: 54px;
    max-height: 54px;
    transform: none;
  }

  .hero.demo-section .stage__view-toggle:not([hidden]) {
    display: grid;
  }

  .hero.demo-section .demo-agents,
  .hero.demo-section .stage__view-toggle,
  .hero.demo-section .stage__grid {
    grid-column: 1;
    grid-row: auto;
  }

  .hero.demo-section .stage__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero.demo-section .chat,
  .hero.demo-section .panel {
    width: 100%;
  }

  .hero.demo-section .chat__shortlist ol {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: clamp(220px, 88%, 330px);
    justify-content: start;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline mandatory;
    scrollbar-width: thin;
  }

  .hero.demo-section .chat__shortlist li {
    height: 100%;
    scroll-snap-align: start;
  }
}

@media (max-width: 860px) {
  .announcement {
    transition: transform 220ms var(--ease);
  }

  .nav {
    transition:
      top 220ms var(--ease),
      color var(--dur) var(--ease);
  }

  .mobile-header-compact .announcement {
    pointer-events: none;
    transform: translateY(-100%);
  }

  .mobile-header-compact .nav {
    top: 0;
  }

  .mobile-header-compact .nav__panel {
    top: 72px;
  }

  .nav__menu > summary {
    min-width: 44px;
    min-height: 44px;
  }

  .nav__brand {
    min-height: 44px;
  }

  .nav__cta,
  .nav--home .nav__cta,
  .nav--home:not(.is-scrolled) .nav__cta {
    min-height: 44px;
  }

  .demo-section .demo-agents button:first-child .demo-agents__tooltip {
    right: auto;
    left: 0;
    transform: translate(0, 4px);
  }

  .demo-section .demo-agents button:last-child .demo-agents__tooltip {
    right: 0;
    left: auto;
    transform: translate(0, 4px);
  }

  .demo-section .demo-agents button:first-child:hover .demo-agents__tooltip,
  .demo-section .demo-agents button:first-child:focus-visible .demo-agents__tooltip,
  .demo-section .demo-agents button:last-child:hover .demo-agents__tooltip,
  .demo-section .demo-agents button:last-child:focus-visible .demo-agents__tooltip {
    transform: translate(0, 0);
  }
}

@media (max-width: 520px) {
  body main .hero.demo-section .hero__title {
    font-size: 38px;
  }

  .hero.demo-section .hero__eyebrow {
    font-size: 10px;
  }

  .announcement__link {
    font-size: clamp(0.625rem, 2.75vw, 0.75rem);
  }

  .hero.demo-section .stage {
    margin-top: 36px;
  }

  .hero.demo-section .demo-agents {
    grid-auto-columns: minmax(44px, 1fr);
  }

  .hero.demo-section .demo-agents button,
  .hero.demo-section .demo-agents button:hover {
    width: 100%;
    min-width: 0;
    max-width: none;
    height: 48px;
    min-height: 48px;
    max-height: 48px;
  }

  .hero.demo-section > .shell > .section-cta {
    min-height: 44px;
  }
}

@media (max-width: 340px) {
  body main .hero.demo-section .hero__title {
    font-size: 34px;
    letter-spacing: -0.044em;
  }

  .hero.demo-section .hero__sub {
    font-size: 20px;
  }

  .stage__view-toggle button {
    padding-inline: 6px;
    font-size: 12px;
  }

  .hero.demo-section .panel__head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .announcement,
  .nav {
    transition: none;
  }
}
