/* Homepage scroll story */
.timeline-mode .product-spotlight,
.timeline-mode .proof,
.timeline-mode .brands,
.timeline-mode .about,
.timeline-mode .services,
.timeline-mode .showreel,
.timeline-mode .case-studies,
.timeline-mode .testimonials,
.timeline-mode .skills {
  display: none;
}

.scroll-story {
  --story-gutter: max(32px, calc((100vw - 1240px) / 2));
  position: relative;
  z-index: 2;
  overflow: clip;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    #070907;
  background-size: 25% 100%, auto;
}

.scroll-story::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 78% 13%, rgba(64, 192, 255, 0.1), transparent 20%),
    radial-gradient(circle at 20% 49%, rgba(255, 87, 164, 0.08), transparent 18%),
    radial-gradient(circle at 75% 80%, rgba(255, 184, 76, 0.07), transparent 20%);
}

.story-intro {
  display: grid;
  grid-template-columns: 150px minmax(0, 840px);
  gap: 48px;
  align-items: start;
  width: min(1240px, calc(100% - 64px));
  min-height: 72vh;
  margin: 0 auto;
  padding: 140px 0 104px;
  border-bottom: 1px solid rgba(244, 239, 230, 0.13);
}

.story-intro-index,
.story-meta,
.story-rail-label {
  font-family: "Sora", sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.story-intro-index {
  padding-top: 10px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.story-intro h2 {
  max-width: 820px;
  margin-top: 13px;
  font-family: "Bebas Neue", sans-serif;
  font-size: 76px;
  font-weight: 400;
  line-height: 0.94;
}

.story-intro > div > p:last-child {
  max-width: 670px;
  margin-top: 26px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.story-shell {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 38px;
  width: min(1240px, calc(100% - 64px));
  margin: 0 auto;
}

.story-rail {
  position: sticky;
  top: 88px;
  align-self: start;
  height: calc(100vh - 116px);
  padding: 12px 0 20px 28px;
}

.story-rail-label {
  display: block;
  margin-bottom: 34px;
  color: rgba(244, 239, 230, 0.44);
}

.story-track {
  position: absolute;
  top: 56px;
  bottom: 26px;
  left: 4px;
  width: 2px;
  overflow: hidden;
  background: rgba(244, 239, 230, 0.14);
}

.story-track::before {
  content: "";
  position: absolute;
  top: 0;
  left: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 20px rgba(191, 255, 87, 0.68);
}

.story-track-progress {
  display: block;
  width: 100%;
  height: calc(var(--story-progress, 0) * 100%);
  background: linear-gradient(180deg, var(--accent), #3fbfff 44%, #ff57a4 72%, #ffb84c);
  box-shadow: 0 0 16px rgba(191, 255, 87, 0.34);
  transition: height 80ms linear;
}

.story-rail ol {
  display: grid;
  gap: 7px;
  list-style: none;
}

.story-rail a {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  color: rgba(244, 239, 230, 0.4);
  font-size: 11px;
  font-weight: 600;
  transition: color 180ms ease, transform 180ms ease;
}

.story-rail a::before {
  content: "";
  position: absolute;
  left: 0;
  width: 10px;
  height: 1px;
  background: currentColor;
  transform: translateX(-28px);
  transition: width 180ms ease, background-color 180ms ease;
}

.story-rail a span {
  color: rgba(244, 239, 230, 0.25);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.story-rail a:hover,
.story-rail a.is-active {
  color: var(--text);
  transform: translateX(3px);
}

.story-rail a.is-active::before {
  width: 18px;
  background: var(--accent);
}

.story-rail a.is-active span {
  color: var(--accent);
}

.story-chapters {
  min-width: 0;
}

.story-chapter {
  --chapter-accent: var(--accent);
  display: grid;
  grid-template-columns: minmax(300px, 0.88fr) minmax(340px, 1.12fr);
  gap: 72px;
  align-items: center;
  min-height: 100vh;
  padding: 92px 0;
  border-bottom: 1px solid rgba(244, 239, 230, 0.11);
  opacity: 0.34;
  transform: scale(0.986);
  transform-origin: center center;
  transition: opacity 420ms ease, transform 520ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.story-chapter.is-active {
  opacity: 1;
  transform: none;
}

.story-chapter-product {
  --chapter-accent: #bfff57;
}

#moment-kwv {
  --chapter-accent: #4cc9ff;
}

#moment-luminare {
  --chapter-accent: #ff57a4;
}

#moment-designer {
  --chapter-accent: #ffb84c;
}

#moment-castello {
  --chapter-accent: #a98bff;
}

.story-chapter-process {
  --chapter-accent: #68e39b;
}

.story-chapter-reverse .story-copy {
  order: 2;
}

.story-chapter-reverse .story-media {
  order: 1;
  margin-right: auto;
  margin-left: 4%;
}

.story-copy {
  position: relative;
  z-index: 2;
  min-width: 0;
}

.story-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-bottom: 32px;
  color: rgba(244, 239, 230, 0.42);
}

.story-meta span:first-child {
  color: var(--chapter-accent);
  font-variant-numeric: tabular-nums;
}

.story-overline {
  margin-bottom: 12px;
  color: var(--chapter-accent);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.story-copy h3 {
  max-width: 650px;
  font-family: "Bebas Neue", sans-serif;
  font-size: 58px;
  font-weight: 400;
  line-height: 0.98;
}

.story-copy > p:not(.story-overline) {
  max-width: 580px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.78;
}

.story-copy blockquote {
  max-width: 500px;
  margin-top: 28px;
  padding-left: 18px;
  border-left: 2px solid var(--chapter-accent);
  color: rgba(244, 239, 230, 0.86);
  font-size: 16px;
  font-style: normal;
  line-height: 1.6;
}

.story-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}

.story-tags span {
  padding: 8px 11px;
  border: 1px solid rgba(244, 239, 230, 0.15);
  border-radius: 4px;
  color: rgba(244, 239, 230, 0.65);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.story-action {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-top: 30px;
  padding: 0 16px;
  border: 1px solid color-mix(in srgb, var(--chapter-accent) 48%, transparent);
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.story-action span {
  color: var(--chapter-accent);
  font-size: 15px;
}

.story-action:hover,
.story-action:focus-visible {
  border-color: var(--chapter-accent);
  background: var(--chapter-accent);
  color: #070907;
  transform: translateY(-2px);
  outline: none;
}

.story-action:hover span,
.story-action:focus-visible span {
  color: #070907;
}

.story-media {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin: 0;
  border: 1px solid rgba(244, 239, 230, 0.16);
  border-radius: 6px;
  background: #0b0d0b;
  box-shadow: 0 38px 90px rgba(0, 0, 0, 0.42);
}

.story-media::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  border: 1px solid transparent;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--chapter-accent) 20%, transparent);
}

.story-media::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -14%;
  bottom: -12%;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--chapter-accent);
  opacity: 0.12;
  filter: blur(54px);
}

.story-media img,
.story-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 900ms cubic-bezier(0.2, 0.8, 0.2, 1), filter 420ms ease;
}

.story-chapter:not(.is-active) .story-media img,
.story-chapter:not(.is-active) .story-media video {
  filter: saturate(0.55) brightness(0.68);
  transform: scale(1.035);
}

.story-media-portrait {
  width: min(100%, 430px);
  aspect-ratio: 9 / 15.5;
  margin-left: auto;
}

.story-media-wide {
  aspect-ratio: 16 / 10;
}

.story-media-wide img {
  object-position: top left;
}

.story-media figcaption,
.story-media-caption {
  position: absolute;
  z-index: 3;
  right: 14px;
  bottom: 14px;
  left: 14px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 4px;
  background: rgba(5, 7, 6, 0.78);
  backdrop-filter: blur(12px);
}

.story-media figcaption b,
.story-media-caption b {
  font-size: 11px;
  text-transform: uppercase;
}

.story-media figcaption small,
.story-media-caption small {
  color: rgba(244, 239, 230, 0.58);
  font-size: 9px;
  text-align: right;
  text-transform: uppercase;
}

.story-chapter-process {
  grid-template-columns: minmax(300px, 0.88fr) minmax(340px, 1.12fr);
}

.story-process-list {
  display: grid;
  list-style: none;
  border-top: 1px solid rgba(244, 239, 230, 0.14);
}

.story-process-list li {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 16px;
  align-items: center;
  min-height: 92px;
  border-bottom: 1px solid rgba(244, 239, 230, 0.14);
  transition: padding-left 180ms ease, background-color 180ms ease;
}

.story-process-list li:hover {
  padding-left: 10px;
  background: rgba(104, 227, 155, 0.035);
}

.story-process-list > li > span {
  color: var(--chapter-accent);
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.story-process-list div {
  display: grid;
  gap: 5px;
}

.story-process-list b {
  font-family: "Bebas Neue", sans-serif;
  font-size: 28px;
  font-weight: 400;
}

.story-process-list small {
  color: var(--muted);
  font-size: 12px;
}

.timeline-mode .contact {
  position: relative;
  z-index: 2;
  border-top: 0;
}

@media (max-width: 1020px) {
  .story-intro,
  .story-shell {
    width: min(100% - 40px, 920px);
  }

  .story-intro {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 28px;
  }

  .story-shell {
    grid-template-columns: 116px minmax(0, 1fr);
    gap: 24px;
  }

  .story-chapter {
    grid-template-columns: minmax(260px, 0.95fr) minmax(280px, 1.05fr);
    gap: 36px;
  }

  .story-copy h3 {
    font-size: 48px;
  }

  .story-media-portrait {
    width: min(100%, 370px);
  }
}

@media (max-width: 760px) {
  .scroll-story {
    background-size: 50% 100%, auto;
  }

  .story-intro {
    grid-template-columns: 1fr;
    gap: 18px;
    width: calc(100% - 32px);
    min-height: 68vh;
    padding: 112px 0 72px;
  }

  .story-intro-index {
    padding-top: 0;
  }

  .story-intro h2 {
    font-size: 52px;
  }

  .story-intro > div > p:last-child {
    font-size: 15px;
  }

  .story-shell {
    display: block;
    width: 100%;
  }

  .story-rail {
    position: sticky;
    z-index: 20;
    top: 62px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    width: 100%;
    height: 54px;
    padding: 0 16px;
    border-top: 1px solid rgba(244, 239, 230, 0.12);
    border-bottom: 1px solid rgba(244, 239, 230, 0.12);
    background: rgba(7, 9, 7, 0.9);
    backdrop-filter: blur(14px);
  }

  .story-rail-label {
    margin: 0;
    color: var(--accent);
  }

  .story-track {
    top: auto;
    right: 16px;
    bottom: 6px;
    left: 16px;
    width: auto;
    height: 2px;
  }

  .story-track::before {
    display: none;
  }

  .story-track-progress {
    width: calc(var(--story-progress, 0) * 100%);
    height: 100%;
    transition: width 80ms linear;
  }

  .story-rail ol {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
  }

  .story-rail li {
    display: none;
  }

  .story-rail li:has(a.is-active) {
    display: block;
  }

  .story-rail a {
    display: flex;
    min-height: auto;
    color: var(--text);
    font-size: 10px;
    pointer-events: none;
  }

  .story-rail a::before {
    display: none;
  }

  .story-rail a span {
    color: var(--accent);
  }

  .story-chapters {
    padding: 0 16px;
  }

  .story-chapter,
  .story-chapter-process {
    grid-template-columns: 1fr;
    gap: 38px;
    min-height: auto;
    padding: 92px 0;
    opacity: 0.5;
  }

  .story-chapter-reverse .story-copy,
  .story-chapter-reverse .story-media {
    order: initial;
  }

  .story-chapter-reverse .story-media {
    margin: 0 auto;
  }

  .story-copy h3 {
    font-size: 44px;
  }

  .story-copy > p:not(.story-overline) {
    font-size: 14px;
  }

  .story-media-portrait {
    width: min(100%, 390px);
    margin: 0 auto;
  }

  .story-media-wide {
    aspect-ratio: 4 / 3;
  }

  .story-media-wide img {
    object-fit: cover;
    object-position: top left;
  }
}

@media (max-width: 460px) {
  .story-intro h2 {
    font-size: 44px;
  }

  .story-copy h3 {
    font-size: 39px;
  }

  .story-meta {
    gap: 8px 12px;
  }

  .story-media figcaption,
  .story-media-caption {
    right: 9px;
    bottom: 9px;
    left: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .story-chapter,
  .story-media img,
  .story-media video,
  .story-track-progress {
    transition: none;
  }

  .story-chapter {
    opacity: 1;
    transform: none;
  }
}
