/* ═══════════════════════════════════════════════════════════
   ANIMATION LAYER — Artbim-style effects for art-k.work
   Load AFTER assets/css/style.css
   ═══════════════════════════════════════════════════════════ */

/* ─── 1) PRELOADER (split-letter "Loading") ─────────────── */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  clip-path: inset(0 0 0 0);
}
#preloader .preloader-text {
  font-family: 'Roboto Mono', monospace;
  font-size: clamp(1rem, 2vw, 1.4rem);
  font-weight: 300;
  letter-spacing: .5em;
  text-transform: uppercase;
  color: #111;
}
#preloader .char { display: inline-block; will-change: transform, opacity; }

/* If JS is off, never trap the visitor behind the preloader */
html:not(.js) #preloader { display: none; }

/* ─── 2) ENTRANCE / SCROLL REVEALS ──────────────────────── */
/* Elements tagged data-reveal start hidden (JS animates them in).
   Only applies when JS is running, so content is never lost.  */
html.js [data-reveal] { opacity: 0; }

/* ─── 3) OUTLINED TEXT MARQUEE (bottom strip) ───────────── */
.marquee {
  position: fixed;
  bottom: 3vh;
  left: 0;
  width: 100%;
  overflow: hidden;
  z-index: 5;               /* above bg-carousel, below menu   */
  pointer-events: none;
  user-select: none;
}
.marquee-track {
  display: inline-flex;
  white-space: nowrap;
  will-change: transform;
  animation: marquee-scroll 45s linear infinite;
}
.marquee-track > span {
  font-family: 'Roboto Mono', monospace;
  font-size: clamp(2.5rem, 7vw, 6rem);
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
  padding-right: 4rem;
  color: transparent;
  -webkit-text-stroke: 1px rgba(0, 0, 0, .22);
}
@keyframes marquee-scroll {
  to { transform: translateX(-50%); }
}

/* ─── 4) HOVER EFFECTS (desktop only — touch stays as the
        original site, so the burger menu is untouched) ──── */
@media (hover: hover) and (pointer: fine) {
  /* Underline sweep on menu links (left in, right out) */
  .main-menu a { position: relative; }
  .main-menu a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 100%;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform .35s cubic-bezier(.4, 0, .2, 1);
  }
  .main-menu a:hover::after,
  .main-menu a:focus-visible::after { transform: scaleX(1); transform-origin: left; }

  /* Number prefix lifts slightly on hover */
  .main-menu .num { transition: transform .3s ease, opacity .3s ease; }
  .main-menu a:hover .num { transform: translateY(-3px); opacity: 1; }

  /* Generic arrow-link hover (Artbim "View All" style) —
     usable on any page: <a class="hover-arrow">Text <span class="arr">↗</span></a> */
  .hover-arrow .arr {
    display: inline-block;
    transition: transform .35s cubic-bezier(.4, 0, .2, 1);
  }
  .hover-arrow:hover .arr { transform: translate(4px, -4px); }

  /* Menu label span (added by JS for the scramble effect) */
  .main-menu a .label { display: inline-block; }
}

/* ─── 6) CAD CROSSHAIR (index only) ─────────────────────── */
/* Crosshair + live coordinates following the mouse */
.hud {
  position: fixed;
  inset: 0;
  z-index: 900;                 /* over the scene, under menu & headline */
  pointer-events: none;
  opacity: 0;                   /* shown on first mouse move */
  display: none;
}
.hud-v {
  position: absolute; top: 0; left: 0;
  width: 1px; height: 100%;
  background: rgba(0, 0, 0, .16);
}
.hud-h {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 1px;
  background: rgba(0, 0, 0, .16);
}
.hud-readout {
  position: absolute; top: 0; left: 0;
  font-family: 'Roboto Mono', monospace;
  font-size: .65rem;
  letter-spacing: .12em;
  color: rgba(0, 0, 0, .45);
  white-space: nowrap;
}
@media (hover: hover) and (pointer: fine) {
  .hud { display: block; }
}

/* ─── 5) REDUCED MOTION ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
  html.js [data-reveal] { opacity: 1; }
  #preloader { display: none; }
  .hud { display: none; }
}

/* ─── 7) PHONES & TABLETS: behave like the original site ── */
/* No preloader, no hidden content — instant render on touch */
@media (hover: none), (pointer: coarse) {
  #preloader { display: none; }
  html.js [data-reveal] { opacity: 1; }
}
