@font-face {
  font-family: "Permanent Marker";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("/fonts/permanent-marker.woff2") format("woff2");
}

@font-face {
  font-family: "Sedgwick Ave";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("/fonts/sedgwick-ave.woff2") format("woff2");
}

@font-face {
  font-family: "Sedgwick Ave Display";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("/fonts/sedgwick-ave-display.woff2") format("woff2");
}

@font-face {
  font-family: "Gochi Hand";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("/fonts/gochi-hand.woff2") format("woff2");
}

@font-face {
  font-family: "Just Another Hand";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("/fonts/just-another-hand.woff2") format("woff2");
}

@font-face {
  font-family: "Nothing You Could Do";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("/fonts/nothing-you-could-do.woff2") format("woff2");
}

@font-face {
  font-family: "Caveat Brush";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("/fonts/caveat-brush.woff2") format("woff2");
}

:root {
  --f-marker: "Permanent Marker", cursive;
  --f-sedgwick: "Sedgwick Ave", cursive;
  --f-sedgwick-display: "Sedgwick Ave Display", cursive;
  --f-gochi: "Gochi Hand", cursive;
  --f-hand: "Just Another Hand", cursive;
  --f-nothing: "Nothing You Could Do", cursive;
  --f-brush: "Caveat Brush", cursive;

  --frames: 30;
  --loop: 6s;
}

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

html,
body {
  width: 100%;
  margin: 0;
  padding: 0;
  background: #000;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  color: #fff;
  font-family: system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.hero {
  display: flex;
  min-height: 100vh;
  min-height: 100svh;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 4vw max(24px, env(safe-area-inset-bottom));
}

.flip {
  --base: clamp(2.75rem, 15.5vw, 9.5rem);

  position: relative;
  display: block;
  width: 100%;
  max-width: 1100px;
  height: calc(var(--base) * 2.45);
  margin: 0;
  font-weight: 400;
  opacity: 0;
}

.flip.ready {
  opacity: 1;
}

.frame {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  inset: 0;
  font-family: var(--font);
  font-size: calc(var(--base) * var(--fit));
  letter-spacing: var(--track);
  line-height: 1;
  opacity: 0;
  animation: flip var(--loop) linear infinite;
  animation-delay: calc(var(--i) * (var(--loop) / var(--frames)));
  -webkit-text-stroke: var(--ink) currentColor;
}

.word {
  display: flex;
  align-items: baseline;
  transform: rotate(var(--rot)) skewX(var(--skew)) scaleY(var(--stretch));
  transform-origin: center;
  white-space: nowrap;
}

.word i {
  display: inline-block;
  font-style: normal;
  transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(var(--s));
  transform-origin: center bottom;
}

.word i::before {
  content: attr(data-c);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@keyframes flip {
  0%,
  3.333% {
    opacity: 1;
  }
  3.334%,
  100% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .frame {
    animation: none;
  }

  .frame:first-of-type {
    opacity: 1;
  }
}
