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

/* ---------------------------------------------------------------------------
 * Section (Figma 7166:88578): a full-width light-indigo band
 * ------------------------------------------------------------------------- */
.rt-in {
  position: relative;
  font-family: var(--rt-font-heading);
  color: var(--rt-text-primary);
  background: #f3f5ff;
  -webkit-font-smoothing: antialiased;
}

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

.rt-in-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  width: 100%;
  max-width: calc(1120px + 2 * 24px);
  margin: 0 auto;
  padding: 80px 24px;
}

.rt-in-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 1030px;
  padding-bottom: 20px;
  text-align: center;
}

.rt-in-h2 {
  margin: 0;
  font-family: var(--rt-font-display);
  font-weight: 700;
  font-size: clamp(2.25rem, 1rem + 3.5vw, 3.75rem);
  line-height: 1.2;
  text-wrap: balance;
}

.rt-in-sub {
  margin: 0;
  font-size: clamp(1.0625rem, 0.9rem + 0.4vw, 1.25rem);
  line-height: 1.6;
  text-wrap: pretty;
}

/* ---- Cards ---- */
.rt-in-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  justify-content: center;
  gap: 20px;
  width: 100%;
}

.rt-in-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 32px 32px;
  border-radius: 16px;
  background: #fff;
  color: inherit;
  text-decoration: none;
}

.rt-in-card-link {
  transition:
    translate 200ms ease,
    box-shadow 200ms ease;
}

.rt-in-card-link:hover {
  translate: 0 -4px;
  box-shadow: 0 14px 32px rgba(31, 54, 167, 0.14);
}

.rt-in-card-link .rt-in-h3 {
  transition: color 200ms ease;
}

.rt-in-card-link:hover .rt-in-h3 {
  color: var(--rt-indigo-100);
}

/* "Learn more": sits at the bottom of the card; the arrow nudges on hover */
.rt-in-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
  font-weight: 600;
  font-size: 18px;
  line-height: 24px;
  color: var(--rt-indigo-100);
}

.rt-in-more svg {
  transition: translate 200ms ease;
}

.rt-in-card-link:hover .rt-in-more svg {
  translate: 3px 0;
}

.rt-in-card-link:focus-visible {
  outline: 2px solid var(--rt-indigo-100);
  outline-offset: 3px;
}

.rt-in-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* "New" pill: top-right corner of the card */
.rt-in-pill {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #fff1d6;
  font-family: var(--rt-font-heading);
  font-weight: 700;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9a5b00;
}

.rt-in-badge {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 32px;
  background: #fff;
}

.rt-in-badge img {
  display: block;
}

.rt-in-badge-shopify img {
  margin-left: -1px;
}

.rt-in-badge-zapier img {
  width: 64px;
  height: 64px;
}

.rt-in-h3 {
  margin: 0;
  font-family: var(--rt-font-body);
  font-weight: 600;
  font-size: 20px;
  line-height: 24px;
}

.rt-in-text {
  margin: 0;
  font-size: 18px;
  line-height: 24px;
}

/* Four across needs room: 2 × 2 below 1200px, stacked full width (like the Engine API card) on phones */
@media (max-width: 1199px) {
  .rt-in-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1440px) and (min-width: 1200px) {
  .rt-in-card {
    padding: 20px 24px 28px;
  }
}

@media (max-width: 599px) {
  .rt-in-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 599px) {
  .rt-in-inner {
    gap: 28px;
    padding: 64px 16px;
  }
  .rt-in-card {
    padding: 20px 20px 24px;
  }
}

/* ---------------------------------------------------------------------------
 * Motion: cards rise in one after another, logos pop. Base styles = final state.
 * ------------------------------------------------------------------------- */
@keyframes rt-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: none; }
}
@keyframes rt-in-pop {
  0% { transform: scale(0.6); }
  70% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.rt-in-animate.is-inview .rt-in-card {
  animation: rt-in-up 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.rt-in-animate.is-inview .rt-in-badge {
  animation: rt-in-pop 500ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.rt-in-animate.is-inview .rt-in-card:nth-child(2),
.rt-in-animate.is-inview .rt-in-card:nth-child(2) .rt-in-badge { animation-delay: 120ms; }
.rt-in-animate.is-inview .rt-in-card:nth-child(3),
.rt-in-animate.is-inview .rt-in-card:nth-child(3) .rt-in-badge { animation-delay: 240ms; }
.rt-in-animate.is-inview .rt-in-card:nth-child(1) .rt-in-badge { animation-delay: 150ms; }
.rt-in-animate.is-inview .rt-in-card:nth-child(2) .rt-in-badge { animation-delay: 270ms; }
.rt-in-animate.is-inview .rt-in-card:nth-child(3) .rt-in-badge { animation-delay: 390ms; }
.rt-in-animate.is-inview .rt-in-card:nth-child(4) { animation-delay: 360ms; }
.rt-in-animate.is-inview .rt-in-card:nth-child(4) .rt-in-badge { animation-delay: 510ms; }

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

