@font-face {
  font-family: "Maledicta";
  src: url("./fonts/ghost-theory-txt.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  /* button sizes */
  --button-width: clamp(280px, 82vw, 320px);
  --button-height: clamp(58px, 15.5vw, 68px);
  --button-left-width: calc(var(--button-height) * 1.309);
  --button-right-width: calc(var(--button-height) * 1.294);

  /* width of the torn-paper layer. */
  --strip-width: min(94vw, 460px);
}

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

html {
  min-height: 100%;
  background: #050505;
}

body {
  position: relative;
  isolation: isolate;
  margin: 0;
  min-height: 100svh;
  overflow-x: hidden;

  color: #f3eee7;
  font-family: "Maledicta", Georgia, serif;
  background: #050505;
}

body::after,
body::before {
  content: "";
  position: fixed;
  inset: -2px;
  pointer-events: none;
}

body::after {
  z-index: 0;
  background:
    #050505 url("./assets/Sfondo.svg") center / cover no-repeat;
}

body::before {
  z-index: 1;
  background-image: url("./assets/g1.svg");
  background-position: center;
  background-repeat: no-repeat;

  /* SVG has preserveAspectRatio="none", this stretches */
  background-size: var(--strip-width) 116dvh;
}

.page {
  position: relative;
  z-index: 2;

  width: min(100%, 720px);
  min-height: 100svh;
  margin-inline: auto;

  padding:
    max(clamp(3.5rem, 10svh, 7rem), env(safe-area-inset-top))
    max(1rem, env(safe-area-inset-right))
    max(2.5rem, env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-left));

  display: flex;
  flex-direction: column;
  align-items: center;
}

.logo {
  display: block;
  width: clamp(250px, 72vw, 340px);
  max-width: 100%;
  height: auto;
  margin-bottom: clamp(3rem, 7svh, 5.5rem);
}

.links {
  width: var(--button-width);
  max-width: 100%;
  display: grid;
  gap: clamp(1rem, 2.5svh, 1.75rem);
}

.link-button {
  position: relative;
  isolation: isolate;

  width: 100%;
  height: var(--button-height);
  min-width: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  padding-inline: calc(var(--button-height) * 0.98);

  color: #f7f0e8;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;

  font-size: clamp(0.76rem, 3.1vw, 0.95rem);
  line-height: 1;
  letter-spacing: 0.07em;

  background-image:
    url("./assets/center-button.svg"),
    url("./assets/center-button.svg"),
    linear-gradient(180deg, #302723 0%, #241c19 48%, #110e0d 100%);

  background-position:
    center top,
    center calc(100% - 2px),
    center;

  background-size:
    calc(100% - var(--button-height) * 1.36) 7px,
    calc(100% - var(--button-height) * 1.36) 7px,
    calc(100% - var(--button-height) * 0.65) calc(100% - 1px);

  background-repeat: no-repeat;

  text-shadow: 0 1px 2px rgb(0 0 0 / 95%);
  filter: drop-shadow(0 4px 6px rgb(0 0 0 / 65%));

  transition: transform 160ms ease, color 160ms ease;
}

.link-button::before,
.link-button::after {
  content: "";
  position: absolute;
  top: 50%;
  z-index: 2;
  height: var(--button-height);

  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;

  transform: translateY(-50%);
  pointer-events: none;
}

.link-button::before {
  left: 0;
  width: var(--button-left-width);
  background-image: url("./assets/left-button-grey.svg");
}

.link-button::after {
  right: 0;
  width: var(--button-right-width);
  background-image: url("./assets/right-button-grey.svg");
}

.link-button:hover {
  color: #fff;
  transform: scale(1.025);
}

.link-button:active {
  transform: scale(0.99);
}

.link-button:focus-visible {
  outline: 2px solid rgb(255 255 255 / 88%);
  outline-offset: 5px;
}

@media (max-height: 700px) {
  .page {
    padding-top: max(2rem, env(safe-area-inset-top));
  }

  .logo {
    width: clamp(220px, 62vw, 290px);
    margin-bottom: 2.25rem;
  }

  .links {
    gap: 0.9rem;
  }
}

@media (max-width: 480px) {
  :root {
    --strip-width: 95vw;

    --button-width: clamp(280px, 76vw, 320px);
    --button-height: clamp(58px, 14.5vw, 64px);
  }
}

@media (max-width: 340px) {
  :root {
    --button-width: calc(100vw - 60px);
  }

  .link-button {
    letter-spacing: 0.045em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .link-button {
    transition: none;
  }
}