/* Design tokens from Figma */
:root {
  --color-nav-bg: #d7c0c0;
  --color-white: #ffffff;
  --color-black: #000000;
  --max-content: 1000px;
  --nav-height: 80px;
  --font-montserrat: "Montserrat", sans-serif;
  --font-open-sans: "Open Sans", sans-serif;
  --font-inter: "Inter", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-open-sans);
  background: var(--color-white);
  color: var(--color-black);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.logo {
  font-family: var(--font-montserrat);
  font-weight: 900;
  font-size: 20px;
  line-height: 38px;
  white-space: nowrap;
}

/* Navigation */
.nav {
  background: var(--color-nav-bg);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  flex-shrink: 0;
  font-family: var(--font-montserrat);
}

.nav__inner {
  width: 100%;
  max-width: var(--max-content);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: 50px;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 24px;
  font-family: var(--font-montserrat);
  font-weight: 400;
  font-size: 16px;
  line-height: 38px;
}

.nav__links a {
  font-family: inherit;
  font-weight: inherit;
  font-size: inherit;
  line-height: inherit;
  white-space: nowrap;
}

.nav__links a:hover,
.footer__links a:hover {
  opacity: 0.7;
}

.nav__links a[aria-current="page"] {
  font-weight: 700;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.btn:hover {
  opacity: 0.85;
}

.nav .btn--primary {
  font-family: var(--font-montserrat);
}

.btn--primary {
  font-family: var(--font-inter);
  font-weight: 600;
  font-size: 18px;
  line-height: normal;
  color: var(--color-white);
  background: var(--color-black);
  border-radius: 8px;
  padding: 10px 16px;
  white-space: nowrap;
}

/* Hero */
.hero {
  background: var(--color-white);
  padding: 56px 24px;
  display: flex;
  justify-content: center;
}

.hero__inner {
  width: 100%;
  max-width: var(--max-content);
  padding: 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.hero__title {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
}

.hero__title-lead {
  font-family: var(--font-open-sans);
  font-weight: 800;
  font-size: 35px;
  line-height: 50px;
}

.hero__title-name {
  font-family: var(--font-montserrat);
  font-weight: 700;
  font-size: 35px;
  line-height: 50px;
}

.hero__text {
  font-family: var(--font-open-sans);
  font-weight: 400;
  font-size: 20px;
  line-height: 38px;
  width: 100%;
}

/* Portfolio carousel */
.carousel {
  width: 100%;
  --marquee-duration: 45s;
}

.carousel__viewport {
  width: 100%;
  overflow: hidden;
}

.carousel__viewport:hover .carousel__track {
  animation-play-state: paused;
}

.carousel__track {
  display: flex;
  width: max-content;
  height: 575px;
  will-change: transform;
  animation: marquee-scroll var(--marquee-duration) linear infinite;
}

@keyframes marquee-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .carousel__track {
    animation: none;
  }
}

.carousel__slide {
  flex: 0 0 auto;
  width: min(545px, 85vw);
  height: 575px;
  overflow: hidden;
}

.carousel__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  user-select: none;
}

/* Portfolio grid page */
.portfolio-grid {
  background: var(--color-white);
  padding: 57px 74px;
  display: flex;
  justify-content: center;
  flex: 1;
}

.portfolio-grid__inner {
  width: 100%;
  max-width: var(--max-content);
}

.portfolio-grid__list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  gap: 30px;
}

.portfolio-grid__list > li {
  flex: 0 0 auto;
}

.portfolio-card {
  position: relative;
  display: block;
  width: 236px;
  height: 224px;
  overflow: hidden;
}

.portfolio-card__media {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.portfolio-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s ease;
}

.portfolio-card__media--crop img {
  width: 191.31%;
  height: 134.38%;
  max-width: none;
  object-fit: cover;
  position: relative;
  left: -46.82%;
  top: -17.41%;
}

.portfolio-card__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.portfolio-card__title {
  font-family: var(--font-montserrat);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.2;
  color: var(--color-white);
  text-align: center;
  padding: 12px;
}

.portfolio-card:hover .portfolio-card__overlay,
.portfolio-card:focus-visible .portfolio-card__overlay {
  opacity: 1;
}

.portfolio-card:focus-visible {
  outline: 2px solid var(--color-black);
  outline-offset: 4px;
}

/* Case study pages (e.g. NPLCA) */
.case-study {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.case-study__intro {
  background: var(--color-white);
  padding: 56px 24px;
  display: flex;
  justify-content: center;
}

.case-study__intro-inner {
  width: 100%;
  max-width: var(--max-content);
  padding: 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.case-study__heading {
  font-family: var(--font-montserrat);
  font-weight: 600;
  font-size: 25px;
  line-height: 38px;
  width: 100%;
}

.case-study__copy {
  font-family: var(--font-montserrat);
  font-weight: 400;
  font-size: 20px;
  line-height: 38px;
  width: 100%;
}

.case-study__copy p + p {
  margin-top: 0;
}

.case-study__gallery {
  display: flex;
  flex-direction: column;
  gap: 26px;
  width: 100%;
}

.case-study__row {
  display: flex;
  width: 100%;
  gap: 26px;
}

.case-study__row--duo {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
  align-items: stretch;
}

.case-study__frame {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  line-height: 0;
}

.case-study__row--duo .case-study__frame {
  aspect-ratio: 710 / 636;
  width: 100%;
  position: relative;
}

.case-study__row--duo .case-study__frame img,
.case-study__row--duo .case-study__frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.case-study__row--full .case-study__frame {
  flex: 1 1 100%;
  width: 100%;
}

.case-study__row--full .case-study__frame img {
  width: 100%;
  height: auto;
  display: block;
}

.case-study__row--crop-brochure .case-study__frame {
  aspect-ratio: 1440 / 1224;
  max-height: 1224px;
  position: relative;
}

.case-study__row--crop-brochure .case-study__frame img {
  position: absolute;
  inset: 0;
  width: 114%;
  height: 100%;
  max-width: none;
  left: -7%;
  top: 2.31%;
  object-fit: cover;
  object-position: center;
}

.case-study__frame--banner {
  background: #d1d1d1;
}

.case-study__row--duo .case-study__frame--banner {
  aspect-ratio: auto;
  position: static;
}

.case-study__row--duo .case-study__frame--banner img {
  position: static;
  inset: auto;
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
}

.case-study__row--infographic .case-study__frame {
  background: #eaeaea;
  width: 100%;
}

.case-study__row--infographic .case-study__frame img {
  width: 100%;
  height: auto;
  display: block;
}

/* NPAO-specific image crops */
.case-study__row--crop-npao-print .case-study__frame {
  aspect-ratio: 1440 / 1224;
  max-height: 1224px;
  position: relative;
  background: #d1d1d1;
}

.case-study__row--crop-npao-print .case-study__frame img {
  position: absolute;
  width: 139%;
  height: 109.02%;
  max-width: none;
  left: -19.5%;
  top: -4.51%;
  object-fit: cover;
  object-position: center;
}

.case-study__row--duo .case-study__frame--crop-npao-brochures img {
  width: 148%;
  height: 110.15%;
  max-width: none;
  left: -24%;
  top: -5.07%;
  right: auto;
  bottom: auto;
}

/* NP Careers-specific image crops */
.case-study__row--crop-np-careers-print .case-study__frame {
  aspect-ratio: 1440 / 1224;
  max-height: 1224px;
  position: relative;
  background: #d1d1d1;
}

.case-study__row--crop-np-careers-print .case-study__frame img {
  position: absolute;
  width: 147%;
  height: 115.29%;
  max-width: none;
  left: -23.5%;
  top: -7.65%;
  object-fit: cover;
  object-position: center;
}

.case-study__frame--crop-np-careers-banner {
  background: #cfcfcf;
}

.case-study__row--duo .case-study__frame--crop-np-careers-banner img {
  width: 69.74%;
  height: 109%;
  max-width: none;
  left: 15.13%;
  top: -4.5%;
  right: auto;
  bottom: auto;
  object-fit: cover;
  object-position: center;
}

/* Illustration-specific image crops */
.case-study__row--full-illustration .case-study__frame {
  aspect-ratio: 1440 / 1224;
  max-height: 1224px;
  position: relative;
}

.case-study__row--full-illustration .case-study__frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.case-study__row--duo .case-study__frame--crop-illustration-cradle img {
  width: 112.51%;
  height: 157%;
  max-width: none;
  left: -6.25%;
  top: -28.5%;
  right: auto;
  bottom: auto;
}

.case-study__row--duo .case-study__frame--contain img {
  object-fit: contain;
}

/* Photography image clip wrappers (matches Figma overflow containers) */
.case-study__frame-clip {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

/* Photography full-width botanical row */
.case-study__row--full-photography .case-study__frame {
  aspect-ratio: 1440 / 1224;
  max-height: 1224px;
  position: relative;
}

.case-study__row--full-photography .case-study__frame img {
  position: absolute;
  inset: auto;
  width: 147%;
  height: 115.29%;
  max-width: none;
  max-height: none;
  left: -23.5%;
  top: -7.65%;
  object-fit: fill;
}

.case-study__row--duo .case-study__frame--crop-photography-handbags img {
  position: absolute;
  inset: auto;
  width: 187.41%;
  height: 331.47%;
  max-width: none;
  max-height: none;
  left: 8.09%;
  top: -198.45%;
  object-fit: fill;
}

.case-study__frame--crop-photography-sneaker {
  background: var(--color-white);
}

.case-study__row--duo .case-study__frame--crop-photography-sneaker img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  object-position: center;
}

.case-study__row--infographic-photography .case-study__frame {
  aspect-ratio: 1440 / 1224;
  max-height: 1224px;
  position: relative;
}

.case-study__row--infographic-photography .case-study__frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.case-study__row--website-development .case-study__frame {
  aspect-ratio: auto;
  position: static;
  overflow: visible;
}

.case-study__row--website-development .case-study__frame img {
  position: static;
  inset: auto;
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
}

.case-study__frame--website-development-span {
  grid-column: 1 / -1;
}

/* Portfolio project placeholder pages */
.portfolio-detail {
  background: var(--color-white);
  padding: 56px 24px;
  display: flex;
  justify-content: center;
  flex: 1;
}

.portfolio-detail__inner {
  width: 100%;
  max-width: var(--max-content);
  padding: 25px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.portfolio-detail__back a {
  font-family: var(--font-montserrat);
  font-size: 16px;
}

.portfolio-detail__back a:hover {
  opacity: 0.7;
}

.portfolio-detail__title {
  font-family: var(--font-montserrat);
  font-weight: 700;
  font-size: 35px;
  line-height: 50px;
}

.portfolio-detail__placeholder {
  font-family: var(--font-open-sans);
  font-size: 20px;
  line-height: 38px;
  color: rgba(0, 0, 0, 0.6);
}

/* Footer */
.footer {
  background: var(--color-white);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  margin-top: auto;
  flex-shrink: 0;
}

.footer__inner {
  width: 100%;
  max-width: var(--max-content);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer__links {
  display: flex;
  align-items: center;
  gap: 24px;
  font-family: var(--font-montserrat);
  font-weight: 400;
  font-size: 14px;
  line-height: 32px;
}

.footer__links a {
  font-family: inherit;
  font-weight: inherit;
  font-size: inherit;
  line-height: inherit;
  white-space: nowrap;
}

.footer__contact {
  white-space: nowrap;
}

/* Responsive */
@media (max-width: 768px) {
  .case-study__intro {
    padding: 40px 24px;
  }

  .case-study__heading {
    font-size: 22px;
    line-height: 32px;
  }

  .case-study__copy {
    font-size: 18px;
    line-height: 32px;
  }

  .case-study__gallery {
    gap: 16px;
    padding: 0 0 40px;
  }

  .case-study__row--duo {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .case-study__row--duo .case-study__frame {
    aspect-ratio: auto;
    position: static;
  }

  .case-study__row--duo .case-study__frame img,
  .case-study__row--duo .case-study__frame video {
    position: static;
    width: 100%;
    height: auto;
    max-width: 100%;
    left: auto;
    top: auto;
    right: auto;
    bottom: auto;
    object-fit: contain;
  }

  .case-study__frame-clip {
    position: static;
    overflow: visible;
  }

  .case-study__row--duo .case-study__frame--crop-photography-handbags img,
  .case-study__row--full-photography .case-study__frame img {
    position: static;
    width: 100%;
    height: auto;
    max-width: 100%;
    left: auto;
    top: auto;
    object-fit: contain;
  }

  .case-study__row:not(.case-study__row--duo) {
    flex-direction: column;
    gap: 16px;
  }

  .case-study__row--crop-brochure .case-study__frame {
    max-height: none;
    aspect-ratio: auto;
  }

  .case-study__row--crop-brochure .case-study__frame {
    aspect-ratio: auto;
  }

  .case-study__row--crop-brochure .case-study__frame img,
  .case-study__row--crop-npao-print .case-study__frame img,
  .case-study__row--crop-np-careers-print .case-study__frame img {
    position: static;
    width: 100%;
    height: auto;
    left: auto;
    top: auto;
  }

  .case-study__row--full-illustration .case-study__frame {
    aspect-ratio: auto;
    max-height: none;
  }

  .case-study__row--full-illustration .case-study__frame img,
  .case-study__row--full-photography .case-study__frame img {
    position: static;
    width: 100%;
    height: auto;
    left: auto;
    top: auto;
  }

  .case-study__row--infographic-photography .case-study__frame {
    aspect-ratio: auto;
    max-height: none;
  }

  .case-study__row--infographic-photography .case-study__frame img {
    position: static;
    width: 100%;
    height: auto;
  }

  .case-study__row--website-development .case-study__frame {
    aspect-ratio: auto;
    position: static;
    overflow: visible;
  }

  .case-study__row--website-development .case-study__frame img {
    position: static;
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0;
    object-fit: contain;
    object-position: center;
  }

  .case-study__row--full-photography .case-study__frame {
    aspect-ratio: auto;
    max-height: none;
  }

  .case-study__row--crop-npao-print .case-study__frame,
  .case-study__row--crop-np-careers-print .case-study__frame {
    aspect-ratio: auto;
    max-height: none;
  }


  .portfolio-grid {
    padding: 40px 24px;
  }

  .portfolio-card {
    width: min(236px, calc(50vw - 39px));
    height: auto;
    aspect-ratio: 236 / 224;
  }

  .nav__inner {
    flex-wrap: wrap;
    justify-content: center;
    padding: 12px 0;
  }

  .nav {
    height: auto;
    min-height: var(--nav-height);
    padding: 16px 24px;
  }

  .nav__actions {
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
  }

  .hero__title-lead,
  .hero__title-name {
    font-size: 28px;
    line-height: 40px;
  }

  .hero__text {
    font-size: 18px;
    line-height: 32px;
  }

  .carousel__track,
  .carousel__slide {
    height: 420px;
  }

  .carousel__slide {
    width: min(400px, 90vw);
  }
}

@media (max-width: 480px) {
  .case-study__intro {
    padding: 32px 16px;
  }

  .case-study__intro-inner {
    padding: 16px;
  }

  .case-study__heading {
    font-size: 20px;
    line-height: 30px;
  }

  .case-study__copy {
    font-size: 16px;
    line-height: 28px;
  }

  .portfolio-grid {
    padding: 32px 16px;
  }

  .portfolio-grid__list {
    gap: 20px;
  }

  .portfolio-card {
    width: 100%;
    max-width: 280px;
  }

  .nav__actions {
    flex-direction: column;
    width: 100%;
  }

  .nav__links {
    justify-content: center;
  }
