/*
 * Home (corporate RIVERO) layout. Needs tokens.css and site.css first.
 * Markup: src/templates/home.mjs and src/components/organisms/home/.
 */

/* Instrument Serif Italic (SIL OFL 1.1, public/assets/fonts/), self-hosted:
   the Latin subset only, for the leadership roles. */
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/instrument-serif-italic-latin.woff2') format('woff2');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}

/* #757575 is too light for body text on #F2F2F2 (4.1:1); darker on alt. Light
   theme only: in the dark theme the alt tone is #151515, where #5e5e5e is
   2.8:1, so it keeps the dark palette's own --ink-muted. */
:root:not([data-theme='dark']) [data-page='home'] [data-tone='alt'] {
  --ink-muted: #5e5e5e;
}
[data-page='home']
  main
  > section[data-tone]:not(.hero, .ports, .bigword, .about-xp) {
  padding-block: var(--section-pad);
}
[data-page='home'] .eyebrow {
  color: var(--accent-text);
}
.section-head {
  display: grid;
  gap: var(--space-4);
  max-width: 62rem;
  margin-bottom: clamp(36px, 5vw, 72px);
}
.section-title {
  font-size: var(--display-md);
}
.section-lede {
  margin: 0;
  max-width: 60ch;
  color: var(--ink-muted);
  font-size: var(--text-lg);
}
.btn-primary:hover {
  background: var(--rv-blue-deep);
}

/* One company bar + header */
.home-brand-bar {
  background: var(--tone-alt);
  color: var(--ink-muted);
  border-bottom: var(--hairline) solid var(--rule);
  font: 500 11px / 1 var(--font-mono);
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
}
/* One fixed-height row (scrolls sideways on narrow screens) so the sticky
   header can park it exactly off screen. */
.home-brand-bar .wrap {
  display: flex;
  align-items: center;
  gap: 22px;
  height: 34px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}
.home-brand-bar .wrap::-webkit-scrollbar {
  display: none;
}
.home-brand-bar a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
  opacity: 0.78;
  transition: opacity var(--dur-fast);
}
.home-brand-bar a:hover {
  opacity: 1;
}
.home-brand-bar .tint {
  width: 14px;
}
/* Static: sticky, with the brand bar (34px + border) scrolling away. */
.home-header {
  position: sticky;
  top: -35px;
  z-index: 50;
  background: color-mix(in srgb, var(--tone-light) 84%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: var(--hairline) solid var(--rule);
  color: var(--ink);
}
html {
  scroll-padding-top: 88px;
}
/* Dive: fixed and parked above the viewport; hero.js adds .is-shown once
   the hero is passed or on scroll up. */
.rv-dive {
  scroll-padding-top: 124px;
}
.rv-dive .home-header {
  position: fixed;
  inset: 0 0 auto;
  transform: translateY(-100%);
  transition: transform 0.4s var(--ease-out);
}
.rv-dive .home-header.is-shown,
.rv-dive .home-header:focus-within,
.rv-dive .home-header:has(.site-nav.is-open) {
  transform: none;
}
.home-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 16px;
  min-height: 72px;
}
.home-logo {
  display: flex;
  align-items: center;
}
.home-logo img {
  width: auto;
  height: 34px;
}
.home-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px clamp(14px, 2vw, 28px);
  font-size: 15px;
}
.home-nav a:not(.btn) {
  color: inherit;
  text-decoration: none;
  opacity: 0.82;
  transition: opacity var(--dur-fast);
}
.home-nav a:not(.btn):hover {
  opacity: 1;
}
.home-nav .home-lang {
  font-weight: 600;
  opacity: 1;
}
@media (max-width: 639px) {
  .home-logo img {
    height: 30px;
  }
}
/* Seven nav items don't fit one row below 1024px: menu button from there
   (headerStyle() only switches below 640px). */
@media (min-width: 640px) and (max-width: 1023px) {
  .home-header.has-js .nav-toggle {
    display: inline-flex;
  }
  .home-header.has-js .home-nav:not(.is-open) {
    display: none;
  }
  .home-header.has-js .home-nav.is-open {
    flex-basis: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 16px;
  }
}

/* Hero. Default: static lockup over the poster, copy and stats below. */
.hero {
  --hero-w: min(90cqw, 1240px);
  container-type: inline-size;
  --hero-h: calc(var(--hero-w) * 0.207);
}
.hero-stage {
  position: relative;
  overflow: hidden;
  padding-top: clamp(40px, 7vw, 96px);
}
.hero-media {
  position: relative;
  width: var(--hero-w);
  aspect-ratio: 1000 / 207;
  margin-inline: auto;
  background: #1b1b1b;
  -webkit-mask: url('/assets/logo-rivero-white.png') center / 100% 100%
    no-repeat;
  mask: url('/assets/logo-rivero-white.png') center / 100% 100% no-repeat;
}
.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Rivero blue-violet over the footage; hero.js fades it out during the dive.
   On the light page the lockup is a cut-out against white, so the tint also
   darkens (multiply) and the letters read; on dark, hue and saturation only
   (color), leaving the warehouse bright inside them. */
.hero-tint {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    rgba(35, 92, 242, 0.72),
    rgba(75, 60, 240, 0.72) 55%,
    rgba(106, 61, 242, 0.72)
  );
  mix-blend-mode: multiply;
  pointer-events: none;
}
[data-theme='dark'] .hero-tint {
  mix-blend-mode: color;
}
.hero-shade,
.hero-lockup {
  display: none;
}
.hero-copy {
  padding-block: clamp(40px, 6vw, 80px);
}
/* One column, one left edge: the headline first, with the lead and the
   buttons in a row under it (`.hero-side`). The grid is a `.wrap`, so
   nothing can pass the site container. */
.hero-copy-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(20px, 2.6vw, 40px);
  align-items: end;
}
.hero-copy .eyebrow {
  margin-bottom: var(--space-4);
}
/* On footage the brand blue is too dark for small text (tokens.css), and the
   tagline is the first thing read, so it is larger and bolder than a label:
   a pale blue (about 10:1 on the scrim) with a darker halo for the bright
   frames of the footage. */
.hero--full .hero-copy .eyebrow {
  color: #cfdbff;
  font-size: clamp(15px, 1.35vw, 20px);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-shadow: 0 1px 14px rgb(7 7 7 / 55%);
}
/* "Your market, protected." is about 10.3em wide, so the size follows the
   hero's own width (5.2cqw, 84px at most) and each phrase fits its line from
   1024 to 1920 and beyond: no wrap inside a phrase on desktop. */
.hero-title {
  font-size: clamp(34px, 5.2cqw, 84px);
  line-height: 0.95;
}
@media (min-width: 961px) {
  .hero-title {
    white-space: nowrap;
  }
}
/* Lead on the left, buttons on the right of it: the lead's last line sits on
   the buttons' baseline. Under 960px they stack. */
.hero-side {
  display: grid;
  grid-template-columns: minmax(0, max-content) max-content;
  justify-content: start;
  align-items: last baseline;
  column-gap: clamp(32px, 5vw, 80px);
  row-gap: 22px;
}
.hero-side p {
  margin: 0;
  max-width: 42ch;
  color: var(--ink-muted);
  font-size: var(--text-lg);
  text-wrap: balance;
}
/* On the footage the lead is set in the headline's own face (Jost 400):
   warmer than Plex next to it, and one voice for the whole hero. */
.hero--full .hero-side p {
  font-family: var(--font-display);
  font-size: clamp(19px, 1.1rem + 0.2vw, 20px);
  font-weight: 400;
  line-height: 1.5;
  color: rgb(255 255 255 / 85%);
}
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
/* Desktop: one row, the lead and, 48px from it, the two buttons side by side
   and centered on it. The row is not tied to the headline's width; it only
   gives way (the lead shrinks first) when the container is narrower than the
   three. Below 1024px: the layout above.
   The lead is three lines. `balance` alone left the English ones 110px apart
   (552 / 442 / 465: "manufacturers," is long and sits at a line end), so
   from 1100px (1140px in Spanish, whose buttons and copy are longer) it is
   justified instead, with the last line left and no hyphens, at the width
   where the plain wrap already fills two lines almost exactly, so a gap grows
   by about 1px, not 15: 556px in English (556 / 556 / 369), 572px in Spanish
   (572 / 572 / 504). Those widths are measured against this copy, this font
   and size; `text-wrap` is `wrap` there because `balance` would pick other
   breaks. Narrower than that the lead is left-aligned and balanced, and the
   gap tightens to 28px at 1024px so English still takes three lines. */
@media (min-width: 1024px) {
  .hero-side {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: clamp(28px, calc(100vw - 994px), 48px);
  }
  .hero-side p {
    flex: 0 1 540px;
    min-width: 0;
    max-width: 540px;
    text-wrap: balance;
    hyphens: none;
  }
  :lang(es) .hero-side p {
    flex-basis: 580px;
    max-width: 580px;
  }
  .hero-ctas {
    flex: none;
    flex-wrap: nowrap;
  }
}
@media (min-width: 1100px) {
  .hero-side {
    gap: 48px;
  }
  :lang(en) .hero-side p {
    flex-basis: 556px;
    max-width: 556px;
    text-wrap: wrap;
    text-align: justify;
    text-align-last: left;
  }
}
@media (min-width: 1140px) {
  :lang(es) .hero-side p {
    flex-basis: 572px;
    max-width: 572px;
    text-wrap: wrap;
    text-align: justify;
    text-align-last: left;
  }
}
.hero-stats {
  padding-bottom: clamp(40px, 6vw, 80px);
}
/* Each column is as wide as its own figure and label (`auto`, not `1fr`: a
   third of the row is narrower than "88,000 sq ft"), and the dividers sit in
   the gaps between columns, centered, so no figure can run into one. The
   tracks stay at their content width (`justify-content: start`) and only
   give way, by wrapping the label, when the row is narrower than that. */
.hero-stats-grid {
  --stat-gap: clamp(36px, 5vw, 80px);
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: start;
  column-gap: var(--stat-gap);
}
.stat {
  position: relative;
  display: grid;
  align-content: start;
  gap: 8px;
}
.stat + .stat::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--stat-gap) / -2);
  width: var(--hairline);
  background: var(--rule);
}
.stat p {
  margin: 0;
}
.stat-value {
  font: 400 clamp(40px, 6.6vw, 112px) / 0.95 var(--font-display);
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.stat-value small {
  margin-left: 0.18em;
  font-size: 0.36em;
  letter-spacing: 0;
  color: var(--ink-muted);
}
.stat-label {
  font: 500 11px / 1.4 var(--font-mono);
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* Copy that ends up on the footage (the dive, and the full-bleed hero when
   the dive is off) keeps the on-image palette in both themes: white over the
   shade, never a black band behind it. */
.rv-dive [data-hero-dive] :is(.hero-copy, .hero-stats),
.hero--full :is(.hero-copy, .hero-stats) {
  --ink: #ffffff;
  --ink-muted: rgba(255, 255, 255, 0.8);
  --rule: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}

/* Scroll dive (html.rv-dive: motion allowed + FEATURES.heroDive); hero.js
   drives it. First screen: the RIVERO logo alone, centered. The copy and
   stats sit at the bottom of the stage, hidden until the video fills the
   screen. */
.rv-dive .hero[data-hero-dive] {
  height: 340vh;
}
.rv-dive [data-hero-dive] .hero-stage {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: clamp(24px, 5svh, 56px);
  height: 100vh;
  height: 100svh;
  padding: 0 0 clamp(28px, 6svh, 72px);
}
.rv-dive [data-hero-dive] .hero-media {
  position: absolute;
  inset: 0;
  width: auto;
  aspect-ratio: auto;
  -webkit-mask: none;
  mask: none;
  -webkit-mask-image: var(--mask-image, url('/assets/logo-rivero-white.png'));
  mask-image: var(--mask-image, url('/assets/logo-rivero-white.png'));
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: var(--mask-size, var(--hero-w) var(--hero-h));
  mask-size: var(--mask-size, var(--hero-w) var(--hero-h));
  -webkit-mask-position: var(--mask-pos, 50% calc(50% - var(--hero-h) / 2));
  mask-position: var(--mask-pos, 50% calc(50% - var(--hero-h) / 2));
}
.rv-dive [data-hero-dive] .hero-media.is-full {
  -webkit-mask-image: none;
  mask-image: none;
}
/* The logo in its own colors, over the video masked to the same letters, in
   the box hero.js measures for the zoom. A gradient mask takes the logo
   away between --hero-wipe-from and --hero-wipe, so the footage fills the
   letters left to right: hero.js moves --hero-wipe from -24% (whole logo)
   to 112% (gone) over the first stretch of scroll, and the intro sweeps a
   wider band across the same mask. --hero-unfold is the intro's too: the
   clip it opens from the symbol to the full lockup. */
.rv-dive [data-hero-dive] .hero-lockup {
  display: block;
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--hero-w);
  aspect-ratio: 1000 / 207;
  translate: -50% -50%;
  pointer-events: none;
  --hero-wipe: -24%;
  --hero-wipe-band: 200%;
}
.rv-dive [data-hero-dive] .hero-lockup img {
  --hero-wipe-from: calc(var(--hero-wipe) - var(--hero-wipe-band));
  width: 100%;
  clip-path: var(--hero-unfold, none);
  -webkit-mask-image: linear-gradient(
    94deg,
    #000 var(--hero-wipe-from),
    transparent calc(var(--hero-wipe-from) + 9%),
    transparent var(--hero-wipe),
    #000 calc(var(--hero-wipe) + 9%)
  );
  mask-image: linear-gradient(
    94deg,
    #000 var(--hero-wipe-from),
    transparent calc(var(--hero-wipe-from) + 9%),
    transparent var(--hero-wipe),
    #000 calc(var(--hero-wipe) + 9%)
  );
}
.rv-dive [data-hero-dive] .hero-shade {
  display: block;
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(
    180deg,
    rgba(7, 7, 7, 0.15) 0%,
    rgba(7, 7, 7, 0.25) 45%,
    rgba(7, 7, 7, 0.92) 100%
  );
  pointer-events: none;
}
.rv-dive [data-hero-dive] .hero-copy,
.rv-dive [data-hero-dive] .hero-stats {
  position: relative;
  padding: 0;
  opacity: 0;
}
.rv-dive [data-hero-dive] .hero-stats {
  pointer-events: none;
}
/* A keyboard user tabbing to a faded CTA must see it. */
.rv-dive [data-hero-dive] .hero-copy:focus-within {
  opacity: 1 !important;
  transform: none !important;
}

/* FEATURES.heroDive off: the video fills the hero. */
.hero--full .hero-stage {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: min(100svh, 900px);
}
.hero--full .hero-media {
  position: absolute;
  inset: 0;
  width: auto;
  aspect-ratio: auto;
  -webkit-mask: none;
  mask: none;
}
.hero--full .hero-tint {
  display: none;
}
.hero--full .hero-shade {
  display: block;
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 7, 7, 0.2), rgba(7, 7, 7, 0.85));
}
.hero--full .hero-copy,
.hero--full .hero-stats {
  position: relative;
}

/*
 * The full hero's copy arrives every time the hero comes back on screen,
 * not only on load (html.rv-hero, set in <head> when motion is allowed;
 * hero.js toggles .is-in on the hero as it enters and leaves the viewport,
 * and holds it until the intro's cover has lifted). Taking .is-in away
 * drops the animation, so the next entrance plays it from the start. The
 * headline leads and the whole entrance is over in 1.2 s; each stat starts
 * counting from zero as it rises (hero.js). Only opacity and transform
 * move, so nothing clips the descenders.
 */
@keyframes hero-rise {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
}
@keyframes hero-title-rise {
  from {
    opacity: 0;
    transform: translateY(0.35em);
  }
}
.rv-hero
  .hero--full:not(.is-in)
  :is(.hero-copy .eyebrow, .hero-title, .hero-side > *, .stat) {
  opacity: 0;
}
.rv-hero .hero--full.is-in :is(.hero-copy .eyebrow, .hero-side > *, .stat) {
  animation: hero-rise 700ms var(--ease-emph) both;
}
.rv-hero .hero--full.is-in .hero-title {
  animation: hero-title-rise 700ms var(--ease-emph) both;
}
.rv-hero .hero--full.is-in .hero-copy .eyebrow {
  animation-delay: 80ms;
}
.rv-hero .hero--full.is-in .hero-side > :first-child {
  animation-delay: 160ms;
}
.rv-hero .hero--full.is-in .hero-side > :nth-child(2) {
  animation-delay: 240ms;
}
.rv-hero .hero--full.is-in .hero-stats .stat {
  animation-delay: calc(320ms + var(--i, 0) * 80ms);
}

/* Ports band */
.ports {
  padding-block: 22px;
  border-block: var(--hairline) solid var(--rule);
}
.ports .marquee-track {
  margin: 0;
  padding: 0;
  list-style: none;
  font: 300 clamp(22px, 2.4vw, 32px) / 1.2 var(--font-display);
  color: var(--ink-muted);
  white-space: nowrap;
}
.ports li {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.ports li::after {
  content: '';
  width: 7px;
  height: 7px;
  margin-inline: 30px;
  background: var(--rv-blue);
}
.port-country {
  font: 500 11px / 1 var(--font-mono);
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--ink-muted);
}
@media (prefers-reduced-motion: reduce) {
  .ports .marquee {
    padding-inline: var(--gutter);
  }
  .ports .marquee-track {
    white-space: normal;
    row-gap: 8px;
  }
}

/* What every partner gets */
.promises-title {
  max-width: 15ch;
  margin-bottom: clamp(36px, 5vw, 72px);
}
.promise-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.promise {
  display: grid;
  grid-template-columns: 72px minmax(0, 1.34fr) minmax(0, 1fr);
  gap: var(--pg);
  align-items: center;
  padding-block: clamp(18px, 2.5vw, 33px);
  border-top: var(--hairline) solid var(--rule);
}
.promise:last-child {
  border-bottom: var(--hairline) solid var(--rule);
}
.promise-num {
  align-self: start;
  padding-top: 1.4em;
  font: 500 13px / 1 var(--font-mono);
  color: var(--ink-muted);
}
/* The words are the shared .fill-word (site.css: Jost 500, 1.5px stroke,
   outline that fills on the scroll, both ways); only their size and place
   are set here. One size for all three words of a language, held so the
   longest one plus its icon fits the word column: --pw is that word's
   width in em ("Protected." in English, 4.18em; "Liquidado." in Spanish,
   4.35em; measured in Jost 500 with the giant tracking), --col the
   column's width (the grid below: 72px | 1.34fr | 1fr), --ic the icon,
   --ig the gap between the dot and the icon. The size is 8.6vw (what the
   words had) held to --fit, never below 56px unless --fit is smaller,
   150px at most. */
.promise-list {
  --pg: clamp(14px, 2.5vw, 40px);
  --pw: 4.2;
  container-type: inline-size;
}
.promises:lang(es) .promise-list {
  --pw: 4.36;
}
.promise-word {
  --c: var(--c-on);
  --ic: 64px;
  --ig: 18px;
  --col: calc((100cqi - 72px - 2 * var(--pg)) * 1.34 / 2.34);
  --fit: calc((var(--col) - var(--ic) - var(--ig)) / var(--pw));
  margin: 0;
  white-space: nowrap;
  font-size: clamp(56px, 8.6vw, 150px);
  font-size: clamp(min(56px, var(--fit)), min(8.6vw, var(--fit)), 150px);
}
.promise-num,
.promise-word,
.promise-text {
  grid-row: 1;
}
.promise-num {
  grid-column: 1;
}
.promise-word {
  grid-column: 2;
}
/* The icon is inline at the end of the word: --ig (18px) after the dot's
   ink, the same for every word (the dot's ink ends .045em before the
   word's advance, measured in Jost 500 with its tracking), centered on the
   x-height (half an `ex` above the baseline). It takes no height of its
   own (0, the drawing is positioned from the baseline), so the row's
   rhythm is the word's. */
.promise-icon {
  position: relative;
  display: inline-block;
  width: var(--ic);
  height: 0;
  margin-left: calc(var(--ig) - 0.045em);
  color: var(--c-on);
}
.promise-text {
  grid-column: 3;
}
.promise-icon svg {
  position: absolute;
  left: 0;
  top: calc(-0.5ex - var(--ic) / 2);
  display: block;
  width: var(--ic);
  height: var(--ic);
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pi-move {
  transform-box: fill-box;
  transform-origin: center;
}
/* home-draw.js adds .rv-pi (motion allowed) and .is-in once per row: the
   lines draw in order and the icon rises 6px. Transitions live on .is-in
   only, so taking the drawing away when the script starts is instant. */
.rv-pi .promise-icon svg {
  opacity: 0;
  transform: translateY(6px);
}
.rv-pi .promise-icon .pi-l {
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
}
.rv-pi .promise-icon.is-in svg {
  opacity: 1;
  transform: none;
  transition:
    opacity var(--dur-base) var(--ease),
    transform var(--dur-slow) var(--ease);
}
.rv-pi .promise-icon.is-in .pi-l {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 700ms var(--ease) calc(var(--k) * 70ms);
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .promise-icon .pi-move {
    transition: transform var(--dur-base) var(--ease);
  }
  .promise:hover [data-icon='blue'] .pi-move {
    transform: translateX(4px);
  }
  .promise:hover [data-icon='red'] .pi-move {
    animation: pi-bounce 640ms var(--ease);
  }
  .promise:hover [data-icon='green'] .pi-move {
    animation: pi-pulse 640ms var(--ease);
  }
}
@keyframes pi-bounce {
  35% {
    transform: translateY(-4px);
  }
  65% {
    transform: translateY(0);
  }
  82% {
    transform: translateY(-1.5px);
  }
}
/* 1.0625 × the 64px icon is 4px wider. */
@keyframes pi-pulse {
  40% {
    transform: scale(1.0625);
  }
}
.promise-text h3 {
  margin: 0 0 10px;
  font: 700 clamp(18px, 1.5vw, 21px) / 1.3 var(--font-body);
}
.promise-text p {
  margin: 0;
  color: var(--ink-muted);
}

/* The model. The three brand lockups are drawn for a light background and
   there is no white-wordmark version of Solutions or Commerce, so these
   cards stay paper in both themes and set their own inks. */
.model-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 1.6vw, 24px);
}
.model-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-height: 420px;
  padding: clamp(24px, 2.6vw, 40px);
  background: #ffffff;
  color: #070707;
  border: var(--hairline) solid var(--rule);
  border-top: 4px solid var(--c);
  border-radius: var(--card-radius);
  text-decoration: none;
  transition:
    box-shadow var(--dur-slow) var(--ease-out),
    border-color var(--dur-slow) var(--ease-out);
}
.model-card:hover {
  border-color: var(--c);
  box-shadow: 0 28px 56px rgb(7 7 7 / 10%);
}
.model-card[data-color] {
  --ink: #070707;
  --ink-muted: #5e5e5e;
  --rule: #e2e2e2;
  --c-on: var(--c-light);
}
.model-card-logo {
  align-self: flex-start;
  width: auto;
  height: 46px;
  margin-bottom: var(--space-6);
}
.model-card h3 {
  margin: 0;
  font: 600 var(--display-sm) / 1.05 var(--font-display);
}
.model-card p {
  margin: 0;
  color: var(--ink-muted);
}
.model-card-cta {
  margin-top: auto;
  padding-top: var(--space-5);
  color: var(--c-on);
  font-weight: 600;
}
.model-steps {
  position: relative;
  margin-top: clamp(56px, 7vw, 104px);
}
.model-steps-line {
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--rv-blue) 0 25%,
    var(--rv-green) 25% 50%,
    var(--rv-red) 50% 75%,
    var(--rv-orange) 75%
  );
}
.model-steps-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 32px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.model-step {
  position: relative;
  padding-top: 32px;
}
.model-step::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 0;
  width: 12px;
  height: 12px;
  background: var(--c);
}
.model-step-label {
  margin: 0;
  font: 500 var(--text-xs) / 1.3 var(--font-mono);
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
}
.model-step h3 {
  margin: 12px 0 8px;
  font: 600 var(--text-xl) / 1.15 var(--font-display);
}
.model-step p {
  margin: 0;
  color: var(--ink-muted);
}

/* Why it works */
.why-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: clamp(40px, 6vw, 120px);
  align-items: start;
}
/* The head is the shared one (.section-head's gap, .section-title's size and
   weight): only the sticky column is its own. */
.why-head {
  display: grid;
  gap: var(--space-4);
  position: sticky;
  top: 120px;
}
.why-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.why-list li {
  display: grid;
  grid-template-columns: minmax(0, 0.6fr) minmax(0, 1fr);
  gap: 24px;
  padding-block: 28px;
  border-top: var(--hairline) solid var(--rule);
}
.why-list li:last-child {
  border-bottom: var(--hairline) solid var(--rule);
}
.why-list h3 {
  margin: 0;
  font: 600 var(--text-xl) / 1.2 var(--font-display);
}
/* The RIVERO symbol (the shape of mark-rivero.png) as a watermark behind
   the heading, inside the sticky head so it travels with it: strokes only,
   1.5px, no fill; neutral black at 9% on light, white at 8% on dark; 420px
   (less in a narrow column). It sits under the text (z-index -1 inside the
   head's own stacking context) and fades in once (home-draw.js adds .is-in;
   without it, or with reduced motion, it is simply there). */
.why-head {
  isolation: isolate;
}
.why-mark {
  position: absolute;
  z-index: -1;
  top: -36px;
  left: 50%;
  width: min(420px, 100%);
  height: auto;
  translate: -50% 0;
  overflow: visible;
  color: #000;
  opacity: 0.09;
  stroke-width: 1.5px;
  pointer-events: none;
}
[data-theme='dark'] .why-mark {
  color: #fff;
  opacity: 0.08;
}
.rv-wm .why-mark {
  transition: opacity 1400ms var(--ease-out);
}
.rv-wm .why-mark:not(.is-in) {
  opacity: 0;
}
.why-list p {
  margin: 0;
  color: var(--ink-muted);
}

/* Three ways in */
.panels {
  display: flex;
  gap: 10px;
  height: clamp(460px, 68vh, 640px);
}
.panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: clamp(22px, 2.4vw, 34px);
  border-radius: var(--card-radius);
  color: #fff;
  transition: flex-grow 0.7s var(--ease-out);
}
/* Keeps the hover widen while site.css's fallback drives the rise: one
   transition list, so neither declaration drops the other. */
.rv-io .panel {
  transition:
    flex-grow 0.7s var(--ease-out),
    opacity var(--dur-reveal) var(--ease-out)
      calc(var(--i, 0) * var(--stagger-step)),
    transform var(--dur-reveal) var(--ease-out)
      calc(var(--i, 0) * var(--stagger-step));
}
.panel-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.08);
  /* Lightened (Marcus's review, Nov 25) so the photos read: less grey, less
     dimming, and a scrim that stays dark only where the copy sits. */
  filter: grayscale(0.4) brightness(0.8);
  transition:
    transform 1s var(--ease-out),
    filter 0.6s;
}
.panel::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    180deg,
    rgba(7, 7, 7, 0.24),
    rgba(7, 7, 7, 0.76) 82%
  );
}
.panel::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 4px;
  background: var(--c);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.7s var(--ease-out);
}
.panel:hover,
.panel:focus-within {
  flex-grow: 1.9;
}
.panel:hover .panel-bg,
.panel:focus-within .panel-bg {
  transform: scale(1);
  filter: grayscale(0) brightness(0.92);
}
.panel:hover::after,
.panel:focus-within::after {
  transform: none;
}
/* Inside the card, on the photo and its scrim: a white ring outside the card
   would sit on the white section in the light theme and vanish. */
.panel:has(.panel-cta:focus-visible) {
  outline: 2px solid #fff;
  outline-offset: -8px;
}
.panel-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.panel-tint {
  width: 44px;
}
.panel-tag {
  max-width: 18ch;
  margin: 0;
  font: 500 11px / 1.4 var(--font-mono);
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  text-align: right;
  color: var(--c-dark);
}
.panel-bottom {
  display: grid;
  gap: 14px;
}
.panel h3 {
  margin: 0;
  font: 600 clamp(28px, 2.8vw, 42px) / 1.02 var(--font-display);
}
.panel-bottom p {
  max-width: 40ch;
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
}
.panel-cta {
  font-weight: 600;
  text-decoration: none;
}
.panel-cta::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}
.panel-cta:focus-visible {
  outline: none;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: center;
}
.about-photo {
  grid-area: 1 / 1 / 2 / 8;
}
.about-photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--card-radius);
}
.about-card {
  grid-area: 1 / 7 / 2 / 13;
  position: relative;
  z-index: 1;
  display: grid;
  gap: var(--space-5);
  padding: clamp(28px, 4vw, 64px);
  border-radius: var(--card-radius);
  background: var(--surface);
  box-shadow: 0 40px 80px rgb(7 7 7 / 8%);
}
.about-card p {
  margin: 0;
}
.about-card p:not(.eyebrow) {
  color: var(--ink-muted);
}

/* Leadership */
.leadership-head {
  margin-bottom: clamp(36px, 5vw, 72px);
}
.team {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(16px, 3vw, 48px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.person-figure {
  display: block;
  /* The reveal's zoom is clipped to the circle (site.css .rv-ph-fig). */
  border-radius: 50%;
}
.person-photo {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  filter: grayscale(1);
  transition: filter var(--dur-slow);
}
.person:hover .person-photo {
  filter: none;
}
.person-name {
  margin: 20px 0 4px;
  font: 500 var(--text-xl) / 1.2 var(--font-display);
}
.person-role {
  margin: 0;
  font: 500 var(--text-xs) / 1.4 var(--font-mono);
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--ink-muted);
}
/* The roles read as titles: an editorial italic serif in full ink, in
   sentence case, a breath under the name (Jost). */
.leadership .person-name {
  margin-bottom: 0;
}
.leadership .person-role {
  margin-top: 6px;
  font:
    italic 400 clamp(20px, 1.5vw, 22px) / 1.2 'Instrument Serif',
    Georgia,
    'Times New Roman',
    serif;
  letter-spacing: 0.005em;
  text-transform: none;
  color: var(--ink);
}

/* OPPORTUNITY */
.bigword {
  overflow: hidden;
  padding-block: clamp(40px, 6vw, 80px);
}
.bigword-text {
  margin: 0;
  font: 600 var(--display-giant) / 0.86 var(--font-display);
  letter-spacing: -0.04em;
  text-align: center;
  white-space: nowrap;
  color: var(--ink);
}
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .bigword-text {
    color: transparent;
    background: url('/assets/photo-trucks-dock.jpg') 50% var(--py, 50%) / cover
      no-repeat;
    -webkit-background-clip: text;
    background-clip: text;
  }
}

/* Contact */
.contact {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48.5' height='84' viewBox='0 0 48.5 84'%3E%3Cpath d='M0 14L24.25 0L48.5 14V42L24.25 56L0 42ZM24.25 56V84' fill='none' stroke='%23fff' stroke-opacity='.12'/%3E%3C/svg%3E");
  background-size: 48.5px 84px;
}
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 88px);
  align-items: end;
}
/*
 * FEATURES.contactMesh: no band and no edges. The wash itself (the soft
 * Rivero-blue light, its contrast notes and the way it carries on into the
 * footer) is the shared `.wash` in site.css, which Solutions' and
 * Commerce's closing bands wear too, each in the tints of its own unit
 * color. What is Home's own is below: its copy on that light.
 */
.contact .eyebrow {
  color: rgba(255, 255, 255, 0.82);
}
.contact-mesh :is(.eyebrow, .contact-body, .contact-list dt) {
  color: var(--wash-ink-soft);
}
.contact .accent-dot {
  color: var(--tone-dark);
}
.contact-mesh .accent-dot {
  color: var(--wash-dot);
}
.contact-title {
  margin-top: 18px;
  font-size: clamp(44px, 6.8vw, 104px);
  line-height: 0.92;
}
.contact-body {
  max-width: 44ch;
  margin: 22px 0 0;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.9);
}
.contact-list {
  display: grid;
  gap: 22px;
  margin: 0;
}
.contact-list dt {
  margin-bottom: 6px;
  font: 500 11px / 1.4 var(--font-mono);
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}
.contact-list dd {
  margin: 0;
}
.contact-email {
  font-size: 22px;
  font-weight: 500;
}
.contact-email a {
  text-underline-offset: 4px;
}
.contact :focus-visible {
  outline-color: #fff;
}
.contact-mesh :focus-visible {
  outline-color: var(--wash-ink);
}

/* The footer is the one every page shares now; it brings its own styles
   (src/components/organisms/footer-site.mjs). */

/* Tablet */
@media (max-width: 960px) {
  .hero-side,
  .why-grid,
  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  /* The hero copy hangs from the bottom of the stage, so when it is taller
     than the screen (a phone, or the ES headline) it is pushed up against
     the floating pill. Its top padding starts under the pill instead, so
     the headline keeps the copy's own 40px clear of it. */
  .hero--full .hero-stage {
    padding-top: calc(var(--hdr-top, 10px) + var(--hdr-row-h, 60px));
  }
  /* One column: the head still travels down with the reasons, as on a
     desktop. It sticks under the pill (or near the top while the pill is
     away) on its own band of the section's colour, so the reasons pass
     under it, and lets go once the last reason is clear of it: its bottom
     margin (taken back by the list) ends the stick that much sooner. The
     band reaches up off the screen; the section clips it to itself. */
  [data-page='home'] main > section.why[data-tone] {
    padding-bottom: 0;
    overflow: clip;
  }
  .why-grid {
    --why-release: 15rem;
  }
  .why-head {
    z-index: 1;
    top: calc(var(--hdr-top, 10px) + var(--hdr-row-h, 60px) + 12px);
    margin-bottom: var(--why-release);
    padding-bottom: 20px;
    transition: top 320ms var(--ease-out);
  }
  html:has(.rv-hdr.is-away:not(:focus-within, .is-menu-open)) .why-head {
    top: 16px;
  }
  .why-head::before {
    content: '';
    position: absolute;
    z-index: -2;
    inset: -100vh calc(var(--gutter) * -1) -20px;
    background: linear-gradient(
      180deg,
      var(--tone-bg) calc(100% - 20px),
      transparent
    );
    pointer-events: none;
  }
  .why-list {
    margin-top: calc(var(--why-release) * -1);
  }
  .promise-word {
    --ic: 56px;
  }
  .promise-icon svg {
    stroke-width: 1.7;
  }
  .model-cards {
    grid-template-columns: minmax(0, 1fr);
  }
  .model-card {
    min-height: 0;
  }
  .model-steps-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 40px;
  }
  .model-steps-line {
    display: none;
  }
  .model-step {
    border-top: 2px solid var(--c);
  }
  .panels {
    flex-direction: column;
    height: auto;
  }
  .panel {
    min-height: 320px;
  }
  .panel:hover,
  .panel:focus-within {
    flex-grow: 1;
  }
  .about-photo,
  .about-card {
    grid-column: 1 / -1;
  }
  .about-card {
    grid-row: 2;
    margin: -64px var(--space-4) 0;
  }
  .team {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Phone */
@media (max-width: 640px) {
  .rv-dive .hero[data-hero-dive] {
    height: 240vh;
  }
  /* The revealed title, lead, CTAs and stats share one sticky screen: CTAs
     on one row and the stats as one compact row so it all fits a short
     phone with browser bars showing (≈550px). */
  .rv-dive [data-hero-dive] .hero-ctas {
    gap: 10px;
  }
  .rv-dive [data-hero-dive] .hero-ctas .btn {
    padding: 12px 16px;
    font-size: 14px;
  }
  .rv-dive [data-hero-dive] .hero-stats-grid {
    --stat-gap: 20px;
    grid-template-columns: repeat(3, auto);
    gap: 0 var(--stat-gap);
  }
  .rv-dive [data-hero-dive] .stat {
    gap: 6px;
  }
  .rv-dive [data-hero-dive] .stat + .stat::before {
    inset: 0 auto 0 calc(var(--stat-gap) / -2);
    width: var(--hairline);
    height: auto;
  }
  .rv-dive [data-hero-dive] .stat-value {
    font-size: 30px;
  }
  .rv-dive [data-hero-dive] .stat-value small {
    display: block;
    margin: 4px 0 0;
    font-size: 13px;
  }
  .rv-dive [data-hero-dive] .stat-label {
    font-size: 10px;
    letter-spacing: 0;
  }
  /* One column: the dividers turn horizontal and sit in the gap above each
     figure after the first. */
  .hero-stats-grid {
    --stat-gap: 36px;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--stat-gap) 0;
  }
  .stat + .stat::before {
    inset: calc(var(--stat-gap) / -2) 0 auto 0;
    width: auto;
    height: var(--hairline);
  }
  /* Stacked, each figure, its unit and its label sit centred under the
     buttons; the dividers still run the full width of the column. */
  .hero-stats .stat {
    justify-items: center;
    text-align: center;
  }
  .promise {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .promise-num {
    padding-top: 0;
  }
  .promise-num,
  .promise-word,
  .promise-text {
    grid-column: 1;
  }
  .promise-word {
    grid-row: 2;
    /* One column: the word has the whole row. */
    --col: 100cqi;
    --ic: 48px;
  }
  .promise-text {
    grid-row: 3;
  }
  .promise-icon svg {
    stroke-width: 2;
  }
  .why-list li {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  .model-steps-list {
    grid-template-columns: minmax(0, 1fr);
  }
  .about-card {
    margin-inline: 0;
  }
}
/* Below 380px the icon would crowd the promise word. */
@media (max-width: 379px) {
  .promise-icon {
    display: none;
  }
  .promise-word {
    --ic: 0px;
  }
}
/* Small phones: the buttons stack and fill the width. */
@media (max-width: 479px) {
  .hero-ctas {
    flex-direction: column;
  }
  .hero-ctas .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}
@media (max-width: 640px) and (max-height: 640px) {
  .rv-dive [data-hero-dive] .hero-stage {
    gap: 20px;
  }
  .rv-dive [data-hero-dive] .hero-copy-grid,
  .rv-dive [data-hero-dive] .hero-side {
    gap: 14px;
  }
  .rv-dive [data-hero-dive] .hero-copy .eyebrow {
    margin-bottom: 10px;
  }
  .rv-dive [data-hero-dive] .hero-side p {
    font-size: 15px;
    line-height: 1.45;
  }
  .rv-dive [data-hero-dive] .hero-ctas .btn {
    padding: 11px 14px;
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .panel,
  .panel-bg,
  .panel::after,
  .person-photo {
    transition: none;
  }
}
