/* Universal Header */
body {
  overflow-x: hidden;
}

.primary-header,
.primary-section,
.primary-footer {
  padding: var(--space-m);
}

.primary-header,
.primary-footer {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;

  padding-block: 0.5rem;
}

.alternate-color-section {
  background-color: var(--text-color);
  color: var(--background-color);
}

.clippy-border {
  clip-path: polygon(0 52%, 0 100%, 100% 0);
  background-color: var(--background-color);
  width: 100%;
  height: 10vh;

  transform: translateY(-4rem);
}

.reverse-clippy-border {
  clip-path: polygon(100% 0, 0 100%, 0 52%);
  background-color: var(--background-color);
  width: 50%;
  height: 6vh;

  transform: translateY(2rem);
}

.bottom-clippy {
  transform: translateY(-2rem);
}

/* SVG ICON */

.svg-container {
  overflow: hidden;
  width: 10rem;
}

.svg {
  justify-items: center;
  border-radius: 40%;
}

.path:hover {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: dash 2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  fill: none;
}

.path--active {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: dash 2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  fill: none;
}

.svg--style {
  stroke: var(--text-color);
  stroke-width: 20;
}

.svg--style-black {
  stroke: var(--text-color);
}

@keyframes dash {
  0% {
    stroke-dashoffset: 1;
    opacity: 0.2;
  }

  90% {
    stroke-dashoffset: 0;
    opacity: 1;
  }
}

/* Universal Main */

.section-main {
  padding-inline: var(--space-m);
  margin-top: var(--space-m);
  width: fit-content;
}

p {
  padding-left: var(--space-m);
  padding-block: var(--space-m);
}

.link-decoration {
  color: var(--text-color);
}

.alternate-color-section .link-decoration {
  color: var(--background-color);
}

.alternate-color-section .link-decoration:hover {
  color: var(--text-color);
  padding-inline-end: var(--space-xs);
}

/* Aeolus Machine */

.parts-img {
  width: 20vw;
  height: 20vh;
  object-fit: cover;
  border-radius: 10px;
  margin-right: 10px;
  cursor: none;
  transition: width 0.5s ease-in-out;
  z-index: -100;
}

.about-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: var(--space-m);
}

/* SKILLS */

.cards {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  padding-inline: var(--space-s);
  gap: var(--space-s);
}

.card {
  color: var(--background-color);
  background-color: var(--text-color);
  border-radius: 20px 0;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.12);
  border-top: 1rem ridge var(--text-color);
}

.card-details {
  text-align: center;
  padding-bottom: var(--space-xs);
}

.card-container {
  position: relative;
  clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
  background-position: top;
}

.card-container .card-image {
  object-position: top;
}

.card-image {
  border-radius: 20px 0;
  height: 40vh;
  width: 100%;
  object-fit: cover;
  object-position: center;
}

.card-image:hover,
.card-image:focus {
  transform: scale(105%);
  filter: saturate(1.5);
}

/* Gallery */
.grid-section {
  display: grid;
  overflow: hidden;

  grid-template-columns: repeat(1, 1fr);
  place-items: center;
}

/* Lightbox */
#lightbox {
  position: fixed;
  z-index: 1000;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgb(0 0 0 /0.9);
  display: none;
}

#lightbox.active {
  display: flex;
  justify-content: center;
  align-items: center;
}

#lightbox img {
  max-width: 90%;
  max-height: 80%;
  padding: 4px;
  background-color: var(--text-color);
  border: 2px inset var(--background-color);
  cursor: none;
}

/* Contact */

a.email > span:nth-child(2) {
  display: none;
}

/* Footer */

footer {
  display: flex;
  flex-direction: column-reverse;
  justify-content: center;
  align-items: flex-end;
  gap: var(--space-s);

  bottom: 1vh;
  right: 1vw;
  padding: 0;
}

/* mobile friendly gallery */
@media screen and (max-width: 749px) {
  .gallery-container {
    --numcolumns: 2;
    --gap: 0.25em;
    --size: calc(100vw / var(--numcolumns));
    display: grid;
    grid-template-columns: repeat(var(--numcolumns), 1fr);

    grid-template-rows: auto;
    gap: var(--gap);
    align-items: stretch;
    padding: 0;
    margin: 0;
  }

  .gallery-image {
    height: calc(var(--size) - var(--gap));
  }

  .gallery-image img {
    object-fit: cover;
  }
}

@media screen and (min-width: 650px) {
  .about-section {
    flex-direction: row;
  }
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media screen and (min-width: 750px) {
  .gallery-container {
    --size: 100px;
    display: grid;
    grid-template-columns: repeat(6, var(--size));
    grid-auto-rows: var(--size);
    margin-bottom: var(--size);
    place-items: start center;
    gap: 0.4rem;
  }
  .gallery-image {
    object-fit: cover;
    width: calc(var(--size) * 2);
    height: calc(var(--size) * 2);
    clip-path: path(
      "M90,10 C100,0 100,0 110,10 190,90 190,90 190,90 200,100 200,100 190,110 190,110 110,190 110,190 100,200 100,200 90,190 90,190 10,110 10,110 0,100 0,100 10,90Z"
    );
    transition: clip-path 0.25s, filter 0.75s;
    grid-column: auto / span 2;
    border-radius: 5px;
  }

  .gallery-image:nth-child(5n-1) {
    grid-column: 2 / span 2;
  }

  .gallery-container:has(:hover) img:not(:hover),
  .gallery-container:has(:focus) img:not(:focus) {
    filter: brightness(0.5) contrast(0.5);
  }

  .gallery-image:hover,
  .gallery-image:focus {
    clip-path: path(
      "M0,0 C0,0 200,0 200,0 200,0 200,100 200,100 200,100 200,200 200,200 200,200 100,200 100,200 100,200 100,200 0,200 0,200 0,100 0,100 0,100 0,100 0,100Z"
    );
    z-index: 1;
    transition: clip-path 0.25s, filter 0.25s;
  }

  .gallery-image:focus {
    outline: 1px dashed black;
    outline-offset: -5px;
  }
}
@media screen and (min-width: 1150px) {
  .cards {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media screen and (min-width: 1450px) {
  .grid-section {
    display: grid;

    grid-template-columns: repeat(2, 1fr);
  }
}
