/* ==========================================================================
   Fonts
   ========================================================================== */

@font-face {
  font-family: "General Sans";
  src: url("../assets/fonts/GeneralSans-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ==========================================================================
   Mess Creative Studio — design tokens (pulled from Figma Dev Mode)
   ========================================================================== */

:root {
  --bg: #0f0f0f;
  --text: #e9e9e9;
  --text-strong: #fff;
  --text-muted: #8a8a8a;
  --border: #322e33;
  --media-placeholder: #1a1a1a;
  --nav-h: 94px;

  --gutter: clamp(20px, 2.2vw, 32px);
  --section-y: clamp(56px, 8.3vw, 120px);

  --ff-body: "PP Neue Montreal", "General Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .header__scroll img {
    animation: none;
  }

  .btn-arrow,
  .nav__links a,
  .nav__links,
  .nav__toggle span,
  .footer__col a,
  .email-copy__tooltip,
  .work-card,
  .work-card__media img,
  .partners__list img,
  .media__pause,
  .media__pause-icon::before,
  .media__pause-icon::after,
  .accordion__icon img,
  .accordion__content,
  .project-slider__nav,
  .project-slider__dots button::after {
    transition: none;
  }

  .partners__track {
    animation: none;
  }
}

/* ==========================================================================
   Reset
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ff-body);
  font-weight: 500;
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

h1, h2, h3, h4, p {
  margin: 0;
}

.wrap {
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.eyebrow {
  font-size: 18px;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--text);
}

.hairline {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ==========================================================================
   Media
   ========================================================================== */

.media {
  position: relative;
  overflow: hidden;
  background: var(--media-placeholder);
}

.media img,
.media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media__pause {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(15, 15, 15, 0.7);
  border: 1px solid var(--border);
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease);
}

.media__pause:hover {
  background: rgba(15, 15, 15, 0.9);
  border-color: var(--text);
}

.media__pause-icon {
  position: relative;
  width: 1px;
  height: 1px;
}

/* Pause bars: one 3px bar plus a box-shadow clone 6px to its right, so the
   pair (bar + 3px gap + bar = 9px total) can be centered as a single unit
   with a fixed transform instead of relying on two separately-positioned
   pseudo-elements landing in sync. */
.media__pause-icon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3px;
  height: 12px;
  background: var(--text);
  box-shadow: 6px 0 0 var(--text);
  transform: translate(-4.5px, -50%);
  transition: opacity 0.2s var(--ease);
}

/* Play triangle: positioned relative to the icon's centered 1px anchor so
   its 11x14 bounding box sits centered on the button. */
.media__pause-icon::after {
  content: "";
  position: absolute;
  top: -7px;
  left: -4px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 7px 0 7px 11px;
  border-color: transparent transparent transparent var(--text);
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}

.media__pause.is-paused .media__pause-icon::before {
  opacity: 0;
}

.media__pause.is-paused .media__pause-icon::after {
  opacity: 1;
}

/* ==========================================================================
   Buttons / links
   ========================================================================== */

.btn-arrow {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 18px;
  font-weight: 500;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--text);
  transition: opacity 0.3s var(--ease);
}

.btn-arrow:hover {
  opacity: 0.7;
}

.btn-arrow img {
  width: 9px;
  height: 9px;
}

/* ==========================================================================
   Nav
   ========================================================================== */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 15, 15, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nav__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px var(--gutter);
}

.nav__logo-group {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 60;
}

.nav__logo img {
  height: 14px;
  width: auto;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 31px;
}

.nav__links a {
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  transition: opacity 0.25s var(--ease);
}

.nav__links a:hover {
  opacity: 0.7;
}

.nav__cta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--text);
}

.nav__cta img {
  width: 8px;
  height: 8px;
}

.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 44px;
  height: 44px;
  padding: 14px 10px;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  z-index: 60;
  box-sizing: border-box;
}

.nav__toggle span {
  display: block;
  height: 1.5px;
  width: 100%;
  background: var(--text);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

.nav__toggle.is-active span:nth-child(1) {
  transform: translateY(7.25px) rotate(45deg);
}

.nav__toggle.is-active span:nth-child(2) {
  opacity: 0;
}

.nav__toggle.is-active span:nth-child(3) {
  transform: translateY(-7.25px) rotate(-45deg);
}

/* ==========================================================================
   Header / hero
   ========================================================================== */

.header {
  display: flex;
  flex-direction: column;
  min-height: calc(100svh - var(--nav-h));
  gap: clamp(32px, 6.4vw, 92px);
  box-sizing: border-box;
  padding: clamp(56px, 9svh, 100px) var(--gutter) clamp(24px, 4svh, 40px);
}

.header__intro {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: clamp(24px, 8.2vw, 118px);
}

.header__title {
  flex: 0 0 59.4%;
  font-size: clamp(56px, 11.11vw, 160px);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: 0;
  color: var(--text);
}

.header__title span {
  display: block;
}

.header__copy {
  flex: 1 0 0;
  min-width: 0;
  font-size: clamp(20px, 1.94vw, 28px);
  line-height: 1.5;
  color: var(--text);
}

.header__bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-top: auto;
}

.header__learn {
  padding-bottom: 2px;
  border-bottom: 1px solid var(--text-strong);
  font-size: 18px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-strong);
}

.header__scroll {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
}

.header__scroll img {
  width: 13px;
  height: 13px;
  transform: scaleY(-1);
  animation: bob 1.8s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: scaleY(-1) translate(0, 0); }
  50% { transform: scaleY(-1) translate(3px, -3px); }
}

/* ==========================================================================
   Statement sections (about / works-intro / services / partners)
   ========================================================================== */

.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
  border-top: 1px solid var(--border);
}

.section--flush {
  border-top: none;
}

.statement {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.statement p {
  max-width: 46ch;
  justify-self: end;
}

.statement .eyebrow {
  max-width: 40ch;
}

.statement p.muted {
  color: var(--text-muted);
}

#about {
  padding-bottom: 0;
}

/* ==========================================================================
   About / founder
   ========================================================================== */

.about__grid {
  display: grid;
  grid-template-columns: 442fr 372fr 496fr;
  gap: 32px;
  align-items: end;
}

.about__media--portrait {
  aspect-ratio: 442 / 786;
}

.about__media--landscape {
  aspect-ratio: 496 / 342;
}

.about__text {
  color: var(--text-muted);
  align-self: end;
}

/* ==========================================================================
   Works grid
   ========================================================================== */

.works {
  display: flex;
  flex-direction: column;
}

.works__row {
  display: flex;
  gap: 32px;
  padding: 60px 0;
}

.works__row + .works__row {
  border-top: none;
}

.work-card {
  display: block;
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.work-card__media {
  aspect-ratio: 4 / 3.4;
}

.work-card__media img {
  transition: transform 0.6s var(--ease);
}

.work-card:hover .work-card__media img,
.work-card:focus-visible .work-card__media img {
  transform: scale(1.06);
}

.work-card__meta {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 18px;
}

.work-card__client {
  display: inline-block;
  color: var(--text-strong);
  text-transform: uppercase;
  font-weight: 500;
}

.work-card__category {
  color: var(--text-muted);
}

.works__spacer {
  flex-shrink: 0;
}

/* Scroll entrance: JS adds `.will-reveal` only once it has run, so a
   blocked/failed script leaves cards in their normal visible state rather
   than hiding content behind a class that never gets removed. */
.work-card.will-reveal {
  opacity: 0;
  transform: translateY(56px);
}

.work-card.will-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Services
   ========================================================================== */

.services {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 32px;
}

.services__left {
  position: sticky;
  top: var(--section-y);
}

.services__right {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 80px;
}

.services__right .muted {
  color: var(--text-muted);
  max-width: 46ch;
}

.accordion {
  border-bottom: 1px solid var(--border);
}

.accordion__item {
  border-top: 1px solid var(--border);
}

.accordion__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 38px 10px;
  font-size: 16px;
  font-weight: 500;
  text-transform: uppercase;
  text-align: left;
}

.accordion__label {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.accordion__number {
  color: var(--text-muted);
}

.accordion__icon {
  position: relative;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.accordion__icon img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

.accordion__icon .minus {
  opacity: 0;
  transform: rotate(-90deg);
}

.accordion__item.is-open .accordion__icon .plus {
  opacity: 0;
  transform: rotate(90deg);
}

.accordion__item.is-open .accordion__icon .minus {
  opacity: 1;
  transform: rotate(0deg);
}

.accordion__content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s var(--ease);
}

.accordion__item.is-open .accordion__content {
  grid-template-rows: 1fr;
}

.accordion__content-inner {
  overflow: hidden;
}

.accordion__content-inner p {
  padding: 0 10px 38px;
  max-width: 640px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==========================================================================
   Partners
   ========================================================================== */

.partners {
  display: flex;
  align-items: center;
  gap: 32px;
}

.partners__label {
  flex-shrink: 0;
  width: 360px;
}

.partners__marquee {
  flex: 1 0 0;
  overflow: visible;
}

.partners__track {
  display: flex;
}

.partners__list {
  flex: 1 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.partners__list--clone {
  display: none;
}

.partners__list li {
  flex: 1 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 12px;
  min-width: 96px;
}

.partners__list img {
  max-height: 46px;
  width: auto;
  opacity: 0.85;
  transition: opacity 0.25s var(--ease);
}

.partners__list li:hover img {
  opacity: 1;
}

@keyframes partners-marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* ==========================================================================
   Footer / contact
   ========================================================================== */

.footer {
  padding-top: 200px;
  padding-bottom: 20px;
  border-top: 1px solid var(--border);
}

.footer__heading {
  font-size: clamp(40px, 11vw, 160px);
  font-weight: 500;
  line-height: 0.9;
}

.footer__copy {
  margin-top: 32px;
  max-width: 46ch;
  color: var(--text-muted);
}

.footer__row {
  margin-top: 120px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 32px;
}

.footer__col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer__col a:not(.btn-arrow) {
  display: inline-block;
  padding: 8px 0;
}

.footer__col--right {
  align-items: flex-end;
  text-align: right;
}

.footer__col a {
  font-size: 18px;
  color: var(--text);
  transition: opacity 0.25s var(--ease);
}

.footer__col a:hover {
  opacity: 0.7;
}

.footer__back-to-top img {
  transform: rotate(-45deg);
}

.email-copy {
  position: relative;
  display: inline-block;
}

.email-copy::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 14px;
}

.email-copy__tooltip {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: #d9d9d9;
  color: #141414;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  padding: 12px 22px;
  border-radius: 999px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0.2s;
}

.email-copy:hover .email-copy__tooltip,
.email-copy:focus-within .email-copy__tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.email-copy__tooltip.is-copied {
  background: var(--text-strong);
}

/* ==========================================================================
   Project detail
   ========================================================================== */

.project-hero {
  padding-top: clamp(40px, 7vw, 72px);
  padding-bottom: clamp(32px, 5vw, 56px);
}

.project-hero__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: clamp(28px, 5vw, 48px);
  transition: color 0.25s var(--ease);
}

.project-hero__back:hover {
  color: var(--text);
}

.project-hero__back svg {
  width: 12px;
  height: 12px;
  transform: rotate(180deg);
}

.project-hero__title {
  font-size: clamp(44px, 8vw, 96px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
}

.project-hero__meta {
  margin-top: clamp(28px, 5vw, 48px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.project-hero__meta dt {
  font-size: 14px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 8px;
}

.project-hero__meta dd {
  margin: 0;
  font-size: 16px;
  color: var(--text);
}

.project-cover {
  padding-bottom: 56px;
}

.project-cover .media {
  aspect-ratio: 16 / 8;
}

.project-body {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 32px;
}

.project-body p {
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.5;
  max-width: 52ch;
}

.project-slider {
  position: relative;
  padding-bottom: 40px;
}

.project-slider__viewport {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.project-slider__viewport::-webkit-scrollbar {
  display: none;
}

.project-slider__track {
  display: flex;
  gap: 16px;
}

.project-slider__track .media {
  flex: 0 0 calc((100% - 32px) / 3);
  aspect-ratio: 4 / 5;
  scroll-snap-align: start;
}

.project-slider__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(15, 15, 15, 0.7);
  border: 1px solid var(--border);
  color: var(--text);
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease), opacity 0.25s var(--ease);
}

.project-slider__nav:hover {
  background: rgba(15, 15, 15, 0.9);
  border-color: var(--text);
}

.project-slider__nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.project-slider__nav:disabled:hover {
  background: rgba(15, 15, 15, 0.7);
  border-color: var(--border);
}

.project-slider__nav svg {
  width: 18px;
  height: 18px;
}

.project-slider__nav--prev {
  left: 16px;
}

.project-slider__nav--next {
  right: 16px;
}

.project-slider__dots {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
}

/* Hit area is the button's own box (24x24, WCAG 2.5.8 minimum), not an
   overflowing pseudo-element: adjacent dots sit only 18px apart, so a
   44px hit area per dot would overlap its neighbors by ~26px and register
   clicks on the wrong dot. The visible dot is a centered 8px ::after. */
.project-slider__dots button {
  appearance: none;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  margin: 0;
  background: none;
  flex-shrink: 0;
}

.project-slider__dots button::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}

.project-slider__dots button.is-active::after {
  background: var(--text);
  transform: scale(1.3);
}

@media (max-width: 900px) {
  .project-slider__track .media {
    flex-basis: 100%;
  }
}

.project-next {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
}

.project-next__label {
  font-size: 16px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.project-next__title {
  font-size: clamp(32px, 6vw, 64px);
  font-weight: 500;
  letter-spacing: -0.02em;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
  .nav__toggle {
    display: flex;
  }

  .nav__links {
    position: fixed;
    inset: 0;
    z-index: 55;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 28px;
    width: 100%;
    height: 100vh;
    padding: 32px var(--gutter);
    background: var(--bg);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-12px);
    transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
  }

  .nav__links.is-active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav__links a {
    font-size: clamp(36px, 11vw, 56px);
    font-weight: 500;
    padding: 0;
  }

  .nav__links .nav__cta {
    margin-top: 12px;
    font-size: 18px;
    border-bottom: 1px solid var(--text);
  }

  body.nav-open {
    overflow: hidden;
  }

  .header {
    gap: 24px;
  }

  .header__intro {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 32px;
  }

  .header__title {
    flex: none;
    font-size: clamp(48px, 17vw, 120px);
  }

  .header__copy {
    flex: none;
    font-size: clamp(20px, 5.6vw, 28px);
  }

  .header__learn {
    display: none;
  }

  .header__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .statement,
  .services,
  .about__grid,
  .project-body {
    grid-template-columns: 1fr;
  }

  .statement p {
    justify-self: start;
  }

  .services__left {
    position: static;
  }

  .about__text {
    order: 3;
  }

  .works__row {
    flex-direction: column;
  }

  .works__spacer {
    display: none;
  }

  .partners {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }

  .partners__label {
    width: auto;
  }

  .partners__marquee {
    flex: none;
    width: 100%;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  }

  .partners__track {
    width: max-content;
    animation: partners-marquee 18s linear infinite;
  }

  .partners__list,
  .partners__list--clone {
    display: flex;
    flex-wrap: nowrap;
    flex: 0 0 auto;
    justify-content: flex-start;
    gap: 40px;
    padding-right: 40px;
  }

  .partners__list--clone {
    display: flex;
  }

  .partners__list li {
    flex: 0 0 auto;
    min-width: auto;
    justify-content: flex-start;
    padding: 12px 0;
  }

  .footer__row {
    flex-direction: column;
    margin-top: 96px;
  }

  .footer__col--right {
    align-items: flex-start;
    text-align: left;
  }

  .project-hero__meta {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-next {
    grid-template-columns: 1fr;
  }
}
