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

::selection {
  background-color: transparent;
  color: #e06030;
}

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

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes drawSignature {
  to { stroke-dashoffset: 0; }
}

@keyframes fillSignature {
  to { fill-opacity: 1; }
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: #fafafa;
  color: #1a1a1a;
  font-family: 'Noto Sans Mono', monospace;
  font-size: clamp(0.65rem, 1vw, 0.78rem);
  line-height: 1.7;
  padding: 2rem;
  -webkit-font-smoothing: antialiased;
  animation: fadeIn 0.4s ease-out;
}

main {
  max-width: 640px;
  width: 100%;
}

h1 {
  font-size: inherit;
  font-weight: 400;
  margin-bottom: 1.5rem;
}

main > h1,
main > p {
  opacity: 0;
  animation: fadeInUp 0.5s ease-out forwards;
}

main > h1 { animation-delay: 0.1s; }
main > p:nth-of-type(1) { animation-delay: 0.2s; }
main > p:nth-of-type(2) { animation-delay: 0.3s; }
main > p:nth-of-type(3) { animation-delay: 0.4s; }
main > p:nth-of-type(4) { animation-delay: 0.5s; }
main > p:nth-of-type(5) { animation-delay: 0.6s; }
main > p:nth-of-type(6) { animation-delay: 0.7s; }

main > footer {
  opacity: 0;
  animation: fadeInUp 0.5s ease-out forwards;
  animation-delay: 0.8s;
}

p + p {
  margin-top: 1.1em;
}

footer {
  margin-top: 2.5rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.links {
  display: flex;
  gap: 1.5em;
}

.links a {
  color: #1a1a1a;
  text-decoration: none;
  position: relative;
}

.links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: #1a1a1a;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.links a:hover::after {
  transform: scaleX(1);
}

em {
  font-family: 'Swanky and Moo Moo', cursive;
  font-style: normal;
  font-size: 1.5em;
  line-height: 0;
  vertical-align: baseline;
  transition: color 0.3s ease;
}

em:hover {
  color: #e06030;
}

.contact-item {
  margin-top: 0.6em;
}

.contact-item a {
  color: #1a1a1a;
  text-decoration: none;
  position: relative;
}

.contact-item a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: #1a1a1a;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.contact-item a:hover::after {
  transform: scaleX(1);
}

.projects-layout {
  display: flex;
  align-items: center;
  height: 100vh;
  overflow: hidden;
  width: 100%;
  padding: 2rem 2rem 2rem 8rem;
  gap: 3rem;
}

.projects-layout main {
  flex-shrink: 0;
  max-width: 640px;
}

.cards {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.project-link {
  position: relative;
  display: block;
  text-decoration: none;
}

.project-img {
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  display: block;
  border-radius: 4px;
}

.project-link .card-arrow {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: #1a1a1a;
  font-size: 1.2rem;
  opacity: 0;
  transition: opacity 0.3s;
}

.project-link:hover .card-arrow {
  opacity: 1;
}

@media (max-width: 900px) {
  .projects-layout {
    flex-direction: column;
    align-items: flex-start;
    padding: 2rem;
    height: auto;
    overflow: visible;
  }

  .projects-layout main {
    max-width: 640px;
    width: 100%;
  }

  .cards {
    width: 100%;
  }

  .project-img {
    width: 100%;
    max-height: none;
  }
}

.copyright {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  font-size: inherit;
  color: #aaa;
}

@media (max-width: 600px) {
  body {
    font-size: 0.85rem;
    flex-direction: column;
    align-items: flex-start;
  }

  footer {
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 0.8em;
  }

  .copyright {
    position: static;
    margin-top: 2.5rem;
  }
}

.signature {
  font-family: 'Swanky and Moo Moo', cursive;
  font-size: 1.8rem;
}

.signature-svg {
  display: block;
  height: 2.4rem;
  overflow: visible;
}

.signature-stroke {
  font-family: 'Swanky and Moo Moo', cursive;
  font-size: 48px;
  fill: #1a1a1a;
  fill-opacity: 0;
  stroke: #1a1a1a;
  stroke-width: 1.2;
  stroke-dasharray: 1500;
  stroke-dashoffset: 1500;
  animation:
    drawSignature 2s ease-in-out 1.3s forwards,
    fillSignature 0.6s ease 3s forwards;
}

@media (prefers-reduced-motion: reduce) {
  .signature-stroke {
    fill-opacity: 1;
    stroke-dasharray: none;
    stroke-dashoffset: 0;
    animation: none;
  }
}
