#work * {
  box-sizing: border-box;
}


#work {
  margin: 0;
  background: #f3f1f7;
  color: #3d3b65;
  font-family: "DM Sans",sans-serif;
}

#work {
  max-width: 1440px;
  margin: auto;
  padding: clamp(24px,7vw,100px);
}

#work h1,#work h2 {
  font-family: Alice,Georgia,serif;
  font-weight: 400;
  margin: 0;
}

#work h1 {
  font-size: clamp(40px,6vw,84px);
  letter-spacing: -.04em;
}

#work h2 {
  font-size: clamp(26px,3.4vw,46px);
}

#work .mh-eyebrow {
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 700;
  color: #77718d;
}

#work .mh-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px 0 48px;
}

#work button {
  font: inherit;
  color: inherit;
  background: #ffffff80;
  border: 1px solid #bdb7d0;
  border-radius: 99px;
  padding: 12px 19px;
  cursor: pointer;
}

#work button:hover,#work button:focus-visible {
  background: #d5eee4;
  border-color: #72b9a5;
}

#work button[aria-pressed=true] {
  background: #3d3b65;
  color: white;
  border-color: #3d3b65;
}

#work .mh-feature {
  background: linear-gradient(130deg,#e8e2f0,#f8f6fb);
  border: 1px solid #fff;
  border-radius: 32px;
  padding: clamp(20px,4vw,56px);
  margin-bottom: 75px;
}

#work .mh-feature-grid {
  display: grid;
  grid-template-columns: repeat(12,1fr);
  align-items: start;
  margin-top: 24px;
}

#work .mh-project {
  position: relative;
  display: block;
  isolation: isolate;
  color: white;
  text-decoration: none;
  border-radius: 20px;
  box-shadow: 0 15px 35px #39304e20;
  transition: transform .25s,box-shadow .25s;
  overflow: hidden;
  background: linear-gradient(145deg,#a29ab9,#514a70);
  aspect-ratio: 1;
}

#work .mh-project img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

#work .mh-project:hover,#work .mh-project:focus-visible {
  z-index: 5;
}

#work .mh-label {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid #ffffff80;
  border-radius: 18px;
  background: #302b49b8;
  backdrop-filter: blur(16px);
  transition: background .2s,border-color .2s;
}

#work .mh-project:hover .mh-label {
  background: #37665ce0;
  border-color: #bce9d8;
}

#work .mh-label small {
  display: block;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: .12em;
  color: #e2dfea;
}

#work .mh-label strong {
  font-size: clamp(13px,1.4vw,19px);
  font-weight: 500;
}

#work .mh-label b {
  font-size: 22px;
  font-weight: 400;
}

#work .mh-p0 {
  grid-column: 1/10;
  grid-row: 1;
  aspect-ratio: 2/1;
}

#work .mh-p7 {
  grid-column: 8/13;
  grid-row: 1;
  margin-top: 20%;
  z-index: 2;
}

#work .mh-collection {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12,1fr);
  gap: 0;
  margin-top: 30px;
  align-items: start;
}

#work .mh-collection .mh-project:nth-of-type(3n/**/+1) {
  grid-column: 1/6;
}

#work .mh-collection .mh-project:nth-of-type(3n/**/+2) {
  grid-column: 5/10;
  margin-top: 24%;
  z-index: 2;
}

#work .mh-collection .mh-project:nth-of-type(3n) {
  grid-column: 9/13;
  margin-top: 8%;
  z-index: 3;
}

#work .mh-collection .mh-project:nth-of-type(-n/**/+3) {
  grid-row: 1;
}

#work .mh-collection .mh-project:nth-of-type(n/**/+4) {
  grid-row: 2;
  margin-top: 5%;
}

#work .mh-collection .mh-project:nth-of-type(5) {
  margin-top: 27%;
}

#work .mh-collection .mh-project:nth-of-type(6) {
  margin-top: 12%;
}

#work .mh-gallery-ribbon {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#work .mh-project[hidden],#work section[hidden] {
  display: none;
}

#work.mh-filtered .mh-collection {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

#work.mh-filtered .mh-collection .mh-project {
  width: min(100%,340px);
  margin: 0;
}

#work.mh-filtered .mh-feature-grid {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

#work.mh-filtered .mh-feature-grid .mh-project {
  width: min(100%,440px);
  margin: 0;
}

@media(max-width:650px) {
  #work .mh-feature-grid,#work .mh-collection {
    display: flex;
    flex-direction: column;
  }

  #work .mh-feature-grid .mh-p0 {
    width: 100%;
  }

  #work .mh-feature-grid .mh-p7 {
    width: 78%;
    align-self: flex-end;
    margin-top: -8px;
  }

  #work .mh-collection .mh-project:nth-of-type(n) {
    width: 83%;
    margin: 0 0 -10px;
  }

  #work .mh-collection .mh-project:nth-of-type(even) {
    align-self: flex-end;
  }

  #work .mh-label {
    padding: 9px 12px;
    bottom: 8px;
    left: 8px;
    right: 8px;
  }

  #work .mh-feature {
    margin-bottom: 45px;
  }

  #work .mh-filters {
    margin-bottom: 30px;
  }
}

@media(prefers-reduced-motion:reduce) {
  #work * {
    transition: none !important;
  }
}

#work .mh-feature-grid {
  width: 66.6667%;
  margin-inline: auto;
}

#work .mh-collection {
  grid-template-columns: repeat(24,minmax(0,1fr));
  padding-block: 18px 42px;
  row-gap: 20px;
}

#work .mh-collection .mh-project:nth-of-type(n) {
  grid-row: 1;
  margin-top: 0;
  z-index: 1;
  grid-column: span 6;
}

#work .mh-collection .mh-project:nth-of-type(1) {
  grid-column: 1/8;
}

#work .mh-collection .mh-project:nth-of-type(2) {
  grid-column: 7/14;
  margin-top: 12%;
  z-index: 2;
}

#work .mh-collection .mh-project:nth-of-type(3) {
  grid-column: 13/20;
  margin-top: 3%;
  z-index: 3;
}

#work .mh-collection .mh-project:nth-of-type(4) {
  grid-column: 19/25;
  margin-top: 15%;
  z-index: 4;
}

#work .mh-collection .mh-project:nth-of-type(5) {
  grid-row: 2;
  grid-column: 7/14;
  margin-top: 0;
}

#work .mh-collection .mh-project:nth-of-type(6) {
  grid-row: 2;
  grid-column: 13/20;
  margin-top: 10%;
  z-index: 2;
}

#work .mh-collection .mh-project:hover,#work .mh-collection .mh-project:focus-visible {
  z-index: 10;
}

#work .mh-gallery-ribbon {
  overflow: visible;
}

#work.mh-filtered .mh-collection .mh-project {
  width: min(100%,260px);
  margin: 0;
}

#work.mh-filtered .mh-feature-grid .mh-project {
  width: min(100%,300px);
  margin: 0;
}

@media(max-width:650px) {
  #work .mh-feature-grid {
    width: 100%;
  }

  #work .mh-feature-grid .mh-p0 {
    width: 75%;
  }

  #work .mh-feature-grid .mh-p7 {
    width: 55%;
  }

  #work .mh-collection .mh-project:nth-of-type(n) {
    width: 56%;
    margin: 0 0 -10px;
  }

  #work .mh-collection .mh-project:nth-of-type(even) {
    align-self: flex-end;
  }

  #work .mh-collection {
    row-gap: 0;
    padding-bottom: 35px;
  }

  #work.mh-filtered .mh-collection .mh-project {
    margin: 0;
  }

  #work.mh-filtered .mh-feature-grid .mh-project {
    width: 75%;
  }
}

#work .mh-label {
  border: 0;
  border-radius: 12px;
  padding: 9px 12px;
  transition: background .2s;
}

#work .mh-label strong {
  font-size: clamp(11px,1.05vw,15px);
  line-height: 1.25;
}

#work .mh-label small {
  font-size: 9px;
}

#work .mh-feature-grid {
  width: 60%;
}

#work .mh-collection .mh-project:nth-of-type(n) {
  width: 90%;
  justify-self: center;
}

#work.mh-filtered .mh-collection .mh-project {
  width: min(100%,234px);
}

#work.mh-filtered .mh-feature-grid .mh-project {
  width: min(100%,270px);
}

#work.mh-filtered .mh-gallery-ribbon {
  display: none;
}

@media(max-width:650px) {
  #work .mh-feature-grid {
    width: 100%;
  }

  #work .mh-feature-grid .mh-p0 {
    width: 67.5%;
  }

  #work .mh-feature-grid .mh-p7 {
    width: 49.5%;
  }

  #work .mh-collection .mh-project:nth-of-type(n) {
    width: 50.4%;
  }

  #work .mh-label {
    padding: 7px 9px;
  }

  #work .mh-label strong {
    font-size: 11px;
  }

  #work.mh-filtered .mh-collection .mh-project {
    width: min(100%,234px);
  }

  #work.mh-filtered .mh-feature-grid .mh-project {
    width: 67.5%;
  }
}

#work h1 {
  font-size: clamp(26px,3vw,40px);
  letter-spacing: -.025em;
  margin-bottom: 24px;
}

#work h2 {
  font-size: clamp(19px,2vw,27px);
}

#work .mh-eyebrow {
  font-size: 10px;
  letter-spacing: .14em;
}

#work .mh-filters {
  gap: 7px;
  margin: 0 0 28px;
}

#work .mh-filters button {
  font-size: 12px;
  padding: 7px 12px;
  line-height: 1.35;
}

#work .mh-feature {
  margin-bottom: 30px;
}

@media(max-width:650px) {
  #work h1 {
    font-size: 28px;
  }

  #work h2 {
    font-size: 20px;
  }

  #work .mh-filters {
    gap: 6px;
    margin-bottom: 22px;
  }

  #work .mh-filters button {
    font-size: 11px;
    padding: 6px 10px;
  }

  #work .mh-feature {
    margin-bottom: 24px;
  }
}

#work .mh-collection-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

#work .mh-collection-heading .mh-filters {
  margin: 0;
  align-items: center;
}

#work .mh-project {
  transition: box-shadow .25s;
}

@media(max-width:650px) {
  #work .mh-collection-heading {
    align-items: flex-start;
    gap: 12px;
  }
}

#work .mh-work-heading {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 12px 22px;
  margin-bottom: 28px;
}

#work .mh-work-heading .mh-filters {
  margin: 0;
  justify-content: flex-start;
  align-items: center;
}

#work .mh-work-heading h1 {
  flex-shrink: 0;
}

@media(max-width:760px) {
  #work .mh-work-heading {
    padding-right: 44px;
    gap: 12px;
  }

  #work .mh-work-heading .mh-filters {
    flex-basis: 100%;
  }
}

#work {
  max-width: 1440px;
  margin: auto;
  scroll-margin-top: 0;
}

.mh-gallery-shell {
  background: #f3f1f7;
  color: #3d3b65;
}

#work .mh-gallery-ribbon {
  transform: none;
  filter: none;
}

#work .mh-eyebrow {
  letter-spacing: .18em;
}

#work .mh-project {
  transition: transform 360ms cubic-bezier(.22,.61,.36,1),box-shadow 360ms ease;
}

@media (hover:hover) and (pointer:fine) {
  #work .mh-project:hover {
    transform: translateY(-6px);
  }
}

#work .mh-project:focus-visible {
  transform: translateY(-6px);
}

@media(prefers-reduced-motion:reduce) {
  #work .mh-project:hover,#work .mh-project:focus-visible {
    transform: none;
    transition: none !important;
  }
}

.mh-hero:before {
  background: radial-gradient(ellipse at 3% 92%,rgba(103,205,181,.29),transparent 37%),radial-gradient(ellipse at 97% 5%,rgba(115,211,187,.25),transparent 35%),radial-gradient(ellipse at 10% 35%,rgba(177,137,213,.20),transparent 42%),radial-gradient(ellipse at 88% 78%,rgba(135,110,194,.22),transparent 40%);
}

#work .mh-project {
  translate: 0 0;
  transition: translate 450ms cubic-bezier(.22,.75,.25,1),box-shadow 450ms ease;
}

#work .mh-project:hover,#work .mh-project:focus-visible {
  transform: none;
  translate: 0 -12px;
  z-index: 15;
}

@media(prefers-reduced-motion:reduce) {
  #work .mh-project:hover,#work .mh-project:focus-visible {
    translate: none !important;
    transition: none !important;
  }
}

.mh-hero .mh-badge,.mh-hero .mh-bubble,.mh-menu-toggle {
  border-color: transparent !important;
  box-shadow: 0 12px 25px #120e3530 !important;
}

html {
  scroll-behavior: auto;
}

@media(max-width:650px) {
  #work:not(.mh-filtered) .mh-collection {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  #work:not(.mh-filtered) .mh-collection .mh-project:nth-of-type(n) {
    width: 50.4%;
    flex: none;
    margin: 0;
  }

  #work:not(.mh-filtered) .mh-collection .mh-project:nth-of-type(n/**/+2) {
    margin-top: -16.8%;
  }

  #work:not(.mh-filtered) .mh-collection .mh-project:nth-of-type(odd) {
    align-self: flex-start;
  }

  #work:not(.mh-filtered) .mh-collection .mh-project:nth-of-type(even) {
    align-self: flex-end;
  }
}

/* Match inactive filter ink to the section headings. */
#work .mh-filters button:not([aria-pressed="true"]) { color: #3d3b65; }

#work .mh-gallery-ribbon { inset: 5% -5% auto; width: 110%; height: 90%; object-fit: contain; transform: rotate(-13deg); opacity: .68; }
@media(max-width:760px){#work .mh-gallery-ribbon { inset: 10% -30% auto; width: 160%; height: 80%; transform: rotate(65deg); }}
/* Unified centered gallery: two cards spanning three columns, then three per row. */
#work .mh-collection.mh-unified { --tile: min(240px, calc((100% - 32px)/3)); display:flex; flex-flow:row wrap; justify-content:center; align-items:flex-start; gap:16px; max-width:752px; margin:30px auto 0; }
#work .mh-collection.mh-unified .mh-project:nth-of-type(n) { flex:0 0 var(--tile); width:var(--tile); max-height:240px; margin:0; align-self:auto; aspect-ratio:1; }
#work .mh-collection.mh-unified .mh-p0:nth-of-type(n) { flex-basis:calc(2 * var(--tile) + 16px); width:calc(2 * var(--tile) + 16px); aspect-ratio: auto; height:var(--tile); }
#work .mh-collection.mh-unified .mh-project[hidden] {display:none;}
#work .mh-unified .mh-gallery-ribbon { z-index:0; }
#work.mh-filtered .mh-unified .mh-gallery-ribbon {display:none;}
@media(max-width:650px){
 #work .mh-collection.mh-unified {--tile:min(240px,calc((100% - 16px)/2));gap:16px;}
 #work .mh-collection.mh-unified .mh-p0:nth-of-type(n){flex-basis:100%;width:100%;height:auto;aspect-ratio:2/1;}
 #work .mh-unified .mh-label{padding:8px;left:6px;right:6px;bottom:6px;}
}
@media(min-width:651px){#work .mh-collection.mh-unified .mh-p0:nth-of-type(n){height:auto;aspect-ratio:496/240;}}
/* Shared content width matches contact's inner layout. */
#work { box-sizing:content-box; max-width:1200px; padding:clamp(48px,7vw,100px) 7.1%; }
#work .mh-collection.mh-unified { --tile:min(240px,calc((100% - 32px)/3)); }
#work:not(.mh-filtered) .mh-collection.mh-unified { row-gap:25px; padding-bottom:65px; }
@media(max-width:650px){
 #work .mh-collection.mh-unified { --tile:min(240px,calc((100% - 16px)/2)); }
}
@media(prefers-reduced-motion:reduce){#work .mh-unified .mh-project{transition:none!important;}}

  /* Isotope owns item positioning and transition transforms; decorative card
     treatment stays on an inner visual layer. */
  #work .mh-unified .mh-project {
    translate: none !important;
    rotate: none !important;
    scale: none !important;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }

  #work .mh-unified .mh-project-visual {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 20px;
    background: linear-gradient(145deg,#a29ab9,#514a70);
    box-shadow: 0 15px 35px #39304e20;
    transform-origin: center;
    translate: none;
    rotate: none;
    scale: none;
    transition: translate 450ms ease, box-shadow 450ms ease;
  }

  #work .mh-unified .mh-project:hover > .mh-project-visual,
  #work .mh-unified .mh-project:focus-visible > .mh-project-visual {
    translate: 0 -12px;
  }

  @media(prefers-reduced-motion:reduce){
    #work .mh-unified .mh-project-visual { transition: none !important; }
  }
/* Desktop work ribbon spans the section while remaining independent of the card grid. */
@media (min-width:761px) {
  #work .mh-collection.mh-unified .mh-gallery-ribbon {
    inset: 5% auto auto 50%;
    width: 100vw;
    max-width: none;
    transform: translateX(-50%) rotate(-13deg);
  }
}
