/* Hover & cursor demos. Every rule is scoped under a .hv-* root. */

/* simulated pointer shown while a demo plays itself */
.hv-ghost { position: absolute; left: 0; top: 0; z-index: 4; width: 15px; height: 19px; pointer-events: none; filter: drop-shadow(0 1px 1.5px rgb(0 0 0 / 0.35)); }
.hv-ghost svg { display: block; width: 100%; height: 100%; }

/* hover lift */
.hv-lift { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4cqi; padding: 0 7cqi; align-items: center; }
.hv-lift-card {
  display: grid; gap: 3px; padding: 2.4cqi; border-radius: 12px; background: var(--stage-card); font-size: 12.5px;
  box-shadow: 0 1px 2px rgb(20 24 60 / 0.12), 0 2px 6px rgb(20 24 60 / 0.06);
  transition: transform 0.22s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.22s ease-out;
}
.hv-lift-card i { display: block; aspect-ratio: 1; border-radius: 8px; margin-bottom: 4px; background: radial-gradient(circle at 35% 30%, rgb(255 255 255 / 0.45), transparent 45%), var(--c); }
.hv-lift-card b { font-weight: 650; }
.hv-lift-card span { font: 500 11px var(--f-mono); opacity: 0.7; }
.hv-lift-card.is-on { transform: translateY(-8px); box-shadow: 0 2px 4px rgb(20 24 60 / 0.1), 0 20px 32px -8px rgb(20 24 60 / 0.38); }

/* 3D tilt card */
.hv-tilt { position: absolute; inset: 0; display: grid; place-items: center; perspective: 700px; }
.hv-tilt-card {
  width: 58cqi; aspect-ratio: 1.586; border-radius: 14px; padding: 4.4cqi; color: #fff;
  display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(circle at 80% 10%, rgb(255 255 255 / 0.25), transparent 40%), linear-gradient(135deg, #3b2bbf, #7b5cff 50%, #ff4f9a);
  box-shadow: 0 18px 36px -10px rgb(40 20 120 / 0.55);
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.hv-tilt.is-live .hv-tilt-card { transition: transform 0.08s linear; }
.hv-tilt-top, .hv-tilt-bottom { transform: translateZ(30px); }
.hv-tilt-top { display: flex; justify-content: space-between; align-items: center; }
.hv-tilt-logo { font-weight: 900; font-stretch: 125%; font-size: 5cqi; letter-spacing: -0.02em; }
.hv-tilt-chip { width: 9cqi; aspect-ratio: 1.3; border-radius: 4px; background: linear-gradient(135deg, #ffe08a, #d9a63a); }
.hv-tilt-bottom p { margin: 0; }
.hv-tilt-n { font-size: 4.6cqi; font-weight: 700; }
.hv-tilt-k { font: 500 2.8cqi var(--f-mono); opacity: 0.8; }

/* glare */
.hv-glare { position: absolute; inset: 0; display: grid; place-items: center; perspective: 800px; }
.hv-glare-card {
  position: relative; width: 40cqi; aspect-ratio: 0.72; border-radius: 12px; padding: 2.6cqi; overflow: hidden;
  display: grid; grid-template-rows: 1fr auto; gap: 2cqi;
  background: #1d2140; border: 1px solid rgb(255 255 255 / 0.14); box-shadow: 0 16px 34px rgb(0 0 0 / 0.45);
  transform: rotateY(var(--ry, 0deg)); transition: transform 0.4s ease-out;
}
.hv-glare-art { position: relative; border-radius: 8px; overflow: hidden; background: conic-gradient(from 200deg at 60% 40%, #ff4f9a, #ffb020, #9bdc28, #19c3d6, #7b5cff, #ff4f9a); }
.hv-glare-art i { position: absolute; }
.hv-glare-art i:nth-child(1) { left: 22%; top: 18%; width: 32%; aspect-ratio: 1; border-radius: 50%; background: #fff3c4; }
.hv-glare-art i:nth-child(2) { left: -10%; right: 30%; bottom: -20%; height: 55%; background: #24185e; clip-path: polygon(0 100%, 45% 0, 100% 100%); }
.hv-glare-art i:nth-child(3) { left: 35%; right: -15%; bottom: -20%; height: 45%; background: #3b2a8f; clip-path: polygon(0 100%, 55% 0, 100% 100%); }
.hv-glare-card p { margin: 0; display: grid; color: #fff; }
.hv-glare-card b { font-size: 3.6cqi; }
.hv-glare-card span { font: 500 2.6cqi var(--f-mono); opacity: 0.65; }
.hv-glare-shine {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: overlay; opacity: 0; transition: opacity 0.4s ease-out;
  background:
    linear-gradient(115deg, transparent calc(var(--p, 50%) - 18%), rgb(255 255 255 / 0.75) var(--p, 50%), transparent calc(var(--p, 50%) + 18%)),
    radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgb(255 255 255 / 0.4), transparent 45%);
}
.hv-glare-card.is-on .hv-glare-shine { opacity: 1; transition-duration: 0.15s; }

/* spotlight card */
.hv-sp { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3cqi; padding: 0 5cqi; align-content: center; --x: -999px; --y: -999px; }
.hv-sp-card {
  --x: -999px; --y: -999px; position: relative; padding: 1px; border-radius: 12px;
  background: radial-gradient(150px circle at var(--x) var(--y), rgb(185 170 255 / 0.95), transparent 60%), #2c3150;
}
.hv-sp-in {
  height: 100%; display: grid; gap: 4px; padding: 3.4cqi 3cqi 4cqi; border-radius: 11px; font-size: 12px;
  background: radial-gradient(220px circle at var(--x) var(--y), rgb(123 92 255 / 0.26), transparent 55%), #14172a;
}
.hv-sp-in i { width: 22px; height: 22px; border-radius: 7px; margin-bottom: 6px; background: color-mix(in srgb, var(--c) 30%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 70%, transparent); }
.hv-sp-in b { font-size: 13px; }
.hv-sp-in span { color: #a9afcb; line-height: 1.3; }

/* magnetic button */
.hv-mag { position: absolute; inset: 0; display: grid; place-items: center; }
.hv-mag-field {
  /* diameter matches the JS attraction radius: 0.42 × stage height × 2 */
  position: absolute; left: 50%; top: 50%; width: 52.5cqi; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; border: 1.5px dashed var(--stage-line); opacity: 0.8;
  transition: border-color 0.2s, background-color 0.2s;
}
.hv-mag.is-pulled .hv-mag-field { border-color: var(--d-violet); background: color-mix(in srgb, var(--d-violet) 7%, transparent); }
.hv-mag-btn {
  position: relative; font: 650 14px var(--f-display); padding: 13px 24px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--stage-ink); color: var(--stage); box-shadow: 0 8px 20px -6px rgb(20 24 60 / 0.4);
  transition: translate 0.6s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.hv-mag-btn span { display: inline-block; transition: translate 0.6s cubic-bezier(0.3, 1.6, 0.5, 1); }
.hv-mag.is-pulled .hv-mag-btn, .hv-mag.is-pulled .hv-mag-btn span { transition-duration: 0.15s; transition-timing-function: ease-out; }

/* custom cursor */
.hv-cc { position: absolute; inset: 0; cursor: none; padding: 5cqi 6cqi; display: flex; flex-direction: column; gap: 3cqi; overflow: hidden; }
.hv-cc-nav { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-right: 30px; font-size: 12.5px; }
.hv-cc-nav b { font-weight: 800; font-stretch: 120%; }
.hv-cc-nav span { display: flex; gap: 14px; }
.hv-cc-nav a { color: inherit; text-decoration: none; font-weight: 550; }
.hv-cc-h { margin: auto 0 0; font-size: clamp(22px, 8.4cqi, 40px); font-weight: 800; font-stretch: 112%; line-height: 1; letter-spacing: -0.025em; max-width: 13ch; }
.hv-cc-btn { align-self: flex-start; font-size: 12.5px; font-weight: 650; padding: 8px 14px; border-radius: 999px; border: 1.5px solid currentColor; margin-bottom: 2cqi; }
.hv-cc-dot, .hv-cc-ring { position: absolute; left: 0; top: 0; pointer-events: none; border-radius: 50%; opacity: 0; transition: opacity 0.2s; z-index: 3; }
.hv-cc-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--stage-ink); }
.hv-cc-ring {
  width: 30px; height: 30px; transform: translate(-50%, -50%); border: 1.5px solid var(--stage-ink);
  transition: opacity 0.2s, width 0.25s cubic-bezier(0.2, 0.7, 0.2, 1), height 0.25s cubic-bezier(0.2, 0.7, 0.2, 1), background-color 0.2s, border-color 0.2s;
}
.hv-cc.is-in .hv-cc-dot, .hv-cc.is-in .hv-cc-ring { opacity: 1; }
.hv-cc.is-hot .hv-cc-ring { width: 56px; height: 56px; background: #fff; border-color: transparent; mix-blend-mode: difference; }
.hv-cc.is-hot .hv-cc-dot { opacity: 0; }

/* image trail */
.hv-trail { position: absolute; inset: 0; overflow: hidden; background: radial-gradient(circle at 50% 120%, #2a1f5c, transparent 70%); }
.hv-trail-bg { position: absolute; inset: 0; margin: 0; display: grid; place-content: center; text-align: center; color: rgb(233 235 247 / 0.9); font-size: clamp(30px, 13cqi, 60px); font-weight: 850; font-stretch: 125%; letter-spacing: -0.03em; line-height: 1; }
.hv-trail-bg span { display: block; margin-top: 8px; font: 400 3.2cqi var(--f-mono); letter-spacing: 0; opacity: 0.6; }
.hv-trail-img {
  position: absolute; left: 0; top: 0; width: 20cqi; aspect-ratio: 0.78; margin: -12.8cqi 0 0 -10cqi; border-radius: 6px; opacity: 0;
  background: radial-gradient(circle at 70% 28%, rgb(255 255 255 / 0.85) 0 9%, transparent 10%), linear-gradient(170deg, hsl(var(--h) 90% 66%), hsl(calc(var(--h) + 50) 75% 42%));
  box-shadow: 0 10px 24px rgb(0 0 0 / 0.45); pointer-events: none;
}
.hv-trail-img.is-on { animation: hv-trail 0.95s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes hv-trail {
  0% { opacity: 0; transform: rotate(var(--rot)) scale(0.55); }
  14% { opacity: 1; transform: rotate(var(--rot)) scale(1); }
  65% { opacity: 1; transform: rotate(var(--rot)) scale(1); }
  100% { opacity: 0; transform: rotate(var(--rot)) scale(0.9) translateY(10px); }
}

/* direction-aware hover */
.hv-dir { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3cqi; padding: 0 5cqi; align-content: center; }
.hv-dir-tile { position: relative; aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; background: linear-gradient(160deg, var(--a), var(--b)); }
.hv-dir-mark { position: absolute; left: 22%; top: 20%; width: 56%; aspect-ratio: 1; border-radius: 50%; border: 3cqi solid rgb(255 255 255 / 0.85); }
.hv-dir-ov {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; padding: 2.6cqi;
  background: rgb(15 17 32 / 0.8); color: #fff; transform: translateY(101%);
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.hv-dir-ov small { font: 500 2.5cqi var(--f-mono); opacity: 0.7; }
.hv-dir-ov b { font-size: 3.6cqi; line-height: 1.1; }
.hv-dir-ov em { font-style: normal; font-size: 2.8cqi; font-weight: 650; color: #c8bfff; margin-top: 4px; }

/* magnifier lens */
.hv-mg { position: absolute; inset: 0; overflow: hidden; cursor: crosshair; }
.hv-mg-map { position: absolute; inset: 0; }
.hv-mg svg { display: block; width: 100%; height: 100%; }
.hv-mg-bg { fill: var(--stage-card); }
.hv-mg-park { fill: color-mix(in srgb, var(--d-lime) 28%, var(--stage-card)); }
.hv-mg-river { fill: none; stroke: color-mix(in srgb, var(--d-cyan) 35%, var(--stage-card)); stroke-width: 14; }
.hv-mg-street { fill: none; stroke: var(--stage-line); stroke-width: 0.6; opacity: 0.7; }
.hv-mg-line { fill: none; stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; }
.hv-mg-l1 { stroke: var(--d-coral); }
.hv-mg-l2 { stroke: var(--d-blue); }
.hv-mg-l3 { stroke: var(--d-violet); }
.hv-mg-st { fill: var(--stage-card); stroke: var(--stage-ink); stroke-width: 1.4; }
.hv-mg-t { font: 600 6.5px var(--f-display); fill: var(--stage-ink); }
.hv-mg-pt { font-style: italic; font-weight: 500; opacity: 0.7; }
.hv-mg-lens {
  position: absolute; left: 0; top: 0; width: 34cqi; aspect-ratio: 1; border-radius: 50%; overflow: hidden; pointer-events: none;
  box-shadow: 0 0 0 2.5px #fff, 0 0 0 3.5px rgb(20 24 60 / 0.25), 0 12px 28px rgb(20 24 60 / 0.35);
  opacity: 0; scale: 0.85; transition: opacity 0.2s, scale 0.2s;
}
.hv-mg.is-on .hv-mg-lens { opacity: 1; scale: 1; }
.hv-mg-zoom { position: absolute; left: 0; top: 0; transform-origin: 0 0; }

/* hover image reveal */
.hv-ir { position: absolute; inset: 0; padding: 4cqi 6cqi; display: grid; align-content: center; overflow: hidden; }
.hv-ir-list { list-style: none; margin: 0; padding: 0; }
.hv-ir-list li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 1.7cqi 0;
  border-bottom: 1px solid var(--stage-line); transition: opacity 0.25s, padding-left 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.hv-ir-list li:first-child { border-top: 1px solid var(--stage-line); }
.hv-ir-list span { font-size: clamp(16px, 5.6cqi, 26px); font-weight: 750; font-stretch: 110%; letter-spacing: -0.02em; }
.hv-ir-list small { font: 500 11px var(--f-mono); opacity: 0.65; }
.hv-ir.has-on li { opacity: 0.35; }
.hv-ir.has-on li.is-on { opacity: 1; padding-left: 2cqi; }
.hv-ir-pre {
  position: absolute; left: 0; top: 0; width: 34cqi; aspect-ratio: 1.45; margin: -11.7cqi 0 0 -17cqi; border-radius: 8px; overflow: hidden; pointer-events: none;
  background: linear-gradient(150deg, var(--a, #7b5cff), var(--b, #ff4f9a)); box-shadow: 0 16px 34px rgb(20 24 60 / 0.4);
  opacity: 0; scale: 0.7; transition: opacity 0.25s, scale 0.3s cubic-bezier(0.2, 0.7, 0.2, 1), background 0.3s; z-index: 2;
}
.hv-ir-pre i { position: absolute; inset: 18% 22%; border-radius: 6px; background: rgb(255 255 255 / 0.2); box-shadow: inset 0 0 0 2px rgb(255 255 255 / 0.55); }
.hv-ir.has-on .hv-ir-pre { opacity: 1; scale: 1; }

/* focus dim */
.hv-fd { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 2.4cqi; padding: 0 5cqi; align-content: center; }
.hv-fd-card {
  position: relative; aspect-ratio: 0.68; border-radius: 10px; overflow: hidden; display: flex; align-items: flex-end; padding: 2cqi;
  background: linear-gradient(170deg, var(--a), var(--b));
  transition: opacity 0.25s ease-out, filter 0.25s ease-out, scale 0.25s ease-out;
}
.hv-fd-card i { position: absolute; left: 18%; top: 14%; width: 40%; aspect-ratio: 1; border-radius: 50%; background: rgb(255 255 255 / 0.75); }
.hv-fd-card b { position: relative; color: #fff; font-size: 3.2cqi; text-shadow: 0 1px 6px rgb(0 0 0 / 0.35); }
.hv-fd.has-focus .hv-fd-card:not(.is-focus) { opacity: 0.45; filter: blur(2px) saturate(0.6); scale: 0.97; }
.hv-fd.has-focus .hv-fd-card.is-focus { scale: 1.03; }

/* dock magnification */
.hv-dock {
  position: absolute; inset: 0; overflow: hidden;
  background: radial-gradient(circle at 20% 20%, #ff4f9a88, transparent 45%), radial-gradient(circle at 85% 30%, #2f7bffaa, transparent 50%), linear-gradient(160deg, #2a1d6e, #120f2e);
}
.hv-dock-bar {
  position: absolute; left: 50%; bottom: 19%; translate: -50% 0; display: flex; align-items: flex-end; gap: 6px; padding: 6px 7px; border-radius: 16px;
  background: rgb(255 255 255 / 0.14); border: 1px solid rgb(255 255 255 / 0.22);
  -webkit-backdrop-filter: blur(14px) saturate(1.5); backdrop-filter: blur(14px) saturate(1.5);
}
.hv-dock-i {
  position: relative; display: block; width: 30px; height: 30px; border-radius: 23%;
  background: radial-gradient(circle at 30% 25%, rgb(255 255 255 / 0.45), transparent 50%), var(--c);
  box-shadow: 0 4px 10px rgb(0 0 0 / 0.3);
}
.hv-dock-i::after { content: ""; position: absolute; inset: 28%; background: rgb(255 255 255 / 0.9); }
.hv-dock-g0::after { border-radius: 2px; clip-path: polygon(0 15%, 40% 15%, 50% 0, 100% 0, 100% 100%, 0 100%); }
.hv-dock-g1::after { clip-path: polygon(0 10%, 100% 10%, 100% 90%, 0 90%, 0 10%, 50% 55%, 100% 10%); background: none; border: 2px solid rgb(255 255 255 / 0.9); border-radius: 2px; }
.hv-dock-g2::after { border-radius: 50%; inset: 30%; box-shadow: 0 0 0 2px rgb(255 255 255 / 0.4); }
.hv-dock-g3::after { border-radius: 50% 50% 50% 0; }
.hv-dock-g4::after { border-radius: 2px; inset: 25% 30%; background: repeating-linear-gradient(rgb(255 255 255 / 0.9) 0 2px, transparent 2px 5px); }
.hv-dock-g5::after { clip-path: polygon(50% 0, 100% 100%, 50% 75%, 0 100%); }
.hv-dock-g6::after { inset: 30% 26%; background: none; border-left: 2px solid #fff; border-bottom: 2px solid #fff; width: 30%; height: 30%; rotate: -135deg; }
.hv-dock-tip {
  position: absolute; left: 0; top: 0; z-index: 3; transform: translate(-50%, -100%); white-space: nowrap; pointer-events: none;
  font-size: 11.5px; font-weight: 600; color: #fff; padding: 4px 9px; border-radius: 7px; background: rgb(20 22 40 / 0.85);
  opacity: 0; transition: opacity 0.15s;
}
.hv-dock-tip.is-on { opacity: 1; }
