@keyframes brickstoneVariation {
  0% {
    font-weight: 100;
    font-variation-settings: 'wght' 100, 'wdth' 85;
    letter-spacing: -0.02em;
    opacity: 0.85;
  }
  20% {
    font-weight: 300;
    font-variation-settings: 'wght' 300, 'wdth' 88;
    letter-spacing: -0.015em;
    opacity: 0.9;
  }
  40% {
    font-weight: 500;
    font-variation-settings: 'wght' 500, 'wdth' 92;
    letter-spacing: -0.005em;
    opacity: 0.95;
  }
  60% {
    font-weight: 700;
    font-variation-settings: 'wght' 700, 'wdth' 96;
    letter-spacing: 0.005em;
    opacity: 1;
  }
  80% {
    font-weight: 400;
    font-variation-settings: 'wght' 400, 'wdth' 90;
    letter-spacing: -0.01em;
    opacity: 0.93;
  }
  100% {
    font-weight: 100;
    font-variation-settings: 'wght' 100, 'wdth' 85;
    letter-spacing: -0.02em;
    opacity: 0.85;
  }
}

/* Vendor prefixes for broader compatibility */
@-webkit-keyframes brickstoneVariation {
  0% {
    font-weight: 100;
    font-variation-settings: 'wght' 100, 'wdth' 85;
    letter-spacing: -0.02em;
    opacity: 0.85;
  }
  20% {
    font-weight: 300;
    font-variation-settings: 'wght' 300, 'wdth' 88;
    letter-spacing: -0.015em;
    opacity: 0.9;
  }
  40% {
    font-weight: 500;
    font-variation-settings: 'wght' 500, 'wdth' 92;
    letter-spacing: -0.005em;
    opacity: 0.95;
  }
  60% {
    font-weight: 700;
    font-variation-settings: 'wght' 700, 'wdth' 96;
    letter-spacing: 0.005em;
    opacity: 1;
  }
  80% {
    font-weight: 400;
    font-variation-settings: 'wght' 400, 'wdth' 90;
    letter-spacing: -0.01em;
    opacity: 0.93;
  }
  100% {
    font-weight: 100;
    font-variation-settings: 'wght' 100, 'wdth' 85;
    letter-spacing: -0.02em;
    opacity: 0.85;
  }
}

.brickstone-animated-text {
  font-family: 'Brickstone', sans-serif;
  font-size: 7rem;
  animation: brickstoneVariation 7s cubic-bezier(0.445, 0.05, 0.55, 0.95) infinite;
  -webkit-animation: brickstoneVariation 7s cubic-bezier(0.445, 0.05, 0.55, 0.95) infinite;
  will-change: font-variation-settings, font-weight, letter-spacing, opacity;
  
  /* Base protection measures */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  
  /* Add a subtle text shadow for depth */
  text-shadow: 0 1px 2px rgba(0,0,0,0.05);
  
  /* Better rendering */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.brickstone-container {
  position: relative;
  overflow: hidden;
  text-align: center;
  margin: 2rem 0;
  pointer-events: none; /* Prevents interaction */
}

/* Transparent protective layer */
.brickstone-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  z-index: 10;
}

/* Optional: text elements with different animations */
.brickstone-sample1 {
  animation-duration: 8s;
  -webkit-animation-duration: 8s;
}

.brickstone-sample2 {
  animation-duration: 9s;
  -webkit-animation-duration: 9s;
  animation-delay: 0.3s;
  -webkit-animation-delay: 0.3s;
}

.brickstone-sample3 {
  animation-duration: 7.5s;
  -webkit-animation-duration: 7.5s;
  animation-delay: 0.6s;
  -webkit-animation-delay: 0.6s;
}

/* Responsive sizing */
@media screen and (max-width: 768px) {
  .brickstone-animated-text {
    font-size: 3.5rem;
  }
}

@media screen and (max-width: 480px) {
  .brickstone-animated-text {
    font-size: 2.5rem;
  }
}