@layer reset, base;

@layer base {
  :root {
    --color-pink: #ff69b4;
    --color-pink-dark: #ff1493;
    --color-yellow: #ffd700;
    --color-orange: #ffa500;
    --color-orange-dark: #ff8c00;
    --color-aqua: #00e5ff;
    --color-aqua-dark: #00ced1;
    --bg-gradient: linear-gradient(135deg, #fff0f5 0%, #fffacd 50%, #ffe4b5 100%);
    --text-color: #333;
  }

  body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-block-size: 100vh;
    padding: 2rem;
    overflow: hidden;
    background-image: var(--bg-gradient);
    background-size: cover;
    background-repeat: no-repeat;
    color: var(--text-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-align: center;
  }

  h1 {
    z-index: 10;
    position: relative;
    margin-bottom: 1rem;
    background: linear-gradient(to right, var(--color-pink-dark), var(--color-orange-dark));
    background-clip: text;
    color: transparent;
    font-size: clamp(3rem, 6vw, 5rem);
    animation: slideUp 1s ease-out forwards;
    user-select: none;
  }

  @keyframes slideUp {
    from {
      transform: translateY(50px);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
}

.particle {
  z-index: 100;
  position: absolute;
  width: var(--size, 10px);
  height: var(--size, 10px);
  transform-origin: center center;
  border-radius: 50%;
  animation: explode var(--fade-duration) ease-out var(--fade-delay) forwards;
  opacity: 0;
  pointer-events: none;
}

@keyframes explode {
  0% {
    transform: translate(-50%, -50%) rotate(var(--angle)) translateX(0);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) rotate(var(--angle)) translateX(var(--distance));
    opacity: 0;
  }
}

@layer reset {
  /* 1. Use a more-intuitive box-sizing model */
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  /* 2. Remove default margin */
  * {
    margin: 0;
  }

  /* 3. Enable keyword animations */
  @media (prefers-reduced-motion: no-preference) {
    html {
      interpolate-size: allow-keywords;
    }
  }

  body {
    /* 4. Add accessible line-height */
    line-height: 1.5;
    /* 5. Improve text rendering */
    -webkit-font-smoothing: antialiased;
  }

  /* 6. Improve media defaults */
  img,
  picture,
  video,
  canvas,
  svg {
    display: block;
    max-inline-size: 100%;
  }

  img {
    font-style: italic;
  }

  /* 7. Inherit fonts for form controls */
  input,
  button,
  textarea,
  select {
    font: inherit;
  }

  /* 8. Avoid text overflows */
  p,
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    overflow-wrap: break-word;
  }

  /* 9. Improve line wrapping */
  p {
    text-wrap: pretty;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    text-wrap: balance;
  }

  em {
    font-style: normal;
  }
}
