

@layer components {

  
  .mh-fence-container {
    width: 100%;
    height: 380px;
    background-color: #fdfdfd;
    border: 2px solid var(--mh-black);
    box-shadow: 8px 8px 0px var(--mh-black);
    background-image:
      linear-gradient(#e0e0e0 1px, transparent 1px),
      linear-gradient(90deg, #e0e0e0 1px, transparent 1px);
    background-size: 20px 20px;
    position: relative;
    overflow: hidden;
  }
  .mh-fence-grid {
    display: grid;
    width: 100%;
    height: 100%;
    grid-template-columns: repeat(20, 1fr);
    grid-template-rows: repeat(20, 1fr);
  }

  .mh-fc-house {
    grid-column: 5 / 17;
    grid-row: 3 / 10;
    border: 2px solid #999;
    background: #f4f4f4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #999;
    opacity: 0;
    animation: popOnGrid 0.5s ease forwards;
  }

  .mh-fc-post {
    width: 4px;
    height: 100%;
    background: var(--mh-black);
    justify-self: center;
    opacity: 0;
    transform: scaleY(0);
    transform-origin: bottom;
    animation: growUp 0.4s ease forwards;
  }

  .mh-fc-panel {
    height: 80%;
    align-self: center;
    border-top: 2px solid #555;
    border-bottom: 2px solid #555;
    background: repeating-linear-gradient(90deg, transparent, transparent 10px, #ddd 10px, #ddd 12px);
    opacity: 0;
    animation: fadeIn 0.4s ease forwards;
  }

  .mh-fc-gate {
    grid-column: 9 / 13;
    grid-row: 14 / 17;
    border: 2px solid var(--mh-black);
    background: rgba(0, 230, 118, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    position: relative;
    opacity: 0;
    transform: translateY(10px);
    animation: slideUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    animation-delay: 1.8s;
  }
  .mh-fc-gate::before, .mh-fc-gate::after {
    content: '';
    position: absolute;
    top: -5px; bottom: -5px;
    width: 6px;
    background: var(--mh-black);
  }
  .mh-fc-gate::before { left: -8px; }
  .mh-fc-gate::after { right: -8px; }

  .mh-fc-worker {
    grid-column: 14 / 16;
    grid-row: 13 / 16;
    font-size: 2rem;
    z-index: 5;
    opacity: 0;
    animation: popOnGrid 0.5s ease forwards 2.5s;
  }

  .mh-fc-measure {
    grid-column: 3 / 19;
    grid-row: 18 / 19;
    border-top: 1px solid #000;
    position: relative;
    opacity: 0;
    animation: fadeIn 0.5s ease forwards 2.2s;
  }
  .mh-fc-measure::before, .mh-fc-measure::after {
    content: ''; position: absolute; top: -3px; height: 7px; width: 1px; background: #000;
  }
  .mh-fc-measure::before { left: 0; }
  .mh-fc-measure::after { right: 0; }
  .mh-fc-text {
    position: absolute;
    top: -20px;
    width: 100%;
    text-align: center;
    font-size: 0.7rem;
  }

  .mh-post-1 { grid-column: 3;  grid-row: 14/17; animation-delay: 0.5s; }
  .mh-post-2 { grid-column: 5;  grid-row: 14/17; animation-delay: 0.6s; }
  .mh-post-3 { grid-column: 7;  grid-row: 14/17; animation-delay: 0.7s; }
  .mh-post-4 { grid-column: 15; grid-row: 14/17; animation-delay: 0.8s; }
  .mh-post-5 { grid-column: 17; grid-row: 14/17; animation-delay: 0.9s; }
  .mh-post-6 { grid-column: 19; grid-row: 14/17; animation-delay: 1.0s; }
  .mh-panel-1 { grid-column: 3/5;  grid-row: 14/17; animation-delay: 1.1s; }
  .mh-panel-2 { grid-column: 5/7;  grid-row: 14/17; animation-delay: 1.2s; }
  .mh-panel-3 { grid-column: 7/9;  grid-row: 14/17; animation-delay: 1.3s; }
  .mh-panel-4 { grid-column: 13/15; grid-row: 14/17; animation-delay: 1.4s; }
  .mh-panel-5 { grid-column: 15/17; grid-row: 14/17; animation-delay: 1.5s; }
  .mh-panel-6 { grid-column: 17/19; grid-row: 14/17; animation-delay: 1.6s; }

  
  @keyframes growUp { 0% { transform: scaleY(0); opacity: 0; } 100% { transform: scaleY(1); opacity: 1; } }
  @keyframes slideUp { 0% { opacity: 0; transform: translateY(10px); } 100% { opacity: 1; transform: translateY(0); } }
  @keyframes fadeIn { to { opacity: 1; } }

  
  @media (prefers-reduced-motion: reduce) {
    .mh-fc-house, .mh-fc-post, .mh-fc-panel, .mh-fc-gate,
    .mh-fc-worker, .mh-fc-measure {
      animation: none !important;
      opacity: 1 !important;
      transform: none !important;
    }
  }

}


@media (max-width: 479px) {
  #live-demo .mh-conf-wrapper {
    padding-inline: 0.5rem;
    max-inline-size: 100%;
    margin-inline: auto;
  }
}
