@font-face {
  font-family: "Monkey";
  src: url("fonts/monkey.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "Mona Sans";
  src: url("fonts/github.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Open Sans";
  src: url("fonts/opensans.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --text: #111111;
  --muted: #757575;
  --faint: #b5b5b5;
  --brand: #333333;
  --hover-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111111;
    --text: #f2f2f2;
    --muted: #999999;
    --faint: #555555;
    --brand: #f2f2f2;
    --hover-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35), 0 0 14px rgba(255, 255, 255, 0.55);
  }
}

* {
  box-sizing: border-box;
  margin: 0;
}

html,
body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Monkey", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

main {
  position: relative;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 2rem 1rem;
  text-align: center;
}

.coco {
  position: relative;
}

.logo {
  display: block;
  width: min(220px, 55vw);
  height: auto;
  aspect-ratio: 1;
  transition: opacity 0.6s;
}

.coco .logo {
  animation: appear 1.4s cubic-bezier(0.22, 1, 0.36, 1) 1s backwards;
}

.viewer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: grab;
  touch-action: none;
  transition: opacity 0.6s;
}

.viewer:active {
  cursor: grabbing;
}

.coco.ready .viewer {
  opacity: 1;
}

.coco.ready .logo {
  opacity: 0;
}

.coco.failed .logo {
  animation-delay: 0s;
}

.credit,
.build {
  position: absolute;
  bottom: 0.75rem;
  color: var(--faint);
  font-size: 0.5rem;
  line-height: 1.6;
  letter-spacing: 0.02em;
}

.credit {
  right: 1rem;
  left: 1rem;
  text-align: right;
  animation: fade-in 0.6s;
}

.build {
  left: 1rem;
}

.credit a {
  color: inherit;
  text-decoration: none;
}

.credit a:hover,
.credit a:focus-visible {
  text-decoration: underline;
}

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

@keyframes appear {
  from {
    opacity: 0;
    transform: scale(0.96);
    filter: blur(6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .logo,
  .viewer {
    transition: none;
  }

  .credit {
    animation: none;
  }

  .coco .logo {
    animation-name: fade-in;
  }
}

.email {
  color: var(--text);
  font-size: clamp(0.7rem, 4.2vw, 1.2rem);
  overflow-wrap: anywhere;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}

.email:hover,
.email:focus-visible {
  color: var(--muted);
  border-color: var(--muted);
}

.email:focus-visible {
  outline: 2px solid var(--muted);
  outline-offset: 4px;
  border-radius: 2px;
}

.links {
  display: grid;
  grid-template-columns: max-content minmax(0, max-content);
  justify-content: center;
  align-items: start;
  column-gap: 0.75rem;
  row-gap: 0.75rem;
  width: 100%;
  margin-top: 1rem;
  font-size: clamp(0.8rem, 4vw, 1rem);
}

.label {
  color: var(--muted);
  text-align: right;
  line-height: calc(2.5rem + 2px);
}

.icons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 8rem;
  height: calc(2.5rem + 2px);
  padding: 0 0.5rem;
  border: 1px solid var(--muted);
  border-radius: calc((2.5rem + 2px) * 0.2237);
  overflow: hidden;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--brand);
  transition: box-shadow 0.2s;
}

@supports (corner-shape: squircle) {
  .icons a {
    border-radius: calc((2.5rem + 2px) * 0.358);
    corner-shape: squircle;
  }
}

.icons a:hover,
.icons a:focus-visible {
  box-shadow: var(--hover-shadow);
}

.icons a:focus-visible {
  outline: 2px solid var(--muted);
  outline-offset: 4px;
}

.icons a:has(> img) {
  background: #ffffff;
}

.icons svg {
  width: 1.5rem;
  height: 1.5rem;
}

.brand {
  font-family: "Mona Sans", -apple-system, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  font-weight: 600;
  font-size: 1.125rem;
}

.store {
  font-family: "Open Sans", -apple-system, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 1.125rem;
}

.icons .site {
  width: auto;
  height: 1.5rem;
}

.icons .mark {
  width: auto;
  height: 1.75rem;
}

.gif {
  display: block;
  width: auto;
  height: min(229px, 50vw);
}

.error {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 1em;
  font-weight: normal;
  font-size: clamp(1rem, 6vw, 1.5rem);
  letter-spacing: 0.02em;
}

.reason {
  color: var(--muted);
}
