/* Immersive interaction layer: scroll progress, film grain, custom cursor,
   magnetic buttons, card tilt with glare, kinetic type band, image reveals. */

.dqq-im-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 9999;
  pointer-events: none;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, #3ec1ff, #7cff6b 30%, #ffd23f 55%, #ff7a45 75%, #ff5d8f);
  box-shadow: 0 0 12px rgba(62, 193, 255, 0.6);
}

.dqq-im-grain {
  position: fixed;
  inset: -50%;
  z-index: 9990;
  pointer-events: none;
  opacity: 0.055;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: dqq-im-grain 0.9s steps(6) infinite;
}

@keyframes dqq-im-grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-4%, 3%); }
  40% { transform: translate(3%, -5%); }
  60% { transform: translate(-6%, -2%); }
  80% { transform: translate(5%, 4%); }
  100% { transform: translate(0, 0); }
}

/* Custom cursor (fine pointers on wide screens only). */
html.dqq-im-cursor-on,
html.dqq-im-cursor-on body,
html.dqq-im-cursor-on a,
html.dqq-im-cursor-on button {
  cursor: none;
}

html.dqq-im-cursor-on input,
html.dqq-im-cursor-on textarea,
html.dqq-im-cursor-on select {
  cursor: auto;
}

.dqq-im-cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 10000;
  pointer-events: none;
}

.dqq-im-cursor-dot,
.dqq-im-cursor-ring {
  position: fixed;
  left: 0;
  top: 0;
  border-radius: 50%;
  will-change: transform;
}

.dqq-im-cursor-dot {
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  background: #fff;
  mix-blend-mode: difference;
}

.dqq-im-cursor-ring {
  width: 42px;
  height: 42px;
  margin: -21px 0 0 -21px;
  border: 1.5px solid #fff;
  mix-blend-mode: difference;
  display: grid;
  place-items: center;
  transition: width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), height 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
    margin 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.35s, border-color 0.35s;
}

.dqq-im-cursor-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font: 700 12px/1 "Archivo", "Noto Sans TC", system-ui, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0a0f2c;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.25s, transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.dqq-im-cursor.is-link .dqq-im-cursor-ring {
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  background: rgba(255, 255, 255, 0.12);
}

.dqq-im-cursor.is-view .dqq-im-cursor-ring {
  width: 96px;
  height: 96px;
  margin: -48px 0 0 -48px;
  background: #ffd23f;
  border-color: #ffd23f;
  mix-blend-mode: normal;
}

.dqq-im-cursor.is-view .dqq-im-cursor-label {
  opacity: 1;
  transform: scale(1);
}

.dqq-im-cursor.is-view .dqq-im-cursor-dot {
  opacity: 0;
}

.dqq-im-cursor.is-hidden {
  opacity: 0;
}

/* Magnetic buttons use the independent translate property so existing transforms stay intact. */
.dqq-im-magnetic {
  transition: translate 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.dqq-im-magnetic.is-pulling {
  transition: translate 0.12s linear;
}

/* Card tilt and glare. */
.dqq-im-tilt {
  position: relative;
}

.dqq-im-tilt .mack-tall-card-media {
  transform: perspective(900px) rotateX(var(--dqq-rx, 0deg)) rotateY(var(--dqq-ry, 0deg));
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  transform-style: preserve-3d;
}

.dqq-im-tilt.is-tilting .mack-tall-card-media {
  transition: transform 0.12s linear;
}

.dqq-im-glare {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  background: radial-gradient(circle at var(--dqq-gx, 50%) var(--dqq-gy, 50%), rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0) 55%);
  mix-blend-mode: soft-light;
  transition: opacity 0.4s;
}

.dqq-im-tilt.is-tilting .dqq-im-glare {
  opacity: 1;
}

/* Kinetic type band. */
.dqq-im-band {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 4vw, 56px) 0;
  background:
    radial-gradient(120% 140% at 15% 0%, rgba(62, 193, 255, 0.28), transparent 55%),
    radial-gradient(120% 140% at 85% 100%, rgba(255, 93, 143, 0.24), transparent 55%),
    #070b22;
  color: #fff;
  isolation: isolate;
}

.dqq-im-band-row {
  display: flex;
  width: max-content;
  white-space: nowrap;
  will-change: transform;
}

.dqq-im-band-row + .dqq-im-band-row {
  margin-top: clamp(4px, 0.8vw, 12px);
}

.dqq-im-band-item {
  font: 800 clamp(48px, 8.4vw, 148px)/0.95 "Archivo Black", "Archivo", "Noto Sans TC", system-ui, sans-serif;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  padding-right: 0.45em;
  transform: skewX(var(--dqq-skew, 0deg));
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.dqq-im-band-item.is-fill {
  background: linear-gradient(100deg, #3ec1ff, #7cff6b 35%, #ffd23f 60%, #ff5d8f);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.dqq-im-band-item.is-outline {
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.75);
}

.dqq-im-band-item.is-slash {
  color: #ffd23f;
  padding-right: 0.45em;
}

.dqq-im-band::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(90deg, #070b22, transparent 9%, transparent 91%, #070b22);
}

/* Image reveal on scroll. */
.dqq-im-reveal {
  clip-path: inset(14% 6% 14% 6% round 18px);
  transform: scale(1.12);
  filter: saturate(0.4) brightness(0.9);
  transition: clip-path 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.6s cubic-bezier(0.16, 1, 0.3, 1),
    filter 1.2s ease;
}

.dqq-im-reveal.is-in {
  clip-path: inset(0 0 0 0 round 0);
  transform: scale(1);
  filter: none;
}

@media (max-width: 760px) {
  .dqq-im-band-item {
    font-size: clamp(38px, 13vw, 64px);
  }

  .dqq-im-band-item.is-outline {
    -webkit-text-stroke-width: 1px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dqq-im-grain {
    animation: none;
  }

  .dqq-im-reveal,
  .dqq-im-reveal.is-in {
    clip-path: none;
    transform: none;
    filter: none;
    transition: none;
  }
}
