/* Group pages: send.html, receive.html, currencies-and-cards.html and plans.html. Each is the
   home of one group in the header: its name, its pages as the app's icons, then a preview of
   every page (the sheet the page opens with) and one line. Loaded after styles.css and
   features.css, on a body with class "home-page feature-page hub-page". */

.hub-hero,
.hub-range {
  width: min(100%, var(--feature-width));
  margin-inline: auto;
}

.hub-hero {
  padding-top: clamp(16px, 3.4vw, 52px);
}

.hub-page .hub-hero h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(54px, 6.2vw, 88px);
  font-weight: 600;
  line-height: max(1, var(--title-leading, 0));
  letter-spacing: -0.06em;
  text-wrap: balance;
}

.hub-lede {
  max-width: 34ch;
  margin: clamp(16px, 1.7vw, 24px) 0 0;
  color: #59606f;
  font-size: clamp(18px, 1.5vw, 21px);
  line-height: 1.42;
  letter-spacing: -0.025em;
  text-wrap: pretty;
}

/* The group's pages, as the app draws them: an icon, a name. */
/* Below desktop width, the icons follow the introduction; names centre under their icons. */
.hub-chapters {
  margin: clamp(40px, 4.4vw, 60px) 0 0 -18px;
  padding: 0;
  display: flex;
  gap: clamp(20px, 2.8vw, 40px);
  list-style: none;
}

.hub-chapter {
  width: 96px;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 12px;
  border-radius: 18px;
  color: var(--ink);
  text-align: center;
}

.hub-chapter:hover,
.hub-chapter:focus-visible {
  text-decoration: none;
}

.hub-chapter:focus-visible {
  outline: 2px solid rgba(109, 123, 255, 0.45);
  outline-offset: 6px;
}

.hub-chapter__icon {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 19px;
  background: linear-gradient(148deg, #7581ff 0%, #6470f6 56%, #735eff 100%);
  box-shadow: 0 10px 18px rgba(42, 48, 95, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.32);
  color: rgba(255, 255, 255, 0.96);
  font-size: 29px;
  transition: transform 420ms var(--ease-premium), box-shadow 420ms var(--ease-premium);
}

/* The plans keep the app's own marks, as in the header menu. */
.hub-chapter__icon--standard {
  background: linear-gradient(145deg, #8994ff 14%, #6558f3 50%, #35267e 86%);
  box-shadow: 0 10px 18px rgba(42, 48, 95, 0.16);
}

/* The silver keeps its edge on the light page, as in the header menu. */
.hub-chapter__icon--infinity {
  background: linear-gradient(118deg, #e1e4e8 13%, #b7bbc3 31%, #eef0f2 50%, #a7acb5 67%, #d3d7dc 87%);
  box-shadow: 0 10px 20px rgba(22, 28, 46, 0.2), inset 0 0 0 1px rgba(23, 25, 30, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  color: #17191e;
}

.hub-chapter__name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
  text-wrap: balance;
  transition: color 200ms ease;
}

.hub-chapter:hover .hub-chapter__icon,
.hub-chapter:focus-visible .hub-chapter__icon {
  transform: translateY(-3px);
  box-shadow: 0 16px 26px rgba(42, 48, 95, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.hub-chapter:hover .hub-chapter__icon--infinity,
.hub-chapter:focus-visible .hub-chapter__icon--infinity {
  box-shadow: 0 16px 26px rgba(22, 28, 46, 0.24), inset 0 0 0 1px rgba(23, 25, 30, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.hub-chapter:hover .hub-chapter__name,
.hub-chapter:focus-visible .hub-chapter__name {
  color: var(--mon-indigo-deep);
}

/* Every page of the group: its sheet, its name, one line. */
.hub-page main > .hub-range {
  margin-top: clamp(96px, 10vw, 148px);
}

.hub-page main > .hub-range::before {
  top: calc(0px - clamp(48px, 5vw, 74px));
}

.hub-range__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: baseline;
  justify-items: center;
  gap: 18px;
}

.hub-range__head h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(34px, 4vw, 54px);
  font-weight: 600;
  line-height: max(1.04, var(--title-leading, 0));
  letter-spacing: -0.055em;
  text-align: center;
  text-wrap: balance;
}

.hub-range__link,
.hub-card__more {
  color: var(--mon-indigo-deep);
  font-weight: 600;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.hub-range__link {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: clamp(15px, 1.2vw, 17px);
}

.hub-range__link:hover,
.hub-range__link:focus-visible {
  text-decoration: none;
}

.hub-range__link::after {
  content: "\f57a";
  font-family: "MonMaterialIcons";
  font-size: 18px;
  font-weight: 400;
  transition: transform 420ms var(--ease-premium);
}

.hub-range__link:hover::after,
.hub-range__link:focus-visible::after {
  transform: translateX(4px);
}

.hub-card__more::after {
  content: "\e15f";
  display: inline-block;
  margin-left: -1px;
  font-family: "MonMaterialIcons";
  font-size: 1.25em;
  font-weight: 400;
  line-height: 0;
  vertical-align: -0.27em;
  transition: transform 420ms var(--ease-premium);
}

.hub-card:hover .hub-card__more::after {
  transform: translateX(3px);
}

.hub-cards {
  --hub-count: 3;
  margin: clamp(30px, 3.4vw, 46px) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(var(--hub-count), minmax(0, 1fr));
  gap: clamp(14px, 1.5vw, 20px);
  list-style: none;
}

.hub-cards--2 { --hub-count: 2; }
.hub-cards--4 { --hub-count: 4; }

/* Under the cards, the way in: the same button as on the feature pages, centred. */
.hub-range > .get-app-button {
  display: flex;
  width: fit-content;
  min-width: 0;
  height: 42px;
  margin: clamp(40px, 4vw, 58px) auto 0;
  padding-inline: 18px;
  font-size: 15px;
  box-shadow: 0 6px 14px rgba(33, 33, 33, 0.12);
}

.hub-card {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 30px;
  background: #fff;
  box-shadow: var(--feature-tile-shadow);
  container-type: inline-size;
  transition: transform 420ms var(--ease-premium), box-shadow 420ms var(--ease-premium);
}

.hub-card:hover,
.hub-card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 28px 52px rgba(22, 28, 46, 0.09);
}

/* The sheet rises from the card, as wide as it reads well, and fades into it: the same width for
   every page, so no sheet looks bigger than the next. */
.hub-card__stage {
  --hub-sheet: min(256px, 74cqi);
  position: relative;
  height: calc(var(--hub-sheet) * 1.02 + 38px);
  display: flex;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(180deg, #eceffe 0%, #f3f5ff 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 64%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 64%, transparent 100%);
}

.hub-card__sheet {
  flex: none;
  width: var(--hub-sheet);
  margin-top: 38px;
  align-self: flex-start;
  filter: drop-shadow(0 2px 10px rgba(109, 123, 255, 0.2)) drop-shadow(0 26px 26px rgba(98, 110, 240, 0.14));
}

.hub-card__sheet img {
  display: block;
  width: 100%;
  height: auto;
}

/* Plans: the card itself, whole, on the same light. */
.hub-card__stage--art {
  align-items: center;
  -webkit-mask-image: none;
  mask-image: none;
  background: linear-gradient(180deg, #eceffe 0%, #f6f7ff 72%, #fff 100%);
}

.hub-card__stage--art .hub-card__sheet {
  width: min(248px, 72cqi);
  margin: 0;
  align-self: center;
  filter: drop-shadow(0 22px 26px rgba(41, 54, 127, 0.2)) drop-shadow(0 4px 8px rgba(41, 54, 127, 0.1));
}

.hub-card__glyph {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  border-radius: 30px;
  background: linear-gradient(148deg, #7581ff 0%, #6470f6 56%, #735eff 100%);
  box-shadow: 0 22px 34px rgba(42, 48, 95, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.32);
  color: rgba(255, 255, 255, 0.96);
  font-size: 46px;
}

.hub-card__copy {
  flex: 1;
  padding: 4px clamp(22px, 2.1vw, 28px) clamp(24px, 2.3vw, 30px);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hub-card h3 {
  margin: 0;
  font-size: clamp(19px, 1.55vw, 21px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.hub-card h3 a {
  color: var(--ink);
  outline: none;
}

.hub-card h3 a:hover {
  text-decoration: none;
}

/* The name is the link; the whole card answers to it. */
.hub-card h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.hub-card h3 a:focus-visible::after {
  outline: 2px solid rgba(109, 123, 255, 0.5);
  outline-offset: -3px;
}

.hub-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.hub-card__more {
  margin-top: auto;
  padding-top: 12px;
  font-size: 15px;
}

/* Use the same left-copy/right-object layout as the feature pages. The section
   title below stays on the content centreline, independent of its utility link. */
@media (min-width: 1280px) {
  .hub-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    align-items: center;
    gap: clamp(36px, 4vw, 64px);
  }

  .hub-hero > div {
    min-width: 0;
  }

  .hub-chapters {
    justify-self: end;
    margin: 0;
  }

  .hub-range__head {
    grid-template-columns: minmax(0, 1fr) minmax(0, max-content) minmax(0, 1fr);
    column-gap: 20px;
  }

  .hub-range__head h2 {
    grid-column: 2;
  }

  .hub-range__link {
    grid-column: 3;
  }
}

/* Four shortcuts need two rows until the copy has room for translated headings. */
@media (min-width: 1280px) and (max-width: 1799px) {
  .hub-chapters:has(> li:nth-child(4)) {
    display: grid;
    grid-template-columns: repeat(2, 96px);
  }
}

/* Four pages sit in one row only where each card stays wide enough to read its sheet. */
@media (max-width: 1399px) {
  .hub-cards--4 { --hub-count: 2; }
}

@media (max-width: 860px) {
  .hub-cards--3 { --hub-count: 1; }
}

@media (max-width: 640px) {
  .hub-cards { --hub-count: 1; }

  /* Phones: the group's name, its line and its pages stand on the centre line. Auto margins centre
     the row of pages and give way to the start when it has to scroll, so none is ever cut off. */
  .hub-hero {
    text-align: center;
  }

  .hub-lede {
    margin-inline: auto;
  }

  .hub-chapters li:first-child {
    margin-inline-start: auto;
  }

  .hub-chapters li:last-child {
    margin-inline-end: auto;
  }

  .hub-chapters {
    margin-inline: calc(0px - var(--site-content-edge));
    padding-inline: calc(var(--site-content-edge) - 13px);
    gap: 12px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .hub-chapters::-webkit-scrollbar {
    display: none;
  }

  .hub-chapters li {
    flex: none;
  }

  .hub-chapter {
    width: 82px;
    gap: 10px;
  }

  .hub-chapter__icon {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    font-size: 27px;
  }

  .hub-chapter__name {
    font-size: 13px;
  }

  .hub-card {
    border-radius: 26px;
  }
}

/* Keep the longest title word within the content gutters on narrow phones. */
@media (max-width: 359px) {
  .hub-page .hub-hero:has(.hub-chapter[href="convert-currency.html"]) h1 {
    font-size: clamp(48px, 15vw, 54px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hub-chapter__icon,
  .hub-card,
  .hub-range__link::after,
  .hub-card__more::after {
    transition: none;
  }
}

/* Plans: the plans are this page, so the footer's own plan cards stay away. */
.hub-page--plans .site-footer .plans-section {
  display: none;
}

.hub-page--plans .site-footer {
  border-top: 12px solid #ffffff;
  padding-block-start: clamp(24px, 4vw, 56px);
}
