/* Headline animations */
.cd-headline.clip b {
  opacity: 0;
}

.cd-headline.clip b.is-visible {
  opacity: 1;
}

.cd-intro {
  margin: 4em auto;
}

@media only screen and (min-width: 768px) {
  .cd-intro {
    margin: 3.5em auto;
  }
}

@media only screen and (min-width: 1170px) {
  .cd-intro {
    margin: 4.5em auto;
  }
}

.cd-headline {
  font-size: 2.5rem;
  line-height: 1.2;
}

@media only screen and (min-width: 768px) {
  .cd-headline {
    font-size: 3.5rem;
    font-weight: 300;
  }
}

@media only screen and (min-width: 1170px) {
  .cd-headline {
    font-size: 4.5rem;
  }
}

.cd-headline.clip span {
  display: block;
  padding: 0.2em 0;
}

.cd-words-wrapper {
  display: inline-block;
  position: relative;
  text-align: center;
}

.cd-words-wrapper b {
  display: inline-block;
  position: absolute;
  white-space: nowrap;
  left: 0;
  top: 0;
}

.cd-words-wrapper b.is-visible {
  position: relative;
}

.no-js .cd-words-wrapper b {
  opacity: 0;
}

.no-js .cd-words-wrapper b.is-visible {
  opacity: 1;
}

.cd-headline.clip .cd-words-wrapper {
  overflow: hidden;
  vertical-align: top;
}

.cd-headline.clip .cd-words-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 2px;
  height: 100%;
  background-color: #aebcb9;
  animation: blink 1s infinite;
}

/* Portfolio items */
.wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  height: auto;
  margin-bottom: var(--space-2);
}

.items {
  display: flex;
  gap: 0.4rem;
  perspective: calc(var(--index) * 55);
  padding: var(--space-3) 0;
}

.item {
  position: relative;
  width: calc(var(--index) * 3);
  height: calc(var(--index) * 12);
  background-color: #222;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  filter: grayscale(1) brightness(0.5);
  opacity: 0;
  transition: transform 1.5s var(--transition), filter 3s var(--transition),
    width 1.5s var(--transition), opacity 0.5s ease-in-out,
    z-index 0.5s var(--transition);
  will-change: transform, filter, rotateY, width;
  background-image: '';
}

.image-description {
  display: none;
  opacity: 1;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: white;
  font-size: 24px;
}

.item-button {
  position: absolute;
  bottom: 10px;
  right: 10px;
  padding: 8px 16px;
  background-color: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  border-radius: 2px;
  font-size: 14px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease-in-out, background-color 0.3s ease-in-out;
  pointer-events: none;
}

.item:active .item-button,
.item:focus .item-button {
  opacity: 1;
  pointer-events: auto;
}

.item-button:hover {
  background-color: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

.item-button {
  transition: transform 0.3s ease-in-out;
}

.item-button::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  bottom: -2px;
  left: 0;
  background-color: white;
  visibility: hidden;
  transform: scaleX(0);
  transition: all 0.3s ease-in-out;
}

.item-button:hover::before {
  visibility: visible;
  transform: scaleX(1);
}

.item::before,
.item::after {
  content: '';
  position: absolute;
  height: 100%;
  width: 20px;
  right: calc(var(--index) * -1);
}

.item::after {
  left: calc(var(--index) * -1);
}

.items .item:hover {
  filter: inherit;
  transform: translateZ(calc(var(--index) * 10));
}

.items .item:hover + * {
  transform: translateZ(calc(var(--index) * 6.5)) rotateY(25deg);
}

.items .item:hover + * + * {
  transform: translateZ(calc(var(--index) * 4.2)) rotateY(30deg);
}

.items .item:hover + * + * + * {
  transform: translateZ(calc(var(--index) * 1.8)) rotateY(20deg);
}

.items .item:hover + * + * + * + * {
  transform: translateZ(calc(var(--index) * 0.4)) rotateY(10deg);
}

.items .item:has(+ :hover) {
  transform: translateZ(calc(var(--index) * 6.5)) rotateY(-25deg);
}

.items .item:has(+ * + :hover) {
  transform: translateZ(calc(var(--index) * 4.2)) rotateY(-30deg);
}

.items .item:has(+ * + * + :hover) {
  transform: translateZ(calc(var(--index) * 1.8)) rotateY(-20deg);
}

.items .item:has(+ * + * + * + :hover) {
  transform: translateZ(calc(var(--index) * 0.4)) rotateY(-10deg);
}

.items .item:active,
.items .item:focus {
  width: 28vw;
  filter: inherit;
  z-index: 100;
  transform: translateZ(calc(var(--index) * 10));
  margin: 0 0.45vw;
}

.edge-item {
  position: relative;
}

.edge-item::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));
}

.edge-item:first-child::before {
  left: 0;
}

.edge-item:last-child::before {
  right: 0;
  transform: scaleX(-1);
}

.monospace {
  font-family: 'Courier New', Courier, 'Lucida Console', monospace;
}

.serif {
  font-family: Georgia, 'Times New Roman', Times, serif;
}

.portfolio-text {
  display: none;
  opacity: 0;
  font-size: 2.5rem;
  line-height: 1.2;
  transition: opacity 0.3s ease-in-out;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  text-align: center;
}

.project-description-container {
  display: none;
  justify-content: center;
  align-items: center;
  margin-top: var(--space-3);
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.project-description {
  display: none;
  opacity: 0;
  max-width: 80%;
  margin: 1rem auto 0;
  text-align: center;
  color: var(--color-text);
  background-color: rgba(0, 0, 0, 0.8);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  font-size: var(--font-size-1);
  line-height: 1.6;
  transition: opacity 0.3s ease-in-out;
}

.items .item:active .project-description-container,
.items .item:focus .project-description-container {
  display: flex;
  opacity: 1;
}

.command.highlight {
  background-color: rgba(255, 255, 0, 0.2);
  transition: background-color 0.3s ease-in-out;
}

.location-icon .offline-indicator {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #ff6666;
  animation: blink 1.5s ease-in-out infinite;
}

.commands-hidden,
.search-hidden {
  opacity: 0;
  visibility: hidden;
}

.dialog {
  transform: scale(0.9);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out,
    visibility 0.3s ease-in-out;
}

.dialog[open] {
  transform: scale(1);
  opacity: 1;
  visibility: visible;
}

.cd-headline,
.commands,
.search-component,
.items,
.portfolio-text {
  font-family: Helvetica, -apple-system, sans-serif;
}

@keyframes blink {
  0% {
    opacity: 0.4;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.4;
  }
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}