:root {
    --color-bg: #14111E;
    --color-fg: #A82236;
    --color-link: #7d7580;
    --color-link-visited: #7d6982;
    --color-link-hover: #C792D4;
}

html, body {
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: "Fira Code";
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

.container {
  display: grid;
  grid-template-columns: 1fr 460px 600px 1fr;
  grid-template-areas: ". left right .";
  column-gap: 80px;
  justify-items: center;
  align-items: center;
  min-height: 100%;
  box-sizing: border-box;
}

.left-container {
  grid-area: left;
  aspect-ratio: 1/1;
  width: 100%;
  max-width: 460px;
}

.right-container {
  grid-area: right;
  height: 50%;
  width: 100%;
  max-width: 600px;
}

.gif img {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

.head {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 40px;
  padding-top: 60px;
}

.category {
  display: flex;
  flex-direction: column;
  width: 180px;
}

.bookmarks {
  display: flex;
  justify-content: center;
}

.links {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 20px;
  padding-bottom: 20px;
}

.title {
  font-size: 20px;
}

li {
  font-size: 16px;
  list-style-type: none;
  padding: 5px;
}

a:link {
  text-decoration: none;
  color: var(--color-link);
}

a:visited {
  color: var(--color-link-visited);
}

a:hover {
  color: var(--color-link-hover);
}

.blinking {
  animation: opacity 1s ease-in-out infinite;
  opacity: 1;
}

@keyframes opacity {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* Адаптивная верстка для планшетов и меньших экранов */
@media screen and (max-width: 1200px) {
  .container {
    grid-template-columns: 1fr 400px 500px 1fr;
    column-gap: 60px;
  }
  
  .left-container {
    max-width: 400px;
  }
  
  .right-container {
    max-width: 500px;
  }
  
  .head {
    font-size: 32px;
  }
}

@media screen and (max-width: 992px) {
  .container {
    grid-template-columns: 1fr 350px 450px 1fr;
    column-gap: 40px;
  }
  
  .left-container {
    max-width: 350px;
  }
  
  .right-container {
    max-width: 450px;
  }
  
  .head {
    font-size: 28px;
  }
}

/* МОБИЛЬНАЯ версия - текст ровно в 10px под гифкой */
@media screen and (max-width: 768px) {
  .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 80px 20px 40px;
    min-height: 100vh;
    gap: 10px;
  }
  
  .left-container {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1/1;
  }
  
  .right-container {
    width: 100%;
    height: auto;
    max-width: 400px;
  }
  
  .head {
    font-size: 24px;
    padding-top: 0;
    text-align: center;
  }
  
  .head p {
    margin: 0;
    word-wrap: break-word;
    line-height: 1.4;
  }
}

/* Маленькие мобильные устройства */
@media screen and (max-width: 480px) {
  .container {
    padding: 60px 15px 30px;
  }
  
  .left-container {
    max-width: 280px;
  }
  
  .right-container {
    max-width: 280px;
  }
  
  .head {
    font-size: 18px;
  }
  
  .title {
    font-size: 18px;
  }
  
  li {
    font-size: 14px;
  }
}

/* Очень маленькие экраны */
@media screen and (max-width: 360px) {
  .left-container {
    max-width: 240px;
  }
  
  .right-container {
    max-width: 240px;
  }
  
  .head {
    font-size: 16px;
  }
}
