:root {
  --primary-color: #087c35;
  --secondary-color: #cca90c;
  --base-font-size: 16px;
}

@font-face {
  font-family: 'Cairo';
  src: url('assets/fonts/Cairo-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cairo';
  src: url('assets/fonts/Cairo-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

body {
  margin: 0;
  font-family: 'Cairo', sans-serif;
  background-color: #f4f4f4;
}

html {
  --width: min(0.3906vw, 7.5px);
  font-size: calc(var(--base-font-size) + var(--width));
  animation: root-anim 5s forwards;
}

@keyframes root-anim {
  0% {
    overflow: hidden;
  }
  100% {
    overflow: auto;
  }
}

* {
  box-sizing: border-box;
}

main {
  display: flex;
  width: 100%;
  height: 100vh;
  height: 100svh;
  background-color: white;
  margin: auto;
}

.wrapper {
  flex: 1;
  display: grid;
}

.bg {
  grid-area: 1 / 1;
  width: 100%;
  height: 50%;
  background-color: var(--primary-color);
  border-bottom-right-radius: 50px;
  border-bottom-left-radius: 50px;
}

.contents {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 5rem;
}

.empty {
  flex: 0.2;
  width: 100%;
}

.cards {
  flex: 4;
  display: flex;
  flex-direction: row;
  justify-content: space-evenly;
  align-items: center;
  padding: 0 2rem;
  gap: 2rem;
}

.card {
  --animation-duration: 1s;

  flex: 1 1 0;
  width: 0;
  display: grid;
  border-radius: 100px;
  background-color: #d9d9d9;
  text-decoration: none;
  overflow: hidden;
  overflow: clip;
  animation: card var(--animation-duration) var(--easing-elastic) forwards, opacity-anim 200ms linear both;
  animation-delay: var(--animation-delay, 0s);
}

.card-bg {
  grid-area: 1 / 1;
  border-radius: inherit;
  background-color: #fff;
  height: 40%;
  animation: card-bg var(--animation-duration) var(--easing-elastic) forwards;
  animation-delay: var(--animation-delay, 0s);
}

@keyframes card-bg {
  0% {
    height: 100%;
  }
  100% {
    height: 40%;
  }
}

@keyframes card-item {
  0% {
    opacity: 0;
    transform: scale(0);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes card {
  0% {
    transform: translateY(50%);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes opacity-anim {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.card-content {
  grid-area: 1 / 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2rem;
  padding: 2rem;
}

.card-content img {
  margin: auto;
  width: 100%;
  height: auto;
  object-fit: cover;
  filter: drop-shadow(4px 4px 10px rgba(0, 0, 0, 0.2));
  animation: card-item var(--animation-duration) var(--easing-elastic) forwards;
  animation-delay: var(--animation-delay, 0s);
}

.card-title {
  text-align: center;
  background-color: var(--primary-color);
  border-radius: 50px;
  color: #fff;
  padding: 1rem;
  font-size: 0.7rem;
  animation: card-item var(--animation-duration) var(--easing-elastic) forwards;
  animation-delay: var(--animation-delay, 0s);
}

.card-title * {
  margin: 0;
  text-wrap: nowrap;
  text-overflow: ellipsis;
  font-size: min(1vw, 1rem);
}

.footer {
  flex: 0.5;
  width: 95%;
  margin: 0 auto;
  background-color: var(--secondary-color);
  border-top-right-radius: 100px;
  border-top-left-radius: 100px;
}

.share-button {
  display: block;
  text-align: center;
  text-decoration: none;
  font-size: 1rem;
  font-weight: bold;
  padding: 0.5rem;
  color: #fff;
  background-color: var(--primary-color);
  border-radius: 100px;
  margin: auto;
  transform: translateY(-50%);
  width: 60%;
  border: none;
  font-family: inherit;
  cursor: pointer;
}

.qr-code {
  border: none;
  background-color: transparent;
  translate: 0 100%;
  opacity: 0;
  transition: opacity 0.2s, translate 0.5s ease, display 0.2s allow-discrete;
}

.qr-code:popover-open {
  opacity: 1;
  translate: 0 0;
}

.qr-code::backdrop {
  background-color: rgba(0, 0, 0, 0.2);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

@starting-style {
  .qr-code:popover-open {
    opacity: 0;
    translate: 0 100%;
  }
}
.qr-code .contents {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  gap: 2rem;
  border-radius: 100px;
  background-color: #f4f4f4;
  box-shadow: 0 0 7px rgba(0, 0, 0, 0.2);
}

.qr-code .img {
  width: min(50vw, 400px);
  aspect-ratio: 1;
  padding: 1rem;
  border-radius: 50px;
  background-color: #fff;
}

.qr-code .img img {
  width: 100%;
  height: 100%;
}

.qr-title p {
  text-align: center;
  margin: 0;
}

.qr-title h2 {
  text-align: center;
  color: var(--primary-color);
  margin: 0;
}

@media screen and (max-width: 1400px) {
  .cards {
    gap: 1rem;
    padding: 0 1rem;
  }

  .card {
    border-radius: 2em;
  }

  .card-content {
    padding: 0.5rem;
  }

  .card-content img {
    border-radius: 12px;
  }
}

main {
  --easing-elastic: linear(
    0,
    0.214,
    0.537,
    0.778,
    0.94,
    1.043,
    1.101,
    1.124,
    1.122,
    1.104,
    1.063,
    1.002,
    0.951,
    0.924,
    0.916,
    0.92,
    0.938,
    0.968,
    1.001,
    1.026,
    1.041,
    1.047,
    1.046,
    1.037,
    1.022,
    1.007,
    0.995,
    0.987,
    0.983,
    0.983,
    0.985,
    0.989,
    0.992,
    0.997,
    1.001,
    1.003,
    1.002,
    1.001,
    0.999,
    0.997,
    0.996,
    0.996,
    0.996,
    0.996,
    0.997,
    0.997,
    0.998,
    0.998,
    0.999,
    1
  );
}
