/* ============================================================
   Gregor Žnidaršič — ADVANCED FX layer
   Film grain · custom cursor · parallax · magnetic · reveals
   All additive & degradable; respects prefers-reduced-motion.
   ============================================================ */

/* ---------- Film grain overlay ---------- */
.fx-grain{
  position:fixed;inset:0;z-index:9990;pointer-events:none;
  opacity:.04;mix-blend-mode:normal;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.86' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size:200px 200px;
}

/* ---------- Custom cursor (fine pointers only) ---------- */
.fx-cursor,.fx-cursor-dot{position:fixed;top:0;left:0;z-index:10000;pointer-events:none;border-radius:50%;
  transform:translate(-50%,-50%);opacity:0;transition:opacity .4s ease}
.fx-cursor{width:42px;height:42px;border:1px solid var(--gold);
  transition:width .35s var(--ease),height .35s var(--ease),background-color .35s var(--ease),border-color .35s var(--ease),opacity .4s ease}
.fx-cursor-dot{width:5px;height:5px;background:var(--gold-deep)}
.fx-cursor-label{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%) scale(.6);
  font-family:var(--sans);font-size:.5rem;letter-spacing:.22em;text-transform:uppercase;color:#fff;
  white-space:nowrap;opacity:0;transition:opacity .3s,transform .35s var(--ease)}
body.fx-on-cursor.fx-ready{cursor:none}
body.fx-on-cursor.fx-ready a,
body.fx-on-cursor.fx-ready button,
body.fx-on-cursor.fx-ready summary,
body.fx-on-cursor.fx-ready .gitem,
body.fx-on-cursor.fx-ready input,
body.fx-on-cursor.fx-ready textarea{cursor:none}
.fx-cursor.is-hover{width:66px;height:66px;background:rgba(176,141,87,.12);border-color:var(--gold)}
.fx-cursor.is-media{width:94px;height:94px;background:rgba(23,19,17,.28);border-color:rgba(246,241,234,.7);backdrop-filter:blur(1px)}
.fx-cursor.is-media .fx-cursor-label{opacity:1;transform:translate(-50%,-50%) scale(1)}
.fx-cursor.is-down{transform:translate(-50%,-50%) scale(.82)}

/* ---------- Parallax ---------- */
[data-parallax]{will-change:transform}

/* ---------- Hero cinematic load reveal ---------- */
.hero__title .line-mask{display:block}            /* keep lines stacked even without FX */
.fx-ready .hero__content .line-mask{overflow:hidden}
.fx-ready .hero__content .line-inner{display:block;transform:translateY(110%);transition:transform 1.1s var(--ease)}
.fx-ready.loaded .hero__content .line-inner{transform:translateY(0)}
.fx-ready .hero__eyebrow,
.fx-ready .hero__sub,
.fx-ready .hero .btn,
.fx-ready .hero__scroll{opacity:0;transform:translateY(22px);transition:opacity 1s var(--ease),transform 1s var(--ease)}
.fx-ready.loaded .hero__eyebrow{opacity:1;transform:none;transition-delay:.15s}
.fx-ready.loaded .hero__title .line-inner{transition-delay:.35s}
.fx-ready.loaded .hero__sub{opacity:1;transform:none;transition-delay:.95s}
.fx-ready.loaded .hero .btn{opacity:1;transform:none;transition-delay:1.15s}
.fx-ready.loaded .hero__scroll{opacity:1;transform:none;transition-delay:1.5s}

/* ---------- Clip reveal for media ---------- */
.fx-media{clip-path:inset(0 0 100% 0);transition:clip-path 1.2s var(--ease)}
.fx-media.in{clip-path:inset(0 0 0 0)}

/* ---------- Line reveal for section headings (words) ---------- */
.fx-words .fx-word{display:inline-block;overflow:hidden;vertical-align:top}
.fx-words .fx-word > span{display:inline-block;transform:translateY(105%);transition:transform .9s var(--ease)}
.fx-words.in .fx-word > span{transform:translateY(0)}

/* ---------- Magnetic ---------- */
.fx-magnetic{will-change:transform}

/* ---------- Link underline sweep (nav + inline) ---------- */
.fx-ready .journal__all,.fx-ready .contact__line{position:relative}

/* ---------- Reduced motion / touch ---------- */
@media(hover:none),(pointer:coarse){
  .fx-cursor,.fx-cursor-dot{display:none!important}
  body.fx-on-cursor{cursor:auto!important}
}
@media(prefers-reduced-motion:reduce){
  .fx-grain{animation:none;opacity:.035}
  .fx-media{clip-path:none!important}
  .fx-words .fx-word > span{transform:none!important}
  .fx-ready .hero__content .line-inner{transform:none!important}
  .fx-ready .hero__eyebrow,.fx-ready .hero__sub,.fx-ready .hero .btn,.fx-ready .hero__scroll{opacity:1!important;transform:none!important}
  [data-parallax]{transform:none!important}
}
