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

/* ---------------------------------------------------------------------------
 * "Built to grow with you": copy + stats left, the growing-orders graph right.
 * Not in the Figma homepage frame (graph from routific.com/smart-route-optimization):
 * flag for design review.
 * ------------------------------------------------------------------------- */
.rt-gr {
  /* Grow-in progress (Growth.tsx sets it while scrolling; 1 = full width, the resting state) */
  --gr-p: 1;
  position: relative;
  background: #fff;
  color: var(--rt-text-primary);
  font-family: var(--rt-font-body);
  -webkit-font-smoothing: antialiased;
}

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

/* The stage holds the panel and the content. On desktop (scroll-driven, once hydrated) the section
   is a screen plus a hold taller, and the stage pins full screen for the hold. */
.rt-gr-stage {
  position: relative;
}

@media (min-width: 900px) and (min-height: 640px) {
  .rt-gr.is-armed {
    height: 170vh;
  }
  .rt-gr.is-armed .rt-gr-stage {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    height: 100vh;
    overflow: hidden;
  }
  .rt-gr.is-armed .rt-gr-inner {
    width: 100%;
    transform-origin: 50% 50%;
  }
}

/* Wide screens have room for the content to end up larger than its layout size */
@media (min-width: 1280px) and (min-height: 640px) {
  .rt-gr.is-armed .rt-gr-inner {
    scale: calc(0.88 + 0.22 * var(--gr-p));
  }
}

/* Lavender panel: an inset rounded card that widens to full width as the section scrolls in.
   Full width it runs straight into Industries below (same #f3f5ff). */
.rt-gr-panel {
  position: absolute;
  inset: 0 calc((1 - var(--gr-p)) * clamp(16px, 8vw, 140px));
  border-radius: calc((1 - var(--gr-p)) * 40px);
  background: #f3f5ff;
}

.rt-gr-inner {
  position: relative;
  scale: calc(0.86 + 0.14 * var(--gr-p));
  transform-origin: 50% 0;
  display: grid;
  grid-template-columns: minmax(0, 4.6fr) minmax(0, 7.4fr);
  align-items: center;
  gap: 56px;
  max-width: calc(1113px + 2 * 24px);
  margin: 0 auto;
  padding: 120px 24px;
}

.rt-gr-text {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.rt-gr-eyebrow {
  margin: 0;
  font-family: var(--rt-font-heading);
  font-weight: 700;
  font-size: 15px;
  line-height: 20px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rt-indigo-100);
}

.rt-gr-h2 {
  margin: 0;
  font-family: var(--rt-font-display);
  font-weight: 700;
  font-size: clamp(2.25rem, 1rem + 3vw, 3.25rem);
  line-height: 1.15;
  text-wrap: balance;
}

.rt-gr-body {
  margin: 0;
  font-size: 18px;
  line-height: 28px;
  color: #3c4151;
  text-wrap: pretty;
}

.rt-gr-stats {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: 20px;
  margin: 14px 0 0;
  padding: 22px 0 0;
  border-top: 1px solid #e4e7f2;
  list-style: none;
}

.rt-gr-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rt-gr-stat-value {
  font-family: var(--rt-font-display);
  font-weight: 700;
  font-size: 26px;
  line-height: 32px;
  color: var(--rt-indigo-100);
  white-space: nowrap;
}

.rt-gr-stat-label {
  font-size: 15px;
  line-height: 20px;
  color: var(--rt-text-secondary);
}

.rt-gr-graph {
  min-width: 0;
}

.rt-gr-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

/* SVG labels (viewBox units: 15 ≈ 15px at full size) */
.rt-gr-svg .rt-gr-tick {
  font-family: var(--rt-font-heading);
  font-size: 23px;
  fill: #282828;
}

.rt-gr-label-m .rt-gr-tick {
  font-size: 31px;
}

.rt-gr-label-m {
  display: none;
}

/* ---- Phones: stack; the graph keeps three larger labels ---- */
@media (max-width: 899px) {
  .rt-gr-inner {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 88px 24px;
  }
}

@media (max-width: 599px) {
  .rt-gr-inner {
    padding: 72px 16px;
  }
  .rt-gr-body {
    font-size: 16px;
    line-height: 25px;
  }
  .rt-gr-stats {
    gap: 12px;
  }
  .rt-gr-stat-value {
    font-size: 20px;
    line-height: 26px;
  }
  .rt-gr-stat-label {
    font-size: 13px;
    line-height: 17px;
  }
  .rt-gr-label-d,
  .rt-gr-label--minor {
    display: none;
  }
  .rt-gr-label-m {
    display: inline;
  }
}

/* ---------------------------------------------------------------------------
 * Motion: scroll-driven (Growth.tsx sets the line's dash offsets, the dot's position and each box
 * stack's opacity/transform). Base styles = the fully grown graph.
 * ------------------------------------------------------------------------- */
.rt-gr-badge,
.rt-gr-dot {
  transform-box: fill-box;
  transform-origin: center;
}

.rt-gr-dot {
  transform-box: view-box;
  transform-origin: 0 0;
}

