/*
 * Design tokens from the Routific Website Figma file (variables on node 7166:92349).
 * Code components render inside Shadow DOM, so tokens are declared on :host as well as :root
 * (:root covers the local preview and Webflow's own page; :host covers the shadow tree).
 */
:host,
:host {
  /* Brand */
  --rt-indigo-100: #374cd2;
  --rt-indigo-200: #667afa;
  --rt-yellow-200: #ffad0a;
  --rt-yellow-border: #b97b01;
  --rt-turquoise: #45c4d7;
  --rt-primary-500: #326bfc;
  --rt-primary-600: #1750e3;
  --rt-hero-blue: #1f36a7;
  --rt-hero-lilac: #eceefb;

  /* Text */
  --rt-text-primary: #282828;
  --rt-text-secondary: #676d7e;
  --rt-text-tertiary: #9da1af;

  /* Route colours */
  --rt-route-violet: #7547bf;
  --rt-route-pink: #ff85a9;
  --rt-route-sky: #269ed1;
  --rt-route-lilac: #a770db;

  /* Type — Proxima Nova is expected to be loaded by the Webflow site (Adobe Fonts);
     Plus Jakarta Sans and Figtree are loaded from Google Fonts by useDocumentFonts(). */
  --rt-font-display: "Plus Jakarta Sans", system-ui, sans-serif;
  --rt-font-heading: "Figtree", system-ui, sans-serif;
  --rt-font-body: "proxima-nova", "Proxima Nova", "Figtree", system-ui, sans-serif;
  --rt-font-ui: "SF Pro Text", -apple-system, "Inter", system-ui, sans-serif;

  /* Radii */
  --rt-radius-md: 8px;
  --rt-radius-lg: 16px;

  /* Vector map (Hero/showcase/MapBase.tsx): Mapbox-light look of the current Routific UI */
  --map-land: #edeff3;
  --map-street: #fcfdfe;
  --map-park: #d3e9d1;
  --map-water: #b3caf3;
  --map-industrial: #f2e4c6;
  --map-highway: #aab3c7;
  --map-highway-edge: #fcfdfe;
}

/* ---------------------------------------------------------------------------
 * Navbar (Figma "Nav Wrapper" 7166:92408) — positioned at the top of the page, so it takes no space
 * in the page flow and floats over the hero (which leaves 180px at its top for it). Static: it
 * scrolls away with the page.
 * ------------------------------------------------------------------------- */
.rt-nav {
  position: absolute;
  z-index: 1000;
  top: 12px;
  left: 50%;
  width: min(1152px, calc(100% - 32px));
  translate: -50% 0;
  border-radius: 24px;
  background: #fff;
  font-family: var(--rt-font-body);
  color: var(--rt-text-primary);
  -webkit-font-smoothing: antialiased;
  box-shadow: 0 1px 2px rgba(31, 54, 167, 0.04);
}

/* ---- Theme "dark" (pages with a dark hero): frosted glass with white text. With the mobile menu
   open it switches to the white bar, which the panel is designed for. ---- */
.rt-nav--dark:not(.is-mobile-open) {
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.rt-nav--dark:not(.is-mobile-open) .rt-nav-logo img + img {
  filter: brightness(0) invert(1);
}

.rt-nav--dark:not(.is-mobile-open) .rt-nav-item,
.rt-nav--dark:not(.is-mobile-open) .rt-nav-link {
  color: #fff;
}

.rt-nav--dark:not(.is-mobile-open) .rt-nav-chev {
  filter: brightness(0) invert(0.85);
}

.rt-nav--dark:not(.is-mobile-open) .rt-nav-burger {
  background: rgba(255, 255, 255, 0.12);
}

.rt-nav--dark:not(.is-mobile-open) .rt-nav-burger span {
  background: #fff;
}

.rt-nav--dark a:focus-visible,
.rt-nav--dark button:focus-visible {
  outline-color: #fff;
}

.rt-nav *,
.rt-nav *::before,
.rt-nav *::after {
  box-sizing: border-box;
}

.rt-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px;
  transition: padding 250ms ease;
}

.rt-nav a {
  text-decoration: none;
}

.rt-nav a:focus-visible,
.rt-nav button:focus-visible {
  outline: 2px solid var(--rt-primary-500);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---- Logo (148 × 48, 32px tall mark + type) ---- */
.rt-nav-logo {
  display: flex;
  flex: none;
  align-items: center;
  width: 148px;
  height: 48px;
  padding: 8px 0;
}

.rt-nav-logo img {
  display: block;
}

.rt-nav-logo img + img {
  margin: 0 0 0 5.8px;
  height: 26.969px;
  width: auto;
}

/* ---- Items ---- */
.rt-nav-items {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 8px;
}

.rt-nav-item,
.rt-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 18px;
  line-height: 24px;
  white-space: nowrap;
  cursor: pointer;
}

.rt-nav-item {
  font-weight: 600;
  color: var(--rt-indigo-100);
}

.rt-nav-link {
  font-weight: 400;
  color: var(--rt-text-primary);
}

.rt-nav-item:hover,
.rt-nav-link:hover {
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 1.5px;
}

/* Figma's chevron points down (the vector is flipped). It turns up when the menu is open. */
.rt-nav-chev {
  display: block;
  width: 9.382px;
  height: 6.094px;
  scale: 1 -1;
  transition: scale 200ms ease;
}

.rt-nav-dd.is-open .rt-nav-chev {
  scale: 1 1;
}

.rt-nav-actions {
  display: flex;
  align-items: center;
  gap: 32px;
}

/* Hero primary button style (Figma 7166:92425) */
.rt-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 32px;
  border: 1.5px solid var(--rt-yellow-border);
  border-radius: var(--rt-radius-lg);
  background: var(--rt-yellow-200);
  font-weight: 600;
  font-size: 18px;
  line-height: 24px;
  color: #18191d;
  white-space: nowrap;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.rt-nav-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(31, 54, 167, 0.18);
}

.rt-nav-btn-outline {
  border-color: var(--rt-indigo-100);
  background: #fff;
  color: var(--rt-indigo-100);
}

/* ---- Dropdowns ---- */
.rt-nav-dd {
  position: relative;
}

/* Invisible bridge so the pointer can travel from the trigger to the menu */
.rt-nav-dd.is-open::after {
  content: "";
  position: absolute;
  left: -12px;
  right: -12px;
  top: 100%;
  height: 22px;
}

.rt-nav-menu {
  position: absolute;
  top: calc(100% + 18px);
  z-index: 1;
  min-width: 220px;
  margin: 0;
  padding: 8px;
  list-style: none;
  border: 1px solid #e5e9ff;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(31, 54, 167, 0.14);
  animation: rt-nav-in 160ms ease-out;
}

.rt-nav-menu[hidden] {
  display: none;
}

.rt-nav-menu-start {
  left: -16px;
}

.rt-nav-menu-end {
  right: -16px;
}

.rt-nav-menu a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 16px;
  line-height: 20px;
  color: var(--rt-text-primary);
  white-space: nowrap;
}

.rt-nav-menu a:hover {
  background: #f3f5ff;
  color: var(--rt-indigo-100);
}

/* Rich menu (Figma 6660:37056): 24px padding, icon + 20px title, 16px grey description indented 40px */
.rt-nav-menu-rich {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 420px;
  padding: 16px 12px;
}

/* Icons without descriptions (Industries): same rows, as wide as the longest label */
.rt-nav-menu-compact {
  width: max-content;
  min-width: 300px;
}

.rt-nav-menu-rich a,
.rt-nav-panel-sub-rich a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  border-radius: 12px;
  white-space: normal;
}

.rt-nav-rich-title {
  display: flex;
  align-items: center;
  gap: 16px;
  font-weight: 600;
  font-size: 20px;
  line-height: 32px;
  color: #111b29;
}

.rt-nav-rich-title img,
.rt-nav-rich-noicon {
  display: block;
  flex: none;
  width: 24px;
  height: 24px;
}

.rt-nav-rich-desc {
  display: block;
  padding-left: 40px;
  font-size: 16px;
  line-height: 20px;
  color: #677489;
}

.rt-nav-menu-rich a:hover .rt-nav-rich-title {
  color: var(--rt-indigo-100);
}

@keyframes rt-nav-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---- Hamburger + mobile panel ---- */
.rt-nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0 11px;
  border: 0;
  border-radius: 12px;
  background: #f3f5ff;
  cursor: pointer;
}

.rt-nav-burger span {
  display: block;
  height: 2px;
  border-radius: 1px;
  background: var(--rt-indigo-100);
  transition:
    transform 200ms ease,
    opacity 200ms ease;
}

.rt-nav.is-mobile-open .rt-nav-burger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.rt-nav.is-mobile-open .rt-nav-burger span:nth-child(2) {
  opacity: 0;
}

.rt-nav.is-mobile-open .rt-nav-burger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.rt-nav-panel {
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding: 0 16px 20px;
  border-top: 1px solid #e5e9ff;
}

.rt-nav-panel[hidden] {
  display: none;
}

.rt-nav-panel-list,
.rt-nav-panel-sub {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rt-nav-panel-list > li {
  border-bottom: 1px solid #f0f2fa;
}

.rt-nav-panel-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 4px;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  font-size: 18px;
  line-height: 24px;
  color: var(--rt-indigo-100);
  text-align: left;
  cursor: pointer;
}

.rt-nav-panel-item[aria-expanded="true"] .rt-nav-chev {
  scale: 1 1;
}

.rt-nav-panel-sub {
  padding: 0 0 12px 12px;
}

.rt-nav-panel-sub[hidden] {
  display: none;
}

.rt-nav-panel-sub a {
  display: block;
  padding: 10px 4px;
  font-size: 16px;
  line-height: 20px;
  color: var(--rt-text-primary);
}

.rt-nav-panel-sub-rich a {
  padding: 8px 4px;
}

.rt-nav-panel-sub-rich .rt-nav-rich-title {
  font-size: 17px;
  line-height: 24px;
}

.rt-nav-panel-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 20px;
}

.rt-nav-panel-login {
  padding: 4px;
  font-size: 16px;
  line-height: 20px;
  color: var(--rt-text-primary);
}

.rt-nav-panel-actions .rt-nav-btn {
  width: 100%;
}

/* Tighter desktop spacing before collapsing */
@media (max-width: 1199px) {
  .rt-nav-items,
  .rt-nav-actions {
    gap: 22px;
  }
  .rt-nav-btn {
    padding: 14px 24px;
  }
}

@media (max-width: 991px) {
  .rt-nav {
    top: 8px;
    width: calc(100% - 16px);
    border-radius: 20px;
  }
  .rt-nav-bar {
    padding: 8px 8px 8px 16px;
  }
  .rt-nav-items,
  .rt-nav-actions {
    display: none;
  }
  .rt-nav-burger {
    display: flex;
  }
}

@media (min-width: 992px) {
  .rt-nav-panel {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rt-nav *,
  .rt-nav {
    animation: none !important;
    transition: none !important;
  }
}

