/* Hero block — loaded on the front end and in the editor. */

/* --header-height comes from layout.css; the editor has no header and
   takes the fallback. */
/* --hero-padding-bottom is read by a hero panel (blocks/hero-panel), which
   hangs past the hero's lower edge by more than the padding. */
.hero {
  --hero-padding-bottom: max(40px, var(--wp--preset--spacing--70));
  position: relative;
  isolation: isolate;
  padding-top: calc(var(--header-height, 0px) + var(--wp--preset--spacing--80));
  padding-bottom: var(--hero-padding-bottom);
  background-color: var(--wp--custom--color--hero-blue);
  color: var(--wp--preset--color--base);
}

/* The editor does not load layout.css, where .wrapper and .container live. */
.editor-styles-wrapper .hero .wrapper {
  padding-right: var(--wp--style--root--padding-right);
  padding-left: var(--wp--style--root--padding-left);
}

.editor-styles-wrapper .hero .container {
  max-width: var(--wp--style--global--content-size);
  margin-right: auto;
  margin-left: auto;
}

/* Both floors at 40px: on a phone the steps shrink to a cramped 30. */
.hero--compact {
  --hero-padding-bottom: max(40px, var(--wp--preset--spacing--60));
}

/* A hero panel hangs over the next section. */
.hero:has(.hero-panel) {
  z-index: 1;
}

.hero--navy {
  background-color: var(--wp--preset--color--primary);
}

.hero--yellow {
  background-color: var(--wp--preset--color--tint);
  color: var(--wp--preset--color--primary);
}

.hero--bright-yellow {
  background-color: var(--wp--preset--color--secondary);
  color: var(--wp--preset--color--primary);
}

.hero :is(h1, h2, h3, h4, h5, h6) {
  color: inherit;
}

/* Two weights in one title: the light line is the heading's own weight, the
   bold one is what the editor's Bold button wraps in <strong>. */
.hero h1 {
  font-size: var(--wp--preset--font-size--huge);
  font-weight: 200;
  line-height: 1.1;
}

/* Home page: taller, its title larger, a tab at the bottom that scrolls to
   the content (blocks/hero/view.js shows it). It fills the first screen
   (up to a 1080px-tall one), its content centred, and the title scales to
   the screen's height as well as its width, so on a laptop the whole hero,
   tab included, fits. */
.hero--large {
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
  min-height: min(100svh, 1080px);
  padding-bottom: calc(var(--wp--preset--spacing--70) + 46px);
}

/* Larger than the largest preset (jumbo): 96px at 1440 by 900 and up. */
.hero--large h1 {
  font-size: clamp(42px, min(4.69vw + 28.4px, 10.7svh), 96px);
  line-height: 1.05;
}

.hero-scroll {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 74px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 24px 24px 0 0;
  background-color: var(--wp--preset--color--base);
  cursor: pointer;
  translate: -50% 0;
}

.hero-scroll::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--wp--preset--color--primary);
  mask: url(../../assets/img/arrow-down.svg) no-repeat center / 10px 14px;
  -webkit-mask: url(../../assets/img/arrow-down.svg) no-repeat center / 10px 14px;
  transition: background-color 0.2s ease;
}

.hero-scroll:hover::before,
.hero-scroll:focus-visible::before {
  background-color: var(--wp--preset--color--accent);
}

.hero-scroll:focus-visible {
  outline: 2px solid var(--wp--preset--color--secondary);
  outline-offset: 2px;
}

.hero h1 strong,
.hero :is(.hero-title, .wp-block-post-title) {
  font-weight: 700;
}

/* .hero in front: blocks.css sets the same gap at equal weight and loads later.
   The second selector is a hero whose text sits in a Column beside a panel. */
.hero .hero-content > :is(h1, h2) + *,
.hero .hero-content > .wp-block-columns > .wp-block-column > h1 + * {
  margin-block-start: var(--wp--preset--spacing--50);
}

/* The second selector is the editor, which wraps the hero's blocks in its
   own block list; the third, text in a Column beside a hero panel. */
.hero-content > p,
.hero-content .block-editor-block-list__layout > p,
.hero-content > .wp-block-columns > .wp-block-column > p {
  max-width: 42rem;
}

/* Phones: a little more room under the header, the hero's text 15px
   further in than the page gutter, and a smaller lead. */
@media (max-width: 599px) {
  .hero {
    padding-top: calc(var(--header-height, 0px) + var(--wp--preset--spacing--80) + 24px);
  }

  .hero .hero-content {
    padding-left: 15px;
    padding-right: 15px;
  }

  .hero-content > p,
  .hero-content .block-editor-block-list__layout > p,
  .hero-content > .wp-block-columns > .wp-block-column > p {
    font-size: 14px;
  }
}

/* Single insight: a bare strip under the header, the title is printed below
   it. After the phone rule above, which would add its own top padding. */
.hero--article {
  --hero-padding-bottom: var(--wp--preset--spacing--70);
  padding-top: var(--header-height, 0px);
}

/* --------- Ribbon --------- */

/* The frame clips the ribbon, not the hero itself: a hero panel has to
   reach past the hero's lower edge. */
.hero-ribbon-frame {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.hero-ribbon {
  position: absolute;
  top: 0;
  right: 0;
  max-width: none;
  height: auto;
  pointer-events: none;
  user-select: none;
  transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
  .hero-ribbon {
    transition: none;
  }
}

/* The yellow ribbon is busy behind dark text: the lead keeps short of it. */
.hero--insights .hero-content > p {
  max-width: 30rem;
}

/* Per ribbon: its width, and how far it hangs past the top-right corner. */
.hero-ribbon--business {
  width: 78.89vw;
  translate: 32.88% -44.59%;
}

/* On a phone the cone would sit behind the title: larger and higher, it
   fills the header's corner instead. */
@media (max-width: 767px) {
  .hero-ribbon--business {
    width: clamp(540px, 46vw + 406px, 760px);
    translate: 40% -58%;
  }
}

.hero-ribbon--payments {
  width: 46.32vw;
  translate: 48.05% -45.07%;
}

.hero-ribbon--corporate {
  width: 51.25vw;
  translate: 21.82% -58.53%;
}

/* The source's straight cut runs down its right side; the ribbon keeps a
   minimum width so the cut stays past the hero's right edge. Narrower, the
   panel goes under the text: smaller, the ribbon ends near the panel. */
.hero-ribbon--forms {
  width: max(570px, 39.58vw);
  translate: 30% -19.52%;
}

@media (max-width: 781px) {
  .hero-ribbon--forms {
    width: min(100vw, 480px);
    translate: 40% -20%;
  }
}

/* Hangs below the hero's bottom edge, which hides the source's straight
   cut along its lower side. */
.hero-ribbon--custody {
  width: 49.86vw;
  translate: 29.46% 52.19%;
}

/* A narrower hero is taller than the ribbon reaches: flipped upside down, the
   cut faces up, out past the top, and the folds fill the corner instead. */
@media (max-width: 1023px) {
  .hero-ribbon--custody {
    width: 60vw;
    scale: 1 -1;
    translate: 35% -35%;
  }
}

@media (max-width: 767px) {
  .hero-ribbon--custody {
    translate: 40% -50%;
  }
}

@media (max-width: 479px) {
  .hero-ribbon--custody {
    width: 90vw;
    translate: 45% -45%;
  }
}

.hero-ribbon--international {
  width: 58.09vw;
  translate: 57.02% -18.26%;
}

/* Narrower, the hero is taller than the ribbon reaches and the source's cut
   lower edge would show: flipped upside down, it faces up, out past the top,
   and the ribbon draws back into the corner as the title takes the width. */
@media (max-width: 1279px) {
  .hero-ribbon--international {
    scale: 1 -1;
    translate: 50% -30%;
  }
}

@media (max-width: 1023px) {
  .hero-ribbon--international {
    width: 60vw;
    translate: 50% -45%;
  }
}

@media (max-width: 767px) {
  .hero-ribbon--international {
    width: 65vw;
    translate: 60% -58%;
  }
}

@media (max-width: 479px) {
  .hero-ribbon--international {
    width: 90vw;
    translate: 55% -55%;
  }
}

.hero-ribbon--fintech {
  width: 90.37vw;
  translate: 44.98% -35.79%;
}

/* The source is cut along its top and bottom, so the image has to stay
   taller than the hero. Below 1024 the hero grows taller for its width:
   the ribbon is drawn larger and further right, its folds in the corner. */
@media (max-width: 1023px) {
  .hero-ribbon--fintech {
    width: 110vw;
    translate: 58% -30%;
  }
}

@media (max-width: 899px) {
  .hero-ribbon--fintech {
    width: 130vw;
    translate: 68% -30%;
  }
}

@media (max-width: 767px) {
  .hero-ribbon--fintech {
    width: 160vw;
    translate: 74% -25%;
  }
}

@media (max-width: 599px) {
  .hero-ribbon--fintech {
    width: 230vw;
    translate: 80% -15%;
  }
}

@media (max-width: 479px) {
  .hero-ribbon--fintech {
    width: 260vw;
    translate: 82% -12%;
  }
}

/* The FinTech ribbon turned 38°, its folds along the top, behind a hero
   panel (Payments, Multi-Currency). */
.hero-ribbon--fintech-panel {
  width: 95.08vw;
  translate: 51.42% -4.65%;
}

/* Narrower, the panel goes under the text and the hero grows taller: drawn
   larger, the folds fill the corner beside the title, and on a phone it is
   flipped upside down so its cut edges stay above the hero. */
@media (max-width: 799px) {
  .hero-ribbon--fintech-panel {
    width: 210vw;
    translate: 72% -11%;
  }
}

@media (max-width: 699px) {
  .hero-ribbon--fintech-panel {
    width: 280vw;
    translate: 78% -11%;
  }
}

@media (max-width: 479px) {
  .hero-ribbon--fintech-panel {
    width: 300vw;
    scale: 1 -1;
    translate: 78% -74%;
  }
}

/* The source is cut along its right side, its whole bottom and the right end
   of its top. Narrower, the hero is taller than the ribbon reaches: flipped
   upside down, the long cut faces up, out past the top, and the short one
   lies past the right edge, so the ribbon can end above the buttons. */
.hero-ribbon--developer {
  width: 48.11vw;
  translate: 21.94% -19%;
}

@media (max-width: 1023px) {
  .hero-ribbon--developer {
    width: 60vw;
    scale: 1 -1;
    translate: 25% -35%;
  }
}

@media (max-width: 599px) {
  .hero-ribbon--developer {
    width: 100vw;
    translate: 45% -30%;
  }
}

.hero-ribbon--testimonials {
  width: 87.22vw;
  translate: 44.76% -61.21%;
}

@media (max-width: 599px) {
  .hero-ribbon--testimonials {
    width: 130vw;
  }
}

/* Cut along its top and right only, so it scales freely; on a phone it is
   drawn larger, the folds beside the title. */
.hero-ribbon--vas {
  width: 119.01vw;
  translate: 26.18% -31.56%;
}

@media (max-width: 599px) {
  .hero-ribbon--vas {
    width: 220vw;
    translate: 30% -25%;
  }
}

/* The vas ribbon turned 6° anticlockwise (Our People). Cut along its top
   and right only, so it scales freely; on a phone it is drawn larger. */
.hero-ribbon--people {
  width: 103.16vw;
  translate: 13.75% -37.96%;
}

@media (max-width: 599px) {
  .hero-ribbon--people {
    width: 220vw;
    translate: 30% -25%;
  }
}

/* The vas ribbon set higher than on APIs & VAS: the lower edge of its folds
   runs across the top. Cut along its top and right only, so it scales
   freely; on a phone it is drawn larger. */
.hero-ribbon--digital {
  width: 130.6vw;
  translate: 13.29% -50.49%;
}

@media (max-width: 599px) {
  .hero-ribbon--digital {
    width: 220vw;
    translate: 20% -42%;
  }
}

.hero-ribbon--home {
  width: 61.28vw;
  translate: 32.92% -26.17%;
}

.hero-ribbon--insights {
  width: 93.61vw;
  translate: 48.07% -19.41%;
}

/* A phone's hero is tall for its width: the ribbon is drawn larger and
   further right, so its folds fill the corner beside the title and the
   straight edges of the source image stay out of the hero. */
@media (max-width: 767px) {
  .hero-ribbon--insights {
    width: clamp(576px, 80vw + 312px, 920px);
    translate: 68% -15%;
  }
}

/* The Insights ribbon for a taller hero (Our Community: a longer text and a
   button): below 1280 drawn larger and further right, so its folds reach
   the hero's lower edge and its straight cut stays out of it. */
.hero-ribbon--community {
  width: 93.61vw;
  translate: 48.07% -19.41%;
}

@media (max-width: 1279px) {
  .hero-ribbon--community {
    width: 110vw;
    translate: 56% -14%;
  }
}

@media (max-width: 1023px) {
  .hero-ribbon--community {
    width: 125vw;
    translate: 68% -14%;
  }
}

@media (max-width: 767px) {
  .hero-ribbon--community {
    width: calc(80vw + 680px);
    translate: 77% -12%;
  }
}

.hero-ribbon--providers {
  width: 72.87vw;
  translate: 14.76% -67.48%;
}

/* A phone would see only the ribbon's top in the corner: drawn larger and
   lower, its loop sits beside the title. */
@media (max-width: 599px) {
  .hero-ribbon--providers {
    width: 110vw;
    translate: 24% -53%;
  }
}

.hero-ribbon--asset-management {
  width: 70.44vw;
  translate: 25.16% -6.98%;
}

/* On a phone the hero is taller for its width: drawn larger, the ribbon
   keeps its cut bottom edge below the hero. */
@media (max-width: 598px) {
  .hero-ribbon--asset-management {
    width: 130vw;
    translate: 60% -2%;
  }
}

.hero-ribbon--insurance {
  width: 75.95vw;
  translate: 17.3% -56.76%;
}

/* On a phone it would sit small in the corner: drawn larger, its folds
   fill the side of the title. */
@media (max-width: 599px) {
  .hero-ribbon--insurance {
    width: 120vw;
    translate: 33% -20%;
  }
}

/* The vas ribbon again, smaller and further right (Caribbean). Cut along its
   top and right only, so it scales freely; on a phone it is drawn larger,
   as on APIs & VAS. */
.hero-ribbon--caribbean {
  width: 79.86vw;
  translate: 18.61% -32.41%;
}

@media (max-width: 599px) {
  .hero-ribbon--caribbean {
    width: 220vw;
    translate: 30% -25%;
  }
}

.hero-ribbon--hong-kong {
  width: 90.06vw;
  translate: 25.93% -72.53%;
}

/* On a phone only a strip of it would show along the top: drawn larger
   and lower, its loop sits beside the title. */
@media (max-width: 599px) {
  .hero-ribbon--hong-kong {
    width: 140vw;
    translate: 33% -51%;
  }
}

.hero-ribbon--uae {
  width: 96vw;
  translate: 16% -63%;
}

/* On a phone the hero is taller for its width: drawn larger, the folds
   fill the side of the title and the cut edges stay out of it. */
@media (max-width: 599px) {
  .hero-ribbon--uae {
    width: 200vw;
    translate: 48% -33%;
  }
}

.hero-ribbon--governance {
  width: 43vw;
  translate: 7.1% -3.96%;
}

/* The source's straight cut runs along the lower part of its right side:
   on a phone the hero is taller than the ribbon reaches, so the ribbon is
   drawn larger and pushed right until the cut is past the edge. */
@media (max-width: 599px) {
  .hero-ribbon--governance {
    width: 75vw;
    translate: 38% -8%;
  }
}

.hero-ribbon--careers {
  width: 40.31vw;
  translate: 4.14% -5.08%;
}

@media (max-width: 599px) {
  .hero-ribbon--careers {
    width: 80vw;
    translate: 12% -10%;
  }
}

.hero-ribbon--legal {
  width: clamp(480px, 73.4vw, 1410px);
  translate: 13.85% -38.23%;
}
