@import url("https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;500;700&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #000000;
  min-height: 100vh;
  overflow: hidden;
  font-family: "Arial", sans-serif;
}



.spotlight {
  --ray-width: 3rem;
  --ray-opacity: 0.4;
  --spot-opacity: 0.4;
  --v-gap: 150px;
  --duration: 0.5s;
  --easing: ease-in-out;
  --color: #f00;
  --outset: 0px;
  --spot-anchor: --spot;
  display: grid;
  justify-items: center;
  align-items: center;
  gap: var(--v-gap);
  anchor-scope: all;
  
  &:has(a:active) .super-trouper > * {
    --outset: -2rem;
    --delay: 0s;
    --duration: 0.2s;
  }
  
  > * {
    grid-column: 1;
  }
}

.spots {
  display: flex;
  grid-row: 1;
  grid-column: 1;
  gap: 8rem;
}

.spot {
  width: 0.875rem;
  aspect-ratio: 1;
  border-radius: 100%;
  anchor-name: --spot;
  position: relative;
  
  &:nth-child(2) {
    anchor-name: --spot-blue;
  }
  
  &:nth-child(3) {
    anchor-name: --spot-green;
  }
}

@keyframes move {
  0%, 100% { translate: -80px 0px;}
  50% { translate: 80px 0px;}
}

.super-trouper {
  grid-row: 1 / 3;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.ray {
  height: 100%;
  mask-image: linear-gradient(0deg, #0000 0.5rem, #000 6rem);
  
  .l-l,
  .l-r,
  .r-l,
  .r-r {
    --angle: atan(100cqi / 100cqb);    
    container-type: size;    
    position: absolute;
    mix-blend-mode: screen;
    
    left: calc(anchor(--link left) - var(--outset));
    right: anchor(var(--spot-anchor) center);
    
    top: anchor(var(--spot-anchor) center);
    bottom: calc(anchor(--link bottom) - 1rem);
    
    transition: left var(--duration) var(--delay, 0s), right var(--duration) var(--delay, 0s);
    transition-timing-function: var(--easing);
    
    &::after {
      --gradient-angle: atan(var(--ray-width) / 100cqb);
      content: "";
      opacity: calc(var(--ray-opacity) * sign(max(0px, 1cqi)));
      width: max(5rem, 100cqi);
      height: calc(hypot(100cqi, 100cqb) + 15rem);
      background-image: conic-gradient(at 0% 0%, transparent calc(180deg - var(--gradient-angle)), var(--color) 180deg);
      position: absolute;
      left: 100%;
      top: 0;
      rotate: var(--angle);
      transform-origin: left top;
      z-index: 4;
      filter: blur(1px);
    }
  }
  
  .l-r {
    left: anchor(var(--spot-anchor) center);
    right: calc(anchor(--link left) + var(--outset));
    
    &:after {
      rotate: calc(var(--angle) * -1);
      left: 0;
    }
  }
  
  .r-l,
  .r-r {
    left: calc(anchor(--link right) + var(--outset));
    right: anchor(var(--spot-anchor) center);
    
    &::after {
      background-image: conic-gradient(at 100% 0%, var(--color) 180deg, transparent calc(180deg + var(--gradient-angle)));      
      left: auto;
      right: 0;
      transform-origin: right top;
    }
  }
  
  .r-r {
    left: anchor(var(--spot-anchor) center);
    right: calc(anchor(--link right) - var(--outset));
    
    &:after {
      rotate: calc(var(--angle) * -1);
      right: 100%;
    }
  }

}

.light {
  position: absolute;
  left: calc(anchor(--link left) - var(--outset));
  right: calc(anchor(--link right) - var(--outset));
  bottom: calc(anchor(--link bottom) - 1.5rem);
  height: 1rem;
  background: rgb(from var(--color) r g b / 0.3);
  border: 1px solid var(--color);
  opacity: var(--spot-opacity);
  border-radius: 100%;
  transition: all var(--duration) var(--delay, 0s);
  transition-timing-function: var(--easing);
  filter: blur(2px);
  mask-image: linear-gradient(#0001, #000);
}

nav {
  grid-row: 2;
  padding-block: 1rem;
  padding-inline: 2rem;
  position: relative;
  
  &::before,
  &::after {
    content: "";
    position: absolute;
    z-index: 2;
    inset: 0;
    inset-inline: -2rem;
    background: linear-gradient(#fff0 50%, rgb(255 255 255 / 0.15));
    border-bottom: 1px solid rgb(255 255 255 / 0.3);
    mask-image: linear-gradient(90deg, #0000, #000 20%, 80%, #0000 100%);
  }
  
  &::after {
    background: linear-gradient(#001, #0000);
    top: auto;
    bottom: -5rem;
    height: 5rem;
    border: none;
    opacity: 0.6;
  }
  
  ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 0;
    justify-content: center;
    position: relative;
    z-index: 2;
    
    &:has(a:hover, a:focus-visible) a:not(:hover, :focus-visible) {
      opacity: 0.3;
    }
  }
  
  a {
    color: #fff;
    text-decoration: none;
    font-size: 1.375rem;
    display: block;
    padding-inline: 1rem;
    position: relative;
    transition-property: opacity, text-shadow;
    transition-duration: calc(var(--duration) * 1.5);
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 0.1em;
    text-align: center;
    
    &:hover,
    &:focus-visible {
      anchor-name: --link;
      text-shadow: 
        0 0 0.75rem #0ff,
        0 0 1.25rem #f0f;
    }
    
    &:focus-visible {
      outline: 2px dotted #fff;
      outline-offset: 5px;
      border-radius: 999rem;
    }

  }
  
  &:not(:has(a:hover)) a[aria-current="page"] {
    anchor-name: --link;
  }
}

.controls {
  position: absolute;
  top: 20px;
  left: 20px;
  display: flex;
  gap: 10px;
  z-index: 100;
}

.control-btn {
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 25px;
  color: white;
  font-weight: bold;
  cursor: pointer;
  backdrop-filter: blur(5px);
  transition: all 0.3s ease;
  font-size: 14px;
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.speed-indicator {
  position: absolute;
  top: 20px;
  right: 20px;
  color: white;
  font-size: 16px;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 16px;
  border-radius: 20px;
  backdrop-filter: blur(5px);
  z-index: 100;
}

.info {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.3);
  padding: 15px 25px;
  border-radius: 20px;
  backdrop-filter: blur(5px);
  z-index: 100;
  line-height: 1.4;
}

.container {
  position: relative;
  width: 100vw;
  height: 50vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-stream {
  position: absolute;
  width: 100vw;
  height: 180px;
  display: flex;
  align-items: center;
  overflow: visible;
}

.card-line {
  display: flex;
  align-items: center;
  gap: 60px;
  white-space: nowrap;
  cursor: grab;
  user-select: none;
  will-change: transform;
}

.card-line:active {
  cursor: grabbing;
}

.card-line.dragging {
  cursor: grabbing;
}

.card-line.css-animated {
  animation: scrollCards 40s linear infinite;
}

@keyframes scrollCards {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100vw);
  }
}

.card-wrapper {
  position: relative;
  width: 400px;
  height: 250px;
  flex-shrink: 0;
}

.card {
  position: absolute;
  top: 0;
  left: 0;
  width: 400px;
  height: 250px;
  border-radius: 15px;
  overflow: hidden;
}

.card-normal {
  background: transparent;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0;
  color: white;
  z-index: 2;
  position: relative;
  overflow: hidden;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 15px;
  transition: all 0.3s ease;
  filter: brightness(1.1) contrast(1.1);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1);
}

.card-image:hover {
  filter: brightness(1.2) contrast(1.2);
}

.card-ascii {
  background: transparent;
  z-index: 1;
  position: absolute;
  top: 0;
  left: 0;
  width: 400px;
  height: 250px;
  border-radius: 15px;
  overflow: hidden;
}

.card-chip {
  width: 40px;
  height: 30px;
  background: linear-gradient(45deg, #ffd700, #ffed4e);
  border-radius: 5px;
  position: relative;
  margin-bottom: 20px;
}

.card-chip::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  right: 3px;
  bottom: 3px;
  background: linear-gradient(45deg, #e6c200, #f4d03f);
  border-radius: 2px;
}

.contactless {
  position: absolute;
  top: 60px;
  left: 20px;
  width: 25px;
  height: 25px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2), transparent);
}

.contactless::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 15px;
  height: 15px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
}

.card-number {
  font-size: 22px;
  font-weight: bold;
  letter-spacing: 3px;
  margin-bottom: 15px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.card-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.card-holder {
  color: white;
  font-size: 14px;
  text-transform: uppercase;
}

.card-expiry {
  color: white;
  font-size: 14px;
}

.card-logo {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 18px;
  font-weight: bold;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.ascii-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  color: rgba(220, 210, 255, 0.6);
  font-family: "Courier New", monospace;
  font-size: 11px;
  line-height: 13px;
  overflow: hidden;
  white-space: pre;
  clip-path: inset(0 calc(100% - var(--clip-left, 0%)) 0 0);
  animation: glitch 0.1s infinite linear alternate-reverse;
  margin: 0;
  padding: 0;
  text-align: left;
  vertical-align: top;
  box-sizing: border-box;
  -webkit-mask-image: linear-gradient(
    to right,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 0.8) 30%,
    rgba(0, 0, 0, 0.6) 50%,
    rgba(0, 0, 0, 0.4) 80%,
    rgba(0, 0, 0, 0.2) 100%
  );
  mask-image: linear-gradient(
    to right,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 0.8) 30%,
    rgba(0, 0, 0, 0.6) 50%,
    rgba(0, 0, 0, 0.4) 80%,
    rgba(0, 0, 0, 0.2) 100%
  );
}

@keyframes glitch {
  0% {
    opacity: 1;
  }
  15% {
    opacity: 0.9;
  }
  16% {
    opacity: 1;
  }
  49% {
    opacity: 0.8;
  }
  50% {
    opacity: 1;
  }
  99% {
    opacity: 0.9;
  }
  100% {
    opacity: 1;
  }
}

.scanner {
  display: none;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 4px;
  height: 300px;
  border-radius: 30px;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(0, 255, 255, 0.8),
    rgba(0, 255, 255, 1),
    rgba(0, 255, 255, 0.8),
    transparent
  );
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.8), 0 0 40px rgba(0, 255, 255, 0.4);
  animation: scanPulse 2s ease-in-out infinite alternate;
  z-index: 10;
}

@keyframes scanPulse {
  0% {
    opacity: 0.8;
    transform: translate(-50%, -50%) scaleY(1);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scaleY(1.1);
  }
}

.scanner-label {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(0, 255, 255, 0.9);
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.card-normal {
  clip-path: inset(0 0 0 var(--clip-right, 0%));
}

.card-ascii {
  clip-path: inset(0 calc(100% - var(--clip-left, 0%)) 0 0);
}

.scan-effect {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 255, 255, 0.4),
    transparent
  );
  animation: scanEffect 0.6s ease-out;
  pointer-events: none;
  z-index: 5;
}

@keyframes scanEffect {
  0% {
    transform: translateX(-100%);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateX(100%);
    opacity: 0;
  }
}

.instructions {
  position: absolute;
  top: 50%;
  right: 30px;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  max-width: 200px;
  text-align: right;
  z-index: 5;
}

#particleCanvas {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  width: 100vw;
  height: 250px;
  z-index: 0;
  pointer-events: none;
}

#scannerCanvas {
  position: absolute;
  top: 50%;
  left: -3px;
  transform: translateY(-50%);
  width: 100vw;
  height: 300px;
  z-index: 15;
  pointer-events: none;
}

.inspiration-credit {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Roboto Mono", monospace;
  font-size: 12px;
  font-weight: 900;
  color: #ff9a9c;
  z-index: 1000;
  text-align: center;
}

.inspiration-credit a {
  color: #ff9a9c;
  text-decoration: none;
  transition: color 0.3s ease;
}

.inspiration-credit a:hover {
  color: #ff7a7c;
}
