/* ORYQON MOTION: styles for the GSAP layer. EVERY rule is scoped by html.fx-<flag> (set by js/motion-config.js), so with a flag off (or ?motion=off, or
   reduced motion) this file adds nothing. Palette: existing tokens only (amber --c, rose-gold --v/--v2, burgundy). Only transform/opacity/clip-path are animated. */

/* ---- anti-flash: while the motion layer is starting, first-screen reveal targets are held invisible (layout kept). Released by motion-boot.js (failsafe 3.2 s). ---- */
html.fx-hold .rv, html.fx-hold .rv-img, html.fx-hold #logoMarquee .logos li { visibility: hidden; }
/* GSAP-owned reveal targets: visible by default (so a reverted/failed effect never leaves content hidden); GSAP writes the start state inline, then hands back to CSS (.in). */
.js .rv.gs-own { opacity: 1; transform: none; }
.js .rv-img.gs-own { clip-path: none; }
.js .rv.gs-own:not(.in), .js .rv-img.gs-own:not(.in) { transition: none; }
html.fx-heroText #hero .rv { transition: none; }

/* ---- split text (heading + hero): masks keep italic overhangs and descenders inside overflow:clip ---- */
.gs-mask { padding-block: .14em .2em; margin-block: -.14em -.2em; padding-inline: .06em; margin-inline: -.06em; }
.gs-line { display: block; }
.gs-word, .gs-char { will-change: transform; }
/* <em> headline words use background-clip:text gradients; SplitText wraps pieces in inline-blocks, so paint the gradient on every piece */
html.fx-heroText #hero h1 em .gs-char, html.fx-heroText #hero h1 em .gs-word { background: inherit; -webkit-background-clip: text; background-clip: text; color: transparent; }
html.fx-headings #game h2 em .gs-word, html.fx-headings #game h2 em .gs-char { background: inherit; -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---- hero ---- */
html.fx-heroParallax .hero-in { will-change: transform, opacity; }

/* ---- magnetic: the CSS hover lift would fight the GSAP transform every frame ---- */
html.fx-magnetic .hero-cta .btn, html.fx-magnetic #gameEnter, html.fx-magnetic #agent .agent-copy .btn.primary { transition: border-color .3s, background .3s, box-shadow .3s; }
html.fx-magnetic .hero-cta .btn:hover, html.fx-magnetic #gameEnter:hover, html.fx-magnetic #agent .agent-copy .btn.primary:hover { transform: none; }

/* ---- logo ribbon (replaces the CSS marquee animation while active; the CSS marquee stays as the fallback) ---- */
.marquee.gs-ribbon .track { animation: none; will-change: transform; }
.marquee.gs-ribbon { touch-action: pan-y; cursor: grab; }
.marquee.gs-ribbon.grabbing { cursor: grabbing; }
.marquee.gs-ribbon .logos a { -webkit-user-drag: none; user-select: none; }
.marquee.gs-ribbon .logos img { -webkit-user-drag: none; }
html.fx-logoHover .logos .mk { transform-origin: 50% 60%; transition: background-color .35s, opacity .35s; }
html.fx-logoHover .logos a:hover .mk, html.fx-logoHover .logos a:focus-visible .mk { background: var(--c); opacity: 1; }
[data-theme="light"].fx-logoHover .logos a:hover .mk, [data-theme="light"].fx-logoHover .logos a:focus-visible .mk { background: #9A4F14; }
html.fx-logoHover .logos:has(a:hover) li:not(:hover) .mk, html.fx-logoHover .logos:has(a:focus-visible) li:not(:has(a:focus-visible)) .mk { opacity: .38; }

/* ---- services: GSAP does the panel entrance (the SVG build-up inside the figure stays CSS) ---- */
html.fx-services .sv-panel.on .sv-fig, html.fx-services .sv-panel.on [style*="--k"] { animation: none; }
html.fx-services .sv-fig { will-change: clip-path; }

/* ---- talk to oryqon ---- */
html.fx-talk .agent-cta .ring { display: none; }
html.fx-talk .agent-cta { overflow: hidden; }
html.fx-talk .agent-cta .mic { overflow: visible; will-change: transform; }
.gs-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(255,255,255,.55); pointer-events: none; opacity: 0; will-change: transform, opacity; }
[data-theme="light"] .gs-ring { border-color: rgba(251,248,242,.7); }
html.fx-talk .agent-cta .mic svg { overflow: visible; }
html.fx-talk .agent-cta .mic svg rect, html.fx-talk .agent-cta .mic svg path { transform-box: fill-box; transform-origin: 50% 50%; }
.gs-bars { position: absolute; inset-inline: -70px; top: 50%; display: flex; justify-content: space-between; pointer-events: none; opacity: 0; direction: ltr; }
.gs-bars i { display: block; width: 3px; height: 22px; border-radius: 2px; background: rgba(255,255,255,.7); transform: scaleY(.2); transform-origin: 50% 50%; margin-top: -11px; }
html.fx-talk .agent-cta[aria-pressed="true"] .gs-bars { opacity: 1; }
@media (max-width: 560px) { .gs-bars { display: none; } }

/* ---- theme toggle circular reveal ---- */
html.gs-vt-theme::view-transition-old(root), html.gs-vt-theme::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
html.gs-vt-theme::view-transition-old(root) { z-index: 1; }
html.gs-vt-theme::view-transition-new(root) { z-index: 2; }

/* ---- footer parallax ---- */
html.fx-footer .foot-sun, html.fx-footer .foot-art, html.fx-footer .wordmark { will-change: transform; }

/* ---- session-once intro (off by default) ---- */
html.fx-intro-pending { background: #1A0A0E; }
html.fx-intro-pending body { overflow: hidden; }
html.fx-intro-pending main, html.fx-intro-pending header.nav, html.fx-intro-pending footer, html.fx-intro-pending .progress { visibility: hidden; }
#gsIntro { position: fixed; inset: 0; z-index: 1000; background: #1A0A0E; display: grid; place-items: center; color: #F5F0E8; direction: ltr; }
#gsIntro .stage { position: relative; width: min(560px, 86vw); aspect-ratio: 560/360; }
#gsIntro svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; fill: none; stroke: #D9B08C; stroke-width: 1.6; stroke-linecap: round; }
#gsIntro .mk { position: absolute; left: 50%; top: 50%; width: clamp(96px, 16vw, 150px); aspect-ratio: 960/780; translate: -50% -52%; background: var(--foil-grad, linear-gradient(120deg,#9B6A52,#F6DDB8,#B76E79)); -webkit-mask: url(../assets/brand/oryqon-logo-mask.png) center/contain no-repeat; mask: url(../assets/brand/oryqon-logo-mask.png) center/contain no-repeat; opacity: 0; }
#gsIntro .skip-intro { position: absolute; inset-block-end: max(22px, env(safe-area-inset-bottom)); inset-inline-end: max(22px, env(safe-area-inset-right)); font: 500 12px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: #E6CFAE; background: transparent; border: 1px solid rgba(230,207,174,.4); border-radius: 999px; padding: 10px 16px; cursor: pointer; }
#gsIntro .skip-intro:focus-visible { outline: 2px solid #F2B27A; outline-offset: 3px; }
html[lang="ar"] #gsIntro .skip-intro { letter-spacing: 0; text-transform: none; font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
  html.fx-hold .rv, html.fx-hold .rv-img, html.fx-hold #logoMarquee .logos li { visibility: visible; }
  #gsIntro, .gs-ring, .gs-bars { display: none; }
}
