*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

input, button, textarea, select {
  font: inherit;
}

:root {
  --primary-color: #E2131D;
  --bg-color: #262736;
}

@font-face {
  font-family: 'Buyan';
  src: url('/assets/fonts/BuyanRegular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Buyan';
  src: url('/assets/fonts/BuyanBold.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

.welcome-block {
  background-color: var(--bg-color);
  background-image: url('/assets/img/welcome-bg.png');
  background-size: cover;
  background-position: center;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px 40px;
  gap: 30px;
}

.logo {
  position: absolute;
  top: 20px;
  left: clamp(16px, 5%, 60px);
}

.logo img {
  width: clamp(120px, 12vw, 250px);
  display: block;
}

.partner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.partner img {
  height: clamp(60px, 12vw, 130px);
  width: auto;
}

.partner p {
  margin-top: 12px;
  font-family: 'Buyan', serif;
  color: white;
  font-size: clamp(16px, 2vw, 28px);
  text-align: center;
}

.loader {
  position: relative;
  width: clamp(60px, 12vw, 150px);
  height: clamp(60px, 12vw, 150px);
  flex-shrink: 0;
}

.loader span {
  position: absolute;
  width: 40%;
  height: 40%;
  background-color: var(--primary-color);
  animation: chase 2s linear infinite;
}

.loader span:nth-child(2) { animation-delay: 0.7s; }
.loader span:nth-child(3) { animation-delay: 1.4s; }

@keyframes chase {
  0%    { top: 0;   left: 0; }
  12.5% { top: 0;   left: 50%; }
  25%   { top: 0;   left: 50%; }
  37.5% { top: 50%; left: 50%; }
  50%   { top: 50%; left: 50%; }
  62.5% { top: 50%; left: 0; }
  75%   { top: 50%; left: 0; }
  87.5% { top: 0;   left: 0; }
  100%  { top: 0;   left: 0; }
}

.site-info {
  font-family: 'Buyan', serif;
  font-size: clamp(20px, 5vw, 50px);
  color: white;
  text-align: center;
}

.mail-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  margin-top: 10px;
}

.letter-image {
  position: relative;
  width: 200px;
  height: 200px;
  cursor: pointer;
}

.animated-mail {
  position: absolute;
  height: 150px;
  width: 200px;
  transition: 0.4s;
}

.animated-mail .body {
  position: absolute;
  bottom: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 0 100px 200px;
  border-color: transparent transparent #e95f55 transparent;
  z-index: 2;
}

.animated-mail .top-fold {
  position: absolute;
  top: 50px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 50px 100px 0 100px;
  transform-origin: 50% 0%;
  transition: transform 0.4s 0.4s, z-index 0.2s 0.4s;
  border-color: #cf4a43 transparent transparent transparent;
  z-index: 2;
}

.animated-mail .back-fold {
  position: absolute;
  bottom: 0;
  width: 200px;
  height: 100px;
  background: #cf4a43;
  z-index: 0;
}

.animated-mail .left-fold {
  position: absolute;
  bottom: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 50px 0 50px 100px;
  border-color: transparent transparent transparent #e15349;
  z-index: 2;
}

.animated-mail .letter {
  left: 20px;
  bottom: 0;
  position: absolute;
  width: 160px;
  height: 60px;
  background: white;
  z-index: 1;
  overflow: hidden;
  transition: 0.4s 0.2s;
}

.animated-mail .letter .letter-border {
  height: 10px;
  width: 100%;
  background: repeating-linear-gradient(
    -45deg,
    #cb5a5e, #cb5a5e 8px,
    transparent 8px, transparent 18px
  );
}

.animated-mail .letter .letter-title {
  margin-top: 10px;
  margin-left: 5px;
  height: 10px;
  width: 40%;
  background: #cb5a5e;
}

.animated-mail .letter .letter-context {
  margin-top: 10px;
  margin-left: 5px;
  height: 10px;
  width: 20%;
  background: #cb5a5e;
}

.animated-mail .letter .letter-stamp {
  margin-top: 30px;
  margin-left: 120px;
  border-radius: 100%;
  height: 30px;
  width: 30px;
  background: #cb5a5e;
  opacity: 0.3;
}

.shadow {
  position: absolute;
  top: 200px;
  left: 50%;
  width: 400px;
  height: 30px;
  transition: 0.4s;
  transform: translateX(-50%);
  border-radius: 100%;
  background: radial-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0), rgba(0, 0, 0, 0));
}

.letter-image:hover .animated-mail {
  transform: translateY(50px);
}

.letter-image:hover .animated-mail .top-fold {
  transition: transform 0.4s, z-index 0.2s;
  transform: rotateX(180deg);
  z-index: 0;
}

.letter-image:hover .animated-mail .letter {
  height: 180px;
}

.letter-image:hover .shadow {
  width: 250px;
}

.mail-info {
  font-family: 'Buyan', serif;
  font-size: clamp(16px, 3vw, 22px);
  color: #E85F56;
  text-align: center;
  margin-top: 10px;
}


@media (max-width: 480px) {
  .welcome-block {
    padding: 70px 16px 30px;
    gap: 20px;
  }

  .logo img {
    width: 100px;
  }

  .letter-image {
    transform: scale(0.75);
    transform-origin: top center;
    height: 160px;
  }

  .shadow {
    width: 300px;
  }
}

@media (max-height: 600px) {
  .welcome-block {
    padding: 70px 20px 20px;
    gap: 15px;
    justify-content: flex-start;
  }

  .partner img {
    height: 60px;
  }

  .loader {
    width: 50px;
    height: 50px;
  }

  .letter-image {
    transform: scale(0.65);
    transform-origin: top center;
    height: 140px;
  }
}

@media (min-width: 481px) and (max-width: 1024px) {
  .welcome-block {
    gap: 25px;
  }
}
