/* ============================================================
   ADAYA — Cinematic scroll-motion system
   Scroll-scrubbed section transitions + Tweaks panel.
   Reveals are driven inline by scroll-motion.js (per-frame),
   so transitions on .reveal must be OFF while scrub is active.
   ============================================================ */

/* While the JS engine owns .reveal, kill the CSS transition so the
   per-frame inline values aren't smeared/lagged. */
html.motion-scrub .reveal{
  transition:none !important;
  will-change:transform,opacity,filter,clip-path;
}
/* Base hidden state before the engine's first pass paints (avoids flash).
   The engine sets inline styles immediately on init, so this is a brief
   safety net only. */
html.motion-scrub .reveal:not([data-mo-ready]){opacity:0}

/* Reduced-motion / engine-off: everything visible, no transforms. */
@media (prefers-reduced-motion:reduce){
  html.motion-scrub .reveal{opacity:1 !important;transform:none !important;filter:none !important;clip-path:none !important}
}

/* ---------- TWEAKS PANEL ---------- */
.mo-panel{
  position:fixed;right:20px;bottom:20px;z-index:9999;
  width:312px;max-width:calc(100vw - 40px);
  font-family:"Plus Jakarta Sans",system-ui,sans-serif;
  color:var(--text);
  background:var(--glass-thick);
  -webkit-backdrop-filter:blur(26px) saturate(170%);
  backdrop-filter:blur(26px) saturate(170%);
  border:1px solid var(--glass-border);
  border-radius:20px;
  box-shadow:var(--elev-4),var(--glass-hi);
  padding:18px 18px 16px;
  opacity:0;visibility:hidden;transform:translateY(14px) scale(.985);
  transition:opacity .3s var(--ease),transform .3s var(--ease),visibility .3s;
}
.mo-panel.open{opacity:1;visibility:visible;transform:none}

.mo-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px}
.mo-title{display:flex;align-items:center;gap:9px;font-weight:700;font-size:1.02rem;letter-spacing:-.01em}
.mo-title .dot{width:8px;height:8px;border-radius:50%;background:var(--grad-core);box-shadow:0 0 10px var(--sky)}
.mo-close{width:30px;height:30px;border-radius:9px;display:flex;align-items:center;justify-content:center;
  background:transparent;border:1px solid var(--glass-border);color:var(--text-2);cursor:pointer;transition:all .2s var(--ease)}
.mo-close:hover{color:var(--text);border-color:var(--border-strong);background:color-mix(in srgb,var(--sapphire) 10%,transparent)}
.mo-close svg{width:15px;height:15px}

.mo-sub{font-family:"IBM Plex Mono",monospace;font-size:.66rem;letter-spacing:.08em;text-transform:uppercase;
  color:var(--text-3);margin-bottom:16px}

.mo-group{margin-top:16px}
.mo-label{display:flex;align-items:center;justify-content:space-between;
  font-size:.74rem;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--text-3);margin-bottom:9px}
.mo-label .val{font-family:"IBM Plex Mono",monospace;color:var(--text-brand);text-transform:none;letter-spacing:0}

/* segmented style picker */
.mo-seg{display:grid;grid-template-columns:1fr 1fr;gap:7px}
.mo-seg button{
  appearance:none;cursor:pointer;text-align:left;
  padding:10px 11px;border-radius:11px;
  background:var(--glass-thin);border:1px solid var(--glass-border);
  color:var(--text-2);font-weight:600;font-size:.86rem;transition:all .18s var(--ease)}
.mo-seg button .mo-mini{display:block;font-family:"IBM Plex Mono",monospace;font-size:.6rem;font-weight:500;
  color:var(--text-3);margin-top:2px;letter-spacing:.02em}
.mo-seg button:hover{color:var(--text);border-color:var(--border-strong)}
.mo-seg button.active{
  color:#fff;border-color:transparent;
  background:var(--grad-cta);box-shadow:0 6px 16px rgba(26,132,242,.32)}
.mo-seg button.active .mo-mini{color:rgba(255,255,255,.82)}

/* slider */
.mo-range{-webkit-appearance:none;appearance:none;width:100%;height:6px;border-radius:999px;
  background:linear-gradient(90deg,var(--sapphire) var(--fill,50%),var(--glass-border) var(--fill,50%));
  outline:none;cursor:pointer}
.mo-range::-webkit-slider-thumb{-webkit-appearance:none;width:18px;height:18px;border-radius:50%;
  background:#fff;border:2px solid var(--sapphire);box-shadow:0 2px 8px rgba(26,132,242,.4);cursor:pointer}
.mo-range::-moz-range-thumb{width:18px;height:18px;border-radius:50%;background:#fff;border:2px solid var(--sapphire);
  box-shadow:0 2px 8px rgba(26,132,242,.4);cursor:pointer}

/* toggle row */
.mo-toggle{display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:11px 0;border-top:1px solid var(--border)}
.mo-toggle .mo-tinfo .t{font-weight:600;font-size:.9rem}
.mo-toggle .mo-tinfo .d{font-size:.74rem;color:var(--text-3);margin-top:1px}
.mo-switch{position:relative;width:44px;height:25px;border-radius:999px;flex-shrink:0;cursor:pointer;
  background:var(--glass-border);border:1px solid var(--border-strong);transition:background .22s var(--ease)}
.mo-switch::after{content:"";position:absolute;top:2px;left:2px;width:19px;height:19px;border-radius:50%;
  background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.3);transition:transform .22s var(--ease)}
.mo-switch.on{background:var(--grad-cta);border-color:transparent}
.mo-switch.on::after{transform:translateX(19px)}

@media (max-width:540px){
  .mo-panel{right:12px;left:12px;bottom:12px;width:auto}
}
