/* Hero */
/* No stacking context here: the hero's own gradient stays below the phone layer,
   while its media and copy opt above it via z-index. */
.hero {
  position: relative;
  height: var(--hero-height);
  background: linear-gradient(to bottom, var(--color-supporting), var(--color-background));
}

.hero__media {
  position: absolute;
  left: 0;
  top: var(--hero-media-top);
  height: var(--hero-media-height);
  overflow: hidden;
  z-index: var(--z-hero-background);
}

/*
 * The design shows the photo 1672px wide inside a 1440px frame, offset by -117px.
 * Keeping that as a ratio of the viewport (1672/1440, -117/1440) reproduces the
 * crop at any width and keeps the cars under the percentage-positioned badges.
 */
.hero__media-image {
  width: 116.111%;
  max-width: none;
  margin-left: -8.125%;
  height: var(--hero-media-height);
  object-fit: cover;
  object-position: 50% 32.75%;
  /* Gradient mask fades the photo into the page at the top and bottom */
  -webkit-mask-image: url("../assets/svg/hero-mask.svg");
  mask-image: url("../assets/svg/hero-mask.svg");
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

/* Percentages are badge centres, so the labels track the cars as the photo widens */
.hero__badge {
  position: absolute;
  transform: translate(-50%, -50%);
}

.hero__badge--meeting {
  left: 27.1%;
  top: 73.4%;
}

.hero__badge--client {
  left: 41.3%;
  top: 68.2%;
}

.hero__badge--transport {
  left: 75.1%;
  top: 76.2%;
}

.hero__inner {
  position: relative;
  height: 100%;
  z-index: var(--z-hero-content);
}

.hero__title-block {
  position: absolute;
  left: 0;
  top: 288px;
  width: 390px;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-h1-size);
  line-height: var(--text-h1-line);
  letter-spacing: var(--text-h1-spacing);
  color: var(--color-foreground);
}

.hero__title-highlight {
  position: relative;
  display: inline;
}

.hero__title-highlight::before {
  content: "";
  position: absolute;
  left: -4px;
  right: -3px;
  top: 50%;
  transform: translateY(-20%);
  height: 51px;
  background: linear-gradient(
    to right,
    var(--color-alpha-brand-80),
    var(--color-alpha-brand-20)
  );
  z-index: -1;
}

/* Right edge aligns to the right edge of the content column */
.hero__text-container {
  position: absolute;
  right: 0;
  top: var(--hero-media-top);
  width: 385px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}

.hero__description {
  font-weight: 500;
  font-size: var(--text-body-size);
  line-height: var(--text-body-line);
  letter-spacing: var(--text-body-spacing);
}

/* How It Works */
.how-it-works {
  position: relative;
}

/* The horizontal rules span the viewport, the columns stay in the content column */
.how-it-works__band {
  height: 700px;
  border-bottom: 1px solid var(--color-border);
}

.how-it-works__band--first {
  margin-top: var(--section-gap);
  border-top: 1px solid var(--color-border);
}

.how-it-works__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  height: 100%;
}

.how-it-works__col {
  display: flex;
  align-items: center;
  padding: 48px;
}

.how-it-works__col:first-child {
  border-left: 1px solid var(--color-border);
}

.how-it-works__col:last-child {
  border-right: 1px solid var(--color-border);
}

.how-it-works__col--white {
  background: var(--color-background);
}

.how-it-works__col--muted {
  background: var(--color-muted);
}

.how-it-works__col--center {
  position: relative;
  justify-content: center;
  overflow: hidden;
  border-inline: 1px solid var(--color-border);
}

/* Keeps its designed 481x1577 size and is centred; the column crops it */
.how-it-works__hatching {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 481px;
  max-width: none;
  height: 1577px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.how-it-works__heading {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-h3-size);
  line-height: var(--text-h3-line);
  letter-spacing: var(--text-h3-spacing);
  color: var(--color-foreground);
}

.how-it-works__body {
  font-weight: 400;
  font-size: var(--text-body-size);
  line-height: var(--text-body-line);
  letter-spacing: var(--text-body-spacing);
}

/* Scroll-driven phone: above the sections, below the hero media and hero copy */
.phone-layer {
  position: fixed;
  top: 0;
  /* Centre on the content column, so a scrollbar cannot shift it */
  left: max(50%, calc(var(--page-min-width) / 2));
  z-index: var(--z-phone);
  pointer-events: none;
  transform: translate3d(-50%, var(--phone-hero-top), 0);
  will-change: transform;
}

/* Problem Section */
.why-ruvio {
  padding-bottom: 100px;
}

.why-ruvio__content {
  display: flex;
  flex-direction: column;
  gap: 100px;
}

.why-ruvio__top {
  width: 100%;
}

.why-ruvio__copy-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  padding: 64px;
  text-align: center;
  border: 1px solid var(--color-border);
  border-top: none;
  background: var(--color-background);
}

.why-ruvio__heading {
  width: 720px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-h3-size);
  line-height: var(--text-h3-line);
  letter-spacing: var(--text-h3-spacing);
}

.why-ruvio__heading-muted {
  color: var(--color-muted-foreground);
}

.why-ruvio__text-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 720px;
}

.why-ruvio__text-lead {
  font-weight: 500;
}

.why-ruvio__text {
  font-weight: 400;
}

.why-ruvio__table-wrapper {
  border-top: 1px solid var(--color-border);
}

.why-ruvio__cta-block {
  background: var(--color-background);
}

.why-ruvio__cta-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  padding: 64px;
  text-align: center;
}

.why-ruvio__cta-heading {
  width: 640px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-h3-size);
  line-height: var(--text-h3-line);
  letter-spacing: var(--text-h3-spacing);
}

.why-ruvio__cta-heading-muted {
  color: var(--color-muted-foreground);
}

.why-ruvio__cta-text {
  width: 640px;
  color: var(--color-muted-foreground);
  font-weight: 400;
}

/* Footer */
.footer {
  background: var(--color-muted);
  border-top: 1px solid var(--color-border);
  font-size: var(--text-small-size);
  font-weight: 500;
  line-height: var(--text-small-line);
  letter-spacing: var(--text-small-spacing);
  color: var(--color-muted-foreground);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 24px;
}

.footer__links {
  display: flex;
  gap: 16px;
}

.footer__link:hover {
  color: var(--color-foreground);
}
