/* ==========================================================================
   REVE Chat Version 4 — site banner + header + mega menus + mobile sheet (every page).
   Markup: template-parts/rc-v4-site-header.php. Behaviour: js/rc-v4-site-header.js.
   Design: Banner + Header (src/creative/Top.jsx) and NavV4 (src/creative/NavV4.jsx + navV4.css) of
   https://reve-chat-website.vercel.app/ (V4 light header). Tokens, resets and buttons: css/rc-v4-base.css (.rc).
   Breakpoints as in the design: 1101px (Log in link), 980px (mobile sheet), 860px, 480px, 400px.
   ========================================================================== */

/* The logo word is DM Sans SemiBold in the design; the theme ships the file (not on Google Fonts list in functions.php). */
@font-face {
  font-family: 'REVE V4 DM Sans';
  src: url(fonts/dm-sans/DMSans-SemiBold.ttf) format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* The root only carries the Version 4 scope: display: contents makes the sticky <header> a box child of <body>,
   so it sticks for the whole page (a sticky element only sticks inside its parent box). */
.rc-site-header { display: contents; }

/* ---------- skip link ---------- */
.rc-header-skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 1001;
  padding: 10px 14px; border-radius: 8px; background: #fff; color: #000;
}
.rc-header-skip-link:focus { top: 12px; color: #000; }

/* ---------- announcement banner: voice wave, purple glow and a slow light sweep ---------- */
.rc-banner {
  position: relative; overflow: hidden; padding: 9px 48px;
  background: radial-gradient(38% 220% at 50% 0%, rgba(123, 92, 255, 0.55), transparent 72%), linear-gradient(90deg, #14102a, #1d1442 50%, #14102a);
  font-size: 13.5px; line-height: 1.55; text-align: center; color: #f4f2fb;
}
.rc-banner::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: -160px; width: 160px; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(190, 170, 255, 0.2), transparent);
  animation: rc-banner-sweep 7s ease-in-out infinite;
}
@keyframes rc-banner-sweep { 0%, 55% { left: -160px; } 100% { left: 110%; } }
.rc-banner .rc-banner-text { position: relative; gap: 4px 10px; color: rgba(255, 255, 255, 0.96); }
.rc-banner .rc-banner-wave { display: inline-flex; align-items: center; gap: 2px; height: 16px; }
.rc-banner .rc-banner-wave i {
  width: 2.5px; height: 100%; border-radius: 2px; background: #a98cff; box-shadow: 0 0 8px rgba(169, 140, 255, 0.8);
  transform: scaleY(0.25); animation: rc-banner-wave 1s ease-in-out infinite;
}
.rc-banner .rc-banner-wave i:nth-child(2) { animation-delay: -0.2s; }
.rc-banner .rc-banner-wave i:nth-child(3) { animation-delay: -0.4s; }
.rc-banner .rc-banner-wave i:nth-child(4) { animation-delay: -0.6s; }
.rc-banner .rc-banner-wave i:nth-child(5) { animation-delay: -0.8s; }
@keyframes rc-banner-wave { 0%, 100% { transform: scaleY(0.25); } 50% { transform: scaleY(1); } }
.rc-banner .rc-banner-lead { display: inline; margin-right: -5px; color: inherit; font-weight: 400; }
.rc-banner .rc-banner-lead em { font-family: var(--rc-font-serif); font-style: italic; font-weight: 700; -webkit-text-stroke: 0.3px currentColor; font-size: 1em; line-height: 1; color: #d9ceff; }
.rc-banner .rc-banner-link,
.rc-banner .rc-banner-link:hover {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 999px;
  color: #fff; font-size: 12.5px; font-weight: 500; transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.rc-banner .rc-banner-link:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.6); box-shadow: 0 0 18px rgba(155, 125, 255, 0.5); }
.rc-banner .rc-banner-close {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border-radius: 50%;
  font-size: 20px; line-height: 1; color: rgba(255, 255, 255, 0.7);
}
.rc-banner .rc-banner-close:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
@media (max-width: 700px) { .rc-banner { padding: 10px 44px 10px 16px; } }
/* banner type: one size for every word, vertically centred (the serif accent matches the sans text) - V4 79dae6a */
.rc-banner { font-size: 15px; line-height: 1.4; }
.rc-banner .rc-banner-text { align-items: center; }
.rc-banner .rc-banner-lead { display: inline-flex; align-items: center; gap: 0.28em; margin-right: 0; line-height: 1.4; }
.rc-banner .rc-banner-link, .rc-banner .rc-banner-link:hover { font-size: 14px; line-height: 1.4; }
@media (prefers-reduced-motion: reduce) {
  .rc-banner::before, .rc-banner .rc-banner-wave i { animation: none; }
  .rc-banner .rc-banner-wave i { transform: scaleY(0.6); }
}

/* ---------- header ---------- */
/* z-index above the old page content (the theme gives every <p> z-index: 100); the mega scrim sits just below */
.rc-header {
  position: sticky; top: 0; z-index: 1000; display: block; width: 100%; margin: 0; padding: 0;
  border-bottom: 1px solid transparent; color: var(--rc-ink);
  background: rgba(255, 255, 255, 0.7);
  -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6);
  transition: background-color 0.3s, backdrop-filter 0.3s, border-color 0.3s;
}
.rc-header.is-open { background: rgba(255, 255, 255, 0.92); }
.rc-header.has-mega { background: #fff; }

.rc-header .rc-header-bar { gap: 28px; height: 68px; }

/* logo: 28px mark (artwork 28 x 15.09 at inset 21.88% 0, as in Figma) + DM Sans SemiBold 18px */
.rc-header-logo,
.rc-header-logo:hover {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  font-family: 'REVE V4 DM Sans', 'DM Sans', var(--rc-font); font-size: 18px; font-weight: 600; line-height: 1.2; letter-spacing: 0;
  color: #1f2a37;
}
.rc-header-logo-mark { position: relative; display: block; flex: none; width: 28px; height: 28px; }
.rc-header-logo-mark img { position: absolute; left: 0; top: 21.88%; width: 100%; height: 53.89%; max-width: none; }
.rc-header-logo-word { white-space: nowrap; }

/* ---------- desktop navigation ---------- */
.rc-nav { position: static; display: flex; align-items: center; margin: 0 0 0 12px; padding: 0; background: none; }
.rc-nav-bar { display: flex; gap: 4px; }
.rc-header .rc-nav-toggle {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 0; border-radius: 999px; background: transparent;
  font-family: var(--rc-font); font-size: 14.5px; font-weight: 400; line-height: 1.55; color: var(--rc-ink-2);
  white-space: nowrap; cursor: pointer; transition: color 0.2s, background-color 0.2s;
}
.rc-header .rc-nav-toggle:hover { color: var(--rc-ink); background: rgba(20, 18, 31, 0.06); }
.rc-header .rc-nav-toggle.is-open { color: #412375; background: #f0ecff; }
.rc-nav-chevron { opacity: 0.7; transition: transform 0.22s var(--rc-ease); }
.rc-nav-toggle.is-open .rc-nav-chevron { transform: rotate(180deg); }

/* ---------- mega menu: one shared full-width panel under the header ---------- */
.rc-mega {
  position: absolute; left: 0; right: 0; top: 100%;
  background: #fff; border-bottom: 1px solid var(--rc-line); box-shadow: 0 30px 44px -30px rgba(20, 18, 31, 0.32);
  opacity: 0; visibility: hidden; transform: translateY(-6px); pointer-events: none;
  transition: opacity 0.16s ease, transform 0.18s var(--rc-ease), visibility 0s linear 0.18s;
}
.rc-mega.is-open { opacity: 1; visibility: visible; transform: none; pointer-events: auto; transition-delay: 0s; }
.rc-header .rc-mega-panel { padding-top: 26px; padding-bottom: 30px; animation: rc-nav-in 0.2s ease both; }
@keyframes rc-nav-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.rc-mega-grid { display: grid; min-height: 236px; }
.rc-mega-grid-product { grid-template-columns: 1.5fr 1fr 1fr 1.05fr; }
.rc-mega-grid-solutions { grid-template-columns: 1.15fr 1.25fr 0.95fr; }
.rc-mega-grid-resources { grid-template-columns: 1fr 1fr 1fr 1.15fr; }

.rc-mega-col { min-width: 0; padding: 0 28px; }
.rc-mega-col:first-child { padding-left: 0; }
.rc-mega-col-feature { display: flex; padding: 0 0 0 28px; }

/* column heading (also the mobile sheet group heading) */
.rc-header .rc-mega-heading,
.rc-header .rc-mobile-menu-heading {
  margin: 0 0 12px; padding-left: 10px;
  font-family: var(--rc-font-label); font-size: 11px; font-weight: 400; line-height: 1.55; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--rc-ink-3);
}

/* products: icon tile + name + one line (mega menu and mobile sheet) */
.rc-header .rc-mega-products,
.rc-header .rc-mega-links,
.rc-header .rc-mega-products li,
.rc-header .rc-mega-links li { margin: 0; padding: 0; list-style: none; }
.rc-header .rc-mega-products { display: grid; gap: 2px; }
.rc-header .rc-mega-product,
.rc-header .rc-mobile-menu-product {
  display: flex; align-items: flex-start; gap: 12px; padding: 10px; border-radius: 12px;
  font-weight: 400; color: var(--rc-ink); transition: background-color 0.18s;
}
.rc-header .rc-mega-product:hover { color: var(--rc-ink); background: rgba(20, 18, 31, 0.04); }
.rc-mega-icon,
.rc-mobile-menu-icon {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: #f2efff; color: #5b3fd0;
}
.rc-header .rc-mega-product-name,
.rc-header .rc-mobile-menu-product-name {
  display: block; font-size: 14.5px; font-weight: 600; line-height: 1.3; letter-spacing: -0.005em;
}
.rc-header .rc-mega-product-desc,
.rc-header .rc-mobile-menu-product-desc {
  display: block; margin-top: 2px;
  font-family: var(--rc-font-text); font-size: 13px; font-weight: 400; line-height: 1.4; color: var(--rc-ink-3);
}

/* plain link lists */
.rc-header .rc-mega-link {
  display: block; padding: 7px 10px; border-radius: 10px;
  font-size: 14px; font-weight: 400; line-height: 1.35; color: var(--rc-ink-2);
  transition: color 0.18s, background-color 0.18s;
}
.rc-header .rc-mega-link:hover { color: var(--rc-ink); background: rgba(20, 18, 31, 0.04); }
.rc-header .rc-mega-links-two-col { display: grid; grid-template-columns: 1fr 1fr; column-gap: 8px; }
.rc-header .rc-mega-more {
  display: inline-flex; align-items: center; gap: 6px; margin: 10px 0 0 10px;
  font-size: 13.5px; font-weight: 500; line-height: 1.55; color: #5b3fd0;
}
.rc-mega-more svg { transition: transform 0.2s var(--rc-ease); }
.rc-header a.rc-mega-more:hover { color: #5b3fd0; text-decoration: underline; text-underline-offset: 3px; }
a:hover > .rc-mega-more svg,
a.rc-mega-more:hover svg { transform: translate(2px, -2px); }

/* one featured card per menu */
.rc-header .rc-mega-feature {
  flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 20px;
  border: 0; border-radius: 16px; background: #f8f6fd; font-weight: 400; color: var(--rc-ink);
  transition: background-color 0.2s;
}
.rc-header .rc-mega-feature:hover { color: var(--rc-ink); background: #f1eefb; }
.rc-mega-feature-tag {
  padding: 3px 9px; border-radius: 999px; background: #ece7ff; color: #412375;
  font-family: var(--rc-font-label); font-size: 10.5px; line-height: 1.55; letter-spacing: 0.07em; text-transform: uppercase;
}
.rc-header .rc-mega-feature-title { font-size: 16px; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
.rc-header .rc-mega-feature-desc { font-family: var(--rc-font-text); font-size: 13.5px; line-height: 1.5; color: var(--rc-ink-3); }
.rc-header .rc-mega-feature .rc-mega-more { margin: auto 0 0; padding-top: 8px; }

/* page dim while a mega menu is open (appended to <body> by rc-v4-site-header.js), under the header */
.rc-mega-scrim {
  position: fixed; inset: 0; z-index: 999; background: rgba(0, 0, 0, 0.08);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}
.rc-mega-scrim.is-open { opacity: 1; visibility: visible; pointer-events: auto; transition-delay: 0s; }

/* ---------- header actions ---------- */
.rc-header .rc-header-actions { gap: 10px; margin-left: auto; }
.rc-header-login { display: none; }
.rc-header .rc-header-demo:hover { background: rgba(20, 18, 31, 0.05); border-color: rgba(20, 18, 31, 0.3); }

.rc-header-burger {
  display: none; position: relative; width: 40px; height: 40px;
  border: 1px solid var(--rc-line); border-radius: 50%;
}
.rc-header-burger span {
  position: absolute; left: 12px; right: 12px; height: 1.5px; background: var(--rc-ink);
  transition: transform 0.25s var(--rc-ease), top 0.25s var(--rc-ease);
}
.rc-header-burger span:first-child { top: 16px; }
.rc-header-burger span:last-child { top: 23px; }
.rc-header.is-open .rc-header-burger span:first-child { top: 19.5px; transform: rotate(45deg); }
.rc-header.is-open .rc-header-burger span:last-child { top: 19.5px; transform: rotate(-45deg); }

@media (min-width: 1101px) {
  .rc-header .rc-header-login {
    display: inline-flex; align-items: center; height: 40px; padding: 0 12px; border-radius: 999px;
    font-size: 14.5px; font-weight: 400; line-height: 1.55; color: var(--rc-ink-2);
    transition: color 0.2s, background-color 0.2s;
  }
  .rc-header .rc-header-login:hover { color: var(--rc-ink); background: rgba(20, 18, 31, 0.06); }
}

/* ---------- mobile sheet (<= 980px) ---------- */
.rc-mobile-menu { display: none; }

@media (max-width: 980px) {
  .rc-nav, .rc-header-demo, .rc-mega-scrim { display: none; }
  .rc-header-burger { display: inline-block; }
  /* the sheet carries its own Start free trial; hide the header copy (kept in layout so nothing shifts) */
  .rc-header.is-open .rc-header-trial { visibility: hidden; pointer-events: none; }

  .rc-mobile-menu:not([hidden]) {
    display: flex; flex-direction: column;
    height: calc(100vh - 69px - var(--rc-mobile-menu-top, 0px));
    height: calc(100dvh - 69px - var(--rc-mobile-menu-top, 0px));
    background: #fff; border-top: 1px solid var(--rc-line);
    animation: rc-nav-in 0.2s ease both;
  }
  .rc-mobile-menu-scroll {
    flex: 1; overflow-y: auto; overscroll-behavior: contain;
    padding: 0 var(--rc-gutter) 16px;
  }
  .rc-header .rc-mobile-menu-login {
    display: flex; align-items: center; min-height: 52px; border-bottom: 1px solid var(--rc-line);
    font-size: 15.5px; font-weight: 400; color: var(--rc-ink-2);
  }
  .rc-header .rc-mobile-menu-toggle {
    display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 58px;
    margin: 0; padding: 0; border: 0; border-bottom: 1px solid var(--rc-line); border-radius: 0; background: transparent;
    font-family: var(--rc-font); font-size: 18px; font-weight: 500; line-height: 1.55; color: var(--rc-ink); text-align: left;
    cursor: pointer;
  }
  .rc-mobile-menu-chevron { width: 12px; height: 12px; opacity: 0.6; transition: transform 0.22s var(--rc-ease); }
  .rc-mobile-menu-toggle[aria-expanded="true"] .rc-mobile-menu-chevron { transform: rotate(180deg); }
  .rc-header .rc-mobile-menu-section .rc-mobile-menu-toggle[aria-expanded="true"] { border-bottom-color: transparent; }
  .rc-mobile-menu-link svg { opacity: 0.6; }
  .rc-mobile-menu-panel {
    padding: 8px 0 16px; border-bottom: 1px solid var(--rc-line);
    animation: rc-nav-in 0.2s ease both;
  }
  .rc-mobile-menu-group + .rc-mobile-menu-group { margin-top: 14px; }
  .rc-header .rc-mobile-menu-heading { padding-left: 0; margin-bottom: 4px; }
  .rc-header .rc-mobile-menu-product { min-height: 52px; padding: 10px 0; border-radius: 0; }
  .rc-header .rc-mobile-menu-row {
    display: flex; align-items: center; min-height: 46px;
    font-size: 16px; font-weight: 400; color: var(--rc-ink-2);
  }
  .rc-mobile-menu-chips { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
  .rc-header .rc-mobile-menu-chip {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
    border: 1px solid var(--rc-line); border-radius: 999px;
    font-size: 14.5px; font-weight: 400; color: var(--rc-ink-2);
  }
  .rc-mobile-menu-cta {
    flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    padding: 12px var(--rc-gutter) calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--rc-line); background: #fff;
  }
  .rc-mobile-menu-cta .rc-btn { height: 48px; font-size: 15px; }
  .rc-mobile-menu-cta .rc-mobile-menu-trial { box-shadow: none; }
}

@media (max-width: 860px) {
  .rc-header .rc-header-logo { min-height: 44px; }
  .rc-header .rc-btn { min-height: 44px; }
  .rc-banner .rc-banner-close { width: 40px; height: 40px; right: 2px; font-size: 22px; }
}

/* 40px+ controls that fit down to 320px */
@media (max-width: 480px) {
  .rc-header .rc-header-bar { gap: 6px; }
  .rc-header .rc-header-actions { gap: 6px; }
  .rc-header .rc-header-actions .rc-btn { height: 40px; padding: 0 12px; font-size: 13px; }
  .rc-header-burger { width: 44px; height: 44px; }
  .rc-header-burger span { left: 13px; right: 13px; }
  .rc-header-burger span:first-child { top: 17px; }
  .rc-header-burger span:last-child { top: 25px; }
  .rc-header.is-open .rc-header-burger span:first-child,
  .rc-header.is-open .rc-header-burger span:last-child { top: 21px; }
}
/* the primary action moves into the menu so the bar never overflows */
@media (max-width: 400px) {
  .rc-header .rc-header-trial { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .rc-site-header *, .rc-mega-scrim { animation: none !important; transition-duration: 0.01ms !important; }
}
