/* Home: hero, figures, the home About section, selected work grid and the loading intro.
   Loads after shared/styles.css. */
/* Hero */
.hero {
  padding-top: clamp(40px, 6vw, 80px);
}
.hero__text {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 800px;
}
.hero .lede {
  max-width: 62ch;
  font-size: 18px;
  line-height: 1.55;
}
.hero .display {
  font-size: clamp(35px, 5.5vw, 77px);
}
.hero__now {
  color: var(--brand);
}
.hero__eyebrow {
  font-size: 15px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 12px;
  font-weight: 600;
}
/* the greeting changes language every few seconds (home.js) */
.hero__hello {
  display: inline-block;
  font-style: italic;
  transition:
    opacity 0.2s var(--ease-standard),
    transform 0.2s var(--ease-standard);
}
.hero__hello.out {
  opacity: 0;
  transform: translateY(-0.12em);
}
.hero__avail {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: flex-start;
  height: 36px;
  padding: 0 14px;
  border-radius: 9999px;
  background: var(--tint);
  font-size: 13px;
  color: var(--ink);
}
.hero__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
}
.hero__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 32px;
}
/* small round photo above the eyebrow: black and white, colour comes back on hover */
.hero__avatar {
  display: block;
  width: 144px;
  height: 144px;
  margin-bottom: 24px;
  border-radius: 50%;
  object-fit: cover;
  filter: grayscale(1);
  transition: filter 0.3s var(--ease-standard);
}
/* About (home) and stats */
.about {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 48px 80px;
  margin-top: 28px;
}
.about__lede {
  font-size: 17px;
  line-height: 1.6;
  color: var(--body);
  max-width: 60ch;
}
.about__facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin: 28px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.about__facts dt {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
}
.about__facts dd {
  margin: 6px 0 0;
  color: var(--ink);
  font-weight: 500;
}
.about__more {
  display: inline-block;
  margin-top: 24px;
  font-weight: 500;
  color: var(--ink);
}
.about__list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.about__list li {
  display: flex;
  align-items: baseline;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: -0.016em;
  color: var(--ink);
}
.about__list span {
  flex: none;
  width: 24px;
  font-variant-numeric: tabular-nums;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--brand);
}
.stats {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 24px;
  margin-top: 48px;
  border-top: 1px solid var(--line);
  padding-top: 32px;
}
.stats:first-child {
  margin-top: 0;
}
.stat__n {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(23px, 2.3vw, 30px);
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
}
.stat__l {
  margin-top: 12px;
  font-size: 15px;
  color: var(--muted);
  max-width: 34ch;
}
/* Selected work: the first case as a large card (image left, text right),
   the rest as smaller cards underneath (image on top) */
.work {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 56px 32px;
  margin-top: 16px;
}
/* with only two small cards (a case is hidden), they share the row in two columns */
@media (min-width: 861px) {
  .work:not(:has(> .case:nth-child(4))) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.case:not(.case--feature) .case__sub {
  display: none;
}
.case:not(.case--feature) .case__title {
  font-size: clamp(21px, 2.1vw, 28px);
  max-width: 20ch;
}
@media (hover: hover) {
  .hero__avatar:hover {
    filter: none;
  }
  /* a terracotta border on the card (or the image of the small cards), no shadow */
  .case:not(.case--feature):hover .case__media {
    border-color: var(--brand);
  }
}
/* Intro: a short loading screen on every visit. When it reaches 100% the name
   flies into the menu and becomes the logo, the screen fades and the hero comes in.
   An exception to the design system's "no entrance choreography", asked for by José.
   The class is set in <head> so the screen is there from the first paint. */
.intro {
  display: none;
}
.intro-on .intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
}
.intro-on .intro::before,
.intro-on .intro::after {
  content: '';
  position: absolute;
  transition: opacity 0.6s var(--ease-standard);
}
.intro-on .intro::before {
  inset: 0;
  background: var(--bg);
}
/* progress line */
.intro-on .intro::after {
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--brand);
  transform: scaleX(var(--p, 0));
  transform-origin: left;
}
.intro__name {
  position: relative;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(32px, 4.4vw, 49px);
  letter-spacing: -0.02em;
  color: var(--ink);
  transform-origin: 0 0;
  transition: transform 0.9s cubic-bezier(0.76, 0, 0.24, 1);
}
.intro__count {
  position: absolute;
  right: var(--gutter);
  bottom: 24px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  transition: opacity 0.3s var(--ease-standard);
}
.intro-out .intro {
  pointer-events: none;
}
.intro-out .intro::before,
.intro-out .intro::after,
.intro-out .intro__count {
  opacity: 0;
}
/* the menu logo waits until the flying name lands on it */
.intro-on .nav__name {
  visibility: hidden;
}
.intro-on:not(.intro-out) {
  overflow: hidden;
}
.intro-on .hero__eyebrow,
.intro-on .hero .display,
.intro-on .hero .lede,
.intro-on .hero__actions,
.intro-on .hero__avatar {
  opacity: 0;
  transform: translateY(24px);
}
.intro-out .hero__eyebrow,
.intro-out .hero .display,
.intro-out .hero .lede,
.intro-out .hero__actions,
.intro-out .hero__avatar {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.7s var(--ease),
    transform 0.7s var(--ease);
}
.intro-out .hero__eyebrow {
  transition-delay: 0.35s;
}
.intro-out .hero .display {
  transition-delay: 0.45s;
}
.intro-out .hero__avatar {
  transition-delay: 0.3s;
}
.intro-out .hero .lede {
  transition-delay: 0.55s;
}
.intro-out .hero__actions {
  transition-delay: 0.65s;
}
/* Short version when the page is reloaded */
.intro-fast .intro__name {
  transition-duration: 0.55s;
}
.intro-fast .intro::before,
.intro-fast .intro::after {
  transition-duration: 0.35s;
}
.intro-fast.intro-out .hero__eyebrow,
.intro-fast.intro-out .hero .display,
.intro-fast.intro-out .hero .lede,
.intro-fast.intro-out .hero__actions,
.intro-fast.intro-out .hero__avatar {
  transition-duration: 0.45s;
}
.intro-fast.intro-out .hero__avatar,
.intro-fast.intro-out .hero__eyebrow {
  transition-delay: 0.15s;
}
.intro-fast.intro-out .hero .display {
  transition-delay: 0.2s;
}
.intro-fast.intro-out .hero .lede {
  transition-delay: 0.25s;
}
.intro-fast.intro-out .hero__actions {
  transition-delay: 0.3s;
}
@media (hover: none) {
  .case:not(.case--feature):active .case__media {
    border-color: var(--brand);
  }
  /* the photo can't wait for a hover: a tap brings the colour back */
  .hero__avatar.is-color {
    filter: none;
  }
}
@media (max-width: 860px) {
  .hero__avatar {
    width: 112px;
    height: 112px;
  }
  .stats {
    grid-auto-flow: row;
    gap: 28px;
  }
  .work {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .about {
    grid-template-columns: 1fr;
    gap: 48px;
    margin-top: 32px;
  }
  .about__list li {
    font-size: 18px;
  }
}
@media (min-width: 600px) and (max-width: 860px) {
  .stats {
    grid-auto-flow: column;
    gap: 24px;
  }
  .work .case:not(.case--feature) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 28px;
    align-items: center;
  }
}
