/*
 * This file is part of the UX SDC Bundle
 *
 * (c) Jozef Môstka <https://github.com/tito10047/ux-sdc>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

@layer components {
  .magic {
    padding-block: var(--space-2xl);
    background: var(--color-surface);
    position: relative;
    overflow: hidden;

    &::before, &::after {
      content: "";
      position: absolute;
      left: 0;
      right: 0;
      height: 40px;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='40' viewBox='0 0 80 40' fill='none' stroke='%23C2A66B' stroke-width='1' opacity='0.2'%3E%3Cpath d='M0 20h10v-10h20v20h-15v-5h10v-5h-15v15h25v-25h15v10h20v20h-15v-5h10v-5h-15v15h25v-25h10'/%3E%3C/svg%3E");
      background-repeat: repeat-x;
      opacity: 0.15;
      pointer-events: none;
      z-index: 0;
    }

    &::before { top: 0; }
    &::after { bottom: 0; transform: rotate(180deg); }

    & .magic__header {
      position: relative;
      z-index: 1;
      text-align: center;
      margin-bottom: var(--space-2xl);
    }

    & .magic__title {
      font-family: var(--font-serif);
      font-size: var(--size-step-1);
      color: var(--color-primary);
      text-transform: uppercase;
      letter-spacing: 0.1em;
      margin-bottom: var(--space-xs);
    }

    & .magic__subtitle {
      font-family: var(--font-serif);
      font-size: var(--size-step-3);
      margin-bottom: var(--space-m);
    }

    & .magic__grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
      gap: var(--space-xl);
    }

    & .magic__feature {
      text-align: center;
      padding: var(--space-xl) var(--space-l);
      transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
      background: color-mix(in oklab, var(--color-surface-variant) 20%, transparent);
      border-radius: var(--radius-m);
      border: 1px solid transparent;

      &:hover {
        transform: translateY(-10px);
        background: var(--color-surface-variant);
        border-color: color-mix(in oklab, var(--color-primary) 30%, transparent);
        box-shadow: var(--shadow-m);
      }
    }

    & .magic__icon {
      width: 70px;
      height: 70px;
      margin-inline: auto;
      margin-bottom: var(--space-l);
      color: var(--color-primary);
      background: color-mix(in oklab, var(--color-primary) 8%, transparent);
      border-radius: 50%;
      padding: var(--space-m);
      display: grid;
      place-items: center;

      & svg {
        width: 100%;
        height: 100%;
        stroke: var(--color-primary);
        filter: drop-shadow(0 0 5px rgba(194, 166, 107, 0.3));
      }
    }

    & .magic__feature-title {
      font-family: var(--font-serif);
      font-size: var(--size-step-1);
      margin-bottom: var(--space-s);
    }

    & .magic__feature-description {
      font-size: var(--size-step-0);
      opacity: 0.8;
      line-height: 1.6;
    }
  }
}
