/*
 * Home brand story
 * One continuous visual from the first view through the mission statement.
 */

.home-story {
  --story-shift: 0px;
  --story-scale: 1.06;
  position: relative;
  isolation: isolate;
  background: #111413;
  color: #fffdf8;
}

.home-story__backdrop {
  position: sticky;
  z-index: 0;
  top: 4rem;
  height: calc(100svh - 4rem);
  margin-bottom: calc(-100svh + 4rem);
  overflow: hidden;
  background: #111413;
}

.home-story__backdrop::before,
.home-story__backdrop::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  content: "";
}

.home-story__backdrop::before {
  background:
    linear-gradient(90deg, rgb(12 15 14 / 76%) 0%, rgb(12 15 14 / 38%) 44%, rgb(12 15 14 / 54%) 100%),
    linear-gradient(180deg, rgb(12 15 14 / 26%) 0%, transparent 42%, rgb(12 15 14 / 70%) 100%);
}

.home-story__backdrop::after {
  background: radial-gradient(circle at 50% 42%, transparent 28%, rgb(8 10 9 / 28%) 100%);
}

.home-story__image {
  position: absolute;
  inset: -5%;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: saturate(.62) contrast(1.08) brightness(.86);
  opacity: 0;
  transform: translate3d(0, var(--story-shift), 0) scale(var(--story-scale));
  transform-origin: center;
  transition: opacity 1.2s ease;
  will-change: transform, opacity;
}

.home-story__image.is-active {
  opacity: 1;
}

.home-story__image--gym {
  background-image: url("../images/hero-fitness-club-v4.jpg");
}

.home-story__image--design {
  background-image: url("../images/home/home-story-design.jpg");
}

.home-story__image--store {
  background-image: url("../the-reset-hero-v3.webp");
}

.story-panel {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: calc(100svh - 4rem);
  align-items: stretch;
  overflow: hidden;
}

.story-panel::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(90deg, rgb(8 10 9 / 34%), transparent 72%);
  content: "";
  pointer-events: none;
}

.story-panel--right::before,
.story-panel--mission::before {
  background: linear-gradient(270deg, rgb(8 10 9 / 62%) 0%, rgb(8 10 9 / 22%) 52%, transparent 82%);
}

.story-panel--left::before {
  background: linear-gradient(90deg, rgb(8 10 9 / 70%) 0%, rgb(8 10 9 / 20%) 56%, transparent 84%);
}

.story-panel--mission::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgb(8 10 9 / 18%) 54%, rgb(8 10 9 / 84%) 100%);
  content: "";
}

.story-panel__inner {
  display: flex;
  min-height: inherit;
  align-items: center;
  padding-top: clamp(5rem, 11vh, 8rem);
  padding-bottom: clamp(4rem, 10vh, 7rem);
}

.story-panel__inner--start {
  justify-content: flex-start;
}

.story-panel__inner--end {
  justify-content: flex-end;
}

.story-panel__content {
  width: min(100%, 48rem);
  color: #fffdf8;
  text-shadow: 0 2px 26px rgb(0 0 0 / 38%);
}

.story-panel__kicker,
.story-panel__number {
  margin: 0 0 clamp(1.4rem, 3vw, 2.5rem);
  color: #f2cf8e;
  font-size: clamp(.62rem, .85vw, .78rem);
  font-weight: 800;
  letter-spacing: .2em;
  line-height: 1.5;
}

.story-panel h1,
.story-panel h2 {
  margin: 0;
  color: #fffdf8;
  font-family: var(--font-sans);
  font-weight: 800;
  letter-spacing: -.055em;
  text-wrap: balance;
}

.story-panel h1 {
  font-size: clamp(2.8rem, 7.4vw, 7rem);
  line-height: 1.08;
}

.story-panel h2 {
  font-size: clamp(2.15rem, 5.2vw, 5rem);
  line-height: 1.18;
}

.story-panel h1 span,
.story-panel h2 span {
  display: block;
}

.story-panel--right .story-panel__content,
.story-panel--mission .story-panel__content {
  width: min(100%, 43rem);
}

.story-panel--right h2 {
  font-size: clamp(1.9rem, 4.1vw, 3.9rem);
  line-height: 1.3;
}

.story-panel__statement {
  margin: clamp(2rem, 5vh, 3.75rem) 0 0;
  padding-top: 1.4rem;
  border-top: 1px solid rgb(255 253 248 / 40%);
  color: rgb(255 253 248 / 84%);
  font-size: clamp(1rem, 1.55vw, 1.35rem);
  font-weight: 700;
  letter-spacing: .05em;
}

.story-panel__content--mission {
  padding: 0;
}

.mission-copy {
  display: grid;
  gap: clamp(1.2rem, 2.4vh, 1.8rem);
  margin-top: clamp(2rem, 4vh, 3.25rem);
}

.mission-copy p {
  margin: 0;
  color: rgb(255 253 248 / 82%);
  font-size: clamp(.9rem, 1.25vw, 1.05rem);
  font-weight: 600;
  letter-spacing: .035em;
  line-height: 2;
}

.mission-copy .mission-copy__conclusion {
  margin-top: clamp(.45rem, 1.5vh, 1rem);
  color: #fffdf8;
  font-size: clamp(1.15rem, 1.8vw, 1.55rem);
  font-weight: 800;
  letter-spacing: .055em;
  line-height: 1.65;
}

.story-scroll {
  position: absolute;
  bottom: clamp(1.75rem, 4vh, 3rem);
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .8rem;
  color: rgb(255 253 248 / 72%);
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .22em;
  text-decoration: none;
  transform: translateX(-50%);
}

.story-scroll i {
  position: relative;
  display: block;
  width: 1px;
  height: 3.5rem;
  overflow: hidden;
  background: rgb(255 253 248 / 28%);
}

.story-scroll i::after {
  position: absolute;
  inset: 0;
  background: #f2cf8e;
  content: "";
  animation: story-scroll-line 2.2s ease-in-out infinite;
  transform: translateY(-105%);
}

@keyframes story-scroll-line {
  0% { transform: translateY(-105%); }
  48%, 58% { transform: translateY(0); }
  100% { transform: translateY(105%); }
}

.js-enabled .story-reveal {
  opacity: 0;
  transform: translate3d(0, 2rem, 0);
  transition: opacity .9s ease, transform 1.1s cubic-bezier(.22, 1, .36, 1);
}

.js-enabled .story-reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* The story continues into proof, work and company without returning to card-heavy UI. */
.home-flow-section {
  padding-block: clamp(5.5rem, 10vw, 9rem);
}

.home-projects.home-flow-section {
  border-top: 0;
  background: #f7f3ea;
}

.home-projects.home-flow-section .home-photo--projects .photo-slot__surface {
  background:
    linear-gradient(110deg, rgb(21 22 23 / 8%), rgb(21 22 23 / 32%)),
    url("../images/home/home-story-design.jpg") center / cover no-repeat;
}

.brands.home-flow-section {
  background: #fffdf8;
}

.works-intro {
  max-width: 34rem;
  margin: clamp(1.4rem, 3vw, 2.2rem) auto 0;
  color: var(--color-muted);
  font-size: clamp(.9rem, 1.15vw, 1.02rem);
  font-weight: 600;
  letter-spacing: .035em;
  line-height: 1.9;
}

.home-company {
  overflow: hidden;
  background: #151617;
  color: #fffdf8;
}

.home-company__inner {
  display: grid;
  min-height: clamp(28rem, 56vw, 43rem);
  grid-template-columns: minmax(0, .82fr) minmax(22rem, 1.18fr);
  align-items: stretch;
  color: inherit;
  text-decoration: none;
}

.home-company__copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(2.5rem, 6vw, 6rem);
}

.home-company .eyebrow {
  color: #f2cf8e;
}

.home-company h2 {
  margin: 0 0 clamp(2rem, 5vw, 4rem);
  color: #fffdf8;
  font-size: clamp(2rem, 4.6vw, 4.4rem);
  line-height: 1.16;
}

.home-company h2 span {
  display: block;
}

.home-company .text-link {
  color: #fffdf8;
}

.home-company__image {
  min-height: 28rem;
  background:
    linear-gradient(90deg, #151617 0%, rgb(21 22 23 / 14%) 34%, rgb(21 22 23 / 12%) 100%),
    url("../images/company/company-hero.jpg") center / cover no-repeat;
  filter: saturate(.7) contrast(1.06);
  transition: filter .6s ease, transform .8s cubic-bezier(.22, 1, .36, 1);
}

.home-company__inner:hover .home-company__image {
  filter: saturate(.9) contrast(1.08);
  transform: scale(1.015);
}

@media (min-width: 64rem) {
  .home-company__copy {
    z-index: 2;
    padding-right: 0;
  }

  .home-company h2 {
    position: relative;
    width: max-content;
    max-width: none;
  }

  .home-company h2 span {
    white-space: nowrap;
  }
}

@media (max-width: 47.99rem) {
  .home-story__backdrop {
    top: 4rem;
  }

  .home-story__image {
    inset: -4rem -24%;
  }

  .home-story__image--gym {
    background-position: 58% center;
  }

  .home-story__image--design {
    background-position: 56% center;
  }

  .home-story__image--store {
    background-position: 56% center;
  }

  .home-story__backdrop::before {
    background:
      linear-gradient(180deg, rgb(10 12 11 / 52%) 0%, rgb(10 12 11 / 26%) 38%, rgb(10 12 11 / 76%) 100%),
      linear-gradient(90deg, rgb(10 12 11 / 48%), transparent 80%);
  }

  .story-panel::before,
  .story-panel--right::before,
  .story-panel--left::before,
  .story-panel--mission::before {
    background: linear-gradient(180deg, transparent 12%, rgb(8 10 9 / 18%) 40%, rgb(8 10 9 / 72%) 100%);
  }

  .story-panel__inner,
  .story-panel__inner--end {
    align-items: flex-end;
    justify-content: flex-start;
    padding-top: 6rem;
    padding-bottom: clamp(5rem, 12vh, 7rem);
  }

  .story-panel--hero .story-panel__inner {
    align-items: center;
  }

  .story-panel h1 {
    font-size: clamp(2rem, 8.8vw, 3.6rem);
    line-height: 1.12;
  }

  .story-panel--hero h1 span {
    white-space: nowrap;
  }

  .story-panel h2,
  .story-panel--right h2 {
    font-size: clamp(1.8rem, 8vw, 2.65rem);
    line-height: 1.32;
  }

  .story-panel__content--mission {
    padding: 0;
  }

  .mission-copy p {
    font-size: .84rem;
    line-height: 1.85;
  }

  .mission-copy .mission-copy__conclusion {
    font-size: clamp(1rem, 4.5vw, 1.22rem);
    line-height: 1.6;
  }

  .home-company__inner {
    min-height: 40rem;
    grid-template-columns: 1fr;
  }

  .home-company__copy {
    min-height: 23rem;
    padding: 2.25rem 1rem 2.75rem;
  }

  .home-company__image {
    min-height: 18rem;
    background-image:
      linear-gradient(180deg, #151617 0%, rgb(21 22 23 / 8%) 30%, rgb(21 22 23 / 14%) 100%),
      url("../images/company/company-hero.jpg");
  }

  .works-intro {
    margin-right: 0;
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-story__image {
    transform: scale(1.04);
    transition: none;
    will-change: auto;
  }

  .js-enabled .story-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .story-scroll i::after {
    animation: none;
    transform: none;
  }

  .home-company__image {
    transition: none;
  }
}

@media (min-width: 64rem) {
  .story-panel h1 { font-size: clamp(4.4rem, 6vw, 5.4rem); }
  .story-panel h2 { font-size: clamp(3.1rem, 4.3vw, 4rem); }
  .story-panel--right h2 { font-size: clamp(2.7rem, 3.5vw, 3.2rem); }
  .home-company h2 { font-size: clamp(2.8rem, 3.8vw, 3.5rem); }
}
