/* The site header, to the approved Figma (4:10 desktop, 4:167 mobile): a dark
   band 104px tall, the white wordmark, four links centred between it and the
   actions, Sign in and a lime Get started. Menus and the phone sheet stay on
   the dark brand: ink surfaces, hairlines, white type, lime only for small
   marks and the primary action. No glows, no gradients, square corners. */
.site-header {
  /* A faint lift for hovered rows on ink; it is not a brand colour. */
  --raise: rgb(255 255 255 / 0.05);
  position: sticky; top: 0; z-index: 40;
  border-bottom: 1px solid transparent;
  transition: border-color var(--motion-fast);
}
/* Scrolled: a hairline appears under the band, nothing more. */
.site-header.is-scrolled { border-color: var(--line-dark); }
.nav-shell {
  position: relative; display: flex; align-items: center; gap: 24px;
  width: min(var(--container), calc(100% - var(--gutter) * 2)); min-height: 104px; margin-inline: auto;
}
/* 7px above and below lift the logo link to a 44px target on phones. */
.site-header .brand, .mobile-menu .brand { width: 228px; padding-block: 7px; }

/* Links: Manrope SemiBold 14/22, 28px apart with the Figma's 6px of padding
   inside each, centred in the free space. Each hit area reaches the band's
   full height so the pointer can travel from a trigger into its panel
   without leaving the group. */
#navigation { --nav-gap: 28px; flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: var(--nav-gap); }
.nav-direct, .nav-group > summary, .header-actions .header-signin {
  position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding-inline: 6px;
  font-size: 14px; line-height: 22px; font-weight: 600; white-space: nowrap; color: var(--white);
  text-decoration: underline; text-decoration-color: transparent; text-decoration-thickness: 1px; text-underline-offset: 6px;
  transition: color var(--motion-fast), text-decoration-color var(--motion-fast);
}
.nav-direct::after, .nav-group > summary::after { content: ""; position: absolute; inset: -30px calc(var(--nav-gap) / -2); }
.nav-direct:hover, .nav-group > summary:hover { text-decoration-color: currentColor; }
/* The current page, and an open menu, carry a lime underline. */
.nav-direct[aria-current="page"], .nav-group[open] > summary,
.nav-group:has(.nav-item[aria-current]) > summary {
  text-decoration-color: var(--lime); text-decoration-thickness: 2px;
}
.nav-group > summary { list-style: none; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-chevron { flex: none; color: var(--on-dark-muted); transition: transform var(--motion-fast) var(--ease), color var(--motion-fast); }
.nav-group[open] .nav-chevron { transform: rotate(180deg); color: var(--lime); }
.header-actions { display: flex; align-items: center; gap: 24px; flex: none; }
/* Sign in carries 16px of padding, as in the Figma, so its text sits 40px
   from the button while the gap stays 24px. */
.header-actions .header-signin { padding-inline: 16px; color: var(--on-dark-muted); }
.header-actions .header-signin::after { content: ""; position: absolute; inset: -30px -12px; }
.header-actions .header-signin:hover { color: var(--white); text-decoration-color: currentColor; }

/* Panels hang from the bottom of the band, centred under the navigation so
   they can never run off a narrow screen. */
.nav-panel {
  position: absolute; z-index: 1; top: 100%; left: 0; right: 0; margin-inline: auto;
  max-height: calc(100dvh - 120px); overflow-y: auto; overscroll-behavior: contain;
  color: var(--white); background: var(--ink);
  border: 1px solid var(--line-dark); border-radius: var(--radius-control);
  box-shadow: 0 24px 48px -24px rgb(0 0 0 / 0.55);
  animation: nav-reveal var(--motion-fast) var(--ease);
}
.product-nav { width: min(960px, 100%); }
.compare-nav { width: min(600px, 100%); }
.resources-nav { width: min(600px, 100%); }

/* Features: the CRM grouped by stage of the job, with the tour as a picture
   card. Refero: Cake's product menu with a demo card, Zapier's grouped
   columns with a side panel. */
.mega { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 8px; padding: 8px; }
.mega-groups { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr; gap: 12px 8px; padding: 12px 0 4px; }
.mega-group:first-child { grid-row: span 2; }
.mega-label { display: flex; align-items: center; gap: 8px; margin: 0 0 6px 12px; }
.mega-icon { flex: none; }
.nav-feature-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav-item {
  display: flex; align-items: flex-start; gap: 12px; padding: 10px;
  border-radius: var(--radius-control); transition: background-color var(--motion-fast);
}
.nav-item:hover, .nav-item[aria-current] { background: var(--raise); }
.nav-item-copy { display: flex; flex-direction: column; gap: 2px; }
.nav-item-copy strong { font-size: 15px; line-height: 22px; font-weight: 600; color: var(--white); }
.nav-item-copy > span { font-size: 14px; line-height: 20px; color: var(--on-dark-muted); }
.mega-tour {
  display: flex; flex-direction: column; gap: 4px; align-self: start; padding: 12px 12px 18px;
  border: 1px solid var(--line-dark); border-radius: var(--radius-control);
  transition: background-color var(--motion-fast), border-color var(--motion-fast);
}
.mega-tour:hover, .mega-tour[aria-current] { background: var(--raise); border-color: var(--outline-dark); }
/* The tour card's picture sits on its own light surface and lifts 4px on hover. */
.mega-shot {
  position: relative; display: block; aspect-ratio: 16 / 10; margin-bottom: 10px; overflow: hidden;
  border: 1px solid var(--line-dark); border-radius: var(--radius-control); background: var(--surface);
  transition: transform 200ms var(--ease);
}
.mega-shot img { width: 100%; max-width: none; height: auto; }
.mega-tour:hover .mega-shot { transform: translateY(-4px); }
.mega-play {
  position: absolute; left: 50%; top: 50%; display: grid; place-items: center;
  width: 44px; height: 44px; margin: -22px 0 0 -22px;
  border-radius: var(--radius-control); background: var(--ink); color: var(--lime);
}
.mega-tour strong { font-size: 15px; line-height: 22px; font-weight: 600; }
.mega-tour > span:last-child { font-size: 14px; line-height: 20px; color: var(--on-dark-muted); }

/* Compare and Resources: words only, a name and one quiet line, in two
   columns. A row of words needs no icon box to be scanned. */
.nav-text-list { grid-template-columns: 1fr 1fr; gap: 2px 8px; padding: 8px; }
.resource-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 20px 8px 8px; }
.nav-item.is-text { padding: 10px 12px; }

.nav-panel-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin: 0 8px; padding: 12px 10px 14px; border-top: 1px solid var(--line-dark);
  font-size: 14px; line-height: 22px;
}
.nav-panel-footer > span { color: var(--on-dark-muted); }
.nav-panel-footer .arrow-link[aria-current] { text-decoration-color: var(--lime); }

/* Phones and small tablets: a hamburger opens a full-screen dark sheet. */
.menu-toggle, .mobile-close {
  display: none; align-items: center; justify-content: center; flex: none;
  width: 44px; height: 44px; margin-right: -10px; padding: 0;
  border: 0; border-radius: var(--radius-control); background: transparent; color: var(--white);
  transition: color var(--motion-fast);
}
.mobile-close { display: inline-flex; }
@media (hover: hover) { .menu-toggle:hover, .mobile-close:hover { color: var(--lime); } }
.mobile-menu {
  inset: 0; width: 100%; max-width: none; height: 100dvh; max-height: none;
  margin: 0; padding: 0; border: 0;
}
.mobile-menu[open] { display: flex; flex-direction: column; animation: mobile-nav-reveal 180ms var(--ease); }
.mobile-menu::backdrop { background: var(--ink); }
.mobile-menu-head {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  min-height: 88px; padding-inline: var(--gutter); border-bottom: 1px solid var(--line-dark);
}
.mobile-menu-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px var(--gutter) 32px; }
.mobile-links, .mobile-list { list-style: none; margin: 0; padding: 0; }
.mobile-link {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px;
  border-bottom: 1px solid var(--line-dark);
  font-size: 20px; line-height: 28px; font-weight: 600; color: var(--white);
}
.mobile-secondary { margin-top: 24px; }
.mobile-secondary .mobile-link { min-height: 56px; font-size: 17px; line-height: 24px; }
.mobile-group-label { margin: 32px 0 4px; }
.mobile-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
.mobile-item {
  display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 72px; padding-block: 12px;
  border-bottom: 1px solid var(--line-dark);
}
.mobile-item strong { font-size: 17px; line-height: 24px; font-weight: 600; color: var(--white); }
.mobile-item span { font-size: 14px; line-height: 20px; color: var(--on-dark-muted); }
.mobile-link[aria-current] > span, .mobile-item[aria-current] strong {
  text-decoration: underline 2px var(--lime); text-underline-offset: 6px;
}
.mobile-menu-actions {
  flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  padding: 16px var(--gutter) max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-dark); background: var(--ink);
}
.mobile-menu-actions .button { min-width: 0; gap: 12px; padding-inline: 16px; }
/* Before the app is live there is no Sign in, so the one action spans the bar. */
.mobile-menu-actions > :only-child { grid-column: 1 / -1; }

@keyframes nav-reveal { from { opacity: 0; transform: translateY(-4px); } }
@keyframes mobile-nav-reveal { from { opacity: 0; transform: translateY(-8px); } }

/* The full row holds from 961px and the navigation is never hidden: between
   961 and 1199 the logo (168 to 228), link gaps (16 to 28), Sign in padding
   (8 to 16) and button (150 to 192) narrow together with the window. */
@media (max-width: 1199px) {
  .site-header .brand { width: clamp(168px, calc(168px + (100vw - 961px) * 0.2521), 228px); }
  #navigation { --nav-gap: clamp(16px, calc(16px + (100vw - 961px) * 0.0504), 28px); }
  .header-actions .header-signin { padding-inline: clamp(8px, calc(8px + (100vw - 961px) * 0.0336), 16px); }
  .header-actions .header-signup {
    min-width: clamp(150px, calc(150px + (100vw - 961px) * 0.1765), 192px); gap: 14px; padding-inline: 18px;
  }
}
@media (max-width: 1100px) {
  .mega { grid-template-columns: minmax(0, 1fr) 240px; }
}
@media (max-width: 960px) {
  .nav-shell { min-height: 88px; justify-content: space-between; }
  #navigation, .header-actions { display: none; }
  .menu-toggle { display: inline-flex; }
  .site-header .brand, .mobile-menu .brand { width: 196px; }
}
@media (max-width: 760px) {
  .nav-shell, .mobile-menu-head { min-height: 79px; }
  .site-header .brand, .mobile-menu .brand { width: 174px; }
}
@media (max-width: 560px) {
  .mobile-list { grid-template-columns: 1fr; }
}
/* The smallest phones keep both actions side by side by tightening them. */
@media (max-width: 359px) {
  .mobile-menu-actions .button { gap: 8px; padding-inline: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .site-header, .nav-direct, .nav-group > summary, .header-actions .header-signin, .nav-chevron, .nav-item,
  .mega-tour, .mega-shot, .menu-toggle, .mobile-close { transition: none; }
  .nav-panel, .mobile-menu[open] { animation: none; }
  .mega-tour:hover .mega-shot { transform: none; }
}
