@font-face {
  font-family: 'ComicSansFallback';
  src: url('fonts/ComicSansFallback.woff2') format('woff2'),
       url('fonts/ComicSansFallback.woff') format('woff');
  font-display: swap;
}

body {
    font-family: "Comic Sans MS", "ComicSansFallback", sans-serif;
    background-color: #fffaf9;
    color: #dd4a4a;
    text-align: center;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

::selection {
    background-color: #dd4a4a;
    color: #fffaf9;
}

a:focus,
summary:focus {
    outline: none;
    box-shadow: 0 0 0 2px #dd4a4a;
}

a,
a:visited {
    color: #dd4a4a;
}

a:hover,
a:focus:hover {
    color: #ff656a;
}

body a {
    -webkit-tap-highlight-color: transparent;
}

header {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    gap: 20px;
    position: relative;
    height: fit-content;
    padding: 15px 0px 0px 0px;
    margin: 0;
}

header::before {
    content: "";
    position: absolute;
    top: 15%;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #dd4a4a;
    transform: translateY(-50%);
    z-index: -1;
}

h1,
h2 {
    margin: 0;
}

header img.basiileaf-cat {
    width: 60px;
    height: 60px;
}

@media (hover: hover) and (pointer: fine) {
    header img.basiileaf-cat:first-child:hover {
    transform: rotate(360deg);
    transition: transform 0.5s ease-in-out;
    }
    header img.basiileaf-cat:last-child:hover {
        transform: rotate(-360deg);
        transition: transform 0.5s ease-in-out;
    }
}

@media (hover: none) or (any-pointer: coarse) {
    header img.basiileaf-cat:first-child.spin {
        transform: rotate(360deg);
        transition: transform 0.5s ease-in-out;
    }
    header img.basiileaf-cat:last-child.spin {
        transform: rotate(-360deg);
        transition: transform 0.5s ease-in-out;
    }
}

.title-span-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3px;
}

.span-shift > span > span {
  display: inline-block;
  animation: snapColorCycle 2.5s infinite running;
  animation-delay: calc(var(--i) * -0.5s); 
  -webkit-text-stroke: 1px #362329;
}

.span-shift:hover > span > span {
  cursor: pointer;
}

.span-shift.shifting > span > span {
  animation-play-state: paused;
}

@keyframes snapColorCycle {
  0%, 19.99%   { color: #ff656a; } 
  20%, 39.99%  { color: #ff9f00; } 
  40%, 59.99%  { color: #ffc600; } 
  60%, 79.99%  { color: #4cd6f8; } 
  80%, 100%    { color: #38d394; } 
}

.intro-text {
    padding: 0 40px;
}

.intro-text p {
    margin: 0 0 30px 0;
}

@media (max-width: 500px) {
    .intro-text {
        padding: 15px;
    }
    .intro-text p {
        margin: 0 0 5px 0;
    }
    header {
        gap: 10px;
    }
    main.cards-container {
        gap: 30px;
    }
}

.semicircle-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    color: #fff0f0;
    background-color: #db6161;
    width: 170px;
    padding: 20px 30px 10px 30px;
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

.cards-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 10px 20px;
}

.card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background-color: #fff0f0;
    border: 2px solid #dd4a4a;
    width: 260px;
    padding: 15px;
    border-radius: 10px;
}

.card .image-link {
    height: 250px;
    width: 250px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    border: 2px solid #dd4a4a;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
    transition: opacity 0.5s ease-in-out;
}

.star-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(228, 112, 112, 0.99); 
  pointer-events: none; 
  mask-image:
    linear-gradient(black, black), 
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-2 -2 28 28'%3E%3Cpath d='M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z' fill='black' stroke='black' stroke-width='2.5' stroke-linejoin='round'/%3E%3C/svg%3E"); 
  mask-repeat: no-repeat, no-repeat;
  mask-position: center, center;
  mask-size: 100% 100%, 280px;
  mask-composite: destination-out;
  mask-composite: exclude;
  transition: mask-size 0.5s ease-in-out;
}

.image-link:hover .star-overlay {
  mask-size: 100% 100%, 1000px;
}

.image-link:hover .card-image {
    opacity: 1;
}

.image-link:hover {
    border: 2px solid #db6161;
}

@media (hover: none) or (any-pointer: coarse) {
  .image-link:hover .star-overlay {
    mask-size: 100% 100%, 280px; 
    transition: mask-size 0.3s ease-in;
  }
  .image-link.is-in-view .star-overlay {
    mask-size: 100% 100%, 1000px;
    transition: mask-size 0.5s ease-in-out;
  }
}

.card .text-link {
    margin-top: 10px;
    text-decoration: none;
    color: #dd4a4a;
    font-size: 1.17em;
    font-weight: bold;
}

.card .text-link:hover {
    text-decoration: underline;
}

.card .go-to-btn {
    margin: 5px 0 10px 0;
    padding: 4px 10px 8px 10px;
    background-color: #db6161;
    color: #fff0f0;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    font-size: 1.1em;
    width: 240px;
}
.card .go-to-btn:hover {
    background-color: #eb4e4e;
    color: #ffffff;
}

.card summary {
    cursor: pointer;
    color: #dd4a4a;
    font-size: 0.8em;
}

.card p {
    margin: 5px 0 25px 0;
}

.socials {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.socials a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #dd4a4a;
    transition: all 0.3s ease-in-out;
}

.socials a:hover {
    filter: brightness(1.2);
    transform: translateY(-1px);
}

.socials a p.social-label {
    font-size: 0.75em;
    color: #654b5e;
    margin: 0;
}

.socials img {
    filter: brightness(0) saturate(100%) invert(30%) sepia(22%) saturate(562%) hue-rotate(264deg) brightness(92%) contrast(83%);
    width: 26px;
}

.socials-container h2 {
    margin: 50px 0 10px 0;
}

footer {
    margin-top: 80px;
    font-size: 0.9em;
    position: relative;
    padding: 0 15px;
}
