/* Shared layer for the KIBO company sites (development/, fintech/).
   Loaded after ../css/styles.css, which gives the fonts, the tokens and every section of the main page.
   This file adds only what those sites have and the main page does not.
   Order: nav, hero, then each section top to bottom. */

/* Nav: the holding's sites share the mark and the name; a quiet descriptor tells them apart. */

.logo__unit {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-left: 2px;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  opacity: 0.74;
}

.logo__unit::before {
  content: '';
  width: 1px;
  height: 1.15em;
  background: currentColor;
  opacity: 0.45;
}

/* The contact link sits in the row of section links only on phones, where the nav has no room for the button. */
.nav__links .nav__contact {
  display: none;
}

/* Hero: a full-screen picture that draws back into a rounded panel on the first scroll.
   It is the main page's intro (.intro in styles.css) without the card: the same headline, cue, line and
   buttons, and the same classes from ../js/opening.js. Where everything lands (--cut-top, --scale,
   --drop, --after-top…) is set by hero.js. Without JavaScript the picture stays a normal full-screen
   hero and the page scrolls as usual.
   Each site sets two things for its picture: --headline-y, where the headline sits on the full picture
   (0 = top, 1 = bottom), and --band, the height in the picture that the panel is centred on. */

.hero {
  --band: 0.6;
}

.hero .intro__frame {
  transform: translateY(0) scale(1);
}

.hero.is-open .intro__frame {
  clip-path: inset(var(--cut-top, 0px) 0 var(--cut-bottom, 0px) round var(--clip-r, 0px));
  transform: translateY(var(--drop, 0px)) scale(var(--scale, 1));
}

/* The still picture eases back a little while it waits, so the opening continues a movement
   that has already begun. A film in the same place needs none of this. */
.hero img.intro__film {
  animation: hero-settle 7s cubic-bezier(0.2, 0.6, 0.2, 1) both;
}

@keyframes hero-settle {
  from {
    transform: scale(1.06);
  }
}

/* The headline is white while the picture is behind it and ink once it stands on the page.
   The change is quick and timed to the moment the picture's edge passes under the words. */
.hero .intro__title [data-part] {
  transition: transform var(--intro-time) var(--intro-ease), color 0.4s ease calc(var(--intro-time) * 0.36);
}

/* Room for one sentence per row in the longer languages. */
.hero .intro__after {
  width: min(100% - 2 * var(--gutter), 46rem);
}

.hero .intro__after .lead {
  max-width: none;
}

/* Each sentence of the line keeps to its own row when there is room for it. */
.hero .intro__after .lead span {
  display: inline-block;
}

/* When the picture cannot draw back (no JavaScript, or reduced motion), the line and buttons sit on it
   right under the headline, on the same calm part of the picture, with a wider shade behind them. */
html:not(.js) .hero .intro__after,
.hero.is-static .intro__after {
  top: calc(var(--headline-y, 0.5) * 100% + 72px);
  bottom: auto;
  text-shadow: 0 1px 12px rgba(4, 16, 12, 0.45);
}

html:not(.js) .hero .intro__scrim,
.hero.is-static .intro__scrim {
  background:
    radial-gradient(72% 46% at 50% calc(var(--headline-y, 0.5) * 100% + 12%), rgba(4, 16, 12, 0.5), transparent 80%),
    linear-gradient(rgba(4, 16, 12, 0.4), rgba(4, 16, 12, 0.04) 28%, rgba(4, 16, 12, 0) 70%, rgba(4, 16, 12, 0.3));
}

/* How we choose. Four steps need a longer scroll than the main page's three. */

.how--four.is-pinned {
  height: calc(100vh + 200vh);
}

/* A two-line heading leaves the picture a little less height than on the main page. */
.how--four.is-pinned .how__stage {
  height: min(60vh, 560px);
}

.how--four.is-pinned .how__step {
  padding-block: 18px;
}

/* On a low screen the heading, the steps and the picture still have to fit under the nav. */
@media (max-height: 700px) {
  .how--four.is-pinned .how__grid {
    margin-top: 24px;
  }

  .how--four.is-pinned .how__stage {
    height: 54vh;
  }

  .how--four.is-pinned .how__step {
    padding-block: 14px;
  }
}

/* The picture beside the steps: one sheet of the project's assessment, filled in as the steps go.
   Inside it are the main page's small pieces (.phone__bar, .phone__progress, .phone__title, .form-row,
   .checks, .home-line). Sizes are in em, so one font-size scales it. */
.sheet {
  position: relative;
  width: min(100% - 2.6em, 23em);
  padding: 1.5em 1.6em 1.7em;
  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;
}

/* The edges of the sheets underneath. */
.sheet::before,
.sheet::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 0.9em;
  left: 0.9em;
  height: 0.45em;
  border-radius: 0 0 0.7em 0.7em;
  background: rgba(255, 255, 255, 0.7);
}

.sheet::after {
  top: calc(100% + 0.45em);
  right: 1.8em;
  left: 1.8em;
  background: rgba(255, 255, 255, 0.4);
}

.sheet .phone__bar {
  margin-top: 0;
}

.sheet .phone__title {
  margin-block: 1em 0;
}

.sheet .form-row {
  margin-top: 1.1em;
}

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

.sheet .home-line {
  margin-top: 0.4em;
}

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

.how__visual.is-active .checks li:nth-child(4) {
  transition-delay: 1.6s;
}

/* A bar of parts with a legend: what a whole is made of, without numbers. */
.parts {
  margin-top: 0.9em;
  padding-top: 0.9em;
  border-top: 1px solid var(--line);
}

.parts__label {
  color: var(--ink-soft);
  font-size: 0.8em;
}

.parts__bar {
  display: flex;
  gap: 0.2em;
  height: 0.9em;
  margin-top: 0.6em;
}

.parts__bar span {
  flex: var(--part, 1);
  border-radius: 0.25em;
  background: var(--tone, var(--green));
}

.parts__keys {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3em 1.1em;
  margin-top: 0.7em;
  color: var(--ink-soft);
  font-size: 0.78em;
}

.parts__keys li {
  display: flex;
  align-items: center;
  gap: 0.45em;
}

.parts__keys li::before {
  content: '';
  width: 0.6em;
  height: 0.6em;
  border-radius: 50%;
  background: var(--tone, var(--green));
}

/* Numbers: a unit set small beside the figure, and a note under the heading. */

.proof__unit {
  margin-left: 0.3em;
  font-size: 0.32em;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.proof .head .caption {
  max-width: 22em;
  margin-top: 0;
}

/* Photo strip with three pictures instead of four. They stay three across until the phone's swipe strip. */

.uses__grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* The main page's credit-line bar, cut into parts: one capital spread over several projects. */

.line__bar--parts {
  display: flex;
  gap: 4px;
  background: none;
}

.line__bar--parts span {
  flex: var(--part, 1);
  width: auto;
  background: var(--tone, linear-gradient(90deg, var(--green), #4fae7c));
  transition-delay: calc(0.3s + var(--i, 0) * 0.12s);
}

.terms .caption {
  margin-top: 20px;
}

/* Footer: the company's identification stands beside the links. */

.foot__pair {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 4fr);
  gap: 40px var(--col-gap);
}

.foot__pair .foot__nav ul {
  grid-template-columns: minmax(0, 1fr);
}

.foot__company p {
  color: var(--ink-soft);
  line-height: 1.75;
}

.foot__company p:first-of-type {
  color: var(--ink);
}

/* Narrower screens */

/* Between the phone menu and a wide screen the nav is tight: the descriptor and longer link names
   need the room the contact button would take. The hero and the footer still lead to the contact form. */
@media (min-width: 861px) and (max-width: 1100px) {
  .nav__in {
    gap: 28px;
  }

  .nav__links {
    gap: 22px;
  }
}

@media (min-width: 861px) and (max-width: 1000px) {
  .nav .btn {
    display: none;
  }
}

@media (max-width: 620px) {
  /* The name and its descriptor need the room: the contact button moves into the menu. */
  .nav .btn {
    display: none;
  }

  .nav__links .nav__contact {
    display: block;
  }

  .foot__pair {
    grid-template-columns: minmax(0, 1fr);
  }

  /* A headline of two or three rows pushes the line on the still picture further down. */
  html:not(.js) .hero .intro__after,
  .hero.is-static .intro__after {
    top: calc(var(--headline-y, 0.5) * 100% + 92px);
  }

  .line__top {
    flex-wrap: wrap;
    gap: 2px 16px;
  }

  .proof__unit {
    font-size: 0.36em;
  }
}
