/* Art of NOMA fun layer. Mobile first (375px), then 760px and 1100px. Loads after polish.css.
   Tokens come from polish.css: --nx-ink, --nx-cream, --nx-paper, --nx-sand, --nx-line, --nx-acid. */

/* ---------- Shared button base (beats theme button styles) ---------- */
body button.nx-fun-b,
body a.nx-fun-b{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;margin:0;padding:0 18px;border:1px solid var(--nx-ink);border-radius:999px;background:transparent;color:var(--nx-ink);font:500 14px/1 var(--noma-sans);letter-spacing:.01em;text-transform:none;text-decoration:none;white-space:nowrap;box-shadow:none;cursor:pointer;-webkit-appearance:none;appearance:none;transition:background-color .2s ease,color .2s ease,border-color .2s ease}
body button.nx-fun-b:hover,
body a.nx-fun-b:hover,
body button.nx-fun-b:focus-visible,
body a.nx-fun-b:focus-visible{background:var(--nx-acid);border-color:var(--nx-ink);color:#15110f;text-decoration:none;box-shadow:none}
body button.nx-fun-b:focus-visible,
body a.nx-fun-b:focus-visible{outline:2px solid var(--nx-ink);outline-offset:2px}
body button.nx-fun-b[hidden],
body a.nx-fun-b[hidden]{display:none}
.nx-fun-star{font-size:15px;line-height:1}

/* ---------- Surprise me: header button next to "See all works" ---------- */
.nx-fun-headtools{display:flex;flex-direction:column;align-items:flex-end;gap:10px}
@media(min-width:760px){.nx-fun-headtools{flex-direction:row;align-items:center;gap:18px}}
body button.nx-fun-surprise{min-height:44px}
@media(min-width:760px){body button.nx-fun-surprise{min-height:40px}}

/* ---------- Surprise me: floating pill ---------- */
body button.nx-fun-pill{position:fixed;right:16px;bottom:calc(16px + env(safe-area-inset-bottom,0px));z-index:900;min-height:44px;padding:0 18px;background:var(--nx-cream);border:1px solid var(--nx-line);box-shadow:0 6px 20px rgba(33,28,24,.14);opacity:0;visibility:hidden;transform:translateY(8px);transition:opacity .25s ease,transform .25s ease,visibility 0s linear .25s,background-color .2s ease,border-color .2s ease}
body button.nx-fun-pill.is-on{opacity:1;visibility:visible;transform:none;transition-delay:0s}
body button.nx-fun-pill:hover,
body button.nx-fun-pill:focus-visible{background:var(--nx-acid);border-color:var(--nx-ink);color:#15110f}

/* ---------- Surprise me: overlay ---------- */
html.nx-fun-lock,
html.nx-fun-lock body{overflow:hidden}
.nx-fun-ov{position:fixed;inset:0;z-index:99000;display:flex;overflow-y:auto;overscroll-behavior:contain;padding:64px 16px 24px;background:rgba(33,28,24,.96);background:color-mix(in srgb,var(--nx-ink) 96%,transparent);color:var(--nx-cream);opacity:0;visibility:hidden;transition:opacity .22s ease,visibility 0s linear .22s}
.nx-fun-ov.is-open{opacity:1;visibility:visible;transition-delay:0s}
.nx-fun-ov::before{content:"";position:fixed;inset:0;pointer-events:none;opacity:.07;mix-blend-mode:overlay;background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>")}
.nx-fun-ov-in{position:relative;width:min(960px,100%);margin:auto;display:flex;flex-direction:column;align-items:center;gap:18px;outline:0}
.nx-fun-stage{display:flex;align-items:center;justify-content:center;width:100%;min-height:30vh}
.nx-fun-img{display:block;max-width:100%;max-height:60vh;max-height:60dvh;width:auto;height:auto;object-fit:contain;box-shadow:0 18px 50px rgba(0,0,0,.45);opacity:1;transition:opacity .25s ease}
.nx-fun-img.is-loading{opacity:0}
.nx-fun-cap{text-align:center;max-width:42ch}
body .nx-fun-ov p.nx-fun-artist{margin:0 0 6px;font:600 12.5px/1.3 var(--noma-sans);letter-spacing:.14em;text-transform:uppercase;color:var(--nx-acid)}
body .nx-fun-ov h2.nx-fun-title{margin:0 0 8px;font:italic 400 clamp(24px,3.4vw,36px)/1.15 var(--noma-serif);letter-spacing:-.01em;color:var(--nx-cream)}
body .nx-fun-ov p.nx-fun-price{margin:0;font:500 16px/1.3 var(--noma-sans);color:rgba(252,251,249,.85)}
.nx-fun-acts{display:flex;flex-direction:column;gap:10px;width:100%}
body .nx-fun-ov button.nx-fun-b,
body .nx-fun-ov a.nx-fun-b{width:100%;border-color:rgba(252,251,249,.5);color:var(--nx-cream);background:transparent}
body .nx-fun-ov a.nx-fun-buy,
body .nx-fun-ov a.nx-fun-buy.nx-buy-now{background:var(--nx-acid);border-color:var(--nx-acid);color:var(--nx-ink);font-weight:600}
body .nx-fun-ov button.nx-fun-b:hover,
body .nx-fun-ov a.nx-fun-b:hover,
body .nx-fun-ov button.nx-fun-b:focus-visible,
body .nx-fun-ov a.nx-fun-b:focus-visible{background:var(--nx-cream);border-color:var(--nx-cream);color:#15110f}
body .nx-fun-ov button.nx-fun-b:focus-visible,
body .nx-fun-ov a.nx-fun-b:focus-visible{outline:2px solid var(--nx-acid);outline-offset:2px}
body .nx-fun-ov button.nx-fun-close{position:absolute;top:12px;right:12px;z-index:2;width:44px;min-width:44px;height:44px;padding:0;font-size:18px;border-radius:50%}
@media(min-width:760px){
  .nx-fun-ov{padding:72px 32px 32px}
  .nx-fun-img{max-height:70vh;max-height:70dvh}
  .nx-fun-acts{flex-direction:row;justify-content:center;width:auto}
  body .nx-fun-ov button.nx-fun-b,
  body .nx-fun-ov a.nx-fun-b{width:auto;min-width:170px}
  body .nx-fun-ov button.nx-fun-close{top:20px;right:24px;min-width:44px;width:44px}
}

/* ---------- Tonight / This weekend / Free ---------- */
.nx-fun-seg{display:flex;width:fit-content;max-width:100%;margin:0 0 20px;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;-webkit-overflow-scrolling:touch;border:1px solid var(--nx-ink);background:var(--nx-cream)}
.nx-fun-seg::-webkit-scrollbar{display:none}
body button.nx-fun-segbtn{flex:none;border:0;border-right:1px solid var(--nx-ink);border-radius:0;min-height:44px;padding:0 16px;background:transparent;color:var(--nx-ink)}
body button.nx-fun-segbtn:last-child{border-right:0}
body button.nx-fun-segbtn:hover,
body button.nx-fun-segbtn:focus-visible{background:var(--nx-acid);color:#15110f;border-color:var(--nx-ink)}
body button.nx-fun-segbtn:focus-visible{outline-offset:-4px}
body button.nx-fun-segbtn[aria-pressed="true"]{background:var(--nx-ink);color:var(--nx-acid)}
body button.nx-fun-segbtn[aria-pressed="true"]:hover{background:var(--nx-ink);color:var(--nx-cream)}
@media(min-width:760px){body button.nx-fun-segbtn{min-height:40px;padding:0 20px}}
.nx-evgrid > [hidden]{display:none!important}
.nx-evgrid > .nx-ev{transition:opacity .2s ease,transform .35s ease}
.nx-evgrid > .nx-ev.nx-fun-out{opacity:0}
body .nx-fun-empty{margin:14px 0 0;font:500 15px/1.4 var(--noma-sans)}
body .nx-fun-empty a{color:var(--nx-ink);background:linear-gradient(var(--nx-acid),var(--nx-acid)) 0 100%/100% 2px no-repeat;padding-bottom:2px;text-decoration:none}
body .nx-fun-empty a:hover{background-size:100% 100%}

/* ---------- Reveal on scroll (classes added by fun.js only when motion is allowed) ---------- */
.nx-reveal.nx-reveal{opacity:0;transform:translateY(14px);transition:opacity .5s ease-out,transform .5s ease-out;transition-delay:calc(var(--nx-i,0) * 40ms)}
.nx-reveal.nx-reveal.is-in{opacity:1;transform:none}
@media(prefers-reduced-motion:reduce),print{.nx-reveal.nx-reveal{opacity:1;transform:none;transition:none}}

/* ---------- Hover craft: images, lift, acid underline (gallery-grade, subtle) ---------- */
.nx-rail{padding-top:4px;margin-top:-4px}
.nx-work-img img,
.nx-artist-img img,
.nx-img img,
.nx-tile img,
.nx-mosaic a img,
.nw-card-img img,
.nx-rail a img{transition:transform .6s cubic-bezier(.2,.6,.2,1)}
.nx-ev-cover{isolation:isolate}
.nx-ev-cover::before{content:"";position:absolute;inset:0;z-index:-1;background:inherit;transition:transform .6s cubic-bezier(.2,.6,.2,1)}

.nx-ev h3 a,
.nx-work-title,
.nw-card-title,
.nx-artist-name,
.nx-story h3,
.nx-guide h3,
.nx-feat-title{display:block;width:fit-content;max-width:100%;align-self:flex-start;padding-bottom:2px;background-image:linear-gradient(var(--nx-acid),var(--nx-acid));background-repeat:no-repeat;background-position:0 100%;background-size:0 2px;transition:background-size .35s ease,color .2s ease}

@media(hover:hover){
  .nx-work:hover .nx-work-img img,
  .nx-artist:hover .nx-artist-img img,
  .nx-story a:hover .nx-img img,
  .nx-guide a:hover .nx-img img,
  .nx-tile:hover img,
  .nx-mosaic a:hover img,
  .nw-card:hover .nw-card-img img,
  .nx-rail a:hover img{transform:scale(1.04)}
  .nx-ev:hover .nx-ev-cover::before,
  .nx-ev-cover:hover::before{transform:scale(1.04)}

  .nx-ev:hover h3 a,
  .nx-work:hover .nx-work-title,
  .nw-card:hover .nw-card-title,
  .nx-artist:hover .nx-artist-name,
  .nx-story a:hover h3,
  .nx-guide a:hover h3,
  .nx-feat-card:hover .nx-feat-title{background-size:100% 2px}
  .noma .nx-story a:hover h3,
  .noma .nx-guide a:hover h3{text-decoration:none}
}
.nx-ev h3 a:focus-visible,
.nx-work-title:focus-visible,
.nw-card-title:focus-visible,
.nx-artist:focus-visible .nx-artist-name,
.nx-story a:focus-visible h3,
.nx-guide a:focus-visible h3,
.nx-feat-link:focus-visible .nx-feat-title{background-size:100% 2px}

@media(hover:hover) and (prefers-reduced-motion:no-preference){
  .nx-work,
  .nx-artist,
  .nx-story,
  .nx-guide,
  .nw-card,
  .nx-feat-card{transition:transform .35s ease}
  .nx-work:hover,
  .nx-artist:hover,
  .nx-story:hover,
  .nx-guide:hover,
  .nx-ev:hover,
  .nw-card:hover,
  .nx-feat-card:hover{transform:translateY(-2px)}
}

/* Video facades: a soft pulsing ring around the play control */
.noma-vplay-icon::before,
.nx-play::before{content:"";position:absolute;inset:-5px;border-radius:50%;border:2px solid var(--nx-acid);opacity:0;pointer-events:none}
.noma-vplay:focus-visible .noma-vplay-icon::before{opacity:.9}
@media(hover:hover){
  .noma-vplay:hover .noma-vplay-icon::before,
  .nx-video:hover .nx-play::before{opacity:.9}
}
@media(hover:hover) and (prefers-reduced-motion:no-preference){
  .noma-vplay:hover .noma-vplay-icon::before,
  .nx-video:hover .nx-play::before{animation:nx-fun-pulse 1.8s ease-out infinite}
}
@keyframes nx-fun-pulse{0%{transform:scale(.92);opacity:.85}100%{transform:scale(1.45);opacity:0}}

/* ---------- Reduced motion: no transitions, no animation from this layer ---------- */
@media(prefers-reduced-motion:reduce){
  .nx-fun-ov,
  .nx-fun-img,
  body button.nx-fun-pill,
  body button.nx-fun-b,
  body a.nx-fun-b,
  .nx-evgrid > .nx-ev,
  .nx-work-img img,
  .nx-artist-img img,
  .nx-img img,
  .nx-tile img,
  .nx-mosaic a img,
  .nw-card-img img,
  .nx-rail a img,
  .nx-ev-cover::before,
  .nx-ev h3 a,
  .nx-work-title,
  .nw-card-title,
  .nx-artist-name,
  .nx-story h3,
  .nx-guide h3,
  .nx-feat-title{transition:none!important}
  .noma-vplay-icon::before,
  .nx-play::before{animation:none!important}
}
