* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: #031917;
  font-family: Arial, Helvetica, sans-serif;
}

main {
  --image-half: min(50vmin, 512px);
  --edge-fade: min(14vmin, 110px);
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  overflow: hidden;
  padding: 24px;
  background: #02110f;
}

main::before,
main::after {
  position: absolute;
  content: "";
}

main::before {
  inset: -24px;
  z-index: -2;
  background: url("salami.jpg") center / cover no-repeat;
  filter: blur(18px) brightness(0.32) saturate(0.9);
  transform: scale(1.04);
}

main::after {
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgb(0 10 9 / 32%), rgb(0 10 9 / 50%)),
    url("salami.jpg") center / min(100vmin, 1024px) no-repeat;
  animation: scene-in 700ms ease-out both;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

h1 {
  margin: 0;
  color: transparent;
  background: linear-gradient(180deg, #f4fff9 10%, #a5cabb 100%);
  background-clip: text;
  -webkit-background-clip: text;
  filter: drop-shadow(0 8px 24px rgb(0 0 0 / 58%));
  font-size: clamp(38px, 5vw, 58px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.045em;
  animation: heading-in 650ms 80ms ease-out both;
}

.telegraph-link {
  position: relative;
  display: inline-flex;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-width: min(400px, calc(100vw - 32px));
  margin-bottom: max(0px, env(safe-area-inset-bottom));
  padding: 24px 48px;
  color: #fff;
  border: 1px solid #49635f;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 2%), transparent 42%),
    #031b19;
  box-shadow:
    0 16px 44px rgb(0 0 0 / 48%),
    inset 0 1px rgb(255 255 255 / 5%);
  font-size: clamp(20px, 2.2vw, 23px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  text-shadow:
    0 1px 10px rgb(0 25 20 / 62%),
    0 0 22px rgb(255 255 255 / 18%);
  text-decoration: none;
  animation:
    button-in 650ms 180ms cubic-bezier(0.2, 0.75, 0.25, 1) both,
    button-idle 2.6s 1s ease-in-out infinite;
  transition:
    background 200ms ease,
    border-color 200ms ease,
    box-shadow 200ms ease;
}

.telegraph-link::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 34%;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 22%), transparent);
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: translateX(-180%) skewX(-18deg);
}

.telegraph-link::after {
  position: absolute;
  inset: 3px;
  border: 1px solid rgb(255 255 255 / 4%);
  border-radius: inherit;
  box-shadow:
    inset 0 0 14px rgb(255 255 255 / 4%),
    inset 0 -5px 14px rgb(0 31 24 / 24%);
  content: "";
  pointer-events: none;
}

.telegraph-link span {
  position: relative;
  z-index: 1;
}

.telegraph-link .link-arrow {
  font-size: 18px;
  font-weight: 400;
}

.telegraph-link:hover {
  border-color: #718a85;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 4%), transparent 42%),
    #06231f;
  box-shadow:
    0 16px 44px rgb(0 0 0 / 52%),
    inset 0 1px rgb(255 255 255 / 7%);
}

.telegraph-link:hover::before {
  animation: button-shine 850ms ease-out;
}

.telegraph-link:focus-visible {
  outline: 3px solid #91aaa5;
  outline-offset: 4px;
}

@keyframes scene-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes button-in {
  from {
    opacity: 0;
    scale: 0.92;
  }

  to {
    opacity: 1;
    scale: 1;
  }
}

@keyframes heading-in {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes button-shine {
  0% {
    opacity: 0;
    transform: translateX(-180%) skewX(-18deg);
  }

  20% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translateX(420%) skewX(-18deg);
  }
}

@keyframes button-idle {
  0%,
  100% {
    filter: brightness(1) saturate(1) drop-shadow(0 0 0 rgb(54 163 137 / 0%));
    transform: scale(1);
  }

  50% {
    filter: brightness(1.2) saturate(1.14) drop-shadow(0 0 18px rgb(54 190 157 / 52%));
    transform: scale(1.025);
  }
}

@media (max-width: 600px) {
  main {
    padding: 16px;
  }

  main::before {
    background:
      linear-gradient(#064537, #02271f),
      url("salami.jpg") center / cover no-repeat;
    background-blend-mode: color, normal;
    filter: blur(5px) brightness(0.24) saturate(1.1);
  }

  main::after {
    -webkit-mask-image:
      linear-gradient(
        to right,
        transparent calc(50% - var(--image-half)),
        #000 calc(50% - var(--image-half) + var(--edge-fade)),
        #000 calc(50% + var(--image-half) - var(--edge-fade)),
        transparent calc(50% + var(--image-half))
      ),
      linear-gradient(
        to bottom,
        transparent calc(50% - var(--image-half)),
        #000 calc(50% - var(--image-half) + var(--edge-fade)),
        #000 calc(50% + var(--image-half) - var(--edge-fade)),
        transparent calc(50% + var(--image-half))
      );
    -webkit-mask-composite: source-in;
    mask-image:
      linear-gradient(
        to right,
        transparent calc(50% - var(--image-half)),
        #000 calc(50% - var(--image-half) + var(--edge-fade)),
        #000 calc(50% + var(--image-half) - var(--edge-fade)),
        transparent calc(50% + var(--image-half))
      ),
      linear-gradient(
        to bottom,
        transparent calc(50% - var(--image-half)),
        #000 calc(50% - var(--image-half) + var(--edge-fade)),
        #000 calc(50% + var(--image-half) - var(--edge-fade)),
        transparent calc(50% + var(--image-half))
      );
    mask-composite: intersect;
  }

  .telegraph-link {
    min-width: 0;
    width: min(100%, 360px);
    padding: 22px 30px;
  }

  .hero-content {
    gap: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  main::after,
  h1,
  .telegraph-link,
  .telegraph-link::before {
    animation: none;
  }

  .telegraph-link {
    transition: none;
  }
}
