/* RGB.ir Awwwards SOTY Core Layer (v4.0.0)
 * - Sentient 3D Optical Prism-Bot Companion (#rpc-dock-btn)
 * - Global Optical Glass Caustic & Magnetic Specular System
 * - Real-Time WebGL Shader Backdrop Layering & WCAG Pause Controls
 * - MWG Group Element View Transitions (document.startViewTransition)
 * Strictly 0 single-edge colored stripes, 0 px font-size, 0 RTL letter-spacing.
 */

@property --rgbe-bot-spin {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

@keyframes rgbe-bot-orbit {
  to { --rgbe-bot-spin: 360deg; }
}

@keyframes rgbe-bot-float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -4px, 0); }
}

/* 1. Sentient 3D Optical Prism-Bot Companion (#rpc-dock-btn) */
#rpc-dock-btn.rgbe-bot-ready {
  width: 66px;
  height: 66px;
  border-radius: 22px;
  background: radial-gradient(85% 85% at 30% 18%, rgba(30, 42, 78, .92), rgba(7, 10, 20, .98));
  border: 1px solid rgba(255, 255, 255, .2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .28),
    0 18px 46px -8px rgba(0, 0, 0, .82),
    0 0 28px -4px var(--rpc-a, rgba(77, 159, 255, .48));
  overflow: visible;
  isolation: isolate;
}
#rpc-dock-btn.rgbe-bot-ready > svg {
  display: none !important;
}
#rpc-dock-btn.rgbe-bot-ready::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 24px;
  padding: 2px;
  background: conic-gradient(
    from var(--rgbe-bot-spin, 0deg),
    rgba(255, 77, 106, .85),
    rgba(176, 107, 255, .9),
    rgba(77, 159, 255, .95),
    rgba(46, 230, 168, .9),
    rgba(255, 77, 106, .85)
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: .72;
  pointer-events: none;
  z-index: 0;
}
#rpc-dock-btn.rgbe-bot-ready::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 30px;
  background: radial-gradient(circle, var(--rpc-a, rgba(77, 159, 255, .36)), transparent 68%);
  opacity: .55;
  pointer-events: none;
  z-index: -1;
}
.rgbe-bot-cv {
  position: relative;
  z-index: 2;
  width: 64px;
  height: 64px;
  display: block;
  border-radius: 20px;
  pointer-events: none;
}
.rgbe-bot-status {
  position: absolute;
  top: -3px;
  inset-inline-start: -3px;
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: var(--green, #2ee6a8);
  border: 2px solid #07090f;
  box-shadow: 0 0 12px rgba(46, 230, 168, .9);
  z-index: 4;
  pointer-events: none;
}
.rgbe-bot-greet {
  position: absolute;
  bottom: calc(100% + 10px);
  inset-inline-end: 0;
  white-space: nowrap;
  padding: 7px 13px;
  border-radius: var(--r-pill, 999px);
  border: 1px solid rgba(255, 255, 255, .2);
  background: rgba(9, 13, 25, .92);
  backdrop-filter: blur(18px) saturate(165%);
  -webkit-backdrop-filter: blur(18px) saturate(165%);
  color: var(--text, #eef1f8);
  font-size: .78rem;
  font-weight: 800;
  box-shadow: 0 14px 36px -10px rgba(0, 0, 0, .78);
  opacity: 0;
  transform: translate3d(0, 6px, 0) scale(.94);
  pointer-events: none;
  z-index: 5;
}
#rpc-dock-btn.rgbe-bot-ready:hover .rgbe-bot-greet,
#rpc-dock-btn.rgbe-bot-ready:focus-visible .rgbe-bot-greet,
#rpc-dock-btn.rgbe-bot-ready.is-greet .rgbe-bot-greet {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}
@media (prefers-reduced-motion: no-preference) {
  #rpc-dock-btn.rgbe-bot-ready {
    animation: rgbe-bot-float 4.2s ease-in-out infinite;
    transition: transform .26s ease-out, box-shadow .26s ease-out;
    transition-timing-function: linear(0, .38 14%, 1.05 44%, .99 72%, 1), ease-out;
  }
  #rpc-dock-btn.rgbe-bot-ready::before {
    animation: rgbe-bot-orbit 5.2s linear infinite;
  }
  #rpc-dock-btn.rgbe-bot-ready:hover {
    animation-play-state: paused;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .36),
      0 22px 54px -6px rgba(0, 0, 0, .86),
      0 0 38px -2px var(--rpc-a, rgba(77, 159, 255, .68));
  }
  .rgbe-bot-greet {
    transition: opacity .24s ease, transform .28s cubic-bezier(.22, 1, .36, 1);
  }
}
@media (max-width: 640px) {
  #rpc-dock-btn.rgbe-bot-ready {
    width: 56px;
    height: 56px;
    border-radius: 18px;
  }
  #rpc-dock-btn.rgbe-bot-ready::before { border-radius: 20px; }
  .rgbe-bot-cv { width: 54px; height: 54px; border-radius: 16px; }
  .rgbe-bot-greet { display: none; }
}

/* 2. Global Optical Caustic Reflection on Interactive Glass Surfaces */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .rgbe-glare-on {
    position: relative;
    background-image: radial-gradient(
      340px circle at var(--gx, 50%) var(--gy, 20%),
      rgba(130, 180, 255, .13),
      rgba(46, 230, 168, .05) 36%,
      transparent 70%
    );
  }
  .rgbe-tilt-card {
    transform-style: preserve-3d;
    will-change: transform;
  }
}

/* 3. Real-Time GLSL WebGL Shader Surface Layering */
.rgbe-webgl-host {
  position: relative !important;
  overflow: hidden !important;
  isolation: isolate;
}
.rgbe-webgl-cv {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  display: block !important;
  pointer-events: none !important;
  z-index: 0 !important;
  border-radius: inherit;
  opacity: .84;
}
.rgbe-webgl-host > :not(.rgbe-webgl-cv):not(.rgbe-aurora-cv):not(.rgbe-aurora-pause):not(.rgbe-gl-pause) {
  position: relative;
  z-index: 2;
}
.rgbe-gl-pause {
  position: absolute !important;
  inset-block-start: 12px;
  inset-inline-end: 12px;
  z-index: 5 !important;
  width: 32px;
  height: 32px;
  border-radius: var(--r-pill, 999px);
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(7, 9, 15, .62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text-2, #a9b1c3);
  font: inherit;
  font-size: .74rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.rgbe-gl-pause:hover {
  border-color: rgba(255, 255, 255, .36);
  color: var(--text, #eef1f8);
}

/* 4. Interactive 3D Stage Frames (Zero-CLS Explicit Geometry) */
.rgbe-3d-wrap {
  position: relative;
  border-radius: var(--r-md, 18px);
  border: 1px solid var(--border, rgba(255, 255, 255, .11));
  background: radial-gradient(95% 95% at 50% 10%, rgba(28, 44, 88, .36), rgba(5, 7, 13, .92));
  overflow: hidden;
  isolation: isolate;
}
.rgbe-3d-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: pan-y;
}
.rgbe-3d-canvas:active { cursor: grabbing; }

.rgbe-3d-hud {
  position: absolute;
  inset-block-start: 12px;
  inset-inline-start: 12px;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  pointer-events: none;
  max-width: calc(100% - 64px);
}
.rgbe-3d-pill {
  padding: 4px 10px;
  border-radius: var(--r-pill, 999px);
  border: 1px solid rgba(255, 255, 255, .15);
  background: rgba(7, 9, 15, .72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text-2, #a9b1c3);
  font-size: .72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.rgbe-3d-pill strong { color: var(--green, #2ee6a8); font-weight: 800; }
@media (max-width: 640px) {
  .rgbe-3d-hud { inset-block-start: 8px; inset-inline-start: 8px; gap: 4px; max-width: calc(100% - 16px); }
  .rgbe-3d-pill { padding: 3px 8px; font-size: .66rem; }
  .rgbe-3d-hide-sm { display: none !important; }
}
.rgbe-bot-mini-cv {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: block;
  flex: none;
}

.rgbe-3d-tip {
  position: absolute;
  z-index: 6;
  max-width: 240px;
  padding: 11px 14px;
  border-radius: var(--r-sm, 14px);
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(8, 12, 24, .92);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 18px 46px -10px rgba(0, 0, 0, .82);
  color: var(--text, #eef1f8);
  font-size: .78rem;
  line-height: 1.5;
  pointer-events: none;
}
.rgbe-3d-tip strong { display: block; font-size: .88rem; margin-bottom: 4px; }
.rgbe-3d-tip span { display: block; color: var(--text-2, #a9b1c3); }

/* 5. MWG Group Element View Transitions (document.startViewTransition) */
:root { view-transition-name: none; }
::view-transition { pointer-events: none; }
.rgbe-vt-card { view-transition-class: rgbe-vt-card; }
::view-transition-group(.rgbe-vt-card) {
  animation-duration: .42s;
  animation-timing-function: ease-out;
  animation-timing-function: linear(0, .38 14%, 1.03 44%, .99 74%, 1);
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

/* 6. Optical SERP Scanning Beam + Victory Sparkles */
@keyframes rgbe-scan-beam {
  0% { transform: translateX(-120%); opacity: 0; }
  20% { opacity: .8; }
  80% { opacity: .8; }
  100% { transform: translateX(220%); opacity: 0; }
}
.rgbe-g-card { position: relative; overflow: hidden; }
.rgbe-g-card.is-optimal {
  box-shadow: 0 0 0 1px rgba(46, 230, 168, .48), 0 22px 54px -16px rgba(46, 230, 168, .28);
}
@media (prefers-reduced-motion: no-preference) {
  .rgbe-g-card.is-scanning::after {
    content: "";
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    width: 45%;
    background: linear-gradient(90deg, transparent, rgba(77, 159, 255, .22), rgba(46, 230, 168, .28), transparent);
    pointer-events: none;
    animation: rgbe-scan-beam .9s ease-out 1 both;
  }
}

@media (forced-colors: active) {
  #rpc-dock-btn.rgbe-bot-ready { border: 2px solid CanvasText; }
  .rgbe-3d-wrap { border: 1px solid CanvasText; }
}
