/* Case study pages. Loaded after styles.css. */
.cs-page {
  --cs-font: "Albert Sans", system-ui, -apple-system, sans-serif;
  --cs-accent: #4884fa;
  --cs-text: #1a1a1a;
  font-family: var(--cs-font);
  color: var(--cs-text);
  font-size: 16px;
}
.cs-page .nav__links { font-size: 16px; font-weight: 400; }
.cs-page .nav__links a:hover,
.cs-page .footer a:hover { color: var(--cs-accent); }
.cs-page a { color: inherit; }

/* Type scale (from the case study's design settings) */
.cs h1 { margin: 0 0 16px; font-size: 44px; font-weight: 400; line-height: 1.15; }
.cs h2 { margin: 0 0 16px; font-size: 36px; font-weight: 400; line-height: 1.2; }
.cs h3 { margin: 0 0 16px; font-size: 28px; font-weight: 400; line-height: 1.25; }
.cs h4 { margin: 0 0 12px; font-size: 24px; font-weight: 400; line-height: 1.3; }
.cs p { margin: 0 0 16px; font-size: 16px; line-height: 1.6; }
.cs strong { font-weight: 600; }
.cs ul, .cs ol { margin: 0 0 16px; padding-left: 1.3em; }
.cs li { margin-bottom: 6px; }
.cs li p { margin: 0; }
.cs > section :last-child > p:last-child { margin-bottom: 0; }

/* 12-column grid; modules place themselves with --col */
.cs-sec { position: relative; }
.cs-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 32px;
  row-gap: 32px;
  align-items: start;
}
.cs-grid > * { grid-column: var(--col, 1 / -1); min-width: 0; }
.cs-grid--row > * { grid-row: 1; align-self: center; }

/* Hero */
.cs-hero { display: flex; align-items: center; }
.cs-hero > .wrap { width: 100%; }
.cs-hero h1 { font-size: 60px; line-height: 1.1; margin-bottom: 20px; }
.cs-hero h2 { font-size: 44px; line-height: 1.15; margin: 0; }

/* Figures */
.cs figure { margin: 0; }
.cs figure img { display: block; width: 100%; height: auto; }
.cs figcaption {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  color: #6b6b6b;
}
.cs figcaption p { margin: 0; font-size: inherit; }
.cs [data-zoom] { cursor: zoom-in; }

.cs-media--small  { --col: 4 / 10; }
.cs-media--medium { --col: 2 / 12; }
.cs-media--large,
.cs-media--cover,
.cs-media--default { --col: 1 / -1; }
.cs-bleed figure img { width: 100%; }
.cs-bleed figcaption { padding: 0 var(--gutter); }

.video { position: relative; aspect-ratio: 16 / 9; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Device frames */
.frame { position: relative; margin: 0 auto; }
.frame--shadow .frame__body { box-shadow: 0 24px 60px rgba(15, 20, 40, .22); }
.frame__screen { overflow: hidden; background: #fff; }

.frame--browser .frame__body { overflow: hidden; }
.frame--browser.frame--rounded .frame__body { border-radius: 10px; }
.frame__bar {
  display: flex;
  gap: 6px;
  align-items: center;
  height: 26px;
  padding: 0 12px;
  background: #2c2c30;
}
.frame--light .frame__bar { background: #e8e8eb; }
.frame__bar i { width: 9px; height: 9px; border-radius: 50%; background: #ff5f57; }
.frame__bar i:nth-child(2) { background: #febc2e; }
.frame__bar i:nth-child(3) { background: #28c840; }

.frame--desktop.frame--semi-realistic .frame__body,
.frame--desktop.frame--simple .frame__body {
  padding: 2.2% 2.2% 2.6%;
  background: #1c1c1e;
  border-radius: 14px 14px 0 0;
}
.frame--desktop.frame--light.frame--semi-realistic .frame__body { background: #d9d9de; }
.frame--desktop.frame--semi-realistic::after,
.frame--desktop.frame--simple::after {
  content: "";
  display: block;
  height: 14px;
  margin: 0 -7%;
  background: linear-gradient(#c9c9ce, #9c9ca2);
  border-radius: 0 0 14px 14px;
}

.frame--mobile { max-width: 340px; }
.frame--mobile .frame__body { padding: 10px; background: #1c1c1e; border-radius: 40px; }
.frame--mobile.frame--light .frame__body { background: #e4e4e8; }
.frame--mobile .frame__screen { border-radius: 30px; }

.frame--tablet { max-width: 520px; }
.frame--tablet .frame__body { padding: 16px; background: #1c1c1e; border-radius: 28px; }
.frame--tablet .frame__screen { border-radius: 12px; }

/* Divider */
.cs-rule { margin: 0; border: 0; border-top: 1px solid rgba(0, 0, 0, .18); }

/* Gallery */
.gallery { position: relative; }
.gallery__track {
  display: flex;
  gap: 32px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__track > figure {
  flex: 0 0 100%;
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.gallery__track > figure img { width: auto; max-width: 100%; max-height: 70vh; }
.gallery--carousel .gallery__track > figure { flex-basis: calc((100% - 64px) / 3); }

.gallery__btn {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  z-index: 1;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #0f0f0f;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .16);
  cursor: pointer;
  transition: opacity .2s, background .2s;
}
.gallery__btn:hover { background: #eee; }
.gallery__btn[disabled] { opacity: 0; pointer-events: none; }
.gallery__btn--prev { left: -24px; }
.gallery__btn--next { right: -24px; }
.gallery__dots { display: flex; justify-content: center; gap: 8px; margin-top: 20px; }
.gallery__dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .2);
  cursor: pointer;
}
.gallery__dots button[aria-current="true"] { background: #0f0f0f; }

.gallery--grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  align-items: start;
}

/* Testimonial */
.cs-quote { --col: 3 / 11; text-align: center; }
.cs-quote blockquote { margin: 0; }
.cs-quote figcaption { color: inherit; font-size: 16px; }

/* Read more */
.cs-related h3 { margin: 0 0 40px; text-align: center; font-size: 28px; font-weight: 400; }
.cs-related .projects { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px 32px; padding-bottom: 0; }
.cs-related .card__title { font-size: 20px; font-weight: 400; }
.cs-related .card__subtitle { font-size: 15px; }

/* Lightbox */
.lightbox {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(10, 10, 12, .94);
  color: #fff;
}
.lightbox::backdrop { background: transparent; }
.lightbox__stage {
  position: absolute;
  inset: 56px 72px 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.lightbox__stage img { max-width: 100%; max-height: calc(100% - 40px); object-fit: contain; }
.lightbox__caption { font-family: var(--cs-font); font-size: 14px; text-align: center; color: #d6d6d6; }
.lightbox__count { position: absolute; top: 18px; left: 24px; font-size: 14px; color: #bbb; }
.lightbox button {
  position: absolute;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  cursor: pointer;
}
.lightbox button:hover { background: rgba(255, 255, 255, .24); }
.lightbox__close { top: 12px; right: 16px; }
.lightbox__prev, .lightbox__next { top: 50%; translate: 0 -50%; }
.lightbox__prev { left: 16px; }
.lightbox__next { right: 16px; }
.lightbox button[hidden] { display: none; }

@media (max-width: 900px) {
  .cs h1, .cs-hero h1 { font-size: 40px; }
  .cs-hero h2, .cs h2 { font-size: 28px; }
  .cs h3 { font-size: 24px; }
  .cs h4 { font-size: 20px; }
  .cs-grid > * { grid-column: 1 / -1; }
  .cs-grid--row > * { grid-row: auto; }
  .cs-grid--row > .cs-text-col { order: -1; }
  .cs-hero { min-height: 0 !important; }
  .gallery__btn--prev { left: 8px; }
  .gallery__btn--next { right: 8px; }
  .gallery--carousel .gallery__track > figure { flex-basis: 80%; }
  .gallery--grid, .cs-related .projects { grid-template-columns: 1fr; }
  .lightbox__stage { inset: 56px 12px 72px; }
  .lightbox__prev, .lightbox__next { top: auto; bottom: 14px; translate: none; }
}


@media (max-width: 760px) {
  .cs-page .nav .nav__links { font-size: 20px; }
}

.video__link { color: var(--cs-accent); font-weight: 600; text-decoration: none; }
.video__link:hover { text-decoration: underline; }

/* Header stays pinned to the top while scrolling. It spans the full width
   (content still aligned to the page container) with a solid background so
   the page doesn't show through as it scrolls underneath. */
.cs-page .nav {
  position: sticky;
  top: 0;
  z-index: 50;
  max-width: none;
  padding-left: max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter)));
  padding-right: max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter)));
  background: #fff;
  border-bottom: 1px solid var(--line);
}

/* Hidden while scrolling down; slides back in when scrolling up (see nav.js) */
.cs-page .nav { transition: transform .25s ease; }
.cs-page .nav.is-hidden { transform: translateY(-100%); }
@media (prefers-reduced-motion: reduce) {
  .cs-page .nav { transition: none; }
}
