/*
 * 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;
}

/* ---------------------------------------------------------------------------
 * Testimonial card (src/lib/TestimonialCard.tsx): frosted deep-blue card with a quote mark, the
 * quote, and the author (avatar or initials, name, role). Used by the Hero and Reviews sections.
 * Needs tokens.css.
 * ------------------------------------------------------------------------- */
.rt-card {
  display: flex;
  border-radius: var(--rt-radius-lg);
  /* Frosted glass over a deep-blue base, so the white text stays readable where the cards
     sit on the lighter part of the gradient (stacked on mobile). */
  background:
    linear-gradient(160deg, rgb(255 255 255 / 0.14), rgb(255 255 255 / 0.05)),
    rgb(31 54 167 / 0.85);
  box-shadow:
    inset 0 0 0 1px rgb(255 255 255 / 0.16),
    0 24px 48px -24px rgb(8 16 70 / 0.55);
  color: #fff;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.rt-figure {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 20px;
  margin: 0;
  padding: 28px 28px 24px;
}

.rt-quote-mark {
  width: 28px;
  height: 21px;
  fill: var(--rt-turquoise);
}

.rt-quote {
  flex: 1;
  margin: 0;
}

.rt-quote p {
  margin: 0;
  font-size: 18px;
  line-height: 26px;
  text-wrap: pretty;
}

.rt-author {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid rgb(255 255 255 / 0.14);
}

.rt-avatar {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px rgb(255 255 255 / 0.85);
}

.rt-avatar-initials {
  display: grid;
  place-items: center;
  font-family: var(--rt-font-heading);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
}
.rt-tone-0 { background: linear-gradient(135deg, var(--rt-turquoise), var(--rt-route-sky)); }
.rt-tone-1 { background: linear-gradient(135deg, var(--rt-route-pink), var(--rt-route-violet)); }
.rt-tone-2 { background: linear-gradient(135deg, var(--rt-indigo-200), var(--rt-route-lilac)); }
.rt-tone-3 { background: linear-gradient(135deg, var(--rt-yellow-200), var(--rt-route-pink)); }

.rt-author-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.rt-author-name {
  font-size: 16px;
  font-weight: 700;
  line-height: 22px;
}

.rt-author-role {
  font-size: 14px;
  line-height: 20px;
  color: rgb(255 255 255 / 0.72);
}

/* ---------------------------------------------------------------------------
 * Capterra social proof (Figma 7166:88320 on bg 7166:88319)
 * ------------------------------------------------------------------------- */
.rt-rv {
  position: relative;
  padding: 128px 24px;
  background: #131b52; /* Background/Dark Indigo */
  color: #fff;
  font-family: var(--rt-font-body);
  -webkit-font-smoothing: antialiased;
}

/* Entry band (Figma bg 7166:88523): a lavender section above fades into the dark indigo through
   the hex lattice (moved here from the old Customers section). */
.rt-rv--light {
  overflow: hidden;
  padding-top: 400px;
  background: linear-gradient(to bottom, #f3f5ff 0, #f3f5ff 40px, #131b52 300px, #131b52 100%);
}

.rt-rv-entry {
  position: absolute;
  top: 20px;
  left: 50%;
  width: 1909px;
  height: 955px;
  translate: -50% 0;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 140px, #000 220px, transparent 330px);
  mask-image: linear-gradient(to bottom, transparent 0, #000 140px, #000 220px, transparent 330px);
}

.rt-rv-entry img {
  display: block;
  width: 100%;
  height: 100%;
}

.rt-rv-inner {
  position: relative;
}

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

/* A left-aligned column, centred: wider than Figma's 821px so the headline sits on two lines */
.rt-rv-inner {
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 1120px;
  margin: 0 auto;
}

.rt-rv-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.rt-rv-h2 {
  margin: 0;
  max-width: 1000px;
  text-wrap: balance;
  font-family: var(--rt-font-display);
  font-weight: 700;
  font-size: clamp(2.25rem, 1rem + 3.5vw, 3.75rem);
  line-height: 1.2;
  color: #fff;
}

.rt-rv-hl {
  color: var(--rt-yellow-200);
}

/* The whole rating line (stars, rating, review count) links to Capterra */
.rt-rv-rating {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  min-height: 30px;
  color: #fff;
  text-decoration: none;
}

.rt-rv-rating img {
  display: block;
  flex: none;
}

.rt-rv-rating-text {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.2em;
  white-space: nowrap;
  padding-top: 6px;
  font-size: 18px;
  line-height: 24px;
}

.rt-rv-rating:hover .rt-rv-rating-text {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.rt-rv-rating:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
  border-radius: 4px;
}

.rt-rv-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 40px;
  margin: 0;
  padding: 20px 0;
  list-style: none;
}

.rt-rv-badge a {
  display: block;
  border-radius: 12px;
  transition: translate 160ms ease;
}

.rt-rv-badge a:hover {
  translate: 0 -3px;
}

.rt-rv-badge a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

.rt-rv-badge img {
  display: block;
  height: 130px;
  width: auto;
}

/* ---- Review cards: the hero's testimonial cards (src/styles/testimonial-card.css) ---- */
.rt-rv-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

/* ---- Customer logos: full-bleed rows under the review cards ---- */
.rt-rv-logos {
  margin: 96px -24px 0;
}

.rt-lg-label {
  margin: 0 auto 28px;
  padding: 0 24px;
  max-width: calc(1120px + 2 * 24px);
  font-family: var(--rt-font-heading);
  font-weight: 700;
  font-size: 15px;
  line-height: 20px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c8d0ff;
}

/* ---- Logo marquee: two rows of 300 × 125 tiles, 32px apart ----
 * Each row starts where Figma puts it (offset from the left edge of the centred 1440 frame) and
 * holds three copies of its logos, so shifting by one copy (--set) loops seamlessly. */
.rt-lg {
  display: flex;
  flex-direction: column;
  gap: 31px;
}

.rt-lg-row {
  position: relative;
  height: 125px;
}

.rt-lg-track {
  position: absolute;
  top: 0;
  left: calc(50% - 720px + var(--offset));
  display: flex;
  gap: 32px;
  margin: 0;
  padding: 0;
  list-style: none;
  will-change: transform;
}

.rt-lg-tile {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 300px;
  height: 125px;
  overflow: hidden;
  padding: 0 32px;
  border-radius: 16px;
  background: #2435a1 /* Indigo/Core */;
}

.rt-lg-art {
  position: relative;
  flex: none;
  display: block;
}

.rt-lg-art.is-dim {
  opacity: 0.8;
}

.rt-lg-art img {
  position: absolute;
  display: block;
  max-width: none;
}

.rt-lg-custom {
  display: block;
  max-width: 236px;
  max-height: 96px;
  object-fit: contain;
}

.rt-lg-name {
  font-weight: 700;
  font-size: 22px;
  color: #d3d7ec;
  text-align: center;
}

@keyframes rt-lg-left {
  from { transform: translateX(0); }
  to { transform: translateX(calc(-1 * var(--set))); }
}
@keyframes rt-lg-right {
  from { transform: translateX(calc(-1 * var(--set))); }
  to { transform: translateX(0); }
}

.rt-lg-animate .rt-lg-left {
  animation-name: rt-lg-left;
}
.rt-lg-animate .rt-lg-right {
  animation-name: rt-lg-right;
}
.rt-lg-animate .rt-lg-track {
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-play-state: paused;
}
/* Scroll only while on screen (hovering doesn't pause it) */
.rt-lg-animate.is-inview .rt-lg-track {
  animation-play-state: running;
}

@media (max-width: 767px) {
  .rt-rv--light {
    padding-top: 340px;
  }
  .rt-rv-logos {
    margin: 64px -16px 0;
  }
  .rt-lg {
    gap: 16px;
  }
  .rt-lg-label {
    padding: 0 16px;
  }
  /* Smaller tiles on phones (a layout Figma doesn't have) */
  .rt-lg-row {
    height: 84px;
  }
  .rt-lg-track {
    transform-origin: 0 0;
    scale: 0.672;
    left: calc(50% - 720px * 0.672 + var(--offset) * 0.672);
  }
}

@media (max-width: 767px) {
  .rt-rv {
    padding: 96px 16px;
  }
  .rt-rv-badges {
    gap: 16px;
    padding: 12px 0;
  }
  .rt-rv-badge img {
    height: 84px;
  }
  .rt-rv-cards {
    grid-template-columns: 1fr;
  }

}


/* ---------------------------------------------------------------------------
 * Motion: badges and cards rise in once the section is in view. Base = final state.
 * ------------------------------------------------------------------------- */
@keyframes rt-rv-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

.rt-rv-animate.is-inview .rt-rv-badge,
.rt-rv-animate.is-inview .rt-card {
  animation: rt-rv-rise 650ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .rt-lg-track,
  .rt-rv-badge,
  .rt-card {
    animation: none !important;
  }
}

