/* KuarkTek — the case study page. One layout for every project; the only
   thing that changes per case is --case-brand, which assets/js/work-cases.js
   sets from the manifest before the page paints. */
:root {
  /* every case sets its own; assets/js/work-cases.js writes it from the
     manifest before the page paints, so the curtain that brought you here and
     the page you land on are the same colour */
  --case-brand: #15ff8b;
  --portfolio-line: rgba(31, 37, 43, .5);
}

body.portfolio-page {
  min-width: 320px;
  overflow-x: hidden;
  background: var(--case-brand);
  color: var(--ink);
}

.portfolio-page main {
  min-height: 100vh;
  min-height: 100svh;
  padding-top: var(--space-150);
  padding-bottom: var(--space-90);
}

/* the case study runs full width by design — it is a gallery, not a column of
   text, so it is not held to the home page's measure */
.portfolio-shell {
  width: calc(100% - 60px);
  margin-inline: auto;
}

.portfolio-hero {
  margin-bottom: var(--space-60);
}

.portfolio-hero h1 {
  max-width: 100%;
  margin: 0;
  color: var(--ink);
  font-size: var(--fs-hero-md);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
  line-height: var(--lh-tight);
  text-align: left;
}

.portfolio-overview__line {
  --hero-section-line-color: var(--portfolio-line);
}

.portfolio-overview__meta {
  display: flex;
  min-height: 40px;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-30);
  margin-bottom: 14px;
}

.portfolio-overview__meta-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--gap-2);
}

.portfolio-overview__label {
  margin: 0;
  font-size: var(--fs-tag);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-normal);
  line-height: var(--lh-heading);
  text-transform: uppercase;
}

.portfolio-overview__pill {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: rgba(31, 37, 43, .1);
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-normal);
  line-height: var(--lh-none);
  text-transform: uppercase;
}

.portfolio-video {
  position: relative;
  width: 100%;
  max-height: calc(100svh - 60px);
  overflow: hidden;
  border-radius: var(--r-lg);
  aspect-ratio: 16 / 9;
}

.portfolio-video video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portfolio-summary {
  max-width: 80%;
  margin: var(--space-90) 0 0;
  color: var(--ink);
  font-size: var(--fs-display-lg);
  /* the same weight and leading the home page gives a section heading — 800 at
     1.0 is the wordmark's setting, not a sentence's */
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
  line-height: var(--lh-display);
  text-indent: 15%;
  padding-bottom: var(--space-60);
}

.portfolio-about {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  /* the paragraph ran into the spec table on the right; this is the air
     between the two halves, not the gutter between grid columns */
  column-gap: clamp(30px, 4vw, 90px);
  padding-top: 30px;
  border-top: 1px solid var(--portfolio-line);
}

.portfolio-about .section-label { grid-column: 1 / 3; }

.portfolio-page h5.section-label .section-label__icon {
  display: inline-block;
  background: var(--ink);
}

.portfolio-page h5.section-label .section-label__icon::before,
.portfolio-page h5.section-label .section-label__icon::after {
  background: var(--white);
}

.portfolio-about__content {
  grid-column: 3 / 9;
  display: flex;
  flex-direction: column;
  gap: var(--space-30);
  max-width: 800px;
}

.portfolio-about__lead {
  margin: 0;
  color: var(--ink);
  font-size: var(--fs-h2);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-snug);
  line-height: var(--lh-text);
}

.portfolio-about__paragraph {
  max-width: 720px;
  margin: 0;
  color: var(--ink);
  font-size: var(--fs-lead);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-snug);
  line-height: var(--lh-body);
}

.portfolio-features__table {
  grid-column: 9 / 13;
  align-self: start;
  width: calc(100% + 20px);
  margin: 0 0 0 -20px;
  border-bottom: 1px solid var(--portfolio-line);
}

.portfolio-features__row {
  display: grid;
  min-height: 60px;
  grid-template-columns: minmax(150px, .7fr) minmax(0, 1.3fr);
  gap: var(--space-30);
  border-top: 1px solid var(--portfolio-line);
  align-items: center;
}

.portfolio-features__row:first-child { border-top: 0; }

.portfolio-features__term {
  display: flex;
  align-items: center;
  gap: var(--gap-2);
  color: var(--ink);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-normal);
  line-height: var(--lh-text);
}

.portfolio-features__value {
  margin: 0;
  color: var(--ink);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-snug);
  line-height: var(--lh-body);
  text-align: right;
}

.portfolio-features__scope {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--gap-1) var(--gap-3);
}

.portfolio-features__scope span:not(:first-child)::before {
  margin-right: 10px;
  color: rgba(31, 37, 43, .24);
  content: "/";
}

.verte-opening-pair,
.verte-motion-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-30);
}

.verte-product-pair {
  display: grid;
  grid-template-columns: minmax(280px, .72fr) minmax(0, 1.58fr);
  gap: var(--space-30);
  padding-bottom: var(--space-30);
}

.verte-opening-pair {
  margin-top: var(--space-120);
}

.verte-opening-pair__left-card,
.verte-opening-pair__right-card,
.verte-product-pair__right-card,
.verte-motion-pair__left-card,
.verte-motion-pair__content-card {
  min-width: 0;
  min-height: 600px;
  overflow: hidden;
  border-radius: var(--r-lg);
}

.verte-opening-pair__left-card,
.verte-opening-pair__right-card,
.verte-product-pair__right-card,
.verte-motion-pair__left-card {
  background: rgba(31, 37, 43, .08);
}

.verte-product-pair__visual-card {
  display: grid;
  min-width: 0;
  min-height: 600px;
  grid-template-rows: auto minmax(0, 1fr);
  gap: var(--space-60);
}

.verte-product-pair__paragraph {
  margin: 0;
  padding: 60px 0 0 0;
  color: var(--ink);
  font-size: var(--fs-h3);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-snug);
  line-height: var(--lh-body);
  max-width: 410px;
}

.verte-product-pair__visual {
  min-height: 0;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: rgba(31, 37, 43, .08);
}

.verte-opening-pair__left-image,
.verte-motion-pair__left-image,
.verte-product-pair__right-image,
.verte-quaternary-media__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.verte-opening-pair__right-video,
.verte-product-pair__visual-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.verte-motion-pair__content-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-30);
  background: var(--white);
}

.verte-motion-pair__kicker p {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-normal);
  line-height: var(--lh-text);
}

.verte-motion-pair__description {
  display: flex;
  flex: 1;
  align-items: flex-end;
}

.verte-motion-pair__description h3 {
  max-width: 100%;
  margin: 0;
  color: var(--ink);
  font-size: var(--fs-h1);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-snug);
  line-height: var(--lh-heading);
}

.verte-vision {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(15px, 1.4vw, 30px);
  padding-top: var(--space-150);
  padding-bottom: var(--space-150);
}

.verte-vision__content {
  grid-column: 3 / 12;
  display: flex;
  max-width: 1080px;
  flex-direction: column;
  gap: var(--space-30);
}

.verte-vision__content .section-label {
  align-items: flex-start;
}

.verte-vision__lead {
  max-width: 720px;
  margin: 0;
  color: var(--ink);
  font-size: var(--fs-h2);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-snug);
  line-height: var(--lh-text);
}

.verte-vision__lead_big {
  max-width: 900px;
  margin: 0;
  color: var(--ink);
  font-size: var(--fs-display-sm);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-snug);
  line-height: var(--lh-heading);
}

.verte-experience {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(15px, 1.4vw, 30px);
  padding-top: var(--space-150);
  padding-bottom: var(--space-150);
}

.verte-experience__content {
  grid-column: 3 / 12;
  display: flex;
  max-width: 900px;
  flex-direction: column;
  gap: var(--space-30);
}

.verte-experience__content .section-label {
  align-items: flex-start;
}

.verte-experience__lead {
  max-width: 900px;
  margin: 0;
  color: var(--ink);
  font-size: var(--fs-display-sm);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-snug);
  line-height: var(--lh-heading);
}

.verte-secondary-media {
  margin-top: 0;
  padding-bottom: var(--space-150);
}

.verte-secondary-media__frame {
  position: relative;
  width: 100%;
  max-height: calc(100svh - 60px);
  overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--ink);
  aspect-ratio: 16 / 9;
}

.verte-secondary-media__video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.verte-tertiary-media__frame {
  position: relative;
  width: 100%;
  max-height: calc(100svh - 60px);
  overflow: hidden;
  border-radius: var(--r-lg);
  aspect-ratio: 16 / 9;
}

.verte-tertiary-media__video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.verte-quaternary-media {
  display: grid;
  grid-template-columns: minmax(180px, .4fr) minmax(0, 1.6fr);
  gap: var(--space-30);
  margin-top: var(--space-30);
}

.verte-quaternary-media__text {
  display: flex;
  min-width: 0;
  align-items: flex-end;
  padding-bottom: 30px;
}

.verte-quaternary-media__paragraph {
  max-width: 360px;
  margin: 0;
  padding: 0;
  color: var(--ink);
  font-size: var(--fs-h3);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-snug);
  line-height: var(--lh-body);
}

.verte-quaternary-media__frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: var(--r-lg);
  aspect-ratio: 16 / 9;
}

.next-case-study {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding-top: var(--space-60);
  padding-bottom: var(--space-60);
  color: var(--ink);
}

.next-case-study__ticker {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 0;
  width: 100vw;
  overflow: hidden;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.next-case-study__ticker-track {
  display: flex;
  width: max-content;
  animation: next-case-ticker 24s linear infinite;
  will-change: transform;
}

.next-case-study__ticker-text {
  flex: 0 0 auto;
  padding-right: .18em;
  color: var(--ink);
  font-size: clamp(var(--fs-hero), 13vw, var(--fs-hero-lg));
  font-weight: var(--fw-display);
  letter-spacing: var(--ls-tight);
  line-height: var(--lh-tight);
  white-space: nowrap;
}

.next-case-study__link {
  position: relative;
  z-index: 1;
  display: block;
  width: min(52vw, 760px);
  margin: var(--space-120) auto 0;
  color: var(--ink);
  text-decoration: none;
}

.next-case-study__visual {
  position: relative;
}

.next-case-study__image-frame {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: rgba(31, 37, 43, .08);
  aspect-ratio: 1 / 1;
}

.next-case-study__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .65s cubic-bezier(.2, .75, .25, 1);
}

.next-case-study__link:hover .next-case-study__image,
.next-case-study__link:focus-visible .next-case-study__image {
  transform: scale(1.035);
}

.portfolio-page [data-distortion] {
  position: relative;
  isolation: isolate;
}

.portfolio-page [data-distortion]::after {
  position: absolute;
  inset: 0;
  z-index: 3;
  border: 1px solid var(--case-brand);
  border-radius: inherit;
  content: "";
  pointer-events: none;
}

.portfolio-page [data-distortion] > img:not(.project__distortion-layer),
.portfolio-page [data-distortion] > video {
  width: calc(100% + 2px);
  max-width: none;
  height: calc(100% + 2px);
  margin: -1px;
  transition: transform .6s cubic-bezier(.2, .65, .2, 1);
  will-change: transform;
}

.portfolio-page [data-distortion]:hover > img:not(.project__distortion-layer),
.portfolio-page [data-distortion]:hover > video,
.portfolio-page [data-distortion]:hover > .project__distortion-canvas {
  transform: scale(1.025);
}

.portfolio-page [data-distortion] > .project__distortion-canvas {
  border-radius: inherit;
  transform: scale(1.002);
}

.next-case-study__title {
  margin: var(--space-30) 0 0;
  color: var(--ink);
  font-size: var(--fs-h3);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-snug);
  line-height: var(--lh-tight);
  text-align: left;
}

.next-case-study__sr-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

@keyframes next-case-ticker {
  to { transform: translateX(-33.3333%); }
}

.portfolio-hero h1,
.portfolio-overview__meta,
.portfolio-video,
.portfolio-summary {
  animation: portfolio-enter .8s cubic-bezier(.2, .75, .25, 1) both;
}

/* These four are deliberately not handed to GSAP: they are the first thing on
   screen, and this animation runs on the first paint with nothing to wait for.
   The scroll choreography starts below them. */

.portfolio-overview__meta { animation-delay: .08s; }
.portfolio-video { animation-delay: .14s; }
.portfolio-summary { animation-delay: .2s; }

@keyframes portfolio-enter {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1024px) {
  .portfolio-page main {
    padding-top: var(--space-150);
    padding-bottom: var(--space-90);
  }

  .portfolio-hero h1 { font-size: clamp(var(--fs-display-xl), 12vw, var(--fs-hero-md)); }
  .portfolio-about__content { grid-column: 4 / 13; }
  .verte-vision__content { grid-column: 4 / 13; }
  .verte-experience__content { grid-column: 4 / 13; }
  .portfolio-features__table {
    grid-column: 4 / 13;
    grid-row: 2;
    width: 100%;
    margin-left: 0;
    margin-top: var(--space-90);
  }

  .verte-opening-pair__left-card,
  .verte-opening-pair__right-card,
  .verte-product-pair__right-card,
  .verte-motion-pair__left-card,
  .verte-motion-pair__content-card { min-height: 500px; }

  .verte-product-pair__visual-card { min-height: 500px; }
}

@media (max-width: 700px) {
  .portfolio-page main {
    /* the fixed header is 64px tall here, so 64px of padding puts the title
       right up against it */
    padding-top: var(--space-120);
    padding-bottom: var(--space-90);
  }

  .portfolio-hero { margin-bottom: var(--space-30); }
  .portfolio-hero h1 {
    font-size: clamp(var(--fs-display-lg), 19vw, var(--fs-hero));
    letter-spacing: var(--ls-tight);
    line-height: var(--lh-tight);
  }

  .portfolio-overview__meta {
    min-height: 0;
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: var(--space-30);
  }

  .portfolio-video {
    border-radius: var(--r-md);
    aspect-ratio: 4 / 5;
  }

  .portfolio-summary {
    margin-top: var(--space-30);
    font-size: var(--fs-display-sm);
    letter-spacing: var(--ls-tight);
  }

  .portfolio-about {
    display: flex;
    flex-direction: column;
    gap: var(--space-60);
    padding-top: 15px;
  }

  .portfolio-about__content { gap: var(--space-30); }
  .portfolio-about__lead { font-size: var(--fs-h3); }
  .portfolio-about__paragraph { font-size: var(--fs-body); }
  .portfolio-features__table { width: 100%; margin-top: 0; }

  .portfolio-features__row {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: var(--gap-3);
    padding: 24px 0;
  }

  .portfolio-features__value { text-align: left; }
  .portfolio-features__scope { justify-content: flex-start; }

  .verte-vision {
    display: block;
    padding-top: var(--space-90);
    padding-bottom: var(--space-90);
  }

  .verte-vision__lead { font-size: var(--fs-h3); }

  .verte-experience {
    display: block;
    padding-top: var(--space-90);
    padding-bottom: var(--space-90);
  }

  .verte-experience__lead { font-size: var(--fs-h3); }

  .verte-opening-pair,
  .verte-product-pair,
  .verte-motion-pair {
    grid-template-columns: 1fr;
    gap: var(--space-30);
  }

  .verte-product-pair__visual-card {
    min-height: 0;
    grid-template-rows: auto minmax(320px, 1fr);
  }

  .verte-opening-pair__left-card,
  .verte-opening-pair__right-card,
  .verte-product-pair__right-card,
  .verte-motion-pair__left-card,
  .verte-motion-pair__content-card { min-height: 420px; }
  .verte-product-pair__visual { border-radius: var(--r-md); }
  .verte-motion-pair__content-card { padding: 24px; }
  .verte-motion-pair__description h3 { font-size: var(--fs-h2); }
  .verte-secondary-media__frame {
    border-radius: var(--r-md);
    aspect-ratio: 4 / 5;
  }

  .verte-tertiary-media__frame {
    border-radius: var(--r-md);
    aspect-ratio: 4 / 5;
  }

  .verte-quaternary-media__frame {
    border-radius: var(--r-md);
    aspect-ratio: 4 / 5;
  }

  .verte-quaternary-media {
    grid-template-columns: 1fr;
    gap: var(--space-30);
  }

  .verte-quaternary-media__paragraph {
    max-width: 100%;
    font-size: var(--fs-h4);
  }

  .next-case-study__ticker-text {
    font-size: clamp(var(--fs-display-xl), 20vw, var(--fs-hero-md));
  }

  .next-case-study__link {
    width: calc(100% - 60px);
    margin-top: var(--space-90);
  }

  .next-case-study__image-frame { border-radius: var(--r-md); }
}

@media (prefers-reduced-motion: reduce) {
  .portfolio-hero h1,
  .portfolio-overview__meta,
  .portfolio-video,
  .portfolio-summary { animation: none; }

  .next-case-study__ticker-track { animation: none; }
}
