@font-face {
  font-family: "Outfit";
  src: url("/fonts/outfit-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #121212;
  --paper: #fff;
  --quiet: #c4c4c4;
  --hairline: #4a4a4a;
  --dot: #ffd21f;
  color-scheme: dark;
}

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

html { background: var(--ink); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding:
    max(1.5rem, env(safe-area-inset-top))
    max(1rem, env(safe-area-inset-right))
    max(1.5rem, env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-left));
  background: var(--ink);
  color: var(--paper);
  font-family: "Outfit", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--dot); color: var(--ink); }

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.75rem, 6vmin, 4rem);
}

.logo {
  margin: 0;
  width: min(78vw, max(46rem, 36vw), 120vh);
  font-size: 0;
  line-height: 0;
}

.logo a { display: block; }

.logo svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible; /* the dot starts its fall well above the viewBox */
}

.mail {
  position: relative;
  display: inline-block;
  padding: .7em .1em;
  color: var(--quiet);
  font-size: clamp(1.0625rem, .9rem + .7vw, 1.625rem);
  letter-spacing: .012em;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: color .25s ease;
}

.mail::before,
.mail::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: .42em;
  height: 1px;
  background: var(--hairline);
}

.mail::after {
  height: 2px;
  background: var(--dot);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .4s cubic-bezier(.2, .7, .1, 1);
}

.mail:hover,
.mail:focus-visible { color: var(--paper); }

.mail:hover::after,
.mail:focus-visible::after { transform: scaleX(1); }

.mail:focus-visible,
.logo a:focus-visible {
  outline: 2px solid var(--dot);
  outline-offset: 6px;
  border-radius: 2px;
}

.mail:focus:not(:focus-visible) { outline: none; }

@media (prefers-reduced-motion: no-preference) {
  .letters { animation: rise .8s cubic-bezier(.2, .7, .1, 1) both; }

  .mail { animation: fade .9s ease 1.1s both; }

  /* The dot is the tittle of the missing "i": it drops through the gap
     between u and d, bounces on the baseline, and springs back into place.
     Lengths are in viewBox units; 202 is rest position to baseline. */
  .dot {
    cursor: pointer;
    transform-box: fill-box;
    transform-origin: 50% 100%;
  }

  .dot.intro { animation: drop 1.6s linear .15s both; }
  .dot.hop { animation: hop 1.05s linear both; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes drop {
  0% {
    transform: translateY(-2400px) scale(.94, 1.1);
    animation-timing-function: cubic-bezier(.5, 0, .95, .6);
  }
  42% {
    transform: translateY(202px) scale(.95, 1.1);
    animation-timing-function: ease-out;
  }
  46% {
    transform: translateY(202px) scale(1.24, .74);
    animation-timing-function: cubic-bezier(.15, .7, .3, 1);
  }
  70% {
    transform: translateY(-30px) scale(.97, 1.04);
    animation-timing-function: ease-in-out;
  }
  85% {
    transform: translateY(8px) scale(1.03, .97);
    animation-timing-function: ease-in-out;
  }
  100% { transform: none; }
}

@keyframes hop {
  0% {
    transform: none;
    animation-timing-function: cubic-bezier(.5, 0, .95, .6);
  }
  32% {
    transform: translateY(202px) scale(.95, 1.1);
    animation-timing-function: ease-out;
  }
  38% {
    transform: translateY(202px) scale(1.24, .74);
    animation-timing-function: cubic-bezier(.15, .7, .3, 1);
  }
  66% {
    transform: translateY(-30px) scale(.97, 1.04);
    animation-timing-function: ease-in-out;
  }
  83% {
    transform: translateY(8px) scale(1.03, .97);
    animation-timing-function: ease-in-out;
  }
  100% { transform: none; }
}
