.hero-section {
  position: relative;
  min-height: 100svh;
  isolation: isolate;
  background-color: #180909;
  background-image:
    linear-gradient(105deg, rgba(244, 62, 40, 0.16) 0%, rgba(121, 25, 20, 0.07) 39%, rgba(7, 5, 7, 0.32) 100%),
    radial-gradient(78% 92% at 12% 16%, rgba(255, 80, 48, 0.23) 0%, transparent 72%),
    url("../../../assets/merco-site/images/bg-hero.webp");
  background-position: center top, left top, center top;
  background-repeat: no-repeat;
  background-size: cover;
}

.hero-section::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  background-image:
    url("../../../assets/merco-site/images/hero-grain.svg"),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 5px),
    linear-gradient(90deg, rgba(255, 65, 54, 0.05) 0%, transparent 45%, rgba(120, 150, 255, 0.04) 100%);
  background-size: 256px 256px, 100% 5px, 100% 100%;
  background-repeat: repeat, repeat, no-repeat;
  content: "";
  mix-blend-mode: soft-light;
  opacity: 0.42;
  pointer-events: none;
  will-change: transform;
  animation: hero-texture-drift 32s ease-in-out infinite alternate;
}

.hero-section::after {
  position: absolute;
  z-index: 0;
  inset: 0;
  background-image:
    radial-gradient(62% 42% at 12% 83%, rgba(229, 70, 39, 0.19) 0%, transparent 74%),
    radial-gradient(42% 38% at 77% 65%, rgba(112, 78, 171, 0.12) 0%, transparent 76%),
    radial-gradient(34% 27% at 54% 46%, rgba(255, 144, 93, 0.09) 0%, transparent 72%);
  content: "";
  opacity: 0.58;
  pointer-events: none;
  will-change: opacity;
  animation: hero-glow-breathe 26s ease-in-out infinite alternate;
}

.hero-glitch {
  --hero-glitch-strength: 0.18;
  position: absolute;
  z-index: 1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-glitch::before,
.hero-glitch::after {
  position: absolute;
  left: -4%;
  width: 108%;
  height: clamp(12px, 1.8vh, 22px);
  background:
    linear-gradient(90deg, transparent 2%, rgba(240, 86, 54, 0.3) 23%, rgba(255, 255, 255, 0.08) 48%, rgba(124, 160, 255, 0.22) 64%, rgba(225, 76, 44, 0.26) 78%, transparent 98%),
    linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  content: "";
  opacity: 0;
  pointer-events: none;
}

.hero-glitch::before {
  top: 34%;
  animation: hero-glitch-primary 28s ease-in-out infinite;
}

.hero-glitch::after {
  display: none;
}

.hero-shell {
  position: relative;
  z-index: 2;
  min-height: calc(100svh - var(--ticker-height));
  padding-top: clamp(168px, calc(100svh - 900px), 208px);
  padding-bottom: 64px;
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: calc(100% - min(604px, max(440px, 31.5vw)) - 32px);
}

.hero-badge {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  animation: content-arrive 560ms both cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-badge__icon {
  width: 22px;
  height: auto;
  flex: 0 0 auto;
  opacity: 0.9;
}

.hero-badge__label {
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.1;
  white-space: nowrap;
}

@media (min-width: 961px) {
  .hero-copy {
    transform: translateY(-48px);
  }
}

.hero-title {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: max-content;
  max-width: 100%;
  margin: 0;
  color: #f7f4f2;
  font-size: clamp(42px, 3.34vw, 64px);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1.2;
}

.hero-title__line {
  display: flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  white-space: nowrap;
}

.hero-title__line--logos {
  gap: 15px;
}

.hero-title__logos {
  width: clamp(106px, 7.7vw, 148px);
  height: auto;
  flex: 0 0 auto;
}

.hero-title__line--icon {
  gap: 17px;
}

.hero-title__icon-frame {
  display: inline-flex;
  width: 84px;
  height: 58px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(245, 238, 255, 0.07);
}

.hero-title__icon-frame img {
  width: 39px;
  height: 40px;
}

.hero-description {
  max-width: 570px;
  margin: 18px 0 0;
  color: var(--color-muted);
  font-size: 19px;
  font-weight: 400;
  line-height: 1.5;
  animation: content-arrive 600ms 150ms both cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-title {
  animation: content-arrive 640ms 70ms both cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-actions {
  display: grid;
  width: min(100%, 528px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 32px;
  animation: content-arrive 600ms 230ms both cubic-bezier(0.22, 1, 0.36, 1);
}

.button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  min-width: 0;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  color: #fff;
  font-size: 19px;
  font-weight: 400;
  line-height: 1;
  transition: border-color 240ms ease, background-color 240ms ease, box-shadow 280ms ease, color 240ms ease;
}

.button::after {
  position: absolute;
  z-index: 0;
  inset: 2px;
  border-radius: inherit;
  background: linear-gradient(112deg, transparent 22%, rgba(255, 255, 255, 0.27) 50%, transparent 78%);
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: translateX(-118%);
  transition: opacity 220ms ease, transform 620ms cubic-bezier(0.2, 0.65, 0.25, 1);
}

.button:hover::after {
  opacity: 1;
  transform: translateX(118%);
}

.button > * {
  position: relative;
  z-index: 1;
}

.button--primary {
  justify-content: space-between;
  gap: 12px;
  border: 2px solid rgba(245, 238, 255, 0.14);
  border-radius: 10px;
  background: radial-gradient(46% 50% at 50% 86.8%, #ff5322 0%, #d32c17 100%);
  background-clip: padding-box;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 1px 0 0 #cf412f inset,
    0 -3px 0 0 rgba(20, 0, 67, 0.2) inset;
}

.button--primary:hover {
  border-color: rgba(255, 228, 215, 0.3);
  box-shadow:
    0 0 0 2px rgba(255, 83, 34, 0.15),
    0 8px 26px rgba(163, 30, 19, 0.23),
    0 1px 0 0 #e76a51 inset,
    0 -3px 0 0 rgba(20, 0, 67, 0.2) inset;
}

.button:focus-visible {
  outline: 2px solid #ffb29e;
  outline-offset: 3px;
}

.button--primary img {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  transition: transform 260ms cubic-bezier(0.2, 0.65, 0.25, 1);
}

.button--primary:hover img {
  transform: translateX(3px);
}

.button--primary > span {
  transform: translateY(-1px);
}

.button--secondary {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: var(
    --Linear,
    linear-gradient(
      0deg,
      rgba(245, 238, 255, 0.12) 0%,
      rgba(245, 238, 255, 0.2) 100%
    )
  );
}

.button--secondary:hover {
  border-color: rgba(255, 255, 255, 0.23);
  background: linear-gradient(0deg, rgba(245, 238, 255, 0.18), rgba(245, 238, 255, 0.26));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 0 22px rgba(245, 238, 255, 0.08);
}

.hero-principles {
  display: grid;
  width: min(100%, 528px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: clamp(72px, 12.25vh, 116px);
  animation: content-arrive 680ms 330ms both cubic-bezier(0.22, 1, 0.36, 1);
}

.principle-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  min-height: 164px;
  flex-direction: column;
  align-items: flex-start;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 24px;
  background: rgba(245, 238, 255, 0.1);
  transition: border-color 260ms ease, background-color 260ms ease, box-shadow 300ms ease;
}

.principle-card::before,
.principle-card::after {
  position: absolute;
  z-index: 0;
  inset: 0;
  border-radius: inherit;
  content: "";
  pointer-events: none;
}

.principle-card::before {
  background: radial-gradient(90% 120% at 0% 0%, rgba(255, 125, 74, 0.16), transparent 72%);
  opacity: 0;
  transition: opacity 360ms ease;
}

.principle-card::after {
  background: linear-gradient(112deg, transparent 24%, rgba(255, 255, 255, 0.12) 50%, transparent 76%);
  opacity: 0;
  transform: translateX(-105%);
  transition: opacity 220ms ease, transform 680ms cubic-bezier(0.2, 0.65, 0.25, 1);
}

.principle-card > * {
  position: relative;
  z-index: 1;
}

.principle-card:hover {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(245, 238, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 10px 28px rgba(15, 2, 4, 0.14);
}

.principle-card:hover::before,
.principle-card:hover::after {
  opacity: 1;
}

.principle-card:hover::after {
  transform: translateX(105%);
}

.principle-card > img {
  width: 27px;
  height: 27px;
  object-fit: contain;
}

.principle-card h2 {
  margin: 14px 0 8px;
  color: #fff;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.12;
}

.principle-card p {
  max-width: 220px;
  margin: 0;
  color: rgba(245, 241, 239, 0.9);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.45;
}

.project-gallery--desktop {
  position: absolute;
  z-index: 1;
  top: 0;
  right: var(--shell-gutter);
  bottom: 0;
  display: block;
  width: min(604px, max(440px, 31.5vw));
  overflow: hidden;
  pointer-events: none;
}

.project-gallery__column {
  position: absolute;
  top: -16px;
  bottom: -18px;
  width: calc((100% - 24px) / 2);
  overflow: hidden;
}

.project-gallery__column--up {
  left: 0;
  animation: gallery-arrive 760ms 100ms both cubic-bezier(0.22, 1, 0.36, 1);
}

.project-gallery__column--down {
  top: -84px;
  right: 0;
  animation: gallery-arrive 760ms 180ms both cubic-bezier(0.22, 1, 0.36, 1);
}

.project-gallery__track {
  display: flex;
  flex-direction: column;
  will-change: transform;
}

.project-gallery__set {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 16px;
  margin: 0;
  padding: 0 0 16px;
  list-style: none;
}

.project-card {
  display: flex;
  width: 100%;
  flex: 0 0 auto;
  flex-direction: column;
  overflow: hidden;
  padding: 8px 8px 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 26px;
  background: #0b0a08;
  box-shadow: 0 4px 0 #020202;
}

.project-card > picture {
  display: block;
  width: 100%;
}

.project-card > picture > img {
  width: 100%;
  height: auto;
  aspect-ratio: 486 / 499;
  border-radius: 20px;
  object-fit: cover;
  image-rendering: high-quality;
}

.project-card__lights {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.project-card__lights i {
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #b85c63;
}

.project-card__lights i:nth-child(2) {
  background: #d0ca4d;
}

.project-card__lights i:nth-child(3) {
  background: #58ae68;
}

@media (min-width: 961px) {
  .project-card__lights {
    min-height: clamp(36px, calc(1.05vw + 25.84px), 46px);
  }
}

.project-gallery__column--up .project-gallery__track {
  animation: projects-up 78s linear infinite;
}

.project-gallery__column--down .project-gallery__track {
  animation: projects-down 84s linear infinite;
}

.project-gallery--mobile {
  display: none;
}

.expertise-marquee {
  animation: ticker-arrive 520ms 380ms both ease-out;
}

@keyframes gallery-arrive {
  from { opacity: 0; transform: translate3d(0, 14px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes projects-up {
  to { transform: translate3d(0, -50%, 0); }
}

@keyframes projects-down {
  from { transform: translate3d(0, -50%, 0); }
  to { transform: translate3d(0, 0, 0); }
}

@keyframes content-arrive {
  from { opacity: 0; transform: translate3d(0, 14px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes ticker-arrive {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes hero-texture-drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(0, -1px, 0); }
}

@keyframes hero-glow-breathe {
  0%, 100% { opacity: 0.48; }
  48% { opacity: 0.66; }
}

@keyframes hero-glitch-primary {
  0%, 23%, 25.5%, 100% {
    opacity: 0;
    transform: translate3d(0, 0, 0);
  }
  23.8% {
    opacity: var(--hero-glitch-strength);
    transform: translate3d(-0.16%, -0.5px, 0);
  }
  24.6% {
    opacity: calc(var(--hero-glitch-strength) * 0.45);
    transform: translate3d(0.08%, 0.5px, 0);
  }
}

@media (max-width: 1200px) and (min-width: 961px) {
  .hero-title__icon-frame {
    width: 68px;
    height: 52px;
  }

  .hero-title__line--icon {
    gap: 12px;
  }

  .hero-description {
    font-size: 18px;
  }

  .button {
    min-height: 54px;
    padding-inline: 14px;
    font-size: 16px;
  }

  .principle-card {
    min-height: 148px;
    padding: 16px;
  }

  .principle-card h2 {
    font-size: 18px;
  }

  .principle-card p {
    font-size: 14px;
  }
}

@media (max-width: 1500px) and (min-width: 961px) {
  .hero-shell {
    padding-top: clamp(158px, calc(100svh - 920px), 192px);
  }

  .hero-copy {
    transform: translateY(-42px);
  }

  .hero-title {
    font-size: clamp(35px, 3.2vw, 48px);
  }

  .hero-title__logos {
    width: clamp(88px, 6.3vw, 104px);
  }

  .hero-title__icon-frame {
    width: clamp(64px, 4.8vw, 74px);
    height: clamp(46px, 3.5vw, 54px);
  }

  .hero-title__line--icon {
    gap: clamp(10px, 1.1vw, 16px);
  }

  .hero-description {
    max-width: 500px;
    font-size: clamp(15px, 1.1vw, 16.5px);
  }

  .hero-actions,
  .hero-principles {
    width: min(100%, 476px);
  }

  .hero-actions {
    margin-top: 28px;
  }

  .button {
    min-height: 52px;
    padding-inline: 14px;
    font-size: clamp(15px, 1.08vw, 16px);
  }

  .button--primary img {
    width: 18px;
    height: 18px;
  }

  .hero-principles {
    margin-top: clamp(72px, 11.5vh, 106px);
  }

  .principle-card {
    min-height: clamp(148px, 10.5vw, 158px);
    padding: clamp(15px, 1.2vw, 18px);
  }

  .principle-card h2 {
    margin: 13px 0 7px;
    font-size: clamp(15px, 1.2vw, 18px);
  }

  .principle-card p {
    font-size: clamp(13px, 0.95vw, 14px);
  }
}

@media (min-width: 961px) and (min-height: 1201px) {
  .hero-section {
    min-height: min(100svh, 1200px);
  }

  .hero-shell {
    display: flex;
    min-height: calc(min(100svh, 1200px) - var(--ticker-height));
    align-items: center;
    padding-block: 0;
  }

  .hero-copy {
    width: 100%;
    transform: none;
  }
}

@media (max-width: 960px) {
  :root {
    --ticker-height: 58px;
  }

  .hero-section {
    min-height: auto;
    background-position: left top, left top, center top;
    background-size: 100% 100%, 100% 100%, auto 100%;
    background-image:
      linear-gradient(180deg, rgba(29, 2, 4, 0.08) 0%, rgba(22, 5, 8, 0.27) 36%, rgba(8, 8, 9, 0.77) 69%, rgba(6, 6, 6, 0.88) 100%),
      radial-gradient(115% 68% at 10% 7%, rgba(255, 76, 47, 0.22) 0%, transparent 75%),
      url("../../../assets/merco-site/images/bg-hero.webp");
  }

  .hero-section::before {
    opacity: 0.24;
    animation: none;
  }

  .hero-section::after {
    opacity: 0.38;
    animation-duration: 34s;
  }

  .hero-glitch {
    --hero-glitch-strength: 0.07;
  }

  .hero-shell {
    min-height: 0;
    padding-top: 106px;
    padding-bottom: 0;
  }

  .hero-copy {
    max-width: none;
  }

  .hero-badge__icon {
    width: 18px;
  }

  .hero-title {
    font-size: clamp(38px, 5.7vw, 52px);
  }

  .hero-title__logos {
    width: clamp(112px, 18vw, 148px);
  }

  .hero-description {
    max-width: 620px;
    margin-top: 18px;
    font-size: 18px;
  }

  .hero-actions {
    max-width: 528px;
    margin-top: 24px;
  }

  .hero-principles {
    max-width: 528px;
    margin-top: 28px;
  }

  .principle-card {
    min-height: 146px;
    padding: 16px;
    border-radius: 20px;
  }

  .principle-card h2 {
    margin: 11px 0 6px;
    font-size: 18px;
  }

  .principle-card p {
    font-size: 14px;
  }

  .project-gallery--desktop {
    display: none;
  }

  .project-gallery--mobile {
    --mobile-card-width: min(76vw, 320px);
    --mobile-offset: calc((100vw - var(--mobile-card-width)) / 2 - var(--mobile-card-width) - 16px);
    position: relative;
    display: block;
    width: calc(100% + var(--shell-gutter) + var(--shell-gutter));
    height: clamp(300px, 89vw, 370px);
    margin: 34px calc(0px - var(--shell-gutter)) 0;
    overflow: hidden;
    animation: gallery-arrive 760ms 100ms both cubic-bezier(0.22, 1, 0.36, 1);
  }

  .project-gallery--mobile .project-gallery__track {
    width: max-content;
    flex-direction: row;
    transform: translate3d(var(--mobile-offset), 0, 0);
    animation: projects-horizontal 104s linear infinite;
  }

  .project-gallery--mobile .project-gallery__set {
    flex-direction: row;
    gap: 16px;
    padding: 0 16px 0 0;
  }

  .project-gallery--mobile .project-card {
    width: var(--mobile-card-width);
  }

  @keyframes projects-horizontal {
    from { transform: translate3d(var(--mobile-offset), 0, 0); }
    to { transform: translate3d(calc(var(--mobile-offset) - 50%), 0, 0); }
  }
}

@media (max-width: 480px) {
  .hero-shell {
    padding-top: 101px;
  }

  .hero-title {
    font-size: clamp(28px, 8vw, 32px);
    letter-spacing: -0.04em;
    line-height: 1.12;
  }

  .hero-title__line--logos {
    gap: 5px;
  }

  .hero-title__logos {
    width: clamp(76px, 22vw, 96px);
  }

  .hero-title__line--icon {
    gap: 9px;
  }

  .hero-title__icon-frame {
    width: 58px;
    height: 42px;
    border-radius: 9px;
  }

  .hero-title__icon-frame img {
    width: 30px;
    height: 31px;
  }

  .hero-description {
    max-width: 370px;
    margin-top: 16px;
    font-size: 16px;
    line-height: 1.45;
  }

  .hero-actions {
    grid-template-columns: 1.2fr 0.9fr;
    gap: 10px;
    margin-top: 22px;
  }

  .button {
    min-height: 52px;
    padding-inline: 8px;
    font-size: 15px;
  }

  .button--primary > span {
    white-space: nowrap;
  }

  .button--primary {
    gap: 2px;
  }

  .button--primary img {
    width: 17px;
    height: 17px;
  }

  .button--secondary {
    border-radius: 12px;
  }

  .hero-principles {
    gap: 10px;
    margin-top: 24px;
  }

  .principle-card {
    min-height: 140px;
    padding: 13px 11px;
    border-radius: 18px;
  }

  .principle-card > img {
    width: 23px;
    height: 24px;
  }

  .principle-card h2 {
    margin: 12px 0 7px;
    font-size: 15px;
  }

  .principle-card p {
    font-size: 12px;
    line-height: 1.4;
  }

  .project-gallery--mobile {
    margin-top: 30px;
  }
}

@media (max-width: 600px) and (min-width: 481px) {
  .hero-actions { gap: 10px; }
  .hero-actions .button { padding-inline: 12px; font-size: 16px; }
  .hero-actions .button--primary { gap: 8px; }
  .hero-actions .button--primary > span { white-space: nowrap; }
  .hero-actions .button--primary img { width: 18px; height: 18px; }
}

@media (max-width: 359px) {
  .hero-actions {
    gap: 8px;
    grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
  }

  .button {
    padding-inline: 4px;
    font-size: 15px;
  }

  .hero-title__line--logos {
    gap: 3px;
  }

  .hero-title__logos {
    width: clamp(68px, 20vw, 74px);
  }

  .button--primary {
    gap: 2px;
  }

  .hero-principles {
    grid-template-columns: 1fr;
  }

  .principle-card {
    min-height: 124px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-section::before,
  .hero-section::after {
    animation: none;
    transform: none;
  }

  .hero-glitch::before,
  .hero-glitch::after {
    animation: none;
    opacity: 0;
    transform: none;
  }

  .hero-badge,
  .hero-title,
  .hero-description,
  .hero-actions,
  .hero-principles {
    animation: none;
  }

  .project-gallery__column--up,
  .project-gallery__column--down,
  .project-gallery--mobile,
  .expertise-marquee {
    animation: none;
    filter: none;
    opacity: 1;
    transform: none;
  }

  .button,
  .principle-card {
    transition: none;
  }

  .button::after,
  .principle-card::before,
  .principle-card::after {
    transition: none;
  }

  .button::after,
  .principle-card::after {
    display: none;
  }

  .button--primary:hover img {
    transform: none;
  }

  .project-gallery__track,
  .project-gallery__column--up .project-gallery__track,
  .project-gallery__column--down .project-gallery__track,
  .project-gallery--mobile .project-gallery__track {
    animation: none;
    transform: none;
  }
}
