/* ============================================================
   chrome.css — shared site header + footer (injected by chrome.js)
   Visual language lifted from the designed pages (most-evolved
   values). Adds: dropdown menus, mobile hamburger, 5-col footer.
   Consumes tokens.css.
   ============================================================ */

/* ---- Header: floating pill nav ---- */
.nav { position: sticky; top: 0; z-index: 100; background: transparent; padding: var(--space-4) var(--space-5) 0; }
.nav a, .nav button, .footer a { text-decoration: none; }
.nav__inner { position: relative; max-width: var(--content-max); margin: 0 auto; padding: 9px 9px 9px 26px; display: flex; align-items: center; min-height: 60px; gap: var(--space-6); background: var(--color-surface-1); border-radius: var(--radius-full); box-shadow: 0 8px 28px rgba(8,9,11,0.12); }
.nav__logo { display: inline-flex; align-items: center; flex: 0 0 auto; }
.nav__logo img { height: 26px; width: auto; display: block; }
.nav__inner > nav { flex: 1; display: flex; }
.nav__links { display: flex; gap: var(--space-5); align-items: center; justify-content: center; width: 100%; list-style: none; margin: 0; padding: 0; }
.nav__item { position: relative; }

/* top-level item is a button that opens its dropdown */
.nav__link { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-body); font-size: var(--type-size-body-sm); font-weight: 500; color: var(--color-brand-primary); padding: 8px 4px; border-radius: var(--radius-sm); background: none; border: 0; cursor: pointer; transition: color 0.25s ease, background 0.25s ease; }
.nav__link:hover, .nav__item:focus-within .nav__link, .nav__item.is-open .nav__link { color: #B5564F; background: transparent; }
.nav__link.is-current { color: #B5564F; }
.nav__caret { width: 12px; height: 12px; opacity: 0.5; transition: transform 0.25s ease, opacity 0.25s ease; }
.nav__link:hover .nav__caret, .nav__item.is-open .nav__link .nav__caret { opacity: 1; }
.nav__item:hover .nav__caret, .nav__item:focus-within .nav__caret, .nav__item.is-open .nav__caret { transform: rotate(180deg); }

/* dropdown panel */
.nav__drop { box-sizing: border-box; position: absolute; top: calc(100% + 14px); left: 50%; transform: translateX(-50%) translateY(6px); min-width: 248px; background: var(--color-surface-1); border-radius: var(--radius-lg); box-shadow: 0 18px 50px rgba(8,9,11,0.18); padding: var(--space-3); list-style: none; margin: 0; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s; z-index: 110; }
/* hover bridge so the gap between item and panel doesn't drop the hover */
.nav__item::after { content: ''; position: absolute; top: 100%; left: 0; right: 0; height: 16px; }
.nav__item:hover .nav__drop, .nav__item:focus-within .nav__drop, .nav__item.is-open .nav__drop { opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.nav__drop-label { display: block; font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-text-muted); padding: var(--space-3) var(--space-3) var(--space-2); }
.nav__drop a { display: flex; align-items: center; gap: 7px; font-size: var(--type-size-body-sm); font-weight: 500; color: var(--color-brand-primary); padding: 9px var(--space-3); border-radius: var(--radius-sm); transition: background 0.2s ease, color 0.2s ease; }
.nav__drop a:hover { background: rgba(54,30,28,0.07); color: #B5564F; }
.nav__drop a.is-current { background: var(--color-accent-soft, rgba(181,86,79,0.1)); color: #B5564F; }
.nav__drop .nav__drop-overview { font-weight: 600; }
.nav__drop hr { border: 0; border-top: 1px solid rgba(54,30,28,0.1); margin: var(--space-2) var(--space-3); }
.nav__tag { font-size: 0.66rem; font-weight: 600; background: var(--color-brand-accent); color: var(--color-brand-primary); padding: 1px 6px; border-radius: var(--radius-full); letter-spacing: 0.02em; }

/* CTA — border-beam pill from the design */
.nav__cta { position: relative; overflow: hidden; display: inline-flex; align-items: center; height: 42px; flex: 0 0 auto; font-size: var(--type-size-button); font-weight: 600; letter-spacing: 0.04em; padding: 0 22px; border-radius: var(--radius-full); background: var(--color-surface-2); color: #08090B; }
.nav__cta-text { transition: opacity 0.55s cubic-bezier(0.4,0,0.2,1); padding-left: 34px; }
.nav__cta:hover .nav__cta-text { opacity: 0; }
.nav__cta-icon { position: absolute; left: 4px; top: 4px; bottom: 4px; width: 32px; display: grid; place-items: center; border-radius: 999px; background: rgba(8,9,11,0.14); color: #08090B; transition: width 0.6s cubic-bezier(0.4,0,0.2,1), transform 0.2s ease; }
.nav__cta:hover .nav__cta-icon { width: calc(100% - 8px); }
.nav__cta:active .nav__cta-icon { transform: scale(0.95); }
.nav__cta-icon svg { width: 16px; height: 16px; }

/* hamburger — hidden on desktop */
.nav__burger { display: none; flex: 0 0 auto; width: 44px; height: 44px; border: 0; background: none; cursor: pointer; border-radius: var(--radius-full); flex-direction: column; justify-content: center; align-items: center; gap: 5px; }
.nav__burger span { display: block; width: 22px; height: 2px; background: var(--color-brand-primary); border-radius: 2px; transition: transform 0.3s ease, opacity 0.2s ease; }
.nav.is-menu-open .nav__burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.is-menu-open .nav__burger span:nth-child(2) { opacity: 0; }
.nav.is-menu-open .nav__burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
/* drawer-only CTA — hidden on desktop, shown inside the mobile drawer */
.nav__cta--drawer { display: none; }

@media (prefers-reduced-motion: reduce) {
  .nav__cta-text, .nav__cta-icon, .nav__caret, .nav__drop { transition: none; }
}

/* ---- Mobile nav (hamburger drawer) ---- */
@media (max-width: 1080px) {
  .nav__burger { display: inline-flex; }
  .nav__inner > nav { position: absolute; top: calc(100% + 10px); left: 0; right: 0; flex-direction: column; background: var(--color-surface-1); border-radius: var(--radius-lg); box-shadow: 0 18px 50px rgba(8,9,11,0.2); padding: var(--space-4); max-height: calc(100vh - 120px); overflow-y: auto; opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s; }
  .nav.is-menu-open .nav__inner > nav { opacity: 1; visibility: visible; transform: none; }
  .nav__links { flex-direction: column; align-items: stretch; gap: 0; }
  .nav__item { border-bottom: 1px solid rgba(54,30,28,0.08); }
  .nav__item::after { content: none; }
  .nav__link { width: 100%; justify-content: space-between; padding: var(--space-4) var(--space-2); font-size: var(--type-size-body); }
  /* accordion: panels flow static, transform neutralized, toggled by JS .is-open.
     NOTE: the .is-open rule must ALSO reset position/transform/left — otherwise the desktop
     `.nav__item.is-open .nav__drop { transform: translateX(-50%) }` (equal specificity, earlier
     in source) wins for any open-but-not-focused panel and shifts it off-screen left. */
  /* Collapsed drop = ZERO height with NO vertical padding, so nothing can peek out (independent of box-sizing).
     The bottom padding is added back only when open. */
  .nav__drop, .nav__item:hover .nav__drop, .nav__item:focus-within .nav__drop { position: static; transform: none; left: auto; opacity: 1; visibility: visible; pointer-events: auto; box-shadow: none; min-width: 0; padding: 0 0 0 var(--space-3); max-height: 0; overflow: hidden; transition: max-height 0.3s ease, padding 0.3s ease; }
  .nav__item.is-open .nav__drop { position: static; transform: none; left: auto; max-height: 640px; padding-bottom: var(--space-3); }
  /* mobile pill: logo left, burger right; the wide CTA moves into the drawer so nothing overflows */
  .nav { padding-left: var(--space-4); padding-right: var(--space-4); }
  .nav__inner { gap: var(--space-3); padding: 8px 12px 8px 18px; }
  .nav__cta { display: none; }
  .nav__burger { display: inline-flex; margin-left: auto; width: 40px; height: 40px; }
  /* Book a Demo lives at the bottom of the open drawer instead */
  .nav__cta--drawer { display: flex; justify-content: center; margin-top: var(--space-4); }
  .nav__cta--drawer .nav__cta-text { padding-left: 0; }
  .nav__cta--drawer .nav__cta-icon { display: none; }
}

/* ---- Footer: scroll-revealed dark panel ---- */
.footer-reveal { position: relative; height: 92vh; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
.footer-reveal__inner { position: relative; height: calc(100vh + 92vh); top: -100vh; }
.footer-reveal__sticky { position: sticky; top: calc(100vh - 92vh); height: 92vh; }
.footer { position: relative; overflow: hidden; height: 100%; display: flex; flex-direction: column; justify-content: space-between; background: #08090B; color: var(--color-text-inverse); padding: var(--space-9) 0 var(--space-7); }
.footer .wrap { position: relative; z-index: 2; width: 100%; max-width: var(--content-max); margin: 0 auto; padding: 0 var(--space-7); }
.footer__blob { position: absolute; border-radius: 50%; filter: blur(80px); pointer-events: none; z-index: 0; }
.footer__blob--a { top: -10%; right: -5%; width: 40vw; max-width: 520px; height: 40vw; max-height: 520px; background: rgba(255,96,56,0.16); animation: blobPulse 7s ease-in-out infinite; }
.footer__blob--b { bottom: -15%; left: -8%; width: 42vw; max-width: 560px; height: 42vw; max-height: 560px; background: rgba(160,201,203,0.14); animation: blobPulse 9s ease-in-out infinite 1.2s; }
@keyframes blobPulse { 0%, 100% { transform: scale(1); opacity: 0.55; } 50% { transform: scale(1.18); opacity: 0.85; } }
.footer__cols { display: grid; grid-template-columns: repeat(5, minmax(104px, 1fr)); gap: var(--space-6); }
.footer__col h4 { font-family: var(--font-body); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(235,236,220,0.6); margin-bottom: var(--space-4); padding-bottom: var(--space-2); border-bottom: 1px solid rgba(235,236,220,0.14); }
/* Linkable column header (top-level section, e.g. Integrations) — inherits the header look,
   NOT the child-link style; no translateX / no accent underline. */
.footer__col h4 a { display: inline; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; transition: color 0.3s ease; }
.footer__col h4 a::after { display: none; }
.footer__col h4 a:hover { color: rgba(235,236,220,0.95); transform: none; }
/* Tail header — a parent-style section link placed BELOW a column's list (Integrations under Solutions).
   Divider goes on top (separates from the list), not bottom. */
.footer__col .footer__col-tail { margin-top: var(--space-6); margin-bottom: 0; padding-top: var(--space-4); padding-bottom: 0; border-top: 1px solid rgba(235,236,220,0.14); border-bottom: none; }
.footer__col ul { list-style: none; display: flex; flex-direction: column; gap: var(--space-3); margin: 0; padding: 0; }
.footer__col a { position: relative; display: inline-block; font-size: var(--type-size-body-sm); color: rgba(235,236,220,0.7); transition: color 0.3s ease, transform 0.3s cubic-bezier(0.34,1.56,0.64,1); }
.footer__col a::after { content: ''; position: absolute; left: 0; bottom: -2px; height: 1.5px; width: 0; background: var(--color-brand-accent); transition: width 0.3s ease; }
.footer__col a:hover { color: var(--color-text-inverse); transform: translateX(8px); }
.footer__col a:hover::after { width: 100%; }
.footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: var(--space-5); margin-top: var(--space-7); }
.footer__logo { display: block; height: clamp(48px, 8vw, 96px); width: auto; max-width: 100%; }
.footer__rule { display: flex; align-items: center; gap: 28px; margin-top: var(--space-5); }
.footer__rule span:first-child { display: block; width: 48px; height: 2px; background: linear-gradient(90deg, var(--color-brand-accent), var(--color-surface-2)); animation: ruleStretch 2.6s ease-in-out infinite; transform-origin: left center; }
@keyframes ruleStretch { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(1.3); } }
.footer__subtitle { font-size: var(--type-size-body-sm); color: rgba(235,236,220,0.7); }
/* Contact block (footer bottom-left, under the logo) */
.footer__contact { margin-top: var(--space-5); }
.footer__contact p { font-size: var(--type-size-body-sm); color: rgba(235,236,220,0.6); margin: 0 0 var(--space-1); line-height: 1.5; }
.footer__contact p:first-child { color: rgba(235,236,220,0.88); font-weight: 600; margin-bottom: var(--space-2); }
.footer__contact a { color: rgba(235,236,220,0.72); transition: color 0.3s ease; }
.footer__contact a:hover { color: var(--color-brand-accent); }
.footer__meta { text-align: right; }
.footer__legal { display: flex; flex-wrap: wrap; gap: var(--space-4); justify-content: flex-end; margin-bottom: var(--space-3); }
.footer__legal a { font-size: var(--type-size-body-sm); color: rgba(235,236,220,0.7); transition: color 0.3s ease; }
.footer__legal a:hover { color: var(--color-text-inverse); }
.footer__meta p { font-size: var(--type-size-body-sm); color: rgba(235,236,220,0.6); margin: 0; max-width: 60ch; margin-left: auto; line-height: 1.5; }
.footer__social { display: flex; gap: var(--space-3); justify-content: flex-end; margin-top: var(--space-3); }
.footer__social a { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(235,236,220,0.1); color: rgba(235,236,220,0.8); font-size: 13px; font-weight: 700; transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), background 0.3s ease, color 0.3s ease; }
.footer__social a:hover { transform: scale(1.18) rotate(10deg); background: linear-gradient(135deg, var(--color-brand-accent), var(--color-surface-2)); color: var(--color-brand-primary); }
/* entrance reveal */
.footer__cols .footer__col, .footer__bottom > * { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.footer.in .footer__cols .footer__col, .footer.in .footer__bottom > * { opacity: 1; transform: none; }
.footer.in .footer__col:nth-child(2) { transition-delay: 0.06s; }
.footer.in .footer__col:nth-child(3) { transition-delay: 0.12s; }
.footer.in .footer__col:nth-child(4) { transition-delay: 0.18s; }
.footer.in .footer__col:nth-child(5) { transition-delay: 0.24s; }
.footer.in .footer__bottom > :last-child { transition-delay: 0.2s; }
@media (prefers-reduced-motion: reduce) {
  .footer__blob, .footer__rule span:first-child { animation: none; }
  .footer__cols .footer__col, .footer__bottom > * { opacity: 1; transform: none; transition: none; }
}
@media (max-width: 900px) {
  .footer-reveal, .footer-reveal__inner, .footer-reveal__sticky { position: static; height: auto; top: 0; clip-path: none; }
  .footer__cols { grid-template-columns: repeat(2, 1fr); gap: var(--space-7); }
  .footer__bottom { flex-direction: column; align-items: flex-start; }
  .footer__meta, .footer__legal, .footer__social { text-align: left; justify-content: flex-start; }
}
