/* KIBO Fintech. Only what belongs to this site: its pictures, the small drawings in its tiles and the
   pictures beside its three steps.
   Everything else comes from ../css/styles.css (the main page) and ../company/company.css (the company sites). */

/* Hero picture: a dark green wall takes its upper half, so the headline sits there; the people at the
   long table are below the middle. */

.hero {
  --headline-y: 0.3;
  --band: 0.68;
}

/* On a screen narrower than the picture, the window at its left edge stays in view. */
.hero .intro__film {
  object-position: 22% 50%;
}

/* The headline keeps clear of the bright window: a longer one (English, Russian) takes two even rows instead. */
.hero .intro__words {
  text-wrap: balance;
}

@media (min-width: 701px) {
  .hero .intro__title {
    padding-inline: max(var(--gutter), 13.5vw);
  }
}

/* Phones and upright tablets get their own upright picture. */
@media (max-width: 900px) and (orientation: portrait) {
  .hero {
    --headline-y: 0.3;
    --band: 0.78;
  }

  .hero .intro__film {
    object-position: 50% 100%;
  }
}

/* Tile 1: the company's product, drawn as its window. */

.product {
  width: min(100% - 2.6em, 17.5em);
  border-radius: 1em;
  background: #fff;
  box-shadow: 0 1.2em 1.8em -1em rgba(11, 42, 32, 0.3), 0 0 0 1px rgba(11, 42, 32, 0.05);
}

.product__line {
  fill: none;
  stroke: var(--line);
}

.product__pick {
  fill: #e6f4e7;
}

.product__row {
  fill: #f3f6f1;
}

.product__dim {
  fill: #d3ddd1;
}

.product__tag {
  fill: #cfe9d4;
}

.product__ink {
  fill: var(--ink);
}

.product__on {
  fill: var(--leaf);
}

/* Tile 2: a market as rows of dots. The full ones are today's customers, the rings are the room left. */

.reach {
  --ring: rgba(11, 42, 32, 0.24);
  position: relative;
  aspect-ratio: 9 / 4;
  margin-top: 1em;
  background: radial-gradient(circle closest-side, transparent 43%, var(--ring) 47%, var(--ring) 57%, transparent 61%) 0 0 /
    calc(100% / 9) 25%;
}

.reach::before,
.reach::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: calc(100% * 4 / 9);
  height: 100%;
  background: radial-gradient(circle closest-side, var(--leaf) 57%, transparent 61%) 0 0 / 25% 25%;
  transition: clip-path 1s var(--ease) 0.4s;
}

/* Two more in the next column, so the edge of today's customers is not a straight line. */
.reach::after {
  left: calc(100% * 4 / 9);
  width: calc(100% / 9);
  height: 50%;
  background-size: 100% 50%;
  transition-delay: 0.9s;
}

.js [data-reveal]:not(.is-in) .reach::before {
  clip-path: inset(0 100% 0 0);
}

.js [data-reveal]:not(.is-in) .reach::after {
  clip-path: inset(0 0 100% 0);
}

.reach__keys {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3em 1.2em;
  margin-top: 1em;
  padding-top: 0.75em;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.78em;
}

.reach__keys span {
  display: flex;
  align-items: center;
  gap: 0.5em;
}

.reach__keys span::before {
  content: '';
  width: 0.72em;
  height: 0.72em;
  border-radius: 50%;
  background: var(--leaf);
}

.reach__keys span + span::before {
  border: 0.14em solid rgba(11, 42, 32, 0.3);
  background: none;
}

/* Tile 3: operating costs coming down, period by period. */

.lean {
  width: min(100% - 2.6em, 14.5em);
  text-align: center;
}

.lean__bars {
  display: flex;
  align-items: flex-end;
  gap: 0.7em;
  height: 6.6em;
  padding-inline: 0.9em;
  border-bottom: 1px solid rgba(11, 42, 32, 0.2);
}

.lean__bars i {
  flex: 1;
  height: calc(var(--h) * 1%);
  border-radius: 0.3em 0.3em 0 0;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 0 0 1px rgba(11, 42, 32, 0.04);
  transform-origin: bottom;
  transition: transform 0.9s var(--ease) 0.3s;
}

/* The last one is where the company runs now. */
.lean__bars i:last-child {
  background: linear-gradient(#4fae7c, var(--green));
  box-shadow: none;
}

.lean__bars i:nth-child(2) {
  transition-delay: 0.38s;
}

.lean__bars i:nth-child(3) {
  transition-delay: 0.46s;
}

.lean__bars i:nth-child(4) {
  transition-delay: 0.54s;
}

.lean__bars i:nth-child(5) {
  transition-delay: 0.62s;
}

.lean__bars i:nth-child(6) {
  transition-delay: 0.7s;
}

.js [data-reveal]:not(.is-in) .lean__bars i {
  transform: scaleY(0);
}

.lean__bars + p {
  margin-top: 1.2em;
  color: var(--ink-soft);
  font-size: 0.87em;
}

.lean strong {
  display: block;
  color: var(--ink);
  font-size: 1.5em;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

/* Tile 4: the company's value as a line that climbs through the goals. No scale, no figures. */

.value {
  width: 100%;
  margin-top: 0.8em;
  overflow: visible;
}

.value__area {
  fill: url(#value-fill);
  transition: opacity 0.9s ease 1.1s;
}

.value__line {
  fill: none;
  stroke: var(--leaf);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 100 110;
  transition: stroke-dashoffset 1.5s var(--ease) 0.3s;
}

.value__goal circle {
  fill: #fff;
  stroke: var(--leaf);
  stroke-width: 2.5;
  transition: opacity 0.4s ease 0.7s;
}

.value__goal circle:nth-child(2) {
  transition-delay: 1.05s;
}

.value__goal circle:nth-child(3) {
  transition-delay: 1.4s;
}

.js [data-reveal]:not(.is-in) .value__line {
  stroke-dashoffset: 104;
}

.js [data-reveal]:not(.is-in) .value__area,
.js [data-reveal]:not(.is-in) .value__goal circle {
  opacity: 0;
}

.value__axis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 0.7em;
  padding-top: 0.65em;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.74em;
  text-align: center;
}

/* How we work. The picture beside the steps is one company's card, which changes with the step:
   who owns it, what is being worked on, who it passes to. Inside are the main page's small pieces
   (.checks, .home-line, .verified) and the company sites' legend (.parts__keys).
   Sizes are in em, so one font-size scales it. */

.board {
  position: relative;
  width: min(100% - 2.6em, 23em);
  padding: 1.35em 1.6em 1.6em;
  border-radius: 1.1em;
  background: #fff;
  box-shadow: 0 1.6em 2.6em -1.6em rgba(11, 42, 32, 0.4), 0 0 0 1px rgba(11, 42, 32, 0.05);
  line-height: 1.35;
}

.how.is-pinned .how__visual {
  font-size: clamp(0.875rem, 1.18vw, 1.0625rem);
}

/* The company's name, the same on all three cards. */
.board__top {
  display: flex;
  align-items: center;
  gap: 0.75em;
  padding-bottom: 1.2em;
  border-bottom: 1px solid var(--line);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.board__top svg {
  flex: none;
  width: 2.3em;
  height: 2.3em;
  padding: 0.5em;
  border-radius: 0.65em;
  background: #e6f4e7;
  color: var(--green);
}

.board__top em {
  margin-left: auto;
  padding: 0.25em 0.7em;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.74em;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0;
}

.board__label {
  margin-top: 1.3em;
  color: var(--ink-soft);
  font-size: 0.86em;
}

/* Step 1: the owners as a ring, with our stake picked out. */
.stake {
  position: relative;
  width: 10.5em;
  margin: 1.5em auto 0;
}

.stake svg {
  width: 100%;
  transform: rotate(-90deg);
}

.stake circle {
  fill: none;
  stroke-width: 15;
}

.stake__rest {
  stroke: #e3eadf;
}

.stake__part {
  stroke: url(#stake-ink);
  stroke-dasharray: 38 100;
  transition: stroke-dasharray 1.3s var(--ease) 0.4s;
}

.js .how__visual:not(.is-active) .stake__part {
  stroke-dasharray: 0 100;
}

.stake p {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  font-size: 0.86em;
}

.board .parts__keys {
  justify-content: center;
  margin-top: 1.2em;
  font-size: 0.86em;
}

.board .home-line {
  margin-top: 1.4em;
}

/* Step 2: the four things we work on. Each line draws itself when the card comes up. */
.tracks li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  padding-block: 0.95em;
  border-top: 1px solid var(--line);
  font-weight: 500;
}

.tracks li:first-child {
  border-top: 0;
}

.tracks li:last-child {
  padding-bottom: 0.2em;
}

.tracks svg {
  flex: none;
  width: 7.2em;
  height: 2.1em;
  overflow: visible;
}

.tracks path {
  fill: none;
  stroke: var(--leaf);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 100 110;
  transition: stroke-dashoffset 1.1s var(--ease) 0.3s;
}

.tracks li:nth-child(2) path {
  transition-delay: 0.55s;
}

.tracks li:nth-child(3) path {
  transition-delay: 0.8s;
}

.tracks li:nth-child(4) path {
  transition-delay: 1.05s;
}

.js .how__visual:not(.is-active) .tracks path {
  stroke-dashoffset: 104;
}

/* Step 3: the goals are met and the stake passes on. */
.board .checks {
  margin-top: 0.3em;
}

.board .checks li:first-child {
  border-top: 0;
}

.handover {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.6em;
  margin-top: 0.7em;
  font-size: 0.9em;
  font-weight: 500;
  text-align: center;
}

.handover span,
.handover strong {
  padding: 0.85em 0.6em;
  border-radius: 0.75em;
  background: #f3f6f1;
  font-weight: inherit;
}

.handover strong {
  background: var(--forest);
  color: #eaf6ea;
}

.handover svg {
  width: 1.2em;
  height: 1.2em;
  color: var(--leaf);
}

/* Numbers. All three are ranges, so the figures are set a little smaller than on the other sites
   and the dash between them is quiet. */

.proof__number {
  font-size: clamp(3.75rem, 8.4vw, 6.75rem);
  font-variant-numeric: normal;
}

.proof__to {
  display: inline-block;
  margin-inline: 0.1em;
  color: var(--ink-faint);
  font-size: 0.6em;
  font-weight: 400;
  vertical-align: 0.24em;
}

/* For investors: one investment on a line of five years. The first three are work on the company;
   in the hatched ones the sale is expected. */

.line__bar--parts .line__open {
  background: repeating-linear-gradient(135deg, #cfe6d3 0 6px, #e6f1e5 6px 12px);
}

.line__years {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  margin-top: 10px;
  color: var(--ink-soft);
  font: 400 0.75rem/1.2 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.line__key--open {
  border-color: #b9dcc0;
}

/* Each note starts under the years it speaks about. */
@media (min-width: 621px) {
  .line .line__keys {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 4px;
    margin-top: 24px;
  }

  .line .line__key {
    padding-right: 24px;
  }
}

/* Footer picture: the windows and the roofs behind them are in the middle, the lamps at both sides.
   A phone's tall panel keeps the middle window. */

.foot__image {
  object-position: 50% 42%;
}

@media (max-width: 620px) {
  /* A range with its unit is as wide as the phone, so each label goes under its figure. */
  .proof__stat {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .proof__label br {
    display: none;
  }

  /* Five year labels in a row need smaller letters here. */
  .line__years {
    font-size: 0.6875rem;
    letter-spacing: 0;
  }
}
