/* Explicit automatic ambient effects, after the quiet premium theme.
   Decorative layers only: text, chart values, cards and hit targets stay still. */
@media screen {
  body.crm-motion-on :is(#homeBoard,#orgView,#fullOrgView,#activityPerformanceView) .crm-scene::before,
  body.crm-motion-on :is(#orgView,#fullOrgView,#activityPerformanceView) .crm-scene::after,
  body.crm-motion-on :is(#orgView,#fullOrgView,#activityPerformanceView) .crm-scene-visual::before,
  body.crm-motion-on :is(#orgView,#fullOrgView,#activityPerformanceView) .crm-scene-visual::after,
  body.crm-motion-on :is(#orgView,#fullOrgView,#activityPerformanceView) :is(.crm-orbit,.crm-spark),
  body.crm-motion-on #homeBoard :is(.hb-period,.hb-rank-card,.hb-honors)::before,
  body.crm-motion-on #homeBoard :is(.hb-rank-card,.hb-honors)::after,
  body.crm-motion-on #homeBoard .hb-rank-row[data-hb-rank="1"]::after { display:block;pointer-events:none; }

  body.crm-motion-on :is(#orgView,#fullOrgView,#activityPerformanceView) .crm-scene::after {
    content:"";position:absolute;inset:auto 0 0;z-index:1;
    background:linear-gradient(90deg,transparent 8%,#c9a34a66 32%,#fff0ba 49%,#c9a34a66 65%,transparent 90%);
    background-size:220% 100%;
  }
  body :is(#orgView,#fullOrgView,#activityPerformanceView) .crm-scene .crm-scene-visual {
    display:block;width:174px;height:174px;right:36px;top:45%;opacity:.95;
  }
  body :is(#orgView,#fullOrgView,#activityPerformanceView) .crm-emblem {
    inset:24%;border:1px solid #edcb7999;border-radius:24%;
    background:linear-gradient(135deg,#e4bf653d,#72541fbd 40%,#14213df5 90%);
    box-shadow:inset 2px 2px 7px #ffefb840,inset -4px -4px 9px #0007,6px 7px 0 #49381d,7px 9px 0 #d4b36966,12px 18px 24px #0007;
    transform:rotate(-8deg) rotateY(-18deg);
  }
  body.crm-motion-on :is(#orgView,#fullOrgView,#activityPerformanceView) .crm-emblem {
    animation:crm-effects-emblem 7s ease-in-out infinite alternate;
  }
  body :is(#orgView,#fullOrgView,#activityPerformanceView) .crm-emblem-mark {
    font-size:54px;letter-spacing:-3px;color:#fff0c2;text-shadow:1px 2px 0 #8d692d,3px 4px 12px #0008;
  }
  body :is(#orgView,#fullOrgView,#activityPerformanceView) .crm-emblem-word { font-size:6px;letter-spacing:1.4px;color:#f2dba3; }
  body .crm-orbit { border-color:#c9a34a88;box-shadow:0 0 13px #c9a34a40,inset 0 0 10px #c9a34a20; }
  body .crm-orbit.orbit-a { border-top-color:#fff3c8;border-bottom-color:#6f5325; }
  body .crm-orbit.orbit-b { border-color:#e4bf6570;border-left-color:#fff0c1; }
  body .crm-orbit.orbit-c { border-color:#d8c3a560; }
  body .crm-spark,body .crm-spark.s2 { background:#ffe7a5;box-shadow:0 0 13px #e4bf65; }

  body #homeBoard :is(.hb-period,.hb-rank-card,.hb-honors) { position:relative;isolation:isolate; }
  body.crm-motion-on #homeBoard .hb-period::before,
  body.crm-motion-on #homeBoard .hb-honors::before {
    content:"";position:absolute;inset:0 6% auto;height:2px;width:auto;z-index:1;pointer-events:none;
    background:linear-gradient(90deg,transparent 5%,#c9a34a66 29%,#fff0b9 49%,#c9a34a88 60%,transparent 90%);background-size:230% 100%;
  }
  body.crm-motion-on #homeBoard .hb-crown { animation:crm-luxe-crown 4.8s ease-in-out infinite alternate !important; }
  body.crm-motion-on #homeBoard .hb-period .hb-rank-row[data-hb-rank="1"]::after {
    z-index:0;opacity:.38;
  }
  body #homeBoard .hb-period .hb-rank-row[data-hb-rank="1"]>* { position:relative;z-index:1; }

  body.crm-motion-on #activityPerformanceView :is(.ap-card,.ap-donut-card)::before {
    display:block;content:"";position:absolute;inset:0 8% auto;height:2px;pointer-events:none;
    background:linear-gradient(90deg,transparent 8%,#c9a34a55 28%,#ffedac 49%,#c9a34a66 62%,transparent 88%);background-size:230% 100%;
    animation:crm-luxe-stream 8s linear infinite;
  }
  body.crm-motion-on #activityPerformanceView .ap-ring::before {
    display:block;content:"";position:absolute;inset:-6px;border:1px solid #c9a34a66;border-radius:50%;pointer-events:none;
    animation:crm-luxe-ring 6s ease-in-out infinite alternate;
  }

  /* Subtle moving highlights on the shared shell and other existing headings. */
  body .workspace>.app-topbar,
  body :is(.target-unified-heading,.recruit-heading,.collection-heading,.med-head,.inc-heading,.sit-heading) { position:relative;isolation:isolate; }
  body.crm-motion-on .workspace>.app-topbar::after,
  body.crm-motion-on :is(.target-unified-heading,.recruit-heading,.collection-heading,.med-head,.inc-heading,.sit-heading)::after {
    display:block;content:"";position:absolute;inset:auto 7% 0;height:1px;z-index:0;pointer-events:none;
    background:linear-gradient(90deg,transparent 5%,#c9a34a55 34%,#fff1ba 50%,#c9a34a55 66%,transparent 95%);background-size:240% 100%;
    animation:crm-luxe-stream 10s linear infinite;
  }
  body.crm-motion-off .workspace>.app-topbar::after,
  body.crm-motion-off :is(.target-unified-heading,.recruit-heading,.collection-heading,.med-head,.inc-heading,.sit-heading)::after { animation:none; }
  body.crm-motion-on #dbView .db-console::before {
    display:block;content:"";background-image:linear-gradient(#c9a34a06 1px,transparent 1px),linear-gradient(90deg,#c9a34a06 1px,transparent 1px);background-size:32px 32px;
  }
  body.crm-motion-on #dbView .db-console::after {
    display:block;content:"";width:24%;opacity:1;
    background:linear-gradient(90deg,transparent,#fff0b9,#c9a34a,transparent);box-shadow:0 0 13px #c9a34a66;
    animation:db-edge-flow 14s ease-in-out infinite;
  }
  body.crm-motion-off #dbView .db-console::after { animation:none;display:none; }
  body.crm-motion-on .app-nav nav button.active { animation:crm-effects-nav 6s ease-in-out infinite alternate; }

  /* Keep the owner's explicit autoplay choice, including reduced-motion PCs.
     Limit motion to ornamentation; do not re-enable page-entry translations. */
  body.crm-motion-on #homeBoard .cc-home-hero::after { animation:cc-light-pass 12s ease-in-out infinite; }
  body #centralAccessGate.ca-cinematic:not(.ca-account-view):not(.ca-effects-paused)::before {
    animation:ca-cinematic-light 14s ease-in-out infinite alternate !important;
  }
  @keyframes crm-effects-emblem {
    from { transform:translateY(5px) rotate(-8deg) rotateY(-18deg); }
    to { transform:translateY(-5px) rotate(5deg) rotateY(22deg); }
  }
  @keyframes crm-effects-nav {
    from { box-shadow:inset 2px 0 #c9a34a,inset 0 0 10px #c9a34a04; }
    to { box-shadow:inset 3px 0 #efd38b,inset 0 0 20px #c9a34a16; }
  }
}
@media screen and (max-width:650px) {
  body :is(#orgView,#fullOrgView,#activityPerformanceView) .crm-scene .crm-scene-visual {
    display:block;width:102px;height:102px;right:12px;top:64px;opacity:.82;
  }
  body :is(#orgView,#fullOrgView,#activityPerformanceView) .crm-emblem-mark { font-size:33px;letter-spacing:-2px; }
  body :is(#orgView,#fullOrgView,#activityPerformanceView) .crm-emblem-word { font-size:4px;letter-spacing:.5px; }
  body :is(#orgView .org-heading>div:first-child,#fullOrgView .fog-board-head>div:first-child) { max-width:calc(100% - 95px); }
}
@media print {
  body :is(#orgView,#fullOrgView,#activityPerformanceView) .crm-scene-visual,
  body :is(#homeBoard,#orgView,#fullOrgView,#activityPerformanceView) ::before,
  body :is(#homeBoard,#orgView,#fullOrgView,#activityPerformanceView) ::after { animation:none !important; }
}
