* {
  box-sizing: border-box;
}

body {
          cursor: url(./img/cursor.png), progress;

        a:hover {
            cursor: url(./img/cursorh.png), progress;
        }

        ::selection {
            text-shadow: 0 0 2px #cec1bb;
            color: #cec1bb
        }

        ::-moz-selection {
            text-shadow: 0 0 2px #cec1bb;
            color: #cec1bb
        }
  margin: 0;
  min-height: 80vh;
  background-image: url('./img/bg.png');
  background-repeat: repeat;
  background-color: #f2efed;
  color: #9e918d;
  font-family: 'Pixel-Maz', monospace;
  font-size: 26px;
}

.website {
  width: min(100% - 32px, 740px);
  min-height: 80vh;
  margin: 0 auto;
  padding: 42px 0 30px;
  margin-top: 3%;
  margin-bottom: 5%;

  display: flex;
  flex-direction: column;
  align-items: center;
}

    i {
        text-decoration: none;
        color: #C0ADA9;
        text-shadow: 0 0 2px #cec1bb;
    }

    a {
color: #C0ADA9;
	}

	a:hover { 
color: #c5b8b6;
text-shadow: 0 0 2px #e8e1e1;
	}  

  .fragment {
  justify-content: center;
  align-items: center;
  text-align: center;
}

#link {
  text-align: right;
  color: #C0ADA9;
  text-decoration: underline solid #daccc9 2px;
  text-underline-offset: 4px;
}


.header {
  margin-bottom: 48px;
  text-align: center;
}

.header h1 {
  margin: 0;
  font-family: 'PjukHand', cursive;
  font-size: 56px;
  font-weight: normal;
  letter-spacing: 2px;
  color: #9e918d;
  text-shadow: 2px 2px #f5f3f1;
}


.embroidery {
  width: 100%;
  max-width: 600px;
  margin-inline: auto;
}

.wooden-frame::before {
  content: "";
  position: absolute;

  width: 110px;
  height: 37px;

  background-image: url('./img/screw.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;

  top: -55px;
  left: 50%;
  transform: translateX(-50%);

  z-index: 2;
  pointer-events: none;
}


.wooden-frame {
  position: relative;
  overflow: visible;
  width: 100%;
  padding: 0px;
  border: 25px solid transparent;
  border-image-source: url('./img/hook.png');
  border-image-slice: 12% fill;
  border-image-repeat: stretch;
  background-color: transparent;
}


.aida-fabric {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  position: relative;
    background-color: transparent;
}


#stitch-grid {
  width: 100%;
  height: 100%;

  display: grid;

  grid-template-columns: repeat(80, minmax(0, 1fr));
  grid-template-rows: repeat(80, minmax(0, 1fr));

  user-select: none;
  -webkit-user-select: none;

  touch-action: none;
  -webkit-touch-callout: none;

  cursor: url(./img/cursor.png), progress;
}

.stitch {
  position: relative;
  min-width: 0;
  min-height: 0;

  cursor: crosshair;
  background-color: transparent;
}

.stitch.empty {
  cursor: default;
  pointer-events: none;
}


.stitch {
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}


.fabric-square,
.stitch-color,
.stitch-cross {
  pointer-events: none;
}


.stitch.completed {
  cursor: url(./img/cursor.png), progress;
}


.stitch-cross,
.stitch-color {
  transition: opacity 0.15s ease;
}


@media (prefers-reduced-motion: reduce) {
  .stitch-cross,
  .stitch-color {
    transition: none;
  }
}



.fabric-square {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: transparent;
  border: none;
}


.stitch-color {
  position: absolute;
  inset: 4%;
  border-radius: 8%;

  background-color: var(--thread-color);
  opacity: 0;

  pointer-events: none;
}

.stitch.completed .stitch-color {
  opacity: 0.5;
}

.stitch:not(.completed) .stitch-cross {
  filter: sepia(0.1) saturate(1.5) brightness(0.8);
}

.stitch.completed .stitch-cross,
.stitch.completed .stitch-color {
  filter: sepia(0.1) saturate(0.5) brightness(1.1);
}

.stitch-cross {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  opacity: 0.25;
}

.stitch.completed .stitch-cross {
  opacity: 1;
}

.stitch-cross line {
  stroke: var(--thread-color);
  stroke-width: 11;
  stroke-linecap: round;
}

.paper-note {
  width: 90%;
  max-width: 360px;
  min-height: 165px;
  margin-top: 20px;
  padding: 5px 5px;

  border: 40px solid transparent;
  border-image-source: url('./img/journal.png');
  border-image-slice: 12% fill;
  border-image-repeat: stretch;
  background-color: transparent;

  text-align: center;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.note-heading {
  margin-bottom: 10px;
  font-size: 30px;
  color: #949c92;
}

.paper-note p {
  margin: 5px 0;
  line-height: 16px;
}

.instruction {
  color: #bfacac;
  font-size: 26px;
}


.haiku {
  width: 100%;
}

.haiku p {
  margin: 8px 0;
  line-height: 16px;
  color: #bfacac;
}

.haiku p.revealed {
  animation: reveal-poem 0.8s ease;
}

@keyframes reveal-poem {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

  .fragment {
  justify-content: center;
  align-items: center;
  text-align: center;
  font-size: 28px;
}


.pagination {
  width: 100%;
  max-width: 360px;
  margin-top: 25px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  font-size: 32px;
}

.page-link {
  color: #bfacac;
  text-shadow: 2px 2px #f5f3f1;
  text-decoration: underline solid #daccc9 2px;
  text-underline-offset: 4px;
}

.page-link:hover {
  color: #a39494;
}

.page-link.disabled {
  opacity: 0.5;
  pointer-events: none;
}

#page-count {
  color: #C0ADA9;
  text-shadow: 2px 2px #f5f3f1;
}


[hidden] {
  display: none !important;
}


@media (max-width: 480px) {
  .website {
    margin-top: 5vh;
    margin-bottom: 5vh;
  }

  .header h1 {
    font-size: 40px;
  }

  .paper-note {
    width: 94%;
    padding: 20px 12px;
  }
    .embroidery {
    width: 100%;
    max-width: 600px;
  }
}