<template>
  <header>
    <div class="logo">
      KP
      <br>
      TL
    </div>
  </header>

  <div class="grid">
    <div class="card">
      <p class="card__title">
        TeamSpeak
      </p>

      <img src="/ts.png" alt="TeamSpeak" class="card__image">

      <a class="button card__action" href="https://invite.teamspeak.com/koptilnya.xyz/">
        Подключиться
      </a>
    </div>

    <div class="card">
      <p class="card__title">
        Dota 2
      </p>

      <img src="/dota.png" alt="Dota 2" class="card__image">

      <a class="button card__action" href="steam://run/570">
        Запустить
      </a>
    </div>

    <div class="card">
      <p class="card__title">
        Gitea
      </p>

      <img src="/gitea.svg" alt="Gitea" class="card__image">

      <a class="button card__action" href="https://git.koptilnya.xyz">
        Перейти
      </a>
    </div>

    <div class="card">
      <p class="card__title">
        Owncast
      </p>

      <img src="/obs.png" alt="Open Broadcaster Software" class="card__image">

      <a class="button card__action" href="https://live.koptilnya.xyz">
        Перейти
      </a>
    </div>
  </div>
</template>

<script setup lang="ts">
</script>

<style lang="scss">
@mixin mobile {
  @media (max-width: 600px) {
    @content;
  }
}

header {
  text-align: center;
  padding-block: 16px;
  margin-bottom: 16px;
}

.logo {
  display: inline-block;
  text-align: center;
  font-size: 32px;
  line-height: 1;
  width: 64px;
  text-transform: uppercase;
  font-weight: 700;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-image: linear-gradient(90deg, var(--beaver), var(--walnut-brown));
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;

  @include mobile {
    grid-template-columns: 1fr;
  }
}

.card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  justify-items: flex-start;
  border-radius: 16px;
  padding: 16px;
  gap: 16px;
  background-image: linear-gradient(90deg, var(--chocolate-cosmos), var(--black));

  &__title {
    font-size: 24px;
    font-weight: 700;
  }

  &__image {
    width: 80px;
    grid-row: span 2;
    opacity: 0.7;
  }

  &__action {
    grid-row: 2;
  }
}

.button {
  display: inline-block;
  text-decoration: none;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  background-image: linear-gradient(135deg, var(--beaver) 0%, var(--beaver) 51%, var(--walnut-brown) 110%);
  background-size: 200% auto;
  background-color: var(--walnut-brown);
  background-repeat: repeat;
  color: var(--white-smoke);
  font-weight: 500;
  transition: .15s ease-out;
  transition-property: color, background-position;

  &:hover:not(:active) {
    background-position: right center;
  }
}
</style>
