:root {
  --bg: #142240;
  --cream: #f2efcf;
  --teal: #53d5f5;
  --panel: rgba(117, 130, 171, 0.46);
  --shadow: rgba(9, 15, 31, 0.36);
  --background-opacity: 0.5;
  --stage-w: min(100vw, calc(100dvh * 1.5));
  --stage-h: min(100dvh, calc(100vw / 1.5));
  --button-gap: clamp(0.975rem, calc(var(--stage-h) * 0.0273), 2.145rem);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-height: 100dvh;
  margin: 0;
  color: var(--cream);
  background: var(--bg);
  font-family: "Quattrocento Sans", Arial, sans-serif;
  font-weight: 700;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  content: "";
  background: url("assets/links_background.jpg") center / cover no-repeat;
  opacity: var(--background-opacity);
  animation: background-fade 900ms ease-out both;
  pointer-events: none;
}

a {
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-shell {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100dvh;
  place-items: end center;
  overflow: hidden;
}

.stage {
  position: relative;
  width: var(--stage-w);
  height: var(--stage-h);
  min-width: 320px;
}

.character-art {
  position: absolute;
  bottom: 0;
  left: 3.8%;
  display: block;
  width: auto;
  height: 94%;
  max-width: 58%;
  object-fit: contain;
  object-position: left bottom;
  filter: drop-shadow(0.5rem 0.8rem 0 rgba(5, 11, 25, 0.2));
  animation: character-enter 900ms cubic-bezier(0.18, 0.84, 0.28, 1) 160ms both;
  pointer-events: none;
  user-select: none;
}

.katie-logo {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0.32rem 0.44rem 0 rgba(5, 11, 25, 0.24));
  animation: logo-enter 720ms cubic-bezier(0.18, 0.84, 0.28, 1) 430ms both;
  pointer-events: none;
  user-select: none;
}

.links-panel {
  position: absolute;
  top: 26.85%;
  left: 59.1%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: calc(var(--button-gap) * 2);
  width: 30.7%;
  min-width: 19rem;
  height: 69.65%;
  padding: clamp(1rem, calc(var(--stage-w) * 0.0135), 1.55rem);
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.link-stack {
  display: flex;
  flex-direction: column;
  gap: var(--button-gap);
  width: 100%;
}

.link-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: clamp(2.24rem, calc(var(--stage-h) * 0.0518), 3.92rem);
  padding: 0 clamp(1.55rem, calc(var(--stage-w) * 0.025), 2.8rem);
  overflow: hidden;
  font-size: clamp(1rem, calc(var(--stage-w) * 0.0132), 1.42rem);
  line-height: 1;
  text-decoration: none;
  letter-spacing: 0;
  background-color: #654fa7;
  background-image: linear-gradient(51deg, rgba(255, 58, 91, 0.52) 0%, rgba(118, 97, 213, 0) 100%);
  border: 0;
  border-radius: 2rem;
  box-shadow: 0.16rem 0.36rem 0 var(--shadow);
  animation: button-enter 620ms cubic-bezier(0.18, 0.84, 0.28, 1) both;
  transition:
    transform 180ms ease,
    filter 180ms ease,
    box-shadow 180ms ease;
}

.link-button:hover,
.link-button:focus-visible {
  transform: scale(1.025);
  filter: brightness(1.1) saturate(1.05);
  box-shadow:
    inset 0 0 0 1px var(--teal),
    0.2rem 0.48rem 0 rgba(9, 15, 31, 0.32);
}

.link-button:focus-visible {
  outline: 3px solid rgba(242, 239, 207, 0.78);
  outline-offset: 4px;
}

.link-button span {
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-button svg {
  flex: 0 0 auto;
  width: clamp(1.45rem, calc(var(--stage-w) * 0.019), 2.1rem);
  height: clamp(1.45rem, calc(var(--stage-w) * 0.019), 2.1rem);
  margin-left: 1rem;
  fill: var(--cream);
}

.link-button-blue {
  background-color: #668ad6;
}

.link-button-purple {
  background-color: #6c5fce;
}

.link-button-dark {
  background-color: #3e357e;
}

.link-stack .link-button:nth-child(1) {
  animation-delay: 820ms;
}

.link-stack .link-button:nth-child(2) {
  animation-delay: 910ms;
}

.link-stack .link-button:nth-child(3) {
  animation-delay: 1000ms;
}

.link-stack .link-button:nth-child(4) {
  animation-delay: 1090ms;
}

.link-stack .link-button:nth-child(5) {
  animation-delay: 1180ms;
}

.link-stack .link-button:nth-child(6) {
  animation-delay: 1270ms;
}

.link-stack .link-button:nth-child(7) {
  animation-delay: 1360ms;
}

@keyframes background-fade {
  from {
    opacity: 0;
  }

  to {
    opacity: var(--background-opacity);
  }
}

@keyframes character-enter {
  from {
    opacity: 0;
    transform: translateY(9%);
  }

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

@keyframes logo-enter {
  from {
    opacity: 0;
    transform: translateY(-14%);
  }

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

@keyframes button-enter {
  from {
    opacity: 0;
    translate: 18% 0;
  }

  to {
    opacity: 1;
    translate: 0 0;
  }
}

@media (max-width: 900px) {
  .site-shell {
    display: block;
    min-height: 100dvh;
    padding: clamp(1.5rem, 7vw, 3rem);
    overflow: visible;
  }

  .stage {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: auto;
    min-height: calc(100dvh - clamp(3rem, 14vw, 6rem));
    align-items: center;
    justify-content: center;
  }

  .character-art {
    display: none;
  }

  .katie-logo {
    width: 100%;
    max-height: none;
    margin-bottom: 0;
    object-fit: contain;
    filter: drop-shadow(0.22rem 0.32rem 0 rgba(5, 11, 25, 0.24));
  }

  .links-panel {
    position: relative;
    top: auto;
    left: auto;
    width: min(100%, 34rem);
    min-width: 0;
    height: auto;
    min-height: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .link-button {
    height: clamp(2.8rem, 9.1vw, 3.64rem);
    padding: 0 clamp(1.5rem, 7vw, 2.25rem);
    font-size: clamp(1rem, 5.5vw, 1.35rem);
    border-radius: 1.85rem;
  }

  .link-button svg {
    width: clamp(1.45rem, 7vw, 2rem);
    height: clamp(1.45rem, 7vw, 2rem);
  }
}

@media (max-width: 900px) and (max-height: 650px) {
  :root {
    --button-gap: clamp(0.5rem, 1.5dvh, 0.75rem);
  }

  .site-shell {
    padding: clamp(0.75rem, 4vw, 1.5rem);
  }

  .stage {
    min-height: calc(100dvh - clamp(1.5rem, 8vw, 3rem));
  }

  .link-button {
    height: clamp(2.25rem, 6.4dvh, 2.5rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-delay: 0ms !important;
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}
